From: Paul Mundt <lethal@linux-sh.org>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 2/4 v2] fbdev: export fb_edid_add_monspecs() for modules, improve algorithm
Date: Wed, 10 Nov 2010 04:34:26 +0000 [thread overview]
Message-ID: <20101110043426.GC30715@linux-sh.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1011021140390.4552@axis700.grange>
On Tue, Nov 02, 2010 at 11:47:36AM +0100, Guennadi Liakhovetski wrote:
> diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
> index a0b5a93..38b3c30 100644
> --- a/drivers/video/fbmon.c
> +++ b/drivers/video/fbmon.c
> @@ -973,58 +973,56 @@ void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
> DPRINTK("====================\n");
> }
>
> +/**
> + * fb_edid_add_monspecs() - add monitor video modes from E-EDID data
> + * @edid: 128 byte array with an E-EDID block
> + * @spacs: monitor specs to be extended
> + */
> void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
> {
...
> + u8 edt[(128 - 4) / DETAILED_TIMING_DESCRIPTION_SIZE];
>
...
> - if (edid[0] != 0x2)
> + if (edid[0] != 0x2 ||
> + edid[2] < 4 || edid[2] > 128 - DETAILED_TIMING_DESCRIPTION_SIZE)
> return;
>
...
> + block = edid + edid[2];
>
...
> + for (i = 0; i < (128 - edid[2]) / DETAILED_TIMING_DESCRIPTION_SIZE;
> + i++, block += DETAILED_TIMING_DESCRIPTION_SIZE)
> + if (!(block[0] = 0x00 && block[1] = 0x00))
> + edt[num++] = block - edid;
>
Can we also do something about these magic numbers? There is already a
drivers/video/edid.h that you can fill out as necessary. I realize that
these values are probably pretty obvious if you have a copy of the spec
in front of you, I don't.
next prev parent reply other threads:[~2010-11-10 4:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-02 10:47 [PATCH 2/4 v2] fbdev: export fb_edid_add_monspecs() for modules, Guennadi Liakhovetski
2010-11-10 4:14 ` [PATCH 2/4 v2] fbdev: export fb_edid_add_monspecs() for modules, improve algorithm Paul Mundt
2010-11-10 4:34 ` Paul Mundt [this message]
2010-11-11 12:58 ` [PATCH 2/4 v2] fbdev: export fb_edid_add_monspecs() for modules, Guennadi Liakhovetski
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=20101110043426.GC30715@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=linux-fbdev@vger.kernel.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).