[haiku-development] Re: Proposed Change to Common Accelerant for EDID

  • From: Gerald Zajac <zajacg@xxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 26 Jun 2009 17:47:28 -0400

Axel Dörfler wrote:
Gerald Zajac <zajacg@xxxxxxxxxxxxx> wrote:
[...]
After further thought, I have come to the conclusion that 1152x864 is the only resolution that has a problem. After examining the EDID info from 7 monitors, it was found that 6 of the monitors had only one EDID entry for 1152x864 and the refresh rate was always 75Hz. The one exception was an older CRT monitor which had no 1152x864 entry.

The resulting mode list from this EDID info will contain only one entry for 1152x864 which will have a refresh rate of 75Hz; thus, for any refresh rate < 75Hz (eg, 60, 70 or 72Hz), the Screen Preferences computes the pixel clock from the 75Hz entry. This causes some problems with the LCD monitors where the testing was performed. When the mode was set to 1152x864 with a refresh rate of 70 or 72Hz, the display would be offset to the right about 10-20 cm and auto-adjust would not recenter the display. This occurred with ATI (Mach64 & Rage128) and S3 chips. Futhermore, there are some problems at 60Hz where displays from some of the Mach64 chips had some flickering and/or ripples.

If the entries from the Common Accelerant base mode list for 1152x864x60Hz and 1152x864@70Hz are added to the constructed mode list, the above problems do not occur. Thus, I'm proposing to modify the Common Accelerant such that when EDID info is used to build a mode list, it checks the 1152x864 entries in the resulting mode list. If the mode list contains one or more 1152x864 entries, and these entries have refresh rates >= 75Hz, entries for 1152x864x60Hz and 1152x864x70Hz will be added to the mode list.

That doesn't really sound like a good solution to me; at least it seems to be a work-around for a broken mode generator/tweaker. Can't we add a function (to the common accelerant code) that just generates good modes? So that we would only need to call that one from propose_mode() with info about the restrictions of the graphics card?


We have good modes in the base mode list (kBaseModeList) for 1152x864, and all I'm suggesting is adding the 1152x864 60Hz and 70Hz modes from the base mode list to the mode list that is being constructed if the EDID info specifies only a refresh rate of 75Hz for 1152x864. All the LCD monitors that I have tested specify only 1152x864@75Hz, and I have no idea as to why none of them do not also specify a refresh rate < 75Hz for 1152x864.

Anyway, attached is a diff file with my proposed changes.

The Screen Preferences merely adjusts the pixel clock when it can not find a matching refresh rate for a specified resolution. Is this the correct way of doing it, or should it also be adjusting some of the other parameters in the mode info?

--Gerald


Index: src/add-ons/accelerants/common/create_display_modes.cpp
===================================================================
--- src/add-ons/accelerants/common/create_display_modes.cpp     (revision 31260)
+++ src/add-ons/accelerants/common/create_display_modes.cpp     (working copy)
@@ -32,18 +32,18 @@
 
        {{29580, 800, 816, 896, 992, 480, 481, 484, 497, B_POSITIVE_VSYNC}, 
B_CMAP8, 800, 480, 0, 0, MODE_FLAGS}, /* 800x480x60Hz */
 
