Re: [igt-dev] [PATCH i-g-t v2 1/2] lib/intel_bufops: Introduce buffer operations

Ville Syrjälä
2019-12-03T17:46:49Z

On Tue, Dec 03, 2019 at 06:05:58PM +0100, Zbigniew Kempczyński wrote:
> On Tue, Dec 03, 2019 at 10:25:29AM +0100, Katarzyna Dec wrote:
>
> <cut>
> > > +static void *x_ptr(void *ptr,
> > > + unsigned int x, unsigned int y,
> > > + unsigned int stride, unsigned int cpp)
> > > +{
> > > + const int tile_width = 512;
> > > + const int tile_height = 8;
> > It can be really silly question - are these ^ values always the same?
>
> Yes.

If you ignore gen2.

>
> > > + const int tile_size = tile_width * tile_height;
> > > + int tile_x, tile_y;
> > > + int offset_x, offset_y, pos;
> > > +
> > > + x *= cpp;
> > > + tile_x = x / tile_width;
> > > + tile_y = y / tile_height;
> > > + offset_x = (tile_x * tile_size);
> > > + offset_y = (tile_y * stride * tile_height);
> > > +
> > > + pos = offset_y + offset_x +
> > > + (y % tile_height * tile_width) + (x % tile_width);
> > > +
> > > + return ptr + pos;
> > > +}
> > > +
> > > +static void *y_ptr(void *ptr,
> > > + unsigned int x, unsigned int y,
> > > + unsigned int stride, unsigned int cpp)
> > > +{
> > > + const int tile_width = 128;
> > > + const int tile_height = 32;
> > > + const int owords = 16;
> > Similar question. I guess this is something specific either to Intel Gen or to
> > testcases.
>
> Tile-n where n is X/Y/Yf/Ys/... describe data placement algorithms
> to be CPU/GPU cache-friendly.

These numbers also only work for i945+.

--
Ville Syrjälä
Intel