diff options
Diffstat (limited to 'graphics/libGL')
15 files changed, 894 insertions, 21 deletions
diff --git a/graphics/libGL/bsd.mesalib.mk b/graphics/libGL/bsd.mesalib.mk index 19e59e6..b39c6ac 100644 --- a/graphics/libGL/bsd.mesalib.mk +++ b/graphics/libGL/bsd.mesalib.mk @@ -33,8 +33,8 @@ BUILD_DEPENDS+= makedepend:${PORTSDIR}/devel/makedepend \ python2:${PORTSDIR}/lang/python2 \ ${PYTHON_SITELIBDIR}/libxml2.py:${PORTSDIR}/textproc/py-libxml2 -USES+= bison gmake pathfix pkgconfig shebangfix tar:bzip2 -USE_PYTHON_BUILD=2 +USES+= bison gmake pathfix pkgconfig python:2,build \ + shebangfix tar:bzip2 USE_LDCONFIG= yes GNU_CONFIGURE= yes diff --git a/graphics/libGL/files/patch-configure b/graphics/libGL/files/patch-configure index 0bfe192..e56b2c2 100644 --- a/graphics/libGL/files/patch-configure +++ b/graphics/libGL/files/patch-configure @@ -1,6 +1,35 @@ ---- configure.orig 2013-08-01 23:22:15.000000000 +0200 -+++ configure 2013-08-19 20:05:02.000000000 +0200 -@@ -21046,9 +21046,34 @@ +--- configure.orig 2014-03-14 20:50:56.000000000 +0100 ++++ configure 2014-03-14 20:51:25.000000000 +0100 +@@ -779,6 +779,8 @@ + GBM_PC_REQ_PRIV + LIBUDEV_LIBS + LIBUDEV_CFLAGS ++LIBDEVQ_LIBS ++LIBDEVQ_CFLAGS + OSMESA_PC_LIB_PRIV + OSMESA_PC_REQ + OSMESA_MESA_DEPS +@@ -1126,6 +1128,8 @@ + NOUVEAU_LIBS + RADEON_CFLAGS + RADEON_LIBS ++LIBDEVQ_CFLAGS ++LIBDEVQ_LIBS + LIBUDEV_CFLAGS + LIBUDEV_LIBS + XORG_CFLAGS +@@ -1930,6 +1934,10 @@ + RADEON_CFLAGS + C compiler flags for RADEON, overriding pkg-config + RADEON_LIBS linker flags for RADEON, overriding pkg-config ++ LIBDEVQ_CFLAGS ++ C compiler flags for LIBDEVQ, overriding pkg-config ++ LIBDEVQ_LIBS ++ linker flags for LIBDEVQ, overriding pkg-config + LIBUDEV_CFLAGS + C compiler flags for LIBUDEV, overriding pkg-config + LIBUDEV_LIBS +@@ -21184,9 +21192,34 @@ DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1" DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS" @@ -25,7 +54,7 @@ + # At some point MGA will be added, but not yet. + if test "x$DRI_DIRS" = "xyes"; then + DRI_DIRS="r200 radeon swrast" -+ fi ++ fi + ;; + sparc*) + # Build only the drivers for cards that exist on SPARC. @@ -38,7 +67,353 @@ ;; gnu*) DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" -@@ -23396,7 +23421,7 @@ +@@ -21684,6 +21717,81 @@ + if test "x$enable_gbm" = xyes; then + SRC_DIRS="$SRC_DIRS gbm" + ++ case "$host_os" in ++ *freebsd*) ++ ++pkg_failed=no ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDEVQ" >&5 ++$as_echo_n "checking for LIBDEVQ... " >&6; } ++ ++if test -n "$LIBDEVQ_CFLAGS"; then ++ pkg_cv_LIBDEVQ_CFLAGS="$LIBDEVQ_CFLAGS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdevq-1.0\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "libdevq-1.0") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_LIBDEVQ_CFLAGS=`$PKG_CONFIG --cflags "libdevq-1.0" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++else ++ pkg_failed=yes ++fi ++ else ++ pkg_failed=untried ++fi ++if test -n "$LIBDEVQ_LIBS"; then ++ pkg_cv_LIBDEVQ_LIBS="$LIBDEVQ_LIBS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdevq-1.0\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "libdevq-1.0") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_LIBDEVQ_LIBS=`$PKG_CONFIG --libs "libdevq-1.0" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++else ++ pkg_failed=yes ++fi ++ else ++ pkg_failed=untried ++fi ++ ++ ++ ++if test $pkg_failed = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ ++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then ++ _pkg_short_errors_supported=yes ++else ++ _pkg_short_errors_supported=no ++fi ++ if test $_pkg_short_errors_supported = yes; then ++ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdevq-1.0" 2>&1` ++ else ++ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdevq-1.0" 2>&1` ++ fi ++ # Put the nasty error message in config.log where it belongs ++ echo "$LIBDEVQ_PKG_ERRORS" >&5 ++ ++ as_fn_error $? "gbm needs libdevq" "$LINENO" 5 ++elif test $pkg_failed = untried; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ as_fn_error $? "gbm needs libdevq" "$LINENO" 5 ++else ++ LIBDEVQ_CFLAGS=$pkg_cv_LIBDEVQ_CFLAGS ++ LIBDEVQ_LIBS=$pkg_cv_LIBDEVQ_LIBS ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ ++fi ++ ;; ++ *) + + pkg_failed=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5 +@@ -21755,6 +21863,8 @@ + $as_echo "yes" >&6; } + + fi ++ ;; ++ esac + + if test "x$enable_dri" = xyes; then + GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri" +@@ -21763,7 +21873,14 @@ + fi + fi + fi +-GBM_PC_REQ_PRIV="libudev" ++case "$host_os" in ++*freebsd*) ++ GBM_PC_REQ_PRIV="libdevq-1.0" ++ ;; ++*) ++ GBM_PC_REQ_PRIV="libudev" ++ ;; ++esac + GBM_PC_LIB_PRIV="$DLOPEN_LIBS" + + +@@ -21782,6 +21899,81 @@ + + if test "$enable_static" != yes; then + # build egl_glx when libGL is built ++ case "$host_os" in ++ *freebsd*) ++ ++pkg_failed=no ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDEVQ" >&5 ++$as_echo_n "checking for LIBDEVQ... " >&6; } ++ ++if test -n "$LIBDEVQ_CFLAGS"; then ++ pkg_cv_LIBDEVQ_CFLAGS="$LIBDEVQ_CFLAGS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdevq-1.0\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "libdevq-1.0") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_LIBDEVQ_CFLAGS=`$PKG_CONFIG --cflags "libdevq-1.0" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++else ++ pkg_failed=yes ++fi ++ else ++ pkg_failed=untried ++fi ++if test -n "$LIBDEVQ_LIBS"; then ++ pkg_cv_LIBDEVQ_LIBS="$LIBDEVQ_LIBS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdevq-1.0\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "libdevq-1.0") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_LIBDEVQ_LIBS=`$PKG_CONFIG --libs "libdevq-1.0" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++else ++ pkg_failed=yes ++fi ++ else ++ pkg_failed=untried ++fi ++ ++ ++ ++if test $pkg_failed = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ ++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then ++ _pkg_short_errors_supported=yes ++else ++ _pkg_short_errors_supported=no ++fi ++ if test $_pkg_short_errors_supported = yes; then ++ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdevq-1.0" 2>&1` ++ else ++ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdevq-1.0" 2>&1` ++ fi ++ # Put the nasty error message in config.log where it belongs ++ echo "$LIBDEVQ_PKG_ERRORS" >&5 ++ ++ have_libdevq=no ++elif test $pkg_failed = untried; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ have_libdevq=no ++else ++ LIBDEVQ_CFLAGS=$pkg_cv_LIBDEVQ_CFLAGS ++ LIBDEVQ_LIBS=$pkg_cv_LIBDEVQ_LIBS ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ have_libdevq=yes ++fi ++ ;; ++ *) + + pkg_failed=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5 +@@ -21853,8 +22045,12 @@ + $as_echo "yes" >&6; } + have_libudev=yes + fi ++ ;; ++ esac + if test "$have_libudev" = yes; then + DEFINES="$DEFINES -DHAVE_LIBUDEV" ++ elif test "$have_libdevq" = yes; then ++ DEFINES="$DEFINES -DHAVE_LIBDEVQ" + fi + + if test "x$enable_dri" = xyes; then +@@ -23053,9 +23249,19 @@ + ;; + esac + +- case "$plat$have_libudev" in +- waylandno|drmno) +- as_fn_error $? "cannot build $plat platfrom without udev" "$LINENO" 5 ;; ++ case "$host_os" in ++ *freebsd*) ++ case "$plat$have_libdevq" in ++ waylandno|drmno) ++ as_fn_error $? "cannot build $plat platfrom without libdevq" "$LINENO" 5 ;; ++ esac ++ ;; ++ *) ++ case "$plat$have_libudev" in ++ waylandno|drmno) ++ as_fn_error $? "cannot build $plat platfrom without udev" "$LINENO" 5 ;; ++ esac ++ ;; + esac + done + +@@ -23348,29 +23554,6 @@ + CLANG_LIBDIR=${LLVM_LIBDIR} + fi + CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION} +- as_ac_File=`$as_echo "ac_cv_file_"$CLANG_RESOURCE_DIR/include/stddef.h"" | $as_tr_sh` +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"$CLANG_RESOURCE_DIR/include/stddef.h\"" >&5 +-$as_echo_n "checking for \"$CLANG_RESOURCE_DIR/include/stddef.h\"... " >&6; } +-if eval \${$as_ac_File+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- test "$cross_compiling" = yes && +- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +-if test -r ""$CLANG_RESOURCE_DIR/include/stddef.h""; then +- eval "$as_ac_File=yes" +-else +- eval "$as_ac_File=no" +-fi +-fi +-eval ac_res=\$$as_ac_File +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +-$as_echo "$ac_res" >&6; } +-if eval test \"x\$"$as_ac_File"\" = x"yes"; then : +- +-else +- as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5 +-fi +- + fi + else + MESA_LLVM=0 +@@ -23453,6 +23636,81 @@ + + gallium_require_drm_loader() { + if test "x$enable_gallium_loader" = xyes; then ++ case "$host_os" in ++ *freebsd*) ++ ++pkg_failed=no ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDEVQ" >&5 ++$as_echo_n "checking for LIBDEVQ... " >&6; } ++ ++if test -n "$LIBDEVQ_CFLAGS"; then ++ pkg_cv_LIBDEVQ_CFLAGS="$LIBDEVQ_CFLAGS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdevq-1.0\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "libdevq-1.0") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_LIBDEVQ_CFLAGS=`$PKG_CONFIG --cflags "libdevq-1.0" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++else ++ pkg_failed=yes ++fi ++ else ++ pkg_failed=untried ++fi ++if test -n "$LIBDEVQ_LIBS"; then ++ pkg_cv_LIBDEVQ_LIBS="$LIBDEVQ_LIBS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdevq-1.0\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "libdevq-1.0") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_LIBDEVQ_LIBS=`$PKG_CONFIG --libs "libdevq-1.0" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++else ++ pkg_failed=yes ++fi ++ else ++ pkg_failed=untried ++fi ++ ++ ++ ++if test $pkg_failed = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ ++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then ++ _pkg_short_errors_supported=yes ++else ++ _pkg_short_errors_supported=no ++fi ++ if test $_pkg_short_errors_supported = yes; then ++ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdevq-1.0" 2>&1` ++ else ++ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdevq-1.0" 2>&1` ++ fi ++ # Put the nasty error message in config.log where it belongs ++ echo "$LIBDEVQ_PKG_ERRORS" >&5 ++ ++ as_fn_error $? "Gallium drm loader requires libdevq" "$LINENO" 5 ++elif test $pkg_failed = untried; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ as_fn_error $? "Gallium drm loader requires libdevq" "$LINENO" 5 ++else ++ LIBDEVQ_CFLAGS=$pkg_cv_LIBDEVQ_CFLAGS ++ LIBDEVQ_LIBS=$pkg_cv_LIBDEVQ_LIBS ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ ++fi ++ ;; ++ *) + + pkg_failed=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5 +@@ -23524,6 +23782,8 @@ + $as_echo "yes" >&6; } + + fi ++ ;; ++ esac + if test "x$have_libdrm" != xyes; then + as_fn_error $? "Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED" "$LINENO" 5 + fi +@@ -23534,7 +23794,7 @@ radeon_llvm_check() { LLVM_REQUIRED_VERSION_MAJOR="3" LLVM_REQUIRED_VERSION_MINOR="2" diff --git a/graphics/libGL/files/patch-src__egl__drivers__dri2__Makefile.in b/graphics/libGL/files/patch-src__egl__drivers__dri2__Makefile.in new file mode 100644 index 0000000..50ca60d --- /dev/null +++ b/graphics/libGL/files/patch-src__egl__drivers__dri2__Makefile.in @@ -0,0 +1,21 @@ +--- src/egl/drivers/dri2/Makefile.in.orig 2014-05-20 21:03:39.000000000 +0200 ++++ src/egl/drivers/dri2/Makefile.in 2014-05-20 21:14:20.000000000 +0200 +@@ -289,6 +289,8 @@ + LIBTOOL = @LIBTOOL@ + LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ + LIBUDEV_LIBS = @LIBUDEV_LIBS@ ++LIBDEVQ_CFLAGS= @LIBDEVQ_CFLAGS@ ++LIBDEVQ_LIBS = @LIBDEVQ_LIBS@ + LIB_DIR = @LIB_DIR@ + LIPO = @LIPO@ + LLVM_BINDIR = @LLVM_BINDIR@ +@@ -455,7 +457,8 @@ + -I$(top_srcdir)/src/egl/wayland/wayland-egl \ + -I$(top_srcdir)/src/egl/wayland/wayland-drm \ + -I$(top_builddir)/src/egl/wayland/wayland-drm $(DEFINES) \ +- $(LIBDRM_CFLAGS) $(LIBUDEV_CFLAGS) $(LIBKMS_CFLAGS) \ ++ $(LIBDRM_CFLAGS) $(LIBUDEV_CFLAGS) $(LIBDEVQ_CFLAGS) \ ++ $(LIBKMS_CFLAGS) \ + -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \ + $(am__append_1) $(am__append_3) $(am__append_5) \ + $(am__append_7) diff --git a/graphics/libGL/files/patch-src__egl__drivers__dri2__common.c b/graphics/libGL/files/patch-src__egl__drivers__dri2__common.c new file mode 100644 index 0000000..73c4f81 --- /dev/null +++ b/graphics/libGL/files/patch-src__egl__drivers__dri2__common.c @@ -0,0 +1,87 @@ +--- src/egl/drivers/dri2/common.c.orig 2012-11-24 18:57:41.000000000 +0100 ++++ src/egl/drivers/dri2/common.c 2014-03-02 11:36:35.000000000 +0100 +@@ -35,11 +35,11 @@ + + #include "egl_dri2.h" + +-#ifdef HAVE_LIBUDEV +- + #define DRIVER_MAP_DRI2_ONLY + #include "pci_ids/pci_id_driver_map.h" + ++#ifdef HAVE_LIBUDEV ++ + #include <libudev.h> + + static struct udev_device * +@@ -141,4 +141,70 @@ + return driver; + } + ++#elif defined(HAVE_LIBDEVQ) ++ ++#include <libdevq.h> ++#include <stdlib.h> ++ ++char * ++dri2_get_device_name_for_fd(int fd) ++{ ++ int ret; ++ char *device_name = NULL; ++ size_t device_name_len; ++ ++ ret = devq_device_get_devpath_from_fd(fd, ++ NULL, &device_name_len); ++ if (ret < 0) ++ return (NULL); ++ ++ device_name = malloc(device_name_len + 1); ++ ret = devq_device_get_devpath_from_fd(fd, ++ device_name, &device_name_len); ++ if (ret < 0) { ++ free(device_name); ++ return (NULL); ++ } ++ ++ device_name[device_name_len] = '\0'; ++ ++ return device_name; ++} ++ ++char * ++dri2_get_driver_for_fd(int fd) ++{ ++ int ret; ++ char *driver = NULL; ++ int vendor_id, chip_id, i, j; ++ ++ ret = devq_device_get_pciid_from_fd(fd, &vendor_id, &chip_id); ++ if (ret < 0) { ++ _eglLog(_EGL_WARNING, "EGL-DRI2: malformed or no PCI ID"); ++ goto out; ++ } ++ ++ for (i = 0; driver_map[i].driver; i++) { ++ if (vendor_id != driver_map[i].vendor_id) ++ continue; ++ if (driver_map[i].num_chips_ids == -1) { ++ driver = strdup(driver_map[i].driver); ++ _eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s", ++ fd, vendor_id, chip_id, driver); ++ goto out; ++ } ++ ++ for (j = 0; j < driver_map[i].num_chips_ids; j++) ++ if (driver_map[i].chip_ids[j] == chip_id) { ++ driver = strdup(driver_map[i].driver); ++ _eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s", ++ fd, vendor_id, chip_id, driver); ++ goto out; ++ } ++ } ++ ++out: ++ return driver; ++} ++ + #endif /* HAVE_LIBUDEV */ diff --git a/graphics/libGL/files/patch-src__egl__drivers__glx__Makefile.in b/graphics/libGL/files/patch-src__egl__drivers__glx__Makefile.in new file mode 100644 index 0000000..7010717 --- /dev/null +++ b/graphics/libGL/files/patch-src__egl__drivers__glx__Makefile.in @@ -0,0 +1,19 @@ +--- src/egl/drivers/glx/Makefile.in.orig 2014-05-20 21:15:30.000000000 +0200 ++++ src/egl/drivers/glx/Makefile.in 2014-05-20 21:16:33.000000000 +0200 +@@ -273,6 +273,8 @@ + LIBTOOL = @LIBTOOL@ + LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ + LIBUDEV_LIBS = @LIBUDEV_LIBS@ ++LIBDEVQ_CFLAGS = @LIBDEVQ_CFLAGS@ ++LIBDEVQ_LIBS = @LIBDEVQ_LIBS@ + LIB_DIR = @LIB_DIR@ + LIPO = @LIPO@ + LLVM_BINDIR = @LLVM_BINDIR@ +@@ -442,6 +444,7 @@ + noinst_LTLIBRARIES = libegl_glx.la + libegl_glx_la_SOURCES = egl_glx.c + libegl_glx_la_LIBADD = \ ++ $(LIBDEVQ_LIBS) \ + $(EGL_LIB_DEPS) + + all: all-am diff --git a/graphics/libGL/files/patch-src__gallium__auxiliary__pipe-loader__pipe_loader_drm.c b/graphics/libGL/files/patch-src__gallium__auxiliary__pipe-loader__pipe_loader_drm.c new file mode 100644 index 0000000..071391b --- /dev/null +++ b/graphics/libGL/files/patch-src__gallium__auxiliary__pipe-loader__pipe_loader_drm.c @@ -0,0 +1,43 @@ +--- ./src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2014-02-03 18:42:39.000000000 +0100 ++++ ./src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c 2014-02-15 21:11:55.000000000 +0100 +@@ -32,7 +32,14 @@ + + #include <fcntl.h> + #include <stdio.h> ++ ++#if defined(HAVE_LIBUDEV) + #include <libudev.h> ++#elif defined(HAVE_LIBDEVQ) ++#include <libdevq.h> ++#include <stdlib.h> ++#endif ++ + #include <xf86drm.h> + + #ifdef HAVE_PIPE_LOADER_XCB +@@ -62,6 +69,7 @@ + static boolean + find_drm_pci_id(struct pipe_loader_drm_device *ddev) + { ++#if defined(HAVE_LIBUDEV) + struct udev *udev = NULL; + struct udev_device *parent, *device = NULL; + struct stat stat; +@@ -100,6 +108,17 @@ + udev_unref(udev); + + return FALSE; ++#elif defined(HAVE_LIBDEVQ) ++ int ret; ++ ++ ret = devq_device_get_pciid_from_fd(ddev->fd, ++ &ddev->base.u.pci.vendor_id, ++ &ddev->base.u.pci.chip_id); ++ if (ret < 0) ++ return FALSE; ++ ++ return TRUE; ++#endif + } + + static boolean diff --git a/graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h b/graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h index 41f38a9..be72edb 100644 --- a/graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h +++ b/graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h @@ -1,7 +1,7 @@ ---- src/gallium/include/pipe/p_config.h.orig 2011-10-15 02:43:58.000000000 +0200 -+++ src/gallium/include/pipe/p_config.h 2012-06-28 21:27:06.000000000 +0200 -@@ -106,6 +106,13 @@ - #endif +--- ./src/gallium/include/pipe/p_config.h.orig 2014-02-03 18:42:39.000000000 +0100 ++++ ./src/gallium/include/pipe/p_config.h 2014-02-15 21:11:34.000000000 +0100 +@@ -81,6 +81,13 @@ + #define PIPE_CC_SUNPRO #endif +#if defined(__sparc__) || defined(__sparc64__) @@ -13,13 +13,4 @@ + /* - * Endian detection. -@@ -133,7 +140,7 @@ - - #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) - #define PIPE_ARCH_LITTLE_ENDIAN --#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) -+#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64) - #define PIPE_ARCH_BIG_ENDIAN - #endif - + * Processor architecture diff --git a/graphics/libGL/files/patch-src__gallium__state_trackers__egl__drm__native_drm.c b/graphics/libGL/files/patch-src__gallium__state_trackers__egl__drm__native_drm.c new file mode 100644 index 0000000..701b7fc --- /dev/null +++ b/graphics/libGL/files/patch-src__gallium__state_trackers__egl__drm__native_drm.c @@ -0,0 +1,42 @@ +--- ./src/gallium/state_trackers/egl/drm/native_drm.c.orig 2014-02-03 18:42:39.000000000 +0100 ++++ ./src/gallium/state_trackers/egl/drm/native_drm.c 2014-02-15 21:11:55.000000000 +0100 +@@ -35,8 +35,11 @@ + + #include "gbm_gallium_drmint.h" + +-#ifdef HAVE_LIBUDEV ++#if defined(HAVE_LIBUDEV) + #include <libudev.h> ++#elif defined(HAVE_LIBDEVQ) ++#include <libdevq.h> ++#include <stdlib.h> + #endif + + static boolean +@@ -183,8 +186,26 @@ + udev_device_unref(device); + outudev: + udev_unref(udev); ++#elif defined(HAVE_LIBDEVQ) ++ int ret; ++ size_t device_name_len; + ++ ret = devq_device_get_devpath_from_fd(fd, ++ NULL, &device_name_len); ++ if (ret < 0) ++ return (NULL); ++ ++ device_name = malloc(device_name_len + 1); ++ ret = devq_device_get_devpath_from_fd(fd, ++ device_name, &device_name_len); ++ if (ret < 0) { ++ free(device_name); ++ return (NULL); ++ } ++ ++ device_name[device_name_len] = '\0'; + #endif ++ + return device_name; + } + diff --git a/graphics/libGL/files/patch-src__gallium__state_trackers__xvmc__tests__xvmc_bench.c b/graphics/libGL/files/patch-src__gallium__state_trackers__xvmc__tests__xvmc_bench.c new file mode 100644 index 0000000..5d4f2dc --- /dev/null +++ b/graphics/libGL/files/patch-src__gallium__state_trackers__xvmc__tests__xvmc_bench.c @@ -0,0 +1,50 @@ +--- src/gallium/state_trackers/xvmc/tests/xvmc_bench.c.orig 2013-10-05 05:59:22.000000000 +0200 ++++ src/gallium/state_trackers/xvmc/tests/xvmc_bench.c 2014-03-02 13:21:35.000000000 +0100 +@@ -28,8 +28,8 @@ + #include <assert.h> + #include <stdio.h> + #include <string.h> +-#include <error.h> + #include <sys/time.h> ++#include <unistd.h> + #include "testlib.h" + + #define MACROBLOCK_WIDTH 16 +@@ -144,23 +144,10 @@ + } + + if (fail) +- error +- ( +- 1, 0, +- "Bad argument.\n" +- "\n" +- "Usage: %s [options]\n" +- "\t-iw <width>\tInput width\n" +- "\t-ih <height>\tInput height\n" +- "\t-ow <width>\tOutput width\n" +- "\t-oh <height>\tOutput height\n" +- "\t-p <pipeline>\tPipeline to test\n" +- "\t-mb <mb type>\tMacroBlock types to use\n" +- "\t-r <reps>\tRepetitions\n\n" +- "\tPipeline steps: mc,csc,swap\n" +- "\tMB types: i,p,b\n", +- argv[0] +- ); ++ { ++ printf ("error happened\n"); ++ exit(1); ++ } + + if (config->output_width == 0) + config->output_width = config->input_width; +@@ -214,7 +201,8 @@ + )) + { + XCloseDisplay(display); +- error(1, 0, "Error, unable to find a good port.\n"); ++ printf("Error, unable to find a good port.\n"); ++ exit(1); + } + + if (is_overlay) diff --git a/graphics/libGL/files/patch-src__gallium__targets__egl-static__egl.c b/graphics/libGL/files/patch-src__gallium__targets__egl-static__egl.c new file mode 100644 index 0000000..225cdc4 --- /dev/null +++ b/graphics/libGL/files/patch-src__gallium__targets__egl-static__egl.c @@ -0,0 +1,37 @@ +--- ./src/gallium/targets/egl-static/egl.c.orig 2014-02-03 18:42:39.000000000 +0100 ++++ ./src/gallium/targets/egl-static/egl.c 2014-02-15 21:11:55.000000000 +0100 +@@ -29,9 +29,12 @@ + #include "egldriver.h" + #include "egllog.h" + +-#ifdef HAVE_LIBUDEV ++#if defined(HAVE_LIBUDEV) + #include <stdio.h> /* for sscanf */ + #include <libudev.h> ++#elif defined(HAVE_LIBDEVQ) ++#include <libdevq.h> ++#include <stdlib.h> + #endif + + #define DRIVER_MAP_GALLIUM_ONLY +@@ -108,6 +111,20 @@ + return (*chip_id >= 0); + } + ++#elif defined(HAVE_LIBDEVQ) ++ ++static boolean ++drm_fd_get_pci_id(int fd, int *vendor_id, int *chip_id) ++{ ++ int ret; ++ ++ ret = devq_device_get_pciid_from_fd(fd, vendor_id, chip_id); ++ if (ret < 0) ++ return FALSE; ++ ++ return TRUE; ++} ++ + #elif defined(PIPE_OS_ANDROID) && !defined(_EGL_NO_DRM) + + #include <xf86drm.h> diff --git a/graphics/libGL/files/patch-src__gallium__targets__gbm__Makefile.in b/graphics/libGL/files/patch-src__gallium__targets__gbm__Makefile.in new file mode 100644 index 0000000..dd55acc --- /dev/null +++ b/graphics/libGL/files/patch-src__gallium__targets__gbm__Makefile.in @@ -0,0 +1,29 @@ +--- src/gallium/targets/gbm/Makefile.in.orig 2014-03-02 12:23:28.000000000 +0100 ++++ src/gallium/targets/gbm/Makefile.in 2014-03-02 12:23:59.000000000 +0100 +@@ -157,7 +157,7 @@ + $(top_builddir)/src/gallium/state_trackers/gbm/libgbm.la \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ +- $(am__DEPENDENCIES_2) ++ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) + am_gbm_gallium_drm_la_OBJECTS = gbm.lo + gbm_gallium_drm_la_OBJECTS = $(am_gbm_gallium_drm_la_OBJECTS) + AM_V_P = $(am__v_P_@AM_V@) +@@ -554,6 +554,7 @@ + AM_CFLAGS = \ + $(GALLIUM_CFLAGS) \ + $(LIBUDEV_CFLAGS) \ ++ $(LIBDEVQ_CFLAGS) \ + $(LIBDRM_CFLAGS) + + gbm_LTLIBRARIES = gbm_gallium_drm.la +@@ -561,7 +562,8 @@ + gbm_gallium_drm_la_LIBADD = $(GALLIUM_PIPE_LOADER_LIBS) \ + $(top_builddir)/src/gallium/state_trackers/gbm/libgbm.la \ + $(top_builddir)/src/gallium/auxiliary/libgallium.la \ +- $(LIBUDEV_LIBS) $(LIBDRM_LIBS) -lm $(am__append_1) ++ $(LIBUDEV_LIBS) $(LIBDEVQ_LIBS) $(LIBDRM_LIBS) -lm \ ++ $(am__append_1) + gbm_gallium_drm_la_LDFLAGS = -no-undefined -avoid-version -module \ + $(am__append_2) + @HAVE_MESA_LLVM_FALSE@gbm_gallium_drm_la_LINK = $(CXXLINK) $(gbm_gallium_drm_la_LDFLAGS) diff --git a/graphics/libGL/files/patch-src__gbm__Makefile.in b/graphics/libGL/files/patch-src__gbm__Makefile.in new file mode 100644 index 0000000..07e196e --- /dev/null +++ b/graphics/libGL/files/patch-src__gbm__Makefile.in @@ -0,0 +1,42 @@ +--- src/gbm/Makefile.in.orig 2014-05-20 21:18:10.000000000 +0200 ++++ src/gbm/Makefile.in 2014-05-20 21:19:09.000000000 +0200 +@@ -107,7 +107,7 @@ + LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) + am__DEPENDENCIES_1 = + libgbm_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ +- $(am__append_2) ++ $(am__DEPENDENCIES_1) $(am__append_2) + am_libgbm_la_OBJECTS = gbm.lo backend.lo common.lo + libgbm_la_OBJECTS = $(am_libgbm_la_OBJECTS) + AM_V_lt = $(am__v_lt_@AM_V@) +@@ -303,6 +303,8 @@ + LIBTOOL = @LIBTOOL@ + LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ + LIBUDEV_LIBS = @LIBUDEV_LIBS@ ++LIBDEVQ_CFLAGS = @LIBDEVQ_CFLAGS@ ++LIBDEVQ_LIBS = @LIBDEVQ_LIBS@ + LIB_DIR = @LIB_DIR@ + LIPO = @LIPO@ + LLVM_BINDIR = @LLVM_BINDIR@ +@@ -467,8 +469,8 @@ + pkgconfig_DATA = main/gbm.pc + AM_CFLAGS = -D_OS_UNIX=1 -DMODULEDIR='"$(libdir)/gbm"' \ + -I$(top_srcdir)/include -I$(top_srcdir)/src/gbm/main \ +- $(LIBUDEV_CFLAGS) $(LIBKMS_CFLAGS) $(DLOPEN_CFLAGS) $(DEFINES) \ +- $(am__append_1) ++ $(LIBUDEV_CFLAGS) $(LIBDEVQ_CFLAGS) $(LIBKMS_CFLAGS) \ ++ $(DLOPEN_CFLAGS) $(DEFINES) $(am__append_1) + lib_LTLIBRARIES = libgbm.la + include_HEADERS = main/gbm.h + libgbm_la_SOURCES = \ +@@ -477,8 +479,8 @@ + main/common.c + + libgbm_la_LDFLAGS = -version-info 1:0 +-libgbm_la_LIBADD = $(LIBUDEV_LIBS) $(LIBKMS_LIBS) $(DLOPEN_LIBS) \ +- $(am__append_2) ++libgbm_la_LIBADD = $(LIBUDEV_LIBS) $(LIBDEVQ_LIBS) $(LIBKMS_LIBS) \ ++ $(DLOPEN_LIBS) $(am__append_2) + @HAVE_EGL_PLATFORM_WAYLAND_TRUE@AM_CPPFLAGS = -DHAVE_WAYLAND_PLATFORM + @HAVE_DRI_TRUE@noinst_LTLIBRARIES = libgbm_dri.la + @HAVE_DRI_TRUE@libgbm_dri_la_SOURCES = \ diff --git a/graphics/libGL/files/patch-src__gbm__backends__dri__driver_name.c b/graphics/libGL/files/patch-src__gbm__backends__dri__driver_name.c new file mode 100644 index 0000000..ac73872 --- /dev/null +++ b/graphics/libGL/files/patch-src__gbm__backends__dri__driver_name.c @@ -0,0 +1,53 @@ +--- ./src/gbm/backends/dri/driver_name.c.orig 2014-02-03 18:42:39.000000000 +0100 ++++ ./src/gbm/backends/dri/driver_name.c 2014-02-15 21:11:55.000000000 +0100 +@@ -29,7 +29,12 @@ + #include <stdio.h> + #include <string.h> + ++#if defined(HAVE_LIBUDEV) + #include <libudev.h> ++#elif defined(HAVE_LIBDEVQ) ++#include <libdevq.h> ++#include <stdlib.h> ++#endif + + #include "gbm_driint.h" + #define DRIVER_MAP_DRI2_ONLY +@@ -38,10 +43,12 @@ + char * + dri_fd_get_driver_name(int fd) + { ++ char *driver = NULL; ++ ++#if defined(HAVE_LIBUDEV) + struct udev *udev; + struct udev_device *device, *parent; + const char *pci_id; +- char *driver = NULL; + int vendor_id, chip_id, i, j; + + udev = udev_new(); +@@ -84,6 +91,23 @@ + out: + udev_device_unref(device); + udev_unref(udev); ++#elif defined(HAVE_LIBDEVQ) ++ int ret; ++ size_t driver_len; ++ ++ ret = devq_device_drm_get_drvname_from_fd(fd, NULL, &driver_len); ++ if (ret < 0) ++ return (NULL); ++ ++ driver = malloc(driver_len + 1); ++ ret = devq_device_drm_get_drvname_from_fd(fd, driver, &driver_len); ++ if (ret < 0) { ++ free(driver); ++ return (NULL); ++ } ++ ++ driver[driver_len] = '\0'; ++#endif + + return driver; + } diff --git a/graphics/libGL/files/patch-src__gbm__main__common.c b/graphics/libGL/files/patch-src__gbm__main__common.c new file mode 100644 index 0000000..662d022 --- /dev/null +++ b/graphics/libGL/files/patch-src__gbm__main__common.c @@ -0,0 +1,69 @@ +--- ./src/gbm/main/common.c.orig 2014-02-03 18:42:39.000000000 +0100 ++++ ./src/gbm/main/common.c 2014-02-15 21:11:55.000000000 +0100 +@@ -28,7 +28,13 @@ + #include <stdio.h> + #include <string.h> + ++#if defined(HAVE_LIBUDEV) + #include <libudev.h> ++#elif defined(HAVE_LIBDEVQ) ++#include <libdevq.h> ++#include <stdlib.h> ++#endif ++ + #include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> +@@ -36,6 +42,7 @@ + #include "common.h" + #include "gbmint.h" + ++#if defined(HAVE_LIBUDEV) + GBM_EXPORT struct udev_device * + _gbm_udev_device_new_from_fd(struct udev *udev, int fd) + { +@@ -56,14 +63,17 @@ + + return device; + } ++#endif /* defined(HAVE_LIBUDEV) */ + + GBM_EXPORT char * + _gbm_fd_get_device_name(int fd) + { ++ char *device_name = NULL; ++ ++#if defined(HAVE_LIBUDEV) + struct udev *udev; + struct udev_device *device; + const char *const_device_name; +- char *device_name = NULL; + + udev = udev_new(); + device = _gbm_udev_device_new_from_fd(udev, fd); +@@ -78,6 +88,25 @@ + out: + udev_device_unref(device); + udev_unref(udev); ++#elif defined(HAVE_LIBDEVQ) ++ int ret; ++ size_t device_name_len; ++ ++ ret = devq_device_get_devpath_from_fd(fd, ++ NULL, &device_name_len); ++ if (ret < 0) ++ return (NULL); ++ ++ device_name = malloc(device_name_len + 1); ++ ret = devq_device_get_devpath_from_fd(fd, ++ device_name, &device_name_len); ++ if (ret < 0) { ++ free(device_name); ++ return (NULL); ++ } ++ ++ device_name[device_name_len] = '\0'; ++#endif + + return device_name; + } diff --git a/graphics/libGL/files/patch-src__gbm__main__common.h b/graphics/libGL/files/patch-src__gbm__main__common.h new file mode 100644 index 0000000..cd870e5 --- /dev/null +++ b/graphics/libGL/files/patch-src__gbm__main__common.h @@ -0,0 +1,15 @@ +--- ./src/gbm/main/common.h.orig 2014-02-03 18:42:39.000000000 +0100 ++++ ./src/gbm/main/common.h 2014-02-15 21:11:55.000000000 +0100 +@@ -28,10 +28,12 @@ + #ifndef _COMMON_H_ + #define _COMMON_H_ + ++#if defined(HAVE_LIBUDEV) + #include <libudev.h> + + struct udev_device * + _gbm_udev_device_new_from_fd(struct udev *udev, int fd); ++#endif + + char * + _gbm_fd_get_device_name(int fd); |