backend/drm: enumerate plane color pipelines

This commit is contained in:
Simon Ser 2025-12-07 00:12:46 +01:00
parent bd99e8c2bd
commit fd0a4dc40e
4 changed files with 121 additions and 0 deletions

View file

@ -20,6 +20,14 @@ struct wlr_drm_viewport {
struct wlr_box dst_box;
};
struct wlr_drm_colorop {
uint32_t id;
uint32_t type; // enum drm_colorop_type
struct wlr_drm_colorop_props props;
struct wl_list link; // wlr_drm_plane.color_pipelines
};
struct wlr_drm_plane {
uint32_t type;
uint32_t id;
@ -43,6 +51,9 @@ struct wlr_drm_plane {
struct wlr_output_cursor_size *cursor_sizes;
size_t cursor_sizes_len;
struct wl_list *color_pipelines; // wlr_drm_colorop.link
size_t color_pipelines_len;
struct wlr_drm_plane_props props;
uint32_t initial_crtc_id;

View file

@ -68,6 +68,7 @@ struct wlr_drm_plane_props {
uint32_t color_encoding; // Not guaranteed to exist
uint32_t color_range; // Not guaranteed to exist
uint32_t color_pipeline; // Not guaranteed to exist
};
// Equivalent to wlr_drm_color_encoding defined in the kernel (but not exported)
@ -83,10 +84,21 @@ enum wlr_drm_color_range {
WLR_DRM_COLOR_YCBCR_LIMITED_RANGE,
};
struct wlr_drm_colorop_props {
uint32_t type;
uint32_t next;
uint32_t bypass;
uint32_t data; // for 1D_LUT, CTM_3X4, 3D_LUT
uint32_t size; // for 1D_LUT, 3D_LUT
uint32_t curve_1d_type; // for 1D_CURVE
uint32_t multiplier; // for MULTIPLIER
};
bool get_drm_connector_props(int fd, uint32_t id,
struct wlr_drm_connector_props *out);
bool get_drm_crtc_props(int fd, uint32_t id, struct wlr_drm_crtc_props *out);
bool get_drm_plane_props(int fd, uint32_t id, struct wlr_drm_plane_props *out);
bool get_drm_colorop_props(int fd, uint32_t id, struct wlr_drm_colorop_props *out);
bool get_drm_prop(int fd, uint32_t obj, uint32_t prop, uint64_t *ret);
void *get_drm_prop_blob(int fd, uint32_t obj, uint32_t prop, size_t *ret_len);