From patchwork Fri Jul 24 03:22:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ling.ma@intel.com X-Patchwork-Id: 37063 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6O3MwO0026688 for ; Fri, 24 Jul 2009 03:22:58 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C94A9EAF6; Thu, 23 Jul 2009 20:22:58 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 12DEE9E74C for ; Thu, 23 Jul 2009 20:22:55 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 23 Jul 2009 20:22:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,259,1246863600"; d="scan'208";a="168410969" Received: from unknown (HELO localhost.localdomain) ([10.239.36.100]) by azsmga001.ch.intel.com with ESMTP; 23 Jul 2009 20:22:54 -0700 From: ling.ma@intel.com To: intel-gfx@lists.freedesktop.org Date: Fri, 24 Jul 2009 11:22:39 +0800 Message-Id: <1248405759-23943-1-git-send-email-ling.ma@intel.com> X-Mailer: git-send-email 1.5.4.4 Cc: Ma Ling Subject: [Intel-gfx] [RFC][PATCH] Stop setting tv format property if crtc is NULL X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org 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 --- src/i830_tv.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) 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. */