mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
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 <michal.wajdeczko@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Link: https://patch.msgid.link/20260512183342.3374-6-michal.wajdeczko@intel.com
This commit is contained in:
parent
358315f019
commit
7caa8cad3a
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user