rpms/xorg-x11-drv-vesa/devel vesa-1.2.1-validmode.patch, NONE, 1.1 xorg-x11-drv-vesa.spec, 1.18, 1.19

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Dec 5 01:39:18 UTC 2006


Author: ajackson

Update of /cvs/dist/rpms/xorg-x11-drv-vesa/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv319

Modified Files:
	xorg-x11-drv-vesa.spec 
Added Files:
	vesa-1.2.1-validmode.patch 
Log Message:
* Mon Dec 4 2006 Adam Jackson <ajax at redhat.com> 1.3.0-1
- Update to 1.3.0
- vesa-1.2.1-validmode.patch: Implement a ValidMode driver hook, which rejects
  modes not present in the BIOS or outside the capability of the monitor.


vesa-1.2.1-validmode.patch:
 vesa.c |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+)

--- NEW FILE vesa-1.2.1-validmode.patch ---
--- xf86-video-vesa-1.2.1/src/vesa.c.validmode	2006-12-04 18:25:14.000000000 -0500
+++ xf86-video-vesa-1.2.1/src/vesa.c	2006-12-04 19:46:21.000000000 -0500
@@ -273,6 +273,60 @@
     xf86PrintChipsets(VESA_NAME, "driver for VESA chipsets", VESAChipsets);
 }
 
+static ModeStatus
+VESAValidMode(int scrn, DisplayModePtr p, Bool flag, int pass)
+{
+    static int warned = 0;
+    ScrnInfoPtr pScrn = xf86Screens[scrn];
+    MonPtr mon = pScrn->monitor;
+    ModeStatus ret1, ret2;
+    DisplayModePtr lo, hi, drop;
+
+    if (pass != MODECHECK_FINAL) {
+	if (!warned) {
+	    xf86DrvMsg(scrn, X_WARNING, "VESAValidMode called unexpectedly\n");
+	    warned = 1;
+	}
+	return MODE_OK;
+    }
+
+    /*
+     * This is suboptimal.  We pass in just the barest description of a mode
+     * we can get away with to VBEValidateModes, so it can't really throw
+     * out anything we give it.  But we need to filter the list so that we
+     * don't populate the mode list with things the monitor can't do.
+     *
+     * So first off, if this isn't a mode we handed to the server (ie,
+     * M_T_BUILTIN), then we know we can't do it.
+     */
+
+    if (!(p->type & M_T_BUILTIN))
+	return MODE_NOMODE;
+
+    /*
+     * Next, synthesize fully-loaded modes corresponding to the maximal and
+     * minimal refresh rates.  If they both fail, then pass the failure code
+     * up (possibly bogus, but oh well).
+     */
+    
+    lo = xf86CVTMode(p->HDisplay, p->VDisplay, mon->vrefresh[0].lo, 0, 0);
+    hi = xf86CVTMode(p->HDisplay, p->VDisplay, mon->vrefresh[0].hi, 0, 0);
+    ret1 = xf86CheckModeForMonitor(lo, mon);
+    ret2 = xf86CheckModeForMonitor(hi, mon);
+    xfree(lo);
+    xfree(hi);
+
+    if (ret1 && ret2) {
+	if (ret1 == ret2)
+	    return ret1;
+	else return MODE_BAD;
+    }
+
+    /* Hooray, we think we can do it */
+
+    return MODE_OK;
+}
+
 /*
  * This function is called once, at the start of the first server generation to
  * do a minimal probe for supported hardware.
@@ -318,6 +372,7 @@
 			pScrn->PreInit       = VESAPreInit;
 			pScrn->ScreenInit    = VESAScreenInit;
 			pScrn->SwitchMode    = VESASwitchMode;
+			pScrn->ValidMode     = VESAValidMode;
 			pScrn->AdjustFrame   = VESAAdjustFrame;
 			pScrn->EnterVT       = VESAEnterVT;
 			pScrn->LeaveVT       = VESALeaveVT;


Index: xorg-x11-drv-vesa.spec
===================================================================
RCS file: /cvs/dist/rpms/xorg-x11-drv-vesa/devel/xorg-x11-drv-vesa.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- xorg-x11-drv-vesa.spec	1 Oct 2006 21:19:15 -0000	1.18
+++ xorg-x11-drv-vesa.spec	5 Dec 2006 01:39:16 -0000	1.19
@@ -6,8 +6,8 @@
 
 Summary:   Xorg X11 vesa video driver
 Name:      xorg-x11-drv-vesa
-Version:   1.2.1
-Release:   4
+Version:   1.3.0
+Release:   1%{?dist}
 URL:       http://www.x.org
 Source0:   http://xorg.freedesktop.org/releases/individual/driver/%{tarball}-%{version}.tar.bz2
 License:   MIT/X11
@@ -17,7 +17,7 @@
 ExclusiveArch: %{ix86} x86_64 ia64 ppc ppc64 alpha sparc sparc64
 
 Patch0:	    vesa-1.2.1-randr-crash.patch
-Patch1:     vesa-1.2.1-fix-shadowfb.patch
+Patch1:     vesa-1.2.1-validmode.patch
 
 BuildRequires: pkgconfig
 BuildRequires: xorg-x11-server-sdk >= 1.1.0-1
@@ -58,6 +58,11 @@
 %{_mandir}/man4/vesa.4*
 
 %changelog
+* Mon Dec 4 2006 Adam Jackson <ajax at redhat.com> 1.3.0-1
+- Update to 1.3.0
+- vesa-1.2.1-validmode.patch: Implement a ValidMode driver hook, which rejects
+  modes not present in the BIOS or outside the capability of the monitor.
+
 * Sun Oct 01 2006 Jesse Keating <jkeating at redhat.com> - 1.2.1-4
 - rebuilt for unwind info generation, broken in gcc-4.1.1-21
 




More information about the fedora-cvs-commits mailing list