All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5] edid: add function to convert edid to fb_videomode
Date: Sun, 12 Jan 2014 21:34:25 +0100	[thread overview]
Message-ID: <20140112213425.5c26453b@crub> (raw)
In-Reply-To: <1389165866-17509-1-git-send-email-christian.gmeiner@gmail.com>

On Wed,  8 Jan 2014 08:24:21 +0100
Christian Gmeiner <christian.gmeiner@gmail.com> wrote:

> There may be some custom boards in the field which have
> an seperate eeprom chip to store edid informations in it.
> To make use of those edid information in the board code
> this patch add a function to convert edid to fb_videomode.
> 
> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
> ---
>  common/edid.c  |   29 +++++++++++++++++++++++++++++
>  include/edid.h |    3 +++
>  2 files changed, 32 insertions(+)

Please check your patches with tools/checkpatch.pl and fix the
reported errors/warnings. Thanks!

> diff --git a/common/edid.c b/common/edid.c
> index e66108f..8841c25 100644
> --- a/common/edid.c
> +++ b/common/edid.c
> @@ -12,6 +12,7 @@
>  
>  #include <common.h>
>  #include <edid.h>
> +#include <linux/fb.h>
>  #include <linux/ctype.h>
>  #include <linux/string.h>
>  
> @@ -288,3 +289,31 @@ void edid_print_info(struct edid1_info *edid_info)
>  	if (!have_timing)
>  		printf("\tNone\n");
>  }
> +
> +void edid_to_fb_videomode(struct edid1_info *edid, struct fb_videomode *mode)
> +{
> +        struct edid_monitor_descriptor *monitor = &edid->monitor_details.descriptor[0];
> +        unsigned char *bytes = (unsigned char *)monitor;
> +        struct edid_detailed_timing *timing = (struct edid_detailed_timing *)monitor;
> +
> +        uint32_t pixclock = EDID_DETAILED_TIMING_PIXEL_CLOCK(*timing);
> +        uint32_t h_blanking = EDID_DETAILED_TIMING_HORIZONTAL_BLANKING(*timing);
> +        uint32_t h_active = EDID_DETAILED_TIMING_HORIZONTAL_ACTIVE(*timing);
> +        uint32_t h_sync_offset = EDID_DETAILED_TIMING_HSYNC_OFFSET(*timing);
> +        uint32_t h_sync_width = EDID_DETAILED_TIMING_HSYNC_PULSE_WIDTH(*timing);
> +        uint32_t v_blanking = EDID_DETAILED_TIMING_VERTICAL_BLANKING(*timing);
> +        uint32_t v_active = EDID_DETAILED_TIMING_VERTICAL_ACTIVE(*timing);
> +        uint32_t v_sync_offset = EDID_DETAILED_TIMING_VSYNC_OFFSET(*timing);
> +        uint32_t v_sync_width = EDID_DETAILED_TIMING_VSYNC_PULSE_WIDTH(*timing);
> +
> +        mode->name = "EDID";
> +        mode->pixclock = pixclock;

as Eric already noticed, please use 

	mode->pixclock = KHZ2PICOS(pixclock/1000);

The unit for fb_videomode.pixclock is picoseconds, the EDID macro
returned the value in Hz. And when converting to device tree timing
node in patch 3/5 please use PICOS2KHZ(mode->pixclock) * 1000 when
setting the clock-frequency property.

Thanks,

Anatolij

  parent reply	other threads:[~2014-01-12 20:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08  7:24 [U-Boot] [PATCH 1/5] edid: add function to convert edid to fb_videomode Christian Gmeiner
2014-01-08  7:24 ` [U-Boot] [PATCH 2/5] imx: mx6q_4x_mt41j128.cfg: enable ecspi3 clocks Christian Gmeiner
2014-01-08 10:44   ` Stefano Babic
2014-01-08 14:45     ` Christian Gmeiner
2014-01-09  7:07       ` Christian Gmeiner
2014-01-09 10:41         ` Stefano Babic
2014-01-08  7:24 ` [U-Boot] [PATCH 3/5] fdt: add fdt_add_display_timings(..) Christian Gmeiner
2014-01-08 10:53   ` Stefano Babic
2014-01-09  7:12     ` Christian Gmeiner
2014-01-09 10:44       ` Stefano Babic
2014-01-09 14:52         ` Eric Nelson
2014-01-09 15:06           ` Stefano Babic
2014-01-09 17:00           ` Stephen Warren
2014-01-09 17:19             ` Christian Gmeiner
2014-01-12 21:21     ` Anatolij Gustschin
2014-01-14  7:58       ` Christian Gmeiner
2014-01-16 11:44         ` Christian Gmeiner
2014-09-15 12:27           ` Christian Gmeiner
2014-01-08  7:24 ` [U-Boot] [PATCH 4/5] imx6: add ot1200 mr board Christian Gmeiner
2014-01-08 11:21   ` Stefano Babic
2014-01-08 14:53     ` Christian Gmeiner
2014-01-08  7:24 ` [U-Boot] [PATCH 5/5] imx6: make use of lldiv(..) Christian Gmeiner
2014-01-08 10:54   ` Stefano Babic
2014-01-08 14:46     ` Christian Gmeiner
2014-01-13 10:57   ` Stefano Babic
2014-01-08 10:40 ` [U-Boot] [PATCH 1/5] edid: add function to convert edid to fb_videomode Stefano Babic
2014-01-10 21:36 ` Eric Nelson
2014-01-14  0:36   ` Fabio Estevam
2014-01-14  2:55     ` Eric Nelson
2014-01-12 20:34 ` Anatolij Gustschin [this message]
2014-01-14  7:56   ` Christian Gmeiner

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=20140112213425.5c26453b@crub \
    --to=agust@denx.de \
    --cc=u-boot@lists.denx.de \
    /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.