public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Karolina Stolarek <karolina.stolarek@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib/intel_batchbuffer: Make find_engine() more flexible
Date: Thu, 1 Dec 2022 08:38:10 +0100	[thread overview]
Message-ID: <6ffd7d2f-8f3e-30ba-2c31-6363067b85ba@intel.com> (raw)
In-Reply-To: <20221201071841.i35kqoffujv7sjic@zkempczy-mobl2>

On 01.12.2022 08:18, Zbigniew Kempczyński wrote:
> On Wed, Nov 30, 2022 at 08:07:59AM +0100, Karolina Stolarek wrote:
>> find_engine() depends on intel_bb struct, making it hard to
>> use outside of this context. As this function cares only about
>> intel_ctx_cfg, not intel_bb itself, let's pass the context
>> config in directly.
>>
>> Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com>
>> ---
>>   lib/intel_batchbuffer.c | 8 +++-----
>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
>> index 19a1fbe4..00a263f2 100644
>> --- a/lib/intel_batchbuffer.c
>> +++ b/lib/intel_batchbuffer.c
>> @@ -1500,13 +1500,11 @@ static bool has_ctx_cfg(struct intel_bb *ibb)
>>   	return ibb->cfg && ibb->cfg->num_engines > 0;
>>   }
>>   
>> -static uint32_t find_engine(struct intel_bb *ibb, unsigned int class)
>> +static uint32_t find_engine(const intel_ctx_cfg_t *cfg, unsigned int class)
> 
> Probably in the future this might be subject of extension with instance.
> Currently this design is limiting us to single (first) blitter.

I'll argue that even in such scenario we'd still be interested in the 
first instance of the blitter, as in general it has more capabilities 
and is more versatile.

> Easiest way would be put responsiblity of passing engine id to the caller,
> but then we need to do more work in all igts. So for single case:
> 
> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

Thanks!

Karolina

> --
> Zbigniew
> 
>>   {
>> -	intel_ctx_cfg_t *cfg;
>>   	unsigned int i;
>>   	uint32_t engine_id = -1;
>>   
>> -	cfg = ibb->cfg;
>>   	for (i = 0; i < cfg->num_engines; i++) {
>>   		if (cfg->engines[i].engine_class == class)
>>   			engine_id = i;
>> @@ -2833,7 +2831,7 @@ void intel_bb_flush_render(struct intel_bb *ibb)
>>   		return;
>>   
>>   	if (has_ctx_cfg(ibb))
>> -		ring = find_engine(ibb, I915_ENGINE_CLASS_RENDER);
>> +		ring = find_engine(ibb->cfg, I915_ENGINE_CLASS_RENDER);
>>   	else
>>   		ring = I915_EXEC_RENDER;
>>   
>> @@ -2856,7 +2854,7 @@ void intel_bb_flush_blit(struct intel_bb *ibb)
>>   		return;
>>   
>>   	if (has_ctx_cfg(ibb))
>> -		ring = find_engine(ibb, I915_ENGINE_CLASS_COPY);
>> +		ring = find_engine(ibb->cfg, I915_ENGINE_CLASS_COPY);
>>   	else
>>   		ring = HAS_BLT_RING(ibb->devid) ? I915_EXEC_BLT : I915_EXEC_DEFAULT;
>>   
>> -- 
>> 2.25.1
>>

  reply	other threads:[~2022-12-01  7:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  7:07 [igt-dev] [PATCH i-g-t 0/2] Support custom contexts in exec_blit() Karolina Stolarek
2022-11-30  7:07 ` [igt-dev] [PATCH i-g-t 1/2] lib/intel_batchbuffer: Make find_engine() more flexible Karolina Stolarek
2022-12-01  7:18   ` Zbigniew Kempczyński
2022-12-01  7:38     ` Karolina Stolarek [this message]
2022-11-30  7:08 ` [igt-dev] [PATCH i-g-t 2/2] lib/intel_batchbuffer: Use correct engine id in exec_blit() Karolina Stolarek
2022-12-01  7:33   ` Zbigniew Kempczyński
2022-12-01  7:53     ` Karolina Stolarek
2022-11-30 10:13 ` [igt-dev] ✓ Fi.CI.BAT: success for Support custom contexts " Patchwork
2022-11-30 20:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-12-01  8:00   ` Karolina Stolarek

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=6ffd7d2f-8f3e-30ba-2c31-6363067b85ba@intel.com \
    --to=karolina.stolarek@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@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