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: add VMA to parent interface

It's unclear what the direction of the VMA abstraction in the parent
interface should be, but convert i915_vma_fence_id() to parent interface
for starters. This paves the way for making struct i915_vma opaque
towards display.

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/036f4b2d20cc1b0a7ab814beb5bb914c53b6eb53.1772212579.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+34 -10
+2 -3
drivers/gpu/drm/i915/display/intel_fbc.c
··· 45 45 #include <drm/drm_fourcc.h> 46 46 #include <drm/drm_print.h> 47 47 48 - #include "i915_vma.h" 49 48 #include "i9xx_plane_regs.h" 50 49 #include "intel_de.h" 51 50 #include "intel_display_device.h" ··· 1462 1463 !intel_fbc_has_fences(display)); 1463 1464 1464 1465 if (plane_state->flags & PLANE_HAS_FENCE) 1465 - fbc_state->fence_id = i915_vma_fence_id(plane_state->ggtt_vma); 1466 + fbc_state->fence_id = intel_parent_vma_fence_id(display, plane_state->ggtt_vma); 1466 1467 else 1467 1468 fbc_state->fence_id = -1; 1468 1469 ··· 1489 1490 */ 1490 1491 return DISPLAY_VER(display) >= 9 || 1491 1492 (plane_state->flags & PLANE_HAS_FENCE && 1492 - i915_vma_fence_id(plane_state->ggtt_vma) != -1); 1493 + intel_parent_vma_fence_id(display, plane_state->ggtt_vma) != -1); 1493 1494 } 1494 1495 1495 1496 static bool intel_fbc_is_cfb_ok(const struct intel_plane_state *plane_state)
+9
drivers/gpu/drm/i915/display/intel_parent.c
··· 317 317 display->parent->stolen->node_free(node); 318 318 } 319 319 320 + /* vma */ 321 + int intel_parent_vma_fence_id(struct intel_display *display, const struct i915_vma *vma) 322 + { 323 + if (!display->parent->vma) 324 + return -1; 325 + 326 + return display->parent->vma->fence_id(vma); 327 + } 328 + 320 329 /* generic */ 321 330 void intel_parent_fence_priority_display(struct intel_display *display, struct dma_fence *fence) 322 331 {
+3
drivers/gpu/drm/i915/display/intel_parent.h
··· 102 102 struct intel_stolen_node *intel_parent_stolen_node_alloc(struct intel_display *display); 103 103 void intel_parent_stolen_node_free(struct intel_display *display, const struct intel_stolen_node *node); 104 104 105 + /* vma */ 106 + int intel_parent_vma_fence_id(struct intel_display *display, const struct i915_vma *vma); 107 + 105 108 /* generic */ 106 109 bool intel_parent_has_auxccs(struct intel_display *display); 107 110 bool intel_parent_has_fenced_regions(struct intel_display *display);
+1
drivers/gpu/drm/i915/i915_driver.c
··· 775 775 .rpm = &i915_display_rpm_interface, 776 776 .rps = &i915_display_rps_interface, 777 777 .stolen = &i915_display_stolen_interface, 778 + .vma = &i915_display_vma_interface, 778 779 779 780 .fence_priority_display = fence_priority_display, 780 781 .has_auxccs = has_auxccs,
+10
drivers/gpu/drm/i915/i915_vma.c
··· 27 27 28 28 #include <drm/drm_gem.h> 29 29 #include <drm/drm_print.h> 30 + #include <drm/intel/display_parent_interface.h> 30 31 31 32 #include "display/intel_fb.h" 32 33 #include "display/intel_frontbuffer.h" ··· 2333 2332 2334 2333 return 0; 2335 2334 } 2335 + 2336 + static int i915_vma_fence_id(const struct i915_vma *vma) 2337 + { 2338 + return vma->fence ? vma->fence->id : -1; 2339 + } 2340 + 2341 + const struct intel_display_vma_interface i915_display_vma_interface = { 2342 + .fence_id = i915_vma_fence_id, 2343 + };
+2 -5
drivers/gpu/drm/i915/i915_vma.h
··· 404 404 __i915_vma_unpin_fence(vma); 405 405 } 406 406 407 - static inline int i915_vma_fence_id(const struct i915_vma *vma) 408 - { 409 - return vma->fence ? vma->fence->id : -1; 410 - } 411 - 412 407 void i915_vma_parked(struct intel_gt *gt); 413 408 414 409 static inline bool i915_vma_is_scanout(const struct i915_vma *vma) ··· 475 480 476 481 I915_SELFTEST_DECLARE(int i915_vma_get_pages(struct i915_vma *vma)); 477 482 I915_SELFTEST_DECLARE(void i915_vma_put_pages(struct i915_vma *vma)); 483 + 484 + extern const struct intel_display_vma_interface i915_display_vma_interface; 478 485 479 486 #endif
-2
drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
··· 26 26 struct xe_ggtt_node *node; 27 27 }; 28 28 29 - #define i915_vma_fence_id(vma) -1 30 - 31 29 static inline u32 i915_ggtt_offset(const struct i915_vma *vma) 32 30 { 33 31 return xe_ggtt_node_addr(vma->node);
+7
include/drm/intel/display_parent_interface.h
··· 149 149 void (*node_free)(const struct intel_stolen_node *node); 150 150 }; 151 151 152 + struct intel_display_vma_interface { 153 + int (*fence_id)(const struct i915_vma *vma); 154 + }; 155 + 152 156 /** 153 157 * struct intel_display_parent_interface - services parent driver provides to display 154 158 * ··· 201 197 202 198 /** @stolen: Stolen memory. */ 203 199 const struct intel_display_stolen_interface *stolen; 200 + 201 + /** @vma: VMA interface. Optional. */ 202 + const struct intel_display_vma_interface *vma; 204 203 205 204 /* Generic independent functions */ 206 205 struct {