AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Sundararaju, Sathishkumar" <sasundar@amd.com>
To: Lijo Lazar <lijo.lazar@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Hawking.Zhang@amd.com, Alexander.Deucher@amd.com,
	leo.liu@amd.com, jane.jian@amd.com,
	sathishkumar.sundararaju@amd.com
Subject: Re: [PATCH v2] drm/amdgpu: Normalize reg offsets on JPEG v4.0.3
Date: Wed, 28 Aug 2024 19:07:05 +0530	[thread overview]
Message-ID: <6c60f44d-dc8f-4c70-a4ff-1d0d0517fc24@amd.com> (raw)
In-Reply-To: <20240828061133.1880057-1-lijo.lazar@amd.com>


On 8/28/2024 11:41 AM, Lijo Lazar wrote:
> On VFs and SOCs with GC 9.4.4, VCN RRMT is disabled.
> Only local register offsets should be used on JPEG v4.0.3 as they cannot
> handle remote access to other AIDs. Since only local offsets are used,
> the special write to MCM_ADDR register is no longer needed.
>
> Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
please move sign-off below v2 commit description and with that

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>

Thanks,

Sathish

> ---
> v2: Restrict the change to GC 9.4.4 on PFs.
>
>   drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 36 ++++++++++--------------
>   1 file changed, 15 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
> index 6ae5a784e187..a4ebceaaa09c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
> @@ -59,6 +59,12 @@ static int amdgpu_ih_srcid_jpeg[] = {
>   	VCN_4_0__SRCID__JPEG7_DECODE
>   };
>   
> +static inline bool jpeg_v4_0_3_normalizn_reqd(struct amdgpu_device *adev)
> +{
> +	return amdgpu_sriov_vf(adev) ||
> +	       (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 4));
> +}
> +
>   /**
>    * jpeg_v4_0_3_early_init - set function pointers
>    *
> @@ -734,32 +740,20 @@ void jpeg_v4_0_3_dec_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seq
>   		0, PACKETJ_CONDITION_CHECK0, PACKETJ_TYPE4));
>   	amdgpu_ring_write(ring, 0);
>   
> -	if (ring->adev->jpeg.inst[ring->me].aid_id) {
> -		amdgpu_ring_write(ring, PACKETJ(regUVD_JRBC_EXTERNAL_MCM_ADDR_INTERNAL_OFFSET,
> -			0, PACKETJ_CONDITION_CHECK0, PACKETJ_TYPE0));
> -		amdgpu_ring_write(ring, 0x4);
> -	} else {
> -		amdgpu_ring_write(ring, PACKETJ(0, 0, 0, PACKETJ_TYPE6));
> -		amdgpu_ring_write(ring, 0);
> -	}
> +	amdgpu_ring_write(ring, PACKETJ(0, 0, 0, PACKETJ_TYPE6));
> +	amdgpu_ring_write(ring, 0);
>   
>   	amdgpu_ring_write(ring,	PACKETJ(regUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET,
>   		0, 0, PACKETJ_TYPE0));
>   	amdgpu_ring_write(ring, 0x3fbc);
>   
> -	if (ring->adev->jpeg.inst[ring->me].aid_id) {
> -		amdgpu_ring_write(ring, PACKETJ(regUVD_JRBC_EXTERNAL_MCM_ADDR_INTERNAL_OFFSET,
> -			0, PACKETJ_CONDITION_CHECK0, PACKETJ_TYPE0));
> -		amdgpu_ring_write(ring, 0x0);
> -	} else {
> -		amdgpu_ring_write(ring, PACKETJ(0, 0, 0, PACKETJ_TYPE6));
> -		amdgpu_ring_write(ring, 0);
> -	}
> -
>   	amdgpu_ring_write(ring, PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR,
>   		0, 0, PACKETJ_TYPE0));
>   	amdgpu_ring_write(ring, 0x1);
>   
> +	amdgpu_ring_write(ring, PACKETJ(0, 0, 0, PACKETJ_TYPE6));
> +	amdgpu_ring_write(ring, 0);
> +
>   	amdgpu_ring_write(ring, PACKETJ(0, 0, 0, PACKETJ_TYPE7));
>   	amdgpu_ring_write(ring, 0);
>   }
> @@ -834,8 +828,8 @@ void jpeg_v4_0_3_dec_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg,
>   {
>   	uint32_t reg_offset;
>   
> -	/* For VF, only local offsets should be used */
> -	if (amdgpu_sriov_vf(ring->adev))
> +	/* Use normalized offsets if required */
> +	if (jpeg_v4_0_3_normalizn_reqd(ring->adev))
>   		reg = NORMALIZE_JPEG_REG_OFFSET(reg);
>   
>   	reg_offset = (reg << 2);
> @@ -881,8 +875,8 @@ void jpeg_v4_0_3_dec_ring_emit_wreg(struct amdgpu_ring *ring, uint32_t reg, uint
>   {
>   	uint32_t reg_offset;
>   
> -	/* For VF, only local offsets should be used */
> -	if (amdgpu_sriov_vf(ring->adev))
> +	/* Use normalized offsets if required */
> +	if (jpeg_v4_0_3_normalizn_reqd(ring->adev))
>   		reg = NORMALIZE_JPEG_REG_OFFSET(reg);
>   
>   	reg_offset = (reg << 2);

      reply	other threads:[~2024-08-28 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  6:11 [PATCH v2] drm/amdgpu: Normalize reg offsets on JPEG v4.0.3 Lijo Lazar
2024-08-28 13:37 ` Sundararaju, Sathishkumar [this message]

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=6c60f44d-dc8f-4c70-a4ff-1d0d0517fc24@amd.com \
    --to=sasundar@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=jane.jian@amd.com \
    --cc=leo.liu@amd.com \
    --cc=lijo.lazar@amd.com \
    --cc=sathishkumar.sundararaju@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox