[PATCH xf86-video-amdgpu] Check GBM flag for textured pixmap creation

Zhou, Jammy Jammy.Zhou at amd.com
Sun Jun 7 20:12:38 PDT 2015


> How can AMDGPU_BO_FLAGS_GBM not be set when using glamor?

It may happen in amdgpu_glamor_set_shared_pixmap_backing for PRIME support.

Regards,
Jammy

-----Original Message-----
From: Michel Dänzer [mailto:michel at daenzer.net] 
Sent: Monday, June 08, 2015 11:11 AM
To: Zhou, Jammy
Cc: xorg-driver-ati at lists.x.org
Subject: Re: [PATCH xf86-video-amdgpu] Check GBM flag for textured pixmap creation

On 08.06.2015 19:32, Jammy Zhou wrote:
> Signed-off-by: Jammy Zhou <Jammy.Zhou at amd.com>
> ---
>  src/amdgpu_glamor.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c index 
> d451fa9..434c138 100644
> --- a/src/amdgpu_glamor.c
> +++ b/src/amdgpu_glamor.c
> @@ -135,6 +135,7 @@ Bool amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap)
>  	AMDGPUInfoPtr info = AMDGPUPTR(scrn);
>  	struct amdgpu_pixmap *priv;
>  	union gbm_bo_handle bo_handle;
> +	int handle;
>  
>  	if ((info->use_glamor) == 0)
>  		return TRUE;
> @@ -144,8 +145,17 @@ Bool amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap)
>  		priv->stride = pixmap->devKind;
>  	}
>  
> -	bo_handle = gbm_bo_get_handle(priv->bo->bo.gbm);
> -	if (glamor_egl_create_textured_pixmap(pixmap, bo_handle.u32,
> +	if (priv->bo->flags & AMDGPU_BO_FLAGS_GBM) {
> +		bo_handle = gbm_bo_get_handle(priv->bo->bo.gbm);
> +		handle = bo_handle.u32;
> +	} else {
> +		if (amdgpu_bo_export(priv->bo->bo.amdgpu,
> +				amdgpu_bo_handle_type_kms,
> +				&handle))
> +			return FALSE;
> +	}
> +
> +	if (glamor_egl_create_textured_pixmap(pixmap, handle,
>  					      priv->stride)) {
>  		return TRUE;
>  	} else {
> 

How can AMDGPU_BO_FLAGS_GBM not be set when using glamor?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-driver-ati mailing list