Compare commits

...

55 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
8a768d8f8f configure.ac: query video driver directory via pkg-config
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-13 11:33:01 +01:00
Enrico Weigelt, metux IT consult
755e07f865 replace obsolete "pointer" typedef by plain void*
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-05 18:22:21 +01:00
Enrico Weigelt, metux IT consult
a052df27e5 .github: add NetBSD build
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-29 17:24:14 +01:00
Enrico Weigelt, metux IT consult
a4d4b1976c .github: add freebsd and dragonfly build
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-28 14:43:57 +01:00
Enrico Weigelt, metux IT consult
737142f729 .github: use new common driver build actions
Using the new driver build actions in X11Libre/actions-build-driver repo,
instead of having lots of duplicated pipeline and script in all the
individual driver repos.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-23 21:46:02 +01:00
Enrico Weigelt, metux IT consult
a5c83b22f9 configure.ac: increase minimum xserver version to 25.0.0
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-19 16:05:40 +01:00
Enrico Weigelt, metux IT consult
b69995d4da release 25.0.0
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 19:09:43 +01:00
Enrico Weigelt, metux IT consult
4fac426b6c configure.ac: tiny formatting cleanup
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 17:22:16 +01:00
Enrico Weigelt, metux IT consult
66b481d628 drop hacks for ancient pre-libpciaccess Xservers
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 15:14:22 +01:00
Enrico Weigelt, metux IT consult
4f822e5dee drop obsolete #ifdef XFree86LOADER
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 13:43:01 +01:00
Enrico Weigelt, metux IT consult
a4e4066e0c configure.ac: replace DRIVER_NAME symbol by actual name
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 13:10:38 +01:00
Enrico Weigelt, metux IT consult
57b598c717 drop obsolete .gitlab-ci.yml
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 11:53:44 +01:00
Enrico Weigelt, metux IT consult
6441dd72a4 drop obsolete HAVE_CONFIG_H
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-17 19:37:03 +01:00
Enrico Weigelt, metux IT consult
cc44831a72 README.md: fix URLs
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-16 12:03:03 +01:00
Enrico Weigelt, metux IT consult
b1d35e5ae6 release 0.5.2
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-15 15:46:57 +01:00
Enrico Weigelt, metux IT consult
bcd5eb9815 configure.ac: fix package name and issue tracker URL
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-15 15:46:36 +01:00
Alan Coopersmith
1a7ca6589d 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-12-09 16:43:55 +01:00
b-aaz
5f2150e618 configure: Automatically detect the default xorg-module-dir.
The module directory has changed to a per ABI folder in the xlibre-xserver.
Now the default value of `xorg-module-dir` will be detected from the `moduledir` variable in xorg-server.pc.

Signed-off-by: b-aaz <b-aazbsd.proton.me>
2025-07-29 18:55:57 +02:00
Enrico Weigelt, metux IT consult
bb833d6b96 .github: add CI pipeline
This pipeline builds the driver against the latest Xserver stable
release as well as current master.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-25 19:19:31 +02:00
callmetango
99d67cce2d .github: Add issue forms
Add the following forms for issue creation:

* Bug report
* Feature request
* Code change
* Documentation update
* Organizational task

* add issue type selection page on "New Issue" call
* mention Github Discussions and the mailing list where appropriate

Part-of: X11Libre/misc#156
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-07-07 17:06:32 +02: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
Adam Jackson
82aa13d013 fbdev 0.5.0
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-05-30 12:31:25 -04:00
Adam Jackson
67525c485f Update for 1.20 ABI
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-05-30 12:31:25 -04:00
Alan Coopersmith
9af7f81534 Use #ifdef instead of #if to avoid build error
fbdev.c:491:21: error: #if with no expression
 #if HAVE_SHADOW_3224
                     ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 11:42:22 -05:00
