[Mesa-dev] radeon/vce: support all firmwares with major ver 53

Submitted by Zhang, Boyuan on July 21, 2017, 2:40 p.m.

Details

Message ID 1500648056-2149-1-git-send-email-boyuan.zhang@amd.com
State New
Headers show
Series "radeon/vce: support all firmwares with major ver 53" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Zhang, Boyuan July 21, 2017, 2:40 p.m.
From: Boyuan Zhang <boyuan.zhang@amd.com>

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
---
 src/gallium/drivers/radeon/radeon_vce.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeon/radeon_vce.c b/src/gallium/drivers/radeon/radeon_vce.c
index 70c1e60..b97909f 100644
--- a/src/gallium/drivers/radeon/radeon_vce.c
+++ b/src/gallium/drivers/radeon/radeon_vce.c
@@ -52,7 +52,7 @@ 
 #define FW_52_0_3 ((52 << 24) | (0 << 16) | (3 << 8))
 #define FW_52_4_3 ((52 << 24) | (4 << 16) | (3 << 8))
 #define FW_52_8_3 ((52 << 24) | (8 << 16) | (3 << 8))
-#define FW_53_19_4 ((53 << 24) | (19 << 16) | (4 << 8))
+#define FW_53 (53 << 24)
 
 /**
  * flush commands to the hardware
@@ -510,13 +510,17 @@  struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context,
 		radeon_vce_52_init(enc);
 		get_pic_param = radeon_vce_52_get_param;
 		break;
-	case FW_53_19_4:
-		radeon_vce_52_init(enc);
-		get_pic_param = radeon_vce_52_get_param;
-		break;
 
 	default:
-		goto error;
+		switch (rscreen->info.vce_fw_version & (0xff << 24)) {
+		case FW_53:
+			radeon_vce_52_init(enc);
+			get_pic_param = radeon_vce_52_get_param;
+			break;
+
+		default:
+			goto error;
+		}
 	}
 
 	return &enc->base;
@@ -546,10 +550,15 @@  bool rvce_is_fw_version_supported(struct r600_common_screen *rscreen)
 	case FW_52_0_3:
 	case FW_52_4_3:
 	case FW_52_8_3:
-	case FW_53_19_4:
 		return true;
 	default:
-		return false;
+		switch (rscreen->info.vce_fw_version & (0xff << 24)) {
+		case FW_53:
+			return true;
+
+		default:
+			return false;
+		}
 	}
 }
 

Comments

Am 21.07.2017 um 16:40 schrieb boyuan.zhang@amd.com:
> From: Boyuan Zhang <boyuan.zhang@amd.com>

First of all some commit message please, something like "The firmware 
interface should now be stable...".

>
> Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
> ---
>   src/gallium/drivers/radeon/radeon_vce.c | 25 +++++++++++++++++--------
>   1 file changed, 17 insertions(+), 8 deletions(-)
>
> diff --git a/src/gallium/drivers/radeon/radeon_vce.c b/src/gallium/drivers/radeon/radeon_vce.c
> index 70c1e60..b97909f 100644
> --- a/src/gallium/drivers/radeon/radeon_vce.c
> +++ b/src/gallium/drivers/radeon/radeon_vce.c
> @@ -52,7 +52,7 @@
>   #define FW_52_0_3 ((52 << 24) | (0 << 16) | (3 << 8))
>   #define FW_52_4_3 ((52 << 24) | (4 << 16) | (3 << 8))
>   #define FW_52_8_3 ((52 << 24) | (8 << 16) | (3 << 8))
> -#define FW_53_19_4 ((53 << 24) | (19 << 16) | (4 << 8))
> +#define FW_53 (53 << 24)
>   
>   /**
>    * flush commands to the hardware
> @@ -510,13 +510,17 @@ struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context,
>   		radeon_vce_52_init(enc);
>   		get_pic_param = radeon_vce_52_get_param;
>   		break;
> -	case FW_53_19_4:
> -		radeon_vce_52_init(enc);
> -		get_pic_param = radeon_vce_52_get_param;
> -		break;
>   
>   	default:
> -		goto error;
> +		switch (rscreen->info.vce_fw_version & (0xff << 24)) {
> +		case FW_53:

An "if" instead of the switch should work here as well.

> +			radeon_vce_52_init(enc);
> +			get_pic_param = radeon_vce_52_get_param;
> +			break;
> +
> +		default:
> +			goto error;
> +		}
>   	}
>   
>   	return &enc->base;
> @@ -546,10 +550,15 @@ bool rvce_is_fw_version_supported(struct r600_common_screen *rscreen)
>   	case FW_52_0_3:
>   	case FW_52_4_3:
>   	case FW_52_8_3:
> -	case FW_53_19_4:
>   		return true;
>   	default:
> -		return false;
> +		switch (rscreen->info.vce_fw_version & (0xff << 24)) {
> +		case FW_53:
> +			return true;
> +
> +		default:
> +			return false;

Same here.

With that changed the patch is Reviewed-by: Christian König 
<christian.koenig@amd.com>.

Regards,
Christian.

> +		}
>   	}
>   }
>