@@ -244,6 +244,9 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
case DRM_CAP_SYNCOBJ:
req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ);
return 0;
+ case DRM_CAP_MODESET:
+ req->value = drm_core_check_feature(dev, DRIVER_MODESET);
+ return 0;
}
/* Other caps only work with KMS drivers */
@@ -649,6 +649,7 @@ struct drm_gem_open {
#define DRM_CAP_PAGE_FLIP_TARGET 0x11
#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
#define DRM_CAP_SYNCOBJ 0x13
+#define DRM_CAP_MODESET 0x14
/** DRM_IOCTL_GET_CAP ioctl argument type */
struct drm_get_cap {
GPU accelerators usually don't have display block or the display driver part can be disabled when building driver(for servers it saves some resources) so it is important let userspace check this capability too. Right now we are checking drmModeGetResources()/drm_mode_getresources() for a error to detect if display is enabled but it is a hackish way it can fail for other reasons too. Signed-off-by: José Roberto de Souza <jose.souza@intel.com> --- drivers/gpu/drm/drm_ioctl.c | 3 +++ include/uapi/drm/drm.h | 1 + 2 files changed, 4 insertions(+)