Skip to content
Snippets Groups Projects
Commit 678a32b9 authored by Karol Herbst's avatar Karol Herbst :crab:
Browse files

nouveau: add ioctl wrapper to check for dead channels


v2: explicitly set nr_push to 0 as well

Signed-off-by: Karol Herbst's avatarKarol Herbst <kherbst@redhat.com>
parent d95b12e7
Branches
Tags
1 merge request!188nouveau: add ioctl wrapper to check for dead channels
Pipeline #575960 passed
...@@ -12,6 +12,7 @@ nouveau_bufctx_mthd ...@@ -12,6 +12,7 @@ nouveau_bufctx_mthd
nouveau_bufctx_new nouveau_bufctx_new
nouveau_bufctx_refn nouveau_bufctx_refn
nouveau_bufctx_reset nouveau_bufctx_reset
nouveau_check_dead_channel
nouveau_client_del nouveau_client_del
nouveau_client_new nouveau_client_new
nouveau_device_del nouveau_device_del
......
...@@ -273,4 +273,8 @@ struct nv04_notify { ...@@ -273,4 +273,8 @@ struct nv04_notify {
uint32_t offset; uint32_t offset;
uint32_t length; uint32_t length;
}; };
bool
nouveau_check_dead_channel(struct nouveau_drm *, struct nouveau_object *chan);
#endif #endif
...@@ -782,3 +782,19 @@ nouveau_pushbuf_kick(struct nouveau_pushbuf *push, struct nouveau_object *chan) ...@@ -782,3 +782,19 @@ nouveau_pushbuf_kick(struct nouveau_pushbuf *push, struct nouveau_object *chan)
pushbuf_flush(push); pushbuf_flush(push);
return pushbuf_validate(push, false); return pushbuf_validate(push, false);
} }
drm_public bool
nouveau_check_dead_channel(struct nouveau_drm *drm, struct nouveau_object *chan)
{
struct drm_nouveau_gem_pushbuf req = {};
struct nouveau_fifo *fifo = chan->data;
int ret;
req.channel = fifo->channel;
req.nr_push = 0;
ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_GEM_PUSHBUF,
&req, sizeof(req));
/* nouveau returns ENODEV once the channel was killed */
return ret == -ENODEV;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment