summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@x-pk2.(none)>2011-06-09 14:06:54 +0800
committerroot <root@x-pk2.(none)>2011-06-09 14:06:54 +0800
commit92a075defb8aa69ad766067b23bdd3f0db6ca0bb (patch)
treeaac2353d4ad7be835e63b42ed0288fcb0a13a8ac
parent12a54cd3aca7e01033b74ed208f215a6cbcf2c88 (diff)
HDMI bpp support, and MAXEDID is written 256.
-rw-r--r--testedid.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/testedid.c b/testedid.c
index 5bb0612..1e378a3 100644
--- a/testedid.c
+++ b/testedid.c
@@ -15,9 +15,11 @@
#define EDIDPATH "/sys/class/drm/"
#define MAXCARD 10
#define MAXFILENAME 256
-#define MAXEDID 128
+#define MAXEDID 256
#include "drm_edid.h"
+//int MAXEDID = 128;
+
int getcardlist(struct dirent *cardlist[])
{
DIR* dp;
@@ -137,6 +139,17 @@ void finddmtmode(struct modeinfo* m,struct modeline* rmode)
}
}
}
+int gethdmiblock(char edid[])
+{
+ for(int i=0;i<MAXEDID;i++)
+ {
+ if(edid[i] == 0x03 && edid[i+1] == 0x0c && edid[i+2] == 0)
+ {
+ return i;
+ }
+ }
+ return -1;
+}
void analizeedid(char edid[])
{
char head[]={0x0,0xff,0xff,0xff,0xff,0xff,0xff,0x0};
@@ -424,8 +437,25 @@ void analizeedid(char edid[])
// printf("VSync: %d\n",sync.value);
}
-
+//////////////////////
+//HDMI
+ int phdmiindex = gethdmiblock(edid);
+ if(phdmiindex != -1)
+ {
+ printf("having a hdmi block, start position is:%2hhx\n",phdmiindex);
+ char *bppinfo[]={ "DVI_Dual" , "", "", "DC_Y444", "DC_30bit", "DC_36bit", "DC_48bit", "Supports_AI"};
+ char bppbyte=edid[phdmiindex + 5];
+ for(int i=0;i<8;i++)
+ {
+ if(bppbyte & 0x01)
+ {
+ printf("HDMI bpp supports: %s\n",bppinfo[i]);
+ }
+ bppbyte = bppbyte >> 1;
+ }
+ }
}
+
int main(void)
{
struct dirent *cardlist[MAXCARD];