Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Das, Nirmoy" <nirmoy.das@linux.intel.com>,
	Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Simplify vcs/bsc engine selection
Date: Fri, 17 Mar 2023 08:59:30 +0000	[thread overview]
Message-ID: <59f57a56-2557-175b-d545-b1cd5f45a203@linux.intel.com> (raw)
In-Reply-To: <b94f1474-60ad-518b-dff4-9518746d4213@linux.intel.com>


On 16/03/2023 15:48, Das, Nirmoy wrote:
> 
> On 3/16/2023 3:27 PM, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> No need to look at the mask of present engines when we already have a
>> count stored ever since e2d0ff3525b9 ("drm/i915: Count engine instances
>> per uabi class").
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
> 
> 
> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>

Pushed, thanks for the review!

Regards,

Tvrtko

>> ---
>>   drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++-------
>>   1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c 
>> b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
>> index 9dce2957b4e5..3aeede6aee4d 100644
>> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
>> @@ -2449,11 +2449,6 @@ static int eb_submit(struct i915_execbuffer *eb)
>>       return err;
>>   }
>> -static int num_vcs_engines(struct drm_i915_private *i915)
>> -{
>> -    return hweight_long(VDBOX_MASK(to_gt(i915)));
>> -}
>> -
>>   /*
>>    * Find one BSD ring to dispatch the corresponding BSD command.
>>    * The engine index is returned.
>> @@ -2467,7 +2462,7 @@ gen8_dispatch_bsd_engine(struct drm_i915_private 
>> *dev_priv,
>>       /* Check whether the file_priv has already selected one ring. */
>>       if ((int)file_priv->bsd_engine < 0)
>>           file_priv->bsd_engine =
>> -            get_random_u32_below(num_vcs_engines(dev_priv));
>> +            
>> get_random_u32_below(dev_priv->engine_uabi_class_count[I915_ENGINE_CLASS_VIDEO]);
>>       return file_priv->bsd_engine;
>>   }
>> @@ -2655,7 +2650,8 @@ eb_select_legacy_ring(struct i915_execbuffer *eb)
>>           return -1;
>>       }
>> -    if (user_ring_id == I915_EXEC_BSD && num_vcs_engines(i915) > 1) {
>> +    if (user_ring_id == I915_EXEC_BSD &&
>> +        i915->engine_uabi_class_count[I915_ENGINE_CLASS_VIDEO] > 1) {
>>           unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;
>>           if (bsd_idx == I915_EXEC_BSD_DEFAULT) {

  reply	other threads:[~2023-03-17  8:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16 14:27 [Intel-gfx] [PATCH] drm/i915: Simplify vcs/bsc engine selection Tvrtko Ursulin
2023-03-16 15:48 ` Das, Nirmoy
2023-03-17  8:59   ` Tvrtko Ursulin [this message]
2023-03-17  0:02 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-03-17  3:07 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=59f57a56-2557-175b-d545-b1cd5f45a203@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=nirmoy.das@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