Skip to contentSkip to conversation

some cleanups and fixes

PATCH In review Monk Liu 2 participants 5 messages Jan 18, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

cover some cleanups and fixes

Monk Liu (3):
drm/amdgpu:set cond_exec polling value to 1 in ring_init drm/amdgpu:Preamble is forbid to be ignored in SRIOV drm/amdgpu:insert switch buffer only for VM submit

 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c   | 8 +++-----
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 +++-
 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1484707233-29838-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 1/3 drm/amdgpu:set cond_exec polling value to 1 in ring_init

no need to set it per ib_schedule(), hw won't override this polling address.

Change-Id Ie27a36f187f7db26239c016315cd2dee482387b5
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c   | 3 ---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 +++-
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0 -3
index 6939822..bcd5142 100644
@@ -175,9 +175,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
 	if (ring->funcs->emit_hdp_flush)
 		amdgpu_ring_emit_hdp_flush(ring);
 
-	/* always set cond_exec_polling to CONTINUE */
-	*ring->cond_exe_cpu_addr = 1;
-
 	skip_preamble = ring->current_ctx == fence_ctx;
 	need_ctx_switch = ring->current_ctx != fence_ctx;
 	if (job && ring->funcs->emit_cntxcntl) {
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3 -1
index 4c99282..7bacf3c 100644
@@ -207,6 +207,8 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
 	}
 	ring->cond_exe_gpu_addr = adev->wb.gpu_addr + (ring->cond_exe_offs * 4);
 	ring->cond_exe_cpu_addr = &adev->wb.wb[ring->cond_exe_offs];
+	/* always set cond_exec_polling to CONTINUE */
+	*ring->cond_exe_cpu_addr = 1;
 
 	r = amdgpu_fence_driver_start_ring(ring, irq_src, irq_type);
 	if (r) {
@@ -307,7 +309,7 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf,
 	while (size) {
 		if (*pos >= (ring->ring_size + 12))
 			return result;
-			
+
 		value = ring->ring[(*pos - 12)/4];
 		r = put_user(value, (uint32_t*)buf);
 		if (r)
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#3 lore raw

PATCH 2/3 drm/amdgpu:Preamble is forbid to be ignored in SRIOV

In reply to a message not in the archive
Change-Id I6da941fa22cfaee43d6dc11191b1fb7482e7362b
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -1
index bcd5142..7552326 100644
@@ -193,7 +193,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
 		/* drop preamble IBs if we don't have a context switch */
 		if ((ib->flags & AMDGPU_IB_FLAG_PREAMBLE) &&
 			skip_preamble &&
-			!(status & AMDGPU_PREAMBLE_IB_PRESENT_FIRST))
+			!(status & AMDGPU_PREAMBLE_IB_PRESENT_FIRST) &&
+			!amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */
 			continue;
 
 		amdgpu_ring_emit_ib(ring, ib, job ? job->vm_id : 0,
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#4 lore raw

PATCH 3/3 drm/amdgpu:insert switch buffer only for VM submit

In reply to a message not in the archive

for non-VM submit which is from kernel side, no need to switch buffer at all.

Change-Id I55c993e6111a7c438a6bc94b36aabdab9ed5f4bd
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +1 -1
index 7552326..12300c3 100644
@@ -224,7 +224,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
 		amdgpu_ring_patch_cond_exec(ring, patch_offset);
 
 	ring->current_ctx = fence_ctx;
-	if (ring->funcs->emit_switch_buffer)
+	if (vm && ring->funcs->emit_switch_buffer)
 		amdgpu_ring_emit_switch_buffer(ring);
 	amdgpu_ring_commit(ring);
 	return 0;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by
#5 lore raw
In reply to a message not in the archive

Regards,
Christian.

Am 18.01.2017 um 03:40 schrieb Monk Liu:

Quoted 9 lines

Monk Liu (3):
drm/amdgpu:set cond_exec polling value to 1 in ring_init drm/amdgpu:Preamble is forbid to be ignored in SRIOV drm/amdgpu:insert switch buffer only for VM submit

  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c   | 8 +++-----
  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 +++-
  2 files changed, 6 insertions(+), 6 deletions(-)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx