[03/18] radeon/common: add vcn enc ip info query

Submitted by Zhang, Boyuan on Nov. 7, 2017, 9:58 p.m.

Details

Message ID 1510091953-3192-3-git-send-email-boyuan.zhang@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Zhang, Boyuan Nov. 7, 2017, 9:58 p.m.
From: Boyuan Zhang <boyuan.zhang@amd.com>

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
---
 src/amd/common/ac_gpu_info.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index 2e56012..b0c0a08 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -98,7 +98,7 @@  bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
 {
 	struct amdgpu_buffer_size_alignments alignment_info = {};
 	struct amdgpu_heap_info vram, vram_vis, gtt;
-	struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, vce = {}, vcn_dec = {};
+	struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, vce = {}, vcn_dec = {}, vcn_enc = {};
 	uint32_t vce_version = 0, vce_feature = 0, uvd_version = 0, uvd_feature = 0;
 	int r, i, j;
 	drmDevicePtr devinfo;
@@ -174,6 +174,14 @@  bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
 		}
 	}
 
+	if (info->drm_major == 3 && info->drm_minor >= 17) {
+		r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_VCN_ENC, 0, &vcn_enc);
+		if (r) {
+			fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(vcn_dec) failed.\n");
+			return false;
+		}
+	}
+
 	r = amdgpu_query_firmware_version(dev, AMDGPU_INFO_FW_GFX_ME, 0, 0,
 					&info->me_fw_version,
 					&info->me_fw_feature);

Comments

On Tue, Nov 7, 2017 at 10:58 PM,  <boyuan.zhang@amd.com> wrote:
> From: Boyuan Zhang <boyuan.zhang@amd.com>
>
> Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
> ---
>  src/amd/common/ac_gpu_info.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
> index 2e56012..b0c0a08 100644
> --- a/src/amd/common/ac_gpu_info.c
> +++ b/src/amd/common/ac_gpu_info.c
> @@ -98,7 +98,7 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
>  {
>         struct amdgpu_buffer_size_alignments alignment_info = {};
>         struct amdgpu_heap_info vram, vram_vis, gtt;
> -       struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, vce = {}, vcn_dec = {};
> +       struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, vce = {}, vcn_dec = {}, vcn_enc = {};
>         uint32_t vce_version = 0, vce_feature = 0, uvd_version = 0, uvd_feature = 0;
>         int r, i, j;
>         drmDevicePtr devinfo;
> @@ -174,6 +174,14 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
>                 }
>         }
>
> +       if (info->drm_major == 3 && info->drm_minor >= 17) {
> +               r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_VCN_ENC, 0, &vcn_enc);
> +               if (r) {
> +                       fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(vcn_dec) failed.\n");

should be "vcn_enc" in the string.

Marek
Oops, thanks for pointing out. Fixed in new patch sets.

Regards,
Boyuan

-----Original Message-----
From: Marek Olšák [mailto:maraeo@gmail.com] 

Sent: November-08-17 11:53 AM
To: Zhang, Boyuan
Cc: mesa-dev@lists.freedesktop.org
Subject: Re: [Mesa-dev] [PATCH 03/18] radeon/common: add vcn enc ip info query

On Tue, Nov 7, 2017 at 10:58 PM,  <boyuan.zhang@amd.com> wrote:
> From: Boyuan Zhang <boyuan.zhang@amd.com>

>

> Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>

> ---

>  src/amd/common/ac_gpu_info.c | 10 +++++++++-

>  1 file changed, 9 insertions(+), 1 deletion(-)

>

> diff --git a/src/amd/common/ac_gpu_info.c 

> b/src/amd/common/ac_gpu_info.c index 2e56012..b0c0a08 100644

> --- a/src/amd/common/ac_gpu_info.c

> +++ b/src/amd/common/ac_gpu_info.c

> @@ -98,7 +98,7 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle 

> dev,  {

>         struct amdgpu_buffer_size_alignments alignment_info = {};

>         struct amdgpu_heap_info vram, vram_vis, gtt;

> -       struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, vce = {}, vcn_dec = {};

> +       struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, 

> + vce = {}, vcn_dec = {}, vcn_enc = {};

>         uint32_t vce_version = 0, vce_feature = 0, uvd_version = 0, uvd_feature = 0;

>         int r, i, j;

>         drmDevicePtr devinfo;

> @@ -174,6 +174,14 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,

>                 }

>         }

>

> +       if (info->drm_major == 3 && info->drm_minor >= 17) {

> +               r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_VCN_ENC, 0, &vcn_enc);

> +               if (r) {

> +                       fprintf(stderr, "amdgpu: 

> + amdgpu_query_hw_ip_info(vcn_dec) failed.\n");


should be "vcn_enc" in the string.

Marek