summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2013-03-06 21:02:47 -0500
committerRob Clark <robdclark@gmail.com>2013-03-06 22:08:34 -0500
commitdc8f8cff38a9f7b5fac615bfb5a8150860920f9a (patch)
tree6a3224dfe6118a5367222f6d297fab68c9b3df2e
parent45bdc281e05781989d90bf6fe00c0d3450257f7b (diff)
exa: use CreatePixmap2
This will be handy later if we want DRI to request creation of render targets in SMI.
-rw-r--r--src/msm-exa.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/msm-exa.c b/src/msm-exa.c
index 1f6d263..f16fbf0 100644
--- a/src/msm-exa.c
+++ b/src/msm-exa.c
@@ -865,12 +865,23 @@ MSMFinishAccess(PixmapPtr pPixmap, int index)
pPixmap->devPrivate.ptr = NULL;
}
+#define EXA_ALIGN(offset, align) (((offset) + (align) - 1) - \
+ (((offset) + (align) - 1) % (align)))
+
static void *
-MSMCreatePixmap(ScreenPtr pScreen, int size, int align)
+MSMCreatePixmap2(ScreenPtr pScreen, int width, int height,
+ int depth, int usage_hint, int bpp,
+ int *new_fb_pitch)
{
struct msm_pixmap_priv *priv;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
MSMPtr pMsm = MSMPTR(pScrn);
+ int pitch, size;
+
+ pitch = EXA_ALIGN(width * bpp, pMsm->pExa->pixmapPitchAlign * 8) / 8;
+ size = pitch * height;
+
+ *new_fb_pitch = pitch;
priv = calloc(1, sizeof(struct msm_pixmap_priv));
@@ -966,7 +977,7 @@ MSMSetupExa(ScreenPtr pScreen)
pExa->MarkSync = MSMMarkSync;
pExa->WaitMarker = MSMWaitMarker;
pExa->PixmapIsOffscreen = MSMPixmapIsOffscreen;
- pExa->CreatePixmap = MSMCreatePixmap;
+ pExa->CreatePixmap2 = MSMCreatePixmap2;
pExa->DestroyPixmap = MSMDestroyPixmap;
pExa->PrepareAccess = MSMPrepareAccess;
pExa->FinishAccess = MSMFinishAccess;