All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] configure.ac: Fix bad syntax for test calls
@ 2012-11-17 21:11 Eric Anholt
  2012-11-17 21:11 ` [PATCH 2/7] intel: Factor out the repeated swap fallback code Eric Anholt
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Eric Anholt @ 2012-11-17 21:11 UTC (permalink / raw)
  To: intel-gfx

---
 configure.ac |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index d92269f..92c77f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,7 +113,7 @@ AC_ARG_ENABLE(udev,
 
 if test x$UDEV != "xno"; then
 	PKG_CHECK_MODULES(UDEV, [libudev], [udev=yes], [udev=no])
-	if test x$UDEV == xyes -a x$udev != xyes; then
+	if test x$UDEV = xyes -a x$udev != xyes; then
 		AC_MSG_ERROR([udev support requested but not found (libudev)])
 	fi
 	if test x$udev = xyes; then
@@ -409,7 +409,7 @@ if test "x$UMS_ONLY" = xyes; then
 fi
 
 AM_CONDITIONAL(DEBUG, test x$DEBUG != xno)
-AM_CONDITIONAL(FULL_DEBUG, test x$FULL_DEBUG == xfull)
+AM_CONDITIONAL(FULL_DEBUG, test x$FULL_DEBUG = xfull)
 if test "x$DEBUG" = xno; then
 	AC_DEFINE(NDEBUG,1,[Disable internal debugging])
 fi
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/7] intel: Factor out the repeated swap fallback code.
  2012-11-17 21:11 [PATCH 1/7] configure.ac: Fix bad syntax for test calls Eric Anholt
@ 2012-11-17 21:11 ` Eric Anholt
  2012-11-17 21:11 ` [PATCH 3/7] intel: Add printf attribute to intel_debug_fallback() Eric Anholt
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2012-11-17 21:11 UTC (permalink / raw)
  To: intel-gfx

---
 src/intel_dri.c |   54 +++++++++++++++++++++++-------------------------------
 1 file changed, 23 insertions(+), 31 deletions(-)

diff --git a/src/intel_dri.c b/src/intel_dri.c
index 17d9d50..4c0827d 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -547,6 +547,23 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
 	intel_batch_submit(scrn);
 }
 
+static void
+I830DRI2FallbackBlitSwap(DrawablePtr drawable,
+			 DRI2BufferPtr dst,
+			 DRI2BufferPtr src)
+{
+	BoxRec box;
+	RegionRec region;
+
+	box.x1 = 0;
+	box.y1 = 0;
+	box.x2 = drawable->width;
+	box.y2 = drawable->height;
+	REGION_INIT(pScreen, &region, &box, 0);
+
+	I830DRI2CopyRegion(drawable, &region, dst, src);
+}
+
 #if DRI2INFOREC_VERSION >= 4
 
 static void I830DRI2ReferenceBuffer(DRI2Buffer2Ptr buffer)
@@ -996,17 +1013,8 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
 
 		/* else fall through to exchange/blit */
 	case DRI2_SWAP: {
-		BoxRec box;
-		RegionRec region;
-
-		box.x1 = 0;
-		box.y1 = 0;
-		box.x2 = drawable->width;
-		box.y2 = drawable->height;
-		REGION_INIT(pScreen, &region, &box, 0);
-
-		I830DRI2CopyRegion(drawable,
-				   &region, swap_info->front, swap_info->back);
+		I830DRI2FallbackBlitSwap(drawable,
+					 swap_info->front, swap_info->back);
 		DRI2SwapComplete(swap_info->client, drawable, frame, tv_sec, tv_usec,
 				 DRI2_BLIT_COMPLETE,
 				 swap_info->client ? swap_info->event_complete : NULL,
@@ -1089,17 +1097,10 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
 				i830_dri2_del_frame_event(chain_drawable, chain);
 			} else if (!can_exchange(chain_drawable, chain->front, chain->back) ||
 				   !I830DRI2ScheduleFlip(intel, chain_drawable, chain)) {
-				BoxRec box;
-				RegionRec region;
-
-				box.x1 = 0;
-				box.y1 = 0;
-				box.x2 = chain_drawable->width;
-				box.y2 = chain_drawable->height;
-				REGION_INIT(pScreen, &region, &box, 0);
+				I830DRI2FallbackBlitSwap(drawable,
+							 chain->front,
+							 chain->back);
 
-				I830DRI2CopyRegion(chain_drawable, &region,
-						   chain->front, chain->back);
 				DRI2SwapComplete(chain->client, chain_drawable, frame, tv_sec, tv_usec,
 						 DRI2_BLIT_COMPLETE,
 						 chain->client ? chain->event_complete : NULL,
@@ -1162,8 +1163,6 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
 	DRI2FrameEventPtr swap_info = NULL;
 	enum DRI2FrameEventType swap_type = DRI2_SWAP;
 	CARD64 current_msc;
-	BoxRec box;
-	RegionRec region;
 
 	/* Drawable not displayed... just complete the swap */
 	if (pipe == -1)
@@ -1313,14 +1312,7 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
 	return TRUE;
 
 blit_fallback:
-	box.x1 = 0;
-	box.y1 = 0;
-	box.x2 = draw->width;
-	box.y2 = draw->height;
-	REGION_INIT(pScreen, &region, &box, 0);
-
-	I830DRI2CopyRegion(draw, &region, front, back);
-
+	I830DRI2FallbackBlitSwap(draw, front, back);
 	DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data);
 	if (swap_info)
 	    i830_dri2_del_frame_event(draw, swap_info);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/7] intel: Add printf attribute to intel_debug_fallback().
  2012-11-17 21:11 [PATCH 1/7] configure.ac: Fix bad syntax for test calls Eric Anholt
  2012-11-17 21:11 ` [PATCH 2/7] intel: Factor out the repeated swap fallback code Eric Anholt
