[Mesa-dev] [PATCH] radeon/winsys: correct RADEON_GEM_WAIT_IDLE use

Jonathan Gray jsg at jsg.id.au
Thu Jun 6 04:23:41 PDT 2013


On Thu, Jun 06, 2013 at 11:30:50AM +0200, Michel Dänzer wrote:
> On Mit, 2013-06-05 at 15:00 +1000, Jonathan Gray wrote:
> > RADEON_GEM_WAIT_IDLE is declared DRM_IOW but mesa
> > uses it with drmCommandWriteRead instead of drmCommandWrite
> > which leads to the ioctl being unmatched and returning an
> > error on at least OpenBSD.
> > 
> > Problem originally noticed in libdrm by Mark Kettenis.
> > Dave Airlie pointed out that mesa has the same issue.
> > 
> > Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
> 
> Pushed, thanks!
> 
> For the libdrm patch, if it really is from Mark, can you set him as the
> Git commit author, and maybe get a Signed-off-by: from him?

His diff was against an older version we track via cvs.
While I seem to have done the right incantations for this
locally, due to the way git format-patch seems to depend on
email headers would I still be able to send the resulting
patch without having to subscribe Mark to the list?

I've attached the raw format-patch output here instead
of trying to mail it normally.
-------------- next part --------------
>From c66207b904890bd8cc15822cad091b0e797f4a47 Mon Sep 17 00:00:00 2001
From: Mark Kettenis <kettenis at openbsd.org>
Date: Wed, 5 Jun 2013 13:04:30 +1000
Subject: [PATCH] radeon: correct RADEON_GEM_WAIT_IDLE use

RADEON_GEM_WAIT_IDLE is declared DRM_IOW but libdrm
uses it with drmCommandWriteRead instead of drmCommandWrite
which leads to the ioctl being unmatched and returning an
error on at least OpenBSD.

Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
---
 radeon/radeon_bo_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git radeon/radeon_bo_gem.c radeon/radeon_bo_gem.c
index fca0aaf..4ea405f 100644
--- radeon/radeon_bo_gem.c
+++ radeon/radeon_bo_gem.c
@@ -211,8 +211,8 @@ static int bo_wait(struct radeon_bo_int *boi)
     memset(&args, 0, sizeof(args));
     args.handle = boi->handle;
     do {
-        ret = drmCommandWriteRead(boi->bom->fd, DRM_RADEON_GEM_WAIT_IDLE,
-                                  &args, sizeof(args));
+        ret = drmCommandWrite(boi->bom->fd, DRM_RADEON_GEM_WAIT_IDLE,
+			      &args, sizeof(args));
     } while (ret == -EBUSY);
     return ret;
 }
-- 
1.8.2.3



More information about the mesa-dev mailing list