From: Tvrtko Ursulin <tursulin@ursulin.net>
To: Intel-gfx@lists.freedesktop.org
Subject: [PATCH] drm/i915/icl: Adjust BSD2 semantics to mean any second VCS instance
Date: Wed, 18 Apr 2018 10:33:42 +0100 [thread overview]
Message-ID: <20180418093342.449-1-tvrtko.ursulin@linux.intel.com> (raw)
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Currently our driver assumes BSD2 means hardware engine instance number
two. This does not work for Icelake parts with two VCS engines, but which
are hardware instances 0 and 2, and not 0 and 1 as with previous parts.
This makes the second engine not discoverable via HAS_BSD2 get param, nor
it can be targetted by execbuf.
While we are working on the next generation execbuf put in a hack which
allows discovery and access to this second VCS engine using legacy ABI.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Cc: Tony Ye <tony.ye@intel.com>
---
Compile tested only.
Also, one could argue if this is just a temporary hack or could actually
make sense to have this permanently in. It feels like the ABI semantics of
BSD2 are blurry, or at least could be re-blurred for Gen11.
---
drivers/gpu/drm/i915/i915_drv.c | 8 +++++++-
drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index b7dbeba72dec..a185366d9beb 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -331,7 +331,13 @@ static int i915_getparam_ioctl(struct drm_device *dev, void *data,
value = !!dev_priv->engine[VECS];
break;
case I915_PARAM_HAS_BSD2:
- value = !!dev_priv->engine[VCS2];
+ /*
+ * FIXME: Temporary hack for Icelake.
+ *
+ * Make semantics of HAS_BSD2 "has second", or "has two" VDBOXes
+ * instead of "has VDBOX 2nd hardware instance".
+ */
+ value = dev_priv->engine[VCS2] || dev_priv->engine[VCS3];
break;
case I915_PARAM_HAS_LLC:
value = HAS_LLC(dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index c74f5df3fb5a..80b32460567d 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -2052,7 +2052,9 @@ eb_select_engine(struct drm_i915_private *dev_priv,
return NULL;
}
- if (user_ring_id == I915_EXEC_BSD && HAS_BSD2(dev_priv)) {
+ if (user_ring_id == I915_EXEC_BSD &&
+ (INTEL_INFO(dev_priv)->ring_mask &
+ (ENGINE_MASK(_VCS(1)) | ENGINE_MASK(_VCS(2))))) {
unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;
if (bsd_idx == I915_EXEC_BSD_DEFAULT) {
@@ -2068,6 +2070,12 @@ eb_select_engine(struct drm_i915_private *dev_priv,
}
engine = dev_priv->engine[_VCS(bsd_idx)];
+
+ /*
+ * FIXME Temporarily map VCS2 to VCS1 on Icelake.
+ */
+ if (!engine && bsd_idx)
+ engine = dev_priv->engine[_VCS(2)];
} else {
engine = dev_priv->engine[user_ring_map[user_ring_id]];
}
--
2.14.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2018-04-18 9:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-18 9:33 Tvrtko Ursulin [this message]
2018-04-18 10:43 ` [PATCH] drm/i915/icl: Adjust BSD2 semantics to mean any second VCS instance Joonas Lahtinen
2018-04-19 15:59 ` Bloomfield, Jon
2018-04-18 14:38 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-04-18 14:53 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-18 18:37 ` ✓ Fi.CI.IGT: " Patchwork
2018-04-20 14:19 ` [PATCH] " Bloomfield, Jon
2018-04-20 16:55 ` Tvrtko Ursulin
2018-04-20 17:01 ` Bloomfield, Jon
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=20180418093342.449-1-tvrtko.ursulin@linux.intel.com \
--to=tursulin@ursulin.net \
--cc=Intel-gfx@lists.freedesktop.org \
/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.