From patchwork Wed Jul 29 02:18:44 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: 38047 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 n6T2IkYu023808 for ; Wed, 29 Jul 2009 02:18:47 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8502D9E7E8; Tue, 28 Jul 2009 19:18:46 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id AD4829E793 for ; Tue, 28 Jul 2009 19:18:44 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 28 Jul 2009 19:09:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,286,1246863600"; d="scan'208";a="478817614" Received: from unknown (HELO localhost.localdomain) ([10.239.36.100]) by fmsmga002.fm.intel.com with ESMTP; 28 Jul 2009 19:11:50 -0700 From: ling.ma@intel.com To: intel-gfx@lists.freedesktop.org Date: Wed, 29 Jul 2009 10:18:44 +0800 Message-Id: <1248833924-9854-1-git-send-email-ling.ma@intel.com> X-Mailer: git-send-email 1.5.4.4 Cc: Ma Ling Subject: [Intel-gfx] [PATCH V2] 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 | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/i830_tv.c b/src/i830_tv.c index 7082aba..6110b45 100644 --- a/src/i830_tv.c +++ b/src/i830_tv.c @@ -1821,6 +1821,12 @@ 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"); + return FALSE; + } /* TV format change will generate new modelines, try to probe them and update outputs. */