diff mbox

[RFC] Stop setting tv format property if crtc is NULL

Message ID 1248405759-23943-1-git-send-email-ling.ma@intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

ling.ma@intel.com July 24, 2009, 3:22 a.m. UTC
When TV is not connected and X start, after plugging TV cable again,
user must assign output crtc by xrandr command before set TV format
property. This patch will return FALSE to avoid system crash if
output crtc is NULL.

Signed-off-by: Ma Ling <ling.ma@intel.com>
---
 src/i830_tv.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/src/i830_tv.c b/src/i830_tv.c
index 7082aba..f1fdeea 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -1821,6 +1821,10 @@  i830_tv_set_property(xf86OutputPtr output, Atom property,
 
 	if (pI830->starting)
 	    return TRUE;
+	if (output->crtc == NULL)
+	    xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+			"Set TV Format Property error,"
+			"CRTC is not available\n");
 
 	/* TV format change will generate new modelines, try
 	   to probe them and update outputs. */