[PATCH] drm/vc4: Advertise supported modifiers for planes

Eric Anholt eric at anholt.net
Fri Aug 4 20:50:07 UTC 2017


Daniel Stone <daniels at collabora.com> writes:

> The IN_FORMATS blob allows the kernel to advertise to userspace which
> format/modifier combinations are supported, per plane. Use this to
> advertise that we support both T_TILED and linear.
>
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  drivers/gpu/drm/vc4/vc4_plane.c | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
> index 2968b3ebb895..554325117a4e 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
> @@ -863,6 +863,20 @@ vc4_update_plane(struct drm_plane *plane,
>  					      ctx);
>  }
>  
> +static bool vc4_format_mod_supported(struct drm_plane *plane,
> +				     uint32_t format,
> +				     uint64_t modifier)
> +{
> +	/* This is easy: both tiled and linear are supported for all formats. */
> +	switch (modifier) {
> +	case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED:
> +	case DRM_FORMAT_MOD_LINEAR:
> +		return true;
> +	default:
> +		return false;
> +	}
> +}

If this is being used for userspace to decide what modifiers it might
want to use for the format, we should disable T_TILED for multi-plane
formats.

However, it also looks like this won't be called unless
dev->mode_config.allow_fb_modifiers, which we should also set.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170804/7b250dc3/attachment.sig>


More information about the dri-devel mailing list