Compare commits

...

19 Commits

Author SHA1 Message Date
Alan Coopersmith
7648873250 Strip trailing whitespace from source files
Performed with: `git ls-files | xargs perl -i -p -e 's{[ \t]+$}{}'`

`git diff -w` & `git diff -b` show no diffs from this change

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/merge_requests/12>
2025-08-12 17:42:09 -07:00
Alan Coopersmith
bd09098198 Improve man page formatting
More closely follow common style as described on
https://man7.org/linux/man-pages/man7/man-pages.7.html

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/merge_requests/11>
2025-04-22 17:45:52 -07:00
Bjarni Ingi Gislason
7dd8150830 fbdev.4: Some editorial changes for this man page [Debian bug #1095447]
Originally from https://bugs.debian.org/1095447

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/merge_requests/11>
2025-04-17 17:27:11 -07:00
Matt Turner
0ead445440 xf86-video-fbdev 0.5.1
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/merge_requests/9>
2024-11-08 10:19:03 -05:00
Enrico Weigelt, metux IT consult
c8d9f3be7e drop compat with ancient xservers
We're relying on >= 1.18 now, so no compat with older ones needed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/merge_requests/8>
2024-05-28 14:38:46 +02:00
Alan Coopersmith
ae894fe112 Raise minimum supported Xserver version to 1.18 (ABI_VIDEODRV_VERSION 20.0)
Already effectively required by use of XNFcallocarray() introduced in
xorg/xserver@b96dc999 - xserver-1.18.0, released in Nov. 2015.

Allows dropping remnants of code for ISA and pre-pciaccess X servers

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/merge_requests/7>
2024-05-14 11:16:37 -07:00
Enrico Weigelt, metux IT consult
dc48c20ceb use XNFcallocarray() instead of xnfcalloc macro
xnfcalloc is just an alias for XNFcallocarray() that doesn't seem to serve
any practical purpose, so it can go away once all drivers stopped using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/merge_requests/5>
2024-05-08 15:46:23 +02:00
Alan Coopersmith
7bccdf4373 Fix warning: unused variable ‘scrnIdx’ [-Wunused-variable]
fbdev.c: In function ‘FBDevDGASetMode’:
fbdev.c:1145:9: warning: unused variable ‘scrnIdx’ [-Wunused-variable]
 1145 |     int scrnIdx = pScrn->pScreen->myNum;
      |         ^~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-15 10:08:31 -08:00
Alan Coopersmith
112b6c1153 Fix warning: statement with no effect [-Wunused-value]
fbdev.c: In function ‘FBDevProbe’:
fbdev.c:355:21: warning: statement with no effect [-Wunused-value]
  355 |                     0;
      |                     ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-15 10:08:23 -08:00
Alan Coopersmith
89728ce1d6 Add X.Org's standard C warning flags to AM_CFLAGS
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-07 09:19:53 -08:00
Alan Coopersmith
554d6fda21 configure: Use LT_INIT from libtool 2 instead of deprecated AC_PROG_LIBTOOL
AC_PROG_LIBTOOL was replaced by LT_INIT in libtool 2 in 2008,
so it's time to rely on it.

Clears autoconf warnings:

configure.ac:44: warning: The macro 'AC_PROG_LIBTOOL' is obsolete.
configure.ac:44: You should run autoupdate.
aclocal.m4:3515: AC_PROG_LIBTOOL is expanded from...
configure.ac:44: the top level

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-07 09:17:53 -08:00
Alan Coopersmith
7f445dbd5a gitlab CI: ensure libtool is installed in build container
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-01 13:10:19 -07:00
Alan Coopersmith
a8aa1c97f9 gitlab CI: stop requiring Signed-off-by in commits
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-09 12:06:56 -08:00
Alan Coopersmith
6ef9644156 gitlab CI: add a basic build test
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-22 10:26:32 -08:00
Alan Coopersmith
cf1875209c Fix spelling/wording issues
Found by using:
    codespell --builtin clear,rare,usage,informal,code,names

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-22 10:25:44 -08:00
Alan Coopersmith
2850cd86d1 Build xz tarballs instead of bzip2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-22 10:25:12 -08:00
Tuomo Rinne
4730f13b92 Fix build error when building with xserver built using meson 2019-01-14 22:33:42 +00:00
Alan Coopersmith
4865f92f74 Update configure.ac bug URL for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-25 13:57:38 -08:00
Alan Coopersmith
f676c9def1 Update README for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-18 12:35:19 -08:00
11 changed files with 198 additions and 223 deletions

4
.gitignore vendored
View File

@@ -71,8 +71,8 @@ core
*.tar.bz2
*.tar.gz
#
# Add & Override patterns for xf86-video-fbdev
# Add & Override patterns for xf86-video-fbdev
#
# Edit the following section as needed
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
#

98
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,98 @@
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
#
# This CI uses the freedesktop.org ci-templates.
# Please see the ci-templates documentation for details:
# https://freedesktop.pages.freedesktop.org/ci-templates/
.templates_sha: &template_sha 25e8e9f020880aa35fffe3d6b259b933f0f9449f # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include:
# Arch container builder template
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/arch.yml'
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/ci-fairy.yml'
- template: Security/SAST.gitlab-ci.yml
stages:
- prep # prep work like rebuilding the container images if there is a change
- build # for actually building and testing things in a container
- test
- deploy
variables:
FDO_UPSTREAM_REPO: 'xorg/driver/xf86-video-fbdev'
# The tag should be updated each time the list of packages is updated.
# Changing a tag forces the associated image to be rebuilt.
# Note: the tag has no meaning, we use a date format purely for readability
FDO_DISTRIBUTION_TAG: '2023-10-01.0'
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool make xorg-util-macros xorgproto xorg-server-devel pixman'
#
# Verify that commit messages are as expected
#
check-commits:
extends:
- .fdo.ci-fairy
stage: prep
script:
- ci-fairy check-commits --junit-xml=results.xml
except:
- master@xorg/driver/xf86-video-fbdev
variables:
GIT_DEPTH: 100
artifacts:
reports:
junit: results.xml
#
# Verify that the merge request has the allow-collaboration checkbox ticked
#
check-merge-request:
extends:
- .fdo.ci-fairy
stage: deploy
script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts:
when: on_failure
reports:
junit: results.xml
allow_failure: true
#
# Build a container with the given tag and the packages pre-installed.
# This only happens if the tag changes, otherwise the existing image is
# re-used.
#
container-prep:
extends:
- .fdo.container-build@arch
stage: prep
variables:
GIT_STRATEGY: none
#
# The default build, runs on the image built above.
#
build:
stage: build
extends:
- .fdo.distribution-image@arch
script:
- autoreconf -ivf
- mkdir _builddir
- pushd _builddir > /dev/null
- ../configure --disable-silent-rules
- make
- make check
- make distcheck
- popd > /dev/null

View File

@@ -30,3 +30,5 @@ ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL
EXTRA_DIST = README.md

20
README
View File

@@ -1,20 +0,0 @@
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

18
README.md Normal file
View File

@@ -0,0 +1,18 @@
xf86-video-fbdev - video driver for framebuffer device
------------------------------------------------------
All questions regarding this software should be directed at the
Xorg mailing list:
https://lists.x.org/mailman/listinfo/xorg
The primary development code repository can be found at:
https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev
Please submit bug reports and requests to merge patches there.
For patch submission instructions, see:
https://www.x.org/wiki/Development/Documentation/SubmittingPatches

View File

@@ -23,15 +23,15 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-fbdev],
[0.5.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[0.5.1],
[https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/issues],
[xf86-video-fbdev])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR(.)
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_INIT_AUTOMAKE([foreign dist-xz])
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
@@ -40,8 +40,7 @@ XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
# Initialize libtool
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
LT_INIT([disable-static])
AH_TOP([#include "xorg-server.h"])
@@ -61,15 +60,7 @@ XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
XORG_DRIVER_CHECK_EXT(XV, videoproto)
# Obtain compiler/linker options for the driver dependencies
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES])
save_CFLAGS="$CFLAGS"
CFLAGS="$XORG_CFLAGS"
AC_CHECK_DECL(xf86ConfigIsaEntity,
[AC_DEFINE(HAVE_ISA, 1, [Have ISA support])],
[],
[#include "xf86.h"])
CFLAGS="$save_CFLAGS"
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.18 xproto fontsproto $REQUIRED_MODULES])
AM_CONDITIONAL(PCIACCESS, [test "x$PCIACCESS" = xyes])
if test "x$PCIACCESS" = xyes; then

