From: Michal Wajdeczko Date: Tue, 12 May 2026 18:33:40 +0000 (+0200) Subject: drm/xe/display: Add macro with display driver features X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7caa8cad3ae04c7b18792e5c18002f2c60db26c7;p=thirdparty%2Fkernel%2Flinux.git drm/xe/display: Add macro with display driver features Instead of updating drm_driver.driver_features in the runtime, we can use macro which value depends on the CONFIG_DRM_XE_DISPLAY. And if display support is later disabled by the xe_modparam then we will clear related bits in the drm_device.driver_features instead. Signed-off-by: Michal Wajdeczko Cc: Jani Nikula Reviewed-by: Jani Nikula Link: https://patch.msgid.link/20260512183342.3374-6-michal.wajdeczko@intel.com --- diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c index 7e7d476da8ce5..7e5382fc161d4 100644 --- a/drivers/gpu/drm/xe/display/xe_display.c +++ b/drivers/gpu/drm/xe/display/xe_display.c @@ -84,13 +84,11 @@ void xe_display_driver_set_hooks(struct drm_driver *driver) { if (!xe_modparam.probe_display) return; - - driver->driver_features |= DRIVER_MODESET | DRIVER_ATOMIC; } static void unset_display_features(struct xe_device *xe) { - xe->drm.driver_features &= ~(DRIVER_MODESET | DRIVER_ATOMIC); + xe->drm.driver_features &= ~XE_DISPLAY_DRIVER_FEATURES; } static void xe_display_fini_early(void *arg) diff --git a/drivers/gpu/drm/xe/display/xe_display.h b/drivers/gpu/drm/xe/display/xe_display.h index deec0232532eb..d2b105d5f2a1b 100644 --- a/drivers/gpu/drm/xe/display/xe_display.h +++ b/drivers/gpu/drm/xe/display/xe_display.h @@ -44,12 +44,14 @@ void xe_display_pm_runtime_suspend(struct xe_device *xe); void xe_display_pm_runtime_suspend_late(struct xe_device *xe); void xe_display_pm_runtime_resume(struct xe_device *xe); +#define XE_DISPLAY_DRIVER_FEATURES (DRIVER_MODESET | DRIVER_ATOMIC) #define XE_DISPLAY_DRIVER_OPS \ .fbdev_probe = PTR_IF(IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION), \ xe_display_driver_fbdev_probe) #else +#define XE_DISPLAY_DRIVER_FEATURES 0 #define XE_DISPLAY_DRIVER_OPS \ .fbdev_probe = NULL diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index 3bca4c1d1d5f1..c053e4d2692ff 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -393,6 +393,7 @@ bool xe_is_xe_file(const struct file *file) static struct drm_driver regular_driver = { .driver_features = + XE_DISPLAY_DRIVER_FEATURES | DRIVER_GEM | DRIVER_RENDER | DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE | DRIVER_GEM_GPUVA, @@ -425,6 +426,7 @@ static const struct drm_ioctl_desc xe_ioctls_admin_only[] = { static struct drm_driver admin_only_driver = { .driver_features = + XE_DISPLAY_DRIVER_FEATURES | DRIVER_GEM | DRIVER_RENDER | DRIVER_GEM_GPUVA, .open = xe_file_open, .postclose = xe_file_close,