Don't crash when the SAREA pointer is NULL.

This commit is contained in:
Michel Dänzer 2007-03-09 23:49:46 +01:00
parent 7518b8959e
commit 3c2d6e07bd
1 changed files with 6 additions and 0 deletions

View File

@ -395,6 +395,9 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x, int y)
if (pI830->directRenderingEnabled) {
drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScrn->pScreen);
if (!sPriv)
return;
switch (pipe) {
case 0:
sPriv->pipeA_x = x;
@ -516,6 +519,9 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScrn->pScreen);
Bool enabled = crtc->enabled && mode != DPMSModeOff;
if (!sPriv)
return;
switch (pipe) {
case 0:
sPriv->pipeA_w = enabled ? crtc->mode.HDisplay : 0;