[igt-dev] [PATCH i-g-t v5 11/11] lib/igt_fb: For xe assume vram is used on discrete

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Tue Apr 25 03:17:57 UTC 2023


On Mon, Apr 24, 2023 at 01:27:47PM +0200, Kamil Konieczny wrote:
> On 2023-04-24 at 09:39:07 +0200, Zbigniew Kempczyński wrote:
> > Assume fb bo's were created on vram on discrete, otherwise use system
> > memory.
> > 
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> 
> Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> 

Thank you for the review.

Apropos: Bhanu noticed we have some regressions on kms testing as some code
doesn't provide region explicitly. This change is imo safe so at the moment
I'll keep your r-b, but I need to address some intel-buf initialization calls
in bufops patch.

--
Zbigniew

> > ---
> >  lib/igt_fb.c | 16 ++++++++++------
> >  1 file changed, 10 insertions(+), 6 deletions(-)
> > 
> > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > index 7379b99aa8..2c1d48783a 100644
> > --- a/lib/igt_fb.c
> > +++ b/lib/igt_fb.c
> > @@ -2545,6 +2545,7 @@ igt_fb_create_intel_buf(int fd, struct buf_ops *bops,
> >  {
> >  	struct intel_buf *buf;
> >  	uint32_t bo_name, handle, compression;
> > +	uint64_t region;
> >  	int num_surfaces;
> >  	int i;
> >  
> > @@ -2571,12 +2572,15 @@ igt_fb_create_intel_buf(int fd, struct buf_ops *bops,
> >  	bo_name = gem_flink(fd, fb->gem_handle);
> >  	handle = gem_open(fd, bo_name);
> >  
> > -	buf = intel_buf_create_using_handle_and_size(bops, handle,
> > -						     fb->width, fb->height,
> > -						     fb->plane_bpp[0], 0,
> > -						     igt_fb_mod_to_tiling(fb->modifier),
> > -						     compression, fb->size,
> > -						     fb->strides[0]);
> > +	/* For i915 region doesn't matter, for xe does */
> > +	region = is_i915_device(fd) ? 0 : vram_if_possible(fd, 0);
> > +	buf = intel_buf_create_full(bops, handle,
> > +				    fb->width, fb->height,
> > +				    fb->plane_bpp[0], 0,
> > +				    igt_fb_mod_to_tiling(fb->modifier),
> > +				    compression, fb->size,
> > +				    fb->strides[0],
> > +				    region);
> >  	intel_buf_set_name(buf, name);
> >  
> >  	/* Make sure we close handle on destroy path */
> > -- 
> > 2.34.1
> > 


More information about the igt-dev mailing list