|
|
6dbcfc2 |
diff --git a/COPYING b/COPYING
|
|
|
6dbcfc2 |
index 22b4b13..f101fb8 100644
|
|
|
6dbcfc2 |
--- a/COPYING
|
|
|
6dbcfc2 |
+++ b/COPYING
|
|
|
6dbcfc2 |
@@ -1,4 +1,5 @@
|
|
|
6dbcfc2 |
Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
|
|
|
6dbcfc2 |
+Copyright 2008 Red Hat, Inc.
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
6dbcfc2 |
copy of this software and associated documentation files (the "Software"),
|
|
|
6dbcfc2 |
diff --git a/configure.ac b/configure.ac
|
|
|
6dbcfc2 |
index ff4713d..5d39bbc 100644
|
|
|
6dbcfc2 |
--- a/configure.ac
|
|
|
6dbcfc2 |
+++ b/configure.ac
|
|
|
6dbcfc2 |
@@ -20,45 +20,44 @@
|
|
|
6dbcfc2 |
#
|
|
|
6dbcfc2 |
# Process this file with autoconf to produce a configure script
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-AC_PREREQ(2.57)
|
|
|
6dbcfc2 |
+# Initialize Autoconf
|
|
|
6dbcfc2 |
+AC_PREREQ([2.60])
|
|
|
6dbcfc2 |
AC_INIT([xf86-video-vesa],
|
|
|
6dbcfc2 |
- 2.3.0,
|
|
|
6dbcfc2 |
+ [2.3.0],
|
|
|
6dbcfc2 |
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
|
|
6dbcfc2 |
- xf86-video-vesa)
|
|
|
6dbcfc2 |
-
|
|
|
6dbcfc2 |
+ [xf86-video-vesa])
|
|
|
6dbcfc2 |
AC_CONFIG_SRCDIR([Makefile.am])
|
|
|
6dbcfc2 |
-AM_CONFIG_HEADER([config.h])
|
|
|
6dbcfc2 |
+AC_CONFIG_HEADERS([config.h])
|
|
|
6dbcfc2 |
AC_CONFIG_AUX_DIR(.)
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
+# Initialize Automake
|
|
|
6dbcfc2 |
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
|
|
6dbcfc2 |
-
|
|
|
6dbcfc2 |
AM_MAINTAINER_MODE
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-# Require xorg-macros: XORG_DEFAULT_OPTIONS
|
|
|
6dbcfc2 |
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
|
|
|
6dbcfc2 |
m4_ifndef([XORG_MACROS_VERSION],
|
|
|
6dbcfc2 |
- [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
|
|
|
6dbcfc2 |
-XORG_MACROS_VERSION(1.3)
|
|
|
6dbcfc2 |
+ [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
|
|
|
6dbcfc2 |
+XORG_MACROS_VERSION(1.8)
|
|
|
6dbcfc2 |
XORG_DEFAULT_OPTIONS
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-# Checks for programs.
|
|
|
6dbcfc2 |
+# Initialize libtool
|
|
|
6dbcfc2 |
AC_DISABLE_STATIC
|
|
|
6dbcfc2 |
AC_PROG_LIBTOOL
|
|
|
6dbcfc2 |
-AC_PROG_CC
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
AH_TOP([#include "xorg-server.h"])
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
+# Define a configure option for an alternate module directory
|
|
|
6dbcfc2 |
AC_ARG_WITH(xorg-module-dir, [ --with-xorg-module-dir=DIR ],
|
|
|
6dbcfc2 |
[ moduledir="$withval" ],
|
|
|
6dbcfc2 |
[ moduledir="$libdir/xorg/modules" ])
|
|
|
6dbcfc2 |
AC_SUBST(moduledir)
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-
|
|
|
6dbcfc2 |
-# Checks for extensions
|
|
|
6dbcfc2 |
+# Store the list of server defined optional extensions in REQUIRED_MODULES
|
|
|
6dbcfc2 |
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
|
|
|
6dbcfc2 |
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
|
|
|
6dbcfc2 |
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-# Checks for pkg-config packages
|
|
|
6dbcfc2 |
+# Obtain compiler/linker options for the driver dependencies
|
|
|
6dbcfc2 |
PKG_CHECK_MODULES(XORG, xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES)
|
|
|
6dbcfc2 |
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
|
|
|
6dbcfc2 |
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
|
|
|
6dbcfc2 |
@@ -89,25 +88,18 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
|
|
|
6dbcfc2 |
CFLAGS="$save_CFLAGS"
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
if test "x$XSERVER_LIBPCIACCESS" = xyes; then
|
|
|
6dbcfc2 |
- PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
|
|
|
6dbcfc2 |
+ PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.12.901])
|
|
|
6dbcfc2 |
fi
|
|
|
6dbcfc2 |
AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
|
|
|
6dbcfc2 |
-INCLUDES="$XORG_INCS "'-I$(top_srcdir)/src'
|
|
|
6dbcfc2 |
-AC_SUBST([CFLAGS])
|
|
|
6dbcfc2 |
-AC_SUBST([INCLUDES])
|
|
|
6dbcfc2 |
-
|
|
|
6dbcfc2 |
# Checks for libraries.
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-# Checks for header files.
|
|
|
6dbcfc2 |
-AC_HEADER_STDC
|
|
|
6dbcfc2 |
-
|
|
|
6dbcfc2 |
DRIVER_NAME=vesa
|
|
|
6dbcfc2 |
AC_SUBST([DRIVER_NAME])
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-AC_OUTPUT([
|
|
|
6dbcfc2 |
- Makefile
|
|
|
6dbcfc2 |
- src/Makefile
|
|
|
6dbcfc2 |
- man/Makefile
|
|
|
6dbcfc2 |
+AC_CONFIG_FILES([
|
|
|
6dbcfc2 |
+ Makefile
|
|
|
6dbcfc2 |
+ src/Makefile
|
|
|
6dbcfc2 |
+ man/Makefile
|
|
|
6dbcfc2 |
])
|
|
|
6dbcfc2 |
+AC_OUTPUT
|
|
|
6dbcfc2 |
diff --git a/man/Makefile.am b/man/Makefile.am
|
|
|
6dbcfc2 |
index f0eb29b..b3688ce 100644
|
|
|
6dbcfc2 |
--- a/man/Makefile.am
|
|
|
6dbcfc2 |
+++ b/man/Makefile.am
|
|
|
6dbcfc2 |
@@ -1,27 +1,24 @@
|
|
|
6dbcfc2 |
#
|
|
|
6dbcfc2 |
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
|
|
6dbcfc2 |
-#
|
|
|
6dbcfc2 |
-# Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
6dbcfc2 |
-# documentation for any purpose is hereby granted without fee, provided that
|
|
|
6dbcfc2 |
-# the above copyright notice appear in all copies and that both that
|
|
|
6dbcfc2 |
-# copyright notice and this permission notice appear in supporting
|
|
|
6dbcfc2 |
-# documentation.
|
|
|
6dbcfc2 |
-#
|
|
|
6dbcfc2 |
-# The above copyright notice and this permission notice shall be included
|
|
|
6dbcfc2 |
-# in all copies or substantial portions of the Software.
|
|
|
6dbcfc2 |
-#
|
|
|
6dbcfc2 |
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
6dbcfc2 |
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
6dbcfc2 |
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
6dbcfc2 |
-# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
6dbcfc2 |
-# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
6dbcfc2 |
-# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
6dbcfc2 |
-# OTHER DEALINGS IN THE SOFTWARE.
|
|
|
6dbcfc2 |
-#
|
|
|
6dbcfc2 |
-# Except as contained in this notice, the name of the copyright holders shall
|
|
|
6dbcfc2 |
-# not be used in advertising or otherwise to promote the sale, use or
|
|
|
6dbcfc2 |
-# other dealings in this Software without prior written authorization
|
|
|
6dbcfc2 |
-# from the copyright holders.
|
|
|
6dbcfc2 |
+#
|
|
|
6dbcfc2 |
+# Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
6dbcfc2 |
+# copy of this software and associated documentation files (the "Software"),
|
|
|
6dbcfc2 |
+# to deal in the Software without restriction, including without limitation
|
|
|
6dbcfc2 |
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
6dbcfc2 |
+# and/or sell copies of the Software, and to permit persons to whom the
|
|
|
6dbcfc2 |
+# Software is furnished to do so, subject to the following conditions:
|
|
|
6dbcfc2 |
+#
|
|
|
6dbcfc2 |
+# The above copyright notice and this permission notice (including the next
|
|
|
6dbcfc2 |
+# paragraph) shall be included in all copies or substantial portions of the
|
|
|
6dbcfc2 |
+# Software.
|
|
|
6dbcfc2 |
+#
|
|
|
6dbcfc2 |
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
6dbcfc2 |
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
6dbcfc2 |
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
6dbcfc2 |
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
6dbcfc2 |
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
6dbcfc2 |
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
6dbcfc2 |
+# DEALINGS IN THE SOFTWARE.
|
|
|
6dbcfc2 |
#
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
drivermandir = $(DRIVER_MAN_DIR)
|
|
|
6dbcfc2 |
@@ -34,25 +31,11 @@ EXTRA_DIST = @DRIVER_NAME@.man
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
CLEANFILES = $(driverman_DATA)
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-SED = sed
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-# Strings to replace in man pages
|
|
|
6dbcfc2 |
-XORGRELSTRING = @PACKAGE_STRING@
|
|
|
6dbcfc2 |
- XORGMANNAME = X Version 11
|
|
|
6dbcfc2 |
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
-MAN_SUBSTS = \
|
|
|
6dbcfc2 |
- -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
|
|
|
6dbcfc2 |
- -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
|
|
|
6dbcfc2 |
- -e 's|__xservername__|Xorg|g' \
|
|
|
6dbcfc2 |
- -e 's|__xconfigfile__|xorg.conf|g' \
|
|
|
6dbcfc2 |
- -e 's|__projectroot__|$(prefix)|g' \
|
|
|
6dbcfc2 |
- -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
|
|
|
6dbcfc2 |
- -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
|
|
|
6dbcfc2 |
- -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
|
|
|
6dbcfc2 |
- -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
|
|
|
6dbcfc2 |
- -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
.man.$(DRIVER_MAN_SUFFIX):
|
|
|
6dbcfc2 |
- sed $(MAN_SUBSTS) < $< > $@
|
|
|
6dbcfc2 |
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
|
|
|
6dbcfc2 |
diff --git a/man/vesa.man b/man/vesa.man
|
|
|
6dbcfc2 |
index 19cb766..ce4b369 100644
|
|
|
6dbcfc2 |
--- a/man/vesa.man
|
|
|
6dbcfc2 |
+++ b/man/vesa.man
|
|
|
6dbcfc2 |
@@ -1,4 +1,3 @@
|
|
|
6dbcfc2 |
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.2 2001/01/27 18:20:56 dawes Exp $
|
|
|
6dbcfc2 |
.\" shorthand for double quote that works everywhere.
|
|
|
6dbcfc2 |
.ds q \N'34'
|
|
|
6dbcfc2 |
.TH VESA __drivermansuffix__ __vendorversion__
|
|
|
6dbcfc2 |
diff --git a/src/Makefile.am b/src/Makefile.am
|
|
|
6dbcfc2 |
index 88da8a2..dc702f0 100644
|
|
|
6dbcfc2 |
--- a/src/Makefile.am
|
|
|
6dbcfc2 |
+++ b/src/Makefile.am
|
|
|
6dbcfc2 |
@@ -24,6 +24,9 @@
|
|
|
6dbcfc2 |
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
|
|
|
6dbcfc2 |
# _ladir passes a dummy rpath to libtool so the thing will actually link
|
|
|
6dbcfc2 |
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
|
|
|
6dbcfc2 |
+
|
|
|
6dbcfc2 |
+AM_CFLAGS = $(XORG_CFLAGS) $(PCIACCESS_CFLAGS)
|
|
|
6dbcfc2 |
+
|
|
|
6dbcfc2 |
vesa_drv_la_LTLIBRARIES = vesa_drv.la
|
|
|
6dbcfc2 |
vesa_drv_la_LDFLAGS = -module -avoid-version
|
|
|
6dbcfc2 |
vesa_drv_ladir = @moduledir@/drivers
|
|
|
6dbcfc2 |
diff --git a/src/vesa.c b/src/vesa.c
|
|
|
6dbcfc2 |
index 034a019..23d9e14 100644
|
|
|
6dbcfc2 |
--- a/src/vesa.c
|
|
|
6dbcfc2 |
+++ b/src/vesa.c
|
|
|
6dbcfc2 |
@@ -281,7 +281,7 @@ static VESAPtr
|
|
|
6dbcfc2 |
VESAGetRec(ScrnInfoPtr pScrn)
|
|
|
6dbcfc2 |
{
|
|
|
6dbcfc2 |
if (!pScrn->driverPrivate)
|
|
|
6dbcfc2 |
- pScrn->driverPrivate = xcalloc(sizeof(VESARec), 1);
|
|
|
6dbcfc2 |
+ pScrn->driverPrivate = calloc(sizeof(VESARec), 1);
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
return ((VESAPtr)pScrn->driverPrivate);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
@@ -296,7 +296,7 @@ VESASetModeParameters(vbeInfoPtr pVbe, DisplayModePtr vbemode,
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
data = (VbeModeInfoData *)vbemode->Private;
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
- data->block = xcalloc(sizeof(VbeCRTCInfoBlock), 1);
|
|
|
6dbcfc2 |
+ data->block = calloc(sizeof(VbeCRTCInfoBlock), 1);
|
|
|
6dbcfc2 |
data->block->HorizontalTotal = ddcmode->HTotal;
|
|
|
6dbcfc2 |
data->block->HorizontalSyncStart = ddcmode->HSyncStart;
|
|
|
6dbcfc2 |
data->block->HorizontalSyncEnd = ddcmode->HSyncEnd;
|
|
|
6dbcfc2 |
@@ -317,6 +317,30 @@ VESASetModeParameters(vbeInfoPtr pVbe, DisplayModePtr vbemode,
|
|
|
6dbcfc2 |
(double)(ddcmode->HTotal * ddcmode->VTotal));
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
+/*
|
|
|
6dbcfc2 |
+ * Despite that VBE gives you pixel granularity for mode sizes, some BIOSes
|
|
|
6dbcfc2 |
+ * think they can only give sizes in multiples of character cells; and
|
|
|
6dbcfc2 |
+ * indeed, the reference CVT and GTF formulae only give results where
|
|
|
6dbcfc2 |
+ * (h % 8) == 0. Whatever, let's just try to cope. What we're looking for
|
|
|
6dbcfc2 |
+ * here is cases where the display says 1366x768 and the BIOS says 1360x768.
|
|
|
6dbcfc2 |
+ */
|
|
|
6dbcfc2 |
+static Bool
|
|
|
6dbcfc2 |
+vesaModesCloseEnough(DisplayModePtr edid, DisplayModePtr vbe)
|
|
|
6dbcfc2 |
+{
|
|
|
6dbcfc2 |
+ if (!(edid->type & M_T_DRIVER))
|
|
|
6dbcfc2 |
+ return FALSE;
|
|
|
6dbcfc2 |
+
|
|
|
6dbcfc2 |
+ /* never seen a height granularity... */
|
|
|
6dbcfc2 |
+ if (edid->VDisplay != vbe->VDisplay)
|
|
|
6dbcfc2 |
+ return FALSE;
|
|
|
6dbcfc2 |
+
|
|
|
6dbcfc2 |
+ if (edid->HDisplay >= vbe->HDisplay &&
|
|
|
6dbcfc2 |
+ (edid->HDisplay & ~7) == (vbe->HDisplay & ~7))
|
|
|
6dbcfc2 |
+ return TRUE;
|
|
|
6dbcfc2 |
+
|
|
|
6dbcfc2 |
+ return FALSE;
|
|
|
6dbcfc2 |
+}
|
|
|
6dbcfc2 |
+
|
|
|
6dbcfc2 |
static ModeStatus
|
|
|
6dbcfc2 |
VESAValidMode(int scrn, DisplayModePtr p, Bool flag, int pass)
|
|
|
6dbcfc2 |
{
|
|
|
6dbcfc2 |
@@ -358,9 +382,7 @@ VESAValidMode(int scrn, DisplayModePtr p, Bool flag, int pass)
|
|
|
6dbcfc2 |
*/
|
|
|
6dbcfc2 |
if (pScrn->monitor->DDC) {
|
|
|
6dbcfc2 |
for (mode = pScrn->monitor->Modes; mode; mode = mode->next) {
|
|
|
6dbcfc2 |
- if (mode->type & M_T_DRIVER &&
|
|
|
6dbcfc2 |
- mode->HDisplay == p->HDisplay &&
|
|
|
6dbcfc2 |
- mode->VDisplay == p->VDisplay) {
|
|
|
6dbcfc2 |
+ if (vesaModesCloseEnough(mode, p)) {
|
|
|
6dbcfc2 |
if (xf86CheckModeForMonitor(mode, mon) == MODE_OK) {
|
|
|
6dbcfc2 |
found = 1;
|
|
|
6dbcfc2 |
break;
|
|
|
6dbcfc2 |
@@ -391,7 +413,8 @@ VESAValidMode(int scrn, DisplayModePtr p, Bool flag, int pass)
|
|
|
6dbcfc2 |
for (v = mon->vrefresh[0].lo; v <= mon->vrefresh[0].hi; v++) {
|
|
|
6dbcfc2 |
mode = xf86GTFMode(p->HDisplay, p->VDisplay, v, 0, 0);
|
|
|
6dbcfc2 |
ret = xf86CheckModeForMonitor(mode, mon);
|
|
|
6dbcfc2 |
- xfree(mode);
|
|
|
6dbcfc2 |
+ free(mode->name);
|
|
|
6dbcfc2 |
+ free(mode);
|
|
|
6dbcfc2 |
if (ret == MODE_OK)
|
|
|
6dbcfc2 |
break;
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
@@ -431,8 +454,14 @@ VESAPciProbe(DriverPtr drv, int entity_num, struct pci_device *dev,
|
|
|
6dbcfc2 |
pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL,
|
|
|
6dbcfc2 |
NULL, NULL, NULL, NULL, NULL);
|
|
|
6dbcfc2 |
if (pScrn != NULL) {
|
|
|
6dbcfc2 |
- VESAPtr pVesa = VESAGetRec(pScrn);
|
|
|
6dbcfc2 |
+ VESAPtr pVesa;
|
|
|
6dbcfc2 |
+
|
|
|
6dbcfc2 |
+ if (pci_device_has_kernel_driver(dev)) {
|
|
|
6dbcfc2 |
+ ErrorF("vesa: Ignoring device with a bound kernel driver\n");
|
|
|
6dbcfc2 |
+ return FALSE;
|
|
|
6dbcfc2 |
+ }
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
+ pVesa = VESAGetRec(pScrn);
|
|
|
6dbcfc2 |
VESAInitScrn(pScrn);
|
|
|
6dbcfc2 |
pVesa->pciInfo = dev;
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
@@ -480,7 +509,7 @@ VESAProbe(DriverPtr drv, int flags)
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
- xfree(usedChips);
|
|
|
6dbcfc2 |
+ free(usedChips);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
#endif
|
|
|
6dbcfc2 |
@@ -503,11 +532,11 @@ VESAProbe(DriverPtr drv, int flags)
|
|
|
6dbcfc2 |
foundScreen = TRUE;
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
- xfree(usedChips);
|
|
|
6dbcfc2 |
+ free(usedChips);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
#endif
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
- xfree(devSections);
|
|
|
6dbcfc2 |
+ free(devSections);
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
return (foundScreen);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
@@ -554,9 +583,9 @@ VESAFreeRec(ScrnInfoPtr pScrn)
|
|
|
6dbcfc2 |
VbeModeInfoData *data = (VbeModeInfoData*)mode->Private;
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
if (data->block)
|
|
|
6dbcfc2 |
- xfree(data->block);
|
|
|
6dbcfc2 |
+ free(data->block);
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
- xfree(data);
|
|
|
6dbcfc2 |
+ free(data);
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
mode->Private = NULL;
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
@@ -564,12 +593,12 @@ VESAFreeRec(ScrnInfoPtr pScrn)
|
|
|
6dbcfc2 |
} while (mode && mode != pScrn->modes);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
#endif
|
|
|
6dbcfc2 |
- xfree(pVesa->monitor);
|
|
|
6dbcfc2 |
- xfree(pVesa->vbeInfo);
|
|
|
6dbcfc2 |
- xfree(pVesa->pal);
|
|
|
6dbcfc2 |
- xfree(pVesa->savedPal);
|
|
|
6dbcfc2 |
- xfree(pVesa->fonts);
|
|
|
6dbcfc2 |
- xfree(pScrn->driverPrivate);
|
|
|
6dbcfc2 |
+ free(pVesa->monitor);
|
|
|
6dbcfc2 |
+ free(pVesa->vbeInfo);
|
|
|
6dbcfc2 |
+ free(pVesa->pal);
|
|
|
6dbcfc2 |
+ free(pVesa->savedPal);
|
|
|
6dbcfc2 |
+ free(pVesa->fonts);
|
|
|
6dbcfc2 |
+ free(pScrn->driverPrivate);
|
|
|
6dbcfc2 |
pScrn->driverPrivate = NULL;
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
@@ -712,7 +741,7 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
|
|
|
6dbcfc2 |
else {
|
|
|
6dbcfc2 |
void *panelid = VBEReadPanelID(pVesa->pVbe);
|
|
|
6dbcfc2 |
VBEInterpretPanelID(pScrn->scrnIndex, panelid);
|
|
|
6dbcfc2 |
- xfree(panelid);
|
|
|
6dbcfc2 |
+ free(panelid);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
#endif
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
@@ -805,7 +834,7 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
/* options */
|
|
|
6dbcfc2 |
xf86CollectOptions(pScrn, NULL);
|
|
|
6dbcfc2 |
- if (!(pVesa->Options = xalloc(sizeof(VESAOptions)))) {
|
|
|
6dbcfc2 |
+ if (!(pVesa->Options = malloc(sizeof(VESAOptions)))) {
|
|
|
6dbcfc2 |
vbeFree(pVesa->pVbe);
|
|
|
6dbcfc2 |
return FALSE;
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
@@ -940,7 +969,7 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|
|
6dbcfc2 |
pScrn->bitsPerPixel = 8;
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
if (pVesa->shadowFB) {
|
|
|
6dbcfc2 |
- pVesa->shadow = xcalloc(1, pScrn->displayWidth * pScrn->virtualY *
|
|
|
6dbcfc2 |
+ pVesa->shadow = calloc(1, pScrn->displayWidth * pScrn->virtualY *
|
|
|
6dbcfc2 |
((pScrn->bitsPerPixel + 7) / 8));
|
|
|
6dbcfc2 |
if (!pVesa->shadow) {
|
|
|
6dbcfc2 |
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
|
|
6dbcfc2 |
@@ -1119,10 +1148,10 @@ VESACloseScreen(int scrnIndex, ScreenPtr pScreen)
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
if (pVesa->shadowFB && pVesa->shadow) {
|
|
|
6dbcfc2 |
shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen));
|
|
|
6dbcfc2 |
- xfree(pVesa->shadow);
|
|
|
6dbcfc2 |
+ free(pVesa->shadow);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
if (pVesa->pDGAMode) {
|
|
|
6dbcfc2 |
- xfree(pVesa->pDGAMode);
|
|
|
6dbcfc2 |
+ free(pVesa->pDGAMode);
|
|
|
6dbcfc2 |
pVesa->pDGAMode = NULL;
|
|
|
6dbcfc2 |
pVesa->nDGAMode = 0;
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
@@ -1180,7 +1209,7 @@ VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
|
|
|
6dbcfc2 |
* Free it as it will not be any longer useful
|
|
|
6dbcfc2 |
*/
|
|
|
6dbcfc2 |
xf86ErrorF(", mode set without customized refresh.\n");
|
|
|
6dbcfc2 |
- xfree(data->block);
|
|
|
6dbcfc2 |
+ free(data->block);
|
|
|
6dbcfc2 |
data->block = NULL;
|
|
|
6dbcfc2 |
data->mode &= ~(1 << 11);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
@@ -1231,25 +1260,28 @@ VESAMapVidMem(ScrnInfoPtr pScrn)
|
|
|
6dbcfc2 |
pScrn->fbOffset = pVesa->mapOff;
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
#ifdef XSERVER_LIBPCIACCESS
|
|
|
6dbcfc2 |
- if ((pVesa->mapPhys != 0xa0000) && (pVesa->pciInfo != NULL)) {
|
|
|
6dbcfc2 |
- (void) pci_device_map_range(pVesa->pciInfo, pScrn->memPhysBase,
|
|
|
6dbcfc2 |
- pVesa->mapSize,
|
|
|
6dbcfc2 |
- (PCI_DEV_MAP_FLAG_WRITABLE
|
|
|
6dbcfc2 |
- | PCI_DEV_MAP_FLAG_WRITE_COMBINE),
|
|
|
6dbcfc2 |
- & pVesa->base);
|
|
|
6dbcfc2 |
- }
|
|
|
6dbcfc2 |
- else
|
|
|
6dbcfc2 |
- pVesa->base = xf86MapDomainMemory(pScrn->scrnIndex, 0, pVesa->pciInfo,
|
|
|
6dbcfc2 |
- pScrn->memPhysBase, pVesa->mapSize);
|
|
|
6dbcfc2 |
-
|
|
|
6dbcfc2 |
- if (pVesa->base) {
|
|
|
6dbcfc2 |
- if (pVesa->mapPhys != 0xa0000)
|
|
|
6dbcfc2 |
- pVesa->VGAbase = xf86MapDomainMemory(pScrn->scrnIndex, 0,
|
|
|
6dbcfc2 |
- pVesa->pciInfo,
|
|
|
6dbcfc2 |
- 0xa0000, 0x10000);
|
|
|
6dbcfc2 |
- else
|
|
|
6dbcfc2 |
- pVesa->VGAbase = pVesa->base;
|
|
|
6dbcfc2 |
+ if (pVesa->pciInfo != NULL) {
|
|
|
6dbcfc2 |
+ if (pVesa->mapPhys != 0xa0000) {
|
|
|
6dbcfc2 |
+ (void) pci_device_map_range(pVesa->pciInfo, pScrn->memPhysBase,
|
|
|
6dbcfc2 |
+ pVesa->mapSize,
|
|
|
6dbcfc2 |
+ (PCI_DEV_MAP_FLAG_WRITABLE
|
|
|
6dbcfc2 |
+ | PCI_DEV_MAP_FLAG_WRITE_COMBINE),
|
|
|
6dbcfc2 |
+ & pVesa->base);
|
|
|
6dbcfc2 |
+
|
|
|
6dbcfc2 |
+ if (pVesa->base)
|
|
|
6dbcfc2 |
+ (void) pci_device_map_legacy(pVesa->pciInfo, 0xa0000, 0x10000,
|
|
|
6dbcfc2 |
+ PCI_DEV_MAP_FLAG_WRITABLE,
|
|
|
6dbcfc2 |
+ & pVesa->VGAbase);
|
|
|
6dbcfc2 |
+ }
|
|
|
6dbcfc2 |
+ else {
|
|
|
6dbcfc2 |
+ (void) pci_device_map_legacy(pVesa->pciInfo, pScrn->memPhysBase,
|
|
|
6dbcfc2 |
+ pVesa->mapSize,
|
|
|
6dbcfc2 |
+ PCI_DEV_MAP_FLAG_WRITABLE,
|
|
|
6dbcfc2 |
+ & pVesa->base);
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
+ if (pVesa->base)
|
|
|
6dbcfc2 |
+ pVesa->VGAbase = pVesa->base;
|
|
|
6dbcfc2 |
+ }
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
#else
|
|
|
6dbcfc2 |
if (pVesa->mapPhys != 0xa0000 && pVesa->pEnt->location.type == BUS_PCI)
|
|
|
6dbcfc2 |
@@ -1270,7 +1302,11 @@ VESAMapVidMem(ScrnInfoPtr pScrn)
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
#endif
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
|
|
|
6dbcfc2 |
pVesa->ioBase = pScrn->domainIOBase;
|
|
|
6dbcfc2 |
+#else
|
|
|
6dbcfc2 |
+ pVesa->ioBase = 0;
|
|
|
6dbcfc2 |
+#endif
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, DEBUG_VERB,
|
|
|
6dbcfc2 |
"virtual address = %p,\n"
|
|
|
6dbcfc2 |
@@ -1292,10 +1328,12 @@ VESAUnmapVidMem(ScrnInfoPtr pScrn)
|
|
|
6dbcfc2 |
if (pVesa->mapPhys != 0xa0000) {
|
|
|
6dbcfc2 |
(void) pci_device_unmap_range(pVesa->pciInfo, pVesa->base,
|
|
|
6dbcfc2 |
pVesa->mapSize);
|
|
|
6dbcfc2 |
- xf86UnMapVidMem(pScrn->scrnIndex, pVesa->VGAbase, 0x10000);
|
|
|
6dbcfc2 |
+ (void) pci_device_unmap_legacy(pVesa->pciInfo, pVesa->VGAbase,
|
|
|
6dbcfc2 |
+ 0x10000);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
else {
|
|
|
6dbcfc2 |
- xf86UnMapVidMem(pScrn->scrnIndex, pVesa->base, pVesa->mapSize);
|
|
|
6dbcfc2 |
+ (void) pci_device_unmap_legacy(pVesa->pciInfo, pVesa->base,
|
|
|
6dbcfc2 |
+ pVesa->mapSize);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
#else
|
|
|
6dbcfc2 |
xf86UnMapVidMem(pScrn->scrnIndex, pVesa->base, pVesa->mapSize);
|
|
|
6dbcfc2 |
@@ -1315,7 +1353,7 @@ VESALoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
|
|
|
6dbcfc2 |
int base;
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
if (pVesa->pal == NULL)
|
|
|
6dbcfc2 |
- pVesa->pal = xcalloc(1, sizeof(CARD32) * 256);
|
|
|
6dbcfc2 |
+ pVesa->pal = calloc(1, sizeof(CARD32) * 256);
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
for (i = 0, base = idx = indices[i]; i < numColors; i++, idx++) {
|
|
|
6dbcfc2 |
int j = indices[i];
|
|
|
6dbcfc2 |
@@ -1414,7 +1452,7 @@ SaveFonts(ScrnInfoPtr pScrn)
|
|
|
6dbcfc2 |
if (attr10 & 0x01)
|
|
|
6dbcfc2 |
return;
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
- pVesa->fonts = xalloc(16384);
|
|
|
6dbcfc2 |
+ pVesa->fonts = malloc(16384);
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
/* save the registers that are needed here */
|
|
|
6dbcfc2 |
miscOut = ReadMiscOut();
|
|
|
6dbcfc2 |
@@ -1622,7 +1660,7 @@ VESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function)
|
|
|
6dbcfc2 |
&& function == MODE_SAVE) {
|
|
|
6dbcfc2 |
/* don't rely on the memory not being touched */
|
|
|
6dbcfc2 |
if (pVesa->pstate == NULL)
|
|
|
6dbcfc2 |
- pVesa->pstate = xalloc(pVesa->stateSize);
|
|
|
6dbcfc2 |
+ pVesa->pstate = malloc(pVesa->stateSize);
|
|
|
6dbcfc2 |
memcpy(pVesa->pstate, pVesa->state, pVesa->stateSize);
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
}
|
|
|
6dbcfc2 |
@@ -1737,7 +1775,7 @@ VESADGAAddModes(ScrnInfoPtr pScrn)
|
|
|
6dbcfc2 |
DGAModePtr pDGAMode;
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
do {
|
|
|
6dbcfc2 |
- pDGAMode = xrealloc(pVesa->pDGAMode,
|
|
|
6dbcfc2 |
+ pDGAMode = realloc(pVesa->pDGAMode,
|
|
|
6dbcfc2 |
(pVesa->nDGAMode + 1) * sizeof(DGAModeRec));
|
|
|
6dbcfc2 |
if (!pDGAMode)
|
|
|
6dbcfc2 |
break;
|
|
|
6dbcfc2 |
diff --git a/src/vesa.h b/src/vesa.h
|
|
|
6dbcfc2 |
index 4656e4c..bcc9e37 100644
|
|
|
6dbcfc2 |
--- a/src/vesa.h
|
|
|
6dbcfc2 |
+++ b/src/vesa.h
|
|
|
6dbcfc2 |
@@ -25,8 +25,6 @@
|
|
|
6dbcfc2 |
* Conectiva Linux.
|
|
|
6dbcfc2 |
*
|
|
|
6dbcfc2 |
* Authors: Paulo C├ęsar Pereira de Andrade <pcpa@conectiva.com.br>
|
|
|
6dbcfc2 |
- *
|
|
|
6dbcfc2 |
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.12 2002/08/06 13:46:27 dawes Exp $
|
|
|
6dbcfc2 |
*/
|
|
|
6dbcfc2 |
|
|
|
6dbcfc2 |
#ifndef _VESA_H_
|
|
|
6dbcfc2 |
@@ -116,7 +114,7 @@ typedef struct _VESARec
|
|
|
6dbcfc2 |
xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
|
|
|
6dbcfc2 |
Bool accessEnabled;
|
|
|
6dbcfc2 |
OptionInfoPtr Options;
|
|
|
6dbcfc2 |
- IOADDRESS ioBase;
|
|
|
6dbcfc2 |
+ unsigned long ioBase;
|
|
|
6dbcfc2 |
Bool ModeSetClearScreen;
|
|
|
6dbcfc2 |
void *shadow;
|
|
|
6dbcfc2 |
ShadowUpdateProc update;
|