From aeeae1b40fc012bcc01fcd2243d4993de819b7cf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 26 Feb 2007 09:13:17 -0800 Subject: [PATCH] Fix a crash in startup monitor detect. --- src/i830_display.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/i830_display.c b/src/i830_display.c index f3beb572..a1660e35 100644 --- a/src/i830_display.c +++ b/src/i830_display.c @@ -342,7 +342,13 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x, int y) int dspbase = (pipe == 0 ? DSPABASE : DSPBBASE); int dspsurf = (pipe == 0 ? DSPASURF : DSPBSURF); - if (crtc->rotatedData != NULL) { + if (pI830->front_buffer == NULL) { + /* During startup we may be called as part of monitor detection while + * there is no memory allocation done, so just supply a dummy base + * address. + */ + Start = 0; + } else if (crtc->rotatedData != NULL) { Start = (char *)crtc->rotatedData - (char *)pI830->FbBase; } else if (I830IsPrimary(pScrn)) { Start = pI830->front_buffer->offset;