Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+78 -8
+1
drivers/gpu/drm/i915/Makefile
··· 290 290 display/intel_hotplug.o \ 291 291 display/intel_hotplug_irq.o \ 292 292 display/intel_hti.o \ 293 + display/intel_initial_plane.o \ 293 294 display/intel_link_bw.o \ 294 295 display/intel_load_detect.o \ 295 296 display/intel_lpe_audio.o \
+20
drivers/gpu/drm/i915/display/intel_initial_plane.c
··· 1 + // SPDX-License-Identifier: MIT 2 + /* Copyright © 2025 Intel Corporation */ 3 + 4 + #include <drm/intel/display_parent_interface.h> 5 + 6 + #include "intel_display_core.h" 7 + #include "intel_display_types.h" 8 + #include "intel_initial_plane.h" 9 + 10 + void intel_initial_plane_vblank_wait(struct intel_crtc *crtc) 11 + { 12 + struct intel_display *display = to_intel_display(crtc); 13 + 14 + display->parent->initial_plane->vblank_wait(&crtc->base); 15 + } 16 + 17 + void intel_initial_plane_config(struct intel_display *display) 18 + { 19 + display->parent->initial_plane->config(display->drm); 20 + }
+2
drivers/gpu/drm/i915/i915_driver.c
··· 99 99 #include "i915_gmch.h" 100 100 #include "i915_hdcp_gsc.h" 101 101 #include "i915_hwmon.h" 102 + #include "i915_initial_plane.h" 102 103 #include "i915_ioc32.h" 103 104 #include "i915_ioctl.h" 104 105 #include "i915_irq.h" ··· 765 764 766 765 static const struct intel_display_parent_interface parent = { 767 766 .hdcp = &i915_display_hdcp_interface, 767 + .initial_plane = &i915_display_initial_plane_interface, 768 768 .irq = &i915_display_irq_interface, 769 769 .panic = &i915_display_panic_interface, 770 770 .pc8 = &i915_display_pc8_interface,
+12 -4
drivers/gpu/drm/i915/i915_initial_plane.c
··· 4 4 */ 5 5 6 6 #include <drm/drm_print.h> 7 + #include <drm/intel/display_parent_interface.h> 7 8 8 9 #include "display/intel_crtc.h" 9 10 #include "display/intel_display.h" ··· 18 17 #include "gem/i915_gem_region.h" 19 18 20 19 #include "i915_drv.h" 20 + #include "i915_initial_plane.h" 21 21 22 - void intel_initial_plane_vblank_wait(struct intel_crtc *crtc) 22 + static void i915_initial_plane_vblank_wait(struct drm_crtc *crtc) 23 23 { 24 - intel_crtc_wait_for_next_vblank(crtc); 24 + intel_crtc_wait_for_next_vblank(to_intel_crtc(crtc)); 25 25 } 26 26 27 27 static bool ··· 408 406 i915_vma_put(plane_config->vma); 409 407 } 410 408 411 - void intel_initial_plane_config(struct intel_display *display) 409 + static void i915_initial_plane_config(struct drm_device *drm) 412 410 { 411 + struct intel_display *display = to_intel_display(drm); 413 412 struct intel_initial_plane_config plane_configs[I915_MAX_PIPES] = {}; 414 413 struct intel_crtc *crtc; 415 414 ··· 439 436 intel_find_initial_plane_obj(crtc, plane_configs); 440 437 441 438 if (display->funcs.display->fixup_initial_plane_config(crtc, plane_config)) 442 - intel_initial_plane_vblank_wait(crtc); 439 + i915_initial_plane_vblank_wait(&crtc->base); 443 440 444 441 plane_config_fini(plane_config); 445 442 } 446 443 } 444 + 445 + const struct intel_display_initial_plane_interface i915_display_initial_plane_interface = { 446 + .vblank_wait = i915_initial_plane_vblank_wait, 447 + .config = i915_initial_plane_config, 448 + };
+9
drivers/gpu/drm/i915/i915_initial_plane.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* Copyright © 2025 Intel Corporation */ 3 + 4 + #ifndef __I915_INITIAL_PLANE_H__ 5 + #define __I915_INITIAL_PLANE_H__ 6 + 7 + extern const struct intel_display_initial_plane_interface i915_display_initial_plane_interface; 8 + 9 + #endif
+1
drivers/gpu/drm/xe/Makefile
··· 292 292 i915-display/intel_hotplug.o \ 293 293 i915-display/intel_hotplug_irq.o \ 294 294 i915-display/intel_hti.o \ 295 + i915-display/intel_initial_plane.o \ 295 296 i915-display/intel_link_bw.o \ 296 297 i915-display/intel_lspcon.o \ 297 298 i915-display/intel_lt_phy.o \
+2
drivers/gpu/drm/xe/display/xe_display.c
··· 37 37 #include "skl_watermark.h" 38 38 #include "xe_display_rpm.h" 39 39 #include "xe_hdcp_gsc.h" 40 + #include "xe_initial_plane.h" 40 41 #include "xe_module.h" 41 42 #include "xe_panic.h" 42 43 #include "xe_stolen.h" ··· 539 538 540 539 static const struct intel_display_parent_interface parent = { 541 540 .hdcp = &xe_display_hdcp_interface, 541 + .initial_plane = &xe_display_initial_plane_interface, 542 542 .irq = &xe_display_irq_interface, 543 543 .panic = &xe_display_panic_interface, 544 544 .rpm = &xe_display_rpm_interface,
+13 -4
drivers/gpu/drm/xe/display/xe_initial_plane.c
··· 6 6 /* for ioread64 */ 7 7 #include <linux/io-64-nonatomic-lo-hi.h> 8 8 9 + #include <drm/intel/display_parent_interface.h> 10 + 9 11 #include "regs/xe_gtt_defs.h" 10 12 #include "xe_ggtt.h" 11 13 #include "xe_mmio.h" ··· 29 27 30 28 #include <generated/xe_device_wa_oob.h> 31 29 32 - void intel_initial_plane_vblank_wait(struct intel_crtc *crtc) 30 + /* Early xe has no irq */ 31 + static void xe_initial_plane_vblank_wait(struct drm_crtc *_crtc) 33 32 { 34 - /* Early xe has no irq */ 33 + struct intel_crtc *crtc = to_intel_crtc(_crtc); 35 34 struct xe_device *xe = to_xe_device(crtc->base.dev); 36 35 struct xe_reg pipe_frmtmstmp = XE_REG(i915_mmio_reg_offset(PIPE_FRMTMSTMP(crtc->pipe))); 37 36 u32 timestamp; ··· 287 284 } 288 285 } 289 286 290 - void intel_initial_plane_config(struct intel_display *display) 287 + static void xe_initial_plane_config(struct drm_device *drm) 291 288 { 289 + struct intel_display *display = to_intel_display(drm); 292 290 struct intel_initial_plane_config plane_configs[I915_MAX_PIPES] = {}; 293 291 struct intel_crtc *crtc; 294 292 ··· 318 314 intel_find_initial_plane_obj(crtc, plane_configs); 319 315 320 316 if (display->funcs.display->fixup_initial_plane_config(crtc, plane_config)) 321 - intel_initial_plane_vblank_wait(crtc); 317 + xe_initial_plane_vblank_wait(&crtc->base); 322 318 323 319 plane_config_fini(plane_config); 324 320 } 325 321 } 322 + 323 + const struct intel_display_initial_plane_interface xe_display_initial_plane_interface = { 324 + .vblank_wait = xe_initial_plane_vblank_wait, 325 + .config = xe_initial_plane_config, 326 + };
+9
drivers/gpu/drm/xe/display/xe_initial_plane.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* Copyright © 2025 Intel Corporation */ 3 + 4 + #ifndef __XE_INITIAL_PLANE_H__ 5 + #define __XE_INITIAL_PLANE_H__ 6 + 7 + extern const struct intel_display_initial_plane_interface xe_display_initial_plane_interface; 8 + 9 + #endif
+9
include/drm/intel/display_parent_interface.h
··· 7 7 #include <linux/types.h> 8 8 9 9 struct dma_fence; 10 + struct drm_crtc; 10 11 struct drm_device; 11 12 struct drm_scanout_buffer; 12 13 struct intel_hdcp_gsc_context; ··· 24 23 bool (*gsc_check_status)(struct drm_device *drm); 25 24 struct intel_hdcp_gsc_context *(*gsc_context_alloc)(struct drm_device *drm); 26 25 void (*gsc_context_free)(struct intel_hdcp_gsc_context *gsc_context); 26 + }; 27 + 28 + struct intel_display_initial_plane_interface { 29 + void (*vblank_wait)(struct drm_crtc *crtc); 30 + void (*config)(struct drm_device *drm); 27 31 }; 28 32 29 33 struct intel_display_irq_interface { ··· 100 94 struct intel_display_parent_interface { 101 95 /** @hdcp: HDCP GSC interface */ 102 96 const struct intel_display_hdcp_interface *hdcp; 97 + 98 + /** @initial_plane: Initial plane interface */ 99 + const struct intel_display_initial_plane_interface *initial_plane; 103 100 104 101 /** @irq: IRQ interface */ 105 102 const struct intel_display_irq_interface *irq;