From: Ben Widawsky <ben@bwidawsk.net>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915: Check whether the ring is initialised prior to dispatch
Date: Fri, 11 May 2012 12:53:23 -0700 [thread overview]
Message-ID: <20120511125323.4b7469df@bwidawsk.net> (raw)
In-Reply-To: <1336742972-12713-2-git-send-email-chris@chris-wilson.co.uk>
On Fri, 11 May 2012 14:29:31 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Rather than use the magic feature tests HAS_BLT/HAS_BSD just check
> whether the ring we are about to dispatch the execbuffer on is
> initialised.
>
> v2: Use intel_ring_initialized()
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
> ---
> drivers/gpu/drm/i915/i915_gem_execbuffer.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 21fc11d..974a9f1 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1064,17 +1064,9 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
> ring = &dev_priv->ring[RCS];
> break;
> case I915_EXEC_BSD:
> - if (!HAS_BSD(dev)) {
> - DRM_DEBUG("execbuf with invalid ring (BSD)\n");
> - return -EINVAL;
> - }
> ring = &dev_priv->ring[VCS];
> break;
> case I915_EXEC_BLT:
> - if (!HAS_BLT(dev)) {
> - DRM_DEBUG("execbuf with invalid ring (BLT)\n");
> - return -EINVAL;
> - }
> ring = &dev_priv->ring[BCS];
> break;
> default:
> @@ -1082,6 +1074,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
> (int)(args->flags & I915_EXEC_RING_MASK));
> return -EINVAL;
> }
> + if (!intel_ring_initialized(ring)) {
> + DRM_DEBUG("execbuf with invalid ring: %d\n",
> + (int)(args->flags & I915_EXEC_RING_MASK));
> + return -EINVAL;
> + }
>
> mode = args->flags & I915_EXEC_CONSTANTS_MASK;
> mask = I915_EXEC_CONSTANTS_MASK;
--
Ben Widawsky, Intel Open Source Technology Center
next prev parent reply other threads:[~2012-05-11 19:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 13:29 [PATCH 1/3] drm/i915: Introduce for_each_ring() macro Chris Wilson
2012-05-11 13:29 ` [PATCH 2/3] drm/i915: Check whether the ring is initialised prior to dispatch Chris Wilson
2012-05-11 19:53 ` Ben Widawsky [this message]
2012-05-11 13:29 ` [PATCH 3/3] drm/i915: Replace the feature tests for BLT/BSD with ring init checks Chris Wilson
2012-05-11 19:58 ` Ben Widawsky
2012-05-11 20:24 ` Chris Wilson
2012-05-11 19:46 ` [PATCH 1/3] drm/i915: Introduce for_each_ring() macro Ben Widawsky
2012-05-13 13:35 ` Daniel Vetter
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=20120511125323.4b7469df@bwidawsk.net \
--to=ben@bwidawsk.net \
--cc=chris@chris-wilson.co.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox