aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/1111-drm-amd-dal-return-page-flip-status-to-userspace.patch
blob: 3142c157cb4fa4e55e01b8d669bb93532b19422a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From 6e02d6ce89cdf62f20e71cc769b34687b722fc62 Mon Sep 17 00:00:00 2001
From: Arindam Nath <arindam.nath@amd.com>
Date: Thu, 18 Aug 2016 11:59:45 +0530
Subject: [PATCH 01/12] drm/amd/dal: return page flip status to userspace

We need to return the status of page flip operation back
to userspace. This enables userspace to take corrective
action when say, a pflip operation returns -EBUSY.

This resolves the issue when mpv randomly hangs during
playback at the very beginning itself.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kalyan Alle <kalyan.alle@amd.com>
---
 drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c
index 390c9b0..ab8bc4c 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c
@@ -2020,7 +2020,7 @@ int amdgpu_dm_atomic_commit(
 	struct drm_plane *plane;
 	struct drm_plane_state *old_plane_state;
 	uint32_t i;
-	int32_t ret;
+	int32_t ret = 0;
 	uint32_t commit_targets_count = 0;
 	uint32_t new_crtcs_count = 0;
 	struct drm_crtc *crtc;
@@ -2260,12 +2260,16 @@ int amdgpu_dm_atomic_commit(
 			!crtc->state->active)
 			continue;
 
-		if (page_flip_needed(plane_state, old_plane_state))
-			amdgpu_crtc_page_flip(
-				crtc,
-				fb,
-				crtc->state->event,
-				0);
+                if (page_flip_needed(plane_state, old_plane_state)) {
+                        ret = amdgpu_crtc_page_flip(
+                                                    crtc,
+                                                    fb,
+                                                    crtc->state->event,
+                                                    0);
+                        if (ret)
+                                return ret;
+                }
+
 	}
 
 	/* In this state all old framebuffers would be unpinned */
@@ -2276,7 +2280,7 @@ int amdgpu_dm_atomic_commit(
 
 	drm_atomic_state_free(state);
 
-	return 0;
+	return ret;
 }
 /*
  * This functions handle all cases when set mode does not come upon hotplug.
-- 
2.7.4