summaryrefslogtreecommitdiff
path: root/src/i830_sdvo.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@mandolin.keithp.com>2006-11-05 13:30:32 -0800
committerKeith Packard <keithp@mandolin.keithp.com>2006-11-05 13:30:32 -0800
commit68c3185046b27ab936ca6c92b924b443b3cd6fce (patch)
tree150ff56265c883b58d65d01b12d791c5346126b0 /src/i830_sdvo.c
parent15ef08046bcc3e746453301379f7c5d1bf929ee1 (diff)
Avoid crashing when disabling sdvo output. XXX
Diffstat (limited to 'src/i830_sdvo.c')
-rw-r--r--src/i830_sdvo.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index da611590..4d4817a5 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -517,8 +517,8 @@ i830_sdvo_pre_set_mode(ScrnInfoPtr pScrn, I830OutputPtr output,
{
I830Ptr pI830 = I830PTR(pScrn);
struct i830_sdvo_priv *dev_priv = output->dev_priv;
- CARD16 width = mode->CrtcHDisplay;
- CARD16 height = mode->CrtcVDisplay;
+ CARD16 width;
+ CARD16 height;
CARD16 h_blank_len, h_sync_len, v_blank_len, v_sync_len;
CARD16 h_sync_offset, v_sync_offset;
struct i830_sdvo_dtd output_dtd;
@@ -526,6 +526,11 @@ i830_sdvo_pre_set_mode(ScrnInfoPtr pScrn, I830OutputPtr output,
memset(&no_outputs, 0, sizeof(no_outputs));
+ if (!mode)
+ return;
+ width = mode->CrtcHDisplay;
+ height = mode->CrtcVDisplay;
+
/* do some mode translations */
h_blank_len = mode->CrtcHBlankEnd - mode->CrtcHBlankStart;
h_sync_len = mode->CrtcHSyncEnd - mode->CrtcHSyncStart;