intel_extreme: Fixed virtualscreen setup, ticket #17261

This commit is contained in:
Rudolf Cornelissen
2021-09-14 02:04:02 +00:00
parent 9a76b18fb6
commit f2a79670ae
3 changed files with 31 additions and 23 deletions
@@ -162,8 +162,8 @@ Pipe::_ConfigureTranscoder(display_mode* target)
// XXX: Is it ok to do these on non-digital? // XXX: Is it ok to do these on non-digital?
write32(INTEL_TRANSCODER_A_POS + fPipeOffset, 0); write32(INTEL_TRANSCODER_A_POS + fPipeOffset, 0);
write32(INTEL_TRANSCODER_A_IMAGE_SIZE + fPipeOffset, write32(INTEL_TRANSCODER_A_IMAGE_SIZE + fPipeOffset,
((uint32)(target->virtual_width - 1) << 16) ((uint32)(target->timing.h_display - 1) << 16)
| ((uint32)target->virtual_height - 1)); | ((uint32)target->timing.v_display - 1));
#endif #endif
} }
@@ -192,8 +192,8 @@ Pipe::ConfigureScalePos(display_mode* target)
// The only thing that really matters: set the image size and let the // The only thing that really matters: set the image size and let the
// panel fitter or the transcoder worry about the rest // panel fitter or the transcoder worry about the rest
write32(INTEL_DISPLAY_A_PIPE_SIZE + fPipeOffset, write32(INTEL_DISPLAY_A_PIPE_SIZE + fPipeOffset,
((uint32)(target->virtual_width - 1) << 16) ((uint32)(target->timing.h_display - 1) << 16)
| ((uint32)target->virtual_height - 1)); | ((uint32)target->timing.v_display - 1));
// Set the plane size as well while we're at it (this is independant, we // Set the plane size as well while we're at it (this is independant, we
// could have a larger plane and scroll through it). // could have a larger plane and scroll through it).
@@ -203,8 +203,8 @@ Pipe::ConfigureScalePos(display_mode* target)
// well. Note that the height and width are swapped when compared to // well. Note that the height and width are swapped when compared to
// the other registers. // the other registers.
write32(INTEL_DISPLAY_A_IMAGE_SIZE + fPipeOffset, write32(INTEL_DISPLAY_A_IMAGE_SIZE + fPipeOffset,
((uint32)(target->virtual_height - 1) << 16) ((uint32)(target->timing.h_display - 1) << 16)
| ((uint32)target->virtual_width - 1)); | ((uint32)target->timing.v_display - 1));
} }
} }
+15 -12
View File
@@ -352,8 +352,8 @@ status_t
AnalogPort::SetDisplayMode(display_mode* target, uint32 colorMode) AnalogPort::SetDisplayMode(display_mode* target, uint32 colorMode)
{ {
CALLED(); CALLED();
TRACE("%s: %s %dx%d\n", __func__, PortName(), target->virtual_width, TRACE("%s: %s %dx%d\n", __func__, PortName(), target->timing.h_display,
target->virtual_height); target->timing.v_display);
if (fPipe == NULL) { if (fPipe == NULL) {
ERROR("%s: Setting display mode without assigned pipe!\n", __func__); ERROR("%s: Setting display mode without assigned pipe!\n", __func__);
@@ -531,7 +531,7 @@ LVDSPort::SetDisplayMode(display_mode* target, uint32 colorMode)
} }
TRACE("%s: %s-%d %dx%d\n", __func__, PortName(), PortIndex(), TRACE("%s: %s-%d %dx%d\n", __func__, PortName(), PortIndex(),
target->virtual_width, target->virtual_height); target->timing.h_display, target->timing.v_display);
if (fPipe == NULL) { if (fPipe == NULL) {
ERROR("%s: Setting display mode without assigned pipe!\n", __func__); ERROR("%s: Setting display mode without assigned pipe!\n", __func__);
@@ -572,17 +572,20 @@ LVDSPort::SetDisplayMode(display_mode* target, uint32 colorMode)
// Set vbios hardware panel mode as base // Set vbios hardware panel mode as base
hardwareTarget = gInfo->shared_info->panel_mode; hardwareTarget = gInfo->shared_info->panel_mode;
if (hardwareTarget.virtual_width == target->virtual_width if (hardwareTarget.timing.h_display == target->timing.h_display
&& hardwareTarget.virtual_height == target->virtual_height) { && hardwareTarget.timing.v_display == target->timing.v_display) {
// We are setting the native video mode, nothing special to do // We are setting the native video mode, nothing special to do
TRACE("Setting LVDS to native mode\n"); TRACE("Setting LVDS to native mode\n");
hardwareTarget = *target; hardwareTarget = *target;
} else { } else {
// We need to enable the panel fitter // We need to enable the panel fitter
TRACE("%s: hardware mode will actually be %dx%d\n", __func__, TRACE("%s: hardware mode will actually be %dx%d\n", __func__,
hardwareTarget.virtual_width, hardwareTarget.virtual_height); hardwareTarget.timing.h_display, hardwareTarget.timing.v_display);
hardwareTarget.space = target->space; hardwareTarget.space = target->space;
// retain requested virtual size
hardwareTarget.virtual_width = target->virtual_width;
hardwareTarget.virtual_height = target->virtual_height;
// FIXME we should also get the refresh frequency from the target // FIXME we should also get the refresh frequency from the target
// mode, and then "sanitize" the resulting mode we made up. // mode, and then "sanitize" the resulting mode we made up.
@@ -785,8 +788,8 @@ status_t
DigitalPort::SetDisplayMode(display_mode* target, uint32 colorMode) DigitalPort::SetDisplayMode(display_mode* target, uint32 colorMode)
{ {
CALLED(); CALLED();
TRACE("%s: %s %dx%d\n", __func__, PortName(), target->virtual_width, TRACE("%s: %s %dx%d\n", __func__, PortName(), target->timing.h_display,
target->virtual_height); target->timing.v_display);
if (fPipe == NULL) { if (fPipe == NULL) {
ERROR("%s: Setting display mode without assigned pipe!\n", __func__); ERROR("%s: Setting display mode without assigned pipe!\n", __func__);
@@ -1125,8 +1128,8 @@ status_t
DisplayPort::SetDisplayMode(display_mode* target, uint32 colorMode) DisplayPort::SetDisplayMode(display_mode* target, uint32 colorMode)
{ {
CALLED(); CALLED();
TRACE("%s: %s %dx%d\n", __func__, PortName(), target->virtual_width, TRACE("%s: %s %dx%d\n", __func__, PortName(), target->timing.h_display,
target->virtual_height); target->timing.v_display);
if (fPipe == NULL) { if (fPipe == NULL) {
ERROR("%s: Setting display mode without assigned pipe!\n", __func__); ERROR("%s: Setting display mode without assigned pipe!\n", __func__);
@@ -1331,8 +1334,8 @@ status_t
DigitalDisplayInterface::SetDisplayMode(display_mode* target, uint32 colorMode) DigitalDisplayInterface::SetDisplayMode(display_mode* target, uint32 colorMode)
{ {
CALLED(); CALLED();
TRACE("%s: %s %dx%d\n", __func__, PortName(), target->virtual_width, TRACE("%s: %s %dx%d\n", __func__, PortName(), target->timing.h_display,
target->virtual_height); target->timing.v_display);
if (fPipe == NULL) { if (fPipe == NULL) {
ERROR("%s: Setting display mode without assigned pipe!\n", __func__); ERROR("%s: Setting display mode without assigned pipe!\n", __func__);
+10 -5
View File
@@ -152,9 +152,9 @@ limit_modes_for_gen3_lvds(display_mode* mode)
// display. // display.
// FIXME do this only for that display. The whole display mode logic // FIXME do this only for that display. The whole display mode logic
// needs to be adjusted to know which display we're talking about. // needs to be adjusted to know which display we're talking about.
if (gInfo->shared_info->panel_mode.virtual_width < mode->virtual_width) if (gInfo->shared_info->panel_mode.timing.h_display < mode->timing.h_display)
return false; return false;
if (gInfo->shared_info->panel_mode.virtual_height < mode->virtual_height) if (gInfo->shared_info->panel_mode.timing.v_display < mode->timing.v_display)
return false; return false;
return true; return true;
@@ -269,18 +269,23 @@ intel_propose_display_mode(display_mode* target, const display_mode* low,
// TODO: Only sanitize_display_mode should be used. However, at the moment // TODO: Only sanitize_display_mode should be used. However, at the moment
// the mode constraints are not optimal and do not work for all // the mode constraints are not optimal and do not work for all
// configurations. // configurations.
uint32 VirtualWidth = target->virtual_width;
uint32 VirtualHeight = target->virtual_height;
for (uint32 i = 0; i < gInfo->shared_info->mode_count; i++) { for (uint32 i = 0; i < gInfo->shared_info->mode_count; i++) {
display_mode *mode = &gInfo->mode_list[i]; display_mode *mode = &gInfo->mode_list[i];
// TODO: improve this, ie. adapt pixel clock to allowed values!!! // TODO: improve this, ie. adapt pixel clock to allowed values!!!
if (target->virtual_width != mode->virtual_width if (target->timing.h_display != mode->timing.h_display
|| target->virtual_height != mode->virtual_height || target->timing.v_display != mode->timing.v_display
|| target->space != mode->space) { || target->space != mode->space) {
continue; continue;
} }
*target = *mode; *target = *mode;
// retain requested virtual size
target->virtual_width = VirtualWidth;
target->virtual_height = VirtualHeight;
return B_OK; return B_OK;
} }
@@ -298,7 +303,7 @@ intel_set_display_mode(display_mode* mode)
return B_BAD_VALUE; return B_BAD_VALUE;
TRACE("%s(%" B_PRIu16 "x%" B_PRIu16 ")\n", __func__, TRACE("%s(%" B_PRIu16 "x%" B_PRIu16 ")\n", __func__,
mode->virtual_width, mode->virtual_height); mode->timing.h_display, mode->timing.v_display);
display_mode target = *mode; display_mode target = *mode;