xf86-video-intel: 3 commits - src/sna/gen4_vertex.c src/sna/sna_trapezoids_precise.c src/sna/xassert.h tools/virtual.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Sep 12 13:18:15 PDT 2014


 src/sna/gen4_vertex.c            |    8 ---
 src/sna/sna_trapezoids_precise.c |   81 ---------------------------------------
 src/sna/xassert.h                |    2 
 tools/virtual.c                  |    4 -
 4 files changed, 3 insertions(+), 92 deletions(-)

New commits:
commit 7ed66ca0fd1160ede890c216c35d4ac42a98ab57
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 12 21:17:04 2014 +0100

    sna: Remvoe unused code
    
    sna_trapezoids_precise.c:566:1: warning: unused function
    'polygon_add_line' [-Wunused-function]
    
    gen4_vertex.c:3093:1: warning: unused function
    'gen4_choose_spans_vertex_buffer' [-Wunused-function]
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c
index 31044d6..7d75729 100644
--- a/src/sna/gen4_vertex.c
+++ b/src/sna/gen4_vertex.c
@@ -3089,14 +3089,6 @@ emit_span_boxes_linear__avx2(const struct sna_composite_spans_op *op,
 }
 #endif
 
-inline static uint32_t
-gen4_choose_spans_vertex_buffer(const struct sna_composite_op *op)
-{
-	int id = op->src.is_solid ? 1 : 2 + !op->src.is_affine;
-	DBG(("%s: id=%x (%d, 1)\n", __FUNCTION__, 1 << 2 | id, id));
-	return 1 << 2 | id;
-}
-
 unsigned gen4_choose_spans_emitter(struct sna *sna,
 				   struct sna_composite_spans_op *tmp)
 {
diff --git a/src/sna/sna_trapezoids_precise.c b/src/sna/sna_trapezoids_precise.c
index 6cde824..99ed087 100644
--- a/src/sna/sna_trapezoids_precise.c
+++ b/src/sna/sna_trapezoids_precise.c
@@ -562,87 +562,6 @@ polygon_add_edge(struct polygon *polygon,
 	polygon->num_edges++;
 }
 
-inline static void
-polygon_add_line(struct polygon *polygon,
-		 const xPointFixed *p1,
-		 const xPointFixed *p2)
-{
-	struct edge *e = &polygon->edges[polygon->num_edges];
-	int dx = p2->x - p1->x;
-	int dy = p2->y - p1->y;
-	int top, bot;
-
-	if (dy == 0)
-		return;
-
-	__DBG(("%s: line=(%d, %d), (%d, %d)\n",
-	       __FUNCTION__, (int)p1->x, (int)p1->y, (int)p2->x, (int)p2->y));
-
-	e->dir = 1;
-	if (dy < 0) {
-		const xPointFixed *t;
-
-		dx = -dx;
-		dy = -dy;
-
-		e->dir = -1;
-
-		t = p1;
-		p1 = p2;
-		p2 = t;
-	}
-	assert (dy > 0);
-	e->dy = dy;
-
-	top = MAX(p1->y, polygon->ymin);
-	bot = MIN(p2->y, polygon->ymax);
-	if (bot <= top)
-		return;
-
-	e->ytop = top;
-	e->height_left = bot - top;
-	if (e->height_left <= 0)
-		return;
-
-	if (dx == 0) {
-		e->x.quo = p1->x;
-		e->x.rem = -dy;
-		e->dxdy.quo = 0;
-		e->dxdy.rem = 0;
-		e->dy = 0;
-	} else {
-		e->dxdy = floored_divrem(dx, dy);
-		if (top == p1->y) {
-			e->x.quo = p1->x;
-			e->x.rem = -dy;
-		} else {
-			e->x = floored_muldivrem(top - p1->y, dx, dy);
-			e->x.quo += p1->x;
-			e->x.rem -= dy;
-		}
-	}
-
-	if (polygon->num_edges > 0) {
-		struct edge *prev = &polygon->edges[polygon->num_edges-1];
-		/* detect degenerate triangles inserted into tristrips */
-		if (e->dir == -prev->dir &&
-		    e->ytop == prev->ytop &&
-		    e->height_left == prev->height_left &&
-		    e->x.quo == prev->x.quo &&
-		    e->x.rem == prev->x.rem &&
-		    e->dxdy.quo == prev->dxdy.quo &&
-		    e->dxdy.rem == prev->dxdy.rem) {
-			unsigned ix = EDGE_Y_BUCKET_INDEX(e->ytop,
-							  polygon->ymin);
-			polygon->y_buckets[ix] = prev->next;
-			return;
-		}
-	}
-
-	_polygon_insert_edge_into_its_y_bucket(polygon, e);
-	polygon->num_edges++;
-}
-
 static void
 active_list_reset(struct active_list *active)
 {
commit f0d5dbe9bf0d507fd5b60bd7a90be09351f75249
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 12 21:16:12 2014 +0100

    sna: Fix include guard
    
    ./xassert.h:24:9: warning: '__XASSERT_H___' is used as a header guard
    here, followed by #define of a different macro [-Wheader-guard]
            ^~~~~~~~~~~~~~
    ./xassert.h:25:9: note: '__XASSERT_H__' is defined here; did you mean
    '__XASSERT_H___'?
            ^~~~~~~~~~~~~
            __XASSERT_H___
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/xassert.h b/src/sna/xassert.h
index 7ab2591..7252ae8 100644
--- a/src/sna/xassert.h
+++ b/src/sna/xassert.h
@@ -21,7 +21,7 @@
  * SOFTWARE.
  */
 
-#ifndef __XASSERT_H___
+#ifndef __XASSERT_H__
 #define __XASSERT_H__
 
 /* Rewrap the traditional assert so that we can capture the error message
commit 7548f77fff1832c038e624c655d534387619d825
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 12 21:15:18 2014 +0100

    intel-virtual-output: Initialise width/height for a disabled output
    
    virtual.c:1081:6: warning: variable 'width' is used uninitialized
    whenever 'if' condition is true [-Wsometimes-uninitialized]
            if (clone->dst.mode.id == 0) {
                ^~~~~~~~~~~~~~~~~~~~~~~
    virtual.c:1092:6: note: uninitialized use occurs here
            if (width == clone->width && height == clone->height)
                ^~~~~
    virtual.c:1081:2: note: remove the 'if' if its condition is always false
            if (clone->dst.mode.id == 0) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    virtual.c:1079:11: note: initialize the variable 'width' to silence this warning
            int width, height;
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index d16a55f..dbbbc27 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1079,8 +1079,8 @@ static int clone_init_xfer(struct clone *clone)
 	int width, height;
 
 	if (clone->dst.mode.id == 0) {
-		clone->width = 0;
-		clone->height = 0;
+		width = 0;
+		height = 0;
 	} else if (clone->dri3.xid) {
 		width = clone->dst.display->width;
 		height = clone->dst.display->height;


More information about the xorg-commit mailing list