intel_extreme: use panel fitter also for generation 3

Should help with #14066
This commit is contained in:
Adrien Destugues
2020-01-11 11:52:05 +01:00
parent e8faedae57
commit 6f7074581a
@@ -490,14 +490,17 @@ LVDSPort::SetDisplayMode(display_mode* target, uint32 colorMode)
link->Train(target); link->Train(target);
#endif #endif
// For LVDS panels, we actually always set the native mode in hardware // For LVDS panels, we may need to set the timings according to the panel
// Then we use the panel fitter to scale the picture to that. // native video mode, and let the panel fitter do the scaling. But the
// place where the scaling happens varies accross generations of devices.
display_mode hardwareTarget; display_mode hardwareTarget;
bool needsScaling = false; bool needsScaling = false;
// TODO needed for the other generations as well, in some way? // TODO figure out how it's done (or if we need to configure something at
if (gInfo->shared_info->device_type.Generation() == 4 // all) for other generations
&& gInfo->shared_info->got_vbt) { if ((gInfo->shared_info->device_type.Generation() == 4
|| gInfo->shared_info->device_type.Generation() == 3)
&& gInfo->shared_info->got_vbt) {
// Set vbios hardware panel mode as base // Set vbios hardware panel mode as base
memcpy(&hardwareTarget, &gInfo->shared_info->panel_mode, memcpy(&hardwareTarget, &gInfo->shared_info->panel_mode,
sizeof(display_mode)); sizeof(display_mode));
@@ -519,6 +522,7 @@ LVDSPort::SetDisplayMode(display_mode* target, uint32 colorMode)
} }
} else { } else {
// We don't have VBT data, try to set the requested mode directly // We don't have VBT data, try to set the requested mode directly
// and hope for the best
hardwareTarget = *target; hardwareTarget = *target;
} }
@@ -609,7 +613,8 @@ LVDSPort::SetDisplayMode(display_mode* target, uint32 colorMode)
// LVDS is always on pipe B. // LVDS is always on pipe B.
write32(INTEL_PANEL_FIT_CONTROL, panelFitterControl); write32(INTEL_PANEL_FIT_CONTROL, panelFitterControl);
} else { } else {
if (gInfo->shared_info->device_type.Generation() == 4) { if (gInfo->shared_info->device_type.Generation() == 4
|| gInfo->shared_info->device_type.Generation() == 3) {
// Bypass the panel fitter // Bypass the panel fitter
uint32 panelFitterControl = read32(INTEL_PANEL_FIT_CONTROL); uint32 panelFitterControl = read32(INTEL_PANEL_FIT_CONTROL);
panelFitterControl &= ~PANEL_FITTER_ENABLED; panelFitterControl &= ~PANEL_FITTER_ENABLED;