]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/{i915, xe}: Avoid direct inspection of dpt_vma from outside dpt
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 21 Aug 2024 19:38:34 +0000 (15:38 -0400)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 22 Aug 2024 18:00:44 +0000 (14:00 -0400)
DPT code is so dependent on i915 vma implementation and it is not
ported yet to Xe.

This patch limits inspection to DPT's VMA struct to intel_dpt
component only, so the Xe GGTT code can evolve.

Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240821193842.352557-4-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/display/intel_dpt.c
drivers/gpu/drm/i915/display/intel_dpt.h
drivers/gpu/drm/i915/display/skl_universal_plane.c
drivers/gpu/drm/xe/display/xe_fb_pin.c

index 73a1918e2537aeaa345f37fcf283b1fcc9c1bad9..3a6d9904482894a91f921c0fb3c6746388e8eb1d 100644 (file)
@@ -317,3 +317,7 @@ void intel_dpt_destroy(struct i915_address_space *vm)
        i915_vm_put(&dpt->vm);
 }
 
+u64 intel_dpt_offset(struct i915_vma *dpt_vma)
+{
+       return dpt_vma->node.start;
+}
index ff18a525bfbe6150947c5ca2325914c7b67b2de0..1f88b0ee17e7ee8e0ef579eff8a720d1edc0482d 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef __INTEL_DPT_H__
 #define __INTEL_DPT_H__
 
+#include <linux/types.h>
+
 struct drm_i915_private;
 
 struct i915_address_space;
@@ -20,5 +22,6 @@ void intel_dpt_suspend(struct drm_i915_private *i915);
 void intel_dpt_resume(struct drm_i915_private *i915);
 struct i915_address_space *
 intel_dpt_create(struct intel_framebuffer *fb);
+u64 intel_dpt_offset(struct i915_vma *dpt_vma);
 
 #endif /* __INTEL_DPT_H__ */
index ba5a628b4757c110e3893d6e6233713d863d1281..1cf1d5c8b9dc81d28b9210a1f4c290ca97646982 100644 (file)
@@ -14,6 +14,7 @@
 #include "intel_de.h"
 #include "intel_display_irq.h"
 #include "intel_display_types.h"
+#include "intel_dpt.h"
 #include "intel_fb.h"
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
@@ -1162,7 +1163,7 @@ static u32 skl_surf_address(const struct intel_plane_state *plane_state,
                 * within the DPT is always 0.
                 */
                drm_WARN_ON(&i915->drm, plane_state->dpt_vma &&
-                           plane_state->dpt_vma->node.start);
+                           intel_dpt_offset(plane_state->dpt_vma));
                drm_WARN_ON(&i915->drm, offset & 0x1fffff);
                return offset >> 9;
        } else {
index d7db44e79eaf55f5227563c634dcb97e7735a6aa..42d431ff14e750358a6d2308495f183f939e0a4e 100644 (file)
@@ -377,8 +377,8 @@ void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state)
 }
 
 /*
- * For Xe introduce dummy intel_dpt_create which just return NULL and
- * intel_dpt_destroy which does nothing.
+ * For Xe introduce dummy intel_dpt_create which just return NULL,
+ * intel_dpt_destroy which does nothing, and fake intel_dpt_ofsset returning 0;
  */
 struct i915_address_space *intel_dpt_create(struct intel_framebuffer *fb)
 {
@@ -389,3 +389,8 @@ void intel_dpt_destroy(struct i915_address_space *vm)
 {
        return;
 }
+
+u64 intel_dpt_offset(struct i915_vma *dpt_vma)
+{
+       return 0;
+}