]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/{i915, xe}: move initial plane calls to parent interface
authorJani Nikula <jani.nikula@intel.com>
Mon, 15 Dec 2025 15:28:18 +0000 (17:28 +0200)
committerJani Nikula <jani.nikula@intel.com>
Mon, 22 Dec 2025 13:09:22 +0000 (15:09 +0200)
Add the initial plane handling functions to the display parent
interface. Add the call wrappers in dedicated intel_initial_plane.c
instead of intel_parent.c, as we'll be refactoring the calls heavily.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/ab91c891677fe2bb83bf5aafa5ee984b2442b84d.1765812266.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/Makefile
drivers/gpu/drm/i915/display/intel_initial_plane.c [new file with mode: 0644]
drivers/gpu/drm/i915/i915_driver.c
drivers/gpu/drm/i915/i915_initial_plane.c
drivers/gpu/drm/i915/i915_initial_plane.h [new file with mode: 0644]
drivers/gpu/drm/xe/Makefile
drivers/gpu/drm/xe/display/xe_display.c
drivers/gpu/drm/xe/display/xe_initial_plane.c
drivers/gpu/drm/xe/display/xe_initial_plane.h [new file with mode: 0644]
include/drm/intel/display_parent_interface.h

index 58bb7e4fad3b181f36b4e3d07ae9329d1df59091..fb2b215930207fead695980cc43374b98a850e94 100644 (file)
@@ -290,6 +290,7 @@ i915-y += \
        display/intel_hotplug.o \
        display/intel_hotplug_irq.o \
        display/intel_hti.o \
+       display/intel_initial_plane.o \
        display/intel_link_bw.o \
        display/intel_load_detect.o \
        display/intel_lpe_audio.o \
diff --git a/drivers/gpu/drm/i915/display/intel_initial_plane.c b/drivers/gpu/drm/i915/display/intel_initial_plane.c
new file mode 100644 (file)
index 0000000..c68d755
--- /dev/null
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: MIT
+/* Copyright © 2025 Intel Corporation */
+
+#include <drm/intel/display_parent_interface.h>
+
+#include "intel_display_core.h"
+#include "intel_display_types.h"
+#include "intel_initial_plane.h"
+
+void intel_initial_plane_vblank_wait(struct intel_crtc *crtc)
+{
+       struct intel_display *display = to_intel_display(crtc);
+
+       display->parent->initial_plane->vblank_wait(&crtc->base);
+}
+
+void intel_initial_plane_config(struct intel_display *display)
+{
+       display->parent->initial_plane->config(display->drm);
+}
index e025273e9ab13b00787a5b9e2624e574aef3230e..f0105c5b49a713bbe03ea5894361ee146b48ea56 100644 (file)
@@ -99,6 +99,7 @@
 #include "i915_gmch.h"
 #include "i915_hdcp_gsc.h"
 #include "i915_hwmon.h"
+#include "i915_initial_plane.h"
 #include "i915_ioc32.h"
 #include "i915_ioctl.h"
 #include "i915_irq.h"
@@ -764,6 +765,7 @@ static bool vgpu_active(struct drm_device *drm)
 
 static const struct intel_display_parent_interface parent = {
        .hdcp = &i915_display_hdcp_interface,
+       .initial_plane = &i915_display_initial_plane_interface,
        .irq = &i915_display_irq_interface,
        .panic = &i915_display_panic_interface,
        .pc8 = &i915_display_pc8_interface,
index b7f115708c32915460bfab809b287b69d213e330..f26563eed9baaaf96280717e6e0264fdbb15fb3b 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <drm/drm_print.h>
+#include <drm/intel/display_parent_interface.h>
 
 #include "display/intel_crtc.h"
 #include "display/intel_display.h"
 #include "gem/i915_gem_region.h"
 
 #include "i915_drv.h"
+#include "i915_initial_plane.h"
 
-void intel_initial_plane_vblank_wait(struct intel_crtc *crtc)
+static void i915_initial_plane_vblank_wait(struct drm_crtc *crtc)
 {
-       intel_crtc_wait_for_next_vblank(crtc);
+       intel_crtc_wait_for_next_vblank(to_intel_crtc(crtc));
 }
 
 static bool
@@ -406,8 +408,9 @@ static void plane_config_fini(struct intel_initial_plane_config *plane_config)
                i915_vma_put(plane_config->vma);
 }
 
-void intel_initial_plane_config(struct intel_display *display)
+static void i915_initial_plane_config(struct drm_device *drm)
 {
+       struct intel_display *display = to_intel_display(drm);
        struct intel_initial_plane_config plane_configs[I915_MAX_PIPES] = {};
        struct intel_crtc *crtc;
 
@@ -436,8 +439,13 @@ void intel_initial_plane_config(struct intel_display *display)
                intel_find_initial_plane_obj(crtc, plane_configs);
 
                if (display->funcs.display->fixup_initial_plane_config(crtc, plane_config))
-                       intel_initial_plane_vblank_wait(crtc);
+                       i915_initial_plane_vblank_wait(&crtc->base);
 
                plane_config_fini(plane_config);
        }
 }
