Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 01/12] lib/rendercopy: Add deltas to all surface relocs
Date: Fri, 22 Dec 2023 08:06:32 +0200	[thread overview]
Message-ID: <ZYUnaMTEkCV2ZDZi@intel.com> (raw)
In-Reply-To: <ZYUmH-o0eH2qVM30@intel.com>

On Fri, Dec 22, 2023 at 08:01:03AM +0200, Ville Syrjälä wrote:
> On Fri, Dec 22, 2023 at 06:37:31AM +0100, Zbigniew Kempczyński wrote:
> > On Wed, Dec 20, 2023 at 07:59:23PM +0200, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > In order to copy stuff not at offset 0 in the BO we need
> > > to include the delta in the relocs/etc.
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  lib/rendercopy_gen4.c |  9 +++++----
> > >  lib/rendercopy_gen6.c |  9 +++++----
> > >  lib/rendercopy_gen7.c |  9 +++++----
> > >  lib/rendercopy_gen8.c |  9 +++++----
> > >  lib/rendercopy_gen9.c | 13 +++++++------
> > >  lib/rendercopy_i830.c | 10 +++++++---
> > >  lib/rendercopy_i915.c |  6 ++++--
> > >  7 files changed, 38 insertions(+), 27 deletions(-)
> > > 
> > > diff --git a/lib/rendercopy_gen4.c b/lib/rendercopy_gen4.c
> > > index 8536d6b632c5..d10e5b7780c0 100644
> > > --- a/lib/rendercopy_gen4.c
> > > +++ b/lib/rendercopy_gen4.c
> > > @@ -148,10 +148,11 @@ gen4_bind_buf(struct intel_bb *ibb, const struct intel_buf *buf, int is_dst)
> > >  	ss->ss0.data_return_format = SURFACERETURNFORMAT_FLOAT32;
> > >  	ss->ss0.color_blend = 1;
> > >  
> > > -	address = intel_bb_offset_reloc(ibb, buf->handle,
> > > -					read_domain, write_domain,
> > > -					intel_bb_offset(ibb) + 4,
> > > -					buf->addr.offset);
> > > +	address = intel_bb_offset_reloc_with_delta(ibb, buf->handle,
> > > +						   read_domain, write_domain,
> > > +						   buf->surface[0].offset,
> > > +						   intel_bb_offset(ibb) + 4,
> > > +						   buf->addr.offset);
> > >  	ss->ss1.base_addr = (uint32_t) address;
> > 
> > I've just took a look to intel_bb_add_reloc() because I didn't
> > remember all details and I see address returned there is offset
> > at which object will be binded, not offset + delta.
> > Until this patch only users of this function reside in
> > rendercopy_gen9.c so for older platforms it doesn't matter
> > (xe driver doesn't support them).
> > 
> > Anyway, delta addition sets up 10-bit if buf->cc.offset is not zero.
> > I mean:
> > 
> > address = intel_bb_offset_reloc_with_delta(ibb, buf->handle,
> > 					   read_domain, write_domain,
> > 					   (buf->cc.offset ? (1 << 10) : 0)
> > 					   | buf->ccs[0].offset,
> > 					   intel_bb_offset(ibb) + 4 * 10,
> > 					   buf->addr.offset);
> > ss->ss10.aux_base_addr = (address + buf->ccs[0].offset) >> 12;
> > ss->ss11.aux_base_addr_hi = (address + buf->ccs[0].offset) >> 32;
> > 
> > I wonder shouldn't intel_bb_add_reloc() return offset + delta.
> > 
> > I also have some doubts regarding:
> > 
> > 	(buf->cc.offset ? (1 << 10) : 0) | buf->ccs[0].offset
> > 
> > This will set up bit-10 (if I'm not wrong clearvalue enable) only
> > when relocation will happen. Without relocation or on softpinning
> > this bit is never set.
> > 
> > Above also would require remove delta in __intel_bb_emit_reloc()
> > but if I'm not wrong this would be enough to start directly using
> > offset returned in intel_bb_add_reloc() derivatives.
> > 
> > Have I missed something?
> 
> No, I think you're right. The lack of the cc enable bit diretly
> written to ss10 would seem to be wrong for the no-reloc case.
> Also the >>12 there looks wrong. And the >>6 in the ss12 clear
> color address looks wrong (and the reloc case should again
> get fixed up by the kernel).

Actually no, the extra shift are correct due to the bitfields.
But yeah clear color enable was missing for the no-reloc case.
But that doesn't help either. And I just realized that I'm actually
testing a modifier w/o CC anyway so the problem must be elsewhere.

> 
> Sadly after fixing up those I still can't see the correct
> output on tgl in kms_big_fb. So there is still something wrong :(
> 
> As for including the delta in the retuened value, we'd need to
> review every usage to make sure no one relies on the current 
> behaviour.
> 
> -- 
> Ville Syrjälä
> Intel

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2023-12-22  6:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20 17:59 [PATCH i-g-t 00/12] tests/kms_big_fb: Test planar formats, and CCS Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 01/12] lib/rendercopy: Add deltas to all surface relocs Ville Syrjala
2023-12-22  5:03   ` [PATCH i-g-t v2 " Ville Syrjala
2023-12-22  5:37   ` [PATCH i-g-t " Zbigniew Kempczyński
2023-12-22  6:01     ` Ville Syrjälä
2023-12-22  6:06       ` Ville Syrjälä [this message]
2023-12-22  6:52         ` Ville Syrjälä
2023-12-22  7:26           ` Zbigniew Kempczyński
2023-12-22  8:33             ` Ville Syrjälä
2023-12-20 17:59 ` [PATCH i-g-t 02/12] tests/kms_big_fb: Use igt_fb_create_intel_buf() Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 03/12] lib/igt_fb: Expose igt_fb_is_ccs_modifier() Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 04/12] tests/kms_big_fb: Fix async Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 05/12] tests/kms_big_fb: Test async flips + linear on tgl+ Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 06/12] tests/kms_big_fb: Determine the max fb size the same way always Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 07/12] tests/kms_frontbuffer_tracking: Use igt_create_fb() Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 08/12] lib/igt_fb: Make igt_calc_fb_size() somewhat usable Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 09/12] tests/kms_big_fb: Nuke fliptab[] Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 10/12] tests/kms_big_fb: Replace 'bpp' with 'name' Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 11/12] tests/kms_big_fb: Test planar YCbCr formats Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 12/12] tests/kms_big_fb: Also test some CCS modifiers Ville Syrjala

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=ZYUnaMTEkCV2ZDZi@intel.com \
    --to=ville.syrjala@linux.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