intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Feceoru <gabriel.feceoru@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Avoid selecting unavailable BSD2 ring
Date: Tue, 23 Feb 2016 15:06:11 +0200	[thread overview]
Message-ID: <56CC5943.1030708@intel.com> (raw)
In-Reply-To: <56CC3D07.8050208@linux.intel.com>



On 23.02.2016 13:05, Tvrtko Ursulin wrote:
>
> Hi,
>
> On 23/02/16 10:52, Gabriel Feceoru wrote:
>> Return error when I915_EXEC_BSD_RING2 flag is set but BSD2 ring
>> is not available in the HW.
>
> What is the reasoning behind this? So far kernel was allowing userspace
> to select these bits and execute on the first engine. With this patch it
> would start failing potentially breaking userspace. Is it not too late
> to make such change?

I noticed some inconsistencies in igt with regards to bsd and bsd1.
For instance, if bsd2 is not available, gem_sync@basic-bsd1 is skipped, 
but it's skipped because of the 2nd check gem_has_bsd2 (see 
gem_require_ring). Surprisingly gem_has_ring() didn't complain about bsd1.

This fix will make gem_has_ring() return false.

I'm not aware about legacy/compatibility issue - if that's the case, 
please disregard this.

Regards,
Gabriel

>
> Regards,
>
> Tvrtko
>
>> v2: Reworked
>> Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
>> ---
>>   drivers/gpu/drm/i915/i915_gem_execbuffer.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
>> b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
>> index 8fd00d2..9fbd023 100644
>> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
>> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
>> @@ -1394,6 +1394,13 @@ eb_select_ring(struct drm_i915_private *dev_priv,
>>           return -EINVAL;
>>       }
>>
>> +    if ((user_ring_id == I915_EXEC_BSD) && !HAS_BSD2(dev_priv) &&
>> +            ((args->flags & I915_EXEC_BSD_MASK) != 0)) {
>> +        DRM_DEBUG("execbuf with bsd ring but with invalid "
>> +              "bsd dispatch flags: %d\n", (int)(args->flags));
>> +        return -EINVAL;
>> +    }
>> +
>>       if (user_ring_id == I915_EXEC_BSD && HAS_BSD2(dev_priv)) {
>>           unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;
>>
>>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-02-23 12:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=56CC5943.1030708@intel.com \
    --to=gabriel.feceoru@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).