aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0359-drm-amdgpu-move-the-GDS-switch-into-vm-flush-as-well.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0359-drm-amdgpu-move-the-GDS-switch-into-vm-flush-as-well.patch')
-rw-r--r--common/recipes-kernel/linux/files/0359-drm-amdgpu-move-the-GDS-switch-into-vm-flush-as-well.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0359-drm-amdgpu-move-the-GDS-switch-into-vm-flush-as-well.patch b/common/recipes-kernel/linux/files/0359-drm-amdgpu-move-the-GDS-switch-into-vm-flush-as-well.patch
new file mode 100644
index 00000000..d72ed0a0
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0359-drm-amdgpu-move-the-GDS-switch-into-vm-flush-as-well.patch
@@ -0,0 +1,100 @@
+From c2c4bf56c642027f4ee4322eead0dd71739f826f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Tue, 1 Mar 2016 13:34:49 +0100
+Subject: [PATCH 0359/1110] drm/amdgpu: move the GDS switch into vm flush as
+ well
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+After all it's an operation on the VMID.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
+Signed-off-by: Kalyan Alle <kalyan.alle@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 ++++--
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 11 ++++-------
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 18 +++++++++++++-----
+ 3 files changed, 21 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+index b649a8f..394122e 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+@@ -923,8 +923,10 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
+ struct amdgpu_sync *sync, struct fence *fence,
+ unsigned *vm_id, uint64_t *vm_pd_addr);
+ void amdgpu_vm_flush(struct amdgpu_ring *ring,
+- unsigned vmid,
+- uint64_t pd_addr);
++ unsigned vm_id, uint64_t pd_addr,
++ uint32_t gds_base, uint32_t gds_size,
++ uint32_t gws_base, uint32_t gws_size,
++ uint32_t oa_base, uint32_t oa_size);
+ uint64_t amdgpu_vm_map_gart(const dma_addr_t *pages_addr, uint64_t addr);
+ int amdgpu_vm_update_page_directory(struct amdgpu_device *adev,
+ struct amdgpu_vm *vm);
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+index 4d7b80b..4aedfe4 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+@@ -149,13 +149,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
+
+ if (vm) {
+ /* do context switch */
+- amdgpu_vm_flush(ring, ib->vm_id, ib->vm_pd_addr);
+-
+- if (ring->funcs->emit_gds_switch)
+- amdgpu_ring_emit_gds_switch(ring, ib->vm_id,
+- ib->gds_base, ib->gds_size,
+- ib->gws_base, ib->gws_size,
+- ib->oa_base, ib->oa_size);
++ amdgpu_vm_flush(ring, ib->vm_id, ib->vm_pd_addr,
++ ib->gds_base, ib->gds_size,
++ ib->gws_base, ib->gws_size,
++ ib->oa_base, ib->oa_size);
+
+ if (ring->funcs->emit_hdp_flush)
+ amdgpu_ring_emit_hdp_flush(ring);
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+index 6e23841..3e1c8cf 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+@@ -248,19 +248,27 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
+ * amdgpu_vm_flush - hardware flush the vm
+ *
+ * @ring: ring to use for flush
+- * @vmid: vmid number to use
++ * @vm_id: vmid number to use
+ * @pd_addr: address of the page directory
+ *
+ * Emit a VM flush when it is necessary.
+ */
+ void amdgpu_vm_flush(struct amdgpu_ring *ring,
+- unsigned vmid,
+- uint64_t pd_addr)
++ unsigned vm_id, uint64_t pd_addr,
++ uint32_t gds_base, uint32_t gds_size,
++ uint32_t gws_base, uint32_t gws_size,
++ uint32_t oa_base, uint32_t oa_size)
+ {
+ if (pd_addr != AMDGPU_VM_NO_FLUSH) {
+- trace_amdgpu_vm_flush(pd_addr, ring->idx, vmid);
+- amdgpu_ring_emit_vm_flush(ring, vmid, pd_addr);
++ trace_amdgpu_vm_flush(pd_addr, ring->idx, vm_id);
++ amdgpu_ring_emit_vm_flush(ring, vm_id, pd_addr);
+ }
++
++ if (ring->funcs->emit_gds_switch)
++ amdgpu_ring_emit_gds_switch(ring, vm_id,
++ gds_base, gds_size,
++ gws_base, gws_size,
++ oa_base, oa_size);
+ }
+
+ /**
+--
+2.7.4
+