drm/{i915, xe}: move initial plane calls to parent interface

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>
This commit is contained in:
Jani Nikula
2025-12-15 17:28:18 +02:00
parent b99690ffbc
commit 9dacae143e
10 changed files with 78 additions and 8 deletions

View 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 \

View File

@@ -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);
}

View 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,

View 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"
@@ -17,10 +18,11 @@
#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,
};

View File

@@ -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

View 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 \

View 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,

View 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"
@@ -27,9 +29,10 @@
#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,
};

View File

@@ -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

View 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;