[PATCH xf86-video-amdgpu] Check GBM flag for textured pixmap creation
Jammy Zhou
Jammy.Zhou at amd.com
Mon Jun 8 03:32:50 PDT 2015
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 {
--
1.9.1
More information about the xorg-driver-ati
mailing list