All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: paulo.r.zanoni@intel.com
Subject: [Intel-gfx] [RFC 4/7] drm/i915: Add checks specific to async flips
Date: Fri,  6 Mar 2020 17:09:24 +0530	[thread overview]
Message-ID: <20200306113927.16904-5-karthik.b.s@intel.com> (raw)
In-Reply-To: <20200306113927.16904-1-karthik.b.s@intel.com>

Support added only for async flips on primary plane.
If flip is requested on any other plane, reject it.

Signed-off-by: Karthik B S <karthik.b.s@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 25fad5d01e67..a8de08c3773e 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -14732,6 +14732,31 @@ static bool intel_cpu_transcoders_need_modeset(struct intel_atomic_state *state,
 	return false;
 }
 
+static int intel_atomic_check_async(struct intel_atomic_state *state)
+{
+	struct drm_plane *plane;
+	struct drm_plane_state *plane_state;
+	struct intel_crtc_state *crtc_state;
+	struct intel_crtc *crtc;
+	int i, j;
+
+	/*FIXME: Async flip is only supported for primary plane currently
+	 * Support for overlays to be added.
+	 */
+	for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
+		if (crtc_state->uapi.async_flip) {
+			for_each_new_plane_in_state(&state->base,
+						    plane, plane_state, j) {
+				if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
+					DRM_ERROR("Async flips is NOT supported for non-primary plane\n");
+					return -EINVAL;
+				}
+			}
+		}
+	}
+	return 0;
+}
+
 /**
  * intel_atomic_check - validate state object
  * @dev: drm device
@@ -14760,6 +14785,10 @@ static int intel_atomic_check(struct drm_device *dev,
 	if (ret)
 		goto fail;
 
+	ret = intel_atomic_check_async(state);
+	if  (ret)
+		goto fail;
+
 	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
 					    new_crtc_state, i) {
 		if (!needs_modeset(new_crtc_state)) {
-- 
2.22.0

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

  parent reply	other threads:[~2020-03-06 11:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 11:39 [Intel-gfx] [RFC 0/7] Asynchronous flip implementation for i915 Karthik B S
2020-03-06 11:39 ` [Intel-gfx] [RFC 1/7] drm/i915: Define flip done functions and enable IER Karthik B S
2020-03-09 23:17   ` Paulo Zanoni
2020-03-10 10:51     ` B S, Karthik
2020-03-06 11:39 ` [Intel-gfx] [RFC 2/7] drm/i915: Add support for async flips in I915 Karthik B S
2020-03-09 23:18   ` Paulo Zanoni
2020-03-10 10:54     ` B S, Karthik
2020-03-06 11:39 ` [Intel-gfx] [RFC 3/7] drm/i915: Make commit call blocking in case of async flips Karthik B S
2020-03-06 11:39 ` Karthik B S [this message]
2020-03-09 23:19   ` [Intel-gfx] [RFC 4/7] drm/i915: Add checks specific to " Paulo Zanoni
2020-03-10 12:51     ` B S, Karthik
2020-03-06 11:39 ` [Intel-gfx] [RFC 5/7] drm/i915: Add flip_done_handler definition Karthik B S
2020-03-09 23:19   ` Paulo Zanoni
2020-03-10 12:52     ` B S, Karthik
2020-03-06 11:39 ` [Intel-gfx] [RFC 6/7] drm/i915: Enable and handle flip done interrupt Karthik B S
2020-03-06 11:39 ` [Intel-gfx] [RFC 7/7] drm/i915: Do not call drm_crtc_arm_vblank_event in async flips Karthik B S
2020-03-06 19:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Asynchronous flip implementation for i915 Patchwork
2020-03-06 19:43 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-03-06 19:58 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2020-03-06 20:10 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2020-03-10  0:04 ` [Intel-gfx] [RFC 0/7] " Paulo Zanoni
2020-03-10 10:07   ` B S, Karthik

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=20200306113927.16904-5-karthik.b.s@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.