From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 2/3] video: fbdev: Check Standard Timing against DMT
Date: Fri, 05 Dec 2014 12:02:19 +0000 [thread overview]
Message-ID: <54819ECB.1090607@ti.com> (raw)
In-Reply-To: <1417643369-20603-2-git-send-email-davidu@nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 2100 bytes --]
On 03/12/14 23:49, David Ung wrote:
> Add the VESA Display Monitor Timing (DMT) table.
> During parsing of Standard Timings, it compare the 2 byte STD code
> with DMT to see what the VESA mode should be. If there is no entry
> in the vesa_modes table or no match found, it fallsback to the
> GTF timings.
>
> Signed-off-by: David Ung <davidu@nvidia.com>
> ---
> drivers/video/fbdev/core/fbmon.c | 20 ++++++----
> drivers/video/fbdev/core/modedb.c | 84 +++++++++++++++++++++++++++++++++++++++
> include/linux/fb.h | 10 +++++
> 3 files changed, 107 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
> index 5b0e313..aa1110a 100644
> --- a/drivers/video/fbdev/core/fbmon.c
> +++ b/drivers/video/fbdev/core/fbmon.c
> @@ -526,16 +526,22 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode,
> refresh = (block[1] & 0x3f) + 60;
>
> DPRINTK(" %dx%d@%dHz\n", xres, yres, refresh);
> - for (i = 0; i < VESA_MODEDB_SIZE; i++) {
> - if (vesa_modes[i].xres == xres &&
> - vesa_modes[i].yres == yres &&
> - vesa_modes[i].refresh == refresh) {
> - *mode = vesa_modes[i];
> + for (i = 0; i < DMT_SIZE; i++) {
> + u32 std_2byte_code = block[0] << 8 | block[1];
> +
> + if (std_2byte_code == dmt_modes[i].std_2byte_code) {
> + if (!dmt_modes[i].mode)
> + break;
> + *mode = *dmt_modes[i].mode;
> mode->flag |= FB_MODE_IS_STANDARD;
> - return 1;
> + DPRINTK(" DMT id=%d\n", dmt_modes[i].dmt_id);
> + break;
> }
> }
> - calc_mode_timings(xres, yres, refresh, mode);
> +
> + if (i == DMT_SIZE || !dmt_modes[i].mode)
> + calc_mode_timings(xres, yres, refresh, mode);
> +
> return 1;
> }
I think this could be made a bit cleaner.
The xres/yres/refresh calculation in get_std_timing doesn't matter for
the DMT code above. So in get_std_timing() you could first do the search
for the DMT mode, and if found, return from the function. After that the
code would do the GTF calculation.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-12-05 12:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 21:49 [PATCH 2/3] video: fbdev: Check Standard Timing against DMT David Ung
2014-12-04 15:41 ` Tomi Valkeinen
2014-12-05 4:08 ` David Ung
2014-12-05 11:41 ` Tomi Valkeinen
2014-12-05 12:02 ` Tomi Valkeinen [this message]
2014-12-05 19:47 ` David Ung
2015-01-13 10:35 ` Tomi Valkeinen
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=54819ECB.1090607@ti.com \
--to=tomi.valkeinen@ti.com \
--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).