From patchwork Fri Nov 27 13:06:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 63328 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 nARD73Ht002918 for ; Fri, 27 Nov 2009 13:07:03 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 308679F61F; Fri, 27 Nov 2009 05:07:03 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fmsmga102.fm.intel.com (mga10.intel.com [192.55.52.92]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B3DE9F5EC for ; Fri, 27 Nov 2009 05:07:01 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 27 Nov 2009 05:02:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,301,1257148800"; d="scan'208";a="517771086" Received: from unknown (HELO localhost.localdomain) ([10.255.16.178]) by fmsmga002.fm.intel.com with ESMTP; 27 Nov 2009 05:00:40 -0800 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 27 Nov 2009 13:06:56 +0000 Message-Id: <1259327216-5666-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <1259326799-5571-1-git-send-email-chris@chris-wilson.co.uk> References: <1259326799-5571-1-git-send-email-chris@chris-wilson.co.uk> Cc: David Woodhouse , Zhenyu Wang Subject: [Intel-gfx] [PATCH] drm/i915: Avoid NULL dereference with component_only tv_modes 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 diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index a0e4bc4..d7465ca 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -1213,20 +1213,17 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, tv_ctl |= TV_TRILEVEL_SYNC; if (tv_mode->pal_burst) tv_ctl |= TV_PAL_BURST; + scctl1 = 0; - /* dda1 implies valid video levels */ - if (tv_mode->dda1_inc) { + if (tv_mode->dda1_inc) scctl1 |= TV_SC_DDA1_EN; - } - if (tv_mode->dda2_inc) scctl1 |= TV_SC_DDA2_EN; - if (tv_mode->dda3_inc) scctl1 |= TV_SC_DDA3_EN; - scctl1 |= tv_mode->sc_reset; - scctl1 |= video_levels->burst << TV_BURST_LEVEL_SHIFT; + if (video_levels) + scctl1 |= video_levels->burst << TV_BURST_LEVEL_SHIFT; scctl1 |= tv_mode->dda1_inc << TV_SCDDA1_INC_SHIFT; scctl2 = tv_mode->dda2_size << TV_SCDDA2_SIZE_SHIFT |