* Thu Mar 13 2008 Adam Jackson <ajax@redhat.com> 1.4.99.901-8.20080310

- xserver-1.5.0-aspect-match.patch: Fix the RANDR 1.2 initial configuration
  heuristic for the case where the best possible mode is the first one in
  the first monitor's mode list.
This commit is contained in:
Adam Jackson 2008-03-13 19:07:47 +00:00
parent aea2eff25e
commit cae9d22d3e
2 changed files with 99 additions and 1 deletions

View File

@ -20,7 +20,7 @@
Summary: X.Org X11 X server
Name: xorg-x11-server
Version: 1.4.99.901
Release: 7.%{gitdate}%{?dist}
Release: 8.%{gitdate}%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X
@ -66,6 +66,7 @@ Patch5005: xserver-1.5.0-unselinux.patch
Patch5006: xserver-1.5.0-ia64.patch
Patch5007: xserver-1.5.0-bad-fbdev-thats-mine.patch
Patch5008: xserver-1.5.0-xaa-sucks.patch
Patch5009: xserver-1.5.0-aspect-match.patch
%define moduledir %{_libdir}/xorg/modules
%define drimoduledir %{_libdir}/dri
@ -514,6 +515,11 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Mar 13 2008 Adam Jackson <ajax@redhat.com> 1.4.99.901-8.20080310
- xserver-1.5.0-aspect-match.patch: Fix the RANDR 1.2 initial configuration
heuristic for the case where the best possible mode is the first one in
the first monitor's mode list.
* Thu Mar 13 2008 Adam Jackson <ajax@redhat.com> 1.4.99.901-7.20080310
- xserver-1.5.0-xaa-sucks: Disable XAA offscreen pixmaps by default. They're
almost always a performance loss anyway. Use Option "XaaOffscreenPixmaps"

View File

@ -0,0 +1,92 @@
From ee98a88b16133b1e2b8532678ea9e06868db7407 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Thu, 13 Mar 2008 14:06:18 -0400
Subject: [PATCH] Fix xf86TargetAspect() to, er, work.
nextAspectMode() was always skipping the first mode in the mode list, which
was problematic if that was the best possible mode...
---
hw/xfree86/modes/xf86Crtc.c | 51 ++++++++++++++++++++++--------------------
1 files changed, 27 insertions(+), 24 deletions(-)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 0bef5b4..2b07421 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1674,14 +1674,19 @@ aspectMatch(float a, float b)
}
static DisplayModePtr
-nextAspectMode(DisplayModePtr start, float aspect)
+nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect)
{
- DisplayModePtr m = start;
+ DisplayModePtr m = NULL;
- if (!m)
+ if (!o)
return NULL;
- for (m = m->next; m; m = m->next)
+ if (!last)
+ m = o->probed_modes;
+ else
+ m = last->next;
+
+ for (; m; m = m->next)
if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay))
return m;
@@ -1691,31 +1696,29 @@ nextAspectMode(DisplayModePtr start, float aspect)
static DisplayModePtr
bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
{
- int o, p;
- DisplayModePtr mode, test = NULL, match = NULL;
+ int o = -1, p;
+ DisplayModePtr mode = NULL, test = NULL, match = NULL;
- for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
- mode = config->output[o]->probed_modes;
- while ((mode = nextAspectMode(mode, aspect))) {
- for (p = o; nextEnabledOutput(config, enabled, &p); ) {
- test = xf86OutputFindClosestMode(config->output[p], mode);
- if (!test)
- break;
- if (test->HDisplay != mode->HDisplay ||
+ nextEnabledOutput(config, enabled, &o);
+ while ((mode = nextAspectMode(config->output[o], mode, aspect))) {
+ for (p = o; nextEnabledOutput(config, enabled, &p); ) {
+ test = xf86OutputFindClosestMode(config->output[p], mode);
+ if (!test)
+ break;
+ if (test->HDisplay != mode->HDisplay ||
test->VDisplay != mode->VDisplay) {
- test = NULL;
- break;
- }
+ test = NULL;
+ break;
}
+ }
- /* if we didn't match it on all outputs, try the next one */
- if (!test)
- continue;
+ /* if we didn't match it on all outputs, try the next one */
+ if (!test)
+ continue;
- /* if it's bigger than the last one, save it */
- if (!match || (test->HDisplay > match->HDisplay))
- match = test;
- }
+ /* if it's bigger than the last one, save it */
+ if (!match || (test->HDisplay > match->HDisplay))
+ match = test;
}
/* return the biggest one found */
--
1.5.4.3