[igt-dev] [PATCH i-g-t v6 13/15] lib/igt_fb: For xe assume vram is used on discrete
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Thu Apr 27 09:04:10 UTC 2023
On Thu, Apr 27, 2023 at 12:14:06PM +0530, Modem, Bhanuprakash wrote:
>
> On Tue-25-04-2023 09:10 pm, 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>
> > ---
> > lib/igt_fb.c | 17 +++++++++++------
> > 1 file changed, 11 insertions(+), 6 deletions(-)
> >
> > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > index 7379b99aa8..76f2e12456 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,16 @@ 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 = buf_ops_get_driver(bops) == INTEL_DRIVER_XE ?
> > + vram_if_possible(fd, 0) : 0;
> ----------------------------------------------------------^
> For i915, region must be -1 right?
Not must but it will be consistent to current design. Thank
you for the review and spotting this.
--
Zbigniew
>
> - Bhanu
>
> > + 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 */
More information about the igt-dev
mailing list