initial import

This commit is contained in:
2025-06-22 20:39:04 -05:00
commit f8a70886f0
3428 changed files with 302546 additions and 0 deletions

View File

@@ -0,0 +1,99 @@
From d39197bb10b7d88cb4c456e7a5e8d34c1dc6eeaf Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu, 21 Jul 2016 12:33:29 +0100
Subject: [PATCH] legacy/i810: Fix compilation with Video ABI 23 changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
src/legacy/i810/i810_video.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c
index be49b91d..af683c81 100644
--- a/src/legacy/i810/i810_video.c
+++ b/src/legacy/i810/i810_video.c
@@ -77,7 +77,11 @@ static int I810PutImage( ScrnInfoPtr,
static int I810QueryImageAttributes(ScrnInfoPtr,
int, unsigned short *, unsigned short *, int *, int *);
+#if !HAVE_NOTIFY_FD
static void I810BlockHandler(BLOCKHANDLER_ARGS_DECL);
+#else
+static void I810BlockHandler(void *data, void *_timeout);
+#endif
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
@@ -418,8 +422,14 @@ I810SetupImageVideo(ScreenPtr screen)
pI810->adaptor = adapt;
+#if !HAVE_NOTIFY_FD
pI810->BlockHandler = screen->BlockHandler;
screen->BlockHandler = I810BlockHandler;
+#else
+ RegisterBlockAndWakeupHandlers(I810BlockHandler,
+ (ServerWakeupHandlerProcPtr)NoopDDA,
+ pScrn);
+#endif
xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
xvContrast = MAKE_ATOM("XV_CONTRAST");
@@ -1135,6 +1145,7 @@ I810QueryImageAttributes(
return size;
}
+#if !HAVE_NOTIFY_FD
static void
I810BlockHandler (BLOCKHANDLER_ARGS_DECL)
{
@@ -1172,6 +1183,38 @@ I810BlockHandler (BLOCKHANDLER_ARGS_DECL)
}
}
}
+#else
+static void
+I810BlockHandler(void *data, void *_timeout)
+{
+ ScrnInfoPtr pScrn = data;
+ I810Ptr pI810 = I810PTR(pScrn);
+ I810PortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn);
+ I810OverlayRegPtr overlay = (I810OverlayRegPtr) (pI810->FbBase + pI810->OverlayStart);
+
+ if(pPriv->videoStatus & TIMER_MASK) {
+ UpdateCurrentTime();
+ if(pPriv->videoStatus & OFF_TIMER) {
+ if(pPriv->offTime < currentTime.milliseconds) {
+ /* Turn off the overlay */
+ overlay->OV0CMD &= 0xFFFFFFFE;
+ OVERLAY_UPDATE(pI810->OverlayPhysical);
+
+ pPriv->videoStatus = FREE_TIMER;
+ pPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
+ }
+ } else { /* FREE_TIMER */
+ if(pPriv->freeTime < currentTime.milliseconds) {
+ if(pPriv->linear) {
+ xf86FreeOffscreenLinear(pPriv->linear);
+ pPriv->linear = NULL;
+ }
+ pPriv->videoStatus = 0;
+ }
+ }
+ }
+}
+#endif
/***************************************************************************
@@ -1373,7 +1416,6 @@ I810DisplaySurface(
UpdateCurrentTime();
pI810Priv->videoStatus = FREE_TIMER;
pI810Priv->freeTime = currentTime.milliseconds + FREE_DELAY;
- pScrn->pScreen->BlockHandler = I810BlockHandler;
}
return Success;
--
2.12.2

View File

@@ -0,0 +1,47 @@
From 9e6e003e3468dca674ac848e2669af973da02fd4 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 6 Mar 2018 12:07:46 -0500
Subject: [PATCH] Fix build on i686
Presumably this only matters for i686 because amd64 implies sse2, but:
BUILDSTDERR: In file included from gen4_vertex.c:34:
BUILDSTDERR: gen4_vertex.c: In function 'emit_vertex':
BUILDSTDERR: sna_render_inline.h:40:26: error: inlining failed in call to always_inline 'vertex_emit_2s': target specific option mismatch
BUILDSTDERR: static force_inline void vertex_emit_2s(struct sna *sna, int16_t x, int16_t y)
BUILDSTDERR: ^~~~~~~~~~~~~~
BUILDSTDERR: gen4_vertex.c:308:25: note: called from here
BUILDSTDERR: #define OUT_VERTEX(x,y) vertex_emit_2s(sna, x,y) /* XXX assert(!too_large(x, y)); */
BUILDSTDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: gen4_vertex.c:360:2: note: in expansion of macro 'OUT_VERTEX'
BUILDSTDERR: OUT_VERTEX(dstX, dstY);
BUILDSTDERR: ^~~~~~~~~~
The bug here appears to be that emit_vertex() is declared 'sse2' but
vertex_emit_2s is merely always_inline. gcc8 decides that since you said
always_inline you need to have explicitly cloned it for every
permutation of targets. Merely saying inline seems to do the job of
cloning vertex_emit_2s as much as necessary.
So to reiterate: if you say always-inline, it won't, but if you just say
maybe inline, it will. Thanks gcc, that's helpful.
---
src/sna/compiler.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sna/compiler.h b/src/sna/compiler.h
index 0f3775ec..2e579b15 100644
--- a/src/sna/compiler.h
+++ b/src/sna/compiler.h
@@ -32,7 +32,7 @@
#define likely(expr) (__builtin_expect (!!(expr), 1))
#define unlikely(expr) (__builtin_expect (!!(expr), 0))
#define noinline __attribute__((noinline))
-#define force_inline inline __attribute__((always_inline))
+#define force_inline inline /* __attribute__((always_inline)) */
#define fastcall __attribute__((regparm(3)))
#define must_check __attribute__((warn_unused_result))
#define constant __attribute__((const))
--
2.12.2

View File

@@ -0,0 +1,77 @@
# Maintainer: Jesus E. <heckyel@riseup.net>
# Based on xf86-video-intel package
pkgname=xenocara-video-intel-debug
_openbsdver=6.9
pkgver=2.99.916
pkgrel=2
pkgdesc="Xenocara Intel i810/i830/i915/945G/G965+ video drivers"
arch=('i686' 'x86_64')
url="https://www.xenocara.org"
license=('Expat')
install="$pkgname.install"
depends=('mesa-dri' 'libxvmc' 'pixman' 'xcb-util>=0.4.0' 'libeudev')
makedepends=('xenocara-server-devel' 'X-ABI-VIDEODRV_VERSION=24.0' 'libx11' 'libxrender' 'xenocara-util-macros'
# additional deps for intel-virtual-output
'libxrandr' 'libxinerama' 'libxcursor' 'libxtst' 'libxss')
optdepends=('libxrandr: for intel-virtual-output'
'libxinerama: for intel-virtual-output'
'libxcursor: for intel-virtual-output'
'libxtst: for intel-virtual-output'
'libxss: for intel-virtual-output')
provides=('xf86-video-intel' 'xf86-video-intel-uxa' 'xf86-video-intel-sna')
conflicts=('xf86-video-intel' 'xenocara-server<1.20' 'X-ABI-VIDEODRV_VERSION<24' 'X-ABI-VIDEODRV_VERSION>=25'
'xf86-video-intel-sna' 'xf86-video-intel-uxa' 'xf86-video-i810' 'xf86-video-intel-legacy')
replaces=('xf86-video-intel' 'xf86-video-intel-uxa' 'xf86-video-intel-sna' 'xorg-video-intel-debug')
groups=('xenocara-video-drivers-debug' 'xenocara-video-debug' 'xenocara-drivers-debug'
'xorg-video-drivers-debug' 'xorg-video-debug' 'xorg-drivers-debug')
source=(https://repo.hyperbola.info:50000/sources/xenocara-libre/$_openbsdver/driver/xf86-video-intel-$pkgver.tar.lz{,.sig}
include-missing-sys-sysmacros-h.patch
0001-legacy-i810-Fix-compilation-with-Video-ABI-23-change.patch
0002-Fix-build-on-i686.patch)
options=(!strip) # It's required for debug packages
sha512sums=('7dbc8fd96e7d20438fb6805eac445fef3ba5e1f0374d1e1c3434e145d7cbac8fd2cc8e46a2e8036993c005ac6c5a0757eb4f646ee0a769f174d2e0646feeec8f'
'SKIP'
'315a0fbb559cfc57dc5a012a4c1fa4d5105bd73bf84195af8d21b5926460110f413ee500b507a988caa5c2c7a1b755e23caecd5ba942f09d54f24b54e780d7b8'
'579135d097f324eae2c471ab18a0296f201acebfa5785b4f71c8666b0aa268cf596d28f34e285a4fb5ddaab195d46efea39638c6bffea9169d07d1ff50147c3b'
'2fed088c25bf6b439783ea53e1fdf445eecf46a2fb75ca715df9db3b4f29309f3627e517bcb639a60bad7287ca99bd1deb7f18224393fe43e2f7d7e42caab2cc')
validpgpkeys=('C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva
prepare() {
cd "xenocara-$_openbsdver/driver/xf86-video-intel"
patch -p1 -i "$srcdir/include-missing-sys-sysmacros-h.patch"
patch -p1 -i "$srcdir/0001-legacy-i810-Fix-compilation-with-Video-ABI-23-change.patch"
patch -p1 -i "$srcdir/0002-Fix-build-on-i686.patch"
autoreconf -vfi
}
build() {
cd "xenocara-$_openbsdver/driver/xf86-video-intel"
# Since pacman 5.0.2-2, hardened flags are now enabled in makepkg.conf
# With them, module fail to load with undefined symbol.
# See https://bugs.archlinux.org/task/55102 / https://bugs.archlinux.org/task/54845
export CFLAGS=${CFLAGS/-fno-plt}
export CXXFLAGS=${CXXFLAGS/-fno-plt}
export LDFLAGS=${LDFLAGS/,-z,now}
# It's required for debug packages
export CFLAGS=${CFLAGS/-O2/-O0 -g3}
export CXXFLAGS=${CXXFLAGS/-O2/-O0 -g3}
./configure --prefix=/usr \
--with-default-dri=3
make
}
check() {
cd "xenocara-$_openbsdver/driver/xf86-video-intel"
make check
}
package() {
cd "xenocara-$_openbsdver/driver/xf86-video-intel"
make DESTDIR="$pkgdir" install
install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

View File

@@ -0,0 +1,39 @@
diff --git a/src/backlight.c b/src/backlight.c
index 129afea6..33c58b9a 100644
--- a/src/backlight.c
+++ b/src/backlight.c
@@ -34,6 +34,8 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
+#include <sys/sysmacros.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/intel_device.c b/src/intel_device.c
index 5d4398d7..ff96ab27 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -38,6 +38,8 @@
#include <dirent.h>
#include <errno.h>
+#include <sys/sysmacros.h>
+
#include <pciaccess.h>
#include <xorg-server.h>
diff --git a/tools/backlight_helper.c b/tools/backlight_helper.c
index 8b2667dc..51d2fffc 100644
--- a/tools/backlight_helper.c
+++ b/tools/backlight_helper.c
@@ -9,6 +9,8 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
+
#define DBG 0
#if defined(__GNUC__) && (__GNUC__ > 3)

View File

@@ -0,0 +1,21 @@
post_install() {
cat <<MSG
>>> This driver now uses DRI3 as the default Direct Rendering
Infrastructure. You can try falling back to DRI2 if you run
into trouble. To do so, save a file with the following
content as /etc/X11/xorg.conf.d/20-intel.conf :
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "DRI" "2" # DRI3 is now default
#Option "AccelMethod" "sna" # default
#Option "AccelMethod" "uxa" # fallback
EndSection
MSG
}
post_upgrade() {
if [ $(vercmp $2 2.99.917-1) -lt 0 ]; then
post_install
fi
}