Package: read-edid
Version: 1.4.1-2.1
Severity: wishlist
Tags: patch

Hi,
the attached patch adds parsing of display size to parse-edid which is
quiet useful if you want your x server to use the correct dpi. 
Please apply,
 -- Guido

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.22-rc6-g48b8ff73
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages read-edid depends on:
ii  libc6                         2.5-11     GNU C Library: Shared libraries

read-edid recommends no packages.

-- no debconf information
diff --git a/parse-edid.c b/parse-edid.c
index e73bdef..8d7185e 100644
--- a/parse-edid.c
+++ b/parse-edid.c
@@ -53,7 +53,11 @@ const byte edid_v1_descriptor_flag[] = { 0x00, 0x00 };
 #define EDID_STRUCT_VERSION                     0x12
 #define EDID_STRUCT_REVISION                    0x13
 
+#define WIDTH                                   0x15
+#define HEIGHT                                  0x16
+
 #define DPMS_FLAGS				0x18
+
 #define ESTABLISHED_TIMING_1                    0x23
 #define ESTABLISHED_TIMING_2                    0x24
 #define MANUFACTURERS_TIMINGS                   0x25
@@ -191,6 +195,9 @@ char*
 get_vendor_sign( byte const* block );
 
 int
+parse_display_size( byte width, byte height);
+
+int
 parse_dpms_capabilities( byte flags );
 
 int
@@ -299,6 +306,8 @@ parse_edid( byte* edid )
 	parse_monitor_limits( block );
     }
 
+  parse_display_size(edid[WIDTH], edid[HEIGHT]);
+
   parse_dpms_capabilities(edid[DPMS_FLAGS]);
 
   block = edid + DETAILED_TIMING_DESCRIPTIONS_START;
@@ -449,3 +458,13 @@ parse_dpms_capabilities(byte flags)
   return 0;
 }
     
+int
+parse_display_size(byte width, byte height)
+{
+  if (width && height) 
+      {
+        printf("\tDisplaySize %d %d\n", width * 10, height * 10); 
+      }
+  return 0;
+}
+

Reply via email to