xf86-video-intel: 6 commits - src/common.h src/intel_driver.c src/intel.h src/sna/sna_accel.c src/sna/sna_dri.c src/sna/sna_glyphs.c src/sna/sna_video.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Feb 21 03:48:54 PST 2012


 src/common.h         |   17 -----------------
 src/intel.h          |    2 +-
 src/intel_driver.c   |   31 -------------------------------
 src/sna/sna_accel.c  |    5 +++++
 src/sna/sna_dri.c    |   33 +++++++++++++++++++--------------
 src/sna/sna_glyphs.c |    2 +-
 src/sna/sna_video.c  |    2 +-
 7 files changed, 27 insertions(+), 65 deletions(-)

New commits:
commit d051793b9194060f5408503b1fac56958c6e58e4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 21 11:42:31 2012 +0000

    sna/dri: Improve error handling of failing to create a DRI2 pixmap
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 96324e6..58a3e3c 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -210,7 +210,6 @@ sna_dri_create_buffer(DrawablePtr drawable,
 	switch (attachment) {
 	case DRI2BufferFrontLeft:
 		pixmap = get_drawable_pixmap(drawable);
-		pixmap->refcnt++;
 		bo = sna_pixmap_set_dri(sna, pixmap);
 		bpp = pixmap->drawable.bitsPerPixel;
 		DBG(("%s: attaching to front buffer %dx%d [%p:%d]\n",
@@ -295,14 +294,13 @@ sna_dri_create_buffer(DrawablePtr drawable,
 	private->bo = bo;
 
 	if (buffer->name == 0) {
-		/* failed to name buffer */
-		if (pixmap)
-			pixmap->drawable.pScreen->DestroyPixmap(pixmap);
-		else
-			kgem_bo_destroy(&sna->kgem, bo);
+		kgem_bo_destroy(&sna->kgem, bo);
 		goto err;
 	}
 
+	if (pixmap)
+		pixmap->refcnt++;
+
 	return buffer;
 
 err:
@@ -531,6 +529,8 @@ sna_dri_copy_region(DrawablePtr draw,
 	     region->extents.x1, region->extents.y1,
 	     region->extents.x2, region->extents.y2,
 	     REGION_NUM_RECTS(region)));
+	assert(dst != NULL);
+	assert(src != NULL);
 
 	sna_dri_copy(to_sna_from_drawable(draw), draw, region, dst, src, false);
 }
commit 580ae520cad749fb86a1bddd0fa2bcadfd60abb6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 21 10:55:46 2012 +0000

    sna: Short-circuit repeated calls to force-to-gpu
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 215dbca..72c3907 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2013,6 +2013,11 @@ sna_pixmap_force_to_gpu(PixmapPtr pixmap, unsigned flags)
 	if (priv == NULL)
 		return NULL;
 
+	if (DAMAGE_IS_ALL(priv->gpu_damage)) {
+		DBG(("%s: GPU all-damaged\n", __FUNCTION__));
+		return priv;
+	}
+
 	/* Unlike move-to-gpu, we ignore wedged and always create the GPU bo */
 	if (priv->gpu_bo == NULL) {
 		struct sna *sna = to_sna_from_pixmap(pixmap);
commit f2aafb98026b5c476b7f84aa2dc4c1f9ba2e573d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 21 10:43:11 2012 +0000

    uxa: Silence compiler warning for const arguments
    
    i965_video.c: In function 'gen6_create_cc_state':
    i965_video.c:1374:12: warning: passing argument 4 of
    'intel_bo_alloc_for_data' discards 'const' qualifier from pointer target
    type [enabled by default]
    
    Repeated ad nauseam.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel.h b/src/intel.h
index e5f8bc8..69f7c72 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -605,7 +605,7 @@ intel_emit_reloc(drm_intel_bo * bo, uint32_t offset,
 static inline drm_intel_bo *intel_bo_alloc_for_data(intel_screen_private *intel,
 						    const void *data,
 						    unsigned int size,
-						    char *name)
+						    const char *name)
 {
 	drm_intel_bo *bo;
 
commit 507f72d6d44963cae5d8d4b9da68165f73c6fd36
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 21 10:39:48 2012 +0000

    uxa: Remove DPRINTF stubs
    
    It wasn't being used for anything non-trivial and was throwing compiler
    warnings, so remove it.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/common.h b/src/common.h
index f9f2300..06b2192 100644
--- a/src/common.h
+++ b/src/common.h
@@ -51,20 +51,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define PFX __FILE__,__LINE__,__FUNCTION__
 #define FUNCTION_NAME __FUNCTION__
 
-#ifdef I830DEBUG
-#define MARKER() ErrorF("\n### %s:%d: >>> %s <<< ###\n\n", \
-			 __FILE__, __LINE__,__FUNCTION__)
-#define DPRINTF I830DPRINTF
-#else /* #ifdef I830DEBUG */
-#define MARKER()
-#define DPRINTF I830DPRINTF_stub
-static inline void
-I830DPRINTF_stub(const char *filename, int line, const char *function,
-		 const char *fmt, ...)
-{
-}
-#endif /* #ifdef I830DEBUG */
-
 #define KB(x) ((x) * 1024)
 #define MB(x) ((x) * KB(1024))
 
@@ -82,9 +68,6 @@ extern void intel_init_scrn(ScrnInfoPtr scrn);
 /* Symbol lists shared by the i810 and i830 parts. */
 extern int I830EntityIndex;
 
-extern void I830DPRINTF_stub(const char *filename, int line,
-			     const char *function, const char *fmt, ...);
-
 #ifdef _I830_H_
 #define PrintErrorState i830_dump_error_state
 #define WaitRingFunc I830WaitLpRing
diff --git a/src/intel_driver.c b/src/intel_driver.c
index b3871f4..1837509 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -137,23 +137,6 @@ static Bool I830EnterVT(int scrnIndex, int flags);
 /* temporary */
 extern void xf86SetCursor(ScreenPtr screen, CursorPtr pCurs, int x, int y);
 
-#ifdef I830DEBUG
-void
-I830DPRINTF(const char *filename, int line, const char *function,
-	    const char *fmt, ...)
-{
-	va_list ap;
-
-	ErrorF("\n##############################################\n"
-	       "*** In function %s, on line %d, in file %s ***\n",
-	       function, line, filename);
-	va_start(ap, fmt);
-	VErrorF(fmt, ap);
-	va_end(ap);
-	ErrorF("##############################################\n\n");
-}
-#endif /* #ifdef I830DEBUG */
-
 /* Export I830 options to i830 driver where necessary */
 const OptionInfoRec *intel_uxa_available_options(int chipid, int busid)
 {
@@ -169,8 +152,6 @@ I830LoadPalette(ScrnInfoPtr scrn, int numColors, int *indices,
 	int p;
 	uint16_t lut_r[256], lut_g[256], lut_b[256];
 
-	DPRINTF(PFX, "I830LoadPalette: numColors: %d\n", numColors);
-
 	for (p = 0; p < xf86_config->num_crtc; p++) {
 		xf86CrtcPtr crtc = xf86_config->crtc[p];
 
@@ -979,9 +960,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
 	if (!miSetPixmapDepths())
 		return FALSE;
 
-	DPRINTF(PFX, "assert( if(!I830EnterVT(scrnIndex, 0)) )\n");
-
-	DPRINTF(PFX, "assert( if(!fbScreenInit(screen, ...) )\n");
 	if (!fbScreenInit(screen, NULL,
 			  scrn->virtualX, scrn->virtualY,
 			  scrn->xDpi, scrn->yDpi,
@@ -1055,11 +1033,9 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
 	if (!xf86CrtcScreenInit(screen))
 		return FALSE;
 
-	DPRINTF(PFX, "assert( if(!miCreateDefColormap(screen)) )\n");
 	if (!miCreateDefColormap(screen))
 		return FALSE;
 
-	DPRINTF(PFX, "assert( if(!xf86HandleColormaps(screen, ...)) )\n");
 	if (!xf86HandleColormaps(screen, 256, 8, I830LoadPalette, NULL,
 				 CMAP_RELOAD_ON_MODE_SWITCH |
 				 CMAP_PALETTED_TRUECOLOR)) {
@@ -1141,8 +1117,6 @@ static void I830LeaveVT(int scrnIndex, int flags)
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 	int ret;
 
-	DPRINTF(PFX, "Leave VT\n");
-
 	xf86RotateFreeShadow(scrn);
 
 	xf86_hide_cursors(scrn);
@@ -1162,8 +1136,6 @@ static Bool I830EnterVT(int scrnIndex, int flags)
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 	int ret;
 
-	DPRINTF(PFX, "Enter VT\n");
-
 	ret = drmSetMaster(intel->drmSubFD);
 	if (ret) {
 		xf86DrvMsg(scrn->scrnIndex, X_WARNING,
@@ -1296,9 +1268,6 @@ static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo)
 	ScrnInfoPtr scrn = xf86Screens[scrnIndex];
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 
-	DPRINTF(PFX, "Enter VT, event %d, undo: %s\n", event,
-		BOOLTOSTRING(undo));
-
 	switch (event) {
 	case XF86_APM_SYS_SUSPEND:
 	case XF86_APM_CRITICAL_SUSPEND:	/*do we want to delay a critical suspend? */
commit c72a67390ea243bf43e2ee4efe237ab88a4615b7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 21 10:21:56 2012 +0000

    sna/dri: Update for AsyncSwap interface changes
    
    We now need to return TRUE/FALSE depending on whether we need to
    invalidate the drawable.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 2a25cbd..96324e6 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1537,7 +1537,7 @@ blit_fallback:
 }
 
 #if DRI2INFOREC_VERSION >= 7
-static void
+static Bool
 sna_dri_async_swap(ClientPtr client, DrawablePtr draw,
 		   DRI2BufferPtr front, DRI2BufferPtr back,
 		   DRI2SwapEventPtr func, void *data)
@@ -1553,6 +1553,8 @@ sna_dri_async_swap(ClientPtr client, DrawablePtr draw,
 	if (pipe == -1) {
 		PixmapPtr pixmap = get_drawable_pixmap(draw);
 
+		DBG(("%s: unattached, exchange pixmaps\n", __FUNCTION__));
+
 		set_bo(pixmap, get_private(back)->bo);
 		sna_dri_exchange_attachment(front, back);
 		get_private(back)->pixmap = pixmap;
@@ -1560,18 +1562,20 @@ sna_dri_async_swap(ClientPtr client, DrawablePtr draw,
 
 		DRI2SwapComplete(client, draw, 0, 0, 0,
 				 DRI2_EXCHANGE_COMPLETE, func, data);
-		return;
+		return TRUE;
 	}
 
 	if (!can_flip(sna, draw, front, back)) {
 blit:
+		DBG(("%s: unable to flip, so blit\n", __FUNCTION__));
+
 		sna_dri_copy(sna, draw, NULL,
 			     get_private(front)->bo,
 			     get_private(back)->bo,
 			     false);
 		DRI2SwapComplete(client, draw, 0, 0, 0,
 				 DRI2_BLIT_COMPLETE, func, data);
-		return;
+		return FALSE;
 	}
 
 	bo = NULL;
@@ -1611,13 +1615,13 @@ blit:
 
 		sna_dri_reference_buffer(front);
 		sna_dri_reference_buffer(back);
-
 	} else if (info->type != DRI2_ASYNC_FLIP) {
 		/* A normal vsync'ed client is finishing, wait for it
 		 * to unpin the old framebuffer before taking over.
 		 */
 		goto blit;
 	} else {
+		DBG(("%s: pending flip, chaining next\n", __FUNCTION__));
 		if (info->next_front.name == info->front->name) {
 			name = info->cache.name;
 			bo = info->cache.bo;
@@ -1629,16 +1633,16 @@ blit:
 		get_private(info->front)->bo = get_private(info->back)->bo;
 	}
 
-	if (bo == NULL)
+	if (bo == NULL) {
+		DBG(("%s: creating new back buffer\n", __FUNCTION__));
 		bo = kgem_create_2d(&sna->kgem,
 				    draw->width,
 				    draw->height,
 				    draw->bitsPerPixel,
 				    I915_TILING_X, CREATE_EXACT);
-	get_private(info->back)->bo = bo;
-
-	if (name == 0)
 		name = kgem_bo_flink(&sna->kgem, bo);
+	}
+	get_private(info->back)->bo = bo;
 	info->back->name = name;
 
 	set_bo(sna->front, get_private(info->front)->bo);
@@ -1646,6 +1650,7 @@ blit:
 
 	DRI2SwapComplete(client, draw, 0, 0, 0,
 			 DRI2_EXCHANGE_COMPLETE, func, data);
+	return TRUE;
 }
 #endif
 
commit 27bc2acf0e6a0e5e071e0d187bdf71577e821af8
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 21 09:29:41 2012 +0000

    sna: Fix use of RegionInit() for singular regions
    
    For a singular region, we want to use a value for nboxes of 0 not 1,
    fortunately if you pass in a box, it ignores the value of nboxes.
    RegionInit() is a most peculiar API!
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index bef1774..91273c9 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -1026,7 +1026,7 @@ glyphs_fallback(CARD8 op,
 	DBG(("%s: (%d, %d), (%d, %d)\n",
 	     __FUNCTION__, box.x1, box.y1, box.x2, box.y2));
 
-	RegionInit(&region, &box, 1);
+	RegionInit(&region, &box, 0);
 	RegionTranslate(&region, dst->pDrawable->x, dst->pDrawable->y);
 	if (dst->pCompositeClip)
 		RegionIntersect(&region, &region, dst->pCompositeClip);
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index cec0473..ebc3860 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -157,7 +157,7 @@ sna_video_clip_helper(ScrnInfoPtr scrn,
 
 	/* For textured video, we don't actually want to clip at all. */
 	if (crtc && !video->textured) {
-		RegionInit(&crtc_region_local, &crtc_box, 1);
+		RegionInit(&crtc_region_local, &crtc_box, 0);
 		crtc_region = &crtc_region_local;
 		RegionIntersect(crtc_region, crtc_region, reg);
 	}


More information about the xorg-commit mailing list