From c21470a80f21c322054000c70ed8218f6c13ffdc Mon Sep 17 00:00:00 2001 From: "ynovikov@chromium.org" Date: Tue, 5 Mar 2013 19:39:49 +0000 Subject: Matching modes for mirroring should preserve interlacing. Add a condition when searching for modes for mirroring - both modes must either be interlaced or progressive scan. Also, as internal panels don't support interlacing, do not attempt to panel fit interlaced modes on them. BUG=179207 TEST=Manually disabled modes, making interlaced one the preferred, then verified that this mode is not picked for mirroring, but the next one. Steps in the bug should also work, but I don't have the necessary hardware. Review URL: https://chromiumcodereview.appspot.com/12388090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186231 0039d316-1c4b-4281-b951-d872f2087c98 --- chromeos/display/output_configurator.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'chromeos') diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index 4357b1a..c460114 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -1070,8 +1070,11 @@ bool OutputConfigurator::FindOrCreateMirrorMode(Display* display, for (int j = 0; j < internal_info->nmode; j++) { internal_mode_id = internal_info->modes[j]; XRRModeInfo* internal_mode = ModeInfoForID(screen, internal_mode_id); + bool is_internal_interlaced = internal_mode->modeFlags & RR_Interlace; + bool is_external_interlaced = external_mode->modeFlags & RR_Interlace; if (internal_mode->width == external_mode->width && - internal_mode->height == external_mode->height) { + internal_mode->height == external_mode->height && + is_internal_interlaced == is_external_interlaced) { *internal_mirror_mode = internal_mode_id; *external_mirror_mode = external_mode_id; return true; // Mirror mode found @@ -1082,9 +1085,11 @@ bool OutputConfigurator::FindOrCreateMirrorMode(Display* display, if (try_creating) { // We can downscale by 1.125, and upscale indefinitely // Downscaling looks ugly, so, can fit == can upscale + // Also, internal panels don't support fitting interlaced modes bool can_fit = internal_native_mode->width >= external_mode->width && - internal_native_mode->height >= external_mode->height; + internal_native_mode->height >= external_mode->height && + !(external_mode->modeFlags & RR_Interlace); if (can_fit) { XRRAddOutputMode(display, internal_output_id, external_mode_id); *internal_mirror_mode = *external_mirror_mode = external_mode_id; -- cgit v1.1