drm/amd/display: add plane HDR multiplier driver-specific property

Multiplier to 'gain' the plane. When PQ is decoded using the fixed func
transfer function to the internal FP16 fb, 1.0 -> 80 nits (on AMD at
least) When sRGB is decoded, 1.0 -> 1.0.  Therefore, 1.0 multiplier = 80
nits for SDR content. So if you want, 203 nits for SDR content, pass in
(203.0 / 80.0).

v4:
- comment about the PQ TF need for L-to-NL (from Harry's review)

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:48 -01:00
committed by Alex Deucher
parent e4cddd51bf
commit ec7b2a5546
4 changed files with 40 additions and 0 deletions

View File

@@ -55,6 +55,9 @@
#define HDMI_AMD_VENDOR_SPECIFIC_DATA_BLOCK_IEEE_REGISTRATION_ID 0x00001A
#define AMD_VSDB_VERSION_3_FEATURECAP_REPLAYMODE 0x40
#define HDMI_AMD_VENDOR_SPECIFIC_DATA_BLOCK_VERSION_3 0x3
#define AMDGPU_HDR_MULT_DEFAULT (0x100000000LL)
/*
#include "include/amdgpu_dal_power_if.h"
#include "amdgpu_dm_irq.h"
@@ -767,6 +770,20 @@ struct dm_plane_state {
* linearize.
*/
enum amdgpu_transfer_function degamma_tf;
/**
* @hdr_mult:
*
* Multiplier to 'gain' the plane. When PQ is decoded using the fixed
* func transfer function to the internal FP16 fb, 1.0 -> 80 nits (on
* AMD at least). When sRGB is decoded, 1.0 -> 1.0, obviously.
* Therefore, 1.0 multiplier = 80 nits for SDR content. So if you
* want, 203 nits for SDR content, pass in (203.0 / 80.0). Format is
* S31.32 sign-magnitude.
*
* HDR multiplier can wide range beyond [0.0, 1.0]. This means that PQ
* TF is needed for any subsequent linear-to-non-linear transforms.
*/
__u64 hdr_mult;
};
struct dm_crtc_state {