[haiku-commits] Change in haiku[master]: intel_extreme: filter out some video modes

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 9 Feb 2020 17:53:02 +0000

From Adrien Destugues <pulkomandy@xxxxxxxxx>:

Adrien Destugues has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2235 ;)


Change subject: intel_extreme: filter out some video modes
......................................................................

intel_extreme: filter out some video modes

Only in the specific case of:
- Generation 2 or 3 hardware (with a limited panel fitter)
- No EDID is found (so we have no idea about timing limits)
- A VBT is found (so we know the native resolution of the LCD panel)

Only in this case, restrict available resolutions to the ones not larger
than the VBT mode. Larger resolutions don't work and result in a black
screen.

In all other cases, we should normally figure out appropriate
resolutions from the EDID limits and our well-known modes list.
---
M src/add-ons/accelerants/intel_extreme/mode.cpp
1 file changed, 22 insertions(+), 2 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/35/2235/1

diff --git a/src/add-ons/accelerants/intel_extreme/mode.cpp 
b/src/add-ons/accelerants/intel_extreme/mode.cpp
index 06e73a1..42616a2 100644
--- a/src/add-ons/accelerants/intel_extreme/mode.cpp
+++ b/src/add-ons/accelerants/intel_extreme/mode.cpp
@@ -145,6 +145,21 @@
 }


+static bool
+limit_modes_for_gen3_lvds(display_mode* mode)
+{
+       // Filter out modes with resolution higher than the internal LCD can
+       // display.
+       // FIXME do this only for that display. The whole display mode logic
+       // needs to be adjusted to know which display we're talking about.
+       if (gInfo->shared_info->panel_mode.virtual_width < mode->virtual_width)
+               return false;
+       if (gInfo->shared_info->panel_mode.virtual_height < 
mode->virtual_height)
+               return false;
+
+       return true;
+}
+
 /*!    Creates the initial mode list of the primary accelerant.
        It's called from intel_init_accelerant().
 */
@@ -183,11 +198,16 @@
        if (!gInfo->has_edid && gInfo->shared_info->got_vbt) {
                // We could not read any EDID info. Fallback to creating a list 
with
                // only the mode set up by the BIOS.
+
+               check_display_mode_hook limitModes = NULL;
+               if (gInfo->shared_info->device_type.Generation() < 4) {
+                       limitModes = limit_modes_for_gen3_lvds;
+               }

                // TODO: support lower modes via scaling and windowing
                gInfo->mode_list_area = create_display_modes("intel extreme 
modes",
                        NULL, &gInfo->shared_info->panel_mode, 1,
-                       supportedSpaces, colorSpaceCount, NULL, &list, &count);
+                       supportedSpaces, colorSpaceCount, limitModes, &list, 
&count);
        } else {
                // Otherwise return the 'real' list of modes
                gInfo->mode_list_area = create_display_modes("intel extreme 
modes",
@@ -245,7 +265,7 @@

        // first search for the specified mode in the list, if no mode is found
        // try to fix the target mode in sanitize_display_mode
-       // TODO: Only sanitize_display_mode should be used. However, at the 
moments
+       // TODO: Only sanitize_display_mode should be used. However, at the 
moment
        // the mode constraints are not optimal and do not work for all
        // configurations.
        for (uint32 i = 0; i < gInfo->shared_info->mode_count; i++) {

--
To view, visit https://review.haiku-os.org/c/haiku/+/2235
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I3bba9f53b92c4c647e0d644fa0181f6fe96d1fc4
Gerrit-Change-Number: 2235
Gerrit-PatchSet: 1
Gerrit-Owner: Adrien Destugues <pulkomandy@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: intel_extreme: filter out some video modes - Gerrit