Skip to contentSkip to conversation

drm/i915/skl: Disallow tiling changes during page flip

PATCH In review Tvrtko Ursulin 2 participants 2 messages Apr 21, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/skl: Disallow tiling changes during page flip

From: Tvrtko Ursulin <[email protected]>

It would require watermark reprogramming which we do not want to do.

Cc Daniel Vetter <[email protected]>
Cc Sonika Jindal <[email protected]>
Cc Damien Lespiau <[email protected]>
Cc Chris Wilson <[email protected]>

---
Why do we not want to reprogram wms?

This doesn't do anything about rotation. I don't see how to do it with the current design since old/new property is in plane state not available in page flip.

And we don't have a callback for set property since drm core eats it up. Perhaps it would also be a more flexible design to use the helper pattern there? To allow drivers to handle common properties on their own if they want to. This way we could remember to reprogram wm, if we wanted to in the first place.

P.S. The DDX handles this page flip failure nicely.

---
 drivers/gpu/drm/i915/intel_display.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/gpu/drm/i915/intel_display.c +17 -0
index 0ed181e..e101a9e 100644
@@ -10646,6 +10646,15 @@ void intel_check_page_flip(struct drm_device *dev, int pipe)
 	spin_unlock(&dev->event_lock);
 }
 
+static bool intel_is_y_tiled(uint64_t fb_modifier)
+{
+	if (fb_modifier == I915_FORMAT_MOD_Y_TILED ||
+	    fb_modifier == I915_FORMAT_MOD_Yf_TILED)
+		return true;
+
+	return false;
+}
+
 static int intel_crtc_page_flip(struct drm_crtc *crtc,
 				struct drm_framebuffer *fb,
 				struct drm_pending_vblank_event *event,
@@ -10775,6 +10784,14 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 						  + intel_crtc->dspaddr_offset;
 
 	if (mmio_flip) {
+		/* Temporarily embedding knowledge of disallowed tiling mode
+		 * transition which would require watermark reprogramming.
+		 */
+		if (intel_is_y_tiled(old_fb->modifier[0]) !=
+		    intel_is_y_tiled(fb->modifier[0])) {
+			ret = -EINVAL;
+			goto cleanup_unpin;
+		}
 		ret = intel_queue_mmio_flip(dev, crtc, fb, obj, ring,
 					    page_flip_flags);
 		if (ret)
Signature · 6 lines
2.3.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#1 lore raw

Task id: 6244 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                                  276/276              276/276
ILK                                  302/302              302/302
SNB                                  318/318              318/318
IVB                                  341/341              341/341
BYT                                  287/287              287/287
BDW                                  318/318              318/318

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx