Skip to contentSkip to conversation

drm/amd/display: fix cursor black issue

PATCH In review tiancyin 2 participants 2 messages Apr 3, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

tiancyin

author
#0 lore raw

PATCH 1/1 drm/amd/display: fix cursor black issue

[Why]
the member sdr_white_level of struct dc_cursor_attributes was not initialized, then the random value result that dcn10_set_cursor_sdr_white_level() set error hw_scale value 0x20D9(normal value is 0x3c00), this cause the black cursor issue.

[how]
just initilize the obj of struct dc_cursor_attributes to zero to avoid the random value.

Change-Id I07a53a48a33940cfb6006ed3738583f9703c7993
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index 744acd8..0343ff1 100644
@@ -5062,7 +5062,7 @@ static void handle_cursor_update(struct drm_plane *plane,
 	struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
 	uint64_t address = afb ? afb->address : 0;
 	struct dc_cursor_position position;
-	struct dc_cursor_attributes attributes;
+	struct dc_cursor_attributes attributes = {0};
 	int ret;
 
 	if (!plane->state->fb && !old_plane_state->fb)
Signature · 6 lines
2.7.4

_______________________________________________
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): 1554258377-4594-1-git-send-email-tianci.yin-5C7GfCeVMHo@public.gmane.org

Reviewed-by Nicholas Kazlauskas
#2 lore raw
Quoted 21 lines · tiancyin

[Why]
the member sdr_white_level of struct dc_cursor_attributes was not initialized, then the random value result that dcn10_set_cursor_sdr_white_level() set error hw_scale value 0x20D9(normal value is 0x3c00), this cause the black cursor issue.

[how]
just initilize the obj of struct dc_cursor_attributes to zero to avoid the random value.

Change-Id I07a53a48a33940cfb6006ed3738583f9703c7993
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index 744acd8..0343ff1 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void handle_cursor_update(struct drm_plane *plane, · line 5065

Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -5062,7 +5062,7 @@ static void handle_cursor_update(struct drm_plane *plane,
  	struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
  	uint64_t address = afb ? afb->address : 0;
  	struct dc_cursor_position position;
-	struct dc_cursor_attributes attributes;
+	struct dc_cursor_attributes attributes = {0};

It's probably best to make this a memset instead since we've had compilers complain about brace / aggregate initialization before.

With that change this patch is:

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void handle_cursor_update(struct drm_plane *plane, · line 5068

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
  	int ret;
 
  	if (!plane->state->fb && !old_plane_state->fb)

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