]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Make plane_config->fb a struct drm_framebuffer*
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 10 Apr 2026 15:04:43 +0000 (18:04 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 15 Apr 2026 09:36:40 +0000 (12:36 +0300)
There's no need to use the intel specific struct intel_framebuffer*
type in the initial plane_config structure. Just make it a
struct drm_framebuffer*.

I think the fewer special types we expose in the interface (even
if just pointers) the better. At least then there is no need to
change the interface definition if we ever change the internal
types. And I hope that the existing examples will generally
encourage people to not expose more special types unless
absolutely necessary.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260410150449.9699-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/i9xx_plane.c
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_initial_plane.c
drivers/gpu/drm/i915/display/skl_universal_plane.c
drivers/gpu/drm/i915/i915_initial_plane.c
drivers/gpu/drm/xe/display/xe_initial_plane.c

index 9c16753a1f3baee5fe5739921c37b5874aa40e3a..70734d32a4090c110def04ab254119644241eb6f 100644 (file)
@@ -1240,7 +1240,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
                    fb->width, fb->height, fb->format->cpp[0] * 8,
                    base, fb->pitches[0], plane_config->size);
 
-       plane_config->fb = intel_fb;
+       plane_config->fb = &intel_fb->base;
 }
 
 bool i9xx_fixup_initial_plane_config(struct intel_crtc *crtc,
index eaa37b8d9584a09864fd933c0c3822129a307cf5..82c7e03427ff3f38e25cce7e0c76709c17d040f4 100644 (file)
@@ -755,7 +755,7 @@ struct intel_plane_state {
 };
 
 struct intel_initial_plane_config {
-       struct intel_framebuffer *fb;
+       struct drm_framebuffer *fb;
        struct i915_vma *vma;
        int size;
        u32 base;
index 4f51083dbd1129f855c0b5435f27459105a1d2ee..911d67dceba92b92d0c2fb8bb6ca37b3f3ee558e 100644 (file)
@@ -55,9 +55,9 @@ static struct drm_gem_object *
 intel_alloc_initial_plane_obj(struct intel_display *display,
                              struct intel_initial_plane_config *plane_config)
 {
-       struct intel_framebuffer *fb = plane_config->fb;
+       struct drm_framebuffer *fb = plane_config->fb;
 
-       switch (fb->base.modifier) {
+       switch (fb->modifier) {
        case DRM_FORMAT_MOD_LINEAR:
        case I915_FORMAT_MOD_X_TILED:
        case I915_FORMAT_MOD_Y_TILED:
@@ -65,7 +65,7 @@ intel_alloc_initial_plane_obj(struct intel_display *display,
                break;
        default:
                drm_dbg_kms(display->drm, "Unsupported modifier for initial FB: 0x%llx\n",
-                           fb->base.modifier);
+                           fb->modifier);
                return NULL;
        }
 
@@ -93,7 +93,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc,
                return;
 
        if (intel_alloc_initial_plane_obj(display, plane_config)) {
-               fb = &plane_config->fb->base;
+               fb = plane_config->fb;
                vma = plane_config->vma;
        } else {
                const struct intel_plane_state *other_plane_state;
@@ -149,7 +149,7 @@ static void plane_config_fini(struct intel_display *display,
                              struct intel_initial_plane_config *plane_config)
 {
        if (plane_config->fb) {
-               struct drm_framebuffer *fb = &plane_config->fb->base;
+               struct drm_framebuffer *fb = plane_config->fb;
 
                /* We may only have the stub and not a full framebuffer */
                if (drm_framebuffer_read_refcount(fb))
index 7a9d494334b58a6a173f4cfa6919dcfce911fe08..00c863e378a1ff33555e9af9a161eae282d230f6 100644 (file)
@@ -3206,7 +3206,7 @@ skl_get_initial_plane_config(struct intel_crtc *crtc,
                    fb->width, fb->height, fb->format->cpp[0] * 8,
                    base, fb->pitches[0], plane_config->size);
 
-       plane_config->fb = intel_fb;
+       plane_config->fb = &intel_fb->base;
        return;
 
 error:
index 6df57db9b62aae0b5e235b338e89f316b3dd5131..5cb1adde67b6fcbaae07db8478943a7671ee0be8 100644 (file)
@@ -137,7 +137,7 @@ initial_plane_vma(struct drm_i915_private *i915,
        i915_gem_object_set_cache_coherency(obj, HAS_WT(i915) ?
                                            I915_CACHE_WT : I915_CACHE_NONE);
 
-       tiling = intel_fb_modifier_to_tiling(plane_config->fb->base.modifier);
+       tiling = intel_fb_modifier_to_tiling(plane_config->fb->modifier);
 
        switch (tiling) {
        case I915_TILING_NONE:
@@ -145,7 +145,7 @@ initial_plane_vma(struct drm_i915_private *i915,
        case I915_TILING_X:
        case I915_TILING_Y:
                obj->tiling_and_stride =
-                       plane_config->fb->base.pitches[0] |
+                       plane_config->fb->pitches[0] |
                        tiling;
                break;
        default:
@@ -223,7 +223,7 @@ i915_alloc_initial_plane_obj(struct drm_device *drm,
 {
        struct drm_i915_private *i915 = to_i915(drm);
        struct drm_mode_fb_cmd2 mode_cmd = {};
-       struct drm_framebuffer *fb = &plane_config->fb->base;
+       struct drm_framebuffer *fb = plane_config->fb;
        struct i915_vma *vma;
 
        vma = initial_plane_vma(i915, plane_config);
index 1c7a4e8c390c01b3042fa35553dfb07b8ce44b49..8f2d0244c03f70de588d8e2344aef0c090fb4bb1 100644 (file)
@@ -115,7 +115,7 @@ xe_alloc_initial_plane_obj(struct drm_device *drm,
 {
        struct xe_device *xe = to_xe_device(drm);
        struct drm_mode_fb_cmd2 mode_cmd = { 0 };
-       struct drm_framebuffer *fb = &plane_config->fb->base;
+       struct drm_framebuffer *fb = plane_config->fb;
        struct xe_bo *bo;
 
        mode_cmd.pixel_format = fb->format->format;