intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH] drm/i915: check whether we actually received an edid in detect_ddc
Date: Wed, 11 Jul 2012 10:58:03 +0100	[thread overview]
Message-ID: <1342000687_250108@CP5-2952> (raw)
In-Reply-To: <1342000071-25057-1-git-send-email-daniel.vetter@ffwll.ch>

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

  reply	other threads:[~2012-07-11  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11  9:47 [PATCH] drm/i915: check whether we actually received an edid in detect_ddc Daniel Vetter
2012-07-11  9:58 ` Chris Wilson [this message]
2012-07-11 10:31   ` [PATCH 1/2] " Daniel Vetter
2012-07-11 10:31     ` [PATCH 2/2] drm/i915: kill intel_ddc_probe Daniel Vetter
2012-07-11 10:43       ` Chris Wilson
2012-07-11 10:44     ` [PATCH 1/2] drm/i915: check whether we actually received an edid in detect_ddc Chris Wilson
2012-07-11 20:02       ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342000687_250108@CP5-2952 \
    --to=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).