public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] edid: add function to convert edid to fb_videomode
@ 2014-01-04  8:53 Christian Gmeiner
  2014-01-04  9:17 ` Wolfgang Denk
  2014-01-04 14:33 ` Gerhard Sittig
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Gmeiner @ 2014-01-04  8:53 UTC (permalink / raw)
  To: u-boot

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(+)

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;
+        mode->yres = v_active;
+        mode->xres = h_active;
+        mode->left_margin = h_blanking - h_sync_offset - h_sync_width;
+        mode->right_margin = h_sync_offset;
+        mode->upper_margin = v_blanking - v_sync_offset - v_sync_width;
+        mode->lower_margin = v_sync_offset;
+        mode->hsync_len = h_sync_width;
+        mode->vsync_len = v_sync_width;
+}
diff --git a/include/edid.h b/include/edid.h
index 480a773..4423062 100644
--- a/include/edid.h
+++ b/include/edid.h
@@ -233,6 +233,9 @@ struct edid1_info {
  */
 void edid_print_info(struct edid1_info *edid_info);
 
+struct fb_videomode;
+void edid_to_fb_videomode(struct edid1_info *edid, struct fb_videomode *mode);
+
 /**
  * Check the EDID info.
  *
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] edid: add function to convert edid to fb_videomode
  2014-01-04  8:53 [U-Boot] [PATCH] edid: add function to convert edid to fb_videomode Christian Gmeiner
@ 2014-01-04  9:17 ` Wolfgang Denk
  2014-01-04 10:01   ` Christian Gmeiner
  2014-01-04 14:33 ` Gerhard Sittig
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2014-01-04  9:17 UTC (permalink / raw)
  To: u-boot

Dear Christian Gmeiner,

In message <39679-8461-1-git-send-email-christian.gmeiner@gmail.com> you wrote:
> There may be some custom boards in the field which have
> an seperate eeprom chip to store edid informations in it.

Also some boards may pass EDIT information in the device tree.

> To make use of those edid information in the board code
> this patch add a function to convert edid to fb_videomode.

Allthough this function may be useful, there is no user for this new
function in current mainline code, and we do not like adding dead
code like this.

Please resubmit as part of a patch series that actually uses this
code.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You've no idea of what a poor opinion  I  have  of  myself,  and  how
little I deserve it.                                  - W. S. Gilbert

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] edid: add function to convert edid to fb_videomode
  2014-01-04  9:17 ` Wolfgang Denk
@ 2014-01-04 10:01   ` Christian Gmeiner
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Gmeiner @ 2014-01-04 10:01 UTC (permalink / raw)
  To: u-boot

2014/1/4 Wolfgang Denk <wd@denx.de>:
> Dear Christian Gmeiner,
>
> In message <39679-8461-1-git-send-email-christian.gmeiner@gmail.com> you wrote:
>> There may be some custom boards in the field which have
>> an seperate eeprom chip to store edid informations in it.
>
> Also some boards may pass EDIT information in the device tree.
>

The linux imx-drm driver does needs a display-timing node.

>> To make use of those edid information in the board code
>> this patch add a function to convert edid to fb_videomode.
>
> Allthough this function may be useful, there is no user for this new
> function in current mainline code, and we do not like adding dead
> code like this.
>
> Please resubmit as part of a patch series that actually uses this
> code.
>

It is really time to submit the whole board support code our imx6 based
board series. I am preparing it and will send it out in the next days.

greets
--
Christian Gmeiner, MSc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] edid: add function to convert edid to fb_videomode
  2014-01-04  8:53 [U-Boot] [PATCH] edid: add function to convert edid to fb_videomode Christian Gmeiner
  2014-01-04  9:17 ` Wolfgang Denk
@ 2014-01-04 14:33 ` Gerhard Sittig
  1 sibling, 0 replies; 4+ messages in thread
From: Gerhard Sittig @ 2014-01-04 14:33 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 01, 1970 at 11:01 +0000, Christian Gmeiner wrote:
> 
> [ ... ]

Please check you system's clock, it appears to be off.  Your
message had this timestamp:

  Date: Thu,  1 Jan 1970 11:01:19 +0000

Can't tell what git would make of it when applying the patch.


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-04 14:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-04  8:53 [U-Boot] [PATCH] edid: add function to convert edid to fb_videomode Christian Gmeiner
2014-01-04  9:17 ` Wolfgang Denk
2014-01-04 10:01   ` Christian Gmeiner
2014-01-04 14:33 ` Gerhard Sittig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox