[pkg-fso-commits] [SCM] xf86-video-glamo, SMedia Glamo video driver for X.Org branch, master, updated. upstream/0.0.0+20090707.git98c012f7-57-g9918e08

Thomas White taw at bitwiz.org.uk
Fri Jan 8 13:24:46 UTC 2010


The following commit has been merged in the master branch:
commit 625f242ec50bba88fb8010b0e8a8c0c7781b2960
Author: Thomas White <taw at bitwiz.org.uk>
Date:   Sun Aug 9 23:20:48 2009 +0100

    Use libDRM functions instead of bom->funcs etc

diff --git a/src/glamo-kms-exa.c b/src/glamo-kms-exa.c
index 4aec710..3d9701f 100644
--- a/src/glamo-kms-exa.c
+++ b/src/glamo-kms-exa.c
@@ -382,12 +382,8 @@ static void *GlamoKMSExaCreatePixmap(ScreenPtr screen, int size, int align)
 		return new_priv;
 
 	/* Dive into the kernel (via libdrm) to allocate some VRAM */
-	new_priv->bo = pGlamo->bufmgr->funcs->bo_open(pGlamo->bufmgr,
-						      0, /* handle */
-						      size,
-						      align,
-						      GLAMO_GEM_DOMAIN_VRAM,
-						      0 /* flags */	      );
+	new_priv->bo = glamo_bo_open(pGlamo->bufmgr, 0, size, align,
+	                             GLAMO_GEM_DOMAIN_VRAM, 0);
 	if (!new_priv->bo) {
 		xfree(new_priv);
 		xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -401,12 +397,11 @@ static void *GlamoKMSExaCreatePixmap(ScreenPtr screen, int size, int align)
 
 static void GlamoKMSExaDestroyPixmap(ScreenPtr screen, void *driverPriv)
 {
-	ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
-	GlamoPtr pGlamo = GlamoPTR(pScrn);
 	struct glamo_exa_pixmap_priv *driver_priv = driverPriv;
 
 	if (driver_priv->bo)
-		pGlamo->bufmgr->funcs->bo_unref(driver_priv->bo);
+		glamo_bo_unref(driver_priv->bo);
+
 	xfree(driver_priv);
 }
 
@@ -427,7 +422,6 @@ static Bool GlamoKMSExaPrepareAccess(PixmapPtr pPix, int index)
 {
 	ScreenPtr screen = pPix->drawable.pScreen;
 	ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
-	GlamoPtr pGlamo = GlamoPTR(pScrn);
 	struct glamo_exa_pixmap_priv *driver_priv;
 
 	driver_priv = exaGetPixmapDriverPrivate(pPix);
@@ -443,7 +437,7 @@ static Bool GlamoKMSExaPrepareAccess(PixmapPtr pPix, int index)
 		return TRUE;
 	}
 
-	if (pGlamo->bufmgr->funcs->bo_map(driver_priv->bo, 1)) {
+	if ( glamo_bo_map(driver_priv->bo, 1) ) {
 		xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 				"%s: bo map failed\n", __FUNCTION__);
 		return FALSE;
@@ -458,7 +452,6 @@ static void GlamoKMSExaFinishAccess(PixmapPtr pPix, int index)
 {
 	ScreenPtr screen = pPix->drawable.pScreen;
 	ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
-	GlamoPtr pGlamo = GlamoPTR(pScrn);
 	struct glamo_exa_pixmap_priv *driver_priv;
 
 	driver_priv = exaGetPixmapDriverPrivate(pPix);
@@ -474,7 +467,7 @@ static void GlamoKMSExaFinishAccess(PixmapPtr pPix, int index)
 		return;
 	}
 
-	pGlamo->bufmgr->funcs->bo_unmap(driver_priv->bo);
+	glamo_bo_unmap(driver_priv->bo);
 	pPix->devPrivate.ptr = NULL;
 }
 
@@ -510,13 +503,13 @@ static Bool GlamoKMSExaModifyPixmapHeader(PixmapPtr pPix, int width, int height,
 
 		/* This pixmap has no associated buffer object.
 		 * It's time to create one */
-		size = width * height * (depth/8);
-		priv->bo = pGlamo->bufmgr->funcs->bo_open(pGlamo->bufmgr,
-		                                          0, /* handle */
-		                                          size,
-		                                          2,
-		                                          GLAMO_GEM_DOMAIN_VRAM,
-		                                          0 /* flags */       );
+		size = (width * height * depth) / 8;
+		if ( size == 0 ) {
+			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+			           "Zero-sized pixmap in ModifyPixmapHeader\n");
+		}
+		priv->bo = glamo_bo_open(pGlamo->bufmgr, 0, size, 2,
+		                         GLAMO_GEM_DOMAIN_VRAM, 0);
 
 		if ( priv->bo == NULL ) {
 			xf86DrvMsg(pScrn->scrnIndex, X_WARNING,

-- 
xf86-video-glamo, SMedia Glamo video driver for X.Org



More information about the pkg-fso-commits mailing list