summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-08-25 18:04:58 +0100
committerThomas White <taw@bitwiz.org.uk>2009-08-25 18:04:58 +0100
commitd91c2881159e177d1edc6ffe916c93050b7c0ae2 (patch)
treea61a77f9cf0b900a7b1210b9f011eecbc1cc7b74
parent48f66451ac799520659b0739222cc1d0f6f65f09 (diff)
Get rid of ModifyPixmapHeader hook
This has the effect of fixing text rendering, and also makes the code a lot clearer.
-rw-r--r--src/glamo-kms-driver.c7
-rw-r--r--src/glamo-kms-exa.c35
-rw-r--r--src/glamo-kms-exa.h3
3 files changed, 17 insertions, 28 deletions
diff --git a/src/glamo-kms-driver.c b/src/glamo-kms-driver.c
index 32fdb4e..b2cfa7a 100644
--- a/src/glamo-kms-driver.c
+++ b/src/glamo-kms-driver.c
@@ -125,11 +125,10 @@ static Bool CreateFrontBuffer(ScrnInfoPtr pScrn)
PixmapPtr rootPixmap = pScreen->GetScreenPixmap(pScreen);
unsigned int flags;
- pScreen->ModifyPixmapHeader(rootPixmap,
+ GlamoKMSExaMakeFullyFledged(rootPixmap,
pScrn->virtualX, pScrn->virtualY,
pScrn->depth, pScrn->bitsPerPixel,
- pScrn->displayWidth * pScrn->bitsPerPixel/8,
- NULL);
+ pScrn->displayWidth*pScrn->bitsPerPixel/8);
drmModeAddFB(pGlamo->drm_fd,
pScrn->virtualX,
@@ -300,7 +299,7 @@ static Bool GlamoKMSCreateScreenResources(ScreenPtr pScreen)
rootPixmap = pScreen->GetScreenPixmap(pScreen);
- if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, NULL))
+ if (!GlamoKMSExaMakeFullyFledged(rootPixmap, -1, -1, -1, -1, -1))
FatalError("Couldn't adjust screen pixmap\n");
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Adding framebuffer....!\n");
diff --git a/src/glamo-kms-exa.c b/src/glamo-kms-exa.c
index a7950c8..87839c7 100644
--- a/src/glamo-kms-exa.c
+++ b/src/glamo-kms-exa.c
@@ -471,9 +471,10 @@ static void GlamoKMSExaFinishAccess(PixmapPtr pPix, int index)
}
-static Bool GlamoKMSExaModifyPixmapHeader(PixmapPtr pPix, int width, int height,
- int depth, int bitsPerPixel,
- int devKind, pointer pPixData)
+/* This essentially does the job of ModifyPixmapHeader, for the occasions
+ * when we need to update the properties of the screen pixmap. */
+Bool GlamoKMSExaMakeFullyFledged(PixmapPtr pPix, int width, int height,
+ int depth, int bitsPerPixel, int devKind)
{
ScreenPtr screen = pPix->drawable.pScreen;
ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
@@ -493,14 +494,14 @@ static Bool GlamoKMSExaModifyPixmapHeader(PixmapPtr pPix, int width, int height,
priv = exaGetPixmapDriverPrivate(pPix);
if (!priv) {
/* This should never, ever, happen */
- FatalError("NO PIXMAP PRIVATE\n");
+ FatalError("Fledgeling pixmap had no driver private!\n");
return FALSE;
}
new_size = (width * height * depth) / 8;
if ( new_size == 0 ) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Zero-sized pixmap in ModifyPixmapHeader"
+ "Fledgeling pixmap would still have zero size!"
" %ix%i %i bpp depth=%i\n", width, height,
bitsPerPixel, depth);
new_size = 1;
@@ -514,29 +515,15 @@ static Bool GlamoKMSExaModifyPixmapHeader(PixmapPtr pPix, int width, int height,
GLAMO_GEM_DOMAIN_VRAM, 0);
if ( priv->bo == NULL ) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Failed to create buffer object"
- " in ModifyPixmapHeader.\n");
+ "Couldn't create buffer object for"
+ " fledgeling pixmap!\n");
return FALSE;
}
} else {
- if ( priv->bo->size < new_size ) {
-
- /* Get rid of the old GEM object */
- glamo_bo_unref(priv->bo);
-
- /* Create a new one of the correct size */
- priv->bo = glamo_bo_open(pGlamo->bufmgr, 0, new_size, 2,
- GLAMO_GEM_DOMAIN_VRAM, 0);
- if ( priv->bo == NULL ) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Failed to reallocate buffer object"
- " in ModifyPixmapHeader.\n");
- return FALSE;
- }
-
- } /* else, reallocation is not required */
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Fledgeling pixmap already had a buffer object!\n");
}
@@ -662,7 +649,7 @@ void GlamoKMSExaInit(ScrnInfoPtr pScrn)
exa->CreatePixmap = GlamoKMSExaCreatePixmap;
exa->DestroyPixmap = GlamoKMSExaDestroyPixmap;
exa->PixmapIsOffscreen = GlamoKMSExaPixmapIsOffscreen;
- exa->ModifyPixmapHeader = GlamoKMSExaModifyPixmapHeader;
+ exa->ModifyPixmapHeader = NULL;
/* Hook up with libdrm */
pGlamo->bufmgr = glamo_bo_manager_gem_ctor(pGlamo->drm_fd);
diff --git a/src/glamo-kms-exa.h b/src/glamo-kms-exa.h
index 6452050..b39878a 100644
--- a/src/glamo-kms-exa.h
+++ b/src/glamo-kms-exa.h
@@ -25,3 +25,6 @@
extern void GlamoKMSExaInit(ScrnInfoPtr pScrn);
extern void GlamoKMSExaClose(ScrnInfoPtr pScrn);
extern unsigned int driGetPixmapHandle(PixmapPtr pPixmap, unsigned int *flags);
+extern Bool GlamoKMSExaMakeFullyFledged(PixmapPtr pPix, int width, int height,
+ int depth, int bitsPerPixel,
+ int devKind);