From: Adam Jackson <ajax@redhat.com>
To: Eugeni Dodonov <eugeni@dodonov.net>
Cc: intel-gfx@lists.freedesktop.org, ben@bwidawsk.net,
Eugeni Dodonov <eugeni.dodonov@intel.com>
Subject: Re: [PATCH] Check if the bus is valid prior to discovering edid.
Date: Thu, 13 Oct 2011 16:34:21 -0400 [thread overview]
Message-ID: <1318538070.7630.2.camel@atropine> (raw)
In-Reply-To: <1318529492-4019-1-git-send-email-eugeni@dodonov.net>
[-- Attachment #1.1: Type: text/plain, Size: 1558 bytes --]
On Thu, 2011-10-13 at 15:11 -0300, Eugeni Dodonov wrote:
> diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
> index d98cee6..b3a6eda 100644
> --- a/drivers/gpu/drm/i915/intel_i2c.c
> +++ b/drivers/gpu/drm/i915/intel_i2c.c
> @@ -470,3 +470,45 @@ void intel_teardown_gmbus(struct drm_device *dev)
> kfree(dev_priv->gmbus);
> dev_priv->gmbus = NULL;
> }
> +
> +/**
> + * intel_drm_get_valid_edid - gets edid from existent adapters only
> + * @connector: DRM connector device to use
> + * @adapter: i2c adapter
> + *
> + * Verifies if the i2c adapter is responding to our queries before
> + * attempting to do proper communication with it. If it does,
> + * retreive the EDID with help of drm_get_edid
> + */
> +struct edid *
> +intel_drm_get_valid_edid(struct drm_connector *connector,
> + struct i2c_adapter *adapter)
> +{
> + int ret;
> + u8 out_buf[] = { 0x0, 0x0};
> + u8 buf[2];
> + struct i2c_msg msgs[] = {
> + {
> + .addr = 0x50,
> + .flags = 0,
> + .len = 1,
> + .buf = out_buf,
> + },
> + {
> + .addr = 0x50,
> + .flags = I2C_M_RD,
> + .len = 1,
> + .buf = buf,
> + }
> + };
> +
> + /* We just check for -ENXIO - drm_get_edid checks if the transfer
> + * works and manages the remaining parts of the EDID */
> + ret = i2c_transfer(adapter, msgs, 2);
This seems like it should be the implementation body of drm_probe_ddc,
and like that function should be EXPORT_SYMBOL()'d. Other people want
to do zero-length reads too, you know.
- ajax
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2011-10-13 20:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 18:11 [PATCH] Check if the bus is valid prior to discovering edid Eugeni Dodonov
2011-10-13 20:34 ` Adam Jackson [this message]
2011-10-13 20:36 ` Eugeni Dodonov
2011-10-18 10:01 ` Dave Airlie
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=1318538070.7630.2.camel@atropine \
--to=ajax@redhat.com \
--cc=ben@bwidawsk.net \
--cc=eugeni.dodonov@intel.com \
--cc=eugeni@dodonov.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.