Skip to contentSkip to conversation

drm/amd/display: Don't program bypass on linear regamma LUT

PATCH In review Harry Wentland 2 participants 2 messages Apr 16, 2018 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 for regamma.

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

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +0 -7
index ef5fad8c5aac..e3d90e918d1b 100644
@@ -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;
Signature · 6 lines
2.17.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180416193945.7601-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 7 lines · 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.

Thanks Harry,

Quoted 13 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 7 -------
  1 file changed, 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +0 -0
index ef5fad8c5aac..e3d90e918d1b 100644
@@ -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);
 

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c int amdgpu_dm_set_regamma_lut(struct dm_crtc_state *crtc) · line 144

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +0 -7
-	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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx