mirror of
https://github.com/X11Libre/xf86-video-v4l.git
synced 2026-03-24 09:35:42 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38c90b5593 | ||
|
|
3a61617ccd | ||
|
|
852018599d |
65
.github/ISSUE_TEMPLATE/01-bug-report.yml
vendored
65
.github/ISSUE_TEMPLATE/01-bug-report.yml
vendored
@@ -1,65 +0,0 @@
|
||||
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.
|
||||
49
.github/ISSUE_TEMPLATE/02-feature-request.yml
vendored
49
.github/ISSUE_TEMPLATE/02-feature-request.yml
vendored
@@ -1,49 +0,0 @@
|
||||
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.
|
||||
49
.github/ISSUE_TEMPLATE/03-code-cleanup.yml
vendored
49
.github/ISSUE_TEMPLATE/03-code-cleanup.yml
vendored
@@ -1,49 +0,0 @@
|
||||
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.
|
||||
38
.github/ISSUE_TEMPLATE/04-doc-update.yml
vendored
38
.github/ISSUE_TEMPLATE/04-doc-update.yml
vendored
@@ -1,38 +0,0 @@
|
||||
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
43
.github/ISSUE_TEMPLATE/05-org-task.yml
vendored
@@ -1,43 +0,0 @@
|
||||
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
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +0,0 @@
|
||||
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
28
.github/workflows/build.yml
vendored
@@ -1,28 +0,0 @@
|
||||
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
1
.gitignore
vendored
@@ -7,6 +7,7 @@
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
autoscan.log
|
||||
ChangeLog
|
||||
compile
|
||||
config.guess
|
||||
config.h
|
||||
|
||||
6
.gitlab-ci.yml
Normal file
6
.gitlab-ci.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
variables:
|
||||
FDO_UPSTREAM_REPO: 'xorg/driver/xf86-video-v4l'
|
||||
FREEBSD_SKIP: 'true' # only works on Linux
|
||||
|
||||
include:
|
||||
- local: '.gitlab-ci/common/xorg-driver.yml'
|
||||
20
.gitlab-ci/common/README.md
Normal file
20
.gitlab-ci/common/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
common CI stuff - supposed to be synced across all drivers
|
||||
|
||||
moving this to a dedicated CI component is left for a later exercise.
|
||||
|
||||
Some scripts can also be used locally, eg. in a VM:
|
||||
|
||||
Prepare the image:
|
||||
|
||||
.gitlab-ci/common/debian/image-install.sh
|
||||
.gitlab-ci/common/freebsd/image-install.sh
|
||||
|
||||
Build the xserver + driver:
|
||||
|
||||
.gitlab-ci/common/build-driver.sh debian <xserver git ref>
|
||||
.gitlab-ci/common/build-driver.sh freebsd <xserver git ref>
|
||||
|
||||
Build just the xserver:
|
||||
|
||||
.gitlab-ci/common/build-xserver.sh debian <xserver git ref>
|
||||
.gitlab-ci/common/build-xserver.sh freebsd <xserver git ref>
|
||||
61
.gitlab-ci/common/build-driver.sh
Executable file
61
.gitlab-ci/common/build-driver.sh
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
PLATFORM="$1"
|
||||
XSERVER_REF="$2"
|
||||
|
||||
if [ ! "$PLATFORM" ]; then
|
||||
echo "missing PLATFORM" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! "$XSERVER_REF" ]; then
|
||||
echo "missing XSERVER_REF" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
.gitlab-ci/common/build-xserver.sh "$PLATFORM" "$XSERVER_REF"
|
||||
|
||||
MACH=`gcc -dumpmachine`
|
||||
echo "Building on machine $MACH"
|
||||
|
||||
case "$PLATFORM" in
|
||||
freebsd)
|
||||
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/libdata/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig"
|
||||
export ACLOCAL_PATH="/usr/share/aclocal:/usr/local/share/aclocal"
|
||||
export CFLAGS="$CFLAGS -I/usr/local/include"
|
||||
export UDEV_CFLAGS=" "
|
||||
export UDEV_LIBS=" "
|
||||
;;
|
||||
debian)
|
||||
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig"
|
||||
;;
|
||||
*)
|
||||
echo "unknown platform $PLATFORM" >&2
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -f autogen.sh ]; then
|
||||
(
|
||||
echo "building driver via autotools"
|
||||
rm -Rf _builddir
|
||||
mkdir -p _builddir
|
||||
cd _builddir
|
||||
../autogen.sh --disable-silent-rules
|
||||
make
|
||||
make check
|
||||
make distcheck
|
||||
)
|
||||
elif [ -f meson.build ]; then
|
||||
(
|
||||
echo "building driver via meson"
|
||||
meson setup _build
|
||||
cd _build
|
||||
meson compile
|
||||
meson install
|
||||
)
|
||||
else
|
||||
echo "failed detecting build system"
|
||||
exit 1
|
||||
fi
|
||||
71
.gitlab-ci/common/build-xserver.sh
Executable file
71
.gitlab-ci/common/build-xserver.sh
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
PLATFORM="$1"
|
||||
XSERVER_REF="$2"
|
||||
|
||||
if [ ! "$XSERVER_REF" ]; then
|
||||
echo "missing XSERVER_REF variable" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
XSERVER_CLONE=/tmp/xserver
|
||||
XSERVER_BUILD=$XSERVER_CLONE/_builddir
|
||||
XSERVER_REPO=https://gitlab.freedesktop.org/xorg/xserver.git
|
||||
|
||||
MACH=`gcc -dumpmachine`
|
||||
|
||||
export PKG_CONFIG_PATH="/usr/lib/$MACH/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"
|
||||
export PKG_CONFIG_PATH="/usr/local/lib/$MACH/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:$PKG_CONFIG_PATH"
|
||||
|
||||
echo "cloning xserver"
|
||||
rm -Rf $XSERVER_CLONE
|
||||
git clone --depth=1 -b $XSERVER_REF $XSERVER_REPO $XSERVER_CLONE
|
||||
|
||||
echo "checking platform: $PLATFORM"
|
||||
case "$PLATFORM" in
|
||||
freebsd)
|
||||
echo "Building on FreeBSD"
|
||||
XSERVER_OS_AUTOCONF_FLAGS="--without-dtrace"
|
||||
XSERVER_MESON_DISABLE="glx udev udev_kms"
|
||||
;;
|
||||
debian)
|
||||
echo "Building on Debian"
|
||||
;;
|
||||
*)
|
||||
echo "unknown platform $PLATFORM" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -f $XSERVER_CLONE/meson.build ]; then
|
||||
(
|
||||
echo "Building Xserver via meson"
|
||||
for opt in $XSERVER_MESON_DISABLE ; do
|
||||
if grep "'$opt'" $XSERVER_CLONE/meson_options.txt ; then
|
||||
echo "disable $opt"
|
||||
XSERVER_MESON_FLAGS="$XSERVER_MESON_FLAGS -D$opt=false"
|
||||
else
|
||||
echo "no option $opt"
|
||||
fi
|
||||
done
|
||||
mkdir -p $XSERVER_BUILD
|
||||
cd $XSERVER_BUILD
|
||||
meson setup --prefix=/usr $XSERVER_MESON_FLAGS
|
||||
meson compile
|
||||
meson install
|
||||
)
|
||||
else
|
||||
(
|
||||
echo "Building Xserver via autotools"
|
||||
cd $XSERVER_CLONE
|
||||
# Workaround glvnd having reset the version in gl.pc from what Mesa used
|
||||
# similar to xserver commit e6ef2b12404dfec7f23592a3524d2a63d9d25802
|
||||
sed -i -e 's/gl >= [79].[12].0/gl >= 1.2/' configure.ac
|
||||
./autogen.sh --prefix=/usr $XSERVER_AUTOCONF_FLAGS $XSERVER_OS_AUTOCONF_FLAGS
|
||||
make -j`nproc`
|
||||
make -j`nproc` install
|
||||
)
|
||||
fi
|
||||
88
.gitlab-ci/common/debian/image-install.sh
Executable file
88
.gitlab-ci/common/debian/image-install.sh
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
echo 'deb-src https://deb.debian.org/debian bullseye main' >>/etc/apt/sources.list.d/deb-src.list
|
||||
echo 'deb-src https://deb.debian.org/debian bullseye-updates main' >>/etc/apt/sources.list.d/deb-src.list
|
||||
apt-get update
|
||||
|
||||
apt-get autoremove -y --purge
|
||||
|
||||
apt-get install -y --no-remove \
|
||||
autoconf \
|
||||
automake \
|
||||
build-essential \
|
||||
libtool \
|
||||
pkg-config \
|
||||
ca-certificates \
|
||||
git \
|
||||
debian-archive-keyring \
|
||||
python3 python3-setuptools libxshmfence-dev \
|
||||
clang \
|
||||
libxvmc-dev libxcb1-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-util-dev \
|
||||
libxfixes-dev libxcb-xfixes0-dev libxrender-dev libxdamage-dev libxrandr-dev \
|
||||
libxcursor-dev libxss-dev libxinerama-dev libxtst-dev libpng-dev libssl-dev \
|
||||
libxcb-dri3-dev libxxf86vm-dev libxfont-dev libxkbfile-dev libdrm-dev \
|
||||
libgbm-dev libgl1-mesa-dev libpciaccess-dev libpixman-1-dev libudev-dev \
|
||||
libgcrypt-dev libepoxy-dev libevdev-dev libmtdev-dev libinput-dev \
|
||||
mesa-common-dev libspice-protocol-dev libspice-server-dev \
|
||||
meson \
|
||||
nettle-dev \
|
||||
pkg-config \
|
||||
valgrind \
|
||||
x11-xkb-utils xfonts-utils xutils-dev x11proto-dev
|
||||
|
||||
build_autoconf() {
|
||||
local subdir="$1"
|
||||
shift
|
||||
(
|
||||
cd $subdir
|
||||
./autogen.sh "$@"
|
||||
make -j${FDO_CI_CONCURRENT:-4}
|
||||
make -j${FDO_CI_CONCURRENT:-4} install
|
||||
)
|
||||
}
|
||||
|
||||
build_meson() {
|
||||
local subdir="$1"
|
||||
shift
|
||||
(
|
||||
cd $subdir
|
||||
meson _build -Dprefix=/usr "$@"
|
||||
ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
|
||||
)
|
||||
}
|
||||
|
||||
do_clone() {
|
||||
git clone "$1" --depth 1 --branch="$2"
|
||||
}
|
||||
|
||||
mkdir -p /tmp/build-deps
|
||||
cd /tmp/build-deps
|
||||
|
||||
# xserver 1.18 and older branches require libXfont 1.5 instead of 2.0
|
||||
echo "Installing libXfont 1.5"
|
||||
do_clone https://gitlab.freedesktop.org/xorg/lib/libXfont.git libXfont-1.5-branch
|
||||
build_autoconf libXfont
|
||||
|
||||
echo "Installing font-util"
|
||||
do_clone https://gitlab.freedesktop.org/xorg/font/util.git font-util-1.4.1
|
||||
build_autoconf util --prefix=/usr
|
||||
|
||||
echo "Installing libxcvt"
|
||||
do_clone https://gitlab.freedesktop.org/xorg/lib/libxcvt.git libxcvt-0.1.0
|
||||
build_meson libxcvt
|
||||
|
||||
# xserver requires xorgproto >= 2024.1 for XWAYLAND
|
||||
echo "Installing xorgproto"
|
||||
do_clone https://gitlab.freedesktop.org/xorg/proto/xorgproto.git xorgproto-2024.1
|
||||
build_autoconf xorgproto
|
||||
|
||||
# Xwayland requires drm 2.4.116 for drmSyncobjEventfd
|
||||
# xf86-video-freedreno and xf86-video-omap need extra features
|
||||
echo "Installing libdrm"
|
||||
do_clone https://gitlab.freedesktop.org/mesa/drm libdrm-2.4.116
|
||||
build_meson drm -Dfreedreno=enabled -Dnouveau=enabled -Domap=enabled
|
||||
|
||||
rm -Rf /tmp/build-deps
|
||||
8
.gitlab-ci/common/freebsd/FreeBSD.conf
Normal file
8
.gitlab-ci/common/freebsd/FreeBSD.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
# using the latest branch
|
||||
FreeBSD: {
|
||||
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
|
||||
mirror_type: "srv",
|
||||
signature_type: "fingerprints",
|
||||
fingerprints: "/usr/share/keys/pkg",
|
||||
enabled: yes
|
||||
}
|
||||
59
.gitlab-ci/common/freebsd/image-install.sh
Executable file
59
.gitlab-ci/common/freebsd/image-install.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# note: really wanna install to /usr/local, since that's explicitly searched first,
|
||||
# so we always catch the locally installed before any system/ports provided one
|
||||
# otherwise we might run into trouble like trying to use outdated xorgproto
|
||||
build_autoconf() {
|
||||
local subdir="$1"
|
||||
shift
|
||||
(
|
||||
cd $subdir
|
||||
./autogen.sh --prefix=/usr/local "$@"
|
||||
make -j${FDO_CI_CONCURRENT:-4}
|
||||
make -j${FDO_CI_CONCURRENT:-4} install
|
||||
)
|
||||
}
|
||||
|
||||
build_meson() {
|
||||
local subdir="$1"
|
||||
shift
|
||||
(
|
||||
cd $subdir
|
||||
meson _build -Dprefix=/usr/local "$@"
|
||||
ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
|
||||
)
|
||||
}
|
||||
|
||||
do_clone() {
|
||||
git clone "$1" --depth 1 --branch="$2"
|
||||
}
|
||||
|
||||
cp .gitlab-ci/common/freebsd/FreeBSD.conf /etc/pkg
|
||||
|
||||
pkg upgrade -f -y
|
||||
|
||||
pkg install -y \
|
||||
git gcc pkgconf autoconf automake libtool xorg-macros xorgproto meson \
|
||||
ninja pixman xtrans libXau libXdmcp libXfont libXfont2 libxkbfile libxcvt \
|
||||
libpciaccess font-util libepoll-shim libdrm mesa-libs libdrm libglu mesa-dri \
|
||||
libepoxy nettle xkbcomp libXvMC xcb-util valgrind libXcursor libXScrnSaver \
|
||||
libXinerama libXtst evdev-proto libevdev libmtdev libinput spice-protocol \
|
||||
libspice-server
|
||||
|
||||
[ -f /bin/bash ] || ln -sf /usr/local/bin/bash /bin/bash
|
||||
|
||||
# Xwayland requires drm 2.4.116 for drmSyncobjEventfd
|
||||
# xf86-video-freedreno and xf86-video-omap need extra features
|
||||
echo "Installing libdrm"
|
||||
do_clone https://gitlab.freedesktop.org/mesa/drm libdrm-2.4.116
|
||||
(
|
||||
cd drm
|
||||
git config user.email "buildbot@freebsd"
|
||||
git config user.name "FreeBSD build bot"
|
||||
git am ../.gitlab-ci/common/freebsd/libdrm-2.4.116.patch
|
||||
)
|
||||
build_meson drm -Dfreedreno=enabled -Dnouveau=enabled -Domap=enabled
|
||||
|
||||
echo "=== post-install script END"
|
||||
109
.gitlab-ci/common/freebsd/libdrm-2.4.116.patch
Normal file
109
.gitlab-ci/common/freebsd/libdrm-2.4.116.patch
Normal file
@@ -0,0 +1,109 @@
|
||||
From a87432dbb281ddf1c50a5e78091d38f0dac79416 Mon Sep 17 00:00:00 2001
|
||||
From: "Enrico Weigelt, metux IT consult" <info@metux.net>
|
||||
Date: Fri, 7 Jun 2024 15:18:47 +0200
|
||||
Subject: [PATCH 1/2] fix FTBS on FreeBSD (or non-Linux in general)
|
||||
|
||||
Several drivers still including <linux/stddef.h>, but not using anything
|
||||
from it, thus breaking build on non-Linux platforms (eg. FreeBSD).
|
||||
Since not needed at all, just stop including it.
|
||||
|
||||
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
|
||||
---
|
||||
etnaviv/etnaviv_device.c | 1 -
|
||||
exynos/exynos_drm.c | 1 -
|
||||
exynos/exynos_fimg2d.c | 1 -
|
||||
omap/omap_drm.c | 1 -
|
||||
tests/exynos/exynos_fimg2d_test.c | 1 -
|
||||
5 files changed, 5 deletions(-)
|
||||
|
||||
diff --git a/etnaviv/etnaviv_device.c b/etnaviv/etnaviv_device.c
|
||||
index 699df256..a63bd15d 100644
|
||||
--- a/etnaviv/etnaviv_device.c
|
||||
+++ b/etnaviv/etnaviv_device.c
|
||||
@@ -25,7 +25,6 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
-#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
diff --git a/exynos/exynos_drm.c b/exynos/exynos_drm.c
|
||||
index 3e322a17..fb4cd8de 100644
|
||||
--- a/exynos/exynos_drm.c
|
||||
+++ b/exynos/exynos_drm.c
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
-#include <linux/stddef.h>
|
||||
|
||||
#include <xf86drm.h>
|
||||
|
||||
diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c
|
||||
index ac6fa687..f0aee962 100644
|
||||
--- a/exynos/exynos_fimg2d.c
|
||||
+++ b/exynos/exynos_fimg2d.c
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
-#include <linux/stddef.h>
|
||||
|
||||
#include <xf86drm.h>
|
||||
|
||||
diff --git a/omap/omap_drm.c b/omap/omap_drm.c
|
||||
index aa273660..42d35ef7 100644
|
||||
--- a/omap/omap_drm.c
|
||||
+++ b/omap/omap_drm.c
|
||||
@@ -27,7 +27,6 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
-#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
diff --git a/tests/exynos/exynos_fimg2d_test.c b/tests/exynos/exynos_fimg2d_test.c
|
||||
index d85e2f6b..b1baa503 100644
|
||||
--- a/tests/exynos/exynos_fimg2d_test.c
|
||||
+++ b/tests/exynos/exynos_fimg2d_test.c
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
-#include <linux/stddef.h>
|
||||
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
--
|
||||
2.39.2
|
||||
|
||||
From 79123db12c6c5f42747fae02068b482055e8c376 Mon Sep 17 00:00:00 2001
|
||||
From: "Enrico Weigelt, metux IT consult" <info@metux.net>
|
||||
Date: Fri, 7 Jun 2024 15:43:13 +0200
|
||||
Subject: [PATCH 2/2] omap: fix FTBS on FreeBSD and drop unneeded include
|
||||
|
||||
No need to explicitly include <linux/types.h>, since drm.h already does that,
|
||||
but conditionally only Linux only.
|
||||
|
||||
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
|
||||
---
|
||||
omap/omap_drm.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/omap/omap_drm.c b/omap/omap_drm.c
|
||||
index 42d35ef7..93d2207f 100644
|
||||
--- a/omap/omap_drm.c
|
||||
+++ b/omap/omap_drm.c
|
||||
@@ -27,7 +27,6 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
-#include <linux/types.h>
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
--
|
||||
2.39.2
|
||||
|
||||
219
.gitlab-ci/common/xorg-driver.yml
Normal file
219
.gitlab-ci/common/xorg-driver.yml
Normal file
@@ -0,0 +1,219 @@
|
||||
# version 0.1.22
|
||||
variables:
|
||||
DEBIAN_VERSION: 'bookworm-slim'
|
||||
DEBIAN_TAG: "2025-03-07"
|
||||
DEBIAN_EXEC: 'bash .gitlab-ci/common/debian/image-install.sh'
|
||||
DEBIAN_SKIP: "false" # to enable, it has to be litterally "true"
|
||||
|
||||
FREEBSD_TAG: '2025-03-07'
|
||||
FREEBSD_VERSION: '14.2'
|
||||
# image is yet too small for that - need a more complicated way :(
|
||||
# FREEBSD_EXEC: "bash .gitlab-ci/common/freebsd/image-install.sh"
|
||||
FREEBSD_SKIP: "false" # to enable, it has to be litterally "true"
|
||||
|
||||
.templates_sha: &template_sha ef5e4669b7500834a17ffe9277e15fbb6d977fff # see https://docs.gitlab.com/ee/ci/yaml/#includefile
|
||||
|
||||
include:
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: *template_sha
|
||||
file: '/templates/debian.yml'
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: *template_sha
|
||||
file: '/templates/freebsd.yml'
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: *template_sha
|
||||
file: '/templates/ci-fairy.yml'
|
||||
- template: Security/SAST.gitlab-ci.yml
|
||||
|
||||
stages:
|
||||
- images
|
||||
- build
|
||||
- test
|
||||
|
||||
# standard commits quality check
|
||||
check-commits:
|
||||
extends:
|
||||
- .fdo.ci-fairy
|
||||
stage: test
|
||||
script:
|
||||
- ci-fairy check-commits --junit-xml=results.xml
|
||||
except:
|
||||
- master@$FDO_UPSTREAM_REPO
|
||||
variables:
|
||||
GIT_DEPTH: 100
|
||||
artifacts:
|
||||
reports:
|
||||
junit: results.xml
|
||||
allow_failure: true
|
||||
needs:
|
||||
|
||||
# standard merge request quality checks
|
||||
check-merge-request:
|
||||
extends:
|
||||
- .fdo.ci-fairy
|
||||
stage: test
|
||||
script:
|
||||
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
|
||||
artifacts:
|
||||
when: on_failure
|
||||
reports:
|
||||
junit: results.xml
|
||||
allow_failure: true
|
||||
needs:
|
||||
|
||||
# create debian build image
|
||||
image@debian@amd64:
|
||||
extends:
|
||||
- .xorg.distro@debian@amd64
|
||||
- .fdo.container-build@debian
|
||||
stage: images
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
rules:
|
||||
- if: $DEBIAN_SKIP != "true"
|
||||
when: always
|
||||
needs:
|
||||
|
||||
image@debian@i386:
|
||||
extends:
|
||||
- .xorg.distro@debian@i386
|
||||
- .fdo.container-build@debian
|
||||
stage: images
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
rules:
|
||||
- if: $DEBIAN_SKIP != "true"
|
||||
when: always
|
||||
needs:
|
||||
|
||||
# inherit this to define FDO_DISTRIBUTION_* variables for Debian
|
||||
.xorg.distro@debian@amd64:
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: "$DEBIAN_VERSION"
|
||||
FDO_DISTRIBUTION_EXEC: "$DEBIAN_EXEC"
|
||||
FDO_DISTRIBUTION_TAG: "amd64-$DEBIAN_TAG"
|
||||
FDO_DISTRIBUTION_PLATFORM: "amd64"
|
||||
FDO_BASE_IMAGE: "amd64/debian:$DEBIAN_VERSION"
|
||||
|
||||
.xorg.distro@debian@i386:
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: "$DEBIAN_VERSION"
|
||||
FDO_DISTRIBUTION_EXEC: "$DEBIAN_EXEC"
|
||||
FDO_DISTRIBUTION_TAG: "i386-$DEBIAN_TAG"
|
||||
FDO_DISTRIBUTION_PLATFORM: "i386"
|
||||
FDO_BASE_IMAGE: "i386/debian:$DEBIAN_VERSION"
|
||||
|
||||
# overwrite this one if another matrix is needed
|
||||
.xorg.driver_matrix@debian:
|
||||
parallel:
|
||||
matrix:
|
||||
- CC: [ "gcc", "clang" ]
|
||||
XSERVER_REF: [
|
||||
# these break on Debian
|
||||
# "xorg-server-1.18.4",
|
||||
# "xorg-server-1.19.7",
|
||||
# "xorg-server-1.20.14",
|
||||
# "xorg-server-21.0.99.1",
|
||||
"xorg-server-21.1.16",
|
||||
"master"
|
||||
]
|
||||
|
||||
# default build with meson on Debian
|
||||
.xorg.driver_common@debian:
|
||||
needs:
|
||||
- image@debian@i386
|
||||
- image@debian@amd64
|
||||
extends:
|
||||
- .fdo.distribution-image@debian
|
||||
stage: build
|
||||
script:
|
||||
- .gitlab-ci/common/build-driver.sh "debian" "$XSERVER_REF"
|
||||
variables:
|
||||
CFLAGS: "-pipe -g -O2"
|
||||
rules:
|
||||
- if: $DEBIAN_SKIP != "true"
|
||||
when: always
|
||||
|
||||
# overwrite this when you need some special Debian build
|
||||
build@debian@amd64:
|
||||
extends:
|
||||
- .xorg.driver_matrix@debian
|
||||
- .xorg.driver_common@debian
|
||||
- .xorg.distro@debian@amd64
|
||||
|
||||
build@debian@i386:
|
||||
extends:
|
||||
- .xorg.driver_matrix@debian
|
||||
- .xorg.driver_common@debian
|
||||
- .xorg.distro@debian@i386
|
||||
|
||||
# inherit this to define FDO_DISTRIBUTION_* variables for FreeBSD
|
||||
.xorg.distro@freebsd:
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: "$FREEBSD_VERSION"
|
||||
FDO_DISTRIBUTION_EXEC: "$FREEBSD_EXEC"
|
||||
FDO_DISTRIBUTION_TAG: "$FREEBSD_TAG"
|
||||
|
||||
# create base image for FreeBSD
|
||||
image@freebsd:
|
||||
extends:
|
||||
- .xorg.distro@freebsd
|
||||
- .fdo.qemu-build@freebsd@x86_64
|
||||
stage: images
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
rules:
|
||||
- if: $FREEBSD_SKIP != "true"
|
||||
when: always
|
||||
|
||||
# inherit this to get the default build matrix
|
||||
.xorg.driver_matrix@freebsd:
|
||||
parallel:
|
||||
matrix:
|
||||
- CC: [ "gcc", "clang" ]
|
||||
XSERVER_REF: [
|
||||
# "xorg-server-1.18.4", # this breaks due name clash on "bool"
|
||||
# "xorg-server-1.19.7",
|
||||
# "xorg-server-1.20.14", # breaks meson ... see: 331850ce6f0c48a1cfc489da2a27ca0220997a2f -- server-1.20-branch
|
||||
"xorg-server-21.0.99.1",
|
||||
"xorg-server-21.1.16",
|
||||
"master"
|
||||
]
|
||||
|
||||
# common build for driver on FreeBSD. meson and autoconf are both handled by this
|
||||
.xorg.driver_common@freebsd:
|
||||
needs:
|
||||
- image@freebsd
|
||||
stage: build
|
||||
extends:
|
||||
- .fdo.distribution-image@freebsd
|
||||
- .xorg.distro@freebsd
|
||||
script:
|
||||
# FIXME: increasing image and running image-install.sh should be done
|
||||
# at container image build time, but would have to replicate too much
|
||||
# of the cbuild script here. better wait until CI folks have increased
|
||||
# the image size or provide hooks for that
|
||||
- xz -d -T0 /app/image.raw.xz
|
||||
- rm -f /app/image.raw.xz
|
||||
- truncate -s +5G /app/image.raw
|
||||
- /app/vmctl start
|
||||
- set +e
|
||||
- /app/vmctl exec "service growfs onestart"
|
||||
- scp -r $PWD "vm:"
|
||||
- /app/vmctl exec "cd $CI_PROJECT_NAME && .gitlab-ci/common/freebsd/image-install.sh"
|
||||
- /app/vmctl exec "cd $CI_PROJECT_NAME && .gitlab-ci/common/build-driver.sh freebsd $XSERVER_REF" && touch .success
|
||||
# copy any test results from the VM to our container so we can
|
||||
# save them as artifacts
|
||||
- scp -r vm:$CI_PROJECT_NAME/test-results.xml . || true # this is allowed to fail
|
||||
- /app/vmctl stop
|
||||
- set -e
|
||||
- test -e .success || exit 1
|
||||
rules:
|
||||
- if: $FREEBSD_SKIP != "true"
|
||||
when: always
|
||||
|
||||
# overwrite this if you need some special FreeBSD build
|
||||
build@freebsd:
|
||||
extends:
|
||||
- .xorg.driver_matrix@freebsd
|
||||
- .xorg.driver_common@freebsd
|
||||
31
Makefile.am
31
Makefile.am
@@ -1 +1,32 @@
|
||||
# Copyright 2005 Adam Jackson.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
SUBDIRS = src man
|
||||
MAINTAINERCLEANFILES = ChangeLog INSTALL
|
||||
|
||||
.PHONY: ChangeLog INSTALL
|
||||
|
||||
INSTALL:
|
||||
$(INSTALL_CMD)
|
||||
|
||||
ChangeLog:
|
||||
$(CHANGELOG_CMD)
|
||||
|
||||
dist-hook: ChangeLog INSTALL
|
||||
|
||||
79
configure.ac
79
configure.ac
@@ -1,10 +1,77 @@
|
||||
# Copyright 2005 Adam Jackson.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Process this file with autoconf to produce a configure script
|
||||
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xlibre-xf86-video-v4l],
|
||||
[25.0.1],
|
||||
[https://github.com/X11Libre/xf86-video-v4l/issues],
|
||||
[xlibre-xf86-video-v4l])
|
||||
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(.)
|
||||
|
||||
XLIBRE_INIT_MODULE_AM(v4l)
|
||||
# Initialize Automake
|
||||
AM_INIT_AUTOMAKE([foreign dist-xz])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
|
||||
# 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_OUTPUT
|
||||
|
||||
@@ -1,12 +1,41 @@
|
||||
# SPDX-License-Identifier: MIT OR X11
|
||||
#
|
||||
# Copyright © 2026 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
drvmandir = @xlibre_driver_man_dir@
|
||||
drvman_DATA = @xlibre_driver_name@.@xlibre_driver_man_section@
|
||||
drivermandir = $(DRIVER_MAN_DIR)
|
||||
|
||||
CLEANFILES = $(drvman_DATA)
|
||||
driverman_PRE = @DRIVER_NAME@.man
|
||||
|
||||
.man.@xlibre_driver_man_section@:
|
||||
cp $< $@
|
||||
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) < $< > $@
|
||||
|
||||
29
man/v4l.man
29
man/v4l.man
@@ -1,6 +1,7 @@
|
||||
.\" $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 4 2026-01-30 "X Version 11"
|
||||
.TH V4L __drivermansuffix__ __vendorversion__
|
||||
.SH NAME
|
||||
v4l \- video4linux driver
|
||||
.SH SYNOPSIS
|
||||
@@ -11,15 +12,11 @@ v4l \- video4linux driver
|
||||
.B EndSection
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.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.
|
||||
.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.
|
||||
.P
|
||||
Note that the extmod module is also required for the Xvideo
|
||||
support (and lots of other extensions too).
|
||||
@@ -33,14 +30,10 @@ overlay.
|
||||
bt848/bt878-based TV cards are the most popular hardware these
|
||||
days.
|
||||
.SH CONFIGURATION DETAILS
|
||||
Please refer to
|
||||
.BR xorg.conf (5)
|
||||
for general configuration details.
|
||||
This section only covers configuration details specific to this driver.
|
||||
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
|
||||
details. This section only covers configuration details specific to this
|
||||
driver.
|
||||
.SH "SEE ALSO"
|
||||
.BR Xorg (1),
|
||||
.BR Xserver (1),
|
||||
.BR xorg.conf (5),
|
||||
.BR X (7)
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
|
||||
.SH AUTHORS
|
||||
Authors include: Gerd Knorr <kraxel@bytesex.org>
|
||||
|
||||
@@ -1,12 +1,33 @@
|
||||
# SPDX-License-Identifier: MIT OR X11
|
||||
# Copyright 2005 Adam Jackson.
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
|
||||
AM_CFLAGS = $(XLIBRE_SERVER_CFLAGS)
|
||||
|
||||
# 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)
|
||||
v4l_drv_la_LTLIBRARIES = v4l_drv.la
|
||||
v4l_drv_la_LDFLAGS = -module -avoid-version
|
||||
v4l_drv_ladir = @xlibre_video_drivers_dir@
|
||||
v4l_drv_la_LDFLAGS = -module -avoid-version
|
||||
v4l_drv_ladir = @moduledir@/drivers
|
||||
|
||||
v4l_drv_la_SOURCES = v4l.c videodev2.h
|
||||
v4l_drv_la_SOURCES = \
|
||||
v4l.c \
|
||||
videodev2.h
|
||||
|
||||
114
src/v4l.c
114
src/v4l.c
@@ -3,27 +3,42 @@
|
||||
* 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 <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
#include <X11/extensions/Xv.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "xf86.h"
|
||||
#include "xf86fbman.h"
|
||||
#include "xf86xv.h"
|
||||
#include "fourcc.h"
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.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 */
|
||||
|
||||
#if 0
|
||||
# define DEBUG(x) (x)
|
||||
@@ -52,6 +67,8 @@ _X_EXPORT DriverRec V4L = {
|
||||
.driverFunc = NULL, /* FIXME: Need to implement for new probing mode */
|
||||
};
|
||||
|
||||
#ifdef XFree86LOADER
|
||||
|
||||
static MODULESETUPPROTO(v4lSetup);
|
||||
|
||||
static XF86ModuleVersionInfo v4lVersRec =
|
||||
@@ -70,8 +87,8 @@ static XF86ModuleVersionInfo v4lVersRec =
|
||||
|
||||
_X_EXPORT XF86ModuleData v4lModuleData = { &v4lVersRec, v4lSetup, NULL };
|
||||
|
||||
static void*
|
||||
v4lSetup(void *module, void *opts, int *errmaj, int *errmin)
|
||||
static pointer
|
||||
v4lSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||
{
|
||||
static Bool setupDone = FALSE;
|
||||
|
||||
@@ -83,9 +100,16 @@ v4lSetup(void *module, void *opts, int *errmaj, int *errmin)
|
||||
|
||||
setupDone = TRUE;
|
||||
xf86AddDriver (&V4L, module, 0);
|
||||
return (void*)1;
|
||||
return (pointer)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) */
|
||||
@@ -143,7 +167,8 @@ typedef struct _PortPrivRec {
|
||||
|
||||
static Atom xvEncoding, xvFreq;
|
||||
|
||||
static XF86VideoFormatRec InputVideoFormats[] = {
|
||||
static XF86VideoFormatRec
|
||||
InputVideoFormats[] = {
|
||||
{ 15, TrueColor },
|
||||
{ 16, TrueColor },
|
||||
{ 24, TrueColor },
|
||||
@@ -153,10 +178,10 @@ static XF86VideoFormatRec InputVideoFormats[] = {
|
||||
#define V4L_ATTR (sizeof(Attributes) / sizeof(XF86AttributeRec))
|
||||
|
||||
static const XF86AttributeRec Attributes[] = {
|
||||
{XvSettable | XvGettable, -1000, 1000, (char*)XV_ENCODING},
|
||||
{XvSettable | XvGettable, -1000, 1000, XV_ENCODING},
|
||||
};
|
||||
static const XF86AttributeRec FreqAttr =
|
||||
{XvSettable | XvGettable, 0, 16*1000, (char*)XV_FREQ};
|
||||
{XvSettable | XvGettable, 0, 16*1000, XV_FREQ};
|
||||
|
||||
|
||||
#define MAX_V4L_DEVICES 4
|
||||
@@ -175,6 +200,8 @@ static struct V4L_DEVICE {
|
||||
{ -1 },
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
static int SetV4LFmt(int fd, CARD32 pixelformat)
|
||||
{
|
||||
struct v4l2_framebuffer fbuf;
|
||||
@@ -197,7 +224,6 @@ 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;
|
||||
@@ -219,6 +245,7 @@ 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) {
|
||||
@@ -388,7 +415,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 = (void*)(pScrn->memPhysBase + pScrn->fbOffset);
|
||||
pPPriv->rgb_fbuf.base = (pointer)(pScrn->memPhysBase + pScrn->fbOffset);
|
||||
if (first) {
|
||||
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 2,
|
||||
"v4l: memPhysBase=0x%lx\n", pScrn->memPhysBase);
|
||||
@@ -434,7 +461,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, void *data, DrawablePtr pDraw)
|
||||
RegionPtr clipBoxes, pointer data, DrawablePtr pDraw)
|
||||
{
|
||||
struct v4l2_format fmt;
|
||||
|
||||
@@ -493,9 +520,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 =
|
||||
(void*)(pScrn->memPhysBase + pPPriv->surface->offsets[0]);
|
||||
pPPriv->yuv_fbuf.fmt.pixelformat = pPPriv->yuv_format;
|
||||
pPPriv->yuv_fbuf.base =
|
||||
(pointer)(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],
|
||||
@@ -666,7 +693,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, void *data, DrawablePtr pDraw)
|
||||
RegionPtr clipBoxes, pointer data, DrawablePtr pDraw)
|
||||
{
|
||||
#if 0
|
||||
PortPrivPtr pPPriv = (PortPrivPtr) data;
|
||||
@@ -679,7 +706,7 @@ V4lPutStill(ScrnInfoPtr pScrn,
|
||||
}
|
||||
|
||||
static void
|
||||
V4lStopVideo(ScrnInfoPtr pScrn, void *data, Bool shutdown)
|
||||
V4lStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
|
||||
{
|
||||
PortPrivPtr pPPriv = (PortPrivPtr) data;
|
||||
int zero=0;
|
||||
@@ -716,7 +743,7 @@ V4lStopVideo(ScrnInfoPtr pScrn, void *data, Bool shutdown)
|
||||
|
||||
static int
|
||||
V4lSetPortAttribute(ScrnInfoPtr pScrn,
|
||||
Atom attribute, INT32 value, void *data)
|
||||
Atom attribute, INT32 value, pointer data)
|
||||
{
|
||||
struct v4l2_control ctrl;
|
||||
PortPrivPtr pPPriv = (PortPrivPtr) data;
|
||||
@@ -782,7 +809,7 @@ err:
|
||||
|
||||
static int
|
||||
V4lGetPortAttribute(ScrnInfoPtr pScrn,
|
||||
Atom attribute, INT32 *value, void *data)
|
||||
Atom attribute, INT32 *value, pointer data)
|
||||
{
|
||||
struct v4l2_control ctrl;
|
||||
PortPrivPtr pPPriv = (PortPrivPtr) data;
|
||||
@@ -837,7 +864,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, void *data)
|
||||
unsigned int *p_w, unsigned int *p_h, pointer data)
|
||||
{
|
||||
PortPrivPtr pPPriv = (PortPrivPtr) data;
|
||||
int maxx = pPPriv->enc[pPPriv->cenc].width;
|
||||
@@ -887,9 +914,12 @@ AddV4LEnc(XF86VideoEncodingPtr enc, int entry,
|
||||
{
|
||||
char *name;
|
||||
|
||||
#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(10, 0)
|
||||
if (asprintf(&name, "%s-%s", norm, fixname(input)) < 0)
|
||||
name = NULL;
|
||||
|
||||
#else
|
||||
name = Xprintf("%s-%s", norm, fixname(input));
|
||||
#endif
|
||||
if (name == NULL)
|
||||
return -1;
|
||||
|
||||
@@ -974,13 +1004,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);
|
||||
@@ -1016,13 +1046,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 */
|
||||
@@ -1188,7 +1218,7 @@ V4LInit(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr **adaptors)
|
||||
if (!Private)
|
||||
return FALSE;
|
||||
memset(Private,0,sizeof(DevUnion));
|
||||
Private->ptr = pPPriv;
|
||||
Private->ptr = (pointer)pPPriv;
|
||||
VAR[i]->pPortPrivates = Private;
|
||||
VAR[i]->nPorts = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user