[PATCH v3 7/8] hack: drm/i915: Always remap gtt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

---
 drivers/gpu/drm/i915/intel_display.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4053ed93e73c..fbe71fb23c9e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2509,6 +2509,25 @@ intel_fb_stride_alignment(const struct drm_framebuffer *fb, int color_plane)
 	}
 }
 
+static bool intel_plane_can_remap(const struct intel_plane_state *plane_state)
+{
+	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
+	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
+	const struct drm_framebuffer *fb = plane_state->base.fb;
+	unsigned int alignment = intel_tile_size(dev_priv) - 1;
+	int i;
+
+	if (fb->modifier != DRM_FORMAT_MOD_LINEAR)
+		return true;
+
+	for (i = 0; i < fb->format->num_planes; i++) {
+		if (fb->pitches[i] & alignment)
+			return false;
+	}
+
+	return true;
+}
+
 static bool intel_plane_needs_remap(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
@@ -2529,6 +2548,10 @@ static bool intel_plane_needs_remap(const struct intel_plane_state *plane_state)
 	if (is_ccs_modifier(fb->modifier))
 		return false;
 
+	/* HACK: always remap */
+	if (intel_plane_can_remap(plane_state))
+		return true;
+
 	/* FIXME other color planes? */
 	stride = intel_fb_pitch(fb, 0, rotation);
 	max_stride = plane->max_stride(plane, fb->format->format,
-- 
2.19.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux