[PATCH v18 1/8] drm/vkms: Document pixel_argb_u16

Louis Chauvet posted 8 patches 8 months ago
[PATCH v18 1/8] drm/vkms: Document pixel_argb_u16
Posted by Louis Chauvet 8 months ago
The meaning of each member of the structure was not specified. To clarify
the format used and the reason behind those choices, add some
documentation.

Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
---
 drivers/gpu/drm/vkms/vkms_drv.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
index a74a7fc3a056..3b7b46dd026f 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.h
+++ b/drivers/gpu/drm/vkms/vkms_drv.h
@@ -45,6 +45,23 @@ struct vkms_frame_info {
 	unsigned int rotation;
 };
 
+/**
+ * struct pixel_argb_u16 - Internal representation of a pixel color.
+ * @a: Alpha component value, stored in 16 bits, without padding, using
+ *     machine endianness
+ * @r: Red component value, stored in 16 bits, without padding, using
+ *     machine endianness
+ * @g: Green component value, stored in 16 bits, without padding, using
+ *     machine endianness
+ * @b: Blue component value, stored in 16 bits, without padding, using
+ *     machine endianness
+ *
+ * The goal of this structure is to keep enough precision to ensure
+ * correct composition results in VKMS and simplifying color
+ * manipulation by splitting each component into its own field.
+ * Caution: the byte ordering of this structure is machine-dependent,
+ * you can't cast it directly to AR48 or xR48.
+ */
 struct pixel_argb_u16 {
 	u16 a, r, g, b;
 };

-- 
2.49.0
Re: [PATCH v18 1/8] drm/vkms: Document pixel_argb_u16
Posted by Pekka Paalanen 8 months ago
On Tue, 15 Apr 2025 15:55:32 +0200
Louis Chauvet <louis.chauvet@bootlin.com> wrote:

> The meaning of each member of the structure was not specified. To clarify
> the format used and the reason behind those choices, add some
> documentation.
> 
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> ---
>  drivers/gpu/drm/vkms/vkms_drv.h | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
> index a74a7fc3a056..3b7b46dd026f 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.h
> +++ b/drivers/gpu/drm/vkms/vkms_drv.h
> @@ -45,6 +45,23 @@ struct vkms_frame_info {
>  	unsigned int rotation;
>  };
>  
> +/**
> + * struct pixel_argb_u16 - Internal representation of a pixel color.
> + * @a: Alpha component value, stored in 16 bits, without padding, using
> + *     machine endianness
> + * @r: Red component value, stored in 16 bits, without padding, using
> + *     machine endianness
> + * @g: Green component value, stored in 16 bits, without padding, using
> + *     machine endianness
> + * @b: Blue component value, stored in 16 bits, without padding, using
> + *     machine endianness
> + *
> + * The goal of this structure is to keep enough precision to ensure
> + * correct composition results in VKMS and simplifying color
> + * manipulation by splitting each component into its own field.
> + * Caution: the byte ordering of this structure is machine-dependent,
> + * you can't cast it directly to AR48 or xR48.
> + */
>  struct pixel_argb_u16 {
>  	u16 a, r, g, b;
>  };
> 

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>

(re-sent through a different address due issues on my side)


Thanks,
pq
Re: [PATCH v18 1/8] drm/vkms: Document pixel_argb_u16
Posted by Pekka Paalanen 8 months ago
On Tue, 15 Apr 2025 15:55:32 +0200
Louis Chauvet <louis.chauvet@bootlin.com> wrote:

> The meaning of each member of the structure was not specified. To clarify
> the format used and the reason behind those choices, add some
> documentation.
> 
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> ---
>  drivers/gpu/drm/vkms/vkms_drv.h | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
> index a74a7fc3a056..3b7b46dd026f 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.h
> +++ b/drivers/gpu/drm/vkms/vkms_drv.h
> @@ -45,6 +45,23 @@ struct vkms_frame_info {
>  	unsigned int rotation;
>  };
>  
> +/**
> + * struct pixel_argb_u16 - Internal representation of a pixel color.
> + * @a: Alpha component value, stored in 16 bits, without padding, using
> + *     machine endianness
> + * @r: Red component value, stored in 16 bits, without padding, using
> + *     machine endianness
> + * @g: Green component value, stored in 16 bits, without padding, using
> + *     machine endianness
> + * @b: Blue component value, stored in 16 bits, without padding, using
> + *     machine endianness
> + *
> + * The goal of this structure is to keep enough precision to ensure
> + * correct composition results in VKMS and simplifying color
> + * manipulation by splitting each component into its own field.
> + * Caution: the byte ordering of this structure is machine-dependent,
> + * you can't cast it directly to AR48 or xR48.
> + */
>  struct pixel_argb_u16 {
>  	u16 a, r, g, b;
>  };
> 

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>


Thanks,
pq