From fc74cf0923bf74696211ab22c10f6b295cf59d81 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 13 Aug 2024 00:20:08 +0000 Subject: [PATCH] drm/i915: Simplify intel_initial_plane_config() calling convention From Ville Syrjala 30865e4abb799547299a9cf39c86fe943ee2913a in mainline linux --- .../drm/i915/display/intel_display_driver.c | 7 +--- .../drm/i915/display/intel_plane_initial.c | 40 +++++++++++-------- .../drm/i915/display/intel_plane_initial.h | 4 +- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/sys/dev/pci/drm/i915/display/intel_display_driver.c b/sys/dev/pci/drm/i915/display/intel_display_driver.c index 4b71b395dd0..386b39bc398 100644 --- a/sys/dev/pci/drm/i915/display/intel_display_driver.c +++ b/sys/dev/pci/drm/i915/display/intel_display_driver.c @@ -277,7 +277,6 @@ int intel_display_driver_probe_nogem(struct drm_i915_private *i915) { struct drm_device *dev = &i915->drm; enum pipe pipe; - struct intel_crtc *crtc; int ret; if (!HAS_DISPLAY(i915)) @@ -327,11 +326,7 @@ int intel_display_driver_probe_nogem(struct drm_i915_private *i915) intel_acpi_assign_connector_fwnodes(i915); drm_modeset_unlock_all(dev); - for_each_intel_crtc(dev, crtc) { - if (!to_intel_crtc_state(crtc->base.state)->uapi.active) - continue; - intel_crtc_initial_plane_config(crtc); - } + intel_initial_plane_config(i915); /* * Make sure hardware watermarks really match the state we read out. diff --git a/sys/dev/pci/drm/i915/display/intel_plane_initial.c b/sys/dev/pci/drm/i915/display/intel_plane_initial.c index 300aa8bc83f..40c129a877a 100644 --- a/sys/dev/pci/drm/i915/display/intel_plane_initial.c +++ b/sys/dev/pci/drm/i915/display/intel_plane_initial.c @@ -356,25 +356,31 @@ static void plane_config_fini(struct intel_initial_plane_config *plane_config) i915_vma_put(plane_config->vma); } -void intel_crtc_initial_plane_config(struct intel_crtc *crtc) +void intel_initial_plane_config(struct drm_i915_private *i915) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); - struct intel_initial_plane_config plane_config = {}; + struct intel_crtc *crtc; - /* - * Note that reserving the BIOS fb up front prevents us - * from stuffing other stolen allocations like the ring - * on top. This prevents some ugliness at boot time, and - * can even allow for smooth boot transitions if the BIOS - * fb is large enough for the active pipe configuration. - */ - dev_priv->display.funcs.display->get_initial_plane_config(crtc, &plane_config); + for_each_intel_crtc(&i915->drm, crtc) { + struct intel_initial_plane_config plane_config = {}; - /* - * If the fb is shared between multiple heads, we'll - * just get the first one. - */ - intel_find_initial_plane_obj(crtc, &plane_config); + if (!to_intel_crtc_state(crtc->base.state)->uapi.active) + continue; - plane_config_fini(&plane_config); + /* + * Note that reserving the BIOS fb up front prevents us + * from stuffing other stolen allocations like the ring + * on top. This prevents some ugliness at boot time, and + * can even allow for smooth boot transitions if the BIOS + * fb is large enough for the active pipe configuration. + */ + i915->display.funcs.display->get_initial_plane_config(crtc, &plane_config); + + /* + * If the fb is shared between multiple heads, we'll + * just get the first one. + */ + intel_find_initial_plane_obj(crtc, &plane_config); + + plane_config_fini(&plane_config); + } } diff --git a/sys/dev/pci/drm/i915/display/intel_plane_initial.h b/sys/dev/pci/drm/i915/display/intel_plane_initial.h index c7e35ab3182..64ab95239cd 100644 --- a/sys/dev/pci/drm/i915/display/intel_plane_initial.h +++ b/sys/dev/pci/drm/i915/display/intel_plane_initial.h @@ -6,8 +6,8 @@ #ifndef __INTEL_PLANE_INITIAL_H__ #define __INTEL_PLANE_INITIAL_H__ -struct intel_crtc; +struct drm_i915_private; -void intel_crtc_initial_plane_config(struct intel_crtc *crtc); +void intel_initial_plane_config(struct drm_i915_private *i915); #endif -- 2.20.1