public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH] drm/i915/skl: Disallow tiling changes during page flip
Date: Tue, 21 Apr 2015 13:45:16 +0100	[thread overview]
Message-ID: <1429620316-20800-1-git-send-email-tvrtko.ursulin@linux.intel.com> (raw)

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

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

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
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(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 0ed181e..e101a9e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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)
-- 
2.3.5

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

             reply	other threads:[~2015-04-21 12:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 12:45 Tvrtko Ursulin [this message]
2015-04-21 17:09 ` [PATCH] drm/i915/skl: Disallow tiling changes during page flip shuang.he

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429620316-20800-1-git-send-email-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=daniel.vetter@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox