[PATCH 16/31] drm/amd/display: Fix race.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrey Grodzovsky <Andrey.Grodzovsky@xxxxxxx>

Problem :
A race between two adjecent page flips makes the earlier one
to release an alocated frame buffer for the subsequent one -
since there are 2 frambuffer swapped back and forth between flips,
the 'new' fb of the later flip is actually the 'previous' fb for the earlier flip.
Fix:
Don't set fb->address = 0 in cleanup hook, this is unnecessery and
erases the newly cached adress that was set in prepare_fb of the second
flip.

Change-Id: I852ad2ee5122222e49dfc9c05e7488843d6a8915
Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky at amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index 6fddf31cc4e4..8aeb10786b94 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -1795,9 +1795,7 @@ static void dm_plane_helper_cleanup_fb(
 		amdgpu_bo_unpin(rbo);
 		amdgpu_bo_unreserve(rbo);
 		amdgpu_bo_unref(&rbo);
-	}
-
-	afb->address = 0;
+	};
 }
 
 int dm_create_validation_set_for_connector(struct drm_connector *connector,
-- 
2.11.0



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux