[PATCH v6 13/17] drm/vkms: Add range and encoding properties to the plane
Pekka Paalanen
pekka.paalanen at collabora.com
Mon Apr 22 14:49:22 UTC 2024
On Tue, 09 Apr 2024 15:25:31 +0200
Louis Chauvet <louis.chauvet at bootlin.com> wrote:
> From: Arthur Grillo <arthurgrillo at riseup.net>
>
> Now that the driver internally handles these quantization ranges and YUV
> encoding matrices, expose the UAPI for setting them.
>
> Signed-off-by: Arthur Grillo <arthurgrillo at riseup.net>
> [Louis Chauvet: retained only relevant parts, updated the commit message]
> Signed-off-by: Louis Chauvet <louis.chauvet at bootlin.com>
> ---
> drivers/gpu/drm/vkms/vkms_formats.c | 2 +-
> drivers/gpu/drm/vkms/vkms_plane.c | 9 +++++++++
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
> index 2d7445a3de93..a294744d29d6 100644
> --- a/drivers/gpu/drm/vkms/vkms_formats.c
> +++ b/drivers/gpu/drm/vkms/vkms_formats.c
> @@ -238,7 +238,7 @@ static struct pixel_argb_u16 argb_u16_from_RGB565(const u16 *pixel)
> static struct pixel_argb_u16 argb_u16_from_yuv888(u8 y, u8 channel_1, u8 channel_2,
> const struct conversion_matrix *matrix)
> {
> - u8 r, g, b;
> + u16 r, g, b;
> s64 fp_y, fp_channel_1, fp_channel_2;
> s64 fp_r, fp_g, fp_b;
This part belongs in the previous patch.
Otherwise,
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.com>
Thanks,
pq
>
> diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> index d4e375913122..8f764a108b00 100644
> --- a/drivers/gpu/drm/vkms/vkms_plane.c
> +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> @@ -218,5 +218,14 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
> drm_plane_create_rotation_property(&plane->base, DRM_MODE_ROTATE_0,
> DRM_MODE_ROTATE_MASK | DRM_MODE_REFLECT_MASK);
>
> + drm_plane_create_color_properties(&plane->base,
> + BIT(DRM_COLOR_YCBCR_BT601) |
> + BIT(DRM_COLOR_YCBCR_BT709) |
> + BIT(DRM_COLOR_YCBCR_BT2020),
> + BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |
> + BIT(DRM_COLOR_YCBCR_FULL_RANGE),
> + DRM_COLOR_YCBCR_BT601,
> + DRM_COLOR_YCBCR_FULL_RANGE);
> +
> return plane;
> }
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20240422/48c39e14/attachment.sig>
More information about the dri-devel
mailing list