mirror of
https://github.com/X11Libre/xf86-video-fbdev.git
synced 2026-03-24 17:45:26 +00:00
Compare commits
4 Commits
xf86-video
...
XPRINT_BEG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f361e1c61 | ||
|
|
010b0aa643 | ||
|
|
b058394c8c | ||
|
|
bacb9bacd1 |
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
|
||||
12
COPYING
12
COPYING
@@ -1,12 +0,0 @@
|
||||
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
|
||||
66
ChangeLog
66
ChangeLog
@@ -1,66 +0,0 @@
|
||||
2006-05-19 Adam Jackson <ajax@freedesktop.org>
|
||||
|
||||
* configure.ac:
|
||||
* src/fbdev.c:
|
||||
Bump to 0.3.0
|
||||
|
||||
2006-05-18 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* src/fbdev.c: (FBDevShadowInit), (FBDevScreenInit),
|
||||
(FBDevCloseScreen):
|
||||
Fix ShadowFB support to work with recent miext/shadow changes from
|
||||
bug #5460 (Kevin Martin), and apply fix for miext/shadow crasher
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=6940 (Kristian
|
||||
Hoegsberg).
|
||||
|
||||
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
22
Makefile.am
@@ -1,22 +0,0 @@
|
||||
# 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
12
autogen.sh
@@ -1,12 +0,0 @@
|
||||
#! /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
77
configure.ac
@@ -1,77 +0,0 @@
|
||||
# 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.3.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
|
||||
])
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,59 +0,0 @@
|
||||
# $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) < $< > $@
|
||||
@@ -60,4 +60,4 @@ Enable rotation of the display. The supported values are "CW" (clockwise,
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__),
|
||||
X(__miscmansuffix__), fbdevhw(__drivermansuffix__)
|
||||
.SH AUTHORS
|
||||
Authors include: Gerd Knorr, Michel Dänzer, Geert Uytterhoeven
|
||||
Authors include: Gerd Knorr, Michel Dänzer, Geert Uytterhoeven
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.la
|
||||
*.lo
|
||||
@@ -1,32 +0,0 @@
|
||||
# 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
|
||||
247
src/fbdev.c
247
src/fbdev.c
@@ -2,18 +2,13 @@
|
||||
|
||||
/*
|
||||
* 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 */
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86_ansic.h"
|
||||
|
||||
#include "mipointer.h"
|
||||
#include "mibstore.h"
|
||||
@@ -62,8 +57,6 @@ static void * FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, in
|
||||
CARD32 *size, void *closure);
|
||||
static void FBDevPointerMoved(int index, int x, int y);
|
||||
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 };
|
||||
@@ -82,14 +75,14 @@ enum { FBDEV_ROTATE_NONE=0, FBDEV_ROTATE_CW=270, FBDEV_ROTATE_UD=180, FBDEV_ROTA
|
||||
*/
|
||||
static int pix24bpp = 0;
|
||||
|
||||
#define FBDEV_VERSION 4000
|
||||
#define VERSION 4000
|
||||
#define FBDEV_NAME "FBDEV"
|
||||
#define FBDEV_DRIVER_NAME "fbdev"
|
||||
#define FBDEV_MAJOR_VERSION 0
|
||||
#define FBDEV_MINOR_VERSION 3
|
||||
#define FBDEV_MINOR_VERSION 1
|
||||
|
||||
_X_EXPORT DriverRec FBDEV = {
|
||||
FBDEV_VERSION,
|
||||
DriverRec FBDEV = {
|
||||
VERSION,
|
||||
FBDEV_DRIVER_NAME,
|
||||
#if 0
|
||||
"driver for linux framebuffer devices",
|
||||
@@ -98,8 +91,7 @@ _X_EXPORT DriverRec FBDEV = {
|
||||
FBDevProbe,
|
||||
FBDevAvailableOptions,
|
||||
NULL,
|
||||
0,
|
||||
FBDevDriverFunc
|
||||
0
|
||||
};
|
||||
|
||||
/* Supported "chipsets" */
|
||||
@@ -141,12 +133,11 @@ static const char *fbSymbols[] = {
|
||||
|
||||
static const char *shadowSymbols[] = {
|
||||
"shadowAdd",
|
||||
"shadowAlloc",
|
||||
"shadowInit",
|
||||
"shadowSetup",
|
||||
"shadowUpdatePacked",
|
||||
"shadowUpdatePackedWeak",
|
||||
"shadowUpdateRotatePacked",
|
||||
"shadowUpdateRotatePackedWeak",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -167,23 +158,20 @@ static const char *fbdevHWSymbols[] = {
|
||||
"fbdevHWUnmapVidmem",
|
||||
|
||||
/* colormap */
|
||||
"fbdevHWLoadPalette",
|
||||
"fbdevHWLoadPaletteWeak",
|
||||
"fbdevHWLoadpalette",
|
||||
|
||||
/* ScrnInfo hooks */
|
||||
"fbdevHWAdjustFrameWeak",
|
||||
"fbdevHWEnterVTWeak",
|
||||
"fbdevHWLeaveVTWeak",
|
||||
"fbdevHWAdjustFrame",
|
||||
"fbdevHWEnterVT",
|
||||
"fbdevHWLeaveVT",
|
||||
"fbdevHWModeInit",
|
||||
"fbdevHWRestore",
|
||||
"fbdevHWSave",
|
||||
"fbdevHWSaveScreen",
|
||||
"fbdevHWSaveScreenWeak",
|
||||
"fbdevHWSwitchModeWeak",
|
||||
"fbdevHWValidModeWeak",
|
||||
"fbdevHWSwitchMode",
|
||||
"fbdevHWValidMode",
|
||||
|
||||
"fbdevHWDPMSSet",
|
||||
"fbdevHWDPMSSetWeak",
|
||||
|
||||
NULL
|
||||
};
|
||||
@@ -206,7 +194,7 @@ static XF86ModuleVersionInfo FBDevVersRec =
|
||||
{0,0,0,0}
|
||||
};
|
||||
|
||||
_X_EXPORT XF86ModuleData fbdevModuleData = { &FBDevVersRec, FBDevSetup, NULL };
|
||||
XF86ModuleData fbdevModuleData = { &FBDevVersRec, FBDevSetup, NULL };
|
||||
|
||||
pointer
|
||||
FBDevSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||
@@ -215,7 +203,7 @@ FBDevSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||
|
||||
if (!setupDone) {
|
||||
setupDone = TRUE;
|
||||
xf86AddDriver(&FBDEV, module, HaveDriverFuncs);
|
||||
xf86AddDriver(&FBDEV, module, 0);
|
||||
LoaderRefSymLists(afbSymbols, fbSymbols,
|
||||
shadowSymbols, fbdevHWSymbols, NULL);
|
||||
return (pointer)1;
|
||||
@@ -235,6 +223,7 @@ typedef struct {
|
||||
unsigned char* fbmem;
|
||||
int fboff;
|
||||
int lineLength;
|
||||
unsigned char* shadowmem;
|
||||
int rotate;
|
||||
Bool shadowFB;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
@@ -359,17 +348,17 @@ FBDevProbe(DriverPtr drv, int flags)
|
||||
if (pScrn) {
|
||||
foundScreen = TRUE;
|
||||
|
||||
pScrn->driverVersion = FBDEV_VERSION;
|
||||
pScrn->driverVersion = 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();
|
||||
pScrn->SwitchMode = fbdevHWSwitchMode;
|
||||
pScrn->AdjustFrame = fbdevHWAdjustFrame;
|
||||
pScrn->EnterVT = fbdevHWEnterVT;
|
||||
pScrn->LeaveVT = fbdevHWLeaveVT;
|
||||
pScrn->ValidMode = fbdevHWValidMode;
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"using %s\n", dev ? dev : "default device");
|
||||
@@ -442,7 +431,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
/* We don't currently support DirectColor at > 8bpp */
|
||||
if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "requested default visual"
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual"
|
||||
" (%s) is not supported at depth %d\n",
|
||||
xf86GetVisualName(pScrn->defaultVisual), pScrn->depth);
|
||||
return FALSE;
|
||||
@@ -461,8 +450,8 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pScrn->chipset = "fbdev";
|
||||
pScrn->videoRam = fbdevHWGetVidmem(pScrn);
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "hardware: %s (video memory:"
|
||||
" %dkB)\n", fbdevHWGetName(pScrn), pScrn->videoRam/1024);
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Hardware: %s (vidmem: %dk)\n",
|
||||
fbdevHWGetName(pScrn),pScrn->videoRam/1024);
|
||||
|
||||
/* handle options */
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
@@ -483,37 +472,37 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
fPtr->shadowFB = TRUE;
|
||||
fPtr->rotate = FBDEV_ROTATE_CW;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"rotating screen clockwise\n");
|
||||
"Rotating screen clockwise\n");
|
||||
}
|
||||
else if(!xf86NameCmp(s, "CCW"))
|
||||
{
|
||||
fPtr->shadowFB = TRUE;
|
||||
fPtr->rotate = FBDEV_ROTATE_CCW;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"rotating screen counter-clockwise\n");
|
||||
"Rotating screen counter clockwise\n");
|
||||
}
|
||||
else if(!xf86NameCmp(s, "UD"))
|
||||
{
|
||||
fPtr->shadowFB = TRUE;
|
||||
fPtr->rotate = FBDEV_ROTATE_UD;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"rotating screen upside-down\n");
|
||||
"Rotating screen upside down\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"\"%s\" is not a valid value for Option \"Rotate\"\n", s);
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"valid options are \"CW\", \"CCW\" and \"UD\"\n");
|
||||
"Valid options are \"CW\", \"CCW\" or \"UD\"\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* 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);
|
||||
|
||||
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;
|
||||
|
||||
@@ -563,32 +552,30 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
break;
|
||||
default:
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"unsupported number of bits per pixel: %d",
|
||||
pScrn->bitsPerPixel);
|
||||
"Unsupported bpp: %d", pScrn->bitsPerPixel);
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
case FBDEVHW_INTERLEAVED_PLANES:
|
||||
/* Not supported yet, don't know what to do with this */
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"interleaved planes are not yet supported by the "
|
||||
"fbdev driver\n");
|
||||
"Interleaved Planes are not supported yet by drivers/fbdev.");
|
||||
return FALSE;
|
||||
case FBDEVHW_TEXT:
|
||||
/* This should never happen ...
|
||||
* we should check for this much much earlier ... */
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"text mode is not supported by the fbdev driver\n");
|
||||
"Text mode is not supprted by drivers/fbdev.\n"
|
||||
"Why do you want to run the X in TEXT mode anyway ?");
|
||||
return FALSE;
|
||||
case FBDEVHW_VGA_PLANES:
|
||||
/* Not supported yet */
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"EGA/VGA planes are not yet supported by the fbdev "
|
||||
"driver\n");
|
||||
"EGA/VGA Planes are not supprted yet by drivers/fbdev.");
|
||||
return FALSE;
|
||||
default:
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"unrecognised fbdev hardware type (%d)\n", type);
|
||||
"Fbdev type (%d) not supported yet.", type);
|
||||
return FALSE;
|
||||
}
|
||||
if (mod && xf86LoadSubModule(pScrn, mod) == NULL) {
|
||||
@@ -601,8 +588,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
/* Load shadow if needed */
|
||||
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")) {
|
||||
FBDevFreeRec(pScrn);
|
||||
return FALSE;
|
||||
@@ -614,36 +600,6 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
FBDevShadowInit(ScreenPtr pScreen, FBDevPtr fPtr)
|
||||
{
|
||||
PixmapPtr pPixmap;
|
||||
ShadowUpdateProc update;
|
||||
ShadowWindowProc window;
|
||||
|
||||
pPixmap = pScreen->CreatePixmap(pScreen, pScreen->width, pScreen->height,
|
||||
pScreen->rootDepth);
|
||||
if (!pPixmap)
|
||||
return FALSE;
|
||||
|
||||
if (!shadowSetup(pScreen)) {
|
||||
pScreen->DestroyPixmap(pPixmap);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
update = fPtr->rotate ? shadowUpdateRotatePackedWeak()
|
||||
: shadowUpdatePackedWeak();
|
||||
|
||||
if (!shadowAdd(pScreen, pPixmap, update, FBDevWindowLinear,
|
||||
fPtr->rotate, NULL)) {
|
||||
pScreen->DestroyPixmap(pPixmap);
|
||||
return FALSE;
|
||||
} else {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static Bool
|
||||
FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
{
|
||||
@@ -667,8 +623,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"
|
||||
" failed\n");
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"Map vid mem failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
fPtr->fboff = fbdevHWLinearOffset(pScrn);
|
||||
@@ -676,7 +631,7 @@ 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(scrnIndex,X_ERROR,"Mode init failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
fbdevHWSaveScreen(pScreen, SCREEN_SAVER_ON);
|
||||
@@ -686,23 +641,19 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
miClearVisualTypes();
|
||||
if (pScrn->bitsPerPixel > 8) {
|
||||
if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
|
||||
" for %d bits per pixel [1]\n",
|
||||
pScrn->bitsPerPixel);
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"Set visual types failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
if (!miSetVisualTypes(pScrn->depth,
|
||||
miGetDefaultVisualMask(pScrn->depth),
|
||||
pScrn->rgbBits, pScrn->defaultVisual)) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
|
||||
" for %d bits per pixel [2]\n",
|
||||
pScrn->bitsPerPixel);
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"Set visual types failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (!miSetPixmapDepths()) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"Set pixmap depths failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -720,7 +671,20 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
pScrn->PointerMoved = FBDevPointerMoved;
|
||||
}
|
||||
|
||||
fPtr->fbstart = fPtr->fbmem + fPtr->fboff;
|
||||
/* shadowfb */
|
||||
if (fPtr->shadowFB) {
|
||||
if ((fPtr->shadowmem = shadowAlloc(width, height,
|
||||
pScrn->bitsPerPixel)) == NULL) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,
|
||||
"Allocation of shadow memory failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fPtr->fbstart = fPtr->shadowmem;
|
||||
} else {
|
||||
fPtr->shadowmem = NULL;
|
||||
fPtr->fbstart = fPtr->fbmem + fPtr->fboff;
|
||||
}
|
||||
|
||||
switch ((type = fbdevHWGetType(pScrn)))
|
||||
{
|
||||
@@ -729,15 +693,14 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
if (fPtr->rotate)
|
||||
{
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: rotate not supported for afb\n");
|
||||
"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");
|
||||
"Internal error: Shadow framebuffer not supported for afb\n");
|
||||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -758,9 +721,8 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
break;
|
||||
default:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: invalid number of bits per"
|
||||
" pixel (%d) encountered in"
|
||||
" FBDevScreenInit()\n", pScrn->bitsPerPixel);
|
||||
"Internal error: invalid bpp (%d) in FBDevScreenInit\n",
|
||||
pScrn->bitsPerPixel);
|
||||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -769,29 +731,29 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
/* This should never happen ...
|
||||
* we should check for this much much earlier ... */
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: interleaved planes are not yet "
|
||||
"supported by the fbdev driver\n");
|
||||
"Internal error: Text mode is not supprted by drivers/fbdev.\n"
|
||||
"Comment: Why do you want to run the X in TEXT mode anyway ?");
|
||||
ret = FALSE;
|
||||
break;
|
||||
case FBDEVHW_TEXT:
|
||||
/* This should never happen ...
|
||||
* we should check for this much much earlier ... */
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: text mode is not supported by the "
|
||||
"fbdev driver\n");
|
||||
"Internal error: Text mode is not supprted by drivers/fbdev.\n"
|
||||
"Comment: Why do you want to run the X in TEXT mode anyway ?");
|
||||
ret = FALSE;
|
||||
break;
|
||||
case FBDEVHW_VGA_PLANES:
|
||||
/* Not supported yet */
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: EGA/VGA Planes are not yet "
|
||||
"supported by the fbdev driver\n");
|
||||
"Internal error: EGA/VGA Planes are not supprted"
|
||||
" yet by drivers/fbdev.");
|
||||
ret = FALSE;
|
||||
break;
|
||||
default:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: unrecognised hardware type (%d) "
|
||||
"encountered in FBDevScreenInit()\n");
|
||||
"Internal error: fbdev type (%d) unsupported in"
|
||||
" FBDevScreenInit\n", type);
|
||||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -816,24 +778,25 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
/* must be after RGB ordering fixed */
|
||||
if (init_picture && !fbPictureInit(pScreen, NULL, 0))
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
"Render extension initialisation failed\n");
|
||||
"RENDER extension initialisation failed.\n");
|
||||
|
||||
if (fPtr->shadowFB && !FBDevShadowInit(pScreen, fPtr)) {
|
||||
if (fPtr->shadowFB &&
|
||||
(!shadowSetup(pScreen) || !shadowAdd(pScreen, NULL,
|
||||
fPtr->rotate ? shadowUpdateRotatePacked : shadowUpdatePacked,
|
||||
FBDevWindowLinear, fPtr->rotate, NULL)) ) {
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"shadow framebuffer initialization failed\n");
|
||||
"Shadow framebuffer initialization failed.\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!fPtr->rotate)
|
||||
FBDevDGAInit(pScrn, pScreen);
|
||||
else {
|
||||
xf86DrvMsg(scrnIndex, X_INFO, "display rotated; disabling DGA\n");
|
||||
xf86DrvMsg(scrnIndex, X_INFO, "using driver rotation; disabling "
|
||||
"XRandR\n");
|
||||
xf86DrvMsg(scrnIndex, X_INFO, "Rotated display, disabling DGA\n");
|
||||
xf86DrvMsg(scrnIndex, X_INFO, "Enabling Driver rotation, disabling RandR\n");
|
||||
xf86DisableRandR();
|
||||
if (pScrn->bitsPerPixel == 24)
|
||||
xf86DrvMsg(scrnIndex, X_WARNING, "rotation might be broken at 24 "
|
||||
"bits per pixel\n");
|
||||
xf86DrvMsg(scrnIndex, X_WARNING, "Rotation might be broken in 24 bpp\n");
|
||||
}
|
||||
|
||||
xf86SetBlackWhitePixels(pScreen);
|
||||
@@ -849,51 +812,42 @@ FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
/* 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");
|
||||
if (!afbCreateDefColormap(pScreen))
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case FBDEVHW_PACKED_PIXELS:
|
||||
if (!miCreateDefColormap(pScreen)) {
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: miCreateDefColormap failed "
|
||||
"in FBDevScreenInit()\n");
|
||||
if (!miCreateDefColormap(pScreen))
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
case FBDEVHW_INTERLEAVED_PLANES:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: interleaved planes are not yet "
|
||||
"supported by the fbdev driver\n");
|
||||
"Internal error: invalid fbdev type (interleaved planes)"
|
||||
" in FBDevScreenInit\n");
|
||||
return FALSE;
|
||||
case FBDEVHW_TEXT:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: text mode is not supported by "
|
||||
"the fbdev driver\n");
|
||||
"Internal error: invalid fbdev type (text)"
|
||||
" in FBDevScreenInit\n");
|
||||
return FALSE;
|
||||
case FBDEVHW_VGA_PLANES:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: EGA/VGA planes are not yet "
|
||||
"supported by the fbdev driver\n");
|
||||
"Internal error: invalid fbdev type (ega/vga planes)"
|
||||
" in FBDevScreenInit\n");
|
||||
return FALSE;
|
||||
default:
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"internal error: unrecognised fbdev hardware type "
|
||||
"(%d) encountered in FBDevScreenInit()\n", type);
|
||||
"Internal error: invalid fbdev type (%d) in FBDevScreenInit\n",
|
||||
type);
|
||||
return FALSE;
|
||||
}
|
||||
flags = CMAP_PALETTED_TRUECOLOR;
|
||||
if(!xf86HandleColormaps(pScreen, 256, 8, fbdevHWLoadPaletteWeak(),
|
||||
NULL, flags))
|
||||
if(!xf86HandleColormaps(pScreen, 256, 8, fbdevHWLoadPalette, NULL, flags))
|
||||
return FALSE;
|
||||
|
||||
xf86DPMSInit(pScreen, fbdevHWDPMSSetWeak(), 0);
|
||||
xf86DPMSInit(pScreen, fbdevHWDPMSSet, 0);
|
||||
|
||||
pScreen->SaveScreen = fbdevHWSaveScreenWeak();
|
||||
pScreen->SaveScreen = fbdevHWSaveScreen;
|
||||
|
||||
/* Wrap the current CloseScreen function */
|
||||
fPtr->CloseScreen = pScreen->CloseScreen;
|
||||
@@ -921,6 +875,8 @@ FBDevCloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||
|
||||
fbdevHWRestore(pScrn);
|
||||
fbdevHWUnmapVidmem(pScrn);
|
||||
if (fPtr->shadowmem)
|
||||
xfree(fPtr->shadowmem);
|
||||
if (fPtr->pDGAMode) {
|
||||
xfree(fPtr->pDGAMode);
|
||||
fPtr->pDGAMode = NULL;
|
||||
@@ -1137,18 +1093,3 @@ FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
|
||||
return (DGAInit(pScreen, &FBDevDGAFunctions,
|
||||
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