/[gentoo-x86]/x11-base/xorg-server/files/1.6.4-re-fix-DGA-removal.patch
Gentoo

Contents of /x11-base/xorg-server/files/1.6.4-re-fix-DGA-removal.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri Oct 2 14:10:01 2009 UTC (8 years, 8 months ago) by remi
Branch: MAIN
x11-base/xorg-server: add patch to fix crasher bug #286746
(Portage version: 2.2_rc42/cvs/Linux i686)

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

  ViewVC Help
Powered by ViewVC 1.1.20