xf86-video-intel: 4 commits - src/sna/sna_display.c src/sna/sna_present.c src/sna/sna_trapezoids.h src/sna/sna_trapezoids_imprecise.c src/uxa/intel_video.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Sep 24 00:01:31 PDT 2014


 src/sna/sna_display.c              |   23 +++++++++++++++++++++++
 src/sna/sna_present.c              |   21 ++++++++++++++++-----
 src/sna/sna_trapezoids.h           |    3 ++-
 src/sna/sna_trapezoids_imprecise.c |   17 +++++++++--------
 src/uxa/intel_video.c              |    2 ++
 5 files changed, 52 insertions(+), 14 deletions(-)

New commits:
commit b9dddc051d57b313fdc9f14ec388b060fdff3924
Author: tobias.jakobi1 at uni-bielefeld.de <tobias.jakobi1 at uni-bielefeld.de>
Date:   Tue Sep 23 20:13:11 2014 +0200

    uxa/video: only call intel_xvmc_adaptor_init when xvmc is enabled
    
    Build regression from
    
    commit 616dea2c67847101fd43b5d89b556b3702c7f0bb
    Author: Keith Packard <keithp at keithp.com>
    Date:   Thu Jul 24 10:27:55 2014 -0700
    
        Rename uxa-specific functions and structs
    
    Signed-off-by: Tobias Jakobi <tjakobi at math.uni-bielefeld.de>

diff --git a/src/uxa/intel_video.c b/src/uxa/intel_video.c
index 310b6c9..33d447c 100644
--- a/src/uxa/intel_video.c
+++ b/src/uxa/intel_video.c
@@ -239,8 +239,10 @@ void intel_video_init(ScreenPtr screen)
 		intel->XvEnabled = FALSE;
 	}
 
+#ifdef INTEL_XVMC
         if (texturedAdaptor)
                 intel_xvmc_adaptor_init(screen);
+#endif
 
 	free(adaptors);
 }
commit fe6ab444ad9d138aa011df6cee9f2cee65dbf493
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 24 07:54:39 2014 +0100

    sna: Initialise the per-CRTC shadow bo on first use
    
    When we create the shadow pixmap for the CRTC, we should copy the
    framebuffer contents into the shadow before we show it the first time.
    This saves us from showing stale contents until the next redrawn in the
    BlockHandler - with the proviso that we can do the copy on the GPU.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 2a98fb9..3ca56f1 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1872,6 +1872,29 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
 			return NULL;
 		}
 
+		if (__sna_pixmap_get_bo(sna->front)) {
+			DrawableRec tmp;
+
+			DBG(("%s: copying onto shadow CRTC: (%d, %d), (%d, %d), handle=%d\n",
+			     __FUNCTION__,
+			     crtc->bounds.x1,
+			     crtc->bounds.y1,
+			     crtc->bounds.x2,
+			     crtc->bounds.y2,
+			     bo->handle));
+
+			tmp.width = crtc->mode.HDisplay;
+			tmp.height = crtc->mode.VDisplay;
+			tmp.depth = sna->front->drawable.depth;
+			tmp.bitsPerPixel = sna->front->drawable.bitsPerPixel;
+
+			(void)sna->render.copy_boxes(sna, GXcopy,
+						     &sna->front->drawable, __sna_pixmap_get_bo(sna->front), 0, 0,
+						     &tmp, bo, -crtc->bounds.x1, -crtc->bounds.y1,
+						     &crtc->bounds, 1,
+						     0);
+		}
+
 		sna_crtc->transform = true;
 		return bo;
 	} else {
commit 1e403716d387be1d741537e02db207416080dbeb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 24 07:37:32 2014 +0100

    sna/present: Make DBG statements uniform before present_event_notify()
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_present.c b/src/sna/sna_present.c
index 6036fbb..8fc2cf1 100644
--- a/src/sna/sna_present.c
+++ b/src/sna/sna_present.c
@@ -128,9 +128,10 @@ sna_present_vblank_handler(struct sna *sna, struct drm_event_vblank *event)
 {
 	struct sna_present_event *info = to_present_event(event->user_data);
 
-	DBG(("%s: pipe=%d event=%lld, tv=%d.%06d msc=%d\n", __FUNCTION__,
-	     sna_crtc_to_pipe(info->crtc), (long long)info->event_id,
-	     event->tv_sec, event->tv_usec, event->sequence));
+	DBG(("%s: pipe=%d tv=%d.%06d msc=%d, event %lld complete\n", __FUNCTION__,
+	     sna_crtc_to_pipe(info->crtc),
+	     event->tv_sec, event->tv_usec, event->sequence,
+	     (long long)info->event_id));
 	present_event_notify(info->event_id,
 			     ust64(event->tv_sec, event->tv_usec),
 			     sna_crtc_record_event(info->crtc, event));
@@ -287,6 +288,11 @@ page_flip__async(RRCrtcPtr crtc,
 		return FALSE;
 	}
 
+	DBG(("%s: pipe=%d tv=%d.%06d msc=%d, event %lld complete\n", __FUNCTION__,
+	     pipe_from_crtc(crtc),
+	     gettime_ust64() / 1000000, gettime_ust64() % 1000000,
+	     sna_crtc_last_swap(crtc->devPrivate)->msc,
+	     (long long)event_id));
 	present_event_notify(event_id, gettime_ust64(), target_msc);
 	return TRUE;
 }
@@ -308,9 +314,10 @@ present_flip_handler(struct sna *sna,
 	} else
 		swap = *sna_crtc_last_swap(info->crtc);
 
-	DBG(("%s: pipe=%d, tv=%d.%06d msc %lld, complete\n", __FUNCTION__,
+	DBG(("%s: pipe=%d, tv=%d.%06d msc %lld, event %lld complete\n", __FUNCTION__,
 	     info->crtc ? sna_crtc_to_pipe(info->crtc) : -1,
-	     swap.tv_sec, swap.tv_usec, (long long)swap.msc));
+	     swap.tv_sec, swap.tv_usec, (long long)swap.msc,
+	     (long long)info->event_id));
 	present_event_notify(info->event_id, ust64(swap.tv_sec, swap.tv_usec), swap.msc);
 	free(info);
 }
