summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-09-03 12:56:56 +1000
committerDave Airlie <airlied@redhat.com>2012-09-03 12:58:38 +1000
commitf7502a11c8ef9c453ceb40d26109977116df88c2 (patch)
treefeb7da4c10f61568566edd5061864c45f8f8a790
parentf71139a2afe8fffb628331402bf829a6d67c9fff (diff)
radeon: add shared support to pixmaps.
this just adds the interface and shared support to the pixmap. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/evergreen_exa.c10
-rw-r--r--src/r600_exa.c10
-rw-r--r--src/radeon.h19
-rw-r--r--src/radeon_exa_funcs.c9
4 files changed, 41 insertions, 7 deletions
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index f906cbf2..40e2e96e 100644
--- a/src/evergreen_exa.c
+++ b/src/evergreen_exa.c
@@ -482,3 +482,6 @@ EVERGREENPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
dst_obj.bpp = pDst->drawable.bitsPerPixel;
- dst_obj.domain = RADEON_GEM_DOMAIN_VRAM;
+ if (radeon_get_pixmap_shared(pDst) == TRUE)
+ dst_obj.domain = RADEON_GEM_DOMAIN_GTT;
+ else
+ dst_obj.domain = RADEON_GEM_DOMAIN_VRAM;
@@ -1159,3 +1162,6 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
dst_obj.bpp = pDst->drawable.bitsPerPixel;
- dst_obj.domain = RADEON_GEM_DOMAIN_VRAM;
+ if (radeon_get_pixmap_shared(pDst) == TRUE)
+ dst_obj.domain = RADEON_GEM_DOMAIN_GTT;
+ else
+ dst_obj.domain = RADEON_GEM_DOMAIN_VRAM;
diff --git a/src/r600_exa.c b/src/r600_exa.c
index 61b6315c..be0a9fae 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -553,3 +553,6 @@ R600PrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
dst_obj.bpp = pDst->drawable.bitsPerPixel;
- dst_obj.domain = RADEON_GEM_DOMAIN_VRAM;
+ if (radeon_get_pixmap_shared(pDst) == TRUE) {
+ dst_obj.domain = RADEON_GEM_DOMAIN_GTT;
+ } else
+ dst_obj.domain = RADEON_GEM_DOMAIN_VRAM;
@@ -1205,3 +1208,6 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
dst_obj.bpp = pDst->drawable.bitsPerPixel;
- dst_obj.domain = RADEON_GEM_DOMAIN_VRAM;
+ if (radeon_get_pixmap_shared(pDst) == TRUE)
+ dst_obj.domain = RADEON_GEM_DOMAIN_GTT;
+ else
+ dst_obj.domain = RADEON_GEM_DOMAIN_VRAM;
diff --git a/src/radeon.h b/src/radeon.h
index 2f05249e..2eac38e5 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -251,2 +251,3 @@ struct radeon_exa_pixmap_priv {
Bool bo_mapped;
+ Bool shared;
};
@@ -268,2 +269,3 @@ struct radeon_2d_state {
uint32_t default_sc_bottom_right;
+ uint32_t dst_domain;
struct radeon_bo *dst_bo;
@@ -626,2 +628,19 @@ static inline struct radeon_bo *radeon_get_pixmap_bo(PixmapPtr pPix)
+static inline Bool radeon_get_pixmap_shared(PixmapPtr pPix)
+{
+#ifdef USE_GLAMOR
+ RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(pPix->drawable.pScreen));
+
+ if (info->use_glamor) {
+ ErrorF("glamor sharing todo\n");
+ return FALSE:
+ } else
+#endif
+ {
+ struct radeon_exa_pixmap_priv *driver_priv;
+ driver_priv = exaGetPixmapDriverPrivate(pPix);
+ return driver_priv->shared;
+ }
+ return FALSE;
+}
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index 4c13a000..db44d948 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -82,3 +82,3 @@ static void Emit2DState(ScrnInfoPtr pScrn, int op)
OUT_RING_REG(RADEON_DST_PITCH_OFFSET, info->state_2d.dst_pitch_offset);
- OUT_RING_RELOC(info->state_2d.dst_bo, 0, RADEON_GEM_DOMAIN_VRAM);
+ OUT_RING_RELOC(info->state_2d.dst_bo, 0, info->state_2d.dst_domain);
@@ -147,4 +147,6 @@ RADEONPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
driver_priv = exaGetPixmapDriverPrivate(pPix);
- if (driver_priv)
+ if (driver_priv) {
info->state_2d.dst_bo = driver_priv->bo;
+ info->state_2d.dst_domain = driver_priv->shared ? RADEON_GEM_DOMAIN_GTT : RADEON_GEM_DOMAIN_VRAM;
+ }
@@ -260,4 +262,5 @@ RADEONPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
driver_priv = exaGetPixmapDriverPrivate(pDst);
- radeon_cs_space_add_persistent_bo(info->cs, driver_priv->bo, 0, RADEON_GEM_DOMAIN_VRAM);
info->state_2d.dst_bo = driver_priv->bo;
+ info->state_2d.dst_domain = driver_priv->shared ? RADEON_GEM_DOMAIN_GTT : RADEON_GEM_DOMAIN_VRAM;
+ radeon_cs_space_add_persistent_bo(info->cs, driver_priv->bo, 0, info->state_2d.dst_domain);