nouveau/ws: assert on broken channel
authorKarol Herbst <kherbst@redhat.com>
Tue, 14 Jun 2022 23:44:42 +0000 (01:44 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:31:54 +0000 (21:31 +0000)
no point in continuing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/winsys/nouveau_push.c

index 547f908..851eadf 100644 (file)
@@ -1,5 +1,6 @@
 #include "nouveau_push.h"
 
+#include <errno.h>
 #include <nouveau_drm.h>
 #include <nouveau/nouveau.h>
 #include <sys/mman.h>
@@ -150,7 +151,12 @@ nouveau_ws_push_submit(
    req.nr_push = 1;
    req.push = (uintptr_t)&req_push;
 
-   return drmCommandWriteRead(pdev->fd, DRM_NOUVEAU_GEM_PUSHBUF, &req, sizeof(req));
+   int ret = drmCommandWriteRead(pdev->fd, DRM_NOUVEAU_GEM_PUSHBUF, &req, sizeof(req));
+
+   /* TODO: later we want to report that the channel is gone, but for now just assert */
+   assert(ret != -ENODEV);
+
+   return ret;
 }
 
 void