summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-01-26 16:12:28 +0900
committerMichel Dänzer <michel@daenzer.net>2016-02-19 11:48:30 +0900
commit65ee496c0567ea6aaf947a6098fbf925d2f6b14b (patch)
tree2aacc6ee0d5bc9f3785dc73a21753f1eaccf99e0
parent076c7b60f2b3700dfc7d94af78b368c00d216532 (diff)
Only map front buffer if glamor acceleration is disabled (v2)
Otherwise the front buffer may not be accessible by the CPU, because Mesa sets the AMDGPU_GEM_CREATE_NO_CPU_ACCESS flag for tiled buffers, because accessing tiled buffers with the CPU makes little sense. v2: Also handle Option "AccelMethod" "none" Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit a3eac85d812ecc605436e6bd5b9ee7ebf307e3d3)
-rw-r--r--src/amdgpu_kms.c3
-rw-r--r--src/drmmode_display.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 3993591..75d35c1 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1415,7 +1415,8 @@ static Bool amdgpu_setup_kernel_mem(ScreenPtr pScreen)
return FALSE;
}
- if (amdgpu_bo_map(pScrn, info->front_buffer)) {
+ if (!info->use_glamor &&
+ amdgpu_bo_map(pScrn, info->front_buffer) != 0) {
ErrorF("Failed to map front buffer memory\n");
return FALSE;
}
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 3f015f9..40a134c 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1741,7 +1741,7 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
goto fail;
}
- if (amdgpu_bo_map(scrn, info->front_buffer)) {
+ if (!info->use_glamor && amdgpu_bo_map(scrn, info->front_buffer) != 0) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to map front buffer memory\n");
goto fail;