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

Chris Wilson chris at chris-wilson.co.uk
Tue Mar 13 20:56:39 UTC 2018


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. :)

Otherwise the code looks consistent with itself and drm_plane.c

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


More information about the igt-dev mailing list