xf86-video-amdgpu: Branch 'master'
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Nov 25 13:20:59 UTC 2024
configure.ac | 5 +++++
src/amdgpu_bo_helper.c | 5 +++++
src/amdgpu_kms.c | 2 +-
src/amdgpu_pixmap.h | 1 +
src/drmmode_display.c | 2 +-
5 files changed, 13 insertions(+), 2 deletions(-)
New commits:
commit 18995f1e3384b89236cde077fda438042d631266
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date: Thu Nov 21 13:38:38 2024 +0100
Use GBM_BO_USE_FRONT_RENDERING on front_buffer alloc
This GBM flag is useful as it allows the driver to be aware
of the intended use of the buffer and act accordingly (typically
disable DCC to avoid artifacts from out of sync DCC).
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
diff --git a/configure.ac b/configure.ac
index 160bcbf..b449b19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,6 +185,11 @@ AC_CHECK_DECL(GBM_BO_USE_LINEAR,
[#include <stdlib.h>
#include <gbm.h>])
+AC_CHECK_DECL(GBM_BO_USE_FRONT_RENDERING,
+ [AC_DEFINE(HAVE_GBM_BO_USE_FRONT_RENDERING, 1, [Have GBM_BO_USE_FRONT_RENDERING])], [],
+ [#include <stdlib.h>
+ #include <gbm.h>])
+
AC_CHECK_HEADERS([misyncshm.h], [], [],
[#include <X11/Xdefs.h>
#include <X11/Xfuncproto.h>
diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index df32f5d..647a951 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -82,6 +82,11 @@ struct amdgpu_buffer *amdgpu_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width,
if (usage_hint & AMDGPU_CREATE_PIXMAP_SCANOUT)
bo_use |= GBM_BO_USE_SCANOUT;
+#ifdef HAVE_GBM_BO_USE_FRONT_RENDERING
+ if (usage_hint & AMDGPU_CREATE_PIXMAP_FRONT)
+ bo_use |= GBM_BO_USE_FRONT_RENDERING;
+#endif
+
#ifdef HAVE_GBM_BO_USE_LINEAR
if (usage_hint == CREATE_PIXMAP_USAGE_SHARED ||
(usage_hint & AMDGPU_CREATE_PIXMAP_LINEAR)) {
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 6a48655..c2b7c8b 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -2426,7 +2426,7 @@ static Bool amdgpu_setup_kernel_mem(ScreenPtr pScreen)
if (!info->front_buffer) {
int pitch;
- int hint = AMDGPU_CREATE_PIXMAP_SCANOUT;
+ int hint = AMDGPU_CREATE_PIXMAP_SCANOUT | AMDGPU_CREATE_PIXMAP_FRONT;
if (info->shadow_primary)
hint |= AMDGPU_CREATE_PIXMAP_LINEAR | AMDGPU_CREATE_PIXMAP_GTT;
diff --git a/src/amdgpu_pixmap.h b/src/amdgpu_pixmap.h
index 663d414..8aaea1c 100644
--- a/src/amdgpu_pixmap.h
+++ b/src/amdgpu_pixmap.h
@@ -166,6 +166,7 @@ amdgpu_pixmap_get_fb(PixmapPtr pix)
}
enum {
+ AMDGPU_CREATE_PIXMAP_FRONT = 0x10000000,
AMDGPU_CREATE_PIXMAP_DRI2 = 0x08000000,
AMDGPU_CREATE_PIXMAP_LINEAR = 0x04000000,
AMDGPU_CREATE_PIXMAP_SCANOUT = 0x02000000,
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index f7c6a3d..b74b237 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2897,7 +2897,7 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
int i, pitch, old_width, old_height, old_pitch;
int cpp = info->pixel_bytes;
PixmapPtr ppix = screen->GetScreenPixmap(screen);
- int hint = AMDGPU_CREATE_PIXMAP_SCANOUT;
+ int hint = AMDGPU_CREATE_PIXMAP_SCANOUT | AMDGPU_CREATE_PIXMAP_FRONT;
void *fb_shadow;
if (scrn->virtualX == width && scrn->virtualY == height)
More information about the xorg-commit
mailing list