[Intel-gfx] [PATCH 2/2] sna/video sprite patch: exposing the maximum Xv port

Michael Hadley michaelx.hadley at intel.com
Tue May 3 12:00:27 UTC 2016


This patch exposes the maximum Xv sprite ports that are available on an adaptor
rather than the minimum. Not compatible with older X11 systems.

Signed-off-by: Michael Hadley <michaelx.hadley at intel.com>
---
 src/sna/sna_video_sprite.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index 943be59..20f74bf 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -660,28 +660,20 @@ static int sna_video_sprite_color_key(struct sna *sna)
 static uint32_t sna_video_num_sprites(struct sna *sna)
 {
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
-	int i, curr_n = 0, min_n = 0;
+	int i, max_n = 0;
 
 	DBG(("%s: num_crtc=%d\n", __FUNCTION__, sna->mode.num_real_crtc));
 
 	if (sna->mode.num_real_crtc == 0)
 		return 0;
 
-	/* Loop through each real pipe and record the min number of sprites */
+	/* Loop through each real pipe and record the max number of sprites */
 	for (i = 0; i < sna->mode.num_real_crtc; i++) {
-		curr_n  = sna_crtc_num_sprites(config->crtc[i]);
-
-		if (i == 0) {
-			min_n = curr_n;
-			continue;
-		}
-
-		if (curr_n < min_n)
-			min_n = curr_n;
+		max_n += sna_crtc_num_sprites(config->crtc[i]);
 	}
 
-	DBG(("%s: %d sprites\n", __FUNCTION__, min_n));
-	return min_n;
+	DBG(("%s: %d sprites\n", __FUNCTION__, max_n));
+	return max_n;
 }
 
 void sna_video_sprite_setup(struct sna *sna, ScreenPtr screen)
-- 
1.9.3



More information about the Intel-gfx mailing list