Mesa (master): st/xorg: Fix crash on startup.
Michel Dänzer
daenzer at kemper.freedesktop.org
Tue Jun 12 18:19:41 UTC 2012
Module: Mesa
Branch: master
Commit: 6d289390ec4d643e7451f9dcb35439876f361c44
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6d289390ec4d643e7451f9dcb35439876f361c44
Author: Dave Airlie <airlied at redhat.com>
Date: Fri Jun 8 18:10:18 2012 +0200
st/xorg: Fix crash on startup.
Signed-off-by: Dave Airlie <airlied at redhat.com>
Tested-by: Michel Dänzer <michel.daenzer at amd.com>
---
src/gallium/state_trackers/xorg/xorg_driver.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index 4b12822..1b0b4c6 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -71,6 +71,7 @@ static Bool drv_screen_init(SCREEN_INIT_ARGS_DECL);
static Bool drv_switch_mode(SWITCH_MODE_ARGS_DECL);
static void drv_adjust_frame(ADJUST_FRAME_ARGS_DECL);
static Bool drv_enter_vt(VT_FUNC_ARGS_DECL);
+static Bool drv_enter_vt_flags(ScrnInfoPtr pScrn, int flags);
static void drv_leave_vt(VT_FUNC_ARGS_DECL);
static void drv_free_screen(FREE_SCREEN_ARGS_DECL);
static ModeStatus drv_valid_mode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose,
@@ -887,7 +888,7 @@ drv_screen_init(SCREEN_INIT_ARGS_DECL)
if (serverGeneration == 1)
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
- return drv_enter_vt(VT_FUNC_ARGS);
+ return drv_enter_vt_flags(pScrn, 1);
}
static void
@@ -959,9 +960,8 @@ drv_leave_vt(VT_FUNC_ARGS_DECL)
* This gets called when gaining control of the VT, and from ScreenInit().
*/
static Bool
-drv_enter_vt(VT_FUNC_ARGS_DECL)
+drv_enter_vt_flags(ScrnInfoPtr pScrn, int flags)
{
- SCRN_INFO_PTR(arg);
modesettingPtr ms = modesettingPTR(pScrn);
CustomizerPtr cust = ms->cust;
@@ -971,7 +971,7 @@ drv_enter_vt(VT_FUNC_ARGS_DECL)
if (!ms->create_front_buffer(pScrn))
return FALSE;
- if (!ms->bind_front_buffer(pScrn))
+ if (!flags && !ms->bind_front_buffer(pScrn))
return FALSE;
if (!xf86SetDesiredModes(pScrn))
@@ -984,6 +984,13 @@ drv_enter_vt(VT_FUNC_ARGS_DECL)
}
static Bool
+drv_enter_vt(VT_FUNC_ARGS_DECL)
+{
+ SCRN_INFO_PTR(arg);
+ return drv_enter_vt_flags(pScrn, 0);
+}
+
+static Bool
drv_switch_mode(SWITCH_MODE_ARGS_DECL)
{
SCRN_INFO_PTR(arg);
More information about the mesa-commit
mailing list