[Nouveau] [PATCH 2/2] nv50/xv: add support for depth 30 xv output

Ilia Mirkin imirkin at alum.mit.edu
Sun Feb 4 18:58:47 UTC 2018


Ostensibly it should probably be looking at the pixmap format. However
it's always the window pixmap, so we can assume it's what we expect.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/nouveau_xv.c | 11 +++++++++--
 src/nv50_xv.c    |  3 ++-
 src/nvc0_xv.c    |  3 ++-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c
index 0b6c4d4..2f1979a 100644
--- a/src/nouveau_xv.c
+++ b/src/nouveau_xv.c
@@ -112,6 +112,13 @@ XF86VideoFormatRec NVFormats[NUM_FORMATS_ALL] =
 	{15, DirectColor}, {16, DirectColor}, {24, DirectColor}
 };
 
+#define NUM_FORMATS_NV50 8
+XF86VideoFormatRec NV50Formats[NUM_FORMATS_NV50] =
+{
+	{15, TrueColor}, {16, TrueColor}, {24, TrueColor}, {30, TrueColor},
+	{15, DirectColor}, {16, DirectColor}, {24, DirectColor}, {30, DirectColor}
+};
+
 #define NUM_NV04_OVERLAY_ATTRIBUTES 4
 XF86AttributeRec NV04OverlayAttributes[NUM_NV04_OVERLAY_ATTRIBUTES] =
 {
@@ -2042,8 +2049,8 @@ NV50SetupTexturedVideo (ScreenPtr pScreen)
 	adapt->name		= "Nouveau GeForce 8/9 Textured Video";
 	adapt->nEncodings	= 1;
 	adapt->pEncodings	= &DummyEncodingNV50;
-	adapt->nFormats		= NUM_FORMATS_ALL;
-	adapt->pFormats		= NVFormats;
+	adapt->nFormats		= NUM_FORMATS_NV50;
+	adapt->pFormats		= NV50Formats;
 	adapt->nPorts		= NUM_TEXTURE_PORTS;
 	adapt->pPortPrivates	= (DevUnion*)(&adapt[1]);
 
diff --git a/src/nv50_xv.c b/src/nv50_xv.c
index b2541b9..ba01c99 100644
--- a/src/nv50_xv.c
+++ b/src/nv50_xv.c
@@ -91,8 +91,9 @@ nv50_xv_image_put(ScrnInfoPtr pScrn,
 	BEGIN_NV04(push, NV50_3D(RT_ADDRESS_HIGH(0)), 5);
 	PUSH_DATA (push, dst->offset >> 32);
 	PUSH_DATA (push, dst->offset);
-	switch (ppix->drawable.bitsPerPixel) {
+	switch (ppix->drawable.depth) {
 	case 32: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGRA8_UNORM); break;
+	case 30: PUSH_DATA (push, NV50_SURFACE_FORMAT_RGB10_A2_UNORM); break;
 	case 24: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGRX8_UNORM); break;
 	case 16: PUSH_DATA (push, NV50_SURFACE_FORMAT_B5G6R5_UNORM); break;
 	case 15: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGR5_X1_UNORM); break;
diff --git a/src/nvc0_xv.c b/src/nvc0_xv.c
index 5cecbf5..8842148 100644
--- a/src/nvc0_xv.c
+++ b/src/nvc0_xv.c
@@ -89,8 +89,9 @@ nvc0_xv_image_put(ScrnInfoPtr pScrn,
 	PUSH_DATA (push, dst->offset);
 	PUSH_DATA (push, ppix->drawable.width);
 	PUSH_DATA (push, ppix->drawable.height);
-	switch (ppix->drawable.bitsPerPixel) {
+	switch (ppix->drawable.depth) {
 	case 32: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGRA8_UNORM); break;
+	case 30: PUSH_DATA (push, NV50_SURFACE_FORMAT_RGB10_A2_UNORM); break;
 	case 24: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGRX8_UNORM); break;
 	case 16: PUSH_DATA (push, NV50_SURFACE_FORMAT_B5G6R5_UNORM); break;
 	case 15: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGR5_X1_UNORM); break;
-- 
2.13.6



More information about the Nouveau mailing list