diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-06 21:40:30 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-06 21:40:59 +0100 |
commit | 7e1e18aca214a8705270972131a1800c81bc3b4d (patch) | |
tree | 718eb2f55cae18bce617f9336c8e71db670816a9 /src/sna/sna_video.c | |
parent | 0869acc0a6a5b92f5528049d2bd5ec62121ba114 (diff) |
sna/video: Fixup formats to select visuals
Fixes regression from
commit 195a51353c3af7bd253227da5f759f06cea01f73 [2.21.8]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Apr 9 19:13:46 2013 +0100
sna/video: Convert to a pure Xv backend
Reported-by: Edward Sheldrake <ejsheldrake@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65479
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_video.c')
-rw-r--r-- | src/sna/sna_video.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c index eb4f8463..6591c625 100644 --- a/src/sna/sna_video.c +++ b/src/sna/sna_video.c @@ -564,6 +564,35 @@ sna_xv_free_port(XvPortPtr port) return Success; } +int +sna_xv_fixup_formats(ScreenPtr screen, XvFormatPtr formats, int num_formats) +{ + XvFormatPtr out = formats; + int count = 0; + + while (num_formats--) { + int num_visuals = screen->numVisuals; + VisualPtr v = screen->visuals; + + while (num_visuals--) { + if (v->class == TrueColor && + v->nplanes == formats->depth) { + int tmp = out[count].depth; + out[count].depth = formats->depth; + out[count].visual = v->vid; + formats->depth = tmp; + count++; + break; + } + v++; + } + + formats++; + } + + return count; +} + static int sna_xv_query_adaptors(ScreenPtr screen, XvAdaptorPtr *adaptors, |