From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH 01/10] drm/i915: Introduce sanity to the plane_config pointer vs. array thing
Date: Fri, 10 Apr 2026 18:04:40 +0300 [thread overview]
Message-ID: <20260410150449.9699-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260410150449.9699-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
The "plane_config" vs. "plane_configs" naming difference is very
subtle, making it far too easy to use the wrong thing by accident.
Introduce a separate type for the array, making it impossible to
pass in the wrong thing. And while at it name the variable
"all_plane_configs" to help the poor reader make sense of things.
The .config_fini() prototype also mistakenly used the plural
form despite only taking in a singular plane_config. So fix that
one up as well.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
.../drm/i915/display/intel_initial_plane.c | 21 ++++++++++++-------
include/drm/intel/display_parent_interface.h | 2 +-
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_initial_plane.c b/drivers/gpu/drm/i915/display/intel_initial_plane.c
index ee545c033da6..4f51083dbd11 100644
--- a/drivers/gpu/drm/i915/display/intel_initial_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_initial_plane.c
@@ -11,6 +11,10 @@
#include "intel_initial_plane.h"
#include "intel_plane.h"
+struct intel_initial_plane_configs {
+ struct intel_initial_plane_config config[I915_MAX_PIPES];
+};
+
void intel_initial_plane_vblank_wait(struct intel_crtc *crtc)
{
struct intel_display *display = to_intel_display(crtc);
@@ -20,7 +24,7 @@ void intel_initial_plane_vblank_wait(struct intel_crtc *crtc)
static const struct intel_plane_state *
intel_reuse_initial_plane_obj(struct intel_crtc *this,
- const struct intel_initial_plane_config plane_configs[])
+ const struct intel_initial_plane_configs *all_plane_configs)
{
struct intel_display *display = to_intel_display(this);
struct intel_crtc *crtc;
@@ -39,7 +43,8 @@ intel_reuse_initial_plane_obj(struct intel_crtc *this,
if (!plane_state->ggtt_vma)
continue;
- if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base)
+ if (all_plane_configs->config[this->pipe].base ==
+ all_plane_configs->config[crtc->pipe].base)
return plane_state;
}
@@ -69,10 +74,10 @@ intel_alloc_initial_plane_obj(struct intel_display *display,
static void
intel_find_initial_plane_obj(struct intel_crtc *crtc,
- struct intel_initial_plane_config plane_configs[])
+ struct intel_initial_plane_configs *all_plane_configs)
{
struct intel_display *display = to_intel_display(crtc);
- struct intel_initial_plane_config *plane_config = &plane_configs[crtc->pipe];
+ struct intel_initial_plane_config *plane_config = &all_plane_configs->config[crtc->pipe];
struct intel_plane *plane = to_intel_plane(crtc->base.primary);
struct intel_plane_state *plane_state = to_intel_plane_state(plane->base.state);
struct drm_framebuffer *fb;
@@ -93,7 +98,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc,
} else {
const struct intel_plane_state *other_plane_state;
- other_plane_state = intel_reuse_initial_plane_obj(crtc, plane_configs);
+ other_plane_state = intel_reuse_initial_plane_obj(crtc, all_plane_configs);
if (!other_plane_state)
goto nofb;
@@ -158,14 +163,14 @@ static void plane_config_fini(struct intel_display *display,
void intel_initial_plane_config(struct intel_display *display)
{
- struct intel_initial_plane_config plane_configs[I915_MAX_PIPES] = {};
+ struct intel_initial_plane_configs all_plane_configs = {};
struct intel_crtc *crtc;
for_each_intel_crtc(display->drm, crtc) {
const struct intel_crtc_state *crtc_state =
to_intel_crtc_state(crtc->base.state);
struct intel_initial_plane_config *plane_config =
- &plane_configs[crtc->pipe];
+ &all_plane_configs.config[crtc->pipe];
if (!crtc_state->hw.active)
continue;
@@ -183,7 +188,7 @@ void intel_initial_plane_config(struct intel_display *display)
* If the fb is shared between multiple heads, we'll
* just get the first one.
*/
- intel_find_initial_plane_obj(crtc, plane_configs);
+ intel_find_initial_plane_obj(crtc, &all_plane_configs);
if (display->funcs.display->fixup_initial_plane_config(crtc, plane_config))
intel_initial_plane_vblank_wait(crtc);
diff --git a/include/drm/intel/display_parent_interface.h b/include/drm/intel/display_parent_interface.h
index 258e6388ef77..9041897c772e 100644
--- a/include/drm/intel/display_parent_interface.h
+++ b/include/drm/intel/display_parent_interface.h
@@ -91,7 +91,7 @@ struct intel_display_initial_plane_interface {
struct drm_gem_object *(*alloc_obj)(struct drm_device *drm, struct intel_initial_plane_config *plane_config);
int (*setup)(struct drm_plane_state *plane_state, struct intel_initial_plane_config *plane_config,
struct drm_framebuffer *fb, struct i915_vma *vma);
- void (*config_fini)(struct intel_initial_plane_config *plane_configs);
+ void (*config_fini)(struct intel_initial_plane_config *plane_config);
};
struct intel_display_irq_interface {
--
2.52.0
next prev parent reply other threads:[~2026-04-10 15:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 15:04 [PATCH 00/10] drm/i915: Some fixes/cleanups to the BIOS FB stuff Ville Syrjala
2026-04-10 15:04 ` Ville Syrjala [this message]
2026-04-10 15:40 ` [PATCH 01/10] drm/i915: Introduce sanity to the plane_config pointer vs. array thing Jani Nikula
2026-04-10 15:04 ` [PATCH 02/10] drm/i915: Remove 'mem' and 'phy_base' from struct intel_initial_plane_config Ville Syrjala
2026-04-10 15:43 ` Jani Nikula
2026-04-10 15:04 ` [PATCH 03/10] drm/i915: Don't pass the whole plane_config to initial_plane_phys() Ville Syrjala
2026-04-10 15:45 ` Jani Nikula
2026-04-10 15:04 ` [PATCH 04/10] drm/i915: Make plane_config->fb a struct drm_framebuffer* Ville Syrjala
2026-04-10 15:48 ` Jani Nikula
2026-04-10 15:04 ` [PATCH 05/10] drm/i915: Move initial plane vblank wait into display code Ville Syrjala
2026-04-10 15:53 ` Jani Nikula
2026-04-10 15:04 ` [PATCH 06/10] drm/i915: Use a 1 second timeout for the polling vblank wait Ville Syrjala
2026-04-10 15:54 ` Jani Nikula
2026-04-10 15:04 ` [PATCH 07/10] drm/i915: Reject tile4 BIOS FB Ville Syrjala
2026-04-10 15:55 ` Jani Nikula
2026-04-10 15:04 ` [PATCH 08/10] drm/i915: Reject X/Y tiled BIOS FB if we don't have fenced regions Ville Syrjala
2026-04-10 15:56 ` Jani Nikula
2026-04-10 15:04 ` [PATCH 09/10] drm/i915: Completely reject DPT BIOS FBs Ville Syrjala
2026-04-10 16:00 ` Jani Nikula
2026-04-10 15:04 ` [PATCH 10/10] drm/i915: Reject BIOS FB rotation in common code Ville Syrjala
2026-04-10 16:01 ` Jani Nikula
2026-04-10 15:12 ` ✓ CI.KUnit: success for drm/i915: Some fixes/cleanups to the BIOS FB stuff Patchwork
2026-04-10 16:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-11 3:46 ` ✓ Xe.CI.FULL: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260410150449.9699-2-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox