summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-03-19 17:34:27 +0900
committerMichel Dänzer <michel@daenzer.net>2015-04-03 11:42:00 +0900
commit051d46382656ffc3e6cac1aab3aee7efdf5b623a (patch)
tree2228cb4edc0c03d7fbf5901397c36d6c73680793
parent2fa021f77372ca93375a3d13a0c43a9089674899 (diff)
glamor: Add radeon_pixmap parameter to radeon_glamor_create_textured_pixmap
-rw-r--r--src/drmmode_display.c3
-rw-r--r--src/radeon_glamor.c16
-rw-r--r--src/radeon_glamor.h6
3 files changed, 12 insertions, 13 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e68f17e9..d8d3ca36 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -149,7 +149,8 @@ static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
}
}
- if (!radeon_glamor_create_textured_pixmap(pixmap)) {
+ if (!radeon_glamor_create_textured_pixmap(pixmap,
+ radeon_get_pixmap_private(pixmap))) {
pScreen->DestroyPixmap(pixmap);
return NULL;
}
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 46148ad9..74d9584b 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -151,23 +151,19 @@ radeon_glamor_pre_init(ScrnInfoPtr scrn)
}
Bool
-radeon_glamor_create_textured_pixmap(PixmapPtr pixmap)
+radeon_glamor_create_textured_pixmap(PixmapPtr pixmap, struct radeon_pixmap *priv)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(scrn);
- struct radeon_pixmap *priv;
if ((info->use_glamor) == 0)
return TRUE;
- priv = radeon_get_pixmap_private(pixmap);
if (!priv->stride)
priv->stride = pixmap->devKind;
- if (glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
- priv->stride))
- return TRUE;
- else
- return FALSE;
+
+ return glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
+ priv->stride);
}
#ifndef CREATE_PIXMAP_USAGE_SHARED
@@ -222,7 +218,7 @@ radeon_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, priv->stride, NULL);
- if (!radeon_glamor_create_textured_pixmap(pixmap))
+ if (!radeon_glamor_create_textured_pixmap(pixmap, priv))
goto fallback_glamor;
}
@@ -298,7 +294,7 @@ radeon_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle)
priv->stride = pixmap->devKind;
priv->surface = surface;
- if (!radeon_glamor_create_textured_pixmap(pixmap)) {
+ if (!radeon_glamor_create_textured_pixmap(pixmap, priv)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to get PRIME drawable for glamor pixmap.\n");
return FALSE;
diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h
index e766bcc6..8010b4a6 100644
--- a/src/radeon_glamor.h
+++ b/src/radeon_glamor.h
@@ -51,12 +51,14 @@
#define GLAMOR_USE_PICTURE_SCREEN 0
#endif
+struct radeon_pixmap;
+
Bool radeon_glamor_pre_init(ScrnInfoPtr scrn);
Bool radeon_glamor_init(ScreenPtr screen);
Bool radeon_glamor_create_screen_resources(ScreenPtr screen);
void radeon_glamor_free_screen(int scrnIndex, int flags);
-Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap);
+Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap, struct radeon_pixmap *priv);
void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst);
XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt);
@@ -68,7 +70,7 @@ static inline Bool radeon_glamor_init(ScreenPtr screen) { return FALSE; }
static inline Bool radeon_glamor_create_screen_resources(ScreenPtr screen) { return FALSE; }
static inline void radeon_glamor_free_screen(int scrnIndex, int flags) { }
-static inline Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap) { return TRUE; }
+static inline Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap, struct radeon_pixmap *priv) { return TRUE; }
static inline void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst) {}