[Intel-gfx] [PATCH] drm/i915: check whether we actually received an edid in detect_ddc

Chris Wilson chris at chris-wilson.co.uk
Wed Jul 11 11:58:03 CEST 2012


On Wed, 11 Jul 2012 11:47:51 +0200, Daniel Vetter <daniel.vetter at ffwll.ch> 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



More information about the Intel-gfx mailing list