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/dpt: move create/destroy to parent interface

Move the DPT create/destroy calls to the display parent interface.

With this, we can remove the dummy xe implementation.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Link: https://patch.msgid.link/9753b21466c668872f468ccff827eab7be034b0c.1772030909.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+57 -30
-3
drivers/gpu/drm/i915/display/intel_dpt.h
··· 8 8 9 9 #include <linux/types.h> 10 10 11 - struct drm_gem_object; 12 11 struct i915_address_space; 13 12 struct i915_vma; 14 13 struct intel_display; 15 14 16 - void intel_dpt_destroy(struct i915_address_space *vm); 17 15 struct i915_vma *intel_dpt_pin_to_ggtt(struct i915_address_space *vm, 18 16 unsigned int alignment); 19 17 void intel_dpt_unpin_from_ggtt(struct i915_address_space *vm); 20 18 void intel_dpt_suspend(struct intel_display *display); 21 19 void intel_dpt_resume(struct intel_display *display); 22 - struct i915_address_space *intel_dpt_create(struct drm_gem_object *obj, size_t size); 23 20 u64 intel_dpt_offset(struct i915_vma *dpt_vma); 24 21 25 22 #endif /* __INTEL_DPT_H__ */
+4 -4
drivers/gpu/drm/i915/display/intel_fb.c
··· 16 16 #include "intel_display_core.h" 17 17 #include "intel_display_types.h" 18 18 #include "intel_display_utils.h" 19 - #include "intel_dpt.h" 20 19 #include "intel_fb.h" 21 20 #include "intel_fb_bo.h" 22 21 #include "intel_frontbuffer.h" ··· 2103 2104 2104 2105 static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) 2105 2106 { 2107 + struct intel_display *display = to_intel_display(fb->dev); 2106 2108 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); 2107 2109 2108 2110 drm_framebuffer_cleanup(fb); 2109 2111 2110 2112 if (intel_fb_uses_dpt(fb)) 2111 - intel_dpt_destroy(intel_fb->dpt_vm); 2113 + intel_parent_dpt_destroy(display, intel_fb->dpt_vm); 2112 2114 2113 2115 intel_fb_bo_framebuffer_fini(intel_fb_bo(fb)); 2114 2116 ··· 2311 2311 if (intel_fb_needs_pot_stride_remap(intel_fb)) 2312 2312 size = intel_remapped_info_size(&intel_fb->remapped_view.gtt.remapped); 2313 2313 2314 - vm = intel_dpt_create(obj, size); 2314 + vm = intel_parent_dpt_create(display, obj, size); 2315 2315 if (IS_ERR(vm)) { 2316 2316 drm_dbg_kms(display->drm, "failed to create DPT\n"); 2317 2317 ret = PTR_ERR(vm); ··· 2331 2331 2332 2332 err_free_dpt: 2333 2333 if (intel_fb_uses_dpt(fb)) 2334 - intel_dpt_destroy(intel_fb->dpt_vm); 2334 + intel_parent_dpt_destroy(display, intel_fb->dpt_vm); 2335 2335 err_bo_framebuffer_fini: 2336 2336 intel_fb_bo_framebuffer_fini(obj); 2337 2337 err_frontbuffer_put:
+17
drivers/gpu/drm/i915/display/intel_parent.c
··· 23 23 #include "intel_display_core.h" 24 24 #include "intel_parent.h" 25 25 26 + /* dpt */ 27 + struct i915_address_space *intel_parent_dpt_create(struct intel_display *display, 28 + struct drm_gem_object *obj, 29 + size_t size) 30 + { 31 + if (display->parent->dpt) 32 + return display->parent->dpt->create(obj, size); 33 + 34 + return NULL; 35 + } 36 + 37 + void intel_parent_dpt_destroy(struct intel_display *display, struct i915_address_space *vm) 38 + { 39 + if (display->parent->dpt) 40 + display->parent->dpt->destroy(vm); 41 + } 42 + 26 43 /* hdcp */ 27 44 ssize_t intel_parent_hdcp_gsc_msg_send(struct intel_display *display, 28 45 struct intel_hdcp_gsc_context *gsc_context,
+8
drivers/gpu/drm/i915/display/intel_parent.h
··· 7 7 #include <linux/types.h> 8 8 9 9 struct dma_fence; 10 + struct drm_gem_object; 10 11 struct drm_scanout_buffer; 12 + struct i915_address_space; 11 13 struct intel_display; 12 14 struct intel_hdcp_gsc_context; 13 15 struct intel_panic; 14 16 struct intel_stolen_node; 17 + 18 + /* dpt */ 19 + struct i915_address_space *intel_parent_dpt_create(struct intel_display *display, 20 + struct drm_gem_object *obj, 21 + size_t size); 22 + void intel_parent_dpt_destroy(struct intel_display *display, struct i915_address_space *vm); 15 23 16 24 /* hdcp */ 17 25 ssize_t intel_parent_hdcp_gsc_msg_send(struct intel_display *display,
+8 -3
drivers/gpu/drm/i915/i915_dpt.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_display_core.h" 9 10 #include "display/intel_display_rpm.h" ··· 243 242 mutex_unlock(&display->drm->mode_config.fb_lock); 244 243 } 245 244 246 - struct i915_address_space * 247 - intel_dpt_create(struct drm_gem_object *obj, size_t size) 245 + static struct i915_address_space *i915_dpt_create(struct drm_gem_object *obj, size_t size) 248 246 { 249 247 struct drm_i915_private *i915 = to_i915(obj->dev); 250 248 struct drm_i915_gem_object *dpt_obj; ··· 308 308 return &dpt->vm; 309 309 } 310 310 311 - void intel_dpt_destroy(struct i915_address_space *vm) 311 + static void i915_dpt_destroy(struct i915_address_space *vm) 312 312 { 313 313 struct i915_dpt *dpt = i915_vm_to_dpt(vm); 314 314 ··· 320 320 { 321 321 return i915_vma_offset(dpt_vma); 322 322 } 323 + 324 + const struct intel_display_dpt_interface i915_display_dpt_interface = { 325 + .create = i915_dpt_create, 326 + .destroy = i915_dpt_destroy, 327 + };
+9
drivers/gpu/drm/i915/i915_dpt.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* Copyright 2026 Intel Corporation */ 3 + 4 + #ifndef __I915_DPT_H__ 5 + #define __I915_DPT_H__ 6 + 7 + extern const struct intel_display_dpt_interface i915_display_dpt_interface; 8 + 9 + #endif /* __I915_DPT_H__ */
+2
drivers/gpu/drm/i915/i915_driver.c
··· 91 91 92 92 #include "i915_debugfs.h" 93 93 #include "i915_display_pc8.h" 94 + #include "i915_dpt.h" 94 95 #include "i915_driver.h" 95 96 #include "i915_drm_client.h" 96 97 #include "i915_drv.h" ··· 762 761 } 763 762 764 763 static const struct intel_display_parent_interface parent = { 764 + .dpt = &i915_display_dpt_interface, 765 765 .dsb = &i915_display_dsb_interface, 766 766 .hdcp = &i915_display_hdcp_interface, 767 767 .initial_plane = &i915_display_initial_plane_interface,
-20
drivers/gpu/drm/xe/display/xe_fb_pin.c
··· 8 8 #include "i915_vma.h" 9 9 #include "intel_display_core.h" 10 10 #include "intel_display_types.h" 11 - #include "intel_dpt.h" 12 11 #include "intel_fb.h" 13 12 #include "intel_fb_pin.h" 14 13 #include "intel_fbdev.h" ··· 449 450 { 450 451 __xe_unpin_fb_vma(old_plane_state->ggtt_vma); 451 452 old_plane_state->ggtt_vma = NULL; 452 - } 453 - 454 - /* 455 - * For Xe introduce dummy intel_dpt_create which just return NULL, 456 - * intel_dpt_destroy which does nothing, and fake intel_dpt_ofsset returning 0; 457 - */ 458 - struct i915_address_space *intel_dpt_create(struct drm_gem_object *obj, size_t size) 459 - { 460 - return NULL; 461 - } 462 - 463 - void intel_dpt_destroy(struct i915_address_space *vm) 464 - { 465 - return; 466 - } 467 - 468 - u64 intel_dpt_offset(struct i915_vma *dpt_vma) 469 - { 470 - return 0; 471 453 } 472 454 473 455 void intel_fb_get_map(struct i915_vma *vma, struct iosys_map *map)
+9
include/drm/intel/display_parent_interface.h
··· 13 13 struct drm_gem_object; 14 14 struct drm_plane_state; 15 15 struct drm_scanout_buffer; 16 + struct i915_address_space; 16 17 struct i915_vma; 17 18 struct intel_dsb_buffer; 18 19 struct intel_hdcp_gsc_context; ··· 23 22 struct ref_tracker; 24 23 25 24 /* Keep struct definitions sorted */ 25 + 26 + struct intel_display_dpt_interface { 27 + struct i915_address_space *(*create)(struct drm_gem_object *obj, size_t size); 28 + void (*destroy)(struct i915_address_space *vm); 29 + }; 26 30 27 31 struct intel_display_dsb_interface { 28 32 u32 (*ggtt_offset)(struct intel_dsb_buffer *dsb_buf); ··· 130 124 * check the optional pointers. 131 125 */ 132 126 struct intel_display_parent_interface { 127 + /** @dsb: DPT interface. Optional. */ 128 + const struct intel_display_dpt_interface *dpt; 129 + 133 130 /** @dsb: DSB buffer interface */ 134 131 const struct intel_display_dsb_interface *dsb; 135 132