All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: Alex Sierra <alex.sierra@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/7] drm/amdgpu: replace kcq enable function on gfx_v9
Date: Mon, 13 Jan 2020 11:53:02 -0500	[thread overview]
Message-ID: <c4970147-6bfd-2cec-115c-1fac615bfe6f@amd.com> (raw)
In-Reply-To: <20200111183938.126310-4-alex.sierra@amd.com>

Can you include kcq_disable in the patch as well?

Thanks,
   Felix

On 2020-01-11 1:39 p.m., Alex Sierra wrote:
> [Why]
> There's a HW-indpendent function that enables kcq. This function uses
> the kiq_pm4_funcs implementation.
>
> [How]
> Local kcq enable function removed and replace it by the generic kcq
> enable under amdgpu_gfx
>
> Change-Id: I7709bdba93742c234941a5936c82eb67e346077c
> Signed-off-by: Alex Sierra <alex.sierra@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 70 +--------------------------
>   1 file changed, 1 insertion(+), 69 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 5be6fab55b73..7219eacad9ce 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -3252,74 +3252,6 @@ static void gfx_v9_0_kiq_setting(struct amdgpu_ring *ring)
>   	WREG32_SOC15_RLC(GC, 0, mmRLC_CP_SCHEDULERS, tmp);
>   }
>   
> -static int gfx_v9_0_kiq_kcq_enable(struct amdgpu_device *adev)
> -{
> -	struct amdgpu_ring *kiq_ring = &adev->gfx.kiq.ring;
> -	uint64_t queue_mask = 0;
> -	int r, i;
> -
> -	for (i = 0; i < AMDGPU_MAX_COMPUTE_QUEUES; ++i) {
> -		if (!test_bit(i, adev->gfx.mec.queue_bitmap))
> -			continue;
> -
> -		/* This situation may be hit in the future if a new HW
> -		 * generation exposes more than 64 queues. If so, the
> -		 * definition of queue_mask needs updating */
> -		if (WARN_ON(i >= (sizeof(queue_mask)*8))) {
> -			DRM_ERROR("Invalid KCQ enabled: %d\n", i);
> -			break;
> -		}
> -
> -		queue_mask |= (1ull << i);
> -	}
> -
> -	r = amdgpu_ring_alloc(kiq_ring, (7 * adev->gfx.num_compute_rings) + 8);
> -	if (r) {
> -		DRM_ERROR("Failed to lock KIQ (%d).\n", r);
> -		return r;
> -	}
> -
> -	/* set resources */
> -	amdgpu_ring_write(kiq_ring, PACKET3(PACKET3_SET_RESOURCES, 6));
> -	amdgpu_ring_write(kiq_ring, PACKET3_SET_RESOURCES_VMID_MASK(0) |
> -			  PACKET3_SET_RESOURCES_QUEUE_TYPE(0));	/* vmid_mask:0 queue_type:0 (KIQ) */
> -	amdgpu_ring_write(kiq_ring, lower_32_bits(queue_mask));	/* queue mask lo */
> -	amdgpu_ring_write(kiq_ring, upper_32_bits(queue_mask));	/* queue mask hi */
> -	amdgpu_ring_write(kiq_ring, 0);	/* gws mask lo */
> -	amdgpu_ring_write(kiq_ring, 0);	/* gws mask hi */
> -	amdgpu_ring_write(kiq_ring, 0);	/* oac mask */
> -	amdgpu_ring_write(kiq_ring, 0);	/* gds heap base:0, gds heap size:0 */
> -	for (i = 0; i < adev->gfx.num_compute_rings; i++) {
> -		struct amdgpu_ring *ring = &adev->gfx.compute_ring[i];
> -		uint64_t mqd_addr = amdgpu_bo_gpu_offset(ring->mqd_obj);
> -		uint64_t wptr_addr = adev->wb.gpu_addr + (ring->wptr_offs * 4);
> -
> -		amdgpu_ring_write(kiq_ring, PACKET3(PACKET3_MAP_QUEUES, 5));
> -		/* Q_sel:0, vmid:0, vidmem: 1, engine:0, num_Q:1*/
> -		amdgpu_ring_write(kiq_ring, /* Q_sel: 0, vmid: 0, engine: 0, num_Q: 1 */
> -				  PACKET3_MAP_QUEUES_QUEUE_SEL(0) | /* Queue_Sel */
> -				  PACKET3_MAP_QUEUES_VMID(0) | /* VMID */
> -				  PACKET3_MAP_QUEUES_QUEUE(ring->queue) |
> -				  PACKET3_MAP_QUEUES_PIPE(ring->pipe) |
> -				  PACKET3_MAP_QUEUES_ME((ring->me == 1 ? 0 : 1)) |
> -				  PACKET3_MAP_QUEUES_QUEUE_TYPE(0) | /*queue_type: normal compute queue */
> -				  PACKET3_MAP_QUEUES_ALLOC_FORMAT(0) | /* alloc format: all_on_one_pipe */
> -				  PACKET3_MAP_QUEUES_ENGINE_SEL(0) | /* engine_sel: compute */
> -				  PACKET3_MAP_QUEUES_NUM_QUEUES(1)); /* num_queues: must be 1 */
> -		amdgpu_ring_write(kiq_ring, PACKET3_MAP_QUEUES_DOORBELL_OFFSET(ring->doorbell_index));
> -		amdgpu_ring_write(kiq_ring, lower_32_bits(mqd_addr));
> -		amdgpu_ring_write(kiq_ring, upper_32_bits(mqd_addr));
> -		amdgpu_ring_write(kiq_ring, lower_32_bits(wptr_addr));
> -		amdgpu_ring_write(kiq_ring, upper_32_bits(wptr_addr));
> -	}
> -
> -	r = amdgpu_ring_test_helper(kiq_ring);
> -	if (r)
> -		DRM_ERROR("KCQ enable failed\n");
> -
> -	return r;
> -}
> -
>   static int gfx_v9_0_mqd_init(struct amdgpu_ring *ring)
>   {
>   	struct amdgpu_device *adev = ring->adev;
> @@ -3726,7 +3658,7 @@ static int gfx_v9_0_kcq_resume(struct amdgpu_device *adev)
>   			goto done;
>   	}
>   
> -	r = gfx_v9_0_kiq_kcq_enable(adev);
> +	r = amdgpu_gfx_enable_kcq(adev);
>   done:
>   	return r;
>   }
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2020-01-13 16:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-11 18:39 [PATCH 1/7] drm/amdgpu: Avoid reclaim fs while eviction lock Alex Sierra
2020-01-11 18:39 ` [PATCH 2/7] drm/amdgpu: kiq pm4 function implementation for gfx_v9 Alex Sierra
2020-01-13 12:10   ` Christian König
2020-01-13 16:57   ` Felix Kuehling
2020-01-11 18:39 ` [PATCH 3/7] drm/amdgpu: implement tlbs invalidate on gfx9 gfx10 Alex Sierra
2020-01-13 12:12   ` Christian König
2020-01-13 16:36   ` Felix Kuehling
2020-01-11 18:39 ` [PATCH 4/7] drm/amdgpu: replace kcq enable function on gfx_v9 Alex Sierra
2020-01-13 12:12   ` Christian König
2020-01-13 16:53   ` Felix Kuehling [this message]
2020-01-11 18:39 ` [PATCH 5/7] drm/amdgpu: export function to flush TLB via pasid Alex Sierra
2020-01-13 12:15   ` Christian König
2020-01-13 16:49   ` Felix Kuehling
2020-01-11 18:39 ` [PATCH 6/7] drm/amdgpu: GPU TLB flush API moved to amdgpu_amdkfd Alex Sierra
2020-01-13 12:16   ` Christian König
2020-01-13 16:58   ` Felix Kuehling
2020-01-11 18:39 ` [PATCH 7/7] drm/amdgpu: flush TLB functions removal from kfd2kgd interface Alex Sierra
2020-01-13 12:17   ` Christian König
2020-01-13 12:10 ` [PATCH 1/7] drm/amdgpu: Avoid reclaim fs while eviction lock 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=c4970147-6bfd-2cec-115c-1fac615bfe6f@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=alex.sierra@amd.com \
    --cc=amd-gfx@lists.freedesktop.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.