All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Avoid selecting unavailable BSD2 ring
@ 2016-02-22 12:07 Gabriel Feceoru
  2016-02-22 12:47 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Gabriel Feceoru @ 2016-02-22 12:07 UTC (permalink / raw)
  To: intel-gfx

Return error when I915_EXEC_BSD_RING2 flag is set but BSD2 ring
is not available in the HW.

Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 8fd00d2..47305ec 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1394,19 +1394,22 @@ eb_select_ring(struct drm_i915_private *dev_priv,
 		return -EINVAL;
 	}
 
-	if (user_ring_id == I915_EXEC_BSD && HAS_BSD2(dev_priv)) {
+	if (user_ring_id == I915_EXEC_BSD) {
 		unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;
 
+		if ((!HAS_BSD2(dev_priv) && (bsd_idx != I915_EXEC_BSD_DEFAULT)) ||
+				(bsd_idx == (I915_EXEC_BSD_RING1 | I915_EXEC_BSD_RING2))) {
+
+			DRM_DEBUG("execbuf with wrong bsd ring: %u\n",
+							  bsd_idx);
+			return -EINVAL;
+		}
+
 		if (bsd_idx == I915_EXEC_BSD_DEFAULT) {
 			bsd_idx = gen8_dispatch_bsd_ring(dev_priv, file);
-		} else if (bsd_idx >= I915_EXEC_BSD_RING1 &&
-			   bsd_idx <= I915_EXEC_BSD_RING2) {
+		} else {
 			bsd_idx >>= I915_EXEC_BSD_SHIFT;
 			bsd_idx--;
-		} else {
-			DRM_DEBUG("execbuf with unknown bsd ring: %u\n",
-				  bsd_idx);
-			return -EINVAL;
 		}
 
 		*ring = &dev_priv->ring[_VCS(bsd_idx)];
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-02-24 15:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-22 12:07 [PATCH] drm/i915: Avoid selecting unavailable BSD2 ring Gabriel Feceoru
2016-02-22 12:47 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-02-23 10:52 ` [PATCH v2] " Gabriel Feceoru
2016-02-23 11:05   ` Tvrtko Ursulin
2016-02-23 13:06     ` Gabriel Feceoru
2016-02-23 13:31       ` Tvrtko Ursulin
2016-02-23 14:03         ` Chris Wilson
2016-02-23 14:39           ` Tvrtko Ursulin
2016-02-23 19:36             ` Dave Gordon
2016-02-24 15:27               ` Gabriel Feceoru
2016-02-23 11:48 ` ✗ Fi.CI.BAT: warning for drm/i915: Avoid selecting unavailable BSD2 ring (rev2) Patchwork

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.