drm/xe/display: Add macro with display driver ops

Instead of updating the drm_driver.fbdev_probe field in the runtime,
we can use macro which value depends on the actual Kconfig setup.

The .fbdev_probe hook will not be used by the drm core unless we
also enable a DRIVER_MODESET driver feature flag, and this flag
still depends on the xe_modparam.probe_display parameter.

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-5-michal.wajdeczko@intel.com
This commit is contained in:
Michal Wajdeczko 2026-05-12 20:33:39 +02:00
parent 9350f47228
commit 358315f019
3 changed files with 21 additions and 4 deletions

View File

@ -85,10 +85,6 @@ void xe_display_driver_set_hooks(struct drm_driver *driver)
if (!xe_modparam.probe_display)
return;
#ifdef CONFIG_DRM_FBDEV_EMULATION
driver->fbdev_probe = intel_fbdev_driver_fbdev_probe;
#endif
driver->driver_features |= DRIVER_MODESET | DRIVER_ATOMIC;
}
@ -603,3 +599,11 @@ int xe_display_probe(struct xe_device *xe)
unset_display_features(xe);
return 0;
}
#ifdef CONFIG_DRM_FBDEV_EMULATION
int xe_display_driver_fbdev_probe(struct drm_fb_helper *fbh,
struct drm_fb_helper_surface_size *sizes)
{
return intel_fbdev_driver_fbdev_probe(fbh, sizes);
}
#endif

View File

@ -9,6 +9,8 @@
#include <linux/types.h>
struct drm_driver;
struct drm_fb_helper;
struct drm_fb_helper_surface_size;
struct pci_dev;
struct xe_device;
@ -16,6 +18,8 @@ struct xe_device;
bool xe_display_driver_probe_defer(struct pci_dev *pdev);
void xe_display_driver_set_hooks(struct drm_driver *driver);
int xe_display_driver_fbdev_probe(struct drm_fb_helper *fbh,
struct drm_fb_helper_surface_size *sizes);
int xe_display_probe(struct xe_device *xe);
@ -40,8 +44,15 @@ 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_OPS \
.fbdev_probe = PTR_IF(IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION), \
xe_display_driver_fbdev_probe)
#else
#define XE_DISPLAY_DRIVER_OPS \
.fbdev_probe = NULL
static inline int xe_display_driver_probe_defer(struct pci_dev *pdev) { return 0; }
static inline void xe_display_driver_set_hooks(struct drm_driver *driver) { }

View File

@ -414,6 +414,7 @@ static struct drm_driver regular_driver = {
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
.patchlevel = DRIVER_PATCHLEVEL,
XE_DISPLAY_DRIVER_OPS,
};
#ifdef CONFIG_PCI_IOV
@ -435,6 +436,7 @@ static struct drm_driver admin_only_driver = {
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
.patchlevel = DRIVER_PATCHLEVEL,
XE_DISPLAY_DRIVER_OPS,
};
/**