if (fd >= 0)
return fd;
+#if !defined(UDEV)
/* Check if the device node is not what we expect it to be, and recreate it
* and try again if so.
*/
drmMsg("drmOpenDevice: Open failed\n");
remove(buf);
+#endif
return -errno;
}
return (drmVersionPtr)version;
}
+int drmGetCap(int fd, uint64_t capability, uint64_t *value)
+{
+ struct drm_get_cap cap = { capability, 0 };
+ int ret;
+
+ ret = drmIoctl(fd, DRM_IOCTL_GET_CAP, &cap);
+ if (ret)
+ return ret;
+
+ *value = cap.value;
+ return 0;
+}
/**
* Free the bus ID information.
if (drmIoctl(fd, DRM_IOCTL_ADD_MAP, &map))
return -errno;
if (handle)
- *handle = (drm_handle_t)map.handle;
+ *handle = (drm_handle_t)(uintptr_t)map.handle;
return 0;
}
{
drm_map_t map;
- map.handle = (void *)handle;
+ map.handle = (void *)(uintptr_t)handle;
if(drmIoctl(fd, DRM_IOCTL_RM_MAP, &map))
return -errno;
drm_ctx_priv_map_t map;
map.ctx_id = ctx_id;
- map.handle = (void *)handle;
+ map.handle = (void *)(uintptr_t)handle;
if (drmIoctl(fd, DRM_IOCTL_SET_SAREA_CTX, &map))
return -errno;
if (drmIoctl(fd, DRM_IOCTL_GET_SAREA_CTX, &map))
return -errno;
if (handle)
- *handle = (drm_handle_t)map.handle;
+ *handle = (drm_handle_t)(uintptr_t)map.handle;
return 0;
}