2023-08-29 10:54:31

by Pekka Paalanen

[permalink] [raw]
Subject: Re: [PATCH RFC v6 02/10] drm: Introduce solid fill DRM plane property

On Mon, 28 Aug 2023 17:05:08 -0700
Jessica Zhang <[email protected]> wrote:

> Document and add support for solid_fill property to drm_plane. In
> addition, add support for setting and getting the values for solid_fill.
>
> To enable solid fill planes, userspace must assign a property blob to
> the "solid_fill" plane property containing the following information:
>
> struct drm_mode_solid_fill {
> u32 r, g, b;
> };
>
> Signed-off-by: Jessica Zhang <[email protected]>
> ---
> drivers/gpu/drm/drm_atomic_state_helper.c | 9 ++++++++
> drivers/gpu/drm/drm_atomic_uapi.c | 26 ++++++++++++++++++++++
> drivers/gpu/drm/drm_blend.c | 30 ++++++++++++++++++++++++++
> include/drm/drm_blend.h | 1 +
> include/drm/drm_plane.h | 36 +++++++++++++++++++++++++++++++
> include/uapi/drm/drm_mode.h | 24 +++++++++++++++++++++
> 6 files changed, 126 insertions(+)

...

> diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c
> index c3c57bae06b7..273021cc21c8 100644
> --- a/drivers/gpu/drm/drm_blend.c
> +++ b/drivers/gpu/drm/drm_blend.c
> @@ -200,6 +200,10 @@
> * "FB":
> * Framebuffer source set by the "FB_ID" property.
> *
> + * solid_fill:
> + * solid_fill is set up with drm_plane_create_solid_fill_property(). It
> + * contains pixel data that drivers can use to fill a plane.
> + *
> * Note that all the property extensions described here apply either to the
> * plane or the CRTC (e.g. for the background color, which currently is not
> * exposed and assumed to be black).

...

> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> index 43691058d28f..1fd92886d66c 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -259,6 +259,30 @@ struct drm_mode_modeinfo {
> char name[DRM_DISPLAY_MODE_LEN];
> };
>
> +/**
> + * struct drm_mode_solid_fill - User info for solid fill planes
> + *
> + * This is the userspace API solid fill information structure.
> + *
> + * Userspace can enable solid fill planes by assigning the plane "solid_fill"
> + * property to a blob containing a single drm_mode_solid_fill struct populated with an RGB323232
> + * color and setting the pixel source to "SOLID_FILL".
> + *
> + * For information on the plane property, see drm_plane_create_solid_fill_property()
> + *
> + * @r: Red color value of single pixel
> + * @g: Green color value of single pixel
> + * @b: Blue color value of single pixel
> + * @pad: padding

Document that padding must be zero, and ensure userspace obeys that. If
there is ever need to re-purpose the pad field, requiring it to be zero
today makes re-purposing possible.

Alternatively, if it is likely that it might be used as alpha if
alpha-ful format is added, then it would make more sense to require it
to be 0xffffffff instead of zero. Then the kernel could internally
interpret it as alpha always without special-casing zero. Or, it could
be straight out called "alpha" to begin with, but document and verify
that it must be set to 0xffffffff which means opaque.

> + */
> +struct drm_mode_solid_fill {
> + __u32 r;
> + __u32 g;
> + __u32 b;
> + __u32 pad;
> +};
> +
> +
> struct drm_mode_card_res {
> __u64 fb_id_ptr;
> __u64 crtc_id_ptr;
>

Looking good.


Thanks,
pq


Attachments:
(No filename) (849.00 B)
OpenPGP digital signature