Adam Jackson
e0bce0d017 Use shadowUpdate32to24 at 24bpp
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16 12:22:09 -05:00
Adam Jackson
3cf9923119 Remove dead pix24bpp variable
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16 12:22:09 -05:00
Mihail Konev
8c03e3474e autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26 14:00:22 +10:00
Emil Velikov
39f668420f autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 11:26:28 +10:00
Peter Hutterer
303f902c76 autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-26 11:23:46 +10:00
Alan Coopersmith
f627319599 autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-26 11:16:37 +10:00
Alan Coopersmith
22f288b4e4 configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-26 11:16:37 +10:00
Adam Jackson
2c5eba8574 Fix shadow fb allocation size (v2)
->bitsPerPixel is rather obviously eight times too large.

v2: Use ->displayWidth - the pitch - not ->virtualX (Keith Packard)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-05 11:15:27 -05:00
Pascal Terjan
66e7909bfe Initialize pci_dev
Else it is read before initialization if XSERVER_LIBPCIACCESS is not
defined or location.type is not BUS_PCI.

Noticed when I got a segfault where it was 0x1 while doing some tests on
arm.

Signed-off-by: Pascal Terjan <pterjan@google.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-27 11:33:24 -05:00
Adam Jackson
ae0aeffae6 Pass the pci device (if any) through to fbdevhw in probe and preinit
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-08-11 12:13:20 -04:00
Adam Jackson
2673e72706 Use own thunk functions instead of fbdevHW*Weak
I plan to remove the Weak functions from a future server.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-05-21 09:49:56 -04:00
Adam Jackson
dd1cf1028c Default to 32bpp if the console is 8bpp (and we weren't told otherwise)
You can still override this on the command line or in the config file.
Without this we'll come up at 8bpp on matroxfb (and probably others),
which among other things breaks the default desktop since gnome-shell
wants GLX and GLX doesn't support pseudocolor anymore.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-03-21 12:41:55 -04:00
Julien Cristau
679ed9a4e6 Bump to 0.4.4 2013-09-23 20:02:47 +02:00
Adam Jackson
ac293412a0 Remove mibstore.h
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-25 08:54:37 -04:00
18 changed files with 573 additions and 354 deletions

View File

@@ -0,0 +1,65 @@
name: 🐞 Bug report
description: Create a report to help us improve
labels: [bug, needs-triage]
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to help everyone identify and fix the bug. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: dropdown
id: affected-version
attributes:
label: Select the version
options:
- 0.5.1.1
- Git master branch
- other or don't know
default: 1
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe your issue
placeholder: When I did X then Y happened.
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
placeholder: |
1. Start ...
2. Do this
3. Do that
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect?
placeholder: I expected this to happen.
- type: textarea
id: environment
attributes:
label: Additional Information
description: |
Additional information you want to provide such as logs, system info, environment, screenshots, etc.
placeholder: |
Add any other context about the bug here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-video-fbdev/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for reporting this issue! We will get back to you as soon as possible.

View File

@@ -0,0 +1,49 @@
name: ✨ Feature request
description: Suggest a feature for this software
labels: [enhancement, needs-triage]
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to properly describe the new software feature you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: textarea
id: description
attributes:
label: "Describe the feature"
placeholder: A thing in X that allows to do Y.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: "It should be done because"
placeholder: Doing Y is needed for Z.
validations:
required: true
- type: textarea
id: alternative
attributes:
label: "What are the alternatives?"
placeholder: We could do A or B instead.
- type: textarea
id: context
attributes:
label: Additional context
description: Additional information you want to provide such as references to related issues or protocols, the implications on existing use cases, etc.
placeholder: |
Add any other context about the feature request here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-video-fbdev/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for your suggestion! Let's see together if it can be done.

View File

@@ -0,0 +1,49 @@
name: 🔧 Code cleanup
description: Level up the source code
labels: [code-cleanup, needs-triage]
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to properly describe the code cleanup you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: textarea
id: description
attributes:
label: "Describe the cleanup"
placeholder: C in X needs to be changed into D.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: "It should be done because"
placeholder: Having D is needed for E.
validations:
required: true
- type: textarea
id: alternative
attributes:
label: "What are the alternatives?"
placeholder: We could do A or B instead.
- type: textarea
id: context
attributes:
label: Additional context
description: Additional information you want to provide such as implications on existing code, how to ensure API/ABI stability, which tests are needed or to be run, related issues, etc.
placeholder: |
Add any other context about the cleanup here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-video-fbdev/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for looking at the source code! Let's see together how it can be improved.

View File

@@ -0,0 +1,38 @@
name: 🔖 Documentation update
description: Make your mark for better documentation
labels: [documentation, needs-triage]
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to help others understand our software. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: textarea
id: description
attributes:
label: Describe the update
placeholder: These things need to be better documented.
validations:
required: true
- type: textarea
id: environment
attributes:
label: Additional Information
description: Additional information you want to provide such as tickets related to changes in the software, affected files, screenshots, etc.
placeholder: |
Add any other context about the update here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-video-fbdev/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for requesting this update! We will get back to you as soon as possible.

43
.github/ISSUE_TEMPLATE/05-org-task.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: ✅ Organizational task
description: Create a task for project organization
labels: [needs-triage, organization]
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to get organizational things done. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: textarea
id: description
attributes:
label: Describe the task
placeholder: These things need to be done.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: "It should be done because"
placeholder: Doing Y is needed for Z.
- type: textarea
id: environment
attributes:
label: Additional Information
description: Additional information you want to provide such as the context for bigger tasks, the implicatons on existing workflows, related issues, etc.
placeholder: |
Add any other context about the task here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-video-fbdev/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for adding this task! We will get back to you as soon as possible.

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: XLibre Community Support
url: https://github.com/orgs/X11Libre/discussions
about: Please ask and answer questions here.
- name: Mailing List
url: https://www.freelists.org/list/xlibre
about: You can join the discussions on our mailing list.

58
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
permissions:
contents: write
on:
push:
pull_request:
jobs:
ubuntu:
strategy:
matrix:
xserver-version: [ master, xlibre-xserver-25.1.0, xlibre-xserver-25.0.0.18 ]
runs-on: ubuntu-latest
steps:
- uses: X11Libre/action-build-driver/target/ubuntu@v0.3.7
with:
xserver-version: ${{ matrix.xserver-version }}
freebsd:
strategy:
matrix:
xserver-version: [ master, xlibre-xserver-25.1.0, xlibre-xserver-25.0.0.18 ]
runs-on: ubuntu-latest
steps:
- uses: X11Libre/action-build-driver/target/freebsd@v0.3.7
with:
xserver-version: ${{ matrix.xserver-version }}
dragonfly:
strategy:
matrix:
# xlibre-xserver-25.0.x not compiling on dragonfly yet
xserver-version: [ master, xlibre-xserver-25.1.0 ]
runs-on: ubuntu-latest
steps:
- uses: X11Libre/action-build-driver/target/dragonfly@v0.3.7
with:
xserver-version: ${{ matrix.xserver-version }}
netbsd:
strategy:
matrix:
xserver-version: [ master, xlibre-xserver-25.1.0 ]
runs-on: ubuntu-latest
steps:
- uses: X11Libre/action-build-driver/target/netbsd@v0.3.7
with:
xserver-version: ${{ matrix.xserver-version }}
release-notes:
name: Release pushed tag
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/xlibre-') }}
needs: [ ubuntu, freebsd, dragonfly, netbsd ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: X11Libre/action-build-driver/release@v0.3.7

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'
#
#

View File

@@ -18,6 +18,10 @@
# 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.
# During distcheck, system locations (as provided by pkg-config) may
# not be writable; provide instead relative locations.
DISTCHECK_CONFIGURE_FLAGS = --with-xorg-module-dir='$${libdir}/xorg/modules'
SUBDIRS = src man
MAINTAINERCLEANFILES = ChangeLog INSTALL
@@ -30,3 +34,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

8
README.md Normal file
View File

@@ -0,0 +1,8 @@
xf86-video-fbdev - video driver for framebuffer device
------------------------------------------------------
The primary development code repository can be found at:
https://github.com/X11Libre/xf86-video-fbdev
Please submit bug reports and requests to merge patches there.

View File

@@ -1,12 +1,17 @@
#! /bin/sh
srcdir=`dirname $0`
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
cd "$srcdir"
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
cd "$ORIGDIR" || exit $?
$srcdir/configure --enable-maintainer-mode "$@"
git config --local --get format.subjectPrefix >/dev/null 2>&1 ||
git config --local format.subjectPrefix "PATCH xf86-video-fbdev"
if test -z "$NOCONFIGURE"; then
exec "$srcdir"/configure "$@"
fi

View File

@@ -22,17 +22,16 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-fbdev],
[0.4.3],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-fbdev])
AC_INIT([xlibre-xf86-video-fbdev],
[25.0.0],
[https://github.com/X11Libre/xf86-video-fbdev/issues],
[xlibrexf86-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_MAINTAINER_MODE
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],
@@ -41,20 +40,15 @@ 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"])
# Define a configure option for an alternate module directory
AC_ARG_WITH(xorg-module-dir,
AS_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
[moduledir="$withval"],
[moduledir="$libdir/xorg/modules"])
AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess],
[Enable use of libpciaccess (default: disabled)]),
[PCIACCESS=$enableval], [PCIACCESS=no])
PKG_PROG_PKG_CONFIG([0.25])
xlibre_video_drivers_dir=`$PKG_CONFIG --variable=video_drivers_dir xlibre-server`
AC_SUBST(xlibre_video_drivers_dir)
# Store the list of server defined optional extensions in REQUIRED_MODULES
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
@@ -62,34 +56,9 @@ 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])
PKG_CHECK_MODULES(XORG, [xorg-server >= 25.0.0 xproto fontsproto $REQUIRED_MODULES])
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
save_CFLAGS="$CFLAGS"
CFLAGS="$XORG_CFLAGS"
AC_CHECK_DECL(xf86ConfigIsaEntity,
[AC_DEFINE(HAVE_ISA, 1, [Have ISA support])],
[],
[#include "xf86.h"])
CFLAGS="$save_CFLAGS"
AM_CONDITIONAL(PCIACCESS, [test "x$PCIACCESS" = xyes])
if test "x$PCIACCESS" = xyes; then
AC_DEFINE(PCIACCESS, 1, [Use libpciaccess])
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
fi
# Checks for libraries.
AC_SUBST([moduledir])
DRIVER_NAME=fbdev
AC_SUBST([DRIVER_NAME])
AC_CONFIG_FILES([
Makefile
src/Makefile
man/Makefile
])
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
AC_OUTPUT

View File

@@ -20,15 +20,15 @@
# 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)
driverman_PRE = @DRIVER_NAME@.man
driverman_PRE = fbdev.man
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.man
EXTRA_DIST = fbdev.man
CLEANFILES = $(driverman_DATA)

View File

@@ -14,47 +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. 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. 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_ladir = @xlibre_video_drivers_dir@
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

@@ -2,10 +2,7 @@
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
* Michel Dänzer, <michel@tungstengraphics.com>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
@@ -14,7 +11,6 @@
#include "xf86_OSproc.h"
#include "mipointer.h"
#include "mibstore.h"
#include "micmap.h"
#include "colormapst.h"
#include "xf86cmap.h"
@@ -24,19 +20,17 @@
/* 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>
/* for xf86{Depth,FbBpp}. i am a terrible person, and i am sorry. */
#include "xf86Priv.h"
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) > 23
#define HAVE_SHADOW_3224
#endif
static Bool debug = 0;
@@ -54,19 +48,17 @@ static Bool debug = 0;
static const OptionInfoRec * FBDevAvailableOptions(int chipid, int busid);
static void FBDevIdentify(int flags);
static Bool FBDevProbe(DriverPtr drv, int flags);
#ifdef XSERVER_LIBPCIACCESS
static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
struct pci_device *dev, intptr_t match_data);
#endif
static Bool FBDevPreInit(ScrnInfoPtr pScrn, int flags);
static Bool FBDevScreenInit(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);
void *ptr);
enum { FBDEV_ROTATE_NONE=0, FBDEV_ROTATE_CW=270, FBDEV_ROTATE_UD=180, FBDEV_ROTATE_CCW=90 };
@@ -74,17 +66,10 @@ enum { FBDEV_ROTATE_NONE=0, FBDEV_ROTATE_CW=270, FBDEV_ROTATE_UD=180, FBDEV_ROTA
/* -------------------------------------------------------------------- */
/*
* This is intentionally screen-independent. It indicates the binding
* choice made in the first PreInit.
*/
static int pix24bpp = 0;
#define FBDEV_VERSION 4000
#define FBDEV_NAME "FBDEV"
#define FBDEV_DRIVER_NAME "fbdev"
#ifdef XSERVER_LIBPCIACCESS
static const struct pci_id_match fbdev_device_match[] = {
{
PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
@@ -93,7 +78,6 @@ static const struct pci_id_match fbdev_device_match[] = {
{ 0, 0, 0 },
};
#endif
_X_EXPORT DriverRec FBDEV = {
FBDEV_VERSION,
@@ -107,11 +91,8 @@ _X_EXPORT DriverRec FBDEV = {
NULL,
0,
FBDevDriverFunc,
#ifdef XSERVER_LIBPCIACCESS
fbdev_device_match,
FBDevPciProbe
#endif
};
/* Supported "chipsets" */
@@ -138,8 +119,6 @@ static const OptionInfoRec FBDevOptions[] = {
/* -------------------------------------------------------------------- */
#ifdef XFree86LOADER
MODULESETUPPROTO(FBDevSetup);
static XF86ModuleVersionInfo FBDevVersRec =
@@ -158,23 +137,21 @@ static XF86ModuleVersionInfo FBDevVersRec =
_X_EXPORT XF86ModuleData fbdevModuleData = { &FBDevVersRec, FBDevSetup, NULL };
pointer
FBDevSetup(pointer module, pointer opts, int *errmaj, int *errmin)
void*
FBDevSetup(void *module, void *opts, int *errmaj, int *errmin)
{
static Bool setupDone = FALSE;
if (!setupDone) {
setupDone = TRUE;
xf86AddDriver(&FBDEV, module, HaveDriverFuncs);
return (pointer)1;
return (void*)1;
} else {
if (errmaj) *errmaj = LDR_ONCEONLY;
return NULL;
}
}
#endif /* XFree86LOADER */
/* -------------------------------------------------------------------- */
/* our private data, and two functions to allocate/free this */
@@ -185,10 +162,11 @@ typedef struct {
int lineLength;
int rotate;
Bool shadowFB;
Bool shadow24;
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;
@@ -203,8 +181,8 @@ FBDevGetRec(ScrnInfoPtr pScrn)
{
if (pScrn->driverPrivate != NULL)
return TRUE;
pScrn->driverPrivate = xnfcalloc(sizeof(FBDevRec), 1);
pScrn->driverPrivate = XNFcallocarray(sizeof(FBDevRec), 1);
return TRUE;
}
@@ -231,8 +209,36 @@ FBDevIdentify(int flags)
xf86PrintChipsets(FBDEV_NAME, "driver for framebuffer", FBDevChipsets);
}
static Bool
fbdevSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
return fbdevHWSwitchMode(pScrn, mode);
}
static void
fbdevAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
{
fbdevHWAdjustFrame(pScrn, x, y);
}
static Bool
fbdevEnterVT(ScrnInfoPtr pScrn)
{
return fbdevHWEnterVT(pScrn);
}
static void
fbdevLeaveVT(ScrnInfoPtr pScrn)
{
fbdevHWLeaveVT(pScrn);
}
static ModeStatus
fbdevValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags)
{
return fbdevHWValidMode(pScrn, mode, verbose, flags);
}
#ifdef XSERVER_LIBPCIACCESS
static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
struct pci_device *dev, intptr_t match_data)
{
@@ -240,7 +246,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) {
@@ -249,21 +255,21 @@ static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
pScrn->entityInstanceList[0]);
device = xf86FindOptionValue(devSection->options, "fbdev");
if (fbdevHWProbe(NULL, device, NULL)) {
if (fbdevHWProbe(dev, device, NULL)) {
pScrn->driverVersion = FBDEV_VERSION;
pScrn->driverName = FBDEV_DRIVER_NAME;
pScrn->name = FBDEV_NAME;
pScrn->Probe = FBDevProbe;
pScrn->PreInit = FBDevPreInit;
pScrn->ScreenInit = FBDevScreenInit;
pScrn->SwitchMode = fbdevHWSwitchModeWeak();
pScrn->AdjustFrame = fbdevHWAdjustFrameWeak();
pScrn->EnterVT = fbdevHWEnterVTWeak();
pScrn->LeaveVT = fbdevHWLeaveVTWeak();
pScrn->ValidMode = fbdevHWValidModeWeak();
pScrn->SwitchMode = fbdevSwitchMode;
pScrn->AdjustFrame = fbdevAdjustFrame;
pScrn->EnterVT = fbdevEnterVT;
pScrn->LeaveVT = fbdevLeaveVT;
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");
@@ -275,8 +281,6 @@ static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
return (pScrn != NULL);
}
#endif
static Bool
FBDevProbe(DriverPtr drv, int flags)
@@ -285,9 +289,6 @@ FBDevProbe(DriverPtr drv, int flags)
ScrnInfoPtr pScrn;
GDevPtr *devSections;
int numDevSections;
#ifndef XSERVER_LIBPCIACCESS
int bus,device,func;
#endif
char *dev;
Bool foundScreen = FALSE;
@@ -297,64 +298,21 @@ 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");
if (devSections[i]->busID) {
#ifndef XSERVER_LIBPCIACCESS
if (xf86ParsePciBusString(devSections[i]->busID,&bus,&device,
&func)) {
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;
if (isPci) {
#ifndef XSERVER_LIBPCIACCESS
/* XXX what about when there's no busID set? */
int entity;
entity = xf86ClaimPciSlot(bus,device,func,drv,
0,devSections[i],
TRUE);
pScrn = xf86ConfigPciEntity(pScrn,0,entity,
NULL,RES_SHARED_VGA,
NULL,NULL,NULL,NULL);
/* xf86DrvMsg() can't be called without setting these */
pScrn->driverName = FBDEV_DRIVER_NAME;
pScrn->name = FBDEV_NAME;
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;
@@ -362,23 +320,23 @@ 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;
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 = fbdevSwitchMode;
pScrn->AdjustFrame = fbdevAdjustFrame;
pScrn->EnterVT = fbdevEnterVT;
pScrn->LeaveVT = fbdevLeaveVT;
pScrn->ValidMode = fbdevValidMode;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"using %s\n", dev ? dev : "default device");
}
@@ -396,6 +354,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
int default_depth, fbbpp;
const char *s;
int type;
void *pci_dev = NULL;
if (flags & PROBE_DETECT) return FALSE;
@@ -412,31 +371,51 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
fPtr->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
#ifndef XSERVER_LIBPCIACCESS
pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
/* XXX Is this right? Can probably remove RAC_FB */
pScrn->racIoFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
if (fPtr->pEnt->location.type == BUS_PCI &&
xf86RegisterResources(fPtr->pEnt->index,NULL,ResExclusive)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"xf86RegisterResources() found resource conflicts\n");
return FALSE;
}
#endif
if (fPtr->pEnt->location.type == BUS_PCI)
pci_dev = fPtr->pEnt->location.id.pci;
/* open device */
if (!fbdevHWInit(pScrn,NULL,xf86FindOptionValue(fPtr->pEnt->device->options,"fbdev")))
if (!fbdevHWInit(pScrn, pci_dev,
xf86FindOptionValue(fPtr->pEnt->device->options,
"fbdev")))
return FALSE;
default_depth = fbdevHWGetDepth(pScrn,&fbbpp);
if (default_depth == 8) do {
/* trust the command line */
if (xf86FbBpp > 0 || xf86Depth > 0)
break;
/* trust the config file's Screen stanza */
if (pScrn->confScreen->defaultfbbpp > 0 ||
pScrn->confScreen->defaultdepth > 0)
break;
/* trust our Device stanza in the config file */
if (xf86FindOption(fPtr->pEnt->device->options, "DefaultDepth") ||
xf86FindOption(fPtr->pEnt->device->options, "DefaultFbBpp"))
break;
/* otherwise, lol no */
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Console is 8bpp, defaulting to 32bpp\n");
default_depth = 24;
fbbpp = 32;
} while (0);
fPtr->shadow24 = FALSE;
#ifdef HAVE_SHADOW_3224
/* okay but 24bpp is awful */
if (fbbpp == 24) {
fPtr->shadow24 = TRUE;
fbbpp = 32;
}
#endif
if (!xf86SetDepthBpp(pScrn, default_depth, default_depth, fbbpp,
Support24bppFb | Support32bppFb | SupportConvert32to24 | SupportConvert24to32))
return FALSE;
xf86PrintDepthBpp(pScrn);
/* Get the depth24 pixmap format */
if (pScrn->depth == 24 && pix24bpp == 0)
pix24bpp = xf86GetBppFromDepth(pScrn, 24);
/* color weight */
if (pScrn->depth > 8) {
rgb zeros = { 0, 0, 0 };
@@ -481,12 +460,18 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
/* use shadow framebuffer by default */
fPtr->shadowFB = xf86ReturnOptValBool(fPtr->Options, OPTION_SHADOW_FB, TRUE);
if (!fPtr->shadowFB && fPtr->shadow24) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"24bpp requires shadow framebuffer, forcing\n");
fPtr->shadowFB = TRUE;
}
debug = xf86ReturnOptValBool(fPtr->Options, OPTION_DEBUG, FALSE);
/* rotation */
fPtr->rotate = FBDEV_ROTATE_NONE;
if ((s = xf86GetOptValString(fPtr->Options, OPTION_ROTATE)))
s = xf86GetOptValString(fPtr->Options, OPTION_ROTATE);
if (s && !fPtr->shadow24)
{
if(!xf86NameCmp(s, "CW"))
{
@@ -526,7 +511,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;
@@ -607,6 +592,25 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
return TRUE;
}
static void
fbdevUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf)
{
#ifdef HAVE_SHADOW_3224
shadowUpdate32to24(pScreen, pBuf);
#endif
}
static void
fbdevUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
{
shadowUpdateRotatePacked(pScreen, pBuf);
}
static void
fbdevUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
{
shadowUpdatePacked(pScreen, pBuf);
}
static Bool
FBDevCreateScreenResources(ScreenPtr pScreen)
@@ -615,6 +619,7 @@ FBDevCreateScreenResources(ScreenPtr pScreen)
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
FBDevPtr fPtr = FBDEVPTR(pScrn);
Bool ret;
void (*update)(ScreenPtr, shadowBufPtr);
pScreen->CreateScreenResources = fPtr->CreateScreenResources;
ret = pScreen->CreateScreenResources(pScreen);
@@ -625,9 +630,15 @@ FBDevCreateScreenResources(ScreenPtr pScreen)
pPixmap = pScreen->GetScreenPixmap(pScreen);
if (!shadowAdd(pScreen, pPixmap, fPtr->rotate ?
shadowUpdateRotatePackedWeak() : shadowUpdatePackedWeak(),
FBDevWindowLinear, fPtr->rotate, NULL)) {
if (fPtr->shadow24)
update = fbdevUpdate32to24;
else if (fPtr->rotate)
update = fbdevUpdateRotatePacked;
else
update = fbdevUpdatePacked;
if (!shadowAdd(pScreen, pPixmap, update, FBDevWindowLinear, fPtr->rotate,
NULL)) {
return FALSE;
}
@@ -639,7 +650,7 @@ FBDevShadowInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
FBDevPtr fPtr = FBDEVPTR(pScrn);
if (!shadowSetup(pScreen)) {
return FALSE;
}
@@ -650,9 +661,26 @@ FBDevShadowInit(ScreenPtr pScreen)
return TRUE;
}
static void
fbdevLoadPalette(ScrnInfoPtr pScrn, int num, int *i, LOCO *col, VisualPtr pVis)
{
fbdevHWLoadPalette(pScrn, num, i, col, pVis);
}
static void
fbdevDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
{
fbdevHWDPMSSet(pScrn, mode, flags);
}
static Bool
FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
fbdevSaveScreen(ScreenPtr pScreen, int mode)
{
return fbdevHWSaveScreen(pScreen, mode);
}
static Bool
FBDevScreenInit(ScreenPtr pScreen, int argc, char **argv)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
FBDevPtr fPtr = FBDEVPTR(pScrn);
@@ -687,7 +715,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();
@@ -739,8 +767,8 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
fPtr->fbstart = fPtr->fbmem + fPtr->fboff;
if (fPtr->shadowFB) {
fPtr->shadow = calloc(1, pScrn->virtualX * pScrn->virtualY *
pScrn->bitsPerPixel);
fPtr->shadow = calloc(1, pScrn->displayWidth * pScrn->virtualY *
((pScrn->bitsPerPixel + 7) / 8));
if (!fPtr->shadow) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -838,14 +866,15 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "display rotated; disabling DGA\n");
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "using driver rotation; disabling "
"XRandR\n");
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 24
xf86DisableRandR();
#endif
if (pScrn->bitsPerPixel == 24)
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "rotation might be broken at 24 "
"bits per pixel\n");
}
xf86SetBlackWhitePixels(pScreen);
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
/* software cursor */
@@ -885,19 +914,18 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
return FALSE;
}
flags = CMAP_PALETTED_TRUECOLOR;
if(!xf86HandleColormaps(pScreen, 256, 8, fbdevHWLoadPaletteWeak(),
NULL, flags))
if(!xf86HandleColormaps(pScreen, 256, 8, fbdevLoadPalette, NULL, flags))
return FALSE;
xf86DPMSInit(pScreen, fbdevHWDPMSSetWeak(), 0);
xf86DPMSInit(pScreen, fbdevDPMSSet, 0);
pScreen->SaveScreen = fbdevHWSaveScreenWeak();
pScreen->SaveScreen = fbdevSaveScreen;
/* Wrap the current CloseScreen function */
fPtr->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = FBDevCloseScreen;
#if XV
#ifdef XV
{
XF86VideoAdaptorPtr *ptr;
@@ -914,11 +942,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) {
@@ -935,7 +963,7 @@ FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL)
pScreen->CreateScreenResources = fPtr->CreateScreenResources;
pScreen->CloseScreen = fPtr->CloseScreen;
return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
return (*pScreen->CloseScreen)(pScreen);
}
@@ -963,9 +991,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;
@@ -997,7 +1024,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);
}
@@ -1029,7 +1056,6 @@ static Bool
FBDevDGASetMode(ScrnInfoPtr pScrn, DGAModePtr pDGAMode)
{
DisplayModePtr pMode;
int scrnIdx = pScrn->pScreen->myNum;
int frameX0, frameY0;
if (pDGAMode) {
@@ -1044,9 +1070,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;
}
@@ -1054,7 +1080,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
@@ -1149,10 +1175,10 @@ FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
}
static Bool
FBDevDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr)
FBDevDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, void *ptr)
{
xorgHWFlags *flag;
switch (op) {
case GET_REQUIRED_HW_INTERFACES:
flag = (CARD32*)ptr;