[igt-dev] [PATCH i-g-t] lib/rendercopy: Assert that buffer dimensions/stride are acceptable

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Apr 4 10:50:55 UTC 2019


On Thu, Apr 04, 2019 at 08:43:38AM +0100, Chris Wilson wrote:
> Quoting Ville Syrjala (2019-04-03 16:41:04)
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > 
> > Sprinkle some asserts into rendercopy to make sure we don't try
> > to exceed the render engine surface size/stride limitations.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> > diff --git a/lib/rendercopy_gen6.c b/lib/rendercopy_gen6.c
> > index f4c0105a80db..a6157cfc70f6 100644
> > --- a/lib/rendercopy_gen6.c
> > +++ b/lib/rendercopy_gen6.c
> > @@ -79,6 +79,10 @@ gen6_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,
> >         uint32_t write_domain, read_domain;
> >         int ret;
> >  
> > +       igt_assert_lte(buf->stride, 128*1024);
> > +       igt_assert_lte(igt_buf_width(buf), 8192);
> > +       igt_assert_lte(igt_buf_height(buf), 8192);
> 
> Indeed. I had it down as 256k, but the field seems to be only 17b and
> not 18b as ivb+.

Yeah, I had the same misconception when working on the gtt remapping
stuff. Also some version of the spec even mistakenly documented it
as 512k IIRC

> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

Ta. Pushed.

-- 
Ville Syrjälä
Intel


More information about the igt-dev mailing list