[Mesa-dev] [PATCH] radeonsi: fix video APIs on Raven2

Marek Olšák maraeo at gmail.com
Tue Nov 13 23:51:22 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

This was missed when I added the new enum.

Cc: 18.3 <mesa-stable at lists.freedesktop.org>
---
 src/gallium/drivers/radeonsi/si_get.c | 9 ++++++---
 src/gallium/drivers/radeonsi/si_uvd.c | 3 ++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c
index b440230d227..91f38329d59 100644
--- a/src/gallium/drivers/radeonsi/si_get.c
+++ b/src/gallium/drivers/radeonsi/si_get.c
@@ -573,24 +573,26 @@ static int si_get_video_param(struct pipe_screen *screen,
 			      enum pipe_video_cap param)
 {
 	struct si_screen *sscreen = (struct si_screen *)screen;
 	enum pipe_video_format codec = u_reduce_video_profile(profile);
 
 	if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
 		switch (param) {
 		case PIPE_VIDEO_CAP_SUPPORTED:
 			return (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
 				(si_vce_is_fw_version_supported(sscreen) ||
-				sscreen->info.family == CHIP_RAVEN)) ||
+				 sscreen->info.family == CHIP_RAVEN ||
+				 sscreen->info.family == CHIP_RAVEN2)) ||
 				(profile == PIPE_VIDEO_PROFILE_HEVC_MAIN &&
 				(sscreen->info.family == CHIP_RAVEN ||
-				si_radeon_uvd_enc_supported(sscreen)));
+				 sscreen->info.family == CHIP_RAVEN2 ||
+				 si_radeon_uvd_enc_supported(sscreen)));
 		case PIPE_VIDEO_CAP_NPOT_TEXTURES:
 			return 1;
 		case PIPE_VIDEO_CAP_MAX_WIDTH:
 			return (sscreen->info.family < CHIP_TONGA) ? 2048 : 4096;
 		case PIPE_VIDEO_CAP_MAX_HEIGHT:
 			return (sscreen->info.family < CHIP_TONGA) ? 1152 : 2304;
 		case PIPE_VIDEO_CAP_PREFERED_FORMAT:
 			return PIPE_FORMAT_NV12;
 		case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
 			return false;
@@ -624,21 +626,22 @@ static int si_get_video_param(struct pipe_screen *screen,
 			return true;
 		case PIPE_VIDEO_FORMAT_HEVC:
 			/* Carrizo only supports HEVC Main */
 			if (sscreen->info.family >= CHIP_STONEY)
 				return (profile == PIPE_VIDEO_PROFILE_HEVC_MAIN ||
 					profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10);
 			else if (sscreen->info.family >= CHIP_CARRIZO)
 				return profile == PIPE_VIDEO_PROFILE_HEVC_MAIN;
 			return false;
 		case PIPE_VIDEO_FORMAT_JPEG:
-			if (sscreen->info.family == CHIP_RAVEN)
+			if (sscreen->info.family == CHIP_RAVEN ||
+			    sscreen->info.family == CHIP_RAVEN2)
 				return true;
 			if (sscreen->info.family < CHIP_CARRIZO || sscreen->info.family >= CHIP_VEGA10)
 				return false;
 			if (!(sscreen->info.drm_major == 3 && sscreen->info.drm_minor >= 19)) {
 				RVID_ERR("No MJPEG support for the kernel version\n");
 				return false;
 			}
 			return true;
 		case PIPE_VIDEO_FORMAT_VP9:
 			if (sscreen->info.family < CHIP_RAVEN)
diff --git a/src/gallium/drivers/radeonsi/si_uvd.c b/src/gallium/drivers/radeonsi/si_uvd.c
index 1a9d8f8d9fa..8c9553acbf3 100644
--- a/src/gallium/drivers/radeonsi/si_uvd.c
+++ b/src/gallium/drivers/radeonsi/si_uvd.c
@@ -139,21 +139,22 @@ static void si_vce_get_buffer(struct pipe_resource *resource,
 		*surface = &res->surface;
 }
 
 /**
  * creates an UVD compatible decoder
  */
 struct pipe_video_codec *si_uvd_create_decoder(struct pipe_context *context,
 					       const struct pipe_video_codec *templ)
 {
 	struct si_context *ctx = (struct si_context *)context;
-	bool vcn = (ctx->family == CHIP_RAVEN) ? true : false;
+	bool vcn = ctx->family == CHIP_RAVEN ||
+		   ctx->family == CHIP_RAVEN2;
 
 	if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
 		if (vcn) {
 			return radeon_create_encoder(context, templ, ctx->ws, si_vce_get_buffer);
 		} else {
 			if (u_reduce_video_profile(templ->profile) == PIPE_VIDEO_FORMAT_HEVC)
 				return radeon_uvd_create_encoder(context, templ, ctx->ws, si_vce_get_buffer);
 			else
 				return si_vce_create_encoder(context, templ, ctx->ws, si_vce_get_buffer);
 		}
-- 
2.17.1



More information about the mesa-dev mailing list