xf86-video-amdgpu: Branch 'master' - 3 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Oct 5 16:36:49 UTC 2018
.gitlab-ci.yml | 79 +++++++++++++++++++++++++++++++++++++++++++++++++
src/amdgpu_bo_helper.c | 13 +++++---
src/amdgpu_glamor.c | 4 ++
src/amdgpu_glamor.h | 21 +++++++++++++
src/amdgpu_kms.c | 2 -
src/drmmode_display.c | 10 ++++++
6 files changed, 124 insertions(+), 5 deletions(-)
New commits:
commit 05a1ba9abc941dec616ef7f836f4c54ac93ff9be
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Tue Oct 2 18:01:14 2018 +0200
Add GitLab CI configuration
Builds the driver against all supported versions of xserver, with both
gcc and clang for xserver >= 1.18 (older versions cause warnings with
clang). Compiler warnings are treated as errors.
The xserver 1.15 build uses standalone glamor, the xserver 1.13 & 1.14
builds use --disable-glamor.
With the latest xserver version, make install and make distcheck are
tested as well.
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..aac8bb7
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,79 @@
+image: registry.freedesktop.org/xorg/driver/xf86-video-amdgpu:debian-testing-20181003
+
+stages:
+ - build
+
+# The default build instructions
+.default_build:
+ stage: build
+ script:
+ - ./autogen.sh
+ - make -j$(nproc) check V=1
+ variables:
+ CFLAGS: "-pipe -g -O2 -Werror"
+ ACLOCAL_PATH: /usr/local/xserver-$XSERVER_VERSION/share/aclocal
+ PKG_CONFIG_PATH: /usr/local/xserver-$XSERVER_VERSION/lib/pkgconfig
+
+xserver-1.20:
+ extends: .default_build
+ script:
+ - ./autogen.sh
+ - make -j$(nproc) check V=1
+ - make install V=1
+ - make -j$(nproc) distcheck
+ variables:
+ XSERVER_VERSION: "1.20"
+
+xserver-1.20-clang:
+ extends: .default_build
+ variables:
+ CC: clang
+ XSERVER_VERSION: "1.20"
+
+xserver-1.13:
+ extends: .default_build
+ script:
+ - ./autogen.sh --disable-glamor
+ - make -j$(nproc) check V=1
+ variables:
+ XSERVER_VERSION: "1.13"
+
+xserver-1.14:
+ extends: xserver-1.13
+ variables:
+ XSERVER_VERSION: "1.14"
+
+xserver-1.15:
+ extends: .default_build
+ variables:
+ XSERVER_VERSION: "1.15"
+
+xserver-1.16:
+ extends: .default_build
+ variables:
+ XSERVER_VERSION: "1.16"
+
+xserver-1.17:
+ extends: .default_build
+ variables:
+ XSERVER_VERSION: "1.17"
+
+xserver-1.18:
+ extends: .default_build
+ variables:
+ XSERVER_VERSION: "1.18"
+
+xserver-1.18-clang:
+ extends: xserver-1.18
+ variables:
+ CC: clang
+
+xserver-1.19:
+ extends: .default_build
+ variables:
+ XSERVER_VERSION: "1.19"
+
+xserver-1.19-clang:
+ extends: xserver-1.19
+ variables:
+ CC: clang
commit babbd38057559471ab3cb6970010b9a4adf1ef3d
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Tue Oct 2 17:55:03 2018 +0200
Fix --disable-glamor build
We were still relying on the glamor.h header being picked up implicitly.
diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index 6fd6884..ea51822 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -148,6 +148,8 @@ Bool amdgpu_bo_get_handle(struct amdgpu_buffer *bo, uint32_t *handle)
handle) == 0;
}
+#ifdef USE_GLAMOR
+
static void amdgpu_pixmap_do_get_tiling_info(PixmapPtr pixmap)
{
struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);
@@ -164,6 +166,8 @@ static void amdgpu_pixmap_do_get_tiling_info(PixmapPtr pixmap)
priv->tiling_info = gem_metadata.data.tiling_info;
}
+#endif
+
uint64_t amdgpu_pixmap_get_tiling_info(PixmapPtr pixmap)
{
struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);
@@ -207,16 +211,17 @@ Bool amdgpu_pixmap_get_handle(PixmapPtr pixmap, uint32_t *handle)
r = drmPrimeFDToHandle(pAMDGPUEnt->fd, fd, &priv->handle);
close(fd);
- if (r == 0)
- goto get_tiling_info;
+ if (r)
+ return FALSE;
+
+ amdgpu_pixmap_do_get_tiling_info(pixmap);
+ goto success;
}
#endif
if (!priv->bo || !amdgpu_bo_get_handle(priv->bo, &priv->handle))
return FALSE;
- get_tiling_info:
- amdgpu_pixmap_do_get_tiling_info(pixmap);
success:
priv->handle_valid = TRUE;
*handle = priv->handle;
diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
index 699861f..f91ee3a 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -28,6 +28,8 @@
#include "config.h"
#endif
+#ifdef USE_GLAMOR
+
#include <xf86.h>
#include "amdgpu_bo_helper.h"
@@ -517,3 +519,5 @@ XF86VideoAdaptorPtr amdgpu_glamor_xv_init(ScreenPtr pScreen, int num_adapt)
{
return glamor_xv_init(pScreen, num_adapt);
}
+
+#endif /* USE_GLAMOR */
diff --git a/src/amdgpu_glamor.h b/src/amdgpu_glamor.h
index 78fec0b..b629985 100644
--- a/src/amdgpu_glamor.h
+++ b/src/amdgpu_glamor.h
@@ -29,6 +29,8 @@
#include "xf86xv.h"
+#ifdef USE_GLAMOR
+
#define GLAMOR_FOR_XORG 1
#include <glamor.h>
@@ -71,4 +73,23 @@ PixmapPtr amdgpu_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap);
XF86VideoAdaptorPtr amdgpu_glamor_xv_init(ScreenPtr pScreen, int num_adapt);
+#else /* !USE_GLAMOR */
+
+static inline Bool amdgpu_glamor_pre_init(ScrnInfoPtr scrn) { return FALSE; }
+static inline Bool amdgpu_glamor_init(ScreenPtr screen) { return FALSE; }
+static inline void amdgpu_glamor_fini(ScreenPtr screen) { }
+static inline Bool amdgpu_glamor_create_screen_resources(ScreenPtr screen) { return FALSE; }
+
+static inline Bool amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_buffer *bo) { return TRUE; }
+
+static inline void amdgpu_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst) {}
+static inline PixmapPtr amdgpu_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap) { return pixmap; }
+
+static inline XF86VideoAdaptorPtr amdgpu_glamor_xv_init(ScreenPtr pScreen, int num_adapt) { return NULL; }
+
+static inline void amdgpu_glamor_flush(ScrnInfoPtr pScrn) { }
+static inline void amdgpu_glamor_finish(ScrnInfoPtr pScrn) { }
+
+#endif /* USE_GLAMOR */
+
#endif /* AMDGPU_GLAMOR_H */
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9917d9f..5315747 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -347,6 +347,8 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
crtc->x, crtc->y);
}
+#ifdef USE_GLAMOR
+
static PixmapPtr
create_pixmap_for_fbcon(drmmode_ptr drmmode,
ScrnInfoPtr pScrn, int fbcon_id)
@@ -384,9 +386,13 @@ out_free_fb:
return pixmap;
}
+#endif /* USE_GLAMOR */
+
void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
{
+#ifdef USE_GLAMOR
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
ScreenPtr pScreen = pScrn->pScreen;
PixmapPtr src, dst = pScreen->GetScreenPixmap(pScreen);
struct drmmode_fb *fb = amdgpu_pixmap_get_fb(dst);
@@ -394,6 +400,9 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
GCPtr gc;
int i;
+ if (!info->use_glamor)
+ return;
+
for (i = 0; i < xf86_config->num_crtc; i++) {
drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[i]->driver_private;
@@ -427,6 +436,7 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
pScreen->canDoBGNoneRoot = TRUE;
pScreen->DestroyPixmap(src);
+#endif
return;
}
commit b6ee7f92cfaa2c134bee101cf89983db73f4c28d
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Tue Oct 2 17:52:10 2018 +0200
Cast return value of amdgpu_get_marketing_name to char*
Avoids compiler warning with xserver < 1.16:
../../src/amdgpu_kms.c: In function ‘AMDGPUPreInitChipType_KMS’:
../../src/amdgpu_kms.c:1203:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
pScrn->chipset = amdgpu_get_marketing_name(pAMDGPUEnt->pDev);
^
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 06bba55..87c06d3 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1200,7 +1200,7 @@ static Bool AMDGPUPreInitChipType_KMS(ScrnInfoPtr pScrn,
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
info->Chipset = info->PciInfo->device_id;
- pScrn->chipset = amdgpu_get_marketing_name(pAMDGPUEnt->pDev);
+ pScrn->chipset = (char*)amdgpu_get_marketing_name(pAMDGPUEnt->pDev);
if (!pScrn->chipset)
pScrn->chipset = "Unknown AMD Radeon GPU";
More information about the xorg-commit
mailing list