All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 11/21] drm/amdgpu: wire up emit_wreg for UVD v7
Date: Wed, 17 Jan 2018 13:46:11 +0100	[thread overview]
Message-ID: <cbdba83c-179f-af8a-d0bf-b72726ebfef0@gmail.com> (raw)
In-Reply-To: <CADnq5_MaS1zp4sixq8D5ZdQ-0fheF92k+V=pBYeM1m2PAJFWVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Am 16.01.2018 um 21:05 schrieb Alex Deucher:
> On Tue, Jan 16, 2018 at 2:40 PM, Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
>> Needed for vm_flush unification.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 24 +++++++++++++++++-------
>>   1 file changed, 17 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
>> index 44f1a3dde4d6..42c4296909e9 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
>> @@ -1255,17 +1255,17 @@ static void uvd_v7_0_enc_ring_emit_ib(struct amdgpu_ring *ring,
>>          amdgpu_ring_write(ring, ib->length_dw);
>>   }
>>
>> -static void uvd_v7_0_vm_reg_write(struct amdgpu_ring *ring,
>> -                               uint32_t data0, uint32_t data1)
>> +static void uvd_v7_0_ring_emit_wreg(struct amdgpu_ring *ring,
>> +                                   uint32_t reg, uint32_t val)
>>   {
>>          struct amdgpu_device *adev = ring->adev;
>>
>>          amdgpu_ring_write(ring,
>>                  PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_GPCOM_VCPU_DATA0), 0));
>> -       amdgpu_ring_write(ring, data0);
>> +       amdgpu_ring_write(ring, reg << 2);
>>          amdgpu_ring_write(ring,
>>                  PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_GPCOM_VCPU_DATA1), 0));
>> -       amdgpu_ring_write(ring, data1);
>> +       amdgpu_ring_write(ring, val);
>>          amdgpu_ring_write(ring,
>>                  PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_GPCOM_VCPU_CMD), 0));
>>          amdgpu_ring_write(ring, 8);
>
> I think this is a special command specifically for writing VM
> registers.  I think you just want a regular PACKET0 like I suggested
> for UVD 6.  If that's not the case,
> uvd_v7_0_ring_emit_hdp_flush() and are
> uvd_v7_0_ring_emit_hdp_invalidate() probably wrong then.  Same for UVD
> 6.

Going to give that a test, but those HDP flush/invalidation 
implementation indeed look like they won't work.

As far as I know the PACKET0 command on the RBC can only write to UVD 
registers.

>
> Independent of this patch, it would be nice two switch the magic
> numbers written to VCPU_CMD with nicer defines...

Agree, completely. But that is a job for Leo/Boyuan I think.

Christian.