View File

@@ -20,7 +20,7 @@
# 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)

View File

@@ -14,49 +14,64 @@ fbdev \- video driver for framebuffer device
.fi
.SH DESCRIPTION
.B fbdev
is an __xservername__ driver for framebuffer devices. This is a non-accelerated
driver, the following framebuffer depths are supported: 8, 15, 16, 24.
All visual types are supported for depth 8, and TrueColor visual is
supported for the other depths. Multi-head configurations are supported.
is an
.B __xservername__
driver for framebuffer devices.
This is a non-accelerated driver,
the following framebuffer depths are supported: 8, 15, 16, 24.
All visual types are supported for depth 8,
and TrueColor visual is supported for the other depths.
Multi-head configurations are supported.
.SH SUPPORTED HARDWARE
The
The
.B fbdev
driver supports all hardware where a framebuffer driver is available.
fbdev uses the os-specific submodule fbdevhw(__drivermansuffix__) to talk
to the kernel
device driver. Currently a fbdevhw module is available for linux.
fbdev uses the os-specific submodule
.BR fbdevhw (__drivermansuffix__)
to talk to the kernel device driver.
Currently a fbdevhw module is available for Linux.
.SH CONFIGURATION DETAILS
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to
this driver.
Please refer to
.BR __xconfigfile__ (__filemansuffix__)
for general configuration details.
This section only covers configuration details specific to this driver.
.PP
For this driver it is not required to specify modes in the screen
section of the config file. The
For this driver it is not required to specify modes
in the screen section of the config file.
The
.B fbdev
driver can pick up the currently used video mode from the framebuffer
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.
For PCI boards you might have to add a BusID line to the Device section.
See above for a sample line.
.PP
The following driver
The following driver
.B Options
are supported:
.TP
.BI "Option \*qfbdev\*q \*q" string \*q
The framebuffer device to use. Default: /dev/fb0.
The framebuffer device to use.
Default: /dev/fb0.
.TP
.BI "Option \*qShadowFB\*q \*q" boolean \*q
Enable or disable use of the shadow framebuffer layer. Mandatory for 24bpp
framebuffers on newer servers. Default: on.
Enable or disable use of the shadow framebuffer layer.
Mandatory for 24bpp framebuffers on newer servers.
Default: on.
.TP
.BI "Option \*qRotate\*q \*q" string \*q
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. Disabled for 24bpp
framebuffers. Default: off.
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.
Disabled for 24bpp framebuffers.
Default: off.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__),
X(__miscmansuffix__), fbdevhw(__drivermansuffix__)
.BR __xservername__ (__appmansuffix__),
.BR __xconfigfile__ (__filemansuffix__),
.BR Xserver (__appmansuffix__),
.BR X (__miscmansuffix__),
.BR fbdevhw (__drivermansuffix__)
.SH AUTHORS
Authors include: Gerd Knorr, Michel D\(:anzer, Geert Uytterhoeven

View File

@@ -23,11 +23,10 @@
# -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@
AM_CFLAGS = $(BASE_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 = \
compat-api.h \
fbdev.c

View File

@@ -1,101 +0,0 @@
/*
* 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

View File

@@ -23,17 +23,10 @@
/* for visuals */
#include "fb.h"
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
#include "xf86Resources.h"
#include "xf86RAC.h"
#endif
#include "fbdevhw.h"
#include "xf86xv.h"
#include "compat-api.h"
#ifdef XSERVER_LIBPCIACCESS
#include <pciaccess.h>
#endif
@@ -65,11 +58,11 @@ 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(SCREEN_INIT_ARGS_DECL);
static Bool FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL);
static Bool FBDevScreenInit(ScreenPtr pScreen, int argc, char **argv);
static Bool FBDevCloseScreen(ScreenPtr pScreen);
static void * FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
CARD32 *size, void *closure);
static void FBDevPointerMoved(SCRN_ARG_TYPE arg, int x, int y);
static void FBDevPointerMoved(ScrnInfoPtr pScrn, int x, int y);
static Bool FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen);
static Bool FBDevDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
pointer ptr);
@@ -189,7 +182,7 @@ typedef struct {
void *shadow;
CloseScreenProcPtr CloseScreen;
CreateScreenResourcesProcPtr CreateScreenResources;
void (*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y);
void (*PointerMoved)(ScrnInfoPtr pScrn, int x, int y);
EntityInfoPtr pEnt;
/* DGA info */
DGAModePtr pDGAMode;
@@ -204,8 +197,8 @@ FBDevGetRec(ScrnInfoPtr pScrn)
{
if (pScrn->driverPrivate != NULL)
return TRUE;
pScrn->driverPrivate = xnfcalloc(sizeof(FBDevRec), 1);
pScrn->driverPrivate = XNFcallocarray(sizeof(FBDevRec), 1);
return TRUE;
}
@@ -270,7 +263,7 @@ static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
if (!xf86LoadDrvSubModule(drv, "fbdevhw"))
return FALSE;
pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL, NULL,
NULL, NULL, NULL, NULL);
if (pScrn) {
@@ -293,7 +286,7 @@ static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
pScrn->ValidMode = fbdevValidMode;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"claimed PCI slot %d@%d:%d:%d\n",
"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");
@@ -327,14 +320,13 @@ FBDevProbe(DriverPtr drv, int flags)
if (flags & PROBE_DETECT)
return FALSE;
if ((numDevSections = xf86MatchDevice(FBDEV_DRIVER_NAME, &devSections)) <= 0)
if ((numDevSections = xf86MatchDevice(FBDEV_DRIVER_NAME, &devSections)) <= 0)
return FALSE;
if (!xf86LoadDrvSubModule(drv, "fbdevhw"))
return FALSE;
for (i = 0; i < numDevSections; i++) {
Bool isIsa = FALSE;
Bool isPci = FALSE;
dev = xf86FindOptionValue(devSections[i]->options,"fbdev");
@@ -345,15 +337,8 @@ FBDevProbe(DriverPtr drv, int flags)
if (!xf86CheckPciSlot(bus,device,func))
continue;
isPci = TRUE;
} else
}
#endif
#ifdef HAVE_ISA
if (xf86ParseIsaBusString(devSections[i]->busID))
isIsa = TRUE;
else
#endif
0;
}
if (fbdevHWProbe(NULL,dev,NULL)) {
pScrn = NULL;
@@ -361,7 +346,7 @@ FBDevProbe(DriverPtr drv, int flags)
#ifndef XSERVER_LIBPCIACCESS
/* XXX what about when there's no busID set? */
int entity;
entity = xf86ClaimPciSlot(bus,device,func,drv,
0,devSections[i],
TRUE);
@@ -374,16 +359,6 @@ 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,
devSections[i], TRUE);
pScrn = xf86ConfigIsaEntity(pScrn,0,entity,
NULL,RES_SHARED_VGA,
NULL,NULL,NULL,NULL);
#endif
} else {
int entity;
@@ -392,11 +367,11 @@ FBDevProbe(DriverPtr drv, int flags)
devSections[i], TRUE);
pScrn = xf86ConfigFbEntity(pScrn,0,entity,
NULL,NULL,NULL,NULL);
}
if (pScrn) {
foundScreen = TRUE;
pScrn->driverVersion = FBDEV_VERSION;
pScrn->driverName = FBDEV_DRIVER_NAME;
pScrn->name = FBDEV_NAME;
@@ -408,7 +383,7 @@ FBDevProbe(DriverPtr drv, int flags)
pScrn->EnterVT = fbdevEnterVT;
pScrn->LeaveVT = fbdevLeaveVT;
pScrn->ValidMode = fbdevValidMode;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"using %s\n", dev ? dev : "default device");
}
@@ -596,7 +571,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "checking modes against monitor...\n");
{
DisplayModePtr mode, first = mode = pScrn->modes;
if (mode != NULL) do {
mode->status = xf86CheckModeForMonitor(mode, pScrn->monitor);
mode = mode->next;
@@ -735,7 +710,7 @@ FBDevShadowInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
FBDevPtr fPtr = FBDEVPTR(pScrn);
if (!shadowSetup(pScreen)) {
return FALSE;
}
@@ -765,7 +740,7 @@ fbdevSaveScreen(ScreenPtr pScreen, int mode)
}
static Bool
FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
FBDevScreenInit(ScreenPtr pScreen, int argc, char **argv)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
FBDevPtr fPtr = FBDEVPTR(pScrn);
@@ -800,7 +775,7 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
return FALSE;
}
fbdevHWSaveScreen(pScreen, SCREEN_SAVER_ON);
fbdevHWAdjustFrame(ADJUST_FRAME_ARGS(pScrn, 0, 0));
fbdevHWAdjustFrame(pScrn, 0, 0);
/* mi layer */
miClearVisualTypes();
@@ -1010,7 +985,7 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
fPtr->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = FBDevCloseScreen;
#if XV
#ifdef XV
{
XF86VideoAdaptorPtr *ptr;
@@ -1027,11 +1002,11 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
}
static Bool
FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL)
FBDevCloseScreen(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
FBDevPtr fPtr = FBDEVPTR(pScrn);
fbdevHWRestore(pScrn);
fbdevHWUnmapVidmem(pScrn);
if (fPtr->shadow) {
@@ -1048,7 +1023,7 @@ FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL)
pScreen->CreateScreenResources = fPtr->CreateScreenResources;
pScreen->CloseScreen = fPtr->CloseScreen;
return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
return (*pScreen->CloseScreen)(pScreen);
}
@@ -1076,9 +1051,8 @@ FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
}
static void
FBDevPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
FBDevPointerMoved(ScrnInfoPtr pScrn, int x, int y)
{
SCRN_INFO_PTR(arg);
FBDevPtr fPtr = FBDEVPTR(pScrn);
int newX, newY;
@@ -1110,7 +1084,7 @@ FBDevPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
}
/* Pass adjusted pointer coordinates to wrapped PointerMoved function. */
(*fPtr->PointerMoved)(arg, newX, newY);
(*fPtr->PointerMoved)(pScrn, newX, newY);
}
@@ -1142,7 +1116,6 @@ static Bool
FBDevDGASetMode(ScrnInfoPtr pScrn, DGAModePtr pDGAMode)
{
DisplayModePtr pMode;
int scrnIdx = pScrn->pScreen->myNum;
int frameX0, frameY0;
if (pDGAMode) {
@@ -1157,9 +1130,9 @@ FBDevDGASetMode(ScrnInfoPtr pScrn, DGAModePtr pDGAMode)
frameY0 = pScrn->frameY0;
}
if (!(*pScrn->SwitchMode)(SWITCH_MODE_ARGS(pScrn, pMode)))
if (!(*pScrn->SwitchMode)(pScrn, pMode))
return FALSE;
(*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, frameX0, frameY0));
(*pScrn->AdjustFrame)(pScrn, frameX0, frameY0);
return TRUE;
}
@@ -1167,7 +1140,7 @@ FBDevDGASetMode(ScrnInfoPtr pScrn, DGAModePtr pDGAMode)
static void
FBDevDGASetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
{
(*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, x, y));
(*pScrn->AdjustFrame)(pScrn, x, y);
}
static int
@@ -1265,7 +1238,7 @@ static Bool
FBDevDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr)
{
xorgHWFlags *flag;
switch (op) {
case GET_REQUIRED_HW_INTERFACES:
flag = (CARD32*)ptr;