drm: Introduce pixel_source DRM plane property

Add support for pixel_source property to drm_plane and related
documentation. In addition, force pixel_source to
DRM_PLANE_PIXEL_SOURCE_FB in DRM_IOCTL_MODE_SETPLANE as to not break
legacy userspace.

This enum property will allow user to specify a pixel source for the
plane. Possible pixel sources will be defined in the
drm_plane_pixel_source enum.

Currently, the only pixel sources are DRM_PLANE_PIXEL_SOURCE_FB (the
default value) and DRM_PLANE_PIXEL_SOURCE_NONE.

Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Sebastian Wick <sebastian@sebastianwick.net>
Acked-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231027-solid-fill-v7-1-780188bfa7b2@quicinc.com
This commit is contained in:
Jessica Zhang
2023-10-27 15:32:51 -07:00
committed by Dmitry Baryshkov
parent 70e67aaec2
commit e50e5fed41
6 changed files with 137 additions and 4 deletions

View File

@@ -58,4 +58,6 @@ int drm_atomic_normalize_zpos(struct drm_device *dev,
struct drm_atomic_state *state);
int drm_plane_create_blend_mode_property(struct drm_plane *plane,
unsigned int supported_modes);
int drm_plane_create_pixel_source_property(struct drm_plane *plane,
unsigned long extra_sources);
#endif

View File

@@ -40,6 +40,12 @@ enum drm_scaling_filter {
DRM_SCALING_FILTER_NEAREST_NEIGHBOR,
};
enum drm_plane_pixel_source {
DRM_PLANE_PIXEL_SOURCE_NONE,
DRM_PLANE_PIXEL_SOURCE_FB,
DRM_PLANE_PIXEL_SOURCE_MAX
};
/**
* struct drm_plane_state - mutable plane state
*
@@ -120,6 +126,14 @@ struct drm_plane_state {
/** @hotspot_y: y offset to mouse cursor hotspot */
int32_t hotspot_x, hotspot_y;
/**
* @pixel_source:
*
* Source of pixel information for the plane. See
* drm_plane_create_pixel_source_property() for more details.
*/
enum drm_plane_pixel_source pixel_source;
/**
* @alpha:
* Opacity of the plane with 0 as completely transparent and 0xffff as
@@ -713,6 +727,13 @@ struct drm_plane {
*/
struct drm_plane_state *state;
/*
* @pixel_source_property:
* Optional pixel_source property for this plane. See
* drm_plane_create_pixel_source_property().
*/
struct drm_property *pixel_source_property;
/**
* @alpha_property:
* Optional alpha property for this plane. See