All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "Li, Xin (Justin)" <xin2.li@amd.com>,
	amd-gfx@lists.freedesktop.org, "Liu, Leo" <Leo.Liu@amd.com>
Cc: "Alex . Deucher" <alexander.deucher@amd.com>,
	"Frank . Min" <Frank.Min@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Fix Gstreamer api vaapih264enc missing
Date: Wed, 26 May 2021 12:49:48 +0200	[thread overview]
Message-ID: <dfab1180-2ee9-7d41-8a12-0a7e86dca9d4@amd.com> (raw)
In-Reply-To: <20210526101310.1872892-1-xin2.li@amd.com>

Am 26.05.21 um 12:13 schrieb Li, Xin (Justin):
> since vcn decoding ring is not required, so just disable it.
>
> Cc: Alex.Deucher <alexander.deucher@amd.com>
> Cc: Christian.Konig <christian.koenig@amd.com>
> Signed-off-by: Li.Xin.Justin <xin2.li@amd.com>
> Signed-off-by: Frank.Min <Frank.Min@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  6 +++---
>   drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c   | 25 ++++++++++++++-----------
>   2 files changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 524e4fe5efe8..614e6b06e94e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -427,7 +427,9 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev,
>   			if (adev->uvd.harvest_config & (1 << i))
>   				continue;
>   
> -			if (adev->vcn.inst[i].ring_dec.sched.ready)
> +			if (adev->vcn.inst[i].ring_dec.sched.ready ||
> +				(adev->asic_type == CHIP_NAVI12 &&
> +				amdgpu_sriov_vf(adev)))

Leo needs to take a closer look, but that looks fishy to me.

Why should the ring be available if it is disabled? That doesn't make sense.

Christian.

>   				++num_rings;
>   		}
>   		ib_start_alignment = 16;
> @@ -770,8 +772,6 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
>   			dev_info->ids_flags |= AMDGPU_IDS_FLAGS_FUSION;
>   		if (amdgpu_mcbp || amdgpu_sriov_vf(adev))
>   			dev_info->ids_flags |= AMDGPU_IDS_FLAGS_PREEMPTION;
> -		if (amdgpu_is_tmz(adev))
> -			dev_info->ids_flags |= AMDGPU_IDS_FLAGS_TMZ;
>   
>   		vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
>   		vm_size -= AMDGPU_VA_RESERVED_SIZE;
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
> index 8af567c546db..dc8a36766c4a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
> @@ -220,17 +220,20 @@ static int vcn_v2_0_hw_init(void *handle)
>   {
>   	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>   	struct amdgpu_ring *ring = &adev->vcn.inst->ring_dec;
> -	int i, r;
> +	int i, r = -1;
>   
>   	adev->nbio.funcs->vcn_doorbell_range(adev, ring->use_doorbell,
>   					     ring->doorbell_index, 0);
>   
> -	if (amdgpu_sriov_vf(adev))
> +	if (amdgpu_sriov_vf(adev)) {
>   		vcn_v2_0_start_sriov(adev);
> -
> -	r = amdgpu_ring_test_helper(ring);
> -	if (r)
> -		goto done;
> +		if (adev->asic_type == CHIP_NAVI12)
> +			ring->sched.ready = false;
> +	} else {
> +		r = amdgpu_ring_test_helper(ring);
> +		if (r)
> +			goto done;
> +	}
>   
>   	//Disable vcn decode for sriov
>   	if (amdgpu_sriov_vf(adev))
> @@ -245,8 +248,11 @@ static int vcn_v2_0_hw_init(void *handle)
>   
>   done:
>   	if (!r)
> -		DRM_INFO("VCN decode and encode initialized successfully(under %s).\n",
> -			(adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)?"DPG Mode":"SPG Mode");
> +		DRM_INFO("VCN %s encode initialized successfully(under %s).\n",
> +			(adev->asic_type == CHIP_NAVI12 &&
> +				amdgpu_sriov_vf(adev))?"":"decode and",
> +			(adev->pg_flags &
> +				AMD_PG_SUPPORT_VCN_DPG)?"DPG Mode":"SPG Mode");
>   
>   	return r;
>   }
> @@ -1721,9 +1727,6 @@ int vcn_v2_0_dec_ring_test_ring(struct amdgpu_ring *ring)
>   	unsigned i;
>   	int r;
>   
> -	if (amdgpu_sriov_vf(adev))
> -		return 0;
> -
>   	WREG32(adev->vcn.inst[ring->me].external.scratch9, 0xCAFEDEAD);
>   	r = amdgpu_ring_alloc(ring, 4);
>   	if (r)

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2021-05-26 10:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 10:13 [PATCH] drm/amdgpu: Fix Gstreamer api vaapih264enc missing Li, Xin (Justin)
2021-05-26 10:49 ` Christian König [this message]
2021-05-27 14:22   ` Leo Liu
2021-05-27 14:27   ` Liu, Leo
2021-05-26 19:08 ` Alex Deucher
2021-05-26 23:57 ` Liu, Monk
2021-05-27  7:17   ` Li, Xin (Justin)
2021-05-31  5:57     ` Deng, Emily

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfab1180-2ee9-7d41-8a12-0a7e86dca9d4@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Frank.Min@amd.com \
    --cc=Leo.Liu@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=xin2.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.