All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Don't program bypass on linear regamma LUT
@ 2018-04-16 19:39 Harry Wentland
       [not found] ` <20180416193945.7601-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Harry Wentland @ 2018-04-16 19:39 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Harry Wentland

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

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@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 7 -------
 1 file changed, 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..e3d90e918d1b 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
@@ -139,13 +139,6 @@ int amdgpu_dm_set_regamma_lut(struct dm_crtc_state *crtc)
 	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;
-- 
2.17.0

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

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

* Re: [PATCH] drm/amd/display: Don't program bypass on linear regamma LUT
       [not found] ` <20180416193945.7601-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
@ 2018-04-16 19:48   ` Leo Li
  0 siblings, 0 replies; 2+ messages in thread
From: Leo Li @ 2018-04-16 19:48 UTC (permalink / raw)
  To: Harry Wentland, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW



On 2018-04-16 03:39 PM, Harry Wentland wrote:
> Even though this is required for degamma since DCE HW only supports a
> couple predefined LUTs we can just program the LUT directly for regamma.
> 
> 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@amd.com>

Thanks Harry,

Reviewed-by: Leo Li <sunpeng.li@amd.com>

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 7 -------
>   1 file changed, 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..e3d90e918d1b 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
> @@ -139,13 +139,6 @@ int amdgpu_dm_set_regamma_lut(struct dm_crtc_state *crtc)
>   	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;
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16 19:39 [PATCH] drm/amd/display: Don't program bypass on linear regamma LUT Harry Wentland
     [not found] ` <20180416193945.7601-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-04-16 19:48   ` Leo Li

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.