@ 2012-11-17 21:11 ` Eric Anholt
  2012-11-17 21:11 ` [PATCH 4/7] uxa: Fix const-cast warning Eric Anholt
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2012-11-17 21:11 UTC (permalink / raw)
  To: intel-gfx

Shuts up a bunch of warnings with xorg's shared warning flags, and
should give us more informative warnings in our code.
---
 src/intel.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/intel.h b/src/intel.h
index d394750..53ce33c 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -553,6 +553,9 @@ intel_get_transformed_coordinates_3d(int x, int y, PictTransformPtr transform,
 				    float *x_out, float *y_out, float *z_out);
 
 static inline void
+intel_debug_fallback(ScrnInfoPtr scrn, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3);
+
+static inline void
 intel_debug_fallback(ScrnInfoPtr scrn, const char *format, ...)
 {
 	intel_screen_private *intel = intel_get_screen_private(scrn);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/7] uxa: Fix const-cast warning.
  2012-11-17 21:11 [PATCH 1/7] configure.ac: Fix bad syntax for test calls Eric Anholt
  2012-11-17 21:11 ` [PATCH 2/7] intel: Factor out the repeated swap fallback code Eric Anholt
  2012-11-17 21:11 ` [PATCH 3/7] intel: Add printf attribute to intel_debug_fallback() Eric Anholt
@ 2012-11-17 21:11 ` Eric Anholt
  2012-11-17 21:11 ` [PATCH 5/7] uxa: Work around uninitialized-value warning Eric Anholt
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2012-11-17 21:11 UTC (permalink / raw)
  To: intel-gfx

The server interfaces take a non-const GCOps, because it expects you
to be able to modify them.
---
 uxa/uxa-accel.c |    2 +-
 uxa/uxa-priv.h  |    2 +-
 uxa/uxa.c       |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index 76425fe..522dd67 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -1038,7 +1038,7 @@ fallback:
 	uxa_check_push_pixels(pGC, pBitmap, pDrawable, w, h, x, y);
 }
 
-const GCOps uxa_ops = {
+GCOps uxa_ops = {
 	uxa_fill_spans,
 	uxa_set_spans,
 	uxa_put_image,
diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
index 3f639e7..4661575 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -296,7 +296,7 @@ void
 uxa_add_traps(PicturePtr pPicture,
 	      INT16 x_off, INT16 y_off, int ntrap, xTrap * traps);
 
-extern const GCOps uxa_ops;
+extern GCOps uxa_ops;
 
 #ifdef RENDER
 
diff --git a/uxa/uxa.c b/uxa/uxa.c
index 2635b50..b15d3c1 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -268,7 +268,7 @@ uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
 	}
 
 set_ops:
-	pGC->ops = (GCOps *) & uxa_ops;
+	pGC->ops = & uxa_ops;
 }
 
 static GCFuncs uxaGCFuncs = {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/7] uxa: Work around uninitialized-value warning.
  2012-11-17 21:11 [PATCH 1/7] configure.ac: Fix bad syntax for test calls Eric Anholt
                   ` (2 preceding siblings ...)
  2012-11-17 21:11 ` [PATCH 4/7] uxa: Fix const-cast warning Eric Anholt
