[PATCH 7/7] drm/xe/display: use xe->display to decide whether to do anything
Matthew Auld
matthew.auld at intel.com
Fri May 16 14:27:50 UTC 2025
On 16/05/2025 13:17, Jani Nikula wrote:
> Since we only initialize xe->display when xe->info.probe_display, we can
> use !xe->display to bail out early. This seems cleaner and more accurate
> than relying on xe->info.probe_display, since xe->display may indeed be
> NULL.
>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
Reviewed-by: Matthew Auld <matthew.auld at intel.com>
> ---
> drivers/gpu/drm/xe/display/xe_display.c | 40 ++++++++++++-------------
> 1 file changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index 8b2aa7dc6e07..1e59b6dd2c3b 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -92,7 +92,7 @@ static void xe_display_fini_early(void *arg)
> struct xe_device *xe = arg;
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> intel_display_driver_remove_nogem(display);
> @@ -106,7 +106,7 @@ int xe_display_init_early(struct xe_device *xe)
> struct intel_display *display = xe->display;
> int err;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return 0;
>
> /* Fake uncore lock */
> @@ -160,7 +160,7 @@ int xe_display_init(struct xe_device *xe)
> struct intel_display *display = xe->display;
> int err;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return 0;
>
> err = intel_display_driver_probe(display);
> @@ -174,7 +174,7 @@ void xe_display_register(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> intel_display_driver_register(display);
> @@ -185,7 +185,7 @@ void xe_display_unregister(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> intel_power_domains_disable(display);
> @@ -198,7 +198,7 @@ void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> if (master_ctl & DISPLAY_IRQ)
> @@ -209,7 +209,7 @@ void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> if (gu_misc_iir & GU_MISC_GSE)
> @@ -220,7 +220,7 @@ void xe_display_irq_reset(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> gen11_display_irq_reset(display);
> @@ -230,7 +230,7 @@ void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> if (gt->info.id == XE_GT0)
> @@ -271,7 +271,7 @@ static void xe_display_enable_d3cold(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> /*
> @@ -294,7 +294,7 @@ static void xe_display_disable_d3cold(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> intel_dmc_resume(display);
> @@ -319,7 +319,7 @@ void xe_display_pm_suspend(struct xe_device *xe)
> struct intel_display *display = xe->display;
> bool s2idle = suspend_to_idle();
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> /*
> @@ -353,7 +353,7 @@ void xe_display_pm_shutdown(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> intel_power_domains_disable(display);
> @@ -384,7 +384,7 @@ void xe_display_pm_runtime_suspend(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> if (xe->d3cold.allowed) {
> @@ -400,7 +400,7 @@ void xe_display_pm_suspend_late(struct xe_device *xe)
> struct intel_display *display = xe->display;
> bool s2idle = suspend_to_idle();
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> intel_display_power_suspend_late(display, s2idle);
> @@ -410,7 +410,7 @@ void xe_display_pm_runtime_suspend_late(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> if (xe->d3cold.allowed)
> @@ -428,7 +428,7 @@ void xe_display_pm_shutdown_late(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> /*
> @@ -443,7 +443,7 @@ void xe_display_pm_resume_early(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> intel_display_power_resume_early(display);
> @@ -453,7 +453,7 @@ void xe_display_pm_resume(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> intel_dmc_resume(display);
> @@ -488,7 +488,7 @@ void xe_display_pm_runtime_resume(struct xe_device *xe)
> {
> struct intel_display *display = xe->display;
>
> - if (!xe->info.probe_display)
> + if (!display)
> return;
>
> if (xe->d3cold.allowed) {
More information about the Intel-gfx
mailing list