-       {{38100, 800, 832, 960, 1088, 600, 602, 606, 620, 0}, B_CMAP8, 800, 
600, 0, 0, MODE_FLAGS}, /* SVGA_800X600X56HzNI */
+       {{36000, 800, 824, 896, 1024, 600, 601, 603, 625, POSITIVE_SYNC}, 
B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@56Hz_(800X600) */
        {{40000, 800, 840, 968, 1056, 600, 601, 605, 628, POSITIVE_SYNC}, 
B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@60Hz_(800X600X8.Z1) */
        {{49500, 800, 816, 896, 1056, 600, 601, 604, 625, POSITIVE_SYNC}, 
B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@75Hz_(800X600X8.Z1) */
        {{50000, 800, 856, 976, 1040, 600, 637, 643, 666, POSITIVE_SYNC}, 
B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@70-72Hz_(800X600X8.Z1) */
        {{56250, 800, 832, 896, 1048, 600, 601, 604, 631, POSITIVE_SYNC}, 
B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@85Hz_(800X600X8.Z1) */
 
        {{65000, 1024, 1048, 1184, 1344, 768, 771, 777, 806, 0}, B_CMAP8, 1024, 
768, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@60Hz_(1024X768X8.Z1) */
-       {{75000, 1024, 1048, 1184, 1328, 768, 771, 777, 806, 0}, B_CMAP8, 1024, 
768, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@70-72Hz_(1024X768X8.Z1) */
+       {{75000, 1024, 1048, 1184, 1328, 768, 771, 777, 806, 0}, B_CMAP8, 1024, 
768, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@70Hz_(1024X768X8.Z1) */
        {{78750, 1024, 1040, 1136, 1312, 768, 769, 772, 800, POSITIVE_SYNC}, 
B_CMAP8, 1024, 768, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@75Hz_(1024X768X8.Z1) */
        {{94500, 1024, 1072, 1168, 1376, 768, 769, 772, 808, POSITIVE_SYNC}, 
B_CMAP8, 1024, 768, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@85Hz_(1024X768X8.Z1) */
 
-       {{81640, 1152, 1216, 1336, 1520, 864, 865, 868, 895, POSITIVE_SYNC}, 
B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* 1152x864x60Hz */
+       {{81620, 1152, 1216, 1336, 1520, 864, 865, 868, 895, B_POSITIVE_VSYNC}, 
B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@60Hz_(1152x864) */
        {{94200, 1152, 1184, 1280, 1472, 864, 865, 868, 914, POSITIVE_SYNC}, 
B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@70Hz_(1152X864X8.Z1) */
        {{108000, 1152, 1216, 1344, 1600, 864, 865, 868, 900, POSITIVE_SYNC}, 
B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@75Hz_(1152X864X8.Z1) */
        {{121500, 1152, 1216, 1344, 1568, 864, 865, 868, 911, POSITIVE_SYNC}, 
B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_@85Hz_(1152X864X8.Z1) */
@@ -70,7 +70,6 @@
 
        {{147100, 1680, 1784, 1968, 2256, 1050, 1051, 1054, 1087, 
POSITIVE_SYNC}, B_CMAP8, 1680, 1050, 0, 0, MODE_FLAGS}, /* 
Vesa_Monitor_@60Hz_(1680X1050) */
 
-       //{{160000, 1920, 2010, 2060, 2110, 1200, 1202, 1208, 1235, 
POSITIVE_SYNC}, B_CMAP8, 1920, 1200, 0, 0, MODE_FLAGS}, /* 
Vesa_Monitor_@60Hz_(1920X1200) */
        {{193160, 1920, 2048, 2256, 2592, 1200, 1201, 1204, 1242, 
POSITIVE_SYNC}, B_CMAP8, 1920, 1200, 0, 0, MODE_FLAGS}, /* 
Vesa_Monitor_@60Hz_(1920X1200) */
 };
 static const uint32 kNumBaseModes = sizeof(kBaseModeList) / 
sizeof(display_mode);
@@ -254,9 +253,32 @@
                _AddMode(&mode);
        }
 
-       // TODO: add other modes from the base list that satisfy the display's
-       //      requirements!
+       // If EDID info has any entries for 1152x864, it is usually only one 
with a
+       // refresh rate of 75Hz.  Thus, when a lower refresh rate is selected 
for
+       // 1152x864 in the Screen Preferences, the mode parameters are computed
+       // using the 1152x864@75Hz values.  With LCD monitors, this can cause 
the
+       // display to have ripples and/or flicker, or the display will be 
offset to
+       // the right 10-20 cm and Auto-Adjust will not recenter the display.  
Thus,
+       // for 1152x864, add the mode entries for the lower refresh rates.
 
+       uint32 lowestRefreshRate = 0;           // 0 = none found
+
+       for (uint32 j = 0; j < fCount; j++) {
+               display_mode& mode = fModes[j];
+               if (mode.timing.h_display == 1152 && mode.timing.v_display == 
864) {
+                       uint32 refreshRate = uint32(get_refresh_rate(mode) + 
0.5);
+                       if (lowestRefreshRate == 0 || refreshRate < 
lowestRefreshRate)
+                               lowestRefreshRate = refreshRate;
+               }
+       }
+
+       if (lowestRefreshRate > 60)
+               _AddBaseMode(1152, 864, 60);
+       if (lowestRefreshRate > 70)
+               _AddBaseMode(1152, 864, 70);
+       if (lowestRefreshRate > 75)
+               _AddBaseMode(1152, 864, 75);
+
        return true;
 }
 

Other related posts: