All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Monk Liu <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
Cc: amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 3/3] drm/amdgpu:invoke meta-data write around cntx_cntl
Date: Fri, 13 Jan 2017 11:35:45 -0500	[thread overview]
Message-ID: <CADnq5_M3ig9C3N7V6B=5n3XJ8eYy5foucWtG+3V3LqSL80uR2A@mail.gmail.com> (raw)
In-Reply-To: <CADnq5_Pe=z1hG9RBXPZ1KGfPHEHqksm9PBJdfeNdKsQDOK59eQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Fri, Jan 13, 2017 at 11:28 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Thu, Jan 12, 2017 at 2:41 AM, Monk Liu <Monk.Liu@amd.com> wrote:
>> ce's META-DATA write need prior to cntx_cntrl package
>> and de's should following.
>>
>> Change-Id: I2bf436d8a16bae38ce484f846f0b399e16cfe80a
>> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Actually, I take that back.  A few comments below.

>
>> ---
>>  drivers/gpu/drm/amd/amdgpu/amdgpu.h    | 1 +
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 +++
>>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c  | 8 ++++++++
>>  3 files changed, 12 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 2039da7..b7f7679 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -953,6 +953,7 @@ struct amdgpu_cs_parser {
>>  #define AMDGPU_PREAMBLE_IB_PRESENT          (1 << 0) /* bit set means command submit involves a preamble IB */
>>  #define AMDGPU_PREAMBLE_IB_PRESENT_FIRST    (1 << 1) /* bit set means preamble IB is first presented in belonging context */
>>  #define AMDGPU_HAVE_CTX_SWITCH              (1 << 2) /* bit set means context switch occured */
>> +#define AMDGPU_VM_DOMAIN                    (1 << 3) /* bit set means in virtual memory context */
>>
>>  struct amdgpu_job {
>>         struct amd_sched_job    base;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
>> index 16308eb..6939822 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
>> @@ -184,6 +184,9 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
>>                 if (need_ctx_switch)
>>                         status |= AMDGPU_HAVE_CTX_SWITCH;
>>                 status |= job->preamble_status;
>> +
>> +               if (vm)
>> +                       status |= AMDGPU_VM_DOMAIN;
>>                 amdgpu_ring_emit_cntxcntl(ring, status);
>>         }
>>

This top chunk should be a separate patch.


>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> index 3e8cff3..8a5c818 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> @@ -6704,6 +6704,10 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)
>>  {
>>         uint32_t dw2 = 0;
>>
>> +       if (amdgpu_sriov_vf(ring->adev))
>> +               gfx_v8_0_ring_emit_ce_meta_init(ring,
>> +                       (flags & AMDGPU_VM_DOMAIN) ? AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr);
>> +
>>         dw2 |= 0x80000000; /* set load_enable otherwise this package is just NOPs */
>>         if (flags & AMDGPU_HAVE_CTX_SWITCH) {
>>                 gfx_v8_0_ring_emit_vgt_flush(ring);
>> @@ -6728,6 +6732,10 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)
>>         amdgpu_ring_write(ring, PACKET3(PACKET3_CONTEXT_CONTROL, 1));
>>         amdgpu_ring_write(ring, dw2);
>>         amdgpu_ring_write(ring, 0);
>> +
>> +       if (amdgpu_sriov_vf(ring->adev))
>> +               gfx_v8_0_ring_emit_de_meta_init(ring,
>> +                       (flags & AMDGPU_VM_DOMAIN) ? AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr);
>>  }
>>

I think you need to update the emit_frame_size to reflect the larger frame.

>>  static void gfx_v8_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
>> --
>> 2.7.4
>>
>> _______________________________________________
>> 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:[~2017-01-13 16:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12  7:41 [PATCH 0/3] GFX8's meta-data write feature for SRIOV Monk Liu
     [not found] ` <1484206893-18806-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-12  7:41   ` [PATCH 1/3] drm/amdgpu:add META_DATA struct for CSA/SRIOV Monk Liu
2017-01-12  7:41   ` [PATCH 2/3] drm/amdgpu:implement META-DATA write routines Monk Liu
     [not found]     ` <1484206893-18806-3-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-12 12:27       ` Christian König
     [not found]         ` <b750813c-5af3-5353-2f08-5b54e0495375-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-01-16  8:20           ` 答复: " Liu, Monk
     [not found]             ` <BY2PR1201MB111021CE95196ED42C7694E4847D0-O28G1zQ8oGliQkyLPkmea2rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-01-16 10:50               ` Christian König
2017-01-13 16:28       ` Alex Deucher
2017-01-12  7:41   ` [PATCH 3/3] drm/amdgpu:invoke meta-data write around cntx_cntl Monk Liu
     [not found]     ` <1484206893-18806-4-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-13 16:28       ` Alex Deucher
     [not found]         ` <CADnq5_Pe=z1hG9RBXPZ1KGfPHEHqksm9PBJdfeNdKsQDOK59eQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-13 16:35           ` Alex Deucher [this message]
     [not found]             ` <CADnq5_M3ig9C3N7V6B=5n3XJ8eYy5foucWtG+3V3LqSL80uR2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-16  8:21               ` 答复: " Liu, Monk

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='CADnq5_M3ig9C3N7V6B=5n3XJ8eYy5foucWtG+3V3LqSL80uR2A@mail.gmail.com' \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Monk.Liu-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.