@ 2012-11-17 21:11 ` Eric Anholt
  2012-11-17 21:11 ` [PATCH 6/7] uxa: Refactor early-exit paths of uxa_try_driver_composite() Eric Anholt
  2012-11-17 21:11 ` [PATCH 7/7] Don't mark the list of chipsets const when we just cast the const away Eric Anholt
  5 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2012-11-17 21:11 UTC (permalink / raw)
  To: intel-gfx

The compiler isn't noticing that localDst only diverges from pDst when
the _copy variables have also been set.
---
 uxa/uxa-render.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index 4463dc2..d783ea2 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -962,7 +962,7 @@ uxa_try_driver_composite(CARD8 op,
 	RegionRec region;
 	BoxPtr pbox;
 	int nbox;
-	int xDst_copy, yDst_copy;
+	int xDst_copy = 0, yDst_copy = 0;
 	int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
 	PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
 	PicturePtr localSrc, localMask = NULL;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/7] uxa: Refactor early-exit paths of uxa_try_driver_composite().
  2012-11-17 21:11 [PATCH 1/7] configure.ac: Fix bad syntax for test calls Eric Anholt
                   ` (3 preceding siblings ...)
  2012-11-17 21:11 ` [PATCH 5/7] uxa: Work around uninitialized-value warning Eric Anholt
@ 2012-11-17 21:11 ` Eric Anholt
  2012-11-17 21:11 ` [PATCH 7/7] Don't mark the list of chipsets const when we just cast the const away Eric Anholt
  5 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2012-11-17 21:11 UTC (permalink / raw)
  To: intel-gfx

Saves 200b of code at -O2.  I noticed this while fixing up the warning
in HEAD~1.
---
 uxa/uxa-render.c |   79 +++++++++++++++++++-----------------------------------
 1 file changed, 28 insertions(+), 51 deletions(-)

diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index d783ea2..3678f6a 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -965,8 +965,9 @@ uxa_try_driver_composite(CARD8 op,
 	int xDst_copy = 0, yDst_copy = 0;
 	int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
 	PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
-	PicturePtr localSrc, localMask = NULL;
+	PicturePtr localSrc = NULL, localMask = NULL;
 	PicturePtr localDst = pDst;
+	int ret = 0;
 
 	if (uxa_screen->info->check_composite &&
 	    !(*uxa_screen->info->check_composite) (op, pSrc, pMask, pDst, width, height))
@@ -1018,9 +1019,8 @@ uxa_try_driver_composite(CARD8 op,
 	pDstPix =
 	    uxa_get_offscreen_pixmap(localDst->pDrawable, &dst_off_x, &dst_off_y);
 	if (!pDstPix) {
-		if (localDst != pDst)
-			FreePicture(localDst, 0);
-		return -1;
+		ret = -1;
+		goto error;
 	}
 
 	xDst += localDst->pDrawable->x;
@@ -1031,9 +1031,8 @@ uxa_try_driver_composite(CARD8 op,
 				      width, height,
 				      &xSrc, &ySrc);
 	if (!localSrc) {
-		if (localDst != pDst)
-			FreePicture(localDst, 0);
-		return 0;
+		ret = 0;
+		goto error;
 	}
 
 	if (pMask) {
@@ -1042,72 +1041,38 @@ uxa_try_driver_composite(CARD8 op,
 					     width, height,
 					     &xMask, &yMask);
 		if (!localMask) {
-			if (localSrc != pSrc)
-				FreePicture(localSrc, 0);
-			if (localDst != pDst)
-				FreePicture(localDst, 0);
-
-			return 0;
+			ret = 0;
+			goto error;
 		}
 	}
 
 	if (!miComputeCompositeRegion(&region, localSrc, localMask, localDst,
 				      xSrc, ySrc, xMask, yMask, xDst, yDst,
 				      width, height)) {
-		if (localSrc != pSrc)
-			FreePicture(localSrc, 0);
-		if (localMask && localMask != pMask)
-			FreePicture(localMask, 0);
-		if (localDst != pDst)
-			FreePicture(localDst, 0);
-
-		return 1;
+		ret = 1;
+		goto error;
 	}
 
 	pSrcPix = uxa_get_offscreen_pixmap(localSrc->pDrawable,
 					   &src_off_x, &src_off_y);
 	if (!pSrcPix) {
-		REGION_UNINIT(screen, &region);
-
-		if (localSrc != pSrc)
-			FreePicture(localSrc, 0);
-		if (localMask && localMask != pMask)
-			FreePicture(localMask, 0);
-		if (localDst != pDst)
-			FreePicture(localDst, 0);
-
-		return 0;
+		ret = 0;
+		goto error;
 	}
 
 	if (localMask) {
 		pMaskPix = uxa_get_offscreen_pixmap(localMask->pDrawable,
 						    &mask_off_x, &mask_off_y);
 		if (!pMaskPix) {
-			REGION_UNINIT(screen, &region);
-
-			if (localSrc != pSrc)
-				FreePicture(localSrc, 0);
-			if (localMask && localMask != pMask)
-				FreePicture(localMask, 0);
-			if (localDst != pDst)
-				FreePicture(localDst, 0);
-
-			return 0;
+			ret = 0;
+			goto error;
 		}
 	}
 
 	if (!(*uxa_screen->info->prepare_composite)
 	    (op, localSrc, localMask, localDst, pSrcPix, pMaskPix, pDstPix)) {
-		REGION_UNINIT(screen, &region);
-
-		if (localSrc != pSrc)
-			FreePicture(localSrc, 0);
-		if (localMask && localMask != pMask)
-			FreePicture(localMask, 0);
-		if (localDst != pDst)
-			FreePicture(localDst, 0);
-
-		return -1;
+		ret = -1;
+		goto error;
 	}
 
 	if (pMask) {
@@ -1156,6 +1121,18 @@ uxa_try_driver_composite(CARD8 op,
 	}
 
 	return 1;
+
+error:
+	REGION_UNINIT(screen, &region);
+
+	if (localSrc && localSrc != pSrc)
+		FreePicture(localSrc, 0);
+	if (localMask && localMask != pMask)
+		FreePicture(localMask, 0);
+	if (localDst != pDst)
+		FreePicture(localDst, 0);
+
+	return ret;
 }
 
 /**
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 7/7] Don't mark the list of chipsets const when we just cast the const away.
  2012-11-17 21:11 [PATCH 1/7] configure.ac: Fix bad syntax for test calls Eric Anholt
                   ` (4 preceding siblings ...)
  2012-11-17 21:11 ` [PATCH 6/7] uxa: Refactor early-exit paths of uxa_try_driver_composite() Eric Anholt
@ 2012-11-17 21:11 ` Eric Anholt
  2012-11-18 11:54   ` Chris Wilson
  5 siblings, 1 reply; 8+ messages in thread
From: Eric Anholt @ 2012-11-17 21:11 UTC (permalink / raw)
  To: intel-gfx

Fixes another gcc warning.
---
 src/intel_module.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel_module.c b/src/intel_module.c
index ef62667..06d2ee7 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -111,7 +111,7 @@ static const struct intel_device_info intel_haswell_info = {
 	.gen = 75,
 };
 
-static const SymTabRec _intel_chipsets[] = {
+static SymTabRec _intel_chipsets[] = {
 	{PCI_CHIP_I810,				"i810"},
 	{PCI_CHIP_I810_DC100,			"i810-dc100"},
 	{PCI_CHIP_I810_E,			"i810e"},
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 7/7] Don't mark the list of chipsets const when we just cast the const away.
  2012-11-17 21:11 ` [PATCH 7/7] Don't mark the list of chipsets const when we just cast the const away Eric Anholt
