[PATCH] i386/pc386: reimplemented check for unused EDID entry in fb_vesa.c to suppress GCC 6 warning.

Pavel Pisa ppisa4lists at pikron.com
Sat Apr 16 13:06:49 UTC 2016


From: Pavel Pisa <ppisa at pikron.com>

closes #2634.

---
 c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c | 2 +-
 c/src/lib/libbsp/i386/pc386/include/edid.h       | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

 I have finally found time to update tools to 4.12 and test change on master.
 Tested on QEMU only for now. If agreed, I can try to push patch to the master branch.

diff --git a/c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c b/c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c
index b758564..fa41d01 100644
--- a/c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c
+++ b/c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c
@@ -499,7 +499,7 @@ static int32_t find_mode_using_EDID( Mode_params *mode_list,
         while (index < 8)
         {
             /* check if descriptor is unused */
-            if (*(uint16_t*)&edid.STI[index] == EDID_STI_DescriptorUnused)
+            if (edid1_STI_is_unused(&edid.STI[index]))
             {
                 index++;
                 continue;
diff --git a/c/src/lib/libbsp/i386/pc386/include/edid.h b/c/src/lib/libbsp/i386/pc386/include/edid.h
index b8c00b1..836294d 100644
--- a/c/src/lib/libbsp/i386/pc386/include/edid.h
+++ b/c/src/lib/libbsp/i386/pc386/include/edid.h
@@ -473,6 +473,14 @@ EDID_INLINE_ROUTINE uint16_t edid1_WhiteY (EDID_edid1 *edid) {
     return (edid->WhiteYHigh<<2) | (edid->WhiteBlueLow&0x3);
 }
 
+EDID_INLINE_ROUTINE int edid1_STI_is_unused (
+      const EDID_standard_timing_identification *edid_sti) {
+    return (edid_sti->HorizontalActivePixels ==
+                  (uint8_t)EDID_STI_DescriptorUnused) &&
+           (edid_sti->ImageAspectRatio_RefreshRate ==
+                  (uint8_t)(EDID_STI_DescriptorUnused >> 8));
+}
+
 enum edid1_established_timings {
 /*  Established Timings I */
     EST_800x600_60Hz    = 0,
-- 
1.9.1



More information about the devel mailing list