mirror of
https://github.com/X11Libre/xf86-video-fbdev.git
synced 2026-04-07 07:54:06 +00:00
Compare commits
40 Commits
XPRINT_BAS
...
fbdev-0_2_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe1fa4c016 | ||
|
|
41a763816d | ||
|
|
332464c43f | ||
|
|
cf1b33cb4d | ||
|
|
35c09ae4c4 | ||
|
|
2e4f3e6a0a | ||
|
|
8521127ff1 | ||
|
|
7a37e5db75 | ||
|
|
4635b198fb | ||
|
|
91b40b9c63 | ||
|
|
ff70627427 | ||
|
|
d57ddc84c3 | ||
|
|
493a1b8b11 | ||
|
|
3f11faf88c | ||
|
|
e87f2ee9b1 | ||
|
|
5f77732d9a | ||
|
|
52518e4511 | ||
|
|
a2a75f4dba | ||
|
|
28171378a1 | ||
|
|
f060ccc1f1 | ||
|
|
d0517a40a9 | ||
|
|
44d4790006 | ||
|
|
4d18c5309c | ||
|
|
82ab7895da | ||
|
|
077e3dbcf4 | ||
|
|
2327cdd208 | ||
|
|
bd1e31bdb5 | ||
|
|
1d3246ca0d | ||
|
|
ce86e2a272 | ||
|
|
4c1492ac6d | ||
|
|
64ef1f4af1 | ||
|
|
db6514cea0 | ||
|
|
1e80fe1bf9 | ||
|
|
5d8a0a2e47 | ||
|
|
69d61895f3 | ||
|
|
806863c5f6 | ||
|
|
595a614cd9 | ||
|
|
62bec818a1 | ||
|
|
48e31aaed2 | ||
|
|
3a00d91359 |
19
.cvsignore
Normal file
19
.cvsignore
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
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
|
||||||
12
COPYING
Normal file
12
COPYING
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
|
Please submit updated COPYING files to the Xorg bugzilla:
|
||||||
|
|
||||||
|
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
||||||
|
|
||||||
|
All licensing questions regarding this software should be directed at the
|
||||||
|
Xorg mailing list:
|
||||||
|
|
||||||
|
http://lists.freedesktop.org/mailman/listinfo/xorg
|
||||||
51
ChangeLog
Normal file
51
ChangeLog
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
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.
|
||||||
22
Makefile.am
Normal file
22
Makefile.am
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Copyright 2005 Adam Jackson.
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||||
|
# license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
# ADAM JACKSON 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.
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = foreign
|
||||||
|
SUBDIRS = src man
|
||||||
12
autogen.sh
Executable file
12
autogen.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
srcdir=`dirname $0`
|
||||||
|
test -z "$srcdir" && srcdir=.
|
||||||
|
|
||||||
|
ORIGDIR=`pwd`
|
||||||
|
cd $srcdir
|
||||||
|
|
||||||
|
autoreconf -v --install || exit 1
|
||||||
|
cd $ORIGDIR || exit $?
|
||||||
|
|
||||||
|
$srcdir/configure --enable-maintainer-mode "$@"
|
||||||
77
configure.ac
Normal file
77
configure.ac
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# Copyright 2005 Adam Jackson.
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||||
|
# license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
# ADAM JACKSON 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.
|
||||||
|
#
|
||||||
|
# Process this file with autoconf to produce a configure script
|
||||||
|
|
||||||
|
AC_PREREQ(2.57)
|
||||||
|
AC_INIT([xf86-video-fbdev],
|
||||||
|
0.2.0,
|
||||||
|
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||||
|
xf86-video-fbdev)
|
||||||
|
|
||||||
|
AC_CONFIG_SRCDIR([Makefile.am])
|
||||||
|
AM_CONFIG_HEADER([config.h])
|
||||||
|
AC_CONFIG_AUX_DIR(.)
|
||||||
|
|
||||||
|
AM_INIT_AUTOMAKE([dist-bzip2])
|
||||||
|
|
||||||
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
|
# Checks for programs.
|
||||||
|
AC_DISABLE_STATIC
|
||||||
|
AC_PROG_LIBTOOL
|
||||||
|
AC_PROG_CC
|
||||||
|
|
||||||
|
AH_TOP([#include "xorg-server.h"])
|
||||||
|
|
||||||
|
AC_ARG_WITH(xorg-module-dir,
|
||||||
|
AC_HELP_STRING([--with-xorg-module-dir=DIR],
|
||||||
|
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
|
||||||
|
[moduledir="$withval"],
|
||||||
|
[moduledir="$libdir/xorg/modules"])
|
||||||
|
|
||||||
|
# Checks for extensions
|
||||||
|
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
|
||||||
|
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
|
||||||
|
XORG_DRIVER_CHECK_EXT(XV, videoproto)
|
||||||
|
|
||||||
|
# Checks for pkg-config packages
|
||||||
|
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES])
|
||||||
|
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
|
||||||
|
|
||||||
|
# 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
|
||||||
|
])
|
||||||
2
man/.cvsignore
Normal file
2
man/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
59
man/Makefile.am
Normal file
59
man/Makefile.am
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# $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.
|
||||||
|
#
|
||||||
|
|
||||||
|
drivermandir = $(DRIVER_MAN_DIR)
|
||||||
|
|
||||||
|
driverman_PRE = @DRIVER_NAME@.man
|
||||||
|
|
||||||
|
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
|
||||||
|
|
||||||
|
EXTRA_DIST = @DRIVER_NAME@.man
|
||||||
|
|
||||||
|
CLEANFILES = $(driverman_DATA)
|
||||||
|
|
||||||
|
SED = sed
|
||||||
|
|
||||||
|
# Strings to replace in man pages
|
||||||
|
XORGRELSTRING = @PACKAGE_STRING@
|
||||||
|
XORGMANNAME = X Version 11
|
||||||
|
|
||||||
|
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) < $< > $@
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.man,v 1.3 2001/10/02 15:57:32 alanh Exp $
|
.\" $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.
|
.\" shorthand for double quote that works everywhere.
|
||||||
.ds q \N'34'
|
.ds q \N'34'
|
||||||
.TH FBDEV __drivermansuffix__ __vendorversion__
|
.TH FBDEV __drivermansuffix__ __vendorversion__
|
||||||
@@ -15,7 +15,7 @@ fbdev \- video driver for framebuffer device
|
|||||||
.fi
|
.fi
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B fbdev
|
.B fbdev
|
||||||
is an XFree86 driver for framebuffer devices. This is a non-accelerated
|
is an __xservername__ driver for framebuffer devices. This is a non-accelerated
|
||||||
driver, the following framebuffer depths are supported: 8, 15, 16, 24.
|
driver, the following framebuffer depths are supported: 8, 15, 16, 24.
|
||||||
All visual types are supported for depth 8, and TrueColor visual is
|
All visual types are supported for depth 8, and TrueColor visual is
|
||||||
supported for the other depths. Multi-head configurations are supported.
|
supported for the other depths. Multi-head configurations are supported.
|
||||||
@@ -27,7 +27,7 @@ fbdev uses the os-specific submodule fbdevhw(__drivermansuffix__) to talk
|
|||||||
to the kernel
|
to the kernel
|
||||||
device driver. Currently a fbdevhw module is available for linux.
|
device driver. Currently a fbdevhw module is available for linux.
|
||||||
.SH CONFIGURATION DETAILS
|
.SH CONFIGURATION DETAILS
|
||||||
Please refer to XF86Config(__filemansuffix__) for general configuration
|
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
|
||||||
details. This section only covers configuration details specific to
|
details. This section only covers configuration details specific to
|
||||||
this driver.
|
this driver.
|
||||||
.PP
|
.PP
|
||||||
@@ -38,7 +38,8 @@ driver can pick up the currently used video mode from the framebuffer
|
|||||||
driver and will use it if there are no video modes configured.
|
driver and will use it if there are no video modes configured.
|
||||||
.PP
|
.PP
|
||||||
For PCI boards you might have to add a BusID line to the Device
|
For PCI boards you might have to add a BusID line to the Device
|
||||||
section. See above for a sample line. You can use "XFree86 -scanpci"
|
section. See above for a sample line. You can use \*q\__xservername__
|
||||||
|
-scanpci\*q
|
||||||
to figure out the correct values.
|
to figure out the correct values.
|
||||||
.PP
|
.PP
|
||||||
The following driver
|
The following driver
|
||||||
@@ -56,7 +57,7 @@ Enable rotation of the display. The supported values are "CW" (clockwise,
|
|||||||
90 degrees), "UD" (upside down, 180 degrees) and "CCW" (counter clockwise,
|
90 degrees), "UD" (upside down, 180 degrees) and "CCW" (counter clockwise,
|
||||||
270 degrees). Implies use of the shadow framebuffer layer. Default: off.
|
270 degrees). Implies use of the shadow framebuffer layer. Default: off.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1),
|
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__),
|
||||||
X(__miscmansuffix__), fbdevhw(__drivermansuffix__)
|
X(__miscmansuffix__), fbdevhw(__drivermansuffix__)
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Authors include: Gerd Knorr, Michel Dänzer, Geert Uytterhoeven
|
Authors include: Gerd Knorr, Michel Dänzer, Geert Uytterhoeven
|
||||||
|
|||||||
6
src/.cvsignore
Normal file
6
src/.cvsignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.deps
|
||||||
|
.libs
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
*.la
|
||||||
|
*.lo
|
||||||
32
src/Makefile.am
Normal file
32
src/Makefile.am
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Copyright 2005 Adam Jackson.
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||||
|
# license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
# ADAM JACKSON 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.
|
||||||
|
|
||||||
|
# this is obnoxious:
|
||||||
|
# -module lets us name the module exactly how we want
|
||||||
|
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
|
||||||
|
# _ladir passes a dummy rpath to libtool so the thing will actually link
|
||||||
|
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
|
||||||
|
AM_CFLAGS = @XORG_CFLAGS@
|
||||||
|
fbdev_drv_la_LTLIBRARIES = fbdev_drv.la
|
||||||
|
fbdev_drv_la_LDFLAGS = -module -avoid-version
|
||||||
|
fbdev_drv_ladir = @moduledir@/drivers
|
||||||
|
|
||||||
|
fbdev_drv_la_SOURCES = \
|
||||||
|
fbdev.c
|
||||||
217
src/fbdev.c
217
src/fbdev.c
@@ -1,14 +1,19 @@
|
|||||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v 1.42 2002/10/10 01:35:20 dawes Exp $ */
|
/* $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>
|
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
|
||||||
* Michel Dänzer, <michdaen@iiic.ethz.ch>
|
* Michel Dänzer, <michdaen@iiic.ethz.ch>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/* all driver need this */
|
/* all driver need this */
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
#include "xf86_OSproc.h"
|
#include "xf86_OSproc.h"
|
||||||
#include "xf86_ansic.h"
|
|
||||||
|
|
||||||
#include "mipointer.h"
|
#include "mipointer.h"
|
||||||
#include "mibstore.h"
|
#include "mibstore.h"
|
||||||
@@ -29,9 +34,7 @@
|
|||||||
|
|
||||||
#include "fbdevhw.h"
|
#include "fbdevhw.h"
|
||||||
|
|
||||||
#ifdef XvExtension
|
|
||||||
#include "xf86xv.h"
|
#include "xf86xv.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
|
|
||||||
@@ -59,6 +62,8 @@ static void * FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, in
|
|||||||
CARD32 *size, void *closure);
|
CARD32 *size, void *closure);
|
||||||
static void FBDevPointerMoved(int index, int x, int y);
|
static void FBDevPointerMoved(int index, int x, int y);
|
||||||
static Bool FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen);
|
static Bool FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen);
|
||||||
|
static Bool FBDevDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
|
||||||
|
pointer ptr);
|
||||||
|
|
||||||
|
|
||||||
enum { FBDEV_ROTATE_NONE=0, FBDEV_ROTATE_CW=270, FBDEV_ROTATE_UD=180, FBDEV_ROTATE_CCW=90 };
|
enum { FBDEV_ROTATE_NONE=0, FBDEV_ROTATE_CW=270, FBDEV_ROTATE_UD=180, FBDEV_ROTATE_CCW=90 };
|
||||||
@@ -77,14 +82,14 @@ enum { FBDEV_ROTATE_NONE=0, FBDEV_ROTATE_CW=270, FBDEV_ROTATE_UD=180, FBDEV_ROTA
|
|||||||
*/
|
*/
|
||||||
static int pix24bpp = 0;
|
static int pix24bpp = 0;
|
||||||
|
|
||||||
#define VERSION 4000
|
#define FBDEV_VERSION 4000
|
||||||
#define FBDEV_NAME "FBDEV"
|
#define FBDEV_NAME "FBDEV"
|
||||||
#define FBDEV_DRIVER_NAME "fbdev"
|
#define FBDEV_DRIVER_NAME "fbdev"
|
||||||
#define FBDEV_MAJOR_VERSION 0
|
#define FBDEV_MAJOR_VERSION 0
|
||||||
#define FBDEV_MINOR_VERSION 1
|
#define FBDEV_MINOR_VERSION 2
|
||||||
|
|
||||||
DriverRec FBDEV = {
|
_X_EXPORT DriverRec FBDEV = {
|
||||||
VERSION,
|
FBDEV_VERSION,
|
||||||
FBDEV_DRIVER_NAME,
|
FBDEV_DRIVER_NAME,
|
||||||
#if 0
|
#if 0
|
||||||
"driver for linux framebuffer devices",
|
"driver for linux framebuffer devices",
|
||||||
@@ -93,7 +98,8 @@ DriverRec FBDEV = {
|
|||||||
FBDevProbe,
|
FBDevProbe,
|
||||||
FBDevAvailableOptions,
|
FBDevAvailableOptions,
|
||||||
NULL,
|
NULL,
|
||||||
0
|
0,
|
||||||
|
FBDevDriverFunc
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Supported "chipsets" */
|
/* Supported "chipsets" */
|
||||||
@@ -139,7 +145,9 @@ static const char *shadowSymbols[] = {
|
|||||||
"shadowInit",
|
"shadowInit",
|
||||||
"shadowSetup",
|
"shadowSetup",
|
||||||
"shadowUpdatePacked",
|
"shadowUpdatePacked",
|
||||||
|
"shadowUpdatePackedWeak",
|
||||||
"shadowUpdateRotatePacked",
|
"shadowUpdateRotatePacked",
|
||||||
|
"shadowUpdateRotatePackedWeak",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -160,20 +168,23 @@ static const char *fbdevHWSymbols[] = {
|
|||||||
"fbdevHWUnmapVidmem",
|
"fbdevHWUnmapVidmem",
|
||||||
|
|
||||||
/* colormap */
|
/* colormap */
|
||||||
"fbdevHWLoadpalette",
|
"fbdevHWLoadPalette",
|
||||||
|
"fbdevHWLoadPaletteWeak",
|
||||||
|
|
||||||
/* ScrnInfo hooks */
|
/* ScrnInfo hooks */
|
||||||
"fbdevHWAdjustFrame",
|
"fbdevHWAdjustFrameWeak",
|
||||||
"fbdevHWEnterVT",
|
"fbdevHWEnterVTWeak",
|
||||||
"fbdevHWLeaveVT",
|
"fbdevHWLeaveVTWeak",
|
||||||
"fbdevHWModeInit",
|
"fbdevHWModeInit",
|
||||||
"fbdevHWRestore",
|
"fbdevHWRestore",
|
||||||
"fbdevHWSave",
|
"fbdevHWSave",
|
||||||
"fbdevHWSaveScreen",
|
"fbdevHWSaveScreen",
|
||||||
"fbdevHWSwitchMode",
|
"fbdevHWSaveScreenWeak",
|
||||||
"fbdevHWValidMode",
|
"fbdevHWSwitchModeWeak",
|
||||||
|
"fbdevHWValidModeWeak",
|
||||||
|
|
||||||
"fbdevHWDPMSSet",
|
"fbdevHWDPMSSet",
|
||||||
|
"fbdevHWDPMSSetWeak",
|
||||||
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
@@ -188,7 +199,7 @@ static XF86ModuleVersionInfo FBDevVersRec =
|
|||||||
MODULEVENDORSTRING,
|
MODULEVENDORSTRING,
|
||||||
MODINFOSTRING1,
|
MODINFOSTRING1,
|
||||||
MODINFOSTRING2,
|
MODINFOSTRING2,
|
||||||
XF86_VERSION_CURRENT,
|
XORG_VERSION_CURRENT,
|
||||||
FBDEV_MAJOR_VERSION, FBDEV_MINOR_VERSION, 0,
|
FBDEV_MAJOR_VERSION, FBDEV_MINOR_VERSION, 0,
|
||||||
ABI_CLASS_VIDEODRV,
|
ABI_CLASS_VIDEODRV,
|
||||||
ABI_VIDEODRV_VERSION,
|
ABI_VIDEODRV_VERSION,
|
||||||
@@ -196,7 +207,7 @@ static XF86ModuleVersionInfo FBDevVersRec =
|
|||||||
{0,0,0,0}
|
{0,0,0,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
XF86ModuleData fbdevModuleData = { &FBDevVersRec, FBDevSetup, NULL };
|
_X_EXPORT XF86ModuleData fbdevModuleData = { &FBDevVersRec, FBDevSetup, NULL };
|
||||||
|
|
||||||
pointer
|
pointer
|
||||||
FBDevSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
FBDevSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||||
@@ -205,7 +216,7 @@ FBDevSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
|||||||
|
|
||||||
if (!setupDone) {
|
if (!setupDone) {
|
||||||
setupDone = TRUE;
|
setupDone = TRUE;
|
||||||
xf86AddDriver(&FBDEV, module, 0);
|
xf86AddDriver(&FBDEV, module, HaveDriverFuncs);
|
||||||
LoaderRefSymLists(afbSymbols, fbSymbols,
|
LoaderRefSymLists(afbSymbols, fbSymbols,
|
||||||
shadowSymbols, fbdevHWSymbols, NULL);
|
shadowSymbols, fbdevHWSymbols, NULL);
|
||||||
return (pointer)1;
|
return (pointer)1;
|
||||||
@@ -350,17 +361,17 @@ FBDevProbe(DriverPtr drv, int flags)
|
|||||||
if (pScrn) {
|
if (pScrn) {
|
||||||
foundScreen = TRUE;
|
foundScreen = TRUE;
|
||||||
|
|
||||||
pScrn->driverVersion = VERSION;
|
pScrn->driverVersion = FBDEV_VERSION;
|
||||||
pScrn->driverName = FBDEV_DRIVER_NAME;
|
pScrn->driverName = FBDEV_DRIVER_NAME;
|
||||||
pScrn->name = FBDEV_NAME;
|
pScrn->name = FBDEV_NAME;
|
||||||
pScrn->Probe = FBDevProbe;
|
pScrn->Probe = FBDevProbe;
|
||||||
pScrn->PreInit = FBDevPreInit;
|
pScrn->PreInit = FBDevPreInit;
|
||||||
pScrn->ScreenInit = FBDevScreenInit;
|
pScrn->ScreenInit = FBDevScreenInit;
|
||||||
pScrn->SwitchMode = fbdevHWSwitchMode;
|
pScrn->SwitchMode = fbdevHWSwitchModeWeak();
|
||||||
pScrn->AdjustFrame = fbdevHWAdjustFrame;
|
pScrn->AdjustFrame = fbdevHWAdjustFrameWeak();
|
||||||
pScrn->EnterVT = fbdevHWEnterVT;
|
pScrn->EnterVT = fbdevHWEnterVTWeak();
|
||||||
pScrn->LeaveVT = fbdevHWLeaveVT;
|
pScrn->LeaveVT = fbdevHWLeaveVTWeak();
|
||||||
pScrn->ValidMode = fbdevHWValidMode;
|
pScrn->ValidMode = fbdevHWValidModeWeak();
|
||||||
|
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||||
"using %s\n", dev ? dev : "default device");
|
"using %s\n", dev ? dev : "default device");
|
||||||
@@ -379,6 +390,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
|||||||
int default_depth, fbbpp;
|
int default_depth, fbbpp;
|
||||||
const char *mod = NULL, *s;
|
const char *mod = NULL, *s;
|
||||||
const char **syms = NULL;
|
const char **syms = NULL;
|
||||||
|
int type;
|
||||||
|
|
||||||
if (flags & PROBE_DETECT) return FALSE;
|
if (flags & PROBE_DETECT) return FALSE;
|
||||||
|
|
||||||
@@ -410,7 +422,8 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
|||||||
if (!fbdevHWInit(pScrn,NULL,xf86FindOptionValue(fPtr->pEnt->device->options,"fbdev")))
|
if (!fbdevHWInit(pScrn,NULL,xf86FindOptionValue(fPtr->pEnt->device->options,"fbdev")))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
default_depth = fbdevHWGetDepth(pScrn,&fbbpp);
|
default_depth = fbdevHWGetDepth(pScrn,&fbbpp);
|
||||||
if (!xf86SetDepthBpp(pScrn, default_depth, default_depth, fbbpp,0))
|
if (!xf86SetDepthBpp(pScrn, default_depth, default_depth, fbbpp,
|
||||||
|
Support24bppFb | Support32bppFb | SupportConvert32to24 | PreferConvert32to24))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
xf86PrintDepthBpp(pScrn);
|
xf86PrintDepthBpp(pScrn);
|
||||||
|
|
||||||
@@ -431,7 +444,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
|||||||
|
|
||||||
/* We don't currently support DirectColor at > 8bpp */
|
/* We don't currently support DirectColor at > 8bpp */
|
||||||
if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) {
|
if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) {
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual"
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "requested default visual"
|
||||||
" (%s) is not supported at depth %d\n",
|
" (%s) is not supported at depth %d\n",
|
||||||
xf86GetVisualName(pScrn->defaultVisual), pScrn->depth);
|
xf86GetVisualName(pScrn->defaultVisual), pScrn->depth);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -450,8 +463,8 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
|||||||
pScrn->chipset = "fbdev";
|
pScrn->chipset = "fbdev";
|
||||||
pScrn->videoRam = fbdevHWGetVidmem(pScrn);
|
pScrn->videoRam = fbdevHWGetVidmem(pScrn);
|
||||||
|
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Hardware: %s (vidmem: %dk)\n",
|
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "hardware: %s (video memory:"
|
||||||
fbdevHWGetName(pScrn),pScrn->videoRam/1024);
|
" %dkB)\n", fbdevHWGetName(pScrn), pScrn->videoRam/1024);
|
||||||
|
|
||||||
/* handle options */
|
/* handle options */
|
||||||
xf86CollectOptions(pScrn, NULL);
|
xf86CollectOptions(pScrn, NULL);
|
||||||
@@ -472,37 +485,37 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
|||||||
fPtr->shadowFB = TRUE;
|
fPtr->shadowFB = TRUE;
|
||||||
fPtr->rotate = FBDEV_ROTATE_CW;
|
fPtr->rotate = FBDEV_ROTATE_CW;
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||||
"Rotating screen clockwise\n");
|
"rotating screen clockwise\n");
|
||||||
}
|
}
|
||||||
else if(!xf86NameCmp(s, "CCW"))
|
else if(!xf86NameCmp(s, "CCW"))
|
||||||
{
|
{
|
||||||
fPtr->shadowFB = TRUE;
|
fPtr->shadowFB = TRUE;
|
||||||
fPtr->rotate = FBDEV_ROTATE_CCW;
|
fPtr->rotate = FBDEV_ROTATE_CCW;
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||||
"Rotating screen counter clockwise\n");
|
"rotating screen counter-clockwise\n");
|
||||||
}
|
}
|
||||||
else if(!xf86NameCmp(s, "UD"))
|
else if(!xf86NameCmp(s, "UD"))
|
||||||
{
|
{
|
||||||
fPtr->shadowFB = TRUE;
|
fPtr->shadowFB = TRUE;
|
||||||
fPtr->rotate = FBDEV_ROTATE_UD;
|
fPtr->rotate = FBDEV_ROTATE_UD;
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||||
"Rotating screen upside down\n");
|
"rotating screen upside-down\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||||
"\"%s\" is not a valid value for Option \"Rotate\"\n", s);
|
"\"%s\" is not a valid value for Option \"Rotate\"\n", s);
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||||
"Valid options are \"CW\", \"CCW\" or \"UD\"\n");
|
"valid options are \"CW\", \"CCW\" and \"UD\"\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* select video modes */
|
/* select video modes */
|
||||||
|
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Checking Modes against framebuffer device...\n");
|
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "checking modes against framebuffer device...\n");
|
||||||
fbdevHWSetVideoModes(pScrn);
|
fbdevHWSetVideoModes(pScrn);
|
||||||
|
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Checking Modes against monitor...\n");
|
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "checking modes against monitor...\n");
|
||||||
{
|
{
|
||||||
DisplayModePtr mode, first = mode = pScrn->modes;
|
DisplayModePtr mode, first = mode = pScrn->modes;
|
||||||
|
|
||||||
@@ -534,7 +547,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
|||||||
xf86SetDpi(pScrn, 0, 0);
|
xf86SetDpi(pScrn, 0, 0);
|
||||||
|
|
||||||
/* Load bpp-specific modules */
|
/* Load bpp-specific modules */
|
||||||
switch (fbdevHWGetType(pScrn))
|
switch ((type = fbdevHWGetType(pScrn)))
|
||||||
{
|
{
|
||||||
case FBDEVHW_PLANES:
|
case FBDEVHW_PLANES:
|
||||||
mod = "afb";
|
mod = "afb";
|
||||||
@@ -552,30 +565,32 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
"Unsupported bpp: %d", pScrn->bitsPerPixel);
|
"unsupported number of bits per pixel: %d",
|
||||||
|
pScrn->bitsPerPixel);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FBDEVHW_INTERLEAVED_PLANES:
|
case FBDEVHW_INTERLEAVED_PLANES:
|
||||||
/* Not supported yet, don't know what to do with this */
|
/* Not supported yet, don't know what to do with this */
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
"Interleaved Planes are not supported yet by drivers/fbdev.");
|
"interleaved planes are not yet supported by the "
|
||||||
|
"fbdev driver\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case FBDEVHW_TEXT:
|
case FBDEVHW_TEXT:
|
||||||
/* This should never happen ...
|
/* This should never happen ...
|
||||||
* we should check for this much much earlier ... */
|
* we should check for this much much earlier ... */
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
"Text mode is not supprted by drivers/fbdev.\n"
|
"text mode is not supported by the fbdev driver\n");
|
||||||
"Why do you want to run the X in TEXT mode anyway ?");
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case FBDEVHW_VGA_PLANES:
|
case FBDEVHW_VGA_PLANES:
|
||||||
/* Not supported yet */
|
/* Not supported yet */
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
"EGA/VGA Planes are not supprted yet by drivers/fbdev.");
|
"EGA/VGA planes are not yet supported by the fbdev "
|
||||||
|
"driver\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
default:
|
default:
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
"Fbdev type (%d) not supported yet.");
|
"unrecognised fbdev hardware type (%d)\n", type);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (mod && xf86LoadSubModule(pScrn, mod) == NULL) {
|
if (mod && xf86LoadSubModule(pScrn, mod) == NULL) {
|
||||||
@@ -588,7 +603,8 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
|||||||
|
|
||||||
/* Load shadow if needed */
|
/* Load shadow if needed */
|
||||||
if (fPtr->shadowFB) {
|
if (fPtr->shadowFB) {
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using \"Shadow Framebuffer\"\n");
|
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "using shadow"
|
||||||
|
" framebuffer\n");
|
||||||
if (!xf86LoadSubModule(pScrn, "shadow")) {
|
if (!xf86LoadSubModule(pScrn, "shadow")) {
|
||||||
FBDevFreeRec(pScrn);
|
FBDevFreeRec(pScrn);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -608,6 +624,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
VisualPtr visual;
|
VisualPtr visual;
|
||||||
int init_picture = 0;
|
int init_picture = 0;
|
||||||
int ret,flags,width,height;
|
int ret,flags,width,height;
|
||||||
|
int type;
|
||||||
|
|
||||||
TRACE_ENTER("FBDevScreenInit");
|
TRACE_ENTER("FBDevScreenInit");
|
||||||
|
|
||||||
@@ -622,7 +639,8 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (NULL == (fPtr->fbmem = fbdevHWMapVidmem(pScrn))) {
|
if (NULL == (fPtr->fbmem = fbdevHWMapVidmem(pScrn))) {
|
||||||
xf86DrvMsg(scrnIndex,X_ERROR,"Map vid mem failed\n");
|
xf86DrvMsg(scrnIndex,X_ERROR,"mapping of video memory"
|
||||||
|
" failed\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
fPtr->fboff = fbdevHWLinearOffset(pScrn);
|
fPtr->fboff = fbdevHWLinearOffset(pScrn);
|
||||||
@@ -630,7 +648,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
fbdevHWSave(pScrn);
|
fbdevHWSave(pScrn);
|
||||||
|
|
||||||
if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) {
|
if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) {
|
||||||
xf86DrvMsg(scrnIndex,X_ERROR,"Mode init failed\n");
|
xf86DrvMsg(scrnIndex,X_ERROR,"mode initialization failed\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
fbdevHWSaveScreen(pScreen, SCREEN_SAVER_ON);
|
fbdevHWSaveScreen(pScreen, SCREEN_SAVER_ON);
|
||||||
@@ -640,19 +658,23 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
miClearVisualTypes();
|
miClearVisualTypes();
|
||||||
if (pScrn->bitsPerPixel > 8) {
|
if (pScrn->bitsPerPixel > 8) {
|
||||||
if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) {
|
if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) {
|
||||||
xf86DrvMsg(scrnIndex,X_ERROR,"Set visual types failed\n");
|
xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
|
||||||
|
" for %d bits per pixel [1]\n",
|
||||||
|
pScrn->bitsPerPixel);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!miSetVisualTypes(pScrn->depth,
|
if (!miSetVisualTypes(pScrn->depth,
|
||||||
miGetDefaultVisualMask(pScrn->depth),
|
miGetDefaultVisualMask(pScrn->depth),
|
||||||
pScrn->rgbBits, pScrn->defaultVisual)) {
|
pScrn->rgbBits, pScrn->defaultVisual)) {
|
||||||
xf86DrvMsg(scrnIndex,X_ERROR,"Set visual types failed\n");
|
xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
|
||||||
|
" for %d bits per pixel [2]\n",
|
||||||
|
pScrn->bitsPerPixel);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!miSetPixmapDepths()) {
|
if (!miSetPixmapDepths()) {
|
||||||
xf86DrvMsg(scrnIndex,X_ERROR,"Set pixmap depths failed\n");
|
xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -675,7 +697,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
if ((fPtr->shadowmem = shadowAlloc(width, height,
|
if ((fPtr->shadowmem = shadowAlloc(width, height,
|
||||||
pScrn->bitsPerPixel)) == NULL) {
|
pScrn->bitsPerPixel)) == NULL) {
|
||||||
xf86DrvMsg(scrnIndex,X_ERROR,
|
xf86DrvMsg(scrnIndex,X_ERROR,
|
||||||
"Allocation of shadow memory failed\n");
|
"allocation of shadow framebuffer memory failed\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,21 +707,22 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
fPtr->fbstart = fPtr->fbmem + fPtr->fboff;
|
fPtr->fbstart = fPtr->fbmem + fPtr->fboff;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (fbdevHWGetType(pScrn))
|
switch ((type = fbdevHWGetType(pScrn)))
|
||||||
{
|
{
|
||||||
#ifdef USE_AFB
|
#ifdef USE_AFB
|
||||||
case FBDEVHW_PLANES:
|
case FBDEVHW_PLANES:
|
||||||
if (fPtr->rotate)
|
if (fPtr->rotate)
|
||||||
{
|
{
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: Rotate not supported for afb\n");
|
"internal error: rotate not supported for afb\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (fPtr->shadowFB)
|
if (fPtr->shadowFB)
|
||||||
{
|
{
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: Shadow framebuffer not supported for afb\n");
|
"internal error: shadow framebuffer not supported"
|
||||||
|
" for afb\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -720,8 +743,9 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: invalid bpp (%d) in FBDevScreenInit\n",
|
"internal error: invalid number of bits per"
|
||||||
pScrn->bitsPerPixel);
|
" pixel (%d) encountered in"
|
||||||
|
" FBDevScreenInit()\n", pScrn->bitsPerPixel);
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -730,29 +754,29 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
/* This should never happen ...
|
/* This should never happen ...
|
||||||
* we should check for this much much earlier ... */
|
* we should check for this much much earlier ... */
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: Text mode is not supprted by drivers/fbdev.\n"
|
"internal error: interleaved planes are not yet "
|
||||||
"Comment: Why do you want to run the X in TEXT mode anyway ?");
|
"supported by the fbdev driver\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
case FBDEVHW_TEXT:
|
case FBDEVHW_TEXT:
|
||||||
/* This should never happen ...
|
/* This should never happen ...
|
||||||
* we should check for this much much earlier ... */
|
* we should check for this much much earlier ... */
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: Text mode is not supprted by drivers/fbdev.\n"
|
"internal error: text mode is not supported by the "
|
||||||
"Comment: Why do you want to run the X in TEXT mode anyway ?");
|
"fbdev driver\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
case FBDEVHW_VGA_PLANES:
|
case FBDEVHW_VGA_PLANES:
|
||||||
/* Not supported yet */
|
/* Not supported yet */
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: EGA/VGA Planes are not supprted"
|
"internal error: EGA/VGA Planes are not yet "
|
||||||
" yet by drivers/fbdev.");
|
"supported by the fbdev driver\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: fbdev type (%d) unsupported in"
|
"internal error: unrecognised hardware type (%d) "
|
||||||
" FBDevScreenInit\n");
|
"encountered in FBDevScreenInit()\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -777,24 +801,28 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
/* must be after RGB ordering fixed */
|
/* must be after RGB ordering fixed */
|
||||||
if (init_picture && !fbPictureInit(pScreen, NULL, 0))
|
if (init_picture && !fbPictureInit(pScreen, NULL, 0))
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||||
"RENDER extension initialisation failed.\n");
|
"Render extension initialisation failed\n");
|
||||||
|
|
||||||
if (fPtr->shadowFB &&
|
if (fPtr->shadowFB &&
|
||||||
(!shadowSetup(pScreen) || !shadowAdd(pScreen, NULL,
|
(!shadowSetup(pScreen) || !shadowAdd(pScreen, NULL,
|
||||||
fPtr->rotate ? shadowUpdateRotatePacked : shadowUpdatePacked,
|
fPtr->rotate ? shadowUpdateRotatePackedWeak()
|
||||||
|
: shadowUpdatePackedWeak(),
|
||||||
FBDevWindowLinear, fPtr->rotate, NULL)) ) {
|
FBDevWindowLinear, fPtr->rotate, NULL)) ) {
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Shadow framebuffer initialization failed.\n");
|
"shadow framebuffer initialization failed\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fPtr->rotate)
|
if (!fPtr->rotate)
|
||||||
FBDevDGAInit(pScrn, pScreen);
|
FBDevDGAInit(pScrn, pScreen);
|
||||||
else {
|
else {
|
||||||
xf86DrvMsg(scrnIndex, X_INFO, "Rotated display, disabling DGA\n");
|
xf86DrvMsg(scrnIndex, X_INFO, "display rotated; disabling DGA\n");
|
||||||
|
xf86DrvMsg(scrnIndex, X_INFO, "using driver rotation; disabling "
|
||||||
|
"XRandR\n");
|
||||||
|
xf86DisableRandR();
|
||||||
if (pScrn->bitsPerPixel == 24)
|
if (pScrn->bitsPerPixel == 24)
|
||||||
xf86DrvMsg(scrnIndex, X_WARNING, "Rotation might be broken in 24 bpp\n");
|
xf86DrvMsg(scrnIndex, X_WARNING, "rotation might be broken at 24 "
|
||||||
|
"bits per pixel\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
xf86SetBlackWhitePixels(pScreen);
|
xf86SetBlackWhitePixels(pScreen);
|
||||||
@@ -805,52 +833,61 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
|
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
|
||||||
|
|
||||||
/* colormap */
|
/* colormap */
|
||||||
switch (fbdevHWGetType(pScrn))
|
switch ((type = fbdevHWGetType(pScrn)))
|
||||||
{
|
{
|
||||||
/* XXX It would be simpler to use miCreateDefColormap() in all cases. */
|
/* XXX It would be simpler to use miCreateDefColormap() in all cases. */
|
||||||
#ifdef USE_AFB
|
#ifdef USE_AFB
|
||||||
case FBDEVHW_PLANES:
|
case FBDEVHW_PLANES:
|
||||||
if (!afbCreateDefColormap(pScreen))
|
if (!afbCreateDefColormap(pScreen)) {
|
||||||
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
|
"internal error: afbCreateDefColormap "
|
||||||
|
"failed in FBDevScreenInit()\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case FBDEVHW_PACKED_PIXELS:
|
case FBDEVHW_PACKED_PIXELS:
|
||||||
if (!miCreateDefColormap(pScreen))
|
if (!miCreateDefColormap(pScreen)) {
|
||||||
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
|
"internal error: miCreateDefColormap failed "
|
||||||
|
"in FBDevScreenInit()\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case FBDEVHW_INTERLEAVED_PLANES:
|
case FBDEVHW_INTERLEAVED_PLANES:
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: invalid fbdev type (interleaved planes)"
|
"internal error: interleaved planes are not yet "
|
||||||
" in FBDevScreenInit\n");
|
"supported by the fbdev driver\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case FBDEVHW_TEXT:
|
case FBDEVHW_TEXT:
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: invalid fbdev type (text)"
|
"internal error: text mode is not supported by "
|
||||||
" in FBDevScreenInit\n");
|
"the fbdev driver\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case FBDEVHW_VGA_PLANES:
|
case FBDEVHW_VGA_PLANES:
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: invalid fbdev type (ega/vga planes)"
|
"internal error: EGA/VGA planes are not yet "
|
||||||
" in FBDevScreenInit\n");
|
"supported by the fbdev driver\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
default:
|
default:
|
||||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||||
"Internal error: invalid fbdev type (%d) in FBDevScreenInit\n");
|
"internal error: unrecognised fbdev hardware type "
|
||||||
|
"(%d) encountered in FBDevScreenInit()\n", type);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
flags = CMAP_PALETTED_TRUECOLOR;
|
flags = CMAP_PALETTED_TRUECOLOR;
|
||||||
if(!xf86HandleColormaps(pScreen, 256, 8, fbdevHWLoadPalette, NULL, flags))
|
if(!xf86HandleColormaps(pScreen, 256, 8, fbdevHWLoadPaletteWeak(),
|
||||||
|
NULL, flags))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
xf86DPMSInit(pScreen, fbdevHWDPMSSet, 0);
|
xf86DPMSInit(pScreen, fbdevHWDPMSSetWeak(), 0);
|
||||||
|
|
||||||
pScreen->SaveScreen = fbdevHWSaveScreen;
|
pScreen->SaveScreen = fbdevHWSaveScreenWeak();
|
||||||
|
|
||||||
/* Wrap the current CloseScreen function */
|
/* Wrap the current CloseScreen function */
|
||||||
fPtr->CloseScreen = pScreen->CloseScreen;
|
fPtr->CloseScreen = pScreen->CloseScreen;
|
||||||
pScreen->CloseScreen = FBDevCloseScreen;
|
pScreen->CloseScreen = FBDevCloseScreen;
|
||||||
|
|
||||||
#ifdef XvExtension
|
|
||||||
{
|
{
|
||||||
XF86VideoAdaptorPtr *ptr;
|
XF86VideoAdaptorPtr *ptr;
|
||||||
|
|
||||||
@@ -859,7 +896,6 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||||||
xf86XVScreenInit(pScreen,ptr,n);
|
xf86XVScreenInit(pScreen,ptr,n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
TRACE_EXIT("FBDevScreenInit");
|
TRACE_EXIT("FBDevScreenInit");
|
||||||
|
|
||||||
@@ -1092,3 +1128,18 @@ FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
|
|||||||
return (DGAInit(pScreen, &FBDevDGAFunctions,
|
return (DGAInit(pScreen, &FBDevDGAFunctions,
|
||||||
fPtr->pDGAMode, fPtr->nDGAMode));
|
fPtr->pDGAMode, fPtr->nDGAMode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Bool
|
||||||
|
FBDevDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr)
|
||||||
|
{
|
||||||
|
xorgHWFlags *flag;
|
||||||
|
|
||||||
|
switch (op) {
|
||||||
|
case GET_REQUIRED_HW_INTERFACES:
|
||||||
|
flag = (CARD32*)ptr;
|
||||||
|
(*flag) = 0;
|
||||||
|
return TRUE;
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user