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>
This commit is contained in:
Michel Dänzer
2016-01-26 16:12:28 +09:00
committed by Michel Dänzer
parent 2fcb7dadd3
commit a3eac85d81
2 changed files with 3 additions and 2 deletions

View File

@@ -1431,7 +1431,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;
}

View File

@@ -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;