diff options
Diffstat (limited to 'x11')
-rw-r--r-- | x11/xf86-video-amdgpu/Makefile | 29 | ||||
-rw-r--r-- | x11/xf86-video-amdgpu/distinfo | 2 | ||||
-rw-r--r-- | x11/xf86-video-amdgpu/patches/patch-src_amdgpu_dri3_c | 34 | ||||
-rw-r--r-- | x11/xf86-video-amdgpu/patches/patch-src_amdgpu_probe_c | 34 | ||||
-rw-r--r-- | x11/xf86-video-amdgpu/pkg/DESCR | 1 | ||||
-rw-r--r-- | x11/xf86-video-amdgpu/pkg/PLIST | 5 |
6 files changed, 105 insertions, 0 deletions
diff --git a/x11/xf86-video-amdgpu/Makefile b/x11/xf86-video-amdgpu/Makefile new file mode 100644 index 0000000..0a8207c --- /dev/null +++ b/x11/xf86-video-amdgpu/Makefile @@ -0,0 +1,29 @@ +COMMENT = video driver for AMD GPU graphics chipsets +DISTNAME = xf86-video-amdgpu-22.0.0 +CATEGORIES = x11 + +HOMEPAGE = https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu + +MAINTAINER = xenocara@openbsd.org + +# MIT +PERMIT_PACKAGE = Yes + +MASTER_SITES = ${MASTER_SITE_XORG:=driver/} + +MODULES = xenocara + +WANTLIB = drm drm_amdgpu gbm expat m + +BUILD_DEPENDS = x11/xorg-server + +SEPARATE_BUILD = Yes +CONFIGURE_STYLE = autoreconf +CONFIGURE_ARGS = --with-xorg-module-dir=${X11BASE}/lib/modules \ + +AUTOCONF_VERSION = 2.69 +AUTOMAKE_VERSION = 1.12 + +NO_TEST = Yes + +.include <bsd.port.mk> diff --git a/x11/xf86-video-amdgpu/distinfo b/x11/xf86-video-amdgpu/distinfo new file mode 100644 index 0000000..099b618 --- /dev/null +++ b/x11/xf86-video-amdgpu/distinfo @@ -0,0 +1,2 @@ +SHA256 (xf86-video-amdgpu-22.0.0.tar.gz) = vEehqIVOeQJw+l3i+53+hVgTmwPY9orBBX3NI11XLcw= +SIZE (xf86-video-amdgpu-22.0.0.tar.gz) = 552435 diff --git a/x11/xf86-video-amdgpu/patches/patch-src_amdgpu_dri3_c b/x11/xf86-video-amdgpu/patches/patch-src_amdgpu_dri3_c new file mode 100644 index 0000000..567e5f9 --- /dev/null +++ b/x11/xf86-video-amdgpu/patches/patch-src_amdgpu_dri3_c @@ -0,0 +1,34 @@ +Index: src/amdgpu_dri3.c +--- src/amdgpu_dri3.c.orig ++++ src/amdgpu_dri3.c +@@ -41,6 +41,12 @@ + #include <errno.h> + #include <libgen.h> + ++#ifdef X_PRIVSEP ++extern int priv_open_device(const char *); ++#else ++#define priv_open_device(n) open(n,O_RDWR|O_CLOEXEC) ++#endif ++ + static int open_card_node(ScreenPtr screen, int *out) + { + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); +@@ -49,7 +55,7 @@ static int open_card_node(ScreenPtr screen, int *out) + drm_magic_t magic; + int fd; + +- fd = open(info->dri2.device_name, O_RDWR | O_CLOEXEC); ++ fd = priv_open_device(info->dri2.device_name); + if (fd < 0) + return BadAlloc; + +@@ -93,7 +99,7 @@ static int open_render_node(ScreenPtr screen, int *out + AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); + int fd; + +- fd = open(pAMDGPUEnt->render_node, O_RDWR | O_CLOEXEC); ++ fd = priv_open_device(pAMDGPUEnt->render_node); + if (fd < 0) + return BadAlloc; + diff --git a/x11/xf86-video-amdgpu/patches/patch-src_amdgpu_probe_c b/x11/xf86-video-amdgpu/patches/patch-src_amdgpu_probe_c new file mode 100644 index 0000000..b108f2e --- /dev/null +++ b/x11/xf86-video-amdgpu/patches/patch-src_amdgpu_probe_c @@ -0,0 +1,34 @@ +Index: src/amdgpu_probe.c +--- src/amdgpu_probe.c.orig ++++ src/amdgpu_probe.c +@@ -55,6 +55,12 @@ + #include <xf86_OSproc.h> + #endif + ++#ifdef X_PRIVSEP ++extern int priv_open_device(const char *); ++#else ++#define priv_open_device(n) open(n,O_RDWR|O_CLOEXEC) ++#endif ++ + #include <xf86platformBus.h> + + _X_EXPORT int gAMDGPUEntityIndex = -1; +@@ -140,7 +146,7 @@ static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn, + path = xf86_get_platform_device_attrib(platform_dev, + ODEV_ATTRIB_PATH); + +- fd = open(path, O_RDWR | O_CLOEXEC); ++ fd = priv_open_device(path); + if (fd != -1) + return fd; + #endif +@@ -159,7 +165,7 @@ static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn, + if (amdgpu_device_matches(devices[i], dev) && + devices[i]->available_nodes & (1 << DRM_NODE_PRIMARY)) { + path = devices[i]->nodes[DRM_NODE_PRIMARY]; +- fd = open(path, O_RDWR | O_CLOEXEC); ++ fd = priv_open_device(path); + break; + } + } diff --git a/x11/xf86-video-amdgpu/pkg/DESCR b/x11/xf86-video-amdgpu/pkg/DESCR new file mode 100644 index 0000000..e27c2a7 --- /dev/null +++ b/x11/xf86-video-amdgpu/pkg/DESCR @@ -0,0 +1 @@ +xf86-video-amdgpu - AMD GPU video driver for the Xorg X server diff --git a/x11/xf86-video-amdgpu/pkg/PLIST b/x11/xf86-video-amdgpu/pkg/PLIST new file mode 100644 index 0000000..2f3ec0c --- /dev/null +++ b/x11/xf86-video-amdgpu/pkg/PLIST @@ -0,0 +1,5 @@ +lib/modules/drivers/amdgpu_drv.a +lib/modules/drivers/amdgpu_drv.la +@so lib/modules/drivers/amdgpu_drv.so +@man man/man4/amdgpu.4 +share/X11/xorg.conf.d/10-amdgpu.conf |