1 |
remi 09/10/02 14:10:01 |
2 |
|
3 |
Added: 1.6.4-re-fix-DGA-removal.patch |
4 |
Log: |
5 |
x11-base/xorg-server: add patch to fix crasher bug #286746 |
6 |
(Portage version: 2.2_rc42/cvs/Linux i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 x11-base/xorg-server/files/1.6.4-re-fix-DGA-removal.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/xorg-server/files/1.6.4-re-fix-DGA-removal.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/xorg-server/files/1.6.4-re-fix-DGA-removal.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: 1.6.4-re-fix-DGA-removal.patch |
15 |
=================================================================== |
16 |
From fc31f76b6ff735e4a4006c5454c4d496ee8b154a Mon Sep 17 00:00:00 2001 |
17 |
From: Keith Packard <keithp@××××××.com> |
18 |
Date: Wed, 30 Sep 2009 18:40:19 +0000 |
19 |
Subject: Re-fix DGA removal. |
20 |
|
21 |
Removing DGA ended up breaking any drivers calling into the old |
22 |
xf86DiDGAInit function as it tried to see if DGA was already enabled |
23 |
and ended up crashing if the VT wasn't completely initialized. Oops. |
24 |
|
25 |
Also, if the driver initializes DGA itself, have the DiDGA |
26 |
initialization overwrite that information as the DiDGA code will call |
27 |
ReInit on mode detect. |
28 |
|
29 |
Signed-off-by: Keith Packard <keithp@××××××.com> |
30 |
Signed-off-by: Peter Hutterer <peter.hutterer@×××××.net> |
31 |
(cherry picked from commit db98b26ee145f70e732e2cf4a6ac3de77fdf4adc) |
32 |
--- |
33 |
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c |
34 |
index a06f285..3f7deba 100644 |
35 |
--- a/hw/xfree86/common/xf86DGA.c |
36 |
+++ b/hw/xfree86/common/xf86DGA.c |
37 |
@@ -120,8 +120,22 @@ DGAInit( |
38 |
|
39 |
DGAScreenKey = &DGAScreenKeyIndex; |
40 |
|
41 |
- if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec)))) |
42 |
- return FALSE; |
43 |
+ pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); |
44 |
+ |
45 |
+ if (!pScreenPriv) |
46 |
+ { |
47 |
+ if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec)))) |
48 |
+ return FALSE; |
49 |
+ dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv); |
50 |
+ pScreenPriv->CloseScreen = pScreen->CloseScreen; |
51 |
+ pScreen->CloseScreen = DGACloseScreen; |
52 |
+ pScreenPriv->DestroyColormap = pScreen->DestroyColormap; |
53 |
+ pScreen->DestroyColormap = DGADestroyColormap; |
54 |
+ pScreenPriv->InstallColormap = pScreen->InstallColormap; |
55 |
+ pScreen->InstallColormap = DGAInstallColormap; |
56 |
+ pScreenPriv->UninstallColormap = pScreen->UninstallColormap; |
57 |
+ pScreen->UninstallColormap = DGAUninstallColormap; |
58 |
+ } |
59 |
|
60 |
pScreenPriv->pScrn = pScrn; |
61 |
pScreenPriv->numModes = num; |
62 |
@@ -146,17 +160,6 @@ DGAInit( |
63 |
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE; |
64 |
#endif |
65 |
|
66 |
- dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv); |
67 |
- pScreenPriv->CloseScreen = pScreen->CloseScreen; |
68 |
- pScreen->CloseScreen = DGACloseScreen; |
69 |
- pScreenPriv->DestroyColormap = pScreen->DestroyColormap; |
70 |
- pScreen->DestroyColormap = DGADestroyColormap; |
71 |
- pScreenPriv->InstallColormap = pScreen->InstallColormap; |
72 |
- pScreen->InstallColormap = DGAInstallColormap; |
73 |
- pScreenPriv->UninstallColormap = pScreen->UninstallColormap; |
74 |
- pScreen->UninstallColormap = DGAUninstallColormap; |
75 |
- |
76 |
- |
77 |
return TRUE; |
78 |
} |
79 |
|
80 |
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c |
81 |
index 899cea5..2627029 100644 |
82 |
--- a/hw/xfree86/modes/xf86Crtc.c |
83 |
+++ b/hw/xfree86/modes/xf86Crtc.c |
84 |
@@ -770,7 +770,7 @@ xf86CrtcScreenInit (ScreenPtr screen) |
85 |
screen->CloseScreen = xf86CrtcCloseScreen; |
86 |
|
87 |
#ifdef XFreeXDGA |
88 |
- xf86DiDGAInit(screen, 0); |
89 |
+ _xf86_di_dga_init_internal(screen); |
90 |
#endif |
91 |
#ifdef RANDR_13_INTERFACE |
92 |
return RANDR_INTERFACE_VERSION; |
93 |
@@ -1887,7 +1887,7 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn) |
94 |
scrn->currentMode = scrn->modes; |
95 |
#ifdef XFreeXDGA |
96 |
if (scrn->pScreen) |
97 |
- xf86DiDGAReInit(scrn->pScreen); |
98 |
+ _xf86_di_dga_reinit_internal(scrn->pScreen); |
99 |
#endif |
100 |
} |
101 |
|
102 |
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h |
103 |
index 0a596bc..4fe4150 100644 |
104 |
--- a/hw/xfree86/modes/xf86Crtc.h |
105 |
+++ b/hw/xfree86/modes/xf86Crtc.h |
106 |
@@ -807,6 +807,10 @@ xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus); |
107 |
Bool |
108 |
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address); |
109 |
|
110 |
+/* this is the real function, used only internally */ |
111 |
+_X_INTERNAL Bool |
112 |
+_xf86_di_dga_init_internal (ScreenPtr pScreen); |
113 |
+ |
114 |
/** |
115 |
* Re-initialize dga for this screen (as when the set of modes changes) |
116 |
*/ |
117 |
@@ -814,6 +818,10 @@ xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address); |
118 |
Bool |
119 |
xf86DiDGAReInit (ScreenPtr pScreen); |
120 |
|
121 |
+/* This is the real function, used only internally */ |
122 |
+_X_INTERNAL Bool |
123 |
+_xf86_di_dga_reinit_internal (ScreenPtr pScreen); |
124 |
+ |
125 |
/* |
126 |
* Set the subpixel order reported for the screen using |
127 |
* the information from the outputs |
128 |
diff --git a/hw/xfree86/modes/xf86DiDGA.c b/hw/xfree86/modes/xf86DiDGA.c |
129 |
index 3992c09..bc59535 100644 |
130 |
--- a/hw/xfree86/modes/xf86DiDGA.c |
131 |
+++ b/hw/xfree86/modes/xf86DiDGA.c |
132 |
@@ -175,6 +175,12 @@ static DGAFunctionRec xf86_dga_funcs = { |
133 |
_X_EXPORT Bool |
134 |
xf86DiDGAReInit (ScreenPtr pScreen) |
135 |
{ |
136 |
+ return TRUE; |
137 |
+} |
138 |
+ |
139 |
+Bool |
140 |
+_xf86_di_dga_reinit_internal (ScreenPtr pScreen) |
141 |
+{ |
142 |
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; |
143 |
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); |
144 |
|
145 |
@@ -190,12 +196,15 @@ xf86DiDGAReInit (ScreenPtr pScreen) |
146 |
_X_EXPORT Bool |
147 |
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address) |
148 |
{ |
149 |
+ return TRUE; |
150 |
+} |
151 |
+ |
152 |
+Bool |
153 |
+_xf86_di_dga_init_internal (ScreenPtr pScreen) |
154 |
+{ |
155 |
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; |
156 |
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); |
157 |
|
158 |
- if (DGAAvailable(pScreen->myNum)) |
159 |
- return TRUE; |
160 |
- |
161 |
xf86_config->dga_flags = 0; |
162 |
xf86_config->dga_address = 0; |
163 |
xf86_config->dga_width = 0; |
164 |
-- |
165 |
cgit v0.8.2 |