@@ -423,6 +430,10 @@ sna_present_unflip(ScreenPtr screen, uint64_t event_id)
 
 notify:
 		swap = sna_crtc_last_swap(sna_mode_first_crtc(sna));
+		DBG(("%s: pipe=%d, tv=%d.%06d msc %lld, event %lld complete\n", __FUNCTION__,
+		     -1,
+		     swap->tv_sec, swap->tv_usec, (long long)swap->msc,
+		     (long long)event_id));
 		present_event_notify(event_id,
 				     ust64(swap->tv_sec, swap->tv_usec),
 				     swap->msc);
commit 4e00cbe35d1a409a02ee27d991213d9a0807e500
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Sep 22 08:54:57 2014 +0100

    traps

diff --git a/src/sna/sna_trapezoids.h b/src/sna/sna_trapezoids.h
index d101726..5acf531 100644
--- a/src/sna/sna_trapezoids.h
+++ b/src/sna/sna_trapezoids.h
@@ -332,7 +332,8 @@ xTriangleValid(const xTriangle *t)
 
 static inline int pixman_fixed_to_fast(pixman_fixed_t v)
 {
-	return (v + ((1<<(16-FAST_SAMPLES_shift-1))-1)) >> (16 - FAST_SAMPLES_shift);
+	//return (v + ((1<<(16-FAST_SAMPLES_shift-1))-1)) >> (16 - FAST_SAMPLES_shift);
+	return (v + ((1<<(16-FAST_SAMPLES_shift-1)))) >> (16 - FAST_SAMPLES_shift);
 }
 
 bool trapezoids_bounds(int n, const xTrapezoid *t, BoxPtr box);
diff --git a/src/sna/sna_trapezoids_imprecise.c b/src/sna/sna_trapezoids_imprecise.c
index b670ca5..8bb5426 100644
--- a/src/sna/sna_trapezoids_imprecise.c
+++ b/src/sna/sna_trapezoids_imprecise.c
@@ -42,8 +42,8 @@
 #undef SAMPLES_X
 #undef SAMPLES_Y
 
-#if 0
-#define __DBG(x) LogF x
+#if 1
+#define __DBG DBG
 #else
 #define __DBG(x)
 #endif
@@ -265,7 +265,7 @@ floored_divrem(int a, int b)
 	struct quorem qr;
 	assert(b>0);
 	qr.quo = a/b;
-	qr.rem = a%b;
+	qr.rem = a - qr.quo*b;
 	if (qr.rem < 0) {
 		qr.quo -= 1;
 		qr.rem += b;
@@ -282,7 +282,7 @@ floored_muldivrem(int32_t x, int32_t a, int32_t b)
 	int64_t xa = (int64_t)x*a;
 	assert(b>0);
 	qr.quo = xa/b;
-	qr.rem = xa%b;
+	qr.rem = xa - qr.quo*b;
 	if (qr.rem < 0) {
 		qr.quo -= 1;
 		qr.rem += b;
@@ -551,8 +551,8 @@ polygon_add_edge(struct polygon *polygon,
 			e->x = floored_muldivrem(ytop - y1, dx, dy);
 			e->x.quo += x1;
 		}
+		e->x.rem -= dy; /* Bias for faster edge advancement. */
 	}
-	e->x.rem -= dy; /* Bias the remainder for faster edge advancement. */
 
 	_polygon_insert_edge_into_its_y_bucket(polygon, e);
 	polygon->num_edges++;
@@ -847,6 +847,7 @@ nonzero_subrow(struct active_list *active, struct cell_list *coverages)
 				if (edge->x.rem >= 0) {
 					++edge->x.quo;
 					edge->x.rem -= edge->dy;
+					assert(edge->x.rem < 0);
 				}
 			}
 
@@ -854,9 +855,9 @@ nonzero_subrow(struct active_list *active, struct cell_list *coverages)
 				struct edge *pos = edge->prev;
 				pos->next = next;
 				next->prev = pos;
-				do {
+				do
 					pos = pos->prev;
-				} while (edge->x.quo < pos->x.quo);
+				while (edge->x.quo < pos->x.quo);
 				pos->next->prev = edge;
 				edge->next = pos->next;
 				edge->prev = pos;
@@ -1939,7 +1940,7 @@ imprecise_trapezoid_span_converter(struct sna *sna,
 	dy *= FAST_SAMPLES_Y;
 
 	num_threads = 1;
-	if (!NO_GPU_THREADS &&
+	if (!NO_GPU_THREADS && 0 &&
 	    (flags & COMPOSITE_SPANS_RECTILINEAR) == 0 &&
 	    tmp.thread_boxes &&
 	    thread_choose_span(&tmp, dst, maskFormat, &clip))


More information about the xorg-commit mailing list