summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2016-05-04 01:28:23 -0400
committerEmil Velikov <emil.l.velikov@gmail.com>2016-05-05 14:02:04 +0100
commit97fe75cee25c881643a7e56725375453a0457392 (patch)
tree6864aa7d14271959b69c4d70a09a9cb19d961442
parent05cf9489898b38706f847faa2e3fb786f6a782a6 (diff)
nouveau/video: properly detect the decoder class for availability checks
The kernel is now more strict with the class ids it exposes, so we need to check the G98 and MCP89 classes as well as the GT215 class. This effectively caused us to decide there were no decoding capabilities on newer kernel for VP3 chips. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95251 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "11.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 38fcf7cbadc748816f99b2c3c9f2f55d0f1635fe)
-rw-r--r--src/gallium/drivers/nouveau/nouveau_vp3_video.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.c b/src/gallium/drivers/nouveau/nouveau_vp3_video.c
index d76d93241f4..10c149cfbe5 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video.c
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.c
@@ -25,6 +25,8 @@
#include <stdio.h>
#include <fcntl.h>
+#include <nvif/class.h>
+
#include "nouveau_screen.h"
#include "nouveau_context.h"
#include "nouveau_vp3_video.h"
@@ -351,6 +353,16 @@ nouveau_vp3_load_firmware(struct nouveau_vp3_decoder *dec,
return 0;
}
+static const struct nouveau_mclass
+nouveau_decoder_msvld[] = {
+ { G98_MSVLD, -1 },
+ { IGT21A_MSVLD, -1 },
+ { GT212_MSVLD, -1 },
+ { GF100_MSVLD, -1 },
+ { GK104_MSVLD, -1 },
+ {}
+};
+
static int
firmware_present(struct pipe_screen *pscreen, enum pipe_video_profile profile)
{
@@ -368,13 +380,7 @@ firmware_present(struct pipe_screen *pscreen, enum pipe_video_profile profile)
struct nvc0_fifo nvc0_args = {};
struct nve0_fifo nve0_args = {.engine = NVE0_FIFO_ENGINE_BSP};
void *data = NULL;
- int size, oclass;
- if (chipset < 0xc0)
- oclass = 0x85b1;
- else if (chipset < 0xe0)
- oclass = 0x90b1;
- else
- oclass = 0x95b1;
+ int size;
if (chipset < 0xc0) {
data = &nv04_data;
@@ -393,7 +399,10 @@ firmware_present(struct pipe_screen *pscreen, enum pipe_video_profile profile)
data, size, &channel);
if (channel) {
- nouveau_object_new(channel, 0, oclass, NULL, 0, &bsp);
+ ret = nouveau_object_mclass(channel, nouveau_decoder_msvld);
+ if (ret >= 0)
+ nouveau_object_new(channel, 0, nouveau_decoder_msvld[ret].oclass,
+ NULL, 0, &bsp);
if (bsp)
screen->firmware_info.profiles_present |= 1;
nouveau_object_del(&bsp);