summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-12-02 21:09:07 +0000
committerAlex Deucher <alexander.deucher@amd.com>2020-12-02 17:39:29 -0500
commit03a663673063d04c2358be754a08e62a465bb8f0 (patch)
treee5d2743ee0fa457f33d9fe541cacb5766675941e /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
parentea9522f5e59d35a8774a6c68e98fc9d1f240a8f8 (diff)
drm/amd/display: use FB pitch to fill dc_cursor_attributes
Instead of relying on pitch (in pixels) == width, use the FB pitch. This is less confusing to readers, and works correctly if we ever support FBs with a pitch (in pixels) != width. This also makes the code symmetrical with fill_plane_buffer_attributes. Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by: Simon Ser <contact@emersion.fr> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Harry Wentland <hwentlan@amd.com> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c2
1 files changed, 1 insertions, 1 deletions
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 49d1d947af72..1c998337656e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7438,7 +7438,7 @@ static void handle_cursor_update(struct drm_plane *plane,
attributes.rotation_angle = 0;
attributes.attribute_flags.value = 0;
- attributes.pitch = attributes.width;
+ attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
if (crtc_state->stream) {
mutex_lock(&adev->dm.dc_lock);