Compare commits

...

26 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
daa6a5f254 release 25.0.1
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-30 16:47:24 +01:00
Enrico Weigelt, metux IT consult
7c7ecbdf70 configure.ac: use new xserver driver build macros
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-30 16:35:41 +01:00
Enrico Weigelt, metux IT consult
3c998c0752 .github: increase xserver dependency
Upcoming changes need a little bit newer xserver SDK.
2026-01-30 15:25:28 +01:00
Enrico Weigelt, metux IT consult
6affbbc248 little formatting cleanup
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-30 13:25:52 +01:00
Enrico Weigelt, metux IT consult
bd0d8b0484 include statement cleanup
Only include what's necessary, and sorting them a little bit.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-30 13:04:16 +01:00
Enrico Weigelt, metux IT consult
ac395bbeca fix int -> pointer typecast warnings
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-30 12:53:23 +01:00
Enrico Weigelt, metux IT consult
9fbe8fbeab fix XF86AttributeRec assignment const issue
Unfortunately this struct is using non-const name field, but actually
may allow const in this case, because nobody's trying to free() these.

Until we've finally got a really clean solution, just do a typecast here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-30 12:49:16 +01:00
Enrico Weigelt, metux IT consult
b224dc8ed6 drop unnecessary include of xf86PciInfo.h
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-30 12:34:37 +01:00
Enrico Weigelt, metux IT consult
ca2b972365 replace obsolete "pointer" typedef by plain void*
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-07 18:59:30 +01:00
Enrico Weigelt, metux IT consult
9b683bb145 configure.ac: drop obsolete AM_MAINTAINER_MODE
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-30 16:17:15 +01:00
Enrico Weigelt, metux IT consult
0f9e231194 .github: update actions version
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-30 16:16:27 +01:00
Enrico Weigelt, metux IT consult
bf621b6ec5 .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-29 10:05:31 +01:00
Enrico Weigelt, metux IT consult
6582ec2b12 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:19:55 +01:00
Enrico Weigelt, metux IT consult
0db0e56806 release 25.0.0
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 19:23:19 +01:00
Enrico Weigelt, metux IT consult
e1ae793d44 configure.ac: tiny formatting cleanup
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 17:43:43 +01:00
Enrico Weigelt, metux IT consult
3af49aa1ee drop obsolete #ifdef XFree86LOADER
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 13:50:44 +01:00
Enrico Weigelt, metux IT consult
37fd765aab configure.ac: replace DRIVER_NAME symbol by actual name
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 13:33:42 +01:00
Enrico Weigelt, metux IT consult
d0469938f1 configure.ac: drop obsolete checks for libc functions
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 12:23:15 +01:00
Enrico Weigelt, metux IT consult
bdce886364 drop obsolete .gitlab-ci.yml
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 11:55:58 +01:00
Enrico Weigelt, metux IT consult
a2e7ab6168 drop obsolete #ifdef HAVE_CONFIG_H
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 11:19:16 +01:00
Alan Coopersmith
0bc8abada1 Improve man page formatting
More closely follow common style as described on
https://man7.org/linux/man-pages/man7/man-pages.7.html
and fix warnings raised by `mandoc -T lint` and `groff -rCHECKSTYLE=10`

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-v4l/-/merge_requests/7>
2025-12-16 10:50:50 +01:00
Enrico Weigelt, metux IT consult
bf3ce6f067 configure.ac: fix package name and issue tracker URL
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-15 19:28:15 +01:00
Enrico Weigelt, metux IT consult
6797508c03 bump minimal xorg version to 1.18
1.18 was released a decade ago, so it seems reasonable stop supporting
older ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-08 18:35:03 +01:00
b-aaz
b472b97892 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:40:57 +02:00
Enrico Weigelt, metux IT consult
ebc39b2367 .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-29 18:33:39 +02:00
callmetango
7dc032a721 .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 16:48:33 +02:00
18 changed files with 355 additions and 342 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: Affected version
options:
- 0.3.0.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-v4l/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-v4l/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-v4l/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-v4l/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-v4l/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.

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

@@ -0,0 +1,28 @@
permissions:
contents: write
on:
push:
pull_request:
jobs:
# This driver is Linux-only
ubuntu:
strategy:
matrix:
xserver-version: [ master, xlibre-xserver-25.1.1, xlibre-xserver-25.0.0.20 ]
runs-on: ubuntu-latest
steps:
- uses: X11Libre/action-build-driver/target/ubuntu@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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: X11Libre/action-build-driver/release@v0.3.7

1
.gitignore vendored
View File

@@ -7,7 +7,6 @@
aclocal.m4
autom4te.cache/
autoscan.log
ChangeLog
compile
config.guess
config.h

View File

@@ -1,98 +0,0 @@
# 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-v4l'
# 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-v4l
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

0
AUTHORS Normal file
View File

0
ChangeLog Normal file
View File

View File

@@ -1,32 +1 @@
# 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.
SUBDIRS = src man
MAINTAINERCLEANFILES = ChangeLog INSTALL
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL

0
NEWS Normal file
View File

View File

@@ -1,77 +1,10 @@
# 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
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-v4l],
[0.3.0],
[https://gitlab.freedesktop.org/xorg/driver/xf86-video-v4l/issues],
[xf86-video-v4l])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR(.)
AC_INIT([xlibre-xf86-video-v4l],
[25.0.1],
[https://github.com/X11Libre/xf86-video-v4l/issues],
[xlibre-xf86-video-v4l])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-xz])
AM_MAINTAINER_MODE
XLIBRE_INIT_MODULE_AM(v4l)
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
# Initialize libtool
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"])
# Store the list of server defined optional extensions in REQUIRED_MODULES
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
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 $REQUIRED_MODULES])
# Checks for library functions
# We don't use strlcat or strlcpy, but check to quiet a -Wredundant-decls warning
# from xorg/os.h which will otherwise redefine it.
AC_CHECK_FUNCS([strlcat strlcpy])
AC_SUBST([moduledir])
DRIVER_NAME=v4l
AC_SUBST([DRIVER_NAME])
AC_CONFIG_FILES([
Makefile
src/Makefile
man/Makefile
])
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
AC_OUTPUT

View File

@@ -1,41 +1,12 @@
# SPDX-License-Identifier: MIT OR X11
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Copyright © 2026 Enrico Weigelt, metux IT consult <info@metux.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
drivermandir = $(DRIVER_MAN_DIR)
drvmandir = @xlibre_driver_man_dir@
drvman_DATA = @xlibre_driver_name@.@xlibre_driver_man_section@
driverman_PRE = @DRIVER_NAME@.man
CLEANFILES = $(drvman_DATA)
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.man
CLEANFILES = $(driverman_DATA)
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
.man.$(DRIVER_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
.man.@xlibre_driver_man_section@:
cp $< $@

View File

@@ -1,7 +1,6 @@
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man,v 1.2 2001/01/27 18:20:55 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH V4L __drivermansuffix__ __vendorversion__
.TH V4L 4 2026-01-30 "X Version 11"
.SH NAME
v4l \- video4linux driver
.SH SYNOPSIS
@@ -12,11 +11,15 @@ v4l \- video4linux driver
.B EndSection
.fi
.SH DESCRIPTION
.B v4l
is an __xservername__ driver for video4linux cards. It provides a Xvideo
extension port for video overlay. Just add the driver to the module
list within the module section of your __xconfigfile__ file if you want
to use it. There are no config options.
.B v4l
is an
.B Xorg
driver for video4linux cards.
It provides a Xvideo extension port for video overlay.
Just add the driver to the module list within the module section of your
.B xorg.conf
file if you want to use it.
There are no config options.
.P
Note that the extmod module is also required for the Xvideo
support (and lots of other extensions too).
@@ -30,10 +33,14 @@ overlay.
bt848/bt878-based TV cards are the most popular hardware these
days.
.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 xorg.conf (5)
for general configuration details.
This section only covers configuration details specific to this driver.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
.BR Xorg (1),
.BR Xserver (1),
.BR xorg.conf (5),
.BR X (7)
.SH AUTHORS
Authors include: Gerd Knorr <kraxel@bytesex.org>

View File

@@ -1,33 +1,12 @@
# Copyright 2005 Adam Jackson.
# SPDX-License-Identifier: MIT OR X11
#
# 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:
# Copyright © 2026 Enrico Weigelt, metux IT consult <info@metux.net>
#
# 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 = $(BASE_CFLAGS) $(XORG_CFLAGS)
AM_CFLAGS = $(XLIBRE_SERVER_CFLAGS)
v4l_drv_la_LTLIBRARIES = v4l_drv.la
v4l_drv_la_LDFLAGS = -module -avoid-version
v4l_drv_ladir = @moduledir@/drivers
v4l_drv_la_LDFLAGS = -module -avoid-version
v4l_drv_ladir = @xlibre_video_drivers_dir@
v4l_drv_la_SOURCES = \
v4l.c \
videodev2.h
v4l_drv_la_SOURCES = v4l.c videodev2.h

101
src/v4l.c
View File

@@ -3,42 +3,27 @@
* based on Michael Schimek's permedia 2 driver.
*
* Copyright (c) 2011 Mauro Carvalho Chehab <mchehab@redhat.com> for:
* - Major rewrite, as driver got ported to V4L2 API
* - Major rewrite, as driver got ported to V4L2 API
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <X11/extensions/Xv.h>
#include "videodev2.h"
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Pci.h"
#include "xf86PciInfo.h"
#include "xf86fbman.h"
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
#include "regionstr.h"
#include "dgaproc.h"
#include "xf86str.h"
#include "fourcc.h"
#include <asm/ioctl.h> /* _IORW(xxx) #defines are here */
#include "videodev2.h"
#if 0
# define DEBUG(x) (x)
@@ -67,8 +52,6 @@ _X_EXPORT DriverRec V4L = {
.driverFunc = NULL, /* FIXME: Need to implement for new probing mode */
};
#ifdef XFree86LOADER
static MODULESETUPPROTO(v4lSetup);
static XF86ModuleVersionInfo v4lVersRec =
@@ -87,8 +70,8 @@ static XF86ModuleVersionInfo v4lVersRec =
_X_EXPORT XF86ModuleData v4lModuleData = { &v4lVersRec, v4lSetup, NULL };
static pointer
v4lSetup(pointer module, pointer opts, int *errmaj, int *errmin)
static void*
v4lSetup(void *module, void *opts, int *errmaj, int *errmin)
{
static Bool setupDone = FALSE;
@@ -100,16 +83,9 @@ v4lSetup(pointer module, pointer opts, int *errmaj, int *errmin)
setupDone = TRUE;
xf86AddDriver (&V4L, module, 0);
return (pointer)1;
return (void*)1;
}
#else
#include <fcntl.h>
#include <sys/ioctl.h>
#endif
#define VIDEO_OFF 0 /* really off */
#define VIDEO_RGB 1 /* rgb overlay (directly to fb) */
#define VIDEO_YUV 2 /* yuv overlay (to offscreen memory + hw scaling) */
@@ -167,8 +143,7 @@ typedef struct _PortPrivRec {
static Atom xvEncoding, xvFreq;
static XF86VideoFormatRec
InputVideoFormats[] = {
static XF86VideoFormatRec InputVideoFormats[] = {
{ 15, TrueColor },
{ 16, TrueColor },
{ 24, TrueColor },
@@ -178,10 +153,10 @@ InputVideoFormats[] = {
#define V4L_ATTR (sizeof(Attributes) / sizeof(XF86AttributeRec))
static const XF86AttributeRec Attributes[] = {
{XvSettable | XvGettable, -1000, 1000, XV_ENCODING},
{XvSettable | XvGettable, -1000, 1000, (char*)XV_ENCODING},
};
static const XF86AttributeRec FreqAttr =
{XvSettable | XvGettable, 0, 16*1000, XV_FREQ};
{XvSettable | XvGettable, 0, 16*1000, (char*)XV_FREQ};
#define MAX_V4L_DEVICES 4
@@ -200,8 +175,6 @@ static struct V4L_DEVICE {
{ -1 },
};
/* ---------------------------------------------------------------------- */
static int SetV4LFmt(int fd, CARD32 pixelformat)
{
struct v4l2_framebuffer fbuf;
@@ -224,6 +197,7 @@ static int SetV4LFmt(int fd, CARD32 pixelformat)
p[0], p[1], p[2], p[3]));
return 0;
}
static int GetV4LFmt(int fd, CARD32 *pixelformat)
{
struct v4l2_framebuffer fbuf;
@@ -245,7 +219,6 @@ static int AddControl(PortPrivPtr p, XF86AttributeRec **list, int *count,
{
char *ptr;
/* v4l_add_attr */
if (qctrl->flags & V4L2_CTRL_FLAG_DISABLED)
return 0;
switch (qctrl->type) {
@@ -415,7 +388,7 @@ static int V4lOpenDevice(PortPrivPtr pPPriv, ScrnInfoPtr pScrn)
pPPriv->rgb_fbuf.fmt.width = pScrn->virtualX;
pPPriv->rgb_fbuf.fmt.height = pScrn->virtualY;
pPPriv->rgb_fbuf.fmt.bytesperline = pScrn->displayWidth * ((pScrn->bitsPerPixel + 7)/8);
pPPriv->rgb_fbuf.base = (pointer)(pScrn->memPhysBase + pScrn->fbOffset);
pPPriv->rgb_fbuf.base = (void*)(pScrn->memPhysBase + pScrn->fbOffset);
if (first) {
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 2,
"v4l: memPhysBase=0x%lx\n", pScrn->memPhysBase);
@@ -461,7 +434,7 @@ static int
V4lPutVideo(ScrnInfoPtr pScrn,
short vid_x, short vid_y, short drw_x, short drw_y,
short vid_w, short vid_h, short drw_w, short drw_h,
RegionPtr clipBoxes, pointer data, DrawablePtr pDraw)
RegionPtr clipBoxes, void *data, DrawablePtr pDraw)
{
struct v4l2_format fmt;
@@ -520,9 +493,9 @@ V4lPutVideo(ScrnInfoPtr pScrn,
pPPriv->yuv_fbuf.fmt.width = pPPriv->surface->width;
pPPriv->yuv_fbuf.fmt.height = pPPriv->surface->height;
pPPriv->yuv_fbuf.fmt.bytesperline = pPPriv->surface->pitches[0];
pPPriv->yuv_fbuf.fmt.pixelformat = pPPriv->yuv_format;
pPPriv->yuv_fbuf.base =
(pointer)(pScrn->memPhysBase + pPPriv->surface->offsets[0]);
pPPriv->yuv_fbuf.fmt.pixelformat = pPPriv->yuv_format;
pPPriv->yuv_fbuf.base =
(void*)(pScrn->memPhysBase + pPPriv->surface->offsets[0]);
DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 2,
" surface: %p+%d = %p, %dx%d, pitch %d\n",
(void *)pScrn->memPhysBase, pPPriv->surface->offsets[0],
@@ -693,7 +666,7 @@ static int
V4lPutStill(ScrnInfoPtr pScrn,
short vid_x, short vid_y, short drw_x, short drw_y,
short vid_w, short vid_h, short drw_w, short drw_h,
RegionPtr clipBoxes, pointer data, DrawablePtr pDraw)
RegionPtr clipBoxes, void *data, DrawablePtr pDraw)
{
#if 0
PortPrivPtr pPPriv = (PortPrivPtr) data;
@@ -706,7 +679,7 @@ V4lPutStill(ScrnInfoPtr pScrn,
}
static void
V4lStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
V4lStopVideo(ScrnInfoPtr pScrn, void *data, Bool shutdown)
{
PortPrivPtr pPPriv = (PortPrivPtr) data;
int zero=0;
@@ -743,7 +716,7 @@ V4lStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
static int
V4lSetPortAttribute(ScrnInfoPtr pScrn,
Atom attribute, INT32 value, pointer data)
Atom attribute, INT32 value, void *data)
{
struct v4l2_control ctrl;
PortPrivPtr pPPriv = (PortPrivPtr) data;
@@ -809,7 +782,7 @@ err:
static int
V4lGetPortAttribute(ScrnInfoPtr pScrn,
Atom attribute, INT32 *value, pointer data)
Atom attribute, INT32 *value, void *data)
{
struct v4l2_control ctrl;
PortPrivPtr pPPriv = (PortPrivPtr) data;
@@ -864,7 +837,7 @@ err:
static void
V4lQueryBestSize(ScrnInfoPtr pScrn, Bool motion,
short vid_w, short vid_h, short drw_w, short drw_h,
unsigned int *p_w, unsigned int *p_h, pointer data)
unsigned int *p_w, unsigned int *p_h, void *data)
{
PortPrivPtr pPPriv = (PortPrivPtr) data;
int maxx = pPPriv->enc[pPPriv->cenc].width;
@@ -1001,13 +974,13 @@ V4LBuildEncodings(PortPrivPtr p, int fd)
for (std = 0; std < num_std; std++) {
int width, height;
/*
* Currently, this code is not reliable, due to driver
* non-compliance on both saa7134 and bttv. So, instead,
* just use the video standard information
*/
/*
* Currently, this code is not reliable, due to driver
* non-compliance on both saa7134 and bttv. So, instead,
* just use the video standard information
*/
#if 0
struct v4l2_framebuffer fbuf;
struct v4l2_framebuffer fbuf;
/* Some webcam drivers will fail here, but that's OK */
ioctl(fd, VIDIOC_S_STD, &p->standard[std].id);
@@ -1043,13 +1016,13 @@ V4LBuildEncodings(PortPrivPtr p, int fd)
}
}
#else
if (p->standard[std].id & V4L2_STD_525_60) {
height = 480;
width = 640;
} else {
height = 576;
width = 768;
}
if (p->standard[std].id & V4L2_STD_525_60) {
height = 480;
width = 640;
} else {
height = 576;
width = 768;
}
#endif
/* Fixup for some driver bug */
@@ -1215,7 +1188,7 @@ V4LInit(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr **adaptors)
if (!Private)
return FALSE;
memset(Private,0,sizeof(DevUnion));
Private->ptr = (pointer)pPPriv;
Private->ptr = pPPriv;
VAR[i]->pPortPrivates = Private;
VAR[i]->nPorts = 1;