From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: check whether we actually received an edid in detect_ddc Date: Wed, 11 Jul 2012 10:58:03 +0100 Message-ID: <1342000687_250108@CP5-2952> References: <1342000071-25057-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (smtp.fireflyinternet.com [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id 2157C9E782 for ; Wed, 11 Jul 2012 02:58:13 -0700 (PDT) In-Reply-To: <1342000071-25057-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Intel Graphics Development Cc: Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org On Wed, 11 Jul 2012 11:47:51 +0200, Daniel Vetter wrote: > Somehow detect_ddc manages to fall through all checks when we think > that something responds on the ddc i2c address, but the edid read > failed. Fix this up by explicitly checking for this case. I'd prefer if we flatten the control flow in that function, state that the intention is to only return a definite positive result and if in any doubt we return false. Note that the ddc probe is implicit in drm_get_edid() and that we then have a stale comment about handling a broken EDID!. So intel_crtc_detect_ddc() { BUG_ON(crt->type != ANALOG); ret = false; if ((edid = drm_get_edid()) { ret = edid_is_analog(edid); kfree(edid); } return ret; } -Chris -- Chris Wilson, Intel Open Source Technology Centre