[PATCH 12/36] drm/amd/display: add plane shaper TF driver-private property

2023-05-23 Thread Melissa Wen
Add property to set predefined transfer function to enable delinearizing content with or without shaper LUT. Drivers should advertize this property acoording to HW caps. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 + drivers/gpu/drm/amd

[PATCH 19/36] drm/amd/display: handle MPC 3D LUT resources for a given context

2023-05-23 Thread Melissa Wen
lures properly. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/dc/core/dc.c | 39 drivers/gpu/drm/amd/display/dc/dc.h | 8 + 2 files changed, 47 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc

[PATCH 07/36] drm/amd/display: add plane driver-specific properties for degamma LUT

2023-05-23 Thread Melissa Wen
AMD_PRIVATE_COLOR. Co-developed-by: Joshua Ashton Signed-off-by: Joshua Ashton Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 8 ++ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 9 +++ .../amd/display/amdgpu_dm

[PATCH 18/36] drm/amd/display: allow BYPASS 3D LUT but keep shaper LUT settings

2023-05-23 Thread Melissa Wen
HW allows us to program shaper LUT without 3D LUT settings and it is also good for testing shaper LUT behavior, therefore, DC driver should allow acquiring both 3D and shaper LUT, but programing shaper LUT without 3D LUT (not initialized). Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd

[PATCH 17/36] drm/amd/display: copy 3D LUT settings from crtc state to stream_update

2023-05-23 Thread Melissa Wen
From: Joshua Ashton When commiting planes, we copy color mgmt resources to the stream state. Do the same for shaper and 3D LUTs. Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen Signed-off-by: Joshua Ashton --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 1 file

[PATCH 15/36] drm/amd/display: encapsulate atomic regamma operation

2023-05-23 Thread Melissa Wen
LUT programming and better understand each step, detach atomic regamma programming from the crtc colocr updating code. Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 53 --- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/drivers/gpu

[PATCH 08/36] drm/amd/display: add plane degamma TF driver-specific property

2023-05-23 Thread Melissa Wen
From: Joshua Ashton Allow userspace to tell the kernel driver the input space and, therefore, uses correct predefined transfer function (TF) to delinearize content with or without LUT. Signed-off-by: Joshua Ashton Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen --- drivers/gpu/drm

[PATCH 13/36] drm/amd/display: add plane blend LUT and TF driver-specific properties

2023-05-23 Thread Melissa Wen
D LUT. Drivers should advertize blend properties according to HW caps. Signed-off-by: Joshua Ashton Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 23 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 18 ++ .../gpu/dr

[PATCH 14/36] drm/amd/display: add comments to describe DM crtc color mgmt behavior

2023-05-23 Thread Melissa Wen
Describe some expected behavior of the AMD DM color mgmt programming. Signed-off-by: Melissa Wen --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b

[PATCH 09/36] drm/amd/display: add plane HDR multiplier driver-specific property

2023-05-23 Thread Melissa Wen
for SDR content, pass in (203.0 / 80.0). Signed-off-by: Joshua Ashton Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h| 4 drivers/gpu/drm/amd/display/amdgp

[PATCH 11/36] drm/amd/display: add plane shaper LUT driver-specific properties

2023-05-23 Thread Melissa Wen
On AMD HW, 3D LUT always assumes a preceding shaper 1D LUT used for delinearizing and/or normalizing the color space before applying a 3D LUT. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 + drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 10

[PATCH 10/36] drm/amd/display: add plane 3D LUT driver-specific properties

2023-05-23 Thread Melissa Wen
-linear space. Therefore, userpace may need one 1D LUT (shaper) before it to delinearize content and another 1D LUT after 3D LUT (blend) to linearize content again for blending. The next patches add these 1D LUTs to the plane color mgmt pipeline. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd

[PATCH 06/36] drm/amd/display: add CRTC driver-specific property for gamma TF

2023-05-23 Thread Melissa Wen
encoding with or without a user gamma LUT. Enumerated TFs are not supported yet by the DRM color pipeline, therefore, create a DRM enum list with the predefined TFs supported by the AMD display driver. Co-developed-by: Joshua Ashton Signed-off-by: Joshua Ashton Signed-off-by: Melissa Wen

[PATCH 05/36] drm/amd/display: fix the delta clamping for shaper LUT