>
>
> Alex
>
>
>> @@ -1305,11 +1305,11 @@ static void uvd_v7_0_ring_emit_vm_flush(struct amdgpu_ring *ring,
>>
>>          data0 = (hub->ctx0_ptb_addr_hi32 + vmid * 2) << 2;
>>          data1 = upper_32_bits(pd_addr);
>> -       uvd_v7_0_vm_reg_write(ring, data0, data1);
>> +       uvd_v7_0_ring_emit_wreg(ring, data0, data1);
>>
>>          data0 = (hub->ctx0_ptb_addr_lo32 + vmid * 2) << 2;
>>          data1 = lower_32_bits(pd_addr);
>> -       uvd_v7_0_vm_reg_write(ring, data0, data1);
>> +       uvd_v7_0_ring_emit_wreg(ring, data0, data1);
>>
>>          data0 = (hub->ctx0_ptb_addr_lo32 + vmid * 2) << 2;
>>          data1 = lower_32_bits(pd_addr);
>> @@ -1319,7 +1319,7 @@ static void uvd_v7_0_ring_emit_vm_flush(struct amdgpu_ring *ring,
>>          /* flush TLB */
>>          data0 = (hub->vm_inv_eng0_req + eng) << 2;
>>          data1 = req;
>> -       uvd_v7_0_vm_reg_write(ring, data0, data1);
>> +       uvd_v7_0_ring_emit_wreg(ring, data0, data1);
>>
>>          /* wait for flush */
>>          data0 = (hub->vm_inv_eng0_ack + eng) << 2;
>> @@ -1380,6 +1380,14 @@ static void uvd_v7_0_enc_ring_emit_vm_flush(struct amdgpu_ring *ring,
>>          amdgpu_ring_write(ring, 1 << vmid);
>>   }
>>
>> +static void uvd_v7_0_enc_ring_emit_wreg(struct amdgpu_ring *ring,
>> +                                       uint32_t reg, uint32_t val)
>> +{
>> +       amdgpu_ring_write(ring, HEVC_ENC_CMD_REG_WRITE);
>> +       amdgpu_ring_write(ring, reg << 2);
>> +       amdgpu_ring_write(ring, val);
>> +}
>> +
>>   #if 0
>>   static bool uvd_v7_0_is_idle(void *handle)
>>   {
>> @@ -1730,6 +1738,7 @@ static const struct amdgpu_ring_funcs uvd_v7_0_ring_vm_funcs = {
>>          .pad_ib = amdgpu_ring_generic_pad_ib,
>>          .begin_use = amdgpu_uvd_ring_begin_use,
>>          .end_use = amdgpu_uvd_ring_end_use,
>> +       .emit_wreg = uvd_v7_0_ring_emit_wreg,
>>   };
>>
>>   static const struct amdgpu_ring_funcs uvd_v7_0_enc_ring_vm_funcs = {
>> @@ -1756,6 +1765,7 @@ static const struct amdgpu_ring_funcs uvd_v7_0_enc_ring_vm_funcs = {
>>          .pad_ib = amdgpu_ring_generic_pad_ib,
>>          .begin_use = amdgpu_uvd_ring_begin_use,
>>          .end_use = amdgpu_uvd_ring_end_use,
>> +       .emit_wreg = uvd_v7_0_enc_ring_emit_wreg,
>>   };
>>
>>   static void uvd_v7_0_set_ring_funcs(struct amdgpu_device *adev)
>> --
>> 2.14.1
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

  parent reply	other threads:[~2018-01-17 12:46 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 19:39 [PATCH 01/21] drm/amdgpu: wire up emit_wreg for gfx v6 Christian König
     [not found] ` <20180116194017.39067-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-16 19:39   ` [PATCH 02/21] drm/amdgpu: wire up emit_wreg for gfx v7 Christian König
2018-01-16 19:39   ` [PATCH 03/21] drm/amdgpu: wire up emit_wreg for gfx v8 Christian König
2018-01-16 19:40   ` [PATCH 04/21] drm/amdgpu: wire up emit_wreg for gfx v9 Christian König
2018-01-16 19:40   ` [PATCH 05/21] drm/amdgpu: wire up emit_wreg for SI DMA Christian König
2018-01-16 19:40   ` [PATCH 06/21] drm/amdgpu: wire up emit_wreg for CIK SDMA Christian König
2018-01-16 19:40   ` [PATCH 07/21] drm/amdgpu: wire up emit_wreg for SDMA v2.4 Christian König
2018-01-16 19:40   ` [PATCH 08/21] drm/amdgpu: wire up emit_wreg for SDMA v3 Christian König
2018-01-16 19:40   ` [PATCH 09/21] drm/amdgpu: wire up emit_wreg for SDMA v4 Christian König
2018-01-16 19:40   ` [PATCH 10/21] drm/amdgpu: wire up emit_wreg for UVD v6 Christian König
     [not found]     ` <20180116194017.39067-10-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-16 20:01       ` Alex Deucher
     [not found]         ` <CADnq5_Pc2QujuEDmsb8O2E0-VGmMgSCkN2K-B4O_1y-3zrQE7A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-17 12:42           ` Christian König
     [not found]             ` <c33f3adf-66d4-1d37-ebc9-cf3ab7d1b967-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-17 14:22               ` Deucher, Alexander
     [not found]                 ` <BN6PR12MB1652DE27EE111B57EC39AA78F7E90-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-01-17 14:49                   ` Christian König
2018-01-16 19:40   ` [PATCH 11/21] drm/amdgpu: wire up emit_wreg for UVD v7 Christian König
     [not found]     ` <20180116194017.39067-11-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-16 20:05       ` Alex Deucher
     [not found]         ` <CADnq5_MaS1zp4sixq8D5ZdQ-0fheF92k+V=pBYeM1m2PAJFWVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-17 12:46           ` Christian König [this message]
2018-01-16 19:40   ` [PATCH 12/21] drm/amdgpu: wire up emit_wreg for VCE v4 Christian König
2018-01-16 19:40   ` [PATCH 13/21] drm/amdgpu: wire up emit_wreg for VCN v1 Christian König
2018-01-16 19:40   ` [PATCH 14/21] drm/amdgpu: add new amdgpu_gmc_emit_flush_gpu_tlb callback Christian König
     [not found]     ` <20180116194017.39067-14-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-17  6:24       ` Chunming Zhou
     [not found]         ` <abf156ad-44a7-fe7f-12b0-3c1a77757fbd-5C7GfCeVMHo@public.gmane.org>
2018-01-17 12:19           ` Christian König
     [not found]             ` <2d56c566-9a4d-924e-6542-1e406ce1776a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-18  7:08               ` Chunming Zhou
     [not found]                 ` <db8d7b0d-bb67-e5fe-299e-a334e483bd19-5C7GfCeVMHo@public.gmane.org>
2018-01-18  8:15                   ` Christian König
2018-01-16 19:40   ` [PATCH 15/21] drm/amdgpu: implement gmc_v6_0_emit_flush_gpu_tlb Christian König
2018-01-16 19:40   ` [PATCH 16/21] drm/amdgpu: implement gmc_v7_0_emit_flush_gpu_tlb Christian König
2018-01-16 19:40   ` [PATCH 17/21] drm/amdgpu: implement gmc_v8_0_emit_flush_gpu_tlb Christian König
2018-01-16 19:40   ` [PATCH 18/21] drm/amdgpu: implement gmc_v9_0_emit_flush_gpu_tlb Christian König
2018-01-16 19:40   ` [PATCH 19/21] drm/amdgpu: add PASID mapping for GMC v7 Christian König
2018-01-16 19:40   ` [PATCH 20/21] drm/amdgpu: add PASID mapping for GFX v8 Christian König
2018-01-16 19:40   ` [PATCH 21/21] " Christian König
     [not found]     ` <20180116194017.39067-21-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-17  6:11       ` Chunming Zhou
     [not found]         ` <bd8e530b-869f-2cf9-c5b2-8fce9afd2341-5C7GfCeVMHo@public.gmane.org>
2018-01-17  6:12           ` Chunming Zhou
2018-01-17  6:13           ` Chunming Zhou
     [not found]             ` <4d39da90-bbe3-d704-72b5-b5ee27a41b14-5C7GfCeVMHo@public.gmane.org>
2018-01-17  6:15               ` Chunming Zhou
2018-01-16 20:15   ` [PATCH 01/21] drm/amdgpu: wire up emit_wreg for gfx v6 Alex Deucher
     [not found]     ` <CADnq5_ObVUuxn4GxWmZfY5m6MjfDcZHR-jwGS6cGXa7MbA3NMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-17 13:47       ` Christian König
  -- strict thread matches above, loose matches on Subject: below --
2018-01-19 11:48 Christian König
     [not found] ` <20180119114825.1336-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-19 11:48   ` [PATCH 11/21] drm/amdgpu: wire up emit_wreg for UVD v7 Christian König

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=cbdba83c-179f-af8a-d0bf-b72726ebfef0@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    /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.