@ 2012-11-18 11:54   ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2012-11-18 11:54 UTC (permalink / raw)
  To: Eric Anholt, intel-gfx

On Sat, 17 Nov 2012 13:11:14 -0800, Eric Anholt <eric@anholt.net> wrote:
> Fixes another gcc warning.

So you would prefer to move it out of the ro ELF section to merely
silence the compiler? And similarly remove the memory protection for the
function pointers?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-11-18 11:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-17 21:11 [PATCH 1/7] configure.ac: Fix bad syntax for test calls Eric Anholt
2012-11-17 21:11 ` [PATCH 2/7] intel: Factor out the repeated swap fallback code Eric Anholt
2012-11-17 21:11 ` [PATCH 3/7] intel: Add printf attribute to intel_debug_fallback() Eric Anholt
2012-11-17 21:11 ` [PATCH 4/7] uxa: Fix const-cast warning Eric Anholt
2012-11-17 21:11 ` [PATCH 5/7] uxa: Work around uninitialized-value warning Eric Anholt
2012-11-17 21:11 ` [PATCH 6/7] uxa: Refactor early-exit paths of uxa_try_driver_composite() Eric Anholt
2012-11-17 21:11 ` [PATCH 7/7] Don't mark the list of chipsets const when we just cast the const away Eric Anholt
2012-11-18 11:54   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.