|
1
|
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
|
|
2
|
+Date: Mon, 8 Aug 2022 10:49:11 +0800
|
|
3
|
+Subject: Initialize present extension for GPU screen
|
|
4
|
+
|
|
5
|
+Some laptops have the external outputs routed to dGPU, when the external
|
|
6
|
+output over dGPU is the only display in reverse prime mode, we need
|
|
7
|
+present extension so fake CRTC won't be used.
|
|
8
|
+
|
|
9
|
+(cherry picked from commit a3a012b649eb9b3066abefe163a72854514792fa)
|
|
10
|
+Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
|
|
11
|
+---
|
|
12
|
+ src/amdgpu_kms.c | 44 +++++++++++++++++++++-----------------------
|
|
13
|
+ 1 file changed, 21 insertions(+), 23 deletions(-)
|
|
14
|
+
|
|
15
|
+diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
|
|
16
|
+index 6d65c81..9364d17 100644
|
|
17
|
+--- a/src/amdgpu_kms.c
|
|
18
|
++++ b/src/amdgpu_kms.c
|
|
19
|
+@@ -2046,36 +2046,34 @@ Bool AMDGPUScreenInit_KMS(ScreenPtr pScreen, int argc, char **argv)
|
|
20
|
+ }
|
|
21
|
+ #endif
|
|
22
|
+
|
|
23
|
+- if (!pScreen->isGPU) {
|
|
24
|
+- if (xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0))
|
|
25
|
+- value = info->use_glamor;
|
|
26
|
+- else
|
|
27
|
+- value = FALSE;
|
|
28
|
+- from = X_DEFAULT;
|
|
29
|
++ if (xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0))
|
|
30
|
++ value = info->use_glamor;
|
|
31
|
++ else
|
|
32
|
++ value = FALSE;
|
|
33
|
++ from = X_DEFAULT;
|
|
34
|
+
|
|
35
|
+- if (info->use_glamor) {
|
|
36
|
+- if (xf86GetOptValBool(info->Options, OPTION_DRI3, &value))
|
|
37
|
+- from = X_CONFIG;
|
|
38
|
++ if (info->use_glamor) {
|
|
39
|
++ if (xf86GetOptValBool(info->Options, OPTION_DRI3, &value))
|
|
40
|
++ from = X_CONFIG;
|
|
41
|
+
|
|
42
|
+- if (xf86GetOptValInteger(info->Options, OPTION_DRI, &driLevel) &&
|
|
43
|
+- (driLevel == 2 || driLevel == 3)) {
|
|
44
|
+- from = X_CONFIG;
|
|
45
|
+- value = driLevel == 3;
|
|
46
|
+- }
|
|
47
|
++ if (xf86GetOptValInteger(info->Options, OPTION_DRI, &driLevel) &&
|
|
48
|
++ (driLevel == 2 || driLevel == 3)) {
|
|
49
|
++ from = X_CONFIG;
|
|
50
|
++ value = driLevel == 3;
|
|
51
|
+ }
|
|
52
|
++ }
|
|
53
|
+
|
|
54
|
+- if (value) {
|
|
55
|
+- value = amdgpu_sync_init(pScreen) &&
|
|
56
|
+- amdgpu_present_screen_init(pScreen) &&
|
|
57
|
+- amdgpu_dri3_screen_init(pScreen);
|
|
58
|
+-
|
|
59
|
+- if (!value)
|
|
60
|
+- from = X_WARNING;
|
|
61
|
+- }
|
|
62
|
++ if (value) {
|
|
63
|
++ value = amdgpu_sync_init(pScreen) &&
|
|
64
|
++ amdgpu_present_screen_init(pScreen) &&
|
|
65
|
++ amdgpu_dri3_screen_init(pScreen);
|
|
66
|
+
|
|
67
|
+- xf86DrvMsg(pScrn->scrnIndex, from, "DRI3 %sabled\n", value ? "en" : "dis");
|
|
68
|
++ if (!value)
|
|
69
|
++ from = X_WARNING;
|
|
70
|
+ }
|
|
71
|
+
|
|
72
|
++ xf86DrvMsg(pScrn->scrnIndex, from, "DRI3 %sabled\n", value ? "en" : "dis");
|
|
73
|
++
|
|
74
|
+ pScrn->vtSema = TRUE;
|
|
75
|
+ xf86SetBackingStore(pScreen);
|
|
76
|
+ |