diff --git a/backend/drm/drm.c b/backend/drm/drm.c index cefc14a60..b2e7c03fe 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -191,6 +191,12 @@ static bool init_color_pipeline(struct wlr_drm_backend *drm, } colorop->size = size; break; + case DRM_COLOROP_1D_CURVE: + if (!introspect_drm_prop_enum(drm->fd, colorop->props.curve_1d_type, + &colorop->curve_1d_types)) { + return false; + } + break; } id = (uint32_t)next; diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 22da263f6..8b14ccb81 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -24,6 +24,7 @@ struct wlr_drm_colorop { uint32_t id; uint32_t type; // enum drm_colorop_type uint32_t size; // for 1D_LUT, 3D_LUT + uint64_t curve_1d_types; // for 1D_CURVE, bitmask of 1 << WLR_DRM_COLOROP_1D_CURVE_* struct wlr_drm_colorop_props props; struct wl_list link; // wlr_drm_plane.color_pipelines diff --git a/include/backend/drm/properties.h b/include/backend/drm/properties.h index e18f87cf3..17405bf47 100644 --- a/include/backend/drm/properties.h +++ b/include/backend/drm/properties.h @@ -84,6 +84,18 @@ enum wlr_drm_color_range { WLR_DRM_COLOR_YCBCR_LIMITED_RANGE, }; +// Equivalent to drm_colorop_curve_1d_type defined in the kernel (but not exported) +enum wlr_drm_colorop_curve_1d_type { + WLR_DRM_COLOROP_1D_CURVE_SRGB_EOTF, + WLR_DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF, + WLR_DRM_COLOROP_1D_CURVE_PQ_125_EOTF, + WLR_DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF, + WLR_DRM_COLOROP_1D_CURVE_BT2020_INV_OETF, + WLR_DRM_COLOROP_1D_CURVE_BT2020_OETF, + WLR_DRM_COLOROP_1D_CURVE_GAMMA22, + WLR_DRM_COLOROP_1D_CURVE_GAMMA22_INV, +}; + struct wlr_drm_colorop_props { uint32_t type; uint32_t next;