+
+const struct intel_display_initial_plane_interface i915_display_initial_plane_interface = {
+       .vblank_wait = i915_initial_plane_vblank_wait,
+       .config = i915_initial_plane_config,
+};
diff --git a/drivers/gpu/drm/i915/i915_initial_plane.h b/drivers/gpu/drm/i915/i915_initial_plane.h
new file mode 100644 (file)
index 0000000..99ba462
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: MIT */
+/* Copyright © 2025 Intel Corporation */
+
+#ifndef __I915_INITIAL_PLANE_H__
+#define __I915_INITIAL_PLANE_H__
+
+extern const struct intel_display_initial_plane_interface i915_display_initial_plane_interface;
+
+#endif
index 4af7f55622218257e140e6cefd903467f8bef07a..2751599a5cc8c0bb6731fb5da66bc857bdf85625 100644 (file)
@@ -292,6 +292,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
        i915-display/intel_hotplug.o \
        i915-display/intel_hotplug_irq.o \
        i915-display/intel_hti.o \
+       i915-display/intel_initial_plane.o \
        i915-display/intel_link_bw.o \
        i915-display/intel_lspcon.o \
        i915-display/intel_lt_phy.o \
index eda65a05f60161b609c27fb8b4227507a0c8142f..f8a831b5dc7d57f673edece001d1102311b0e894 100644 (file)
@@ -37,6 +37,7 @@
 #include "skl_watermark.h"
 #include "xe_display_rpm.h"
 #include "xe_hdcp_gsc.h"
+#include "xe_initial_plane.h"
 #include "xe_module.h"
 #include "xe_panic.h"
 #include "xe_stolen.h"
@@ -538,6 +539,7 @@ static const struct intel_display_irq_interface xe_display_irq_interface = {
 
 static const struct intel_display_parent_interface parent = {
        .hdcp = &xe_display_hdcp_interface,
+       .initial_plane = &xe_display_initial_plane_interface,
        .irq = &xe_display_irq_interface,
        .panic = &xe_display_panic_interface,
        .rpm = &xe_display_rpm_interface,
index 9d5760e56c4c87e7631089a6759c706fe097491a..dd69f1c65903d703d37eb0a70207f29b0f471e3c 100644 (file)
@@ -6,6 +6,8 @@
 /* for ioread64 */
 #include <linux/io-64-nonatomic-lo-hi.h>
 
+#include <drm/intel/display_parent_interface.h>
+
 #include "regs/xe_gtt_defs.h"
 #include "xe_ggtt.h"
 #include "xe_mmio.h"
 
 #include <generated/xe_device_wa_oob.h>
 
-void intel_initial_plane_vblank_wait(struct intel_crtc *crtc)
+/* Early xe has no irq */
+static void xe_initial_plane_vblank_wait(struct drm_crtc *_crtc)
 {
-       /* Early xe has no irq */
+       struct intel_crtc *crtc = to_intel_crtc(_crtc);
        struct xe_device *xe = to_xe_device(crtc->base.dev);
        struct xe_reg pipe_frmtmstmp = XE_REG(i915_mmio_reg_offset(PIPE_FRMTMSTMP(crtc->pipe)));
        u32 timestamp;
@@ -284,8 +287,9 @@ static void plane_config_fini(struct intel_initial_plane_config *plane_config)
        }
 }
 
-void intel_initial_plane_config(struct intel_display *display)
+static void xe_initial_plane_config(struct drm_device *drm)
 {
+       struct intel_display *display = to_intel_display(drm);
        struct intel_initial_plane_config plane_configs[I915_MAX_PIPES] = {};
        struct intel_crtc *crtc;
 
@@ -314,8 +318,13 @@ void intel_initial_plane_config(struct intel_display *display)
                intel_find_initial_plane_obj(crtc, plane_configs);
 
                if (display->funcs.display->fixup_initial_plane_config(crtc, plane_config))
-                       intel_initial_plane_vblank_wait(crtc);
+                       xe_initial_plane_vblank_wait(&crtc->base);
 
                plane_config_fini(plane_config);
        }
 }
+
+const struct intel_display_initial_plane_interface xe_display_initial_plane_interface = {
+       .vblank_wait = xe_initial_plane_vblank_wait,
+       .config = xe_initial_plane_config,
+};
diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.h b/drivers/gpu/drm/xe/display/xe_initial_plane.h
new file mode 100644 (file)
index 0000000..399d15f
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: MIT */
+/* Copyright © 2025 Intel Corporation */
+
+#ifndef __XE_INITIAL_PLANE_H__
+#define __XE_INITIAL_PLANE_H__
+
+extern const struct intel_display_initial_plane_interface xe_display_initial_plane_interface;
+
+#endif
index 10c50b42844eabf698074bb9280bf5e4ac4e8ee2..48d52bee4ceecddbfed8278537911c0530de49c2 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/types.h>
 
 struct dma_fence;
+struct drm_crtc;
 struct drm_device;
 struct drm_scanout_buffer;
 struct intel_hdcp_gsc_context;
@@ -25,6 +26,11 @@ struct intel_display_hdcp_interface {
        void (*gsc_context_free)(struct intel_hdcp_gsc_context *gsc_context);
 };
 
+struct intel_display_initial_plane_interface {
+       void (*vblank_wait)(struct drm_crtc *crtc);
+       void (*config)(struct drm_device *drm);
+};
+
 struct intel_display_irq_interface {
        bool (*enabled)(struct drm_device *drm);
        void (*synchronize)(struct drm_device *drm);
@@ -95,6 +101,9 @@ struct intel_display_parent_interface {
        /** @hdcp: HDCP GSC interface */
        const struct intel_display_hdcp_interface *hdcp;
 
+       /** @initial_plane: Initial plane interface */
+       const struct intel_display_initial_plane_interface *initial_plane;
+
        /** @irq: IRQ interface */
        const struct intel_display_irq_interface *irq;