2023-05-23 Thread Melissa Wen
ant 14-bit precision and discard the 4 most-significant bytes. To do that we'll do dc_fixpt_clamp_u0d14() & 0x3ff instead. Signed-off-by: Harry Wentland Signed-off-by: Melissa Wen --- .../gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c | 14 +++--- 1 file changed, 11 insertions(+), 3

[PATCH 03/36] drm/drm_plane: track color mgmt changes per plane

2023-05-23 Thread Melissa Wen
: Melissa Wen --- drivers/gpu/drm/drm_atomic.c | 1 + drivers/gpu/drm/drm_atomic_state_helper.c | 1 + include/drm/drm_plane.h | 7 +++ 3 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index c0dc5858a723

[PATCH 04/36] drm/amd/display: fix segment distribution for linear LUTs

2023-05-23 Thread Melissa Wen
points. With these changes an "identity" LUT looks visually indistinguishable from bypass and allows us to use our 3DLUT. Signed-off-by: Harry Wentland Signed-off-by: Melissa Wen --- .../amd/display/dc/dcn10/dcn10_cm_common.c| 93 +++ 1 file changed, 75 inserti

[PATCH 00/36] drm/amd/display: add AMD driver-specific properties for color mgmt

2023-05-23 Thread Melissa Wen
me results with and without the guard. Finally, I may have missed something, please let me know if that's the case. Best Regards, Melissa Wen [1] https://lore.kernel.org/dri-devel/20230423141051.702990-1-m...@igalia.com [2] https://github.com/ValveSoftware/gamescope/blob/master/src/do

[PATCH 01/36] drm/drm_mode_object: increase max objects to accommodate new color props

2023-05-23 Thread Melissa Wen
property. Signed-off-by: Melissa Wen --- include/drm/drm_mode_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h index 912f1e415685..08d7a7f0188f 100644 --- a/include/drm/drm_mode_object.h +++ b/include/drm

[PATCH 02/36] drm/drm_property: make replace_property_blob_from_id a DRM helper

2023-05-23 Thread Melissa Wen
Place it in drm_property where drm_property_replace_blob and drm_property_lookup_blob live. Then we can use the DRM helper for driver-specific KMS properties too. Signed-off-by: Melissa Wen --- drivers/gpu/drm/arm/malidp_crtc.c | 2 +- drivers/gpu/drm/drm_atomic_uapi.c | 43

Re: [RFC PATCH 00/40] drm/amd/display: add AMD driver-specific properties for color mgmt

2023-05-09 Thread Melissa Wen
On 05/08, Harry Wentland wrote: > > > On 4/23/23 10:10, Melissa Wen wrote: > > Hi all, > > > > Joshua Ashton and I (with the great collaboration of Harry Wentland - > > thanks) have been working on KMS color pipeline enhancement for Steam > > Deck/SteamOS

Re: [RFC PATCH 12/40] drm/amd/display: add plane HDR multiplier driver-private property

2023-05-09 Thread Melissa Wen
On 05/08, Harry Wentland wrote: > > > On 4/23/23 10:10, Melissa Wen wrote: > > From: Joshua Ashton > > > > Multiplier to 'gain' the plane. When PQ is decoded using the fixed func > > transfer function to the internal FP16 fb, 1.0 -> 80 nits (

Re: [RFC PATCH 09/40] drm/amd/display: move replace blob func to dm plane

2023-05-09 Thread Melissa Wen
On 05/08, Harry Wentland wrote: > > > On 4/23/23 10:10, Melissa Wen wrote: > > From amdgpu_dm_plane we can get it for both CRTC and plane color > > properties. We are adding new plane properties for AMD driver-private > > color mgmt. > > > > Signed-of

Re: [RFC PATCH 07/40] drm/amd/display: add CRTC gamma TF to driver-private props

2023-05-09 Thread Melissa Wen
On 05/08, Harry Wentland wrote: > > > On 4/23/23 10:10, Melissa Wen wrote: > > From: Joshua Ashton > > > > Add predefined transfer function property to DRM CRTC gamma to convert > > to wire encoding with or without gamma LUT. > > > > Are all t

Re: [RFC PATCH 05/40] drm/amd/display: add shaper LUT driver-private props

2023-05-09 Thread Melissa Wen
On 05/08, Harry Wentland wrote: > > > On 4/23/23 10:10, Melissa Wen wrote: > > CRTC shaper LUT shapes the content after blending, i.e., de-linearizes > > or normalizes space before applying a 3D LUT color correction. In the > > next patch, we add CRTC 3D LUT prope

Re: [RFC PATCH 03/40] drm/amd/display: introduce Steam Deck color features to AMD display driver

2023-05-09 Thread Melissa Wen
On 05/08, Harry Wentland wrote: > On 4/23/23 10:10, Melissa Wen wrote: > > We are enabling a large set of color calibration features to enhance KMS > > color mgmt but these properties are specific of AMD display HW, and > > cannot be provided by other vendors. Therefore, s

[RFC PATCH 40/40] drm/amd/display: allow newer DC hardware to use degamma ROM for PQ/HLG

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Need to funnel the color caps through to these functions so it can check that the hardware is capable. Signed-off-by: Joshua Ashton --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 34 --- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/dr

[RFC PATCH 39/40] drm/amd/display: copy dc_plane color settings to surface_updates

2023-04-23 Thread Melissa Wen
As per previous code, copy shaper, 3d and blend settings from dc_plane to surface_updates before commit. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm

[RFC PATCH 38/40] drm/amd/display: add DRM plane blend LUT and TF support

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Map DRM plane blend properties to DPP blend gamma. Plane blend is a post-3D LUT curve that linearizes color space for blending. It may be defined by a user-blob LUT and/or predefined transfer function. As hardcoded curve (ROM) is not supported on blend gamma, we use AMD color

[RFC PATCH 37/40] drm/amd/display: handle empty LUTs in __set_input_tf

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Unlike degamma, blend gamma doesn't support hardcoded curve (predefined/ROM), but we can use AMD color module to fill blend gamma parameters when we have non-linear plane gamma TF without plane gamma LUT. The regular degamma path doesn't hit this. Signed-off-by: Joshua Ashton

[RFC PATCH 36/40] drm/amd/display: add plane shaper/3D LUT and shaper TF support

2023-04-23 Thread Melissa Wen
We already have the steps to program post-blending shaper/3D LUT on AMD display driver, so that we can reuse them and map plane properties to DC plane for pre-blending (plane) shaper/3D LUT setup. Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 34

[RFC PATCH 35/40] drm/adm/display: add HDR multiplier support

2023-04-23 Thread Melissa Wen
From: Joshua Ashton With `dc_fixpt_from_s3132()` translation, we can just use it to set hdr_mult. Signed-off-by: Joshua Ashton --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 3 +++ 2 files changed, 4 insertions(+) d

[RFC PATCH 33/40] drm/amd/display: reject atomic commit if setting both plane and CRTC degamma

2023-04-23 Thread Melissa Wen
ff-by: Melissa Wen --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index 693168cc1d9c..07303c9f3618 100644 --- a/dr

[RFC PATCH 34/40] drm/amd/display: add dc_fixpt_from_s3132 helper

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Detach value translation from CTM to reuse it for programming HDR multiplier property. Signed-off-by: Joshua Ashton --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 8 +--- drivers/gpu/drm/amd/display/include/fixed31_32.h | 12 2 files change

[RFC PATCH 32/40] drm/amd/display: add support for plane degamma TF and LUT properties

2023-04-23 Thread Melissa Wen
From: Joshua Ashton We only set CRTC degamma if we don't have plane degamma LUT or TF to configure. We return -EINVAL if we don't have plane degamma settings, so we can continue and check CRTC degamma. Signed-off-by: Joshua Ashton --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +- .../

[RFC PATCH 31/40] drm/amd/display: decouple steps for mapping CRTC degamma to DC plane

2023-04-23 Thread Melissa Wen
combinations. Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 55 +-- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index

[RFC PATCH 30/40] drm/amd/display: mark plane as needing reset if plane color mgmt changes

2023-04-23 Thread Melissa Wen
hua Ashton Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 760080e4a4da..1dac311cab67 100644 --- a/driv

[RFC PATCH 29/40] drm/amd/display: add CRTC shaper TF support

2023-04-23 Thread Melissa Wen
igned-off-by: Melissa Wen --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index 6e72710

[RFC PATCH 26/40] drm/amd/display: add CRTC shaper LUT support to amd color pipeline

2023-04-23 Thread Melissa Wen
DRM CRTC shaper and 3D LUTs are optional properties, from our tests, AMD HW doesn't allow 3D LUT when shaper LUT is set to BYPASS (without user shaper LUT) Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 81 +-- 1 file changed, 38 insertions(+

[RFC PATCH 28/40] drm/amd/display: set sdr_ref_white_level to 80 for out_transfer_func

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Otherwise this is just initialized to 0. This needs to actually have a value so that compute_curve can work for PQ EOTF. Signed-off-by: Joshua Ashton --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu

[RFC PATCH 27/40] drm/amd/display: add CRTC regamma TF support

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Add predefined transfer function programming. There is no out gamma ROM, but we can use AMD color modules to program LUT parameters from a predefined TF and an empty regamma LUT (or power LUT parameters with predefined TF setup). Signed-off-by: Joshua Ashton --- .../amd/dis

[RFC PATCH 24/40] drm/amd/display: add CRTC 3D LUT support to amd color pipeline

2023-04-23 Thread Melissa Wen
color space before applying 3D LUT conversion. Signed-off-by: Melissa Wen --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 5 + .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 185 +++--- 3 files changed, 174 insertions(+), 24

[RFC PATCH 25/40] drm/amd/display: decouple steps to reuse in CRTC shaper LUT support

2023-04-23 Thread Melissa Wen
Decouple steps of post-blending shaper LUT setup and LUT size validation according to HW caps as a preparation for DRM CRTC shaper LUT support. Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 67 --- 1 file changed, 58 insertions(+), 9 deletions

[RFC PATCH 23/40] drm/amd/display: dynamically acquire 3DLUT resources for color changes

2023-04-23 Thread Melissa Wen
dynamically acquire 3D LUT resources when we actually use them, so we don't limit ourselves with the stream count. Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen Signed-off-by: Joshua Ashton --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++- .../gpu/drm/amd/display/amdg

[RFC PATCH 22/40] drm/amd/display: handle MPC 3D LUT resources for a given context

2023-04-23 Thread Melissa Wen
lures properly. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/dc/core/dc.c | 39 drivers/gpu/drm/amd/display/dc/dc.h | 8 + 2 files changed, 47 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc

[RFC PATCH 21/40] drm/amd/display: allow BYPASS 3D LUT but keep shaper LUT settings

2023-04-23 Thread Melissa Wen
HW allows us to program shaper LUT without 3D LUT settings and it is also good for testing shaper LUT behavior, therefore, DC driver should allow acquiring both 3D and shaper LUT, but programing shaper LUT without 3D LUT (not initialized). Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd

[RFC PATCH 20/40] drm/amd/display: copy 3D LUT settings from crtc state to stream_update

2023-04-23 Thread Melissa Wen
From: Joshua Ashton When commiting planes, we copy color mgmt resources to the stream state. Do the same for shaper and 3D LUTs. Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen Signed-off-by: Joshua Ashton --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 1 file

[RFC PATCH 18/40] drm/amd/display: encapsulate atomic regamma operation

2023-04-23 Thread Melissa Wen
introduce 3D LUT programming and better understand each step, detach atomic regamma programming from the crtc colocr updating code. Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 52 --- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a

[RFC PATCH 19/40] drm/amd/display: update lut3d and shaper lut to stream

2023-04-23 Thread Melissa Wen
It follows the same path of out_transfer_func for stream updates, since shaper LUT and 3D LUT is programmed in funcs.set_output_transfer_func() and this function is called in the atomic commit_tail when update_flags.bits.out_tf is set. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display

[RFC PATCH 17/40] drm/amd/display: add comments to describe DM crtc color mgmt behavior

2023-04-23 Thread Melissa Wen
Describe some expected behavior of the AMD DM color mgmt programming. Signed-off-by: Melissa Wen --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b

[RFC PATCH 16/40] drm/amd/display: add plane blend LUT and TF driver-private properties

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Blend 1D LUT or a predefined transfer function can be set to linearize content before blending, so that it's positioned just before blending planes, and after 3D LUT (non-linear space). Shaper and Blend LUTs are 1D LUTs that sandwich 3D LUT. Drivers should advertize blend prop

[RFC PATCH 15/40] drm/amd/display: add plane shaper TF driver-private property

2023-04-23 Thread Melissa Wen
Add property to set predefined transfer function to enable delinearizing content with or without shaper LUT. Drivers should advertize this property acoording to HW caps. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 + drivers/gpu/drm/amd

[RFC PATCH 13/40] drm/amd/display: add plane 3D LUT driver-private properties

2023-04-23 Thread Melissa Wen
next patches add these 1D LUTs to the plane color mgmt pipeline. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 10 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 5 .../amd/display

[RFC PATCH 14/40] drm/amd/display: add plane shaper LUT driver-private properties

2023-04-23 Thread Melissa Wen
Shaper 1D LUT delinearizes content before applying 3D LUT so that, it comes before 3D LUT. It's an optional property and drivers should attach it according to HW caps. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 ++ drivers/gpu/drm/amd/a

[RFC PATCH 12/40] drm/amd/display: add plane HDR multiplier driver-private property

2023-04-23 Thread Melissa Wen
for SDR content, pass in (203.0 / 80.0). Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen Signed-off-by: Joshua Ashton --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 + drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 4 +++ .../gpu/drm/amd/display/amdgpu_dm/

[RFC PATCH 10/40] drm/amd/display: add plane degamma LUT driver-private props

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Create driver-private properties (not DRM KMS generic) for plane degamma LUT (user-blob and its size). Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen Signed-off-by: Joshua Ashton --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 drivers/gpu/drm/amd

[RFC PATCH 11/40] drm/amd/display: add plane degamma TF driver-private property

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Allow userspace to tell the kernel driver the input space and, therefore, uses correct predefined transfer function (TF) to delinearize content with or without LUT (using hardcoded curve caps). Signed-off-by: Joshua Ashton --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c |

[RFC PATCH 09/40] drm/amd/display: move replace blob func to dm plane

2023-04-23 Thread Melissa Wen
>From amdgpu_dm_plane we can get it for both CRTC and plane color properties. We are adding new plane properties for AMD driver-private color mgmt. Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c| 37 +-- .../amd/display/amdgpu_dm/amdgpu_dm_plan

[RFC PATCH 07/40] drm/amd/display: add CRTC gamma TF to driver-private props

2023-04-23 Thread Melissa Wen
From: Joshua Ashton Add predefined transfer function property to DRM CRTC gamma to convert to wire encoding with or without gamma LUT. Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen Signed-off-by: Joshua Ashton --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 22

[RFC PATCH 08/40] drm/drm_plane: track color mgmt changes per plane

2023-04-23 Thread Melissa Wen
: Melissa Wen --- drivers/gpu/drm/drm_atomic.c | 1 + drivers/gpu/drm/drm_atomic_state_helper.c | 1 + include/drm/drm_plane.h | 7 +++ 3 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index c0dc5858a723

[RFC PATCH 04/40] drm/drm_mode_object: increase max objects to accommodate new color props

2023-04-23 Thread Melissa Wen
-generic, by now, increase max objs to 41. Signed-off-by: Melissa Wen --- include/drm/drm_mode_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h index 912f1e415685..7e4fb7536c6a 100644 --- a/include/drm

[RFC PATCH 06/40] drm/amd/display: add 3D LUT driver-private props

2023-04-23 Thread Melissa Wen
Add CRTC 3D LUT for gamma correction using a 3D lookup table. A shaper lut must be set to shape the content for a non-linear space. That details should be handled by the driver according to HW color capabilities. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14

[RFC PATCH 05/40] drm/amd/display: add shaper LUT driver-private props

2023-04-23 Thread Melissa Wen
CRTC shaper LUT shapes the content after blending, i.e., de-linearizes or normalizes space before applying a 3D LUT color correction. In the next patch, we add CRTC 3D LUT property to DRM color management after this shaper LUT and before the current CRTC gamma LUT. Signed-off-by: Melissa Wen

[RFC PATCH 03/40] drm/amd/display: introduce Steam Deck color features to AMD display driver

2023-04-23 Thread Melissa Wen
-developed-by: Joshua Ashton Signed-off-by: Joshua Ashton Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig index 06b438217c61..c45a8deb1098 100644

[RFC PATCH 02/40] drm/amd/display: fix the delta clamping for shaper LUT

2023-04-23 Thread Melissa Wen
From: Harry Wentland The shaper LUT requires a 10-bit value of the delta between segments. We were using dc_fixpt_clamp_u0d10() to do that but it doesn't do what we want it to do. It will preserve 10-bit precision after the decimal point, but that's not quite what we want. We want 14-bit precisio

[RFC PATCH 01/40] drm/amd/display: fix segment distribution for linear LUTs

2023-04-23 Thread Melissa Wen
From: Harry Wentland The region and segment calculation was incapable of dealing with regions of more than 16 segments. We first fix this. Now that we can support regions up to 256 elements we can define a better segment distribution for near-linear LUTs for our maximum of 256 HW-supported point

[RFC PATCH 00/40] drm/amd/display: add AMD driver-specific properties for color mgmt

2023-04-23 Thread Melissa Wen
know your thoughts. Best Regards, Signed-off-by: Joshua Ashton Signed-off-by: Melissa Wen [1] https://lore.kernel.org/dri-devel/20220619223104.667413-1-m...@igalia.com/ [2] https://lore.kernel.org/amd-gfx/20220906164628.2361811-1-m...@igalia.com/ [3] https://lore.kernel.org/dri-devel/20230109143846.

Re: [PATCH] drm/amd/display: Set MPC_SPLIT_DYNAMIC for DCN301

2023-03-11 Thread Melissa Wen
my previous tests on HW rotation, I don't see glitches when splitting pipe, the issue only appears on one-pipe setup, but Xaver is the best person to validate this on KDE environment. Thanks, Reviewed-by: Melissa Wen > > Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2247 > Cc: Me

[PATCH 6/6] drm/amd/display: remove unused _calculate_degamma_curve function

2023-02-14 Thread Melissa Wen
We don't use this function anywhere, therefore, remove it. Signed-off-by: Melissa Wen --- .../amd/display/modules/color/color_gamma.c | 86 --- .../amd/display/modules/color/color_gamma.h | 3 - 2 files changed, 89 deletions(-) diff --git a/drivers/gpu/drm/amd/di

[PATCH 2/6] drm/amd/display: clean code-style issues in dcn30_set_mpc_shaper_3dlut

2023-02-14 Thread Melissa Wen
This function has many conditions and all code style issues (identation, missing braces, etc.) make reading it really annoying. Signed-off-by: Melissa Wen --- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c| 37 ++- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a

[PATCH 4/6] drm/amd/display: unset initial value for tf since it's never used

2023-02-14 Thread Melissa Wen
In mod_color_calculate_{degamma/regamma}_params(), a tf variable is initialized as TRANSFER_FUNCTION_SRGB but tf is only used after tf = input->tf, therefore, better to just remove this initial value and avoid misleading interpretations. Signed-off-by: Melissa Wen --- drivers/gpu/drm/

[PATCH 5/6] drm/amd/display: remove unused func declaration from resource headers

2023-02-14 Thread Melissa Wen
The function resource_validate_ctx_update_pointer_after_copy() is declared in resource.h but never defined, therefore, remove its declaration from headers. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/dc/inc/resource.h | 4 1 file changed, 4 deletions(-) diff --git a/drivers

[PATCH 3/6] drm/amd/display: camel case cleanup in color_gamma file

2023-02-14 Thread Melissa Wen
Rename mapUserRamp to map_user_ramp and doClamping to do_clamping Signed-off-by: Melissa Wen --- .../amd/display/modules/color/color_gamma.c | 50 ++- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b

[PATCH 1/6] drm/amd/display: ident braces in dcn30_acquire_post_bldn_3dlut correctly

2023-02-14 Thread Melissa Wen
Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c index feb4bb491525..60bb5634b6e2

[PATCH 0/6] Trivial code cleanup around color resources

2023-02-14 Thread Melissa Wen
"remove unused _calculate_degamma_curve" since this could just be a matter of missing parts. If so, happy to remove the patch and include a comment describing the situation (or the potential usage of it). Thanks, Melissa [1] https://lore.kernel.org/dri-devel/20230109143846.1966301-1-m...

Re: [RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface

2023-02-13 Thread Melissa Wen
On 02/13, Ville Syrjälä wrote: > On Mon, Feb 13, 2023 at 11:01:31AM +0200, Pekka Paalanen wrote: > > On Fri, 10 Feb 2023 14:47:50 -0500 > > Harry Wentland wrote: > > > > > On 2/10/23 04:28, Pekka Paalanen wrote: > > > > On Thu, 9 Feb 2023

Re: [RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface

2023-02-13 Thread Melissa Wen
On 02/10, Pekka Paalanen wrote: > On Thu, 9 Feb 2023 13:27:02 -0100 > Melissa Wen wrote: > > > On 01/31, Pekka Paalanen wrote: > > > On Mon, 9 Jan 2023 14:38:09 -0100 > > > Melissa Wen wrote: > > > > > > > On 01/09, Melissa Wen wrote:

Re: [RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface

2023-02-09 Thread Melissa Wen
On 01/31, Pekka Paalanen wrote: > On Mon, 9 Jan 2023 14:38:09 -0100 > Melissa Wen wrote: > > > On 01/09, Melissa Wen wrote: > > > Hi, > > > > > > After collecting comments in different places, here is a second version > > > of the work on addi

[PATCH] drm/amd/display: fix glitches on hw rotation without pipe split

2023-02-07 Thread Melissa Wen
Fix glitches when moving cursor close to the edge on a rotated screen for drivers with one pipe (without pipe split) by halving dst_x_offset. Reported-by: Xaver Hugl Signed-off-by: Melissa Wen --- Hi, I'm not sure if having dst_x_offset (or only for the one pipe case) is the right sol

[PATCH] drm/amd/display: fix cursor offset on rotation 180

2023-01-31 Thread Melissa Wen
osition on horizontal mirror") Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10

Re: [PATCH 2/2] drm/amd/display: Remove unused display_content_support

2023-01-19 Thread Melissa Wen
; > - } bits; > -}; > - > struct dc_panel_patch { > unsigned int dppowerup_delay; > unsigned int extra_t12_ms; > @@ -219,8 +207,6 @@ struct dc_edid_caps { > uint32_t audio_latency; > uint32_t video_latency; > > - union display_conte

Re: [PATCH 1/2] drm/amd/display: Hook up 'content type' property for HDMI

2023-01-19 Thread Melissa Wen
On 01/17, Joshua Ashton wrote: > Implements the 'content type' property for HDMI connectors. > Verified by checking the avi infoframe on a connected TV. > > This also simplifies a lot of the code in that area as well, there were > a lot of temp variables doing very little and unnecessary logic > t

Re: [PATCH] drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix

2023-01-16 Thread Melissa Wen
tag here to: Fixes: 40df2f809e8f ("drm/amd/display: color space ycbcr709 support") Thanks, Reviewed-by: Melissa Wen { COLOR_SPACE_YCBCR709_BLACK_TYPE, { 0x, 0x, 0x, 0x1000, 0x, 0x, 0x, 0x0200, 0x, 0

Re: [PATCH v2] drm/amd/display: Calculate output_color_space after pixel encoding adjustment

2023-01-16 Thread Melissa Wen
On 01/16, Melissa Wen wrote: > On 01/10, Joshua Ashton wrote: > > Code in get_output_color_space depends on knowing the pixel encoding to > > determine whether to pick between eg. COLOR_SPACE_SRGB or > > COLOR_SPACE_YCBCR709 for transparent RGB -> YCbCr 4:4:4 in the dr

Re: [PATCH v2] drm/amd/display: Calculate output_color_space after pixel encoding adjustment

2023-01-16 Thread Melissa Wen
stream->output_color_space = get_output_color_space(timing_out); LGTM. I see that we were ignoring the updated value of pixel_encoding in the previous point. Nice catch! Reviewed-by: Melissa Wen > } > > static void fill_audio_info(struct audio_info *audio_info, > -- > 2.39.0 > signature.asc Description: PGP signature

Re: [RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface

2023-01-09 Thread Melissa Wen
On 01/09, Melissa Wen wrote: > Hi, > > After collecting comments in different places, here is a second version > of the work on adding DRM CRTC 3D LUT support to the current DRM color > mgmt interface. In comparison to previous proposals [1][2][3], here we > add 3D LUT before

[RFC PATCH v2 16/18] drm/amd/display: add user 3D LUT support to the amdgpu_dm color pipeline

2023-01-09 Thread Melissa Wen
CRTC color management") dc_acquire_release_mpc_3dlut initializes the bits required to program 3DLUT in DC MPC hw block, that is applied by set_output_transfer_func(). I still need to double check the timing to acquire and release shaper and 3D LUTs from the resource pool. Signed-off-by: M

[RFC PATCH v2 18/18] drm/amd/display: add user shaper LUT support to amdgpu_dm color pipeline

2023-01-09 Thread Melissa Wen
Now, we can use shaper LUT to delinearize and/or normalize the color space for a more efficient 3D LUT support (so far, only for DRM atomic color mgmt). If a degamma 1D LUT is passed to linearize the color space, a custom shaper 1D LUT can be used before applying 3D LUT. Signed-off-by: Melissa

[RFC PATCH v2 17/18] drm/amd/display: decouple steps to reuse in shaper LUT support

2023-01-09 Thread Melissa Wen
Decouple steps of shaper LUT setup and LUT size validation according to HW caps as a preparation for shaper LUT support. Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 22 --- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers

[RFC PATCH v2 14/18] drm/amd/display: expand array of supported 3D LUT modes

2023-01-09 Thread Melissa Wen
AMD MPC block support 3D LUTs of dimensions 17 and 9, and also bit depth 12 and 10, therefore, advertise them to the userspace. Signed-off-by: Melissa Wen --- .../amd/display/modules/color/color_gamma.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/drivers/gpu/drm

[RFC PATCH v2 10/18] drm/amd/display: update lut3d and shaper lut to stream

2023-01-09 Thread Melissa Wen
It follows the same path of out_transfer_func for stream updates, since shaper LUT and 3D LUT is programmed in funcs.set_output_transfer_func() and this function is called in the atomic commit_tail when update_flags.bits.out_tf is set. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display

[RFC PATCH v2 15/18] drm/amd/display: enable 3D-LUT DRM properties if supported

2023-01-09 Thread Melissa Wen
Enable DRM crtc properties related to 3D LUT resources (shaper LUT, 3D LUT and 3D LUT modes) if it's supported by DCN HW, that means DCN families 3.0+ Signed-off-by: Melissa Wen --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 + .../amd/display/amdgpu_dm/amdgpu_dm_color.c

[RFC PATCH v2 13/18] drm/amd/display: Define 3D LUT struct for HDR planes

2023-01-09 Thread Melissa Wen
From: Alex Hung Add a 3D LUT mode supported by amdgpu driver. Note: A patchset "IGT tests for pre-blending 3D LUT interfaces" for this proposal is sent to IGT mailing list. Signed-off-by: Alex Hung --- .../gpu/drm/amd/display/modules/color/color_gamma.h | 12 1 file changed, 12

[RFC PATCH v2 12/18] drm/amd/display: acquire/release 3D LUT resources for ctx on DCN301

2023-01-09 Thread Melissa Wen
Acquire and release 3D LUT and shaper LUT every time we create/remove a new ctx and add/remove stream to/from it. 3D LUT acquire/release can fail and therefore we should check its availability during atomic check considering the new context created not the current one. Signed-off-by: Melissa Wen

[RFC PATCH v2 11/18] drm/amd/display: handle MPC 3D LUT resources for a given context

2023-01-09 Thread Melissa Wen
lures properly. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/dc/core/dc.c | 39 drivers/gpu/drm/amd/display/dc/dc.h | 8 + 2 files changed, 47 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc

[RFC PATCH v2 09/18] drm/amd/display: encapsulate atomic regamma operation

2023-01-09 Thread Melissa Wen
introduce 3D LUT programming and better understand each step, detach atomic regamma programming from the crtc colocr updating code. Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 52 --- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a

[RFC PATCH v2 08/18] drm/amd/display: add comments to describe DM crtc color mgmt behavior

2023-01-09 Thread Melissa Wen
Describe some expected behavior of the AMD DM color mgmt programming. Signed-off-by: Melissa Wen --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b

[RFC PATCH v2 07/18] drm/amd/display: remove unused regamma condition

2023-01-09 Thread Melissa Wen
oid misunderstandings here. Signed-off-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 32 ++- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu

[RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface

2023-01-09 Thread Melissa Wen
oughts. Thanks, Melissa Alex Hung (2): drm: Add 3D LUT mode and its attributes drm/amd/display: Define 3D LUT struct for HDR planes Melissa Wen (16): drm/drm_color_mgmt: add shaper LUT to color mgmt properties drm/drm_color_mgmt: add 3D LUT props to DRM color mgmt drm/drm_color_mgmt:

[PATCH] drm/amd/display: don't enable DRM CRTC degamma property for DCE

2022-11-03 Thread Melissa Wen
mma in DCE, therefore, DRM CRTC degamma property shouldn't be enabled for DCE drivers. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdg

[RFC PATCH v2 9/9] drm/amd/display: enable DRM shaper and 3D LUT properties

2022-09-06 Thread Melissa Wen
Shaper LUT and 3D LUT programming is done, so make the DRM color properties available. Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b

<    1   2   3   4   5   >