All of lore.kernel.org
 help / color / mirror / Atom feed
* Gamma problem after 4096 LUT entries change
@ 2018-04-15  9:37 Môshe van der Sterre
       [not found] ` <235ddff0-f299-264b-1d6c-a97a6012e8dc-A/3C56C7qwM@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Môshe van der Sterre @ 2018-04-15  9:37 UTC (permalink / raw)
  To: Leo (Sunpeng) Li
  Cc: Alex Deucher, Harry Wentland, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 609 bytes --]

Hello Leo Li,

The current mainline has a gamma regression for me, running wayland on a 
Ryzen 5 2400G (integrated gpu). Colors are much too dark after the 
following commit:
086247a4b2fb "drm/amd/display: Use 4096 lut entries"

 From this commit alone I cannot deduce how to properly address the 
problem. Reverting restores the correct colors. Unfortunately, I have no 
other amdgpu hardware to test if this is specific to the integrated gpu 
or not.

I'll gladly test possible fixes or debug a little further if you can 
point me in the right direction.

Thanks,
Môshe van der Sterre



[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3974 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Gamma problem after 4096 LUT entries change
       [not found] ` <235ddff0-f299-264b-1d6c-a97a6012e8dc-A/3C56C7qwM@public.gmane.org>
@ 2018-04-16 14:07   ` Harry Wentland
       [not found]     ` <7e45e177-ce05-746a-d91d-1917f3257de1-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Harry Wentland @ 2018-04-16 14:07 UTC (permalink / raw)
  To: Môshe van der Sterre, Leo (Sunpeng) Li
  Cc: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

On 2018-04-15 05:37 AM, Môshe van der Sterre wrote:
> Hello Leo Li,
> 
> The current mainline has a gamma regression for me, running wayland on a Ryzen 5 2400G (integrated gpu). Colors are much too dark after the following commit:
> 086247a4b2fb "drm/amd/display: Use 4096 lut entries"
> 
> From this commit alone I cannot deduce how to properly address the problem. Reverting restores the correct colors. Unfortunately, I have no other amdgpu hardware to test if this is specific to the integrated gpu or not.
> 
> I'll gladly test possible fixes or debug a little further if you can point me in the right direction.
> 

Can you give attached patch a spin. We'll probably merge it or a variant of it soon.

Harry

> Thanks,
> Môshe van der Sterre
> 
> 

[-- Attachment #2: 0001-drm-amd-display-Don-t-program-bypass-on-linear-regam.patch --]
[-- Type: text/x-patch, Size: 1976 bytes --]

>From 9adc614f258ba021aa70eeed92ecb0613406cf09 Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
Date: Thu, 12 Apr 2018 16:37:09 -0400
Subject: [PATCH] drm/amd/display: Don't program bypass on linear regamma LUT

Even though this is required for degamma since DCE HW only supports a
couple predefined LUTs we can just program the LUT directly.

This fixes dark screens which occurs when we program regamma to bypass
while degamma is using srgb LUT.

Signed-off-by: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c  | 12 +++++-------
 1 file changed, 5 insertions(+), 7 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 ef5fad8c5aac..59e993ad1209 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
@@ -133,19 +133,15 @@ int amdgpu_dm_set_regamma_lut(struct dm_crtc_state *crtc)
 		/* By default, use the SRGB predefined curve.*/
 		stream->out_transfer_func->type = TF_TYPE_PREDEFINED;
 		stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB;
+
+		DRM_DEBUG_KMS("Using pre-defined regamma\n");
+
 		return 0;
 	}
 
 	lut = (struct drm_color_lut *)blob->data;
 	lut_size = blob->length / sizeof(struct drm_color_lut);
 
-	if (__is_lut_linear(lut, lut_size)) {
-		/* Set to bypass if lut is set to linear */
-		stream->out_transfer_func->type = TF_TYPE_BYPASS;
-		stream->out_transfer_func->tf = TRANSFER_FUNCTION_LINEAR;
-		return 0;
-	}
-
 	gamma = dc_create_gamma();
 	if (!gamma)
 		return -ENOMEM;
@@ -161,6 +157,8 @@ int amdgpu_dm_set_regamma_lut(struct dm_crtc_state *crtc)
 		return -EINVAL;
 	}
 
+	DRM_DEBUG_KMS("Using regamma with %d entries\n", lut_size);
+
 	/* Convert drm_lut into dc_gamma */
 	__drm_lut_to_dc_gamma(lut, gamma, gamma->type == GAMMA_RGB_256);
 
-- 
2.17.0


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Gamma problem after 4096 LUT entries change
       [not found]     ` <7e45e177-ce05-746a-d91d-1917f3257de1-5C7GfCeVMHo@public.gmane.org>
@ 2018-04-16 18:48       ` Môshe van der Sterre
  0 siblings, 0 replies; 3+ messages in thread
From: Môshe van der Sterre @ 2018-04-16 18:48 UTC (permalink / raw)
  To: Harry Wentland
  Cc: Leo (Sunpeng) Li, Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 04/16/2018 04:07 PM, Harry Wentland wrote:
> On 2018-04-15 05:37 AM, Môshe van der Sterre wrote:
>> Hello Leo Li,
>>
>> The current mainline has a gamma regression for me, running wayland on a Ryzen 5 2400G (integrated gpu). Colors are much too dark after the following commit:
>> 086247a4b2fb "drm/amd/display: Use 4096 lut entries"
>>
>>  From this commit alone I cannot deduce how to properly address the problem. Reverting restores the correct colors. Unfortunately, I have no other amdgpu hardware to test if this is specific to the integrated gpu or not.
>>
>> I'll gladly test possible fixes or debug a little further if you can point me in the right direction.
>>
> Can you give attached patch a spin. We'll probably merge it or a variant of it soon.
>
> Harry
Thank you Harry. The patch works on my system.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-16 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-15  9:37 Gamma problem after 4096 LUT entries change Môshe van der Sterre
     [not found] ` <235ddff0-f299-264b-1d6c-a97a6012e8dc-A/3C56C7qwM@public.gmane.org>
2018-04-16 14:07   ` Harry Wentland
     [not found]     ` <7e45e177-ce05-746a-d91d-1917f3257de1-5C7GfCeVMHo@public.gmane.org>
2018-04-16 18:48       ` Môshe van der Sterre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.