summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-06-14 18:53:34 +0900
committerMichel Dänzer <michel@daenzer.net>2016-06-15 18:09:57 +0900
commit74602c4221e3c84949fd69f690cbc66dcae384ea (patch)
tree31ea774492c350298fa51e3cd95918b758706616
parent0007c2f018ba663303d91d847e7c085269a23062 (diff)
glamor: Make amdgpu_glamor_create_textured_pixmap take amdgpu_buffer*
Preparation for the following fixes. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/amdgpu_bo_helper.c2
-rw-r--r--src/amdgpu_glamor.c8
-rw-r--r--src/amdgpu_glamor.h2
-rw-r--r--src/drmmode_display.c3
4 files changed, 7 insertions, 8 deletions
diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index 783347b..f5a67e3 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -426,7 +426,7 @@ Bool amdgpu_set_shared_pixmap_backing(PixmapPtr ppix, void *fd_handle)
#ifdef USE_GLAMOR
if (info->use_glamor &&
- !amdgpu_glamor_create_textured_pixmap(ppix, priv)) {
+ !amdgpu_glamor_create_textured_pixmap(ppix, priv->bo)) {
free(priv->bo);
free(priv);
return FALSE;
diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
index 3f4b1af..9785ad7 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -127,7 +127,7 @@ Bool amdgpu_glamor_pre_init(ScrnInfoPtr scrn)
}
Bool
-amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *priv)
+amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_buffer *bo)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
AMDGPUInfoPtr info = AMDGPUPTR(scrn);
@@ -136,7 +136,7 @@ amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *pri
if ((info->use_glamor) == 0)
return TRUE;
- if (!amdgpu_bo_get_handle(priv->bo, &bo_handle))
+ if (!amdgpu_bo_get_handle(bo, &bo_handle))
return FALSE;
return glamor_egl_create_textured_pixmap(pixmap, bo_handle,
@@ -233,7 +233,7 @@ amdgpu_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
pixmap->devPrivate.ptr = NULL;
- if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv))
+ if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv->bo))
goto fallback_glamor;
}
@@ -372,7 +372,7 @@ amdgpu_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle)
priv = amdgpu_get_pixmap_private(pixmap);
- if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv)) {
+ if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv->bo)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to get PRIME drawable for glamor pixmap.\n");
return FALSE;
diff --git a/src/amdgpu_glamor.h b/src/amdgpu_glamor.h
index 05ca5cf..4473495 100644
--- a/src/amdgpu_glamor.h
+++ b/src/amdgpu_glamor.h
@@ -69,7 +69,7 @@ void amdgpu_glamor_flush(ScrnInfoPtr pScrn);
void amdgpu_glamor_finish(ScrnInfoPtr pScrn);
Bool
-amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *priv);
+amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_buffer *bo);
void amdgpu_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst);
PixmapPtr amdgpu_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap);
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 7b326bb..a675c73 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -117,8 +117,7 @@ static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
amdgpu_set_pixmap_bo(pixmap, bo);
- if (!amdgpu_glamor_create_textured_pixmap(pixmap,
- amdgpu_get_pixmap_private(pixmap))) {
+ if (!amdgpu_glamor_create_textured_pixmap(pixmap, bo)) {
pScreen->DestroyPixmap(pixmap);
return NULL;
}