[PATCH xf86-video-amdgpu] Only map front buffer if glamor acceleration is disabled (v2)

2016-01-28 Thread Michel Dänzer
From: Michel Dänzer 

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"
Signed-off-by: Michel Dänzer 
---
 src/amdgpu_kms.c  | 3 ++-
 src/drmmode_display.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index e090c25..b9e4eb7 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -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;
}
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;
-- 
2.7.0

___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Only map front buffer if glamor acceleration is disabled (v2)

2016-01-28 Thread Alex Deucher
On Thu, Jan 28, 2016 at 3:23 AM, Michel Dänzer  wrote:
> From: Michel Dänzer 
>
> 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"
> Signed-off-by: Michel Dänzer 

Reviewed-by: Alex Deucher 

> ---
>  src/amdgpu_kms.c  | 3 ++-
>  src/drmmode_display.c | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index e090c25..b9e4eb7 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -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;
> }
> 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;
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati