drm/amd/display: add plane degamma TF driver-specific property

Allow userspace to tell the kernel driver the input space and,
therefore, uses correct predefined transfer function (TF) to go from
encoded values to linear values.

v2:
- rename TF enum prefix from DRM_ to AMDGPU_ (Harry)
- remove HLG TF

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Co-developed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Joshua Ashton
2023-11-16 18:57:45 -01:00
committed by Alex Deucher
parent 571c2fa26a
commit d5a348d96e
4 changed files with 62 additions and 2 deletions

View File

@@ -724,6 +724,18 @@ struct amdgpu_dm_wb_connector {
extern const struct amdgpu_ip_block_version dm_ip_block;
enum amdgpu_transfer_function {
AMDGPU_TRANSFER_FUNCTION_DEFAULT,
AMDGPU_TRANSFER_FUNCTION_SRGB,
AMDGPU_TRANSFER_FUNCTION_BT709,
AMDGPU_TRANSFER_FUNCTION_PQ,
AMDGPU_TRANSFER_FUNCTION_LINEAR,
AMDGPU_TRANSFER_FUNCTION_UNITY,
AMDGPU_TRANSFER_FUNCTION_GAMMA22,
AMDGPU_TRANSFER_FUNCTION_GAMMA24,
AMDGPU_TRANSFER_FUNCTION_GAMMA26,
};
struct dm_plane_state {
struct drm_plane_state base;
struct dc_plane_state *dc_state;
@@ -737,6 +749,13 @@ struct dm_plane_state {
* The blob (if not NULL) is an array of &struct drm_color_lut.
*/
struct drm_property_blob *degamma_lut;
/**
* @degamma_tf:
*
* Predefined transfer function to tell DC driver the input space to
* linearize.
*/
enum amdgpu_transfer_function degamma_tf;
};
struct dm_crtc_state {