Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271297
b: refs/heads/master
c: 43dcd13
h: refs/heads/master
i:
  271295: ce27f1e
v: v3
  • Loading branch information
Tomi Valkeinen authored and Florian Tobias Schandinat committed Sep 1, 2011
1 parent 5714ea1 commit 106928e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f88a91ccc8c341e6058c017823e2db266f374024
refs/heads/master: 43dcd13b9a807ea9e832e4c6b138d825a7b65577
21 changes: 15 additions & 6 deletions trunk/drivers/video/fbmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ static int get_est_timing(unsigned char *block, struct fb_videomode *mode)
return num;
}

static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
static int get_std_timing(unsigned char *block, struct fb_videomode *mode,
int ver, int rev)
{
int xres, yres = 0, refresh, ratio, i;

Expand All @@ -504,7 +505,11 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
ratio = (block[1] & 0xc0) >> 6;
switch (ratio) {
case 0:
yres = xres;
/* in EDID 1.3 the meaning of 0 changed to 16:10 (prior 1:1) */
if (ver < 1 || (ver == 1 && rev < 3))
yres = xres;
else
yres = (xres * 10)/16;
break;
case 1:
yres = (xres * 3)/4;
Expand Down Expand Up @@ -533,12 +538,12 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
}

static int get_dst_timing(unsigned char *block,
struct fb_videomode *mode)
struct fb_videomode *mode, int ver, int rev)
{
int j, num = 0;

for (j = 0; j < 6; j++, block += STD_TIMING_DESCRIPTION_SIZE)
num += get_std_timing(block, &mode[num]);
num += get_std_timing(block, &mode[num], ver, rev);

return num;
}
Expand Down Expand Up @@ -599,6 +604,10 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
struct fb_videomode *mode, *m;
unsigned char *block;
int num = 0, i, first = 1;
int ver, rev;

ver = edid[EDID_STRUCT_VERSION];
rev = edid[EDID_STRUCT_REVISION];

mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
if (mode == NULL)
Expand Down Expand Up @@ -632,12 +641,12 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
DPRINTK(" Standard Timings\n");
block = edid + STD_TIMING_DESCRIPTIONS_START;
for (i = 0; i < STD_TIMING; i++, block += STD_TIMING_DESCRIPTION_SIZE)
num += get_std_timing(block, &mode[num]);
num += get_std_timing(block, &mode[num], ver, rev);

block = edid + DETAILED_TIMING_DESCRIPTIONS_START;
for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) {
if (block[0] == 0x00 && block[1] == 0x00 && block[3] == 0xfa)
num += get_dst_timing(block + 5, &mode[num]);
num += get_dst_timing(block + 5, &mode[num], ver, rev);
}

/* Yikes, EDID data is totally useless */
Expand Down

0 comments on commit 106928e

Please sign in to comment.