All of lore.kernel.org
 help / color / mirror / Atom feed
From: Monk Liu <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Monk Liu <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 05/13] drm/amdgpu:fix ring init sequence
Date: Fri, 24 Mar 2017 18:38:24 +0800	[thread overview]
Message-ID: <1490351912-10122-6-git-send-email-Monk.Liu@amd.com> (raw)
In-Reply-To: <1490351912-10122-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>

ring->buf_mask need be set prior to ring_clear_ring invoke
and fix ring_clear_ring as well which should use buf_mask
instead of ptr_mask

Change-Id: I7778a7afe27ac2bdedcaba1b0146582100602f9d
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 6 +++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index e619833..10e94d0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -235,6 +235,9 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
 	ring->ring_size = roundup_pow_of_two(max_dw * 4 *
 					     amdgpu_sched_hw_submission);
 
+	ring->buf_mask = (ring->ring_size / 4) - 1;
+	ring->ptr_mask = ring->funcs->support_64bit_ptrs ?
+		0xffffffffffffffff : ring->buf_mask;
 	/* Allocate ring buffer */
 	if (ring->ring_obj == NULL) {
 		r = amdgpu_bo_create_kernel(adev, ring->ring_size, PAGE_SIZE,
@@ -248,9 +251,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
 		}
 		amdgpu_ring_clear_ring(ring);
 	}
-	ring->buf_mask = (ring->ring_size / 4) - 1;
-	ring->ptr_mask = ring->funcs->support_64bit_ptrs ?
-		0xffffffffffffffff : ring->buf_mask;
 
 	ring->max_dw = max_dw;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
index 9f57eda..5fd3dd1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
@@ -194,7 +194,7 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring);
 static inline void amdgpu_ring_clear_ring(struct amdgpu_ring *ring)
 {
 	int i = 0;
-	while (i <= ring->ptr_mask)
+	while (i <= ring->buf_mask)
 		ring->ring[i++] = ring->funcs->nop;
 
 }
-- 
2.7.4

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

  parent reply	other threads:[~2017-03-24 10:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 10:38 [PATCH 00/13] *** VEGA10 SRIOV PATCHES *** Monk Liu
     [not found] ` <1490351912-10122-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 10:38   ` [PATCH 01/13] drm/amdgpu:imple cond_exec for gfx8 Monk Liu
     [not found]     ` <1490351912-10122-2-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 14:38       ` Deucher, Alexander
2017-03-24 10:38   ` [PATCH 02/13] drm/amdgpu:enable mcbp for gfx9 Monk Liu
     [not found]     ` <1490351912-10122-3-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 14:38       ` Deucher, Alexander
2017-03-24 10:38   ` [PATCH 03/13] drm/amdgpu:add KIQ interrupt id Monk Liu
     [not found]     ` <1490351912-10122-4-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 14:40       ` Deucher, Alexander
2017-03-24 10:38   ` [PATCH 04/13] drm/amdgpu:virt_init_setting invoke is missed! Monk Liu
     [not found]     ` <1490351912-10122-5-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 14:40       ` Deucher, Alexander
2017-03-24 10:38   ` Monk Liu [this message]
     [not found]     ` <1490351912-10122-6-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-27 15:54       ` [PATCH 05/13] drm/amdgpu:fix ring init sequence Deucher, Alexander
2017-03-24 10:38   ` [PATCH 06/13] drm/amdgpu:change sequence of SDMA v4 init Monk Liu
     [not found]     ` <1490351912-10122-7-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 14:46       ` Deucher, Alexander
2017-03-24 10:38   ` [PATCH 07/13] drm/amdgpu:two fixings for sdma v4 for SRIOV Monk Liu
     [not found]     ` <1490351912-10122-8-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 14:47       ` Deucher, Alexander
2017-03-24 10:38   ` [PATCH 08/13] drm/amdgpu:no cg for soc15 of SRIOV Monk Liu
     [not found]     ` <1490351912-10122-9-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 14:47       ` Deucher, Alexander
2017-03-24 10:38   ` [PATCH 09/13] drm/amdgpu:fix gmc_v9 vm fault process for SRIOV Monk Liu
     [not found]     ` <1490351912-10122-10-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 14:49       ` Deucher, Alexander
2017-03-27  1:51       ` Zhang, Jerry (Junwei)
     [not found]         ` <58D8700C.1030305-5C7GfCeVMHo@public.gmane.org>
2017-03-27  6:39           ` Christian König
     [not found]             ` <56a0f0fb-42f7-9b1e-ffaa-caa142a84e1c-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-03-27  7:00               ` Zhang, Jerry (Junwei)
2017-03-24 10:38   ` [PATCH 10/13] drm/amdgpu:fix ring_write_multiple Monk Liu
     [not found]     ` <1490351912-10122-11-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-27 15:54       ` Deucher, Alexander
2017-03-24 10:38   ` [PATCH 11/13] drm/amdgpu:fix missing programing critical registers Monk Liu
     [not found]     ` <1490351912-10122-12-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-24 14:50       ` Deucher, Alexander
2017-03-24 10:38   ` [PATCH 12/13] drm/amdgpu:changes in gfx DMAframe scheme Monk Liu
     [not found]     ` <1490351912-10122-13-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-03-27 15:59       ` Deucher, Alexander
2017-03-27 16:16       ` Christian König
     [not found]         ` <0befd76b-3656-af37-e820-8d84660cf20e-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-03-28  3:23           ` 答复: " Liu, Monk
     [not found]             ` <DM5PR12MB16103525AF905E70A4BB6C0C84320-2J9CzHegvk++jCVTvoAFKAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-03-28  8:33               ` Christian König
     [not found]                 ` <fc8681ca-4fa1-b75e-da70-7e573059cb85-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-03-28  8:42                   ` 答复: " Liu, Monk
2017-03-24 10:38   ` [PATCH 13/13] drm/amdgpu:change emit_frame_size of gfx8 Monk Liu
2017-03-24 11:39   ` [PATCH 00/13] *** VEGA10 SRIOV PATCHES *** Yu, Xiangliang

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=1490351912-10122-6-git-send-email-Monk.Liu@amd.com \
    --to=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.