mirror of
https://github.com/X11Libre/xf86-video-fbdev.git
synced 2026-03-24 17:45:26 +00:00
Compare commits
57 Commits
fbdev-0_2_
...
xf86-video
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
679ed9a4e6 | ||
|
|
ac293412a0 | ||
|
|
2edaad4ab2 | ||
|
|
8a65ca2fdc | ||
|
|
91e8b295f8 | ||
|
|
6e29cf8c29 | ||
|
|
a87213930e | ||
|
|
be003f2568 | ||
|
|
20909cd806 | ||
|
|
90524a26d3 | ||
|
|
0d45d8f3ad | ||
|
|
049cdddd14 | ||
|
|
d3a2fe1b76 | ||
|
|
f7e68d16dc | ||
|
|
0ddf357522 | ||
|
|
55e0de6cb1 | ||
|
|
a05560b1d3 | ||
|
|
8f7d8a7ba3 | ||
|
|
9b3ef42fdd | ||
|
|
b768d66b87 | ||
|
|
fa588a1ddc | ||
|
|
6977b3490a | ||
|
|
7ec9d466e5 | ||
|
|
b3220bf63e | ||
|
|
a9df47d6d0 | ||
|
|
a5b035414d | ||
|
|
5ec41a8b2e | ||
|
|
69f82077fd | ||
|
|
4e8a6ac78d | ||
|
|
d868015c9c | ||
|
|
a9e65feebd | ||
|
|
7b583191fa | ||
|
|
6b5e30a2df | ||
|
|
e233c12c97 | ||
|
|
dfe51de992 | ||
|
|
fe00991326 | ||
|
|
16ea2bb46c | ||
|
|
c3434c8625 | ||
|
|
db33e337a8 | ||
|
|
f9b88908fc | ||
|
|
092f0f10cb | ||
|
|
73ff2d0cd7 | ||
|
|
6bae3476b0 | ||
|
|
a9a7763ce0 | ||
|
|
31707aeccd | ||
|
|
b17f9256d5 | ||
|
|
436a2c094a | ||
|
|
5b54cbd70e | ||
|
|
b6fd370824 | ||
|
|
43236f5bfc | ||
|
|
643573a51f | ||
|
|
b5b1b7d731 | ||
|
|
abfc75fbcd | ||
|
|
a12d1ce572 | ||
|
|
6ed2e61542 | ||
|
|
24177f7218 | ||
|
|
c7b9e1a327 |
19
.cvsignore
19
.cvsignore
@@ -1,19 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.la
|
||||
*.lo
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
libtool
|
||||
ltmain.sh
|
||||
missing
|
||||
stamp-h1
|
||||
78
.gitignore
vendored
Normal file
78
.gitignore
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
#
|
||||
# X.Org module default exclusion patterns
|
||||
# The next section if for module specific patterns
|
||||
#
|
||||
# Do not edit the following section
|
||||
# GNU Build System (Autotools)
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
autoscan.log
|
||||
ChangeLog
|
||||
compile
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config-ml.in
|
||||
config.py
|
||||
config.status
|
||||
config.status.lineno
|
||||
config.sub
|
||||
configure
|
||||
configure.scan
|
||||
depcomp
|
||||
.deps/
|
||||
INSTALL
|
||||
install-sh
|
||||
.libs/
|
||||
libtool
|
||||
libtool.m4
|
||||
ltmain.sh
|
||||
lt~obsolete.m4
|
||||
ltoptions.m4
|
||||
ltsugar.m4
|
||||
ltversion.m4
|
||||
Makefile
|
||||
Makefile.in
|
||||
mdate-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
*.pc
|
||||
py-compile
|
||||
stamp-h?
|
||||
symlink-tree
|
||||
texinfo.tex
|
||||
ylwrap
|
||||
|
||||
# Do not edit the following section
|
||||
# Edit Compile Debug Document Distribute
|
||||
*~
|
||||
*.[0-9]
|
||||
*.[0-9]x
|
||||
*.bak
|
||||
*.bin
|
||||
core
|
||||
*.dll
|
||||
*.exe
|
||||
*-ISO*.bdf
|
||||
*-JIS*.bdf
|
||||
*-KOI8*.bdf
|
||||
*.kld
|
||||
*.ko
|
||||
*.ko.cmd
|
||||
*.lai
|
||||
*.l[oa]
|
||||
*.[oa]
|
||||
*.obj
|
||||
*.patch
|
||||
*.so
|
||||
*.pcf.gz
|
||||
*.pdb
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
#
|
||||
# Add & Override patterns for xf86-video-fbdev
|
||||
#
|
||||
# Edit the following section as needed
|
||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||
#
|
||||
27
COPYING
27
COPYING
@@ -1,12 +1,23 @@
|
||||
This is a stub file. This package has not yet had its complete licensing
|
||||
information compiled. Please see the individual source files for details on
|
||||
your rights to use and modify this software.
|
||||
Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
|
||||
|
||||
Please submit updated COPYING files to the Xorg bugzilla:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is fur-
|
||||
nished to do so, subject to the following conditions:
|
||||
|
||||
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
All licensing questions regarding this software should be directed at the
|
||||
Xorg mailing list:
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
|
||||
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
|
||||
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
http://lists.freedesktop.org/mailman/listinfo/xorg
|
||||
Except as contained in this notice, the name of the XFree86 Project shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
ings in this Software without prior written authorization from the XFree86
|
||||
Project.
|
||||
|
||||
51
ChangeLog
51
ChangeLog
@@ -1,51 +0,0 @@
|
||||
2006-04-06 Adam Jackson <ajax@freedesktop.org>
|
||||
|
||||
* configure.ac:
|
||||
* src/fbdev.c:
|
||||
Unlibcwrap. Bump server version requirement. Bump to 0.2.0.
|
||||
|
||||
2006-01-09 David Nusinow <gravity-at-freedesktop-dot-org>
|
||||
|
||||
* man/fbdev.man:
|
||||
Convert manpage to utf-8
|
||||
Bugzilla #1925 <https://bugs.freedesktop.org/show_bug.cgi?id=1925>
|
||||
|
||||
2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Update package version for X11R7 release.
|
||||
|
||||
2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Update package version number for final X11R7 release candidate.
|
||||
|
||||
2005-12-06 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* man/Makefile.am:
|
||||
Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
|
||||
|
||||
2005-12-03 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Update package version number for X11R7 RC3 release.
|
||||
|
||||
2005-12-01 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Remove extraneous AC_MSG_RESULT.
|
||||
|
||||
2005-11-29 Adam Jackson <ajax@freedesktop.org>
|
||||
|
||||
* configure.ac:
|
||||
Only build dlloader modules by default.
|
||||
|
||||
2005-11-09 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Update package version number for X11R7 RC2 release.
|
||||
|
||||
2005-11-01 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Update pkgcheck dependencies to work with separate build roots.
|
||||
12
Makefile.am
12
Makefile.am
@@ -18,5 +18,15 @@
|
||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
SUBDIRS = src man
|
||||
MAINTAINERCLEANFILES = ChangeLog INSTALL
|
||||
|
||||
.PHONY: ChangeLog INSTALL
|
||||
|
||||
INSTALL:
|
||||
$(INSTALL_CMD)
|
||||
|
||||
ChangeLog:
|
||||
$(CHANGELOG_CMD)
|
||||
|
||||
dist-hook: ChangeLog INSTALL
|
||||
|
||||
20
README
Normal file
20
README
Normal file
@@ -0,0 +1,20 @@
|
||||
xf86-video-fbdev - video driver for framebuffer device
|
||||
|
||||
Please submit bugs & patches to the Xorg bugzilla:
|
||||
|
||||
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
||||
|
||||
All questions regarding this software should be directed at the
|
||||
Xorg mailing list:
|
||||
|
||||
http://lists.freedesktop.org/mailman/listinfo/xorg
|
||||
|
||||
The master development code repository can be found at:
|
||||
|
||||
git://anongit.freedesktop.org/git/xorg/driver/xf86-video-fbdev
|
||||
|
||||
http://cgit.freedesktop.org/xorg/driver/xf86-video-fbdev
|
||||
|
||||
For more information on the git code manager, see:
|
||||
|
||||
http://wiki.x.org/wiki/GitPage
|
||||
64
configure.ac
64
configure.ac
@@ -20,58 +20,76 @@
|
||||
#
|
||||
# Process this file with autoconf to produce a configure script
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xf86-video-fbdev],
|
||||
0.2.0,
|
||||
[0.4.4],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
xf86-video-fbdev)
|
||||
|
||||
[xf86-video-fbdev])
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_AUX_DIR(.)
|
||||
|
||||
AM_INIT_AUTOMAKE([dist-bzip2])
|
||||
|
||||
# Initialize Automake
|
||||
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
# Checks for programs.
|
||||
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
|
||||
m4_ifndef([XORG_MACROS_VERSION],
|
||||
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
|
||||
XORG_MACROS_VERSION(1.8)
|
||||
XORG_DEFAULT_OPTIONS
|
||||
|
||||
# Initialize libtool
|
||||
AC_DISABLE_STATIC
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_CC
|
||||
|
||||
AH_TOP([#include "xorg-server.h"])
|
||||
|
||||
# Define a configure option for an alternate module directory
|
||||
AC_ARG_WITH(xorg-module-dir,
|
||||
AC_HELP_STRING([--with-xorg-module-dir=DIR],
|
||||
AS_HELP_STRING([--with-xorg-module-dir=DIR],
|
||||
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
|
||||
[moduledir="$withval"],
|
||||
[moduledir="$libdir/xorg/modules"])
|
||||
AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess],
|
||||
[Enable use of libpciaccess (default: disabled)]),
|
||||
[PCIACCESS=$enableval], [PCIACCESS=no])
|
||||
|
||||
# Checks for extensions
|
||||
# Store the list of server defined optional extensions in REQUIRED_MODULES
|
||||
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
|
||||
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
|
||||
XORG_DRIVER_CHECK_EXT(XV, videoproto)
|
||||
|
||||
# Checks for pkg-config packages
|
||||
# Obtain compiler/linker options for the driver dependencies
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES])
|
||||
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
|
||||
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$XORG_CFLAGS"
|
||||
AC_CHECK_DECL(xf86ConfigIsaEntity,
|
||||
[AC_DEFINE(HAVE_ISA, 1, [Have ISA support])],
|
||||
[],
|
||||
[#include "xf86.h"])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AM_CONDITIONAL(PCIACCESS, [test "x$PCIACCESS" = xyes])
|
||||
if test "x$PCIACCESS" = xyes; then
|
||||
AC_DEFINE(PCIACCESS, 1, [Use libpciaccess])
|
||||
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
|
||||
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
|
||||
fi
|
||||
|
||||
# Checks for libraries.
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
AC_SUBST([XORG_CFLAGS])
|
||||
AC_SUBST([moduledir])
|
||||
|
||||
DRIVER_NAME=fbdev
|
||||
AC_SUBST([DRIVER_NAME])
|
||||
|
||||
XORG_MANPAGE_SECTIONS
|
||||
XORG_RELEASE_VERSION
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
man/Makefile
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
src/Makefile
|
||||
man/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,28 +1,25 @@
|
||||
# $Id$
|
||||
#
|
||||
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation.
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the copyright holders shall
|
||||
# not be used in advertising or otherwise to promote the sale, use or
|
||||
# other dealings in this Software without prior written authorization
|
||||
# from the copyright holders.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
drivermandir = $(DRIVER_MAN_DIR)
|
||||
@@ -35,25 +32,11 @@ EXTRA_DIST = @DRIVER_NAME@.man
|
||||
|
||||
CLEANFILES = $(driverman_DATA)
|
||||
|
||||
SED = sed
|
||||
|
||||
# Strings to replace in man pages
|
||||
XORGRELSTRING = @PACKAGE_STRING@
|
||||
XORGMANNAME = X Version 11
|
||||
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
|
||||
|
||||
MAN_SUBSTS = \
|
||||
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
|
||||
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
|
||||
-e 's|__xservername__|Xorg|g' \
|
||||
-e 's|__xconfigfile__|xorg.conf|g' \
|
||||
-e 's|__projectroot__|$(prefix)|g' \
|
||||
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
|
||||
-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
|
||||
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
|
||||
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
|
||||
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
|
||||
|
||||
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
|
||||
|
||||
.man.$(DRIVER_MAN_SUFFIX):
|
||||
sed $(MAN_SUBSTS) < $< > $@
|
||||
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.man,v 1.2 2001/01/27 18:20:47 dawes Exp $
|
||||
.\" shorthand for double quote that works everywhere.
|
||||
.ds q \N'34'
|
||||
.TH FBDEV __drivermansuffix__ __vendorversion__
|
||||
@@ -38,9 +37,7 @@ driver can pick up the currently used video mode from the framebuffer
|
||||
driver and will use it if there are no video modes configured.
|
||||
.PP
|
||||
For PCI boards you might have to add a BusID line to the Device
|
||||
section. See above for a sample line. You can use \*q\__xservername__
|
||||
-scanpci\*q
|
||||
to figure out the correct values.
|
||||
section. See above for a sample line.
|
||||
.PP
|
||||
The following driver
|
||||
.B Options
|
||||
@@ -57,7 +54,7 @@ Enable rotation of the display. The supported values are "CW" (clockwise,
|
||||
90 degrees), "UD" (upside down, 180 degrees) and "CCW" (counter clockwise,
|
||||
270 degrees). Implies use of the shadow framebuffer layer. Default: off.
|
||||
.SH "SEE ALSO"
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__),
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__),
|
||||
X(__miscmansuffix__), fbdevhw(__drivermansuffix__)
|
||||
.SH AUTHORS
|
||||
Authors include: Gerd Knorr, Michel Dänzer, Geert Uytterhoeven
|
||||
Authors include: Gerd Knorr, Michel D\(:anzer, Geert Uytterhoeven
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.la
|
||||
*.lo
|
||||
@@ -29,4 +29,5 @@ fbdev_drv_la_LDFLAGS = -module -avoid-version
|
||||
fbdev_drv_ladir = @moduledir@/drivers
|
||||
|
||||
fbdev_drv_la_SOURCES = \
|
||||
compat-api.h \
|
||||
fbdev.c
|
||||
|
||||
101
src/compat-api.h
Normal file
101
src/compat-api.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright 2012 Red Hat, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author: Dave Airlie <airlied@redhat.com>
|
||||
*/
|
||||
|
||||
/* this file provides API compat between server post 1.13 and pre it,
|
||||
it should be reused inside as many drivers as possible */
|
||||
#ifndef COMPAT_API_H
|
||||
#define COMPAT_API_H
|
||||
|
||||
#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
|
||||
#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
|
||||
#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
|
||||
#endif
|
||||
|
||||
#ifndef XF86_HAS_SCRN_CONV
|
||||
#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
|
||||
#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
|
||||
#endif
|
||||
|
||||
#ifndef XF86_SCRN_INTERFACE
|
||||
|
||||
#define SCRN_ARG_TYPE int
|
||||
#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
|
||||
|
||||
#define SCREEN_ARG_TYPE int
|
||||
#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
|
||||
|
||||
#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv
|
||||
|
||||
#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
|
||||
#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
|
||||
|
||||
#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
|
||||
#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
|
||||
|
||||
#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
|
||||
#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0
|
||||
|
||||
#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
|
||||
#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0
|
||||
|
||||
#define FREE_SCREEN_ARGS_DECL int arg, int flags
|
||||
#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
|
||||
|
||||
#define VT_FUNC_ARGS_DECL int arg, int flags
|
||||
#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
|
||||
|
||||
#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
|
||||
#else
|
||||
#define SCRN_ARG_TYPE ScrnInfoPtr
|
||||
#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
|
||||
|
||||
#define SCREEN_ARG_TYPE ScreenPtr
|
||||
#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
|
||||
|
||||
#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
|
||||
|
||||
#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
|
||||
#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
|
||||
|
||||
#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
|
||||
#define CLOSE_SCREEN_ARGS pScreen
|
||||
|
||||
#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
|
||||
#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y
|
||||
|
||||
#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
|
||||
#define SWITCH_MODE_ARGS(arg, m) arg, m
|
||||
|
||||
#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
|
||||
#define FREE_SCREEN_ARGS(x) (x)
|
||||
|
||||
#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
|
||||
#define VT_FUNC_ARGS(flags) pScrn
|
||||
|
||||
#define XF86_ENABLEDISABLEFB_ARG(x) (x)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
471
src/fbdev.c
471
src/fbdev.c
@@ -1,8 +1,6 @@
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v 1.44 2003/09/24 02:43:21 dawes Exp $ */
|
||||
|
||||
/*
|
||||
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
|
||||
* Michel Dänzer, <michdaen@iiic.ethz.ch>
|
||||
* Michel Dänzer, <michel@tungstengraphics.com>
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -16,7 +14,6 @@
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
#include "mipointer.h"
|
||||
#include "mibstore.h"
|
||||
#include "micmap.h"
|
||||
#include "colormapst.h"
|
||||
#include "xf86cmap.h"
|
||||
@@ -25,42 +22,47 @@
|
||||
|
||||
/* for visuals */
|
||||
#include "fb.h"
|
||||
#ifdef USE_AFB
|
||||
#include "afb.h"
|
||||
#endif
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
|
||||
#include "xf86Resources.h"
|
||||
#include "xf86RAC.h"
|
||||
#endif
|
||||
|
||||
#include "fbdevhw.h"
|
||||
|
||||
#include "xf86xv.h"
|
||||
|
||||
#define DEBUG 0
|
||||
#include "compat-api.h"
|
||||
|
||||
#if DEBUG
|
||||
# define TRACE_ENTER(str) ErrorF("fbdev: " str " %d\n",pScrn->scrnIndex)
|
||||
# define TRACE_EXIT(str) ErrorF("fbdev: " str " done\n")
|
||||
# define TRACE(str) ErrorF("fbdev trace: " str "\n")
|
||||
#else
|
||||
# define TRACE_ENTER(str)
|
||||
# define TRACE_EXIT(str)
|
||||
# define TRACE(str)
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
#include <pciaccess.h>
|
||||
#endif
|
||||
|
||||
static Bool debug = 0;
|
||||
|
||||
#define TRACE_ENTER(str) \
|
||||
do { if (debug) ErrorF("fbdev: " str " %d\n",pScrn->scrnIndex); } while (0)
|
||||
#define TRACE_EXIT(str) \
|
||||
do { if (debug) ErrorF("fbdev: " str " done\n"); } while (0)
|
||||
#define TRACE(str) \
|
||||
do { if (debug) ErrorF("fbdev trace: " str "\n"); } while (0)
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* prototypes */
|
||||
|
||||
static const OptionInfoRec * FBDevAvailableOptions(int chipid, int busid);
|
||||
static void FBDevIdentify(int flags);
|
||||
static Bool FBDevProbe(DriverPtr drv, int flags);
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
|
||||
struct pci_device *dev, intptr_t match_data);
|
||||
#endif
|
||||
static Bool FBDevPreInit(ScrnInfoPtr pScrn, int flags);
|
||||
static Bool FBDevScreenInit(int Index, ScreenPtr pScreen, int argc,
|
||||
char **argv);
|
||||
static Bool FBDevCloseScreen(int scrnIndex, ScreenPtr pScreen);
|
||||
static Bool FBDevScreenInit(SCREEN_INIT_ARGS_DECL);
|
||||
static Bool FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL);
|
||||
static void * FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
|
||||
CARD32 *size, void *closure);
|
||||
static void FBDevPointerMoved(int index, int x, int y);
|
||||
static void FBDevPointerMoved(SCRN_ARG_TYPE arg, int x, int y);
|
||||
static Bool FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen);
|
||||
static Bool FBDevDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
|
||||
pointer ptr);
|
||||
@@ -68,11 +70,6 @@ static Bool FBDevDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
|
||||
|
||||
enum { FBDEV_ROTATE_NONE=0, FBDEV_ROTATE_CW=270, FBDEV_ROTATE_UD=180, FBDEV_ROTATE_CCW=90 };
|
||||
|
||||
/*static ShadowUpdateProc updateFuncs[] =
|
||||
{ shadowUpdatePacked, shadowUpdateRotate8_270, shadowUpdateRotate8_180, shadowUpdateRotate8_90,
|
||||
shadowUpdatePacked, shadowUpdateRotate16_270, shadowUpdateRotate16_180, shadowUpdateRotate16_90,
|
||||
shadowUpdatePacked, shadowUpdateRotate32_270, shadowUpdateRotate32_180, shadowUpdateRotate32_90 }; */
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -85,8 +82,17 @@ static int pix24bpp = 0;
|
||||
#define FBDEV_VERSION 4000
|
||||
#define FBDEV_NAME "FBDEV"
|
||||
#define FBDEV_DRIVER_NAME "fbdev"
|
||||
#define FBDEV_MAJOR_VERSION 0
|
||||
#define FBDEV_MINOR_VERSION 2
|
||||
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
static const struct pci_id_match fbdev_device_match[] = {
|
||||
{
|
||||
PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
|
||||
0x00030000, 0x00ffffff, 0
|
||||
},
|
||||
|
||||
{ 0, 0, 0 },
|
||||
};
|
||||
#endif
|
||||
|
||||
_X_EXPORT DriverRec FBDEV = {
|
||||
FBDEV_VERSION,
|
||||
@@ -99,15 +105,17 @@ _X_EXPORT DriverRec FBDEV = {
|
||||
FBDevAvailableOptions,
|
||||
NULL,
|
||||
0,
|
||||
FBDevDriverFunc
|
||||
FBDevDriverFunc,
|
||||
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
fbdev_device_match,
|
||||
FBDevPciProbe
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Supported "chipsets" */
|
||||
static SymTabRec FBDevChipsets[] = {
|
||||
{ 0, "fbdev" },
|
||||
#ifdef USE_AFB
|
||||
{ 0, "afb" },
|
||||
#endif
|
||||
{-1, NULL }
|
||||
};
|
||||
|
||||
@@ -115,80 +123,20 @@ static SymTabRec FBDevChipsets[] = {
|
||||
typedef enum {
|
||||
OPTION_SHADOW_FB,
|
||||
OPTION_ROTATE,
|
||||
OPTION_FBDEV
|
||||
OPTION_FBDEV,
|
||||
OPTION_DEBUG
|
||||
} FBDevOpts;
|
||||
|
||||
static const OptionInfoRec FBDevOptions[] = {
|
||||
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
|
||||
{ OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE },
|
||||
{ OPTION_FBDEV, "fbdev", OPTV_STRING, {0}, FALSE },
|
||||
{ OPTION_DEBUG, "debug", OPTV_BOOLEAN, {0}, FALSE },
|
||||
{ -1, NULL, OPTV_NONE, {0}, FALSE }
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
static const char *afbSymbols[] = {
|
||||
"afbScreenInit",
|
||||
"afbCreateDefColormap",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char *fbSymbols[] = {
|
||||
"fbScreenInit",
|
||||
"fbPictureInit",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char *shadowSymbols[] = {
|
||||
"shadowAdd",
|
||||
"shadowAlloc",
|
||||
"shadowInit",
|
||||
"shadowSetup",
|
||||
"shadowUpdatePacked",
|
||||
"shadowUpdatePackedWeak",
|
||||
"shadowUpdateRotatePacked",
|
||||
"shadowUpdateRotatePackedWeak",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char *fbdevHWSymbols[] = {
|
||||
"fbdevHWInit",
|
||||
"fbdevHWProbe",
|
||||
"fbdevHWSetVideoModes",
|
||||
"fbdevHWUseBuildinMode",
|
||||
|
||||
"fbdevHWGetDepth",
|
||||
"fbdevHWGetLineLength",
|
||||
"fbdevHWGetName",
|
||||
"fbdevHWGetType",
|
||||
"fbdevHWGetVidmem",
|
||||
"fbdevHWLinearOffset",
|
||||
"fbdevHWLoadPalette",
|
||||
"fbdevHWMapVidmem",
|
||||
"fbdevHWUnmapVidmem",
|
||||
|
||||
/* colormap */
|
||||
"fbdevHWLoadPalette",
|
||||
"fbdevHWLoadPaletteWeak",
|
||||
|
||||
/* ScrnInfo hooks */
|
||||
"fbdevHWAdjustFrameWeak",
|
||||
"fbdevHWEnterVTWeak",
|
||||
"fbdevHWLeaveVTWeak",
|
||||
"fbdevHWModeInit",
|
||||
"fbdevHWRestore",
|
||||
"fbdevHWSave",
|
||||
"fbdevHWSaveScreen",
|
||||
"fbdevHWSaveScreenWeak",
|
||||
"fbdevHWSwitchModeWeak",
|
||||
"fbdevHWValidModeWeak",
|
||||
|
||||
"fbdevHWDPMSSet",
|
||||
"fbdevHWDPMSSetWeak",
|
||||
|
||||
NULL
|
||||
};
|
||||
|
||||
#ifdef XFree86LOADER
|
||||
|
||||
MODULESETUPPROTO(FBDevSetup);
|
||||
@@ -200,10 +148,10 @@ static XF86ModuleVersionInfo FBDevVersRec =
|
||||
MODINFOSTRING1,
|
||||
MODINFOSTRING2,
|
||||
XORG_VERSION_CURRENT,
|
||||
FBDEV_MAJOR_VERSION, FBDEV_MINOR_VERSION, 0,
|
||||
PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
|
||||
ABI_CLASS_VIDEODRV,
|
||||
ABI_VIDEODRV_VERSION,
|
||||
NULL,
|
||||
MOD_CLASS_VIDEODRV,
|
||||
{0,0,0,0}
|
||||
};
|
||||
|
||||
@@ -217,8 +165,6 @@ FBDevSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||
if (!setupDone) {
|
||||
setupDone = TRUE;
|
||||
xf86AddDriver(&FBDEV, module, HaveDriverFuncs);
|
||||
LoaderRefSymLists(afbSymbols, fbSymbols,
|
||||
shadowSymbols, fbdevHWSymbols, NULL);
|
||||
return (pointer)1;
|
||||
} else {
|
||||
if (errmaj) *errmaj = LDR_ONCEONLY;
|
||||
@@ -236,11 +182,12 @@ typedef struct {
|
||||
unsigned char* fbmem;
|
||||
int fboff;
|
||||
int lineLength;
|
||||
unsigned char* shadowmem;
|
||||
int rotate;
|
||||
Bool shadowFB;
|
||||
void *shadow;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
void (*PointerMoved)(int index, int x, int y);
|
||||
CreateScreenResourcesProcPtr CreateScreenResources;
|
||||
void (*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y);
|
||||
EntityInfoPtr pEnt;
|
||||
/* DGA info */
|
||||
DGAModePtr pDGAMode;
|
||||
@@ -265,7 +212,7 @@ FBDevFreeRec(ScrnInfoPtr pScrn)
|
||||
{
|
||||
if (pScrn->driverPrivate == NULL)
|
||||
return;
|
||||
xfree(pScrn->driverPrivate);
|
||||
free(pScrn->driverPrivate);
|
||||
pScrn->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
@@ -283,6 +230,53 @@ FBDevIdentify(int flags)
|
||||
xf86PrintChipsets(FBDEV_NAME, "driver for framebuffer", FBDevChipsets);
|
||||
}
|
||||
|
||||
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
|
||||
struct pci_device *dev, intptr_t match_data)
|
||||
{
|
||||
ScrnInfoPtr pScrn = NULL;
|
||||
|
||||
if (!xf86LoadDrvSubModule(drv, "fbdevhw"))
|
||||
return FALSE;
|
||||
|
||||
pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL);
|
||||
if (pScrn) {
|
||||
char *device;
|
||||
GDevPtr devSection = xf86GetDevFromEntity(pScrn->entityList[0],
|
||||
pScrn->entityInstanceList[0]);
|
||||
|
||||
device = xf86FindOptionValue(devSection->options, "fbdev");
|
||||
if (fbdevHWProbe(NULL, device, NULL)) {
|
||||
pScrn->driverVersion = FBDEV_VERSION;
|
||||
pScrn->driverName = FBDEV_DRIVER_NAME;
|
||||
pScrn->name = FBDEV_NAME;
|
||||
pScrn->Probe = FBDevProbe;
|
||||
pScrn->PreInit = FBDevPreInit;
|
||||
pScrn->ScreenInit = FBDevScreenInit;
|
||||
pScrn->SwitchMode = fbdevHWSwitchModeWeak();
|
||||
pScrn->AdjustFrame = fbdevHWAdjustFrameWeak();
|
||||
pScrn->EnterVT = fbdevHWEnterVTWeak();
|
||||
pScrn->LeaveVT = fbdevHWLeaveVTWeak();
|
||||
pScrn->ValidMode = fbdevHWValidModeWeak();
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"claimed PCI slot %d@%d:%d:%d\n",
|
||||
dev->bus, dev->domain, dev->dev, dev->func);
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"using %s\n", device ? device : "default device");
|
||||
}
|
||||
else {
|
||||
pScrn = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return (pScrn != NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static Bool
|
||||
FBDevProbe(DriverPtr drv, int flags)
|
||||
{
|
||||
@@ -290,7 +284,9 @@ FBDevProbe(DriverPtr drv, int flags)
|
||||
ScrnInfoPtr pScrn;
|
||||
GDevPtr *devSections;
|
||||
int numDevSections;
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
int bus,device,func;
|
||||
#endif
|
||||
char *dev;
|
||||
Bool foundScreen = FALSE;
|
||||
|
||||
@@ -306,26 +302,32 @@ FBDevProbe(DriverPtr drv, int flags)
|
||||
if (!xf86LoadDrvSubModule(drv, "fbdevhw"))
|
||||
return FALSE;
|
||||
|
||||
xf86LoaderReqSymLists(fbdevHWSymbols, NULL);
|
||||
|
||||
for (i = 0; i < numDevSections; i++) {
|
||||
Bool isIsa = FALSE;
|
||||
Bool isPci = FALSE;
|
||||
|
||||
dev = xf86FindOptionValue(devSections[i]->options,"fbdev");
|
||||
if (devSections[i]->busID) {
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (xf86ParsePciBusString(devSections[i]->busID,&bus,&device,
|
||||
&func)) {
|
||||
if (!xf86CheckPciSlot(bus,device,func))
|
||||
continue;
|
||||
isPci = TRUE;
|
||||
} else if (xf86ParseIsaBusString(devSections[i]->busID))
|
||||
} else
|
||||
#endif
|
||||
#ifdef HAVE_ISA
|
||||
if (xf86ParseIsaBusString(devSections[i]->busID))
|
||||
isIsa = TRUE;
|
||||
else
|
||||
#endif
|
||||
0;
|
||||
|
||||
}
|
||||
if (fbdevHWProbe(NULL,dev,NULL)) {
|
||||
pScrn = NULL;
|
||||
if (isPci) {
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
/* XXX what about when there's no busID set? */
|
||||
int entity;
|
||||
|
||||
@@ -341,7 +343,9 @@ FBDevProbe(DriverPtr drv, int flags)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"claimed PCI slot %d:%d:%d\n",bus,device,func);
|
||||
|
||||
#endif
|
||||
} else if (isIsa) {
|
||||
#ifdef HAVE_ISA
|
||||
int entity;
|
||||
|
||||
entity = xf86ClaimIsaSlot(drv, 0,
|
||||
@@ -349,6 +353,7 @@ FBDevProbe(DriverPtr drv, int flags)
|
||||
pScrn = xf86ConfigIsaEntity(pScrn,0,entity,
|
||||
NULL,RES_SHARED_VGA,
|
||||
NULL,NULL,NULL,NULL);
|
||||
#endif
|
||||
} else {
|
||||
int entity;
|
||||
|
||||
@@ -378,7 +383,7 @@ FBDevProbe(DriverPtr drv, int flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
xfree(devSections);
|
||||
free(devSections);
|
||||
TRACE("probe done");
|
||||
return foundScreen;
|
||||
}
|
||||
@@ -388,8 +393,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
{
|
||||
FBDevPtr fPtr;
|
||||
int default_depth, fbbpp;
|
||||
const char *mod = NULL, *s;
|
||||
const char **syms = NULL;
|
||||
const char *s;
|
||||
int type;
|
||||
|
||||
if (flags & PROBE_DETECT) return FALSE;
|
||||
@@ -407,6 +411,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
fPtr->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
|
||||
/* XXX Is this right? Can probably remove RAC_FB */
|
||||
pScrn->racIoFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
|
||||
@@ -417,13 +422,13 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
"xf86RegisterResources() found resource conflicts\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* open device */
|
||||
if (!fbdevHWInit(pScrn,NULL,xf86FindOptionValue(fPtr->pEnt->device->options,"fbdev")))
|
||||
return FALSE;
|
||||
default_depth = fbdevHWGetDepth(pScrn,&fbbpp);
|
||||
if (!xf86SetDepthBpp(pScrn, default_depth, default_depth, fbbpp,
|
||||
Support24bppFb | Support32bppFb | SupportConvert32to24 | PreferConvert32to24))
|
||||
Support24bppFb | Support32bppFb | SupportConvert32to24 | SupportConvert24to32))
|
||||
return FALSE;
|
||||
xf86PrintDepthBpp(pScrn);
|
||||
|
||||
@@ -468,7 +473,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
/* handle options */
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
if (!(fPtr->Options = xalloc(sizeof(FBDevOptions))))
|
||||
if (!(fPtr->Options = malloc(sizeof(FBDevOptions))))
|
||||
return FALSE;
|
||||
memcpy(fPtr->Options, FBDevOptions, sizeof(FBDevOptions));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, fPtr->pEnt->device->options, fPtr->Options);
|
||||
@@ -476,6 +481,8 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
/* use shadow framebuffer by default */
|
||||
fPtr->shadowFB = xf86ReturnOptValBool(fPtr->Options, OPTION_SHADOW_FB, TRUE);
|
||||
|
||||
debug = xf86ReturnOptValBool(fPtr->Options, OPTION_DEBUG, FALSE);
|
||||
|
||||
/* rotation */
|
||||
fPtr->rotate = FBDEV_ROTATE_NONE;
|
||||
if ((s = xf86GetOptValString(fPtr->Options, OPTION_ROTATE)))
|
||||
@@ -531,15 +538,8 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
fbdevHWUseBuildinMode(pScrn);
|
||||
pScrn->currentMode = pScrn->modes;
|
||||
|
||||
if (fPtr->shadowFB)
|
||||
pScrn->displayWidth = pScrn->virtualX; /* ShadowFB handles this correctly */
|
||||
else {
|
||||
int fbbpp;
|
||||
/* FIXME: this doesn't work for all cases, e.g. when each scanline
|
||||
has a padding which is independent from the depth (controlfb) */
|
||||
fbdevHWGetDepth(pScrn,&fbbpp);
|
||||
pScrn->displayWidth = fbdevHWGetLineLength(pScrn)/(fbbpp >> 3);
|
||||
}
|
||||
/* First approximation, may be refined in ScreenInit */
|
||||
pScrn->displayWidth = pScrn->virtualX;
|
||||
|
||||
xf86PrintModes(pScrn);
|
||||
|
||||
@@ -549,10 +549,6 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
/* Load bpp-specific modules */
|
||||
switch ((type = fbdevHWGetType(pScrn)))
|
||||
{
|
||||
case FBDEVHW_PLANES:
|
||||
mod = "afb";
|
||||
syms = afbSymbols;
|
||||
break;
|
||||
case FBDEVHW_PACKED_PIXELS:
|
||||
switch (pScrn->bitsPerPixel)
|
||||
{
|
||||
@@ -560,8 +556,6 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
case 16:
|
||||
case 24:
|
||||
case 32:
|
||||
mod = "fb";
|
||||
syms = fbSymbols;
|
||||
break;
|
||||
default:
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
@@ -593,13 +587,10 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
"unrecognised fbdev hardware type (%d)\n", type);
|
||||
return FALSE;
|
||||
}
|
||||
if (mod && xf86LoadSubModule(pScrn, mod) == NULL) {
|
||||
if (xf86LoadSubModule(pScrn, "fb") == NULL) {
|
||||
FBDevFreeRec(pScrn);
|
||||
return FALSE;
|
||||
}
|
||||
if (mod && syms) {
|
||||
xf86LoaderReqSymLists(syms, NULL);
|
||||
}
|
||||
|
||||
/* Load shadow if needed */
|
||||
if (fPtr->shadowFB) {
|
||||
@@ -609,21 +600,64 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
FBDevFreeRec(pScrn);
|
||||
return FALSE;
|
||||
}
|
||||
xf86LoaderReqSymLists(shadowSymbols, NULL);
|
||||
}
|
||||
|
||||
TRACE_EXIT("PreInit");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static Bool
|
||||
FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
FBDevCreateScreenResources(ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
PixmapPtr pPixmap;
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
Bool ret;
|
||||
|
||||
pScreen->CreateScreenResources = fPtr->CreateScreenResources;
|
||||
ret = pScreen->CreateScreenResources(pScreen);
|
||||
pScreen->CreateScreenResources = FBDevCreateScreenResources;
|
||||
|
||||
if (!ret)
|
||||
return FALSE;
|
||||
|
||||
pPixmap = pScreen->GetScreenPixmap(pScreen);
|
||||
|
||||
if (!shadowAdd(pScreen, pPixmap, fPtr->rotate ?
|
||||
shadowUpdateRotatePackedWeak() : shadowUpdatePackedWeak(),
|
||||
FBDevWindowLinear, fPtr->rotate, NULL)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
FBDevShadowInit(ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
|
||||
if (!shadowSetup(pScreen)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fPtr->CreateScreenResources = pScreen->CreateScreenResources;
|
||||
pScreen->CreateScreenResources = FBDevCreateScreenResources;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static Bool
|
||||
FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
VisualPtr visual;
|
||||
int init_picture = 0;
|
||||
int ret,flags,width,height;
|
||||
int ret, flags;
|
||||
int type;
|
||||
|
||||
TRACE_ENTER("FBDevScreenInit");
|
||||
@@ -639,7 +673,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
#endif
|
||||
|
||||
if (NULL == (fPtr->fbmem = fbdevHWMapVidmem(pScrn))) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"mapping of video memory"
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"mapping of video memory"
|
||||
" failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
@@ -648,17 +682,17 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
fbdevHWSave(pScrn);
|
||||
|
||||
if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"mode initialization failed\n");
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"mode initialization failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
fbdevHWSaveScreen(pScreen, SCREEN_SAVER_ON);
|
||||
fbdevHWAdjustFrame(scrnIndex,0,0,0);
|
||||
fbdevHWAdjustFrame(ADJUST_FRAME_ARGS(pScrn, 0, 0));
|
||||
|
||||
/* mi layer */
|
||||
miClearVisualTypes();
|
||||
if (pScrn->bitsPerPixel > 8) {
|
||||
if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"
|
||||
" for %d bits per pixel [1]\n",
|
||||
pScrn->bitsPerPixel);
|
||||
return FALSE;
|
||||
@@ -667,24 +701,33 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
if (!miSetVisualTypes(pScrn->depth,
|
||||
miGetDefaultVisualMask(pScrn->depth),
|
||||
pScrn->rgbBits, pScrn->defaultVisual)) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"
|
||||
" for %d bits per pixel [2]\n",
|
||||
pScrn->bitsPerPixel);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (!miSetPixmapDepths()) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(fPtr->rotate==FBDEV_ROTATE_CW || fPtr->rotate==FBDEV_ROTATE_CCW)
|
||||
{
|
||||
height = pScrn->virtualX;
|
||||
width = pScrn->displayWidth = pScrn->virtualY;
|
||||
} else {
|
||||
height = pScrn->virtualY;
|
||||
width = pScrn->virtualX;
|
||||
int tmp = pScrn->virtualX;
|
||||
pScrn->virtualX = pScrn->displayWidth = pScrn->virtualY;
|
||||
pScrn->virtualY = tmp;
|
||||
} else if (!fPtr->shadowFB) {
|
||||
/* FIXME: this doesn't work for all cases, e.g. when each scanline
|
||||
has a padding which is independent from the depth (controlfb) */
|
||||
pScrn->displayWidth = fbdevHWGetLineLength(pScrn) /
|
||||
(pScrn->bitsPerPixel / 8);
|
||||
|
||||
if (pScrn->displayWidth != pScrn->virtualX) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Pitch updated to %d after ModeInit\n",
|
||||
pScrn->displayWidth);
|
||||
}
|
||||
}
|
||||
|
||||
if(fPtr->rotate && !fPtr->PointerMoved) {
|
||||
@@ -692,57 +735,36 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
pScrn->PointerMoved = FBDevPointerMoved;
|
||||
}
|
||||
|
||||
/* shadowfb */
|
||||
if (fPtr->shadowFB) {
|
||||
if ((fPtr->shadowmem = shadowAlloc(width, height,
|
||||
pScrn->bitsPerPixel)) == NULL) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,
|
||||
"allocation of shadow framebuffer memory failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
fPtr->fbstart = fPtr->fbmem + fPtr->fboff;
|
||||
|
||||
fPtr->fbstart = fPtr->shadowmem;
|
||||
} else {
|
||||
fPtr->shadowmem = NULL;
|
||||
fPtr->fbstart = fPtr->fbmem + fPtr->fboff;
|
||||
if (fPtr->shadowFB) {
|
||||
fPtr->shadow = calloc(1, pScrn->virtualX * pScrn->virtualY *
|
||||
pScrn->bitsPerPixel);
|
||||
|
||||
if (!fPtr->shadow) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Failed to allocate shadow framebuffer\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
switch ((type = fbdevHWGetType(pScrn)))
|
||||
{
|
||||
#ifdef USE_AFB
|
||||
case FBDEVHW_PLANES:
|
||||
if (fPtr->rotate)
|
||||
{
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: rotate not supported for afb\n");
|
||||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
if (fPtr->shadowFB)
|
||||
{
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: shadow framebuffer not supported"
|
||||
" for afb\n");
|
||||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
ret = afbScreenInit
|
||||
(pScreen, fPtr->fbstart, pScrn->virtualX, pScrn->virtualY,
|
||||
pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth);
|
||||
break;
|
||||
#endif
|
||||
case FBDEVHW_PACKED_PIXELS:
|
||||
switch (pScrn->bitsPerPixel) {
|
||||
case 8:
|
||||
case 16:
|
||||
case 24:
|
||||
case 32:
|
||||
ret = fbScreenInit(pScreen, fPtr->fbstart, width, height,
|
||||
pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth, pScrn->bitsPerPixel);
|
||||
ret = fbScreenInit(pScreen, fPtr->shadowFB ? fPtr->shadow
|
||||
: fPtr->fbstart, pScrn->virtualX,
|
||||
pScrn->virtualY, pScrn->xDpi,
|
||||
pScrn->yDpi, pScrn->displayWidth,
|
||||
pScrn->bitsPerPixel);
|
||||
init_picture = 1;
|
||||
break;
|
||||
default:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: invalid number of bits per"
|
||||
" pixel (%d) encountered in"
|
||||
" FBDevScreenInit()\n", pScrn->bitsPerPixel);
|
||||
@@ -753,7 +775,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
case FBDEVHW_INTERLEAVED_PLANES:
|
||||
/* This should never happen ...
|
||||
* we should check for this much much earlier ... */
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: interleaved planes are not yet "
|
||||
"supported by the fbdev driver\n");
|
||||
ret = FALSE;
|
||||
@@ -761,22 +783,22 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
case FBDEVHW_TEXT:
|
||||
/* This should never happen ...
|
||||
* we should check for this much much earlier ... */
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: text mode is not supported by the "
|
||||
"fbdev driver\n");
|
||||
ret = FALSE;
|
||||
break;
|
||||
case FBDEVHW_VGA_PLANES:
|
||||
/* Not supported yet */
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: EGA/VGA Planes are not yet "
|
||||
"supported by the fbdev driver\n");
|
||||
ret = FALSE;
|
||||
break;
|
||||
default:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: unrecognised hardware type (%d) "
|
||||
"encountered in FBDevScreenInit()\n");
|
||||
"encountered in FBDevScreenInit()\n", type);
|
||||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -803,12 +825,8 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
"Render extension initialisation failed\n");
|
||||
|
||||
if (fPtr->shadowFB &&
|
||||
(!shadowSetup(pScreen) || !shadowAdd(pScreen, NULL,
|
||||
fPtr->rotate ? shadowUpdateRotatePackedWeak()
|
||||
: shadowUpdatePackedWeak(),
|
||||
FBDevWindowLinear, fPtr->rotate, NULL)) ) {
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
if (fPtr->shadowFB && !FBDevShadowInit(pScreen)) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"shadow framebuffer initialization failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
@@ -816,17 +834,16 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
if (!fPtr->rotate)
|
||||
FBDevDGAInit(pScrn, pScreen);
|
||||
else {
|
||||
xf86DrvMsg(scrnIndex, X_INFO, "display rotated; disabling DGA\n");
|
||||
xf86DrvMsg(scrnIndex, X_INFO, "using driver rotation; disabling "
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "display rotated; disabling DGA\n");
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "using driver rotation; disabling "
|
||||
"XRandR\n");
|
||||
xf86DisableRandR();
|
||||
if (pScrn->bitsPerPixel == 24)
|
||||
xf86DrvMsg(scrnIndex, X_WARNING, "rotation might be broken at 24 "
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "rotation might be broken at 24 "
|
||||
"bits per pixel\n");
|
||||
}
|
||||
|
||||
xf86SetBlackWhitePixels(pScreen);
|
||||
miInitializeBackingStore(pScreen);
|
||||
xf86SetBackingStore(pScreen);
|
||||
|
||||
/* software cursor */
|
||||
@@ -836,41 +853,31 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
switch ((type = fbdevHWGetType(pScrn)))
|
||||
{
|
||||
/* XXX It would be simpler to use miCreateDefColormap() in all cases. */
|
||||
#ifdef USE_AFB
|
||||
case FBDEVHW_PLANES:
|
||||
if (!afbCreateDefColormap(pScreen)) {
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: afbCreateDefColormap "
|
||||
"failed in FBDevScreenInit()\n");
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case FBDEVHW_PACKED_PIXELS:
|
||||
if (!miCreateDefColormap(pScreen)) {
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: miCreateDefColormap failed "
|
||||
"in FBDevScreenInit()\n");
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
case FBDEVHW_INTERLEAVED_PLANES:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: interleaved planes are not yet "
|
||||
"supported by the fbdev driver\n");
|
||||
return FALSE;
|
||||
case FBDEVHW_TEXT:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: text mode is not supported by "
|
||||
"the fbdev driver\n");
|
||||
return FALSE;
|
||||
case FBDEVHW_VGA_PLANES:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: EGA/VGA planes are not yet "
|
||||
"supported by the fbdev driver\n");
|
||||
return FALSE;
|
||||
default:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"internal error: unrecognised fbdev hardware type "
|
||||
"(%d) encountered in FBDevScreenInit()\n", type);
|
||||
return FALSE;
|
||||
@@ -888,6 +895,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
fPtr->CloseScreen = pScreen->CloseScreen;
|
||||
pScreen->CloseScreen = FBDevCloseScreen;
|
||||
|
||||
#if XV
|
||||
{
|
||||
XF86VideoAdaptorPtr *ptr;
|
||||
|
||||
@@ -896,6 +904,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
xf86XVScreenInit(pScreen,ptr,n);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
TRACE_EXIT("FBDevScreenInit");
|
||||
|
||||
@@ -903,24 +912,28 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
}
|
||||
|
||||
static Bool
|
||||
FBDevCloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||
FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
|
||||
fbdevHWRestore(pScrn);
|
||||
fbdevHWUnmapVidmem(pScrn);
|
||||
if (fPtr->shadowmem)
|
||||
xfree(fPtr->shadowmem);
|
||||
if (fPtr->shadow) {
|
||||
shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen));
|
||||
free(fPtr->shadow);
|
||||
fPtr->shadow = NULL;
|
||||
}
|
||||
if (fPtr->pDGAMode) {
|
||||
xfree(fPtr->pDGAMode);
|
||||
free(fPtr->pDGAMode);
|
||||
fPtr->pDGAMode = NULL;
|
||||
fPtr->nDGAMode = 0;
|
||||
}
|
||||
pScrn->vtSema = FALSE;
|
||||
|
||||
pScreen->CreateScreenResources = fPtr->CreateScreenResources;
|
||||
pScreen->CloseScreen = fPtr->CloseScreen;
|
||||
return (*pScreen->CloseScreen)(scrnIndex, pScreen);
|
||||
return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
|
||||
}
|
||||
|
||||
|
||||
@@ -933,7 +946,7 @@ static void *
|
||||
FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
|
||||
CARD32 *size, void *closure)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
|
||||
if (!pScrn->vtSema)
|
||||
@@ -944,13 +957,13 @@ FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
|
||||
else
|
||||
*size = fPtr->lineLength = fbdevHWGetLineLength(pScrn);
|
||||
|
||||
return ((CARD8 *)fPtr->fbmem + fPtr->fboff + row * fPtr->lineLength + offset);
|
||||
return ((CARD8 *)fPtr->fbstart + row * fPtr->lineLength + offset);
|
||||
}
|
||||
|
||||
static void
|
||||
FBDevPointerMoved(int index, int x, int y)
|
||||
FBDevPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[index];
|
||||
SCRN_INFO_PTR(arg);
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
int newX, newY;
|
||||
|
||||
@@ -982,7 +995,7 @@ FBDevPointerMoved(int index, int x, int y)
|
||||
}
|
||||
|
||||
/* Pass adjusted pointer coordinates to wrapped PointerMoved function. */
|
||||
(*fPtr->PointerMoved)(index, newX, newY);
|
||||
(*fPtr->PointerMoved)(arg, newX, newY);
|
||||
}
|
||||
|
||||
|
||||
@@ -1029,9 +1042,9 @@ FBDevDGASetMode(ScrnInfoPtr pScrn, DGAModePtr pDGAMode)
|
||||
frameY0 = pScrn->frameY0;
|
||||
}
|
||||
|
||||
if (!(*pScrn->SwitchMode)(scrnIdx, pMode, 0))
|
||||
if (!(*pScrn->SwitchMode)(SWITCH_MODE_ARGS(pScrn, pMode)))
|
||||
return FALSE;
|
||||
(*pScrn->AdjustFrame)(scrnIdx, frameX0, frameY0, 0);
|
||||
(*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, frameX0, frameY0));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1039,7 +1052,7 @@ FBDevDGASetMode(ScrnInfoPtr pScrn, DGAModePtr pDGAMode)
|
||||
static void
|
||||
FBDevDGASetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
|
||||
{
|
||||
(*pScrn->AdjustFrame)(pScrn->pScreen->myNum, x, y, flags);
|
||||
(*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, x, y));
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1069,8 +1082,8 @@ FBDevDGAAddModes(ScrnInfoPtr pScrn)
|
||||
DGAModePtr pDGAMode;
|
||||
|
||||
do {
|
||||
pDGAMode = xrealloc(fPtr->pDGAMode,
|
||||
(fPtr->nDGAMode + 1) * sizeof(DGAModeRec));
|
||||
pDGAMode = realloc(fPtr->pDGAMode,
|
||||
(fPtr->nDGAMode + 1) * sizeof(DGAModeRec));
|
||||
if (!pDGAMode)
|
||||
break;
|
||||
|
||||
@@ -1117,6 +1130,7 @@ FBDevDGAAddModes(ScrnInfoPtr pScrn)
|
||||
static Bool
|
||||
FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
|
||||
{
|
||||
#ifdef XFreeXDGA
|
||||
FBDevPtr fPtr = FBDEVPTR(pScrn);
|
||||
|
||||
if (pScrn->depth < 8)
|
||||
@@ -1127,6 +1141,9 @@ FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
|
||||
|
||||
return (DGAInit(pScreen, &FBDevDGAFunctions,
|
||||
fPtr->pDGAMode, fPtr->nDGAMode));
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
||||
Reference in New Issue
Block a user