Fix a crash in startup monitor detect.

This commit is contained in:
Eric Anholt 2007-02-26 09:13:17 -08:00
parent 84a7429730
commit aeeae1b40f
1 changed files with 7 additions and 1 deletions

View File

@ -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;