Skip to content
Browse files

added extended EDID info to sysfs entries vga_edid and dvi_edid for d…

…ebugging monitor problems
  • Loading branch information...
1 parent 3739922 commit 939ebab33a380b07b0c07ae0d3f61b1f313b98a6 Far McKon committed with haveahennessy May 31, 2011
Showing with 48 additions and 5 deletions.
  1. +2 −2 drivers/bmi/pims/video/bmi_video.c
  2. +44 −3 drivers/video/fbmon.c
  3. +2 −0 include/linux/fb.h
View
4 drivers/bmi/pims/video/bmi_video.c
@@ -368,7 +368,7 @@ static ssize_t bmi_video_vga_edid_show(struct device *dev,
if(video->vga_monitor_edid) {
ssize_t len = 0;
fb_edid_to_monspecs( video->vga_monitor_edid, &monspecs);
- len = fb_edid_show(&monspecs, buf, PAGE_SIZE, 1);
+ len = fb_edid_show(&monspecs, buf, PAGE_SIZE, 5);
fb_destroy_modedb(monspecs.modedb);
return len;
}
@@ -384,7 +384,7 @@ static ssize_t bmi_video_dvi_edid_show(struct device *dev,
if(video->dvi_monitor_edid) {
ssize_t len = 0;
fb_edid_to_monspecs( video->dvi_monitor_edid, &monspecs);
- len = fb_edid_show(&monspecs, buf, PAGE_SIZE, 1);
+ len = fb_edid_show(&monspecs, buf, PAGE_SIZE, 5);
fb_destroy_modedb(monspecs.modedb);
return len;
}
View
47 drivers/video/fbmon.c
@@ -908,7 +908,26 @@ int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
}
return 1;
}
-
+ssize_t fb_videomode_show(struct fb_videomode* modedb, int modedb_len,
+ int bpp, char* buf, ssize_t bufSize)
+{
+ int i = 0;
+ if(modedb_len <= 0) {
+ snprintfcat(buf,bufSize, "== No Valid Mode Info ==\n");
+ return strnlen(buf, bufSize);
+ }
+ // detail <= 1, print EDID header
+ snprintfcat(buf, bufSize, "=====\nMODE INFO\n====\n");
+
+ for (i = 0; i < modedb_len; i++)
+ {
+ struct fb_videomode* mode = &modedb[i];
+ snprintfcat(buf, bufSize, "Listed mode %s %dx%d-%d@%d\n",
+ mode->name ? mode->name : "noname",
+ mode->xres, mode->yres, bpp, mode->refresh);
+ }
+ return strnlen(buf, bufSize);
+}
/* fb_edid_show - prints EDID data summary to a passed buffer
*
@@ -923,6 +942,7 @@ int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
ssize_t fb_edid_show(struct fb_monspecs *specs, char *buf,
ssize_t bufSize, int detail)
{
+ // detail <= 1, print EDID header
snprintfcat(buf, bufSize, "=====\nEDID INFO\n====\n");
snprintfcat(buf, bufSize, " EDID Version %d.%d\n",
(int) specs->version, (int) specs->revision);
@@ -931,8 +951,29 @@ ssize_t fb_edid_show(struct fb_monspecs *specs, char *buf,
snprintfcat(buf, bufSize, " Serial#: %u\n", specs->serial);
snprintfcat(buf, bufSize, " Year: %u Week %u\n",
specs->year, specs->week);
- if (detail < 1) {
- printk(KERN_INFO "Only level 1 detail available\n");
+
+ //display video modes
+ if(detail >= 2){
+ int bpp = 8; //HACK: hardcoded for testing
+ fb_videomode_show(specs->modedb, specs->modedb_len,bpp, buf, bufSize);
+ }
+
+ if (detail >= 3 ) {
+ snprintfcat(buf, bufSize, "== Display Characteristics:\n");
+ if(specs->input == 0)
+ snprintfcat(buf, bufSize, "No display inf in EDID\n");
+ else if( (specs->input & FB_DISP_DDI) == FB_DISP_DDI)
+ snprintfcat(buf, bufSize, "Digital Display Input\n");
+ else if( (specs->input & FB_DISP_ANA_700_300) == FB_DISP_ANA_700_300)
+ snprintfcat(buf, bufSize, "Analog Display Input: 0.7V/0.3V\n");
+ else if( (specs->input & FB_DISP_ANA_714_286) == FB_DISP_ANA_714_286)
+ snprintfcat(buf, bufSize, "Analog Display Input: 0.714V/0.286V\n");
+ else if( (specs->input & FB_DISP_ANA_1000_400) == FB_DISP_ANA_1000_400)
+ snprintfcat(buf, bufSize, "Analog Display Input: 0.1000V/0.400V\n");
+ else if( (specs->input & FB_DISP_ANA_700_000) == FB_DISP_ANA_700_000)
+ snprintfcat(buf, bufSize, "Analog Display Input: 0.7V/0.0V\n");
+
+ snprintfcat(buf, bufSize, "Sync: Not reported\n");
return strnlen(buf, bufSize);
}
View
2 include/linux/fb.h
@@ -1067,6 +1067,8 @@ extern int fb_validate_mode(const struct fb_var_screeninfo *var,
struct fb_info *info);
extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var);
extern const unsigned char *fb_firmware_edid(struct device *device);
+ssize_t fb_videomode_show(struct fb_videomode* modedb, int modedb_len,
+ int bpp, char* buf, ssize_t bufSize);
extern ssize_t fb_edid_show(struct fb_monspecs *specs, char *buf,
ssize_t bufSize, int detail);
extern void fb_edid_to_monspecs(unsigned char *edid,

0 comments on commit 939ebab

Please sign in to comment.
Something went wrong with that request. Please try again.