Skip to contentSkip to conversation

intel: replace direct ioctl use with drm{Set, Drop}Master

PATCH In review Jonathan Gray 2 participants 2 messages Jun 30, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel: replace direct ioctl use with drm{Set, Drop}Master

Use drmSetMaster/drmDropMaster instead of calling the ioctls directly. Fixes compilation on OpenBSD where these ioctls aren't defined.

---
 src/intel_device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
intel_device.c +3 -3
index 5c49db0..1b2f33c 100644
@@ -202,7 +202,7 @@ int intel_get_master(ScrnInfoPtr scrn)
 		int retry = 2000;
 
 		do {
-			ret = ioctl(dev->fd, DRM_IOCTL_SET_MASTER);
+			ret = drmSetMaster(dev->fd);
 			if (ret == 0)
 				break;
 			usleep(1000);
@@ -222,8 +222,8 @@ int intel_put_master(ScrnInfoPtr scrn)
 	ret = 0;
 	assert(dev->master_count);
 	if (--dev->master_count == 0) {
-		assert(ioctl(dev->fd, DRM_IOCTL_SET_MASTER) == 0);
-		ret = ioctl(dev->fd, DRM_IOCTL_DROP_MASTER);
+		assert(drmSetMaster(dev->fd) == 0);
+		ret = drmDropMaster(dev->fd);
 	}
 
 	return ret;
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 5 lines · Jonathan Gray

Use drmSetMaster/drmDropMaster instead of calling the ioctls directly. Fixes compilation on OpenBSD where these ioctls aren't defined.

Sigh. Thanks for the patch, pushed.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre