x11-drivers/xf86-video-intel: Update snapshot

Update the snapshot of x11-driver/xf86-video-intel
- Fix build with -fno-common
- Fix MIT-SHM detection
- Drop SNA/UXA options in favor of xorg.conf(5)
- Add hyphen to output names for consistency with modesetting(4x)
- Add UDEV and XVMC options
- Add "make test" support
- Drop unused dependencies
- Switch to upstream versioning scheme
- Document all patches
- Simplify and deprecate _WITH_GETLINE
- Fix most style warnings

PR:		236003
Submitted by:	jbiech
MFH:		2020Q3
This commit is contained in:
Niclas Zeising 2020-08-18 22:07:48 +00:00
parent 8c67899b63
commit 3ba1b802b2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=545262
11 changed files with 315 additions and 98 deletions

View File

@ -2,42 +2,52 @@
# $FreeBSD$
PORTNAME= xf86-video-intel
PORTVERSION= 2.99.917.20181203
PORTREVISION= 1
DISTVERSION= 2.99.917-909
DISTVERSIONSUFFIX= -g${GL_COMMIT:C/(.{12}).*/\1/}
PORTEPOCH= 1
CATEGORIES= x11-drivers
MAINTAINER= x11@FreeBSD.org
COMMENT= Driver for Intel integrated graphics chipsets
COMMENT= X.Org legacy driver for Intel integrated graphics chipsets
LICENSE= MIT # various
LICENSE_FILE= ${WRKSRC}/COPYING
ONLY_FOR_ARCHS= amd64 i386
ONLY_FOR_ARCHS_REASON= Intel integrated GPU only exists in Intel x86 processors/chipsets
ONLY_FOR_ARCHS_REASON= Only Intel integrated GPUs on x86 are supported
LIB_DEPENDS= libxcb-util.so:x11/xcb-util \
libdrm.so:graphics/libdrm
USES= cpe gl xorg xorg-cat:driver
USE_GITLAB= yes
GL_COMMIT= e5ff8e1828f97891c819c919d7115c6e18b2eb1f
USE_GL= gl
USE_XORG= pciaccess pixman x11 xcb xext xrender xv xvmc
USE_LDCONFIG= yes
LIB_DEPENDS= libdrm_intel.so:graphics/libdrm
USES= cpe localbase xorg xorg-cat:driver
CPE_VENDOR= x
USE_GITLAB= yes
GL_COMMIT= 5ca3ac1a90af177eb111a965e9b4dd8a27cc58fc
USE_XORG= pciaccess pixman
CONFIGURE_ENV= ac_cv_header_sys_sysinfo_h=no # XXX ports/242236
CONFIGURE_ARGS= --with-builderstring="${DISTVERSIONFULL}"
TEST_TARGET= check
OPTIONS_SINGLE= ACCEL
OPTIONS_SINGLE_ACCEL= SNA UXA
OPTIONS_DEFAULT= UXA
# XXX bug 214593: SNA crashes on pre-SandyBridge hardware
CONFIGURE_ARGS+=--with-default-accel=uxa
# XXX Remove after FreeBSD 11 EOL
CPPFLAGS+= -D_WITH_GETLINE
ACCEL_DESC= Default AccelMethod (if not specified in xorg.conf)
SNA_DESC= SandyBridge's New Acceleration
UXA_DESC= Unified Acceleration Architecture
OPTIONS_DEFINE= UDEV XVMC
OPTIONS_DEFAULT=UDEV XVMC
OPTIONS_SUB= yes
CONFIGURE_ARGS+= --disable-udev
UDEV_DESC= udev-based monitor hotplug detection
UDEV_LIB_DEPENDS= libudev.so:devel/libudev-devd
UDEV_CONFIGURE_ENABLE= udev
SNA_CONFIGURE_ON= --with-default-accel=sna
UXA_CONFIGURE_ON= --with-default-accel=uxa
XVMC_LIB_DEPENDS= libxcb-util.so:x11/xcb-util
XVMC_USE= XORG=x11,xcb,xvmc
XVMC_CONFIGURE_ENABLE= xvmc
XVMC_VARS= USE_LDCONFIG=yes
post-patch:
.if ${CONFIGURE_ARGS:M--with-default-accel=uxa}
@${REINPLACE_CMD} '/^Default/s/SNA/UXA/' ${WRKSRC}/man/intel.man
.endif
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1561472772
SHA256 (xorg/driver/driver-xf86-video-intel-e5ff8e1828f97891c819c919d7115c6e18b2eb1f_GL0.tar.gz) = cbb6a10695b9e8b41fef1bafe5c4d9ddf710acb1ccba8e141378493bacda982e
SIZE (xorg/driver/driver-xf86-video-intel-e5ff8e1828f97891c819c919d7115c6e18b2eb1f_GL0.tar.gz) = 1693563
TIMESTAMP = 1589561818
SHA256 (xorg/driver/driver-xf86-video-intel-5ca3ac1a90af177eb111a965e9b4dd8a27cc58fc_GL0.tar.gz) = 1060f911ad646f4cf223dd07cd81bca7e2747ce030590a63901f2f492480988a
SIZE (xorg/driver/driver-xf86-video-intel-5ca3ac1a90af177eb111a965e9b4dd8a27cc58fc_GL0.tar.gz) = 1695892

View File

@ -0,0 +1,25 @@
dri3-swap.c:237:24: error: variable 'tmp' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry(tmp, &mru, link) {
^~~
dri3-swap.c:117:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
dri3-swap.c:114:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
dri3-swap.c:236:22: note: initialize the variable 'tmp' to silence this warning
struct buffer *tmp, *b = NULL;
^
= NULL
--- benchmarks/dri3-swap.c.orig 2019-02-21 22:26:50 UTC
+++ benchmarks/dri3-swap.c
@@ -233,7 +233,7 @@ static void run(Display *dpy, Window win)
clock_gettime(CLOCK_MONOTONIC, &start);
do {
for (n = 0; n < 1000; n++) {
- struct buffer *tmp, *b = NULL;
+ struct buffer *tmp = NULL, *b = NULL;
list_for_each_entry(tmp, &mru, link) {
if (!tmp->busy) {
b = tmp;

View File

@ -0,0 +1,24 @@
Add hyphen to RANDR output names for consistency with modesetting(4x)
--- src/sna/sna_display.c.orig 2018-12-03 09:01:25 UTC
+++ src/sna/sna_display.c
@@ -5126,7 +5126,7 @@ sna_output_add(struct sna *sna, unsigned id, unsigned
output_name = output_names[compat_conn.conn.connector_type];
else
output_name = "UNKNOWN";
- len = snprintf(name, 32, "%s%d", output_name, compat_conn.conn.connector_type_id);
+ len = snprintf(name, 32, "%s-%d", output_name, compat_conn.conn.connector_type_id);
if (output_ignored(scrn, name))
return 0;
--- src/uxa/intel_display.c.orig 2018-12-03 09:01:25 UTC
+++ src/uxa/intel_display.c
@@ -1484,7 +1484,7 @@ drmmode_create_name(ScrnInfoPtr pScrn, drmModeConnecto
else
output_name = "UNKNOWN";
- snprintf(name, 32, "%s%d",
+ snprintf(name, 32, "%s-%d",
output_name, koutput->connector_type_id);
}
}

View File

@ -1,16 +1,9 @@
--- src/intel_device.c.orig 2017-02-28 20:52:19 UTC
i915 requires KMS, so FreeBSD uses suffix to distinguish drm1 and drm2 drivers.
drm-kmod kept the same name at the cost of conflict with in-base drm2.
--- src/intel_device.c.orig 2019-02-21 22:26:50 UTC
+++ src/intel_device.c
@@ -28,6 +28,9 @@
#include "config.h"
#endif
+#define _WITH_GETLINE /* to expose getline() in stdio.h on FreeBSD */
+#include <stdio.h> /* for getline() */
+
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
@@ -204,6 +207,7 @@ static inline struct intel_device *intel
@@ -204,6 +204,7 @@ static inline struct intel_device *intel_device(ScrnIn
}
static const char *kernel_module_names[] ={

View File

@ -1,15 +1,124 @@
--- src/intel_list.h.orig 2017-02-28 20:52:19 UTC
kgem.c:2864:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry(bo, &kgem->snoop, list) {
^~
../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
kgem.c:2849:20: note: initialize the variable 'bo' to silence this warning
struct kgem_bo *bo, *first = NULL;
^
= NULL
kgem.c:3118:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry_safe(bo, next, &kgem->flushing, request) {
^~
../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
for (pos = __container_of((head)->next, pos, member), \
^~~
../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
kgem.c:3115:20: note: initialize the variable 'bo' to silence this warning
struct kgem_bo *bo, *next;
^
= NULL
kgem.c:3429:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry_safe(bo, next, &rq->buffers, request) {
^~
../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
for (pos = __container_of((head)->next, pos, member), \
^~~
../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
kgem.c:3425:20: note: initialize the variable 'bo' to silence this warning
struct kgem_bo *bo, *next;
^
= NULL
kgem.c:3541:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry_safe(bo, next, &kgem->batch_buffers, base.list) {
^~
../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
for (pos = __container_of((head)->next, pos, member), \
^~~
../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
kgem.c:3539:24: note: initialize the variable 'bo' to silence this warning
struct kgem_buffer *bo, *next;
^
= NULL
kgem.c:3930:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry(bo, list, list) {
^~
../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
kgem.c:3928:20: note: initialize the variable 'bo' to silence this warning
struct kgem_bo *bo;
^
= NULL
kgem.c:4670:23: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry(bo, cache, vma) {
^~
../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
kgem.c:4576:20: note: initialize the variable 'bo' to silence this warning
struct kgem_bo *bo, *first = NULL;
^
= NULL
kgem.c:5411:31: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry_reverse(bo, &kgem->scanout, list) {
^~
../../src/intel_list.h:333:45: note: expanded from macro 'list_for_each_entry_reverse'
for (pos = __container_of((head)->prev, pos, member); \
^~~
../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
kgem.c:5380:20: note: initialize the variable 'bo' to silence this warning
struct kgem_bo *bo;
^
= NULL
kgem.c:7225:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry(bo, buffers, request) {
^~
../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
kgem.c:7223:20: note: initialize the variable 'bo' to silence this warning
struct kgem_bo *bo;
^
= NULL
kgem.c:7517:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry(bo, &kgem->batch_buffers, base.list) {
^~
../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
kgem.c:7503:24: note: initialize the variable 'bo' to silence this warning
struct kgem_buffer *bo;
^
= NULL
--- src/intel_list.h.orig 2019-02-21 22:26:50 UTC
+++ src/intel_list.h
@@ -305,8 +305,6 @@ list_is_empty(const struct list *head)
#define list_last_entry(ptr, type, member) \
list_entry((ptr)->prev, type, member)
-#define __container_of(ptr, sample, member) \
- (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
/**
* Loop through the list given by head and set pos to struct in the list.
*
@@ -325,12 +323,12 @@ list_is_empty(const struct list *head)
@@ -325,12 +325,12 @@ list_is_empty(const struct list *head)
*
*/
#define list_for_each_entry(pos, head, member) \
@ -25,7 +134,7 @@
&pos->member != (head); \
pos = __container_of(pos->member.prev, pos, member))
@@ -342,7 +340,7 @@ list_is_empty(const struct list *head)
@@ -342,7 +342,7 @@ list_is_empty(const struct list *head)
* See list_for_each_entry for more details.
*/
#define list_for_each_entry_safe(pos, tmp, head, member) \

View File

@ -1,12 +0,0 @@
--- src/sna/kgem.c.orig 2017-02-28 20:52:19 UTC
+++ src/sna/kgem.c
@@ -29,6 +29,9 @@
#include "config.h"
#endif
+#define _WITH_GETLINE /* to expose getline() in stdio.h on FreeBSD */
+#include <stdio.h> /* for getline() */
+
#include "sna.h"
#include "sna_reg.h"

View File

@ -1,12 +0,0 @@
--- src/sna/sna_threads.c.orig 2017-02-28 20:52:19 UTC
+++ src/sna/sna_threads.c
@@ -29,6 +29,9 @@
#include "config.h"
#endif
+#define _WITH_GETLINE /* to expose getline() in stdio.h on FreeBSD */
+#include <stdio.h> /* for getline() */
+
#include "sna.h"
#include <unistd.h>

View File

@ -1,19 +0,0 @@
sna_video.c:62:10: fatal error: 'byteswap.h' file not found
#include <byteswap.h>
^~~~~~~~~~~~
--- src/sna/sna_video.c.orig 2018-12-03 09:01:25 UTC
+++ src/sna/sna_video.c
@@ -59,7 +59,12 @@
#include "intel_options.h"
#include <xf86xv.h>
+#if defined(__linux__) || defined(__GLIBC__)
#include <byteswap.h>
+#else
+#include <sys/endian.h>
+#define bswap_32 bswap32
+#endif
#ifdef SNA_XVMC
#define _SNA_XVMC_SERVER_

View File

@ -0,0 +1,99 @@
present-speed.c:317:23: error: variable 'b' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry(b, &mru, link)
^
present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
present-speed.c:112:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
present-speed.c:297:19: note: initialize the variable 'b' to silence this warning
struct buffer *b;
^
= NULL
present-speed.c:229:19: error: variable 'tmp' is used uninitialized whenever its declaration is reached
[-Werror,-Wsometimes-uninitialized]
struct buffer *tmp, *b = NULL;
~~~~~~~~~~~~~~~^~~
present-speed.c:231:24: note: uninitialized use occurs here
list_for_each_entry(tmp, &mru, link) {
^~~
present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
present-speed.c:112:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
present-speed.c:229:22: note: initialize the variable 'tmp' to silence this warning
struct buffer *tmp, *b = NULL;
^
= NULL
present-speed.c:557:24: error: variable 'b' is uninitialized when used here [-Werror,-Wuninitialized]
list_for_each_entry(b, &pp[i].mru, link)
^
present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
present-speed.c:112:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
present-speed.c:537:20: note: initialize the variable 'b' to silence this warning
struct buffer *b;
^
= NULL
present-speed.c:467:19: error: variable 'tmp' is used uninitialized whenever its declaration is reached
[-Werror,-Wsometimes-uninitialized]
struct buffer *tmp, *b = NULL;
~~~~~~~~~~~~~~~^~~
present-speed.c:469:24: note: uninitialized use occurs here
list_for_each_entry(tmp, &pp[i].mru, link) {
^~~
present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
for (pos = __container_of((head)->next, pos, member); \
^~~
present-speed.c:112:41: note: expanded from macro '__container_of'
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
^~~~~~
present-speed.c:467:22: note: initialize the variable 'tmp' to silence this warning
struct buffer *tmp, *b = NULL;
^
= NULL
--- test/present-speed.c.orig 2019-02-21 22:26:50 UTC
+++ test/present-speed.c
@@ -226,7 +226,7 @@ static void run(Display *dpy, Window win, const char *
clock_gettime(CLOCK_MONOTONIC, &start);
do {
for (n = 0; n < 1000; n++) {
- struct buffer *tmp, *b = NULL;
+ struct buffer *tmp = NULL, *b = NULL;
retry:
list_for_each_entry(tmp, &mru, link) {
if (tmp->fence.xid)
@@ -294,7 +294,7 @@ retry:
} while (end.tv_sec < start.tv_sec + 10);
if (options & DRI3) {
- struct buffer *b;
+ struct buffer *b = NULL;
XID pixmap;
pixmap = xcb_generate_id(c);
@@ -464,7 +464,7 @@ static void perpixel(Display *dpy,
clock_gettime(CLOCK_MONOTONIC, &start);
do {
for (i = 0; i < sz; i++) {
- struct buffer *tmp, *b = NULL;
+ struct buffer *tmp = NULL, *b = NULL;
retry:
list_for_each_entry(tmp, &pp[i].mru, link) {
if (tmp->fence.xid)
@@ -534,7 +534,7 @@ retry:
for (i = 0; i < sz; i++) {
if (options & DRI3) {
int depth = DefaultDepth(dpy, DefaultScreen(dpy));
- struct buffer *b;
+ struct buffer *b = NULL;
XID pixmap;
pixmap = xcb_generate_id(c);

View File

@ -1,8 +1,8 @@
lib/libI810XvMC.so
lib/libI810XvMC.so.1
lib/libI810XvMC.so.1.0.0
lib/libIntelXvMC.so.1
lib/libIntelXvMC.so
lib/libIntelXvMC.so.1.0.0
%%XVMC%%lib/libI810XvMC.so
%%XVMC%%lib/libI810XvMC.so.1
%%XVMC%%lib/libI810XvMC.so.1.0.0
%%XVMC%%lib/libIntelXvMC.so.1
%%XVMC%%lib/libIntelXvMC.so
%%XVMC%%lib/libIntelXvMC.so.1.0.0
lib/xorg/modules/drivers/intel_drv.so
man/man4/intel.4x.gz