[igt-dev] [PATCH i-g-t v3 12/21] lib/igt_vc4: Add helper for checking SAND tiling support on plane
Maxime Ripard
maxime.ripard at bootlin.com
Fri Jan 11 15:15:18 UTC 2019
On Fri, Jan 11, 2019 at 10:05:23AM +0100, Paul Kocialkowski wrote:
> This introduces a convenience helper for checking whether a plane
> supports SAND tiling for a given format.
>
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski at bootlin.com>
> ---
> lib/igt_vc4.h | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/lib/igt_vc4.h b/lib/igt_vc4.h
> index 9118ae193f60..cb980541a61f 100644
> --- a/lib/igt_vc4.h
> +++ b/lib/igt_vc4.h
> @@ -33,6 +33,30 @@ static inline bool igt_vc4_plane_supports_t_tiling(igt_plane_t *plane,
> DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED);
> }
>
> +static inline bool igt_vc4_plane_supports_sand_tiling(igt_plane_t *plane,
> + uint32_t format,
> + size_t column_width_bytes)
> +{
> + uint64_t modifier;
> +
> + switch (column_width_bytes) {
> + case 32:
> + modifier = DRM_FORMAT_MOD_BROADCOM_SAND32;
> + break;
> + case 64:
> + modifier = DRM_FORMAT_MOD_BROADCOM_SAND64;
> + break;
> + case 128:
> + modifier = DRM_FORMAT_MOD_BROADCOM_SAND128;
> + break;
> + case 256:
> + modifier = DRM_FORMAT_MOD_BROADCOM_SAND256;
> + break;
> + }
> +
> + return igt_plane_has_format_mod(plane, format, modifier);
> +}
> +
I'm not quite sure what that function is supposed to be doing, or
rather, why do you need the column_width_bytes parameter.
If that function was just about checking whether the sand tiling is
supported, then you can just return an or'd igt_plane_has_format_mod
of all the modifiers supported, right?
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20190111/3487ae19/attachment.sig>
More information about the igt-dev
mailing list