[igt-dev] [PATCH i-g-t v2 2/3] lib: Parse plane IN_FORMATS blobifiers into a nicer form

Ville Syrjälä ville.syrjala at linux.intel.com
Tue Mar 13 21:19:14 UTC 2018


On Tue, Mar 13, 2018 at 08:56:39PM +0000, Chris Wilson wrote:
> Quoting Ville Syrjala (2018-03-13 18:30:13)
> > +       for (int i = 0; i < blob_data->count_modifiers; i++) {
> > +               for (int j = 0; j < 64; j++) {
> > +                       const struct drm_format_modifier *modifiers =
> > +                               modifiers_ptr(blob_data);
> > +                       const uint32_t *formats = formats_ptr(blob_data);
> > +
> > +                       if (!(modifiers[i].formats & (1ULL << j)))
> > +                               continue;
> > +
> > +                       plane->formats[idx] = formats[modifiers[i].offset + j];
> 
> So far everything has been byte offset, but for drm_format_modifier you
> now switch to an index offset. In drm_plane.c, I only found
> drm_format_modifier.offset = 0 and no examples of a non-zero offset to
> check against.
> 
> I presume you know what you are doing. :)

Possibly. IIRC the offset is was just supposed to be n*64 to index more
than 64 formats. But of course it's all very much theoretical until a
plane exposes that many formats.

> 
> Otherwise the code looks consistent with itself and drm_plane.c
> 
> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
> -Chris

-- 
Ville Syrjälä
Intel OTC


More information about the igt-dev mailing list