Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/igt_fb/xe: use engine copy where available
Date: Tue, 17 Oct 2023 10:08:57 +0300	[thread overview]
Message-ID: <161bd2a0-1395-ffab-76a9-d53bf2abc02e@gmail.com> (raw)
In-Reply-To: <20231017064451.mohdfg7vfkiqdrjr@zkempczy-mobl2>

On 17.10.2023 9.44, Zbigniew Kempczyński wrote:
> On Mon, Oct 16, 2023 at 04:48:52PM +0300, Juha-Pekka Heikkila wrote:
>> On Xe driver there seems to be some problems with blitter while copying
>> framebuffers. Switch to use engine copy instead of blitter copy
>> where possible at least until blitter path is fixed.
> 
> Do we have separated test which exposes this bug on Xe?
> If not this looks like hiding bugs what's wrong as this might
> be triggered on another path.
> 

As discussed offline, any x-tile test will show this on adlp. 
Framebuffers here are for display testing, agreed this would put the bug 
in hiding on blitter but allow some basic display testing with rgb 
framebuffers on Xe. With this set once testing proceed to yuv 
framebuffers we'll see all of those failing as Vebox doesn't yet work on 
Xe either.

/Juha-Pekka

> 
> 
>>
>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> 
>> ---
>>   lib/igt_fb.c | 30 ++++++++++++++++++++++++------
>>   1 file changed, 24 insertions(+), 6 deletions(-)
>>
>> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
>> index e82393909..0ff610dc2 100644
>> --- a/lib/igt_fb.c
>> +++ b/lib/igt_fb.c
>> @@ -2502,12 +2502,17 @@ static bool block_copy_ok(const struct igt_fb *fb)
>>   
>>   static bool blitter_ok(const struct igt_fb *fb)
>>   {
>> +	int devid;
>> +
>>   	if (!is_intel_device(fb->fd))
>>   		return false;
>>   
>> +	devid = intel_get_drm_devid(fb->fd);
>> +
>>   	if ((is_ccs_modifier(fb->modifier) &&
>> -	     !HAS_FLATCCS(intel_get_drm_devid(fb->fd))) ||
>> -	     is_gen12_mc_ccs_modifier(fb->modifier))
>> +	     !HAS_FLATCCS(devid)) ||
>> +	     is_gen12_mc_ccs_modifier(fb->modifier) ||
>> +	     (is_xe_device(fb->fd) && igt_get_render_copyfunc(devid)))
>>   		return false;
>>   
>>   	for (int i = 0; i < fb->num_planes; i++) {
>> @@ -2538,15 +2543,20 @@ static bool blitter_ok(const struct igt_fb *fb)
>>   
>>   static bool use_enginecopy(const struct igt_fb *fb)
>>   {
>> +	int devid;
>> +
>>   	if (!is_intel_device(fb->fd))
>>   		return false;
>>   
>>   	if (blitter_ok(fb))
>>   		return false;
>>   
>> +	devid = intel_get_drm_devid(fb->fd);
>> +
>>   	return fb->modifier == I915_FORMAT_MOD_Yf_TILED ||
>> -	       (!HAS_FLATCCS(intel_get_drm_devid(fb->fd)) && is_ccs_modifier(fb->modifier)) ||
>> -	       is_gen12_mc_ccs_modifier(fb->modifier);
>> +	       (!HAS_FLATCCS(devid) && is_ccs_modifier(fb->modifier)) ||
>> +	       is_gen12_mc_ccs_modifier(fb->modifier) ||
>> +	       (is_xe_device(fb->fd) && igt_get_render_copyfunc(devid));
>>   }
>>   
>>   static bool use_blitter(const struct igt_fb *fb)
>> @@ -3052,7 +3062,12 @@ static void free_linear_mapping(struct fb_blit_upload *blit)
>>   		igt_nouveau_delete_bo(&linear->fb);
>>   	} else if (is_xe_device(fd)) {
>>   		gem_munmap(linear->map, linear->fb.size);
>> -		blitcopy(fb, &linear->fb);
>> +
>> +		if (blit->ibb)
>> +			copy_with_engine(blit, fb, &linear->fb);
>> +		else
>> +			blitcopy(fb, &linear->fb);
>> +
>>   		gem_close(fd, linear->fb.gem_handle);
>>   	} else {
>>   		gem_munmap(linear->map, linear->fb.size);
>> @@ -3132,7 +3147,10 @@ static void setup_linear_mapping(struct fb_blit_upload *blit)
>>   
>>   		linear->map = igt_nouveau_mmap_bo(&linear->fb, PROT_READ | PROT_WRITE);
>>   	} else if (is_xe_device(fd)) {
>> -		blitcopy(&linear->fb, fb);
>> +		if (blit->ibb)
>> +			copy_with_engine(blit, &linear->fb, fb);
>> +		else
>> +			blitcopy(&linear->fb, fb);
>>   
>>   		linear->map = xe_bo_mmap_ext(fd, linear->fb.gem_handle,
>>   					     linear->fb.size, PROT_READ | PROT_WRITE);
>> -- 
>> 2.34.1
>>

  reply	other threads:[~2023-10-17  7:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 13:48 [igt-dev] [PATCH i-g-t] lib/igt_fb/xe: use engine copy where available Juha-Pekka Heikkila
2023-10-16 19:00 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2023-10-16 19:28 ` [igt-dev] ✓ CI.xeBAT: success " Patchwork
2023-10-16 19:31 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-10-17  0:08 ` [igt-dev] ✓ CI.xeBAT: success for lib/igt_fb/xe: use engine copy where available (rev2) Patchwork
2023-10-17  0:13 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-10-17  5:58 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb/xe: use engine copy where available (rev3) Patchwork
2023-10-17  6:20 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-10-17  6:44 ` [igt-dev] [PATCH i-g-t] lib/igt_fb/xe: use engine copy where available Zbigniew Kempczyński
2023-10-17  7:08   ` Juha-Pekka Heikkila [this message]
2023-10-18 12:57     ` Maarten Lankhorst
2023-10-18 13:51       ` Juha-Pekka Heikkila
2023-10-17  7:49 ` [igt-dev] ✗ Fi.CI.IGT: failure for lib/igt_fb/xe: use engine copy where available (rev3) 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=161bd2a0-1395-ffab-76a9-d53bf2abc02e@gmail.com \
    --to=juhapekka.heikkila@gmail.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