From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Egbert Eich <eich@suse.com>
Cc: tiwai@suse.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 05/18] DRM/KMS/EDID: Test EDDC if EDID announces more than one Extension Block (v2)
Date: Thu, 22 Nov 2012 14:29:45 +0200 [thread overview]
Message-ID: <20121122122945.GF3296@intel.com> (raw)
In-Reply-To: <20654.5504.513136.392670@linux-qknr.site>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 3985 bytes --]
On Thu, Nov 22, 2012 at 01:07:28PM +0100, Egbert Eich wrote:
> Ville Syrjälä writes:
> > On Thu, Nov 22, 2012 at 05:22:55AM -0500, Egbert Eich wrote:
> > > There are displays which announce EDID extension blocks in the
> > > Extension Flag of the EDID base block although they are not EDDC
> > > capable (ie. take a segment address at I2C slave address 0x30).
> > > We test this by looking for an EDID header which is only possible
> > > in the base block.
> > > If the segment address is not taken into account, this block will
> > > be identical to the base block in which case we stop reading further
> > > EEDID blocks, correct the extension flag and just return the base
> > > block.
> > >
> > > v2: Split up EDID fixup code into separate commit.
> > >
> > > Signed-off-by: Egbert Eich <eich@suse.com>
> > > ---
> > > drivers/gpu/drm/drm_edid.c | 13 +++++++++++++
> > > 1 files changed, 13 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > > index a952cfe..5a0e331 100644
> > > --- a/drivers/gpu/drm/drm_edid.c
> > > +++ b/drivers/gpu/drm/drm_edid.c
> > > @@ -364,6 +364,19 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
> > > }
> > > if (drm_edid_block_valid(block + (valid_extensions + 1) * EDID_LENGTH, j, print_bad_edid)) {
> > > valid_extensions++;
> > > + /* Test if base block announced extension blocks although
> > > + * display is not EDDC capable.
> > > + */
> > > + if (j == 2) {
> > > + int k;
> > > + for (k = 0; k < sizeof(edid_header); k++)
> > > + if (block[(EDID_LENGTH * 2) + k] != edid_header[k])
> > > + break;
> > > + if (k == sizeof(edid_header)) {
> > > + valid_extensions = 0;
> > > + goto done_fix_extension_count;
> > > + }
> >
> > memcmp()? Also couldn't we just memcmp() the whole block against the base
> > block, instead of just the header part?
>
> I don't see an advantage of comparing the entire block with the base block:
> the signature should already be unique. However I don't insist ;)
Me neither. I just figured it might reduce the chance of false
positives. But if you say that can't happen, I'll take your word
for it.
> Regarding memcmp() you are definitely right, I will change the code.
>
> >
> > Also the comment is somehow misleading. It talks about the base block
> > even though we're looking at the extension block.
>
>
> Reason for this patch:
> I had a bug report for a monitor announcing extension blocks in the extension
> block flag of the base block (over 200!) although it wasn't EDDC capable.
> For some reason it got past the ACK check when the segment number was written
> to address 0x30 and happily transferred the base block for any odd numbered
> block and some garbage for even ones.
That's nasty. When I saw your patch I was immediately thinking that this
is caused by the IGNORE_NAK flag, but then I read the current code, and
realized that we're not using that flag. It was used in the original
EDDC patch, and I was worried that this kind of bad behaviour would be
possible if use the flag. But it seems I underestimated how crappy the
monitor hardwar can be.
> The only reliable way we found to catch this condition early was to check if
> block 2 had the header of a base block which will happen when the display
> cannot deal with the segment number.
>
> This was what I tried to summarize in very few words - maybe i should reword
> it a bit.
Right. The idea seems reasonable, I just found the comment somehow a
bit confusing when I was reading the code following it.
So maybe something like 'Test if base block ..., by checking whether the
extension block is a duplicate the base block.' Although the use of
memcmp() will already make things much clearer.
--
Ville Syrjälä
Intel OTC
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2012-11-22 12:29 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-19 20:23 [PATCH 00/17] DRM/KMS/EDID: Various EDID handling related fixes Egbert Eich
2012-11-19 20:23 ` [PATCH 01/17] DRM/KMS/EDID: Mask out Segment Bits when calculating Offset Egbert Eich
2012-11-19 20:23 ` [PATCH 03/17] DRM/KMS/EDID: Return Base EDID block if reading EEDID Blocks fails Egbert Eich
2012-11-19 20:23 ` [PATCH 04/17] DRM/KMS/EDID: Test EDDC if EDID announces more than one Extension Block Egbert Eich
2012-11-19 20:23 ` [PATCH 05/17] DRM/KMS/EDID: Fix up EEDID Map Blocks if Extension block count has changed Egbert Eich
2012-11-20 8:13 ` Takashi Iwai
2012-11-19 20:23 ` [PATCH 06/17] DRM/exynos: Fix Memory Leak: free EDID blcok returned by drm_get_edid() Egbert Eich
2012-11-20 4:17 ` Inki Dae
2012-11-20 9:30 ` [PATCH] drm/exynos: fix memory leak: free EDID block Egbert Eich
2012-11-20 19:58 ` Sean Paul
2012-11-20 20:29 ` Egbert Eich
2012-11-20 21:18 ` Sean Paul
2012-12-14 10:24 ` Jani Nikula
2012-11-21 3:50 ` Inki Dae
2012-11-19 20:23 ` [PATCH 07/17] DRM/KMS/EDID: Move drm_edid_load.o to drm.ko Egbert Eich
2012-11-20 8:26 ` Takashi Iwai
2012-11-19 20:23 ` [PATCH 08/17] DRM/KMS/EDID: Use Extension Block Fixup Code also for 'firmware' EDID Egbert Eich
2012-11-20 8:21 ` Takashi Iwai
2012-11-19 20:23 ` [PATCH 09/17] DRM/KMS/EDID: Feed 'firmware' supplied EDID blocks whenever the EDID is read Egbert Eich
2012-11-19 20:23 ` [PATCH 10/17] DRM/KMS/EDID: Cache EDID blobs with extensions Egbert Eich
2012-11-20 8:29 ` Takashi Iwai
2012-11-19 20:23 ` [PATCH 11/17] DRM/KMS/EDID: Avoid failing on krealloc on EDID blocks Egbert Eich
2012-11-19 20:23 ` [PATCH 12/17] DRM/KMS/EDID: Consolidate EDID Error Handling Egbert Eich
2012-11-19 20:23 ` [PATCH 13/17] DRM/KMS/EDID: Allow for multiple Connectors when specifying 'firmware'-EDID Files Egbert Eich
2012-11-20 8:38 ` Takashi Iwai
2012-11-19 20:23 ` [PATCH 14/17] DRM/KMS/ast: Include drm_edid.h in file using drm_get_edid() Egbert Eich
2012-11-19 20:23 ` [PATCH 15/17] DRM/KMS/gma500: " Egbert Eich
2012-11-19 20:23 ` [PATCH 16/17] DRM/KMS/mgag200: " Egbert Eich
2012-11-19 20:23 ` [PATCH 17/17] DRM/KMS/EDID: Move EDID related Functions to drm_edid.h Egbert Eich
2012-11-22 10:22 ` [PATCH v2 00/18] DRM/KMS/EDID: Various EDID handling related fixes Egbert Eich
2012-11-22 10:22 ` [PATCH v2 01/18] DRM/KMS/EDID: Mask out Segment Bits when calculating Offset Egbert Eich
2012-11-22 10:22 ` [PATCH v2 02/18] DRM/KMS/EDID: 0x7e -> EDID_EXTENSION_FLAG_OFFSET (v2) Egbert Eich
2012-11-22 10:22 ` [PATCH v2 03/18] DRM/KMS/EDID: Return Base EDID block if reading EEDID Blocks fails (v2) Egbert Eich
2012-11-22 10:22 ` [PATCH v2 04/18] DRM/KMS/EDID: Don't fail when failing to allocate memory for EDID extensions Egbert Eich
2012-11-22 10:22 ` [PATCH v2 05/18] DRM/KMS/EDID: Test EDDC if EDID announces more than one Extension Block (v2) Egbert Eich
2012-11-22 11:20 ` Ville Syrjälä
2012-11-22 12:07 ` Egbert Eich
2012-11-22 12:29 ` Ville Syrjälä [this message]
2012-11-22 13:18 ` Egbert Eich
2012-11-22 14:39 ` [PATCH v3] DRM/KMS/EDID: Test EDDC if EDID announces more than one Extension Block (v3) Egbert Eich
2012-11-22 10:22 ` [PATCH v2 06/18] DRM/KMS/EDID: Don't expect extension blocks for EDID Versions < 1.3 Egbert Eich
2012-11-22 10:22 ` [PATCH v2 07/18] DRM/KMS/EDID: Don't reallocate EDID blob when size has shrunk Egbert Eich
2012-11-22 10:22 ` [PATCH v2 08/18] DRM/KMS/EDID: Fix up EEDID Map Blogs if Extension Block Count has changed (v2) Egbert Eich
2012-11-22 10:22 ` [PATCH v2 09/18] DRM/KMS/EDID: Move drm_edid_load.o to drm.ko (v2) Egbert Eich
2012-11-22 10:23 ` [PATCH v2 10/18] DRM/KMS/EDID: Feed 'firmware' supplied EDID blocks whenever the EDID is read (v2) Egbert Eich
2012-11-22 10:23 ` [PATCH v2 11/18] DRM/KMS/EDID: Allow for multiple Connectors when specifying 'firmware'-EDID Files (v2) Egbert Eich
2012-11-22 10:23 ` [PATCH v2 12/18] DRM/KMS/EDID: Use Extension Block Fixup Code also for 'firmware' EDID (v2) Egbert Eich
2012-11-22 10:23 ` [PATCH v2 13/18] DRM/KMS/EDID: Cache EDID blobs with extensions (v2) Egbert Eich
2012-11-22 14:14 ` Ville Syrjälä
2012-11-22 14:29 ` Egbert Eich
2012-11-22 14:43 ` [PATCH v3] DRM/KMS/EDID: Cache EDID blobs with extensions (v3) Egbert Eich
2012-11-22 10:23 ` [PATCH v2 14/18] DRM/KMS/EDID: Consolidate EDID Error Handling (v2) Egbert Eich
2012-11-22 14:44 ` [PATCH v3] DRM/KMS/EDID: Consolidate EDID Error Handling (v3) Egbert Eich
2012-11-22 16:09 ` Ville Syrjälä
2012-11-22 18:28 ` Egbert Eich
2012-11-22 18:54 ` Ville Syrjälä
2012-11-22 20:01 ` Egbert Eich
2012-11-22 18:57 ` [PATCH v4] DRM/KMS/EDID: Consolidate EDID Error Handling (v4) Egbert Eich
2012-11-22 20:29 ` [PATCH v5] DRM/KMS/EDID: Consolidate EDID Error Handling (v5) Egbert Eich
2012-11-22 10:23 ` [PATCH v2 15/18] DRM/KMS/ast: Include drm_edid.h in file using drm_get_edid() Egbert Eich
2012-11-22 10:23 ` [PATCH v2 16/18] DRM/KMS/gma500: " Egbert Eich
2012-11-22 10:23 ` [PATCH v2 17/18] DRM/KMS/mgag200: " Egbert Eich
2012-11-22 10:23 ` [PATCH v2 18/18] DRM/KMS/EDID: Move EDID related Functions to drm_edid.h Egbert Eich
2012-11-22 19:00 ` [PATCH v4] DRM/KMS/EDID: Move EDID related Functions to drm_edid.h (v2) Egbert Eich
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=20121122122945.GF3296@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=eich@suse.com \
--cc=tiwai@suse.com \
/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