aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0250-drm-amdgpu-move-more-logic-into-amdgpu_vm_map_gart-v.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0250-drm-amdgpu-move-more-logic-into-amdgpu_vm_map_gart-v.patch')
-rw-r--r--common/recipes-kernel/linux/files/0250-drm-amdgpu-move-more-logic-into-amdgpu_vm_map_gart-v.patch210
1 files changed, 0 insertions, 210 deletions
diff --git a/common/recipes-kernel/linux/files/0250-drm-amdgpu-move-more-logic-into-amdgpu_vm_map_gart-v.patch b/common/recipes-kernel/linux/files/0250-drm-amdgpu-move-more-logic-into-amdgpu_vm_map_gart-v.patch
deleted file mode 100644
index a1cb64cb..00000000
--- a/common/recipes-kernel/linux/files/0250-drm-amdgpu-move-more-logic-into-amdgpu_vm_map_gart-v.patch
+++ /dev/null
@@ -1,210 +0,0 @@
-From fb8c81fd95e4e90a3d5054b30d3cf2eaab12115e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
-Date: Mon, 30 Nov 2015 13:26:07 +0100
-Subject: [PATCH 0250/1110] drm/amdgpu: move more logic into amdgpu_vm_map_gart
- v3
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-No need to duplicate that code over and over again. Also stop using the
-flags to determine if we need to map the addresses.
-
-v2: constify the pages_addr
-v3: rebased, fix typo in commit message
-
-Signed-off-by: Christian K├Ânig <christian.koenig@amd.com>
-Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
----
- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 +++---
- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 36 ++++++++++++++++++++++------------
- drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 11 ++---------
- drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 11 ++---------
- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 11 ++---------
- 5 files changed, 33 insertions(+), 42 deletions(-)
-
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-index 0e65ffe..e182c9f 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-@@ -244,7 +244,7 @@ struct amdgpu_vm_pte_funcs {
- unsigned count);
- /* write pte one entry at a time with addr mapping */
- void (*write_pte)(struct amdgpu_ib *ib,
-- uint64_t pe,
-+ const dma_addr_t *pages_addr, uint64_t pe,
- uint64_t addr, unsigned count,
- uint32_t incr, uint32_t flags);
- /* for linear pte/pde updates without addr mapping */
-@@ -930,7 +930,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
- void amdgpu_vm_flush(struct amdgpu_ring *ring,
- struct amdgpu_vm *vm,
- struct fence *updates);
--uint64_t amdgpu_vm_map_gart(struct amdgpu_device *adev, uint64_t addr);
-+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);
- int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
-@@ -2164,7 +2164,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
- #define amdgpu_gart_flush_gpu_tlb(adev, vmid) (adev)->gart.gart_funcs->flush_gpu_tlb((adev), (vmid))
- #define amdgpu_gart_set_pte_pde(adev, pt, idx, addr, flags) (adev)->gart.gart_funcs->set_pte_pde((adev), (pt), (idx), (addr), (flags))
- #define amdgpu_vm_copy_pte(adev, ib, pe, src, count) ((adev)->vm_manager.vm_pte_funcs->copy_pte((ib), (pe), (src), (count)))
--#define amdgpu_vm_write_pte(adev, ib, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->write_pte((ib), (pe), (addr), (count), (incr), (flags)))
-+#define amdgpu_vm_write_pte(adev, ib, pa, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->write_pte((ib), (pa), (pe), (addr), (count), (incr), (flags)))
- #define amdgpu_vm_set_pte_pde(adev, ib, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->set_pte_pde((ib), (pe), (addr), (count), (incr), (flags)))
- #define amdgpu_vm_pad_ib(adev, ib) ((adev)->vm_manager.vm_pte_funcs->pad_ib((ib)))
- #define amdgpu_ring_parse_cs(r, p, ib) ((r)->funcs->parse_cs((p), (ib)))
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
-index 9f3a8d9..47e1186 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
-@@ -306,9 +306,14 @@ static void amdgpu_vm_update_pages(struct amdgpu_device *adev,
- uint64_t src = adev->gart.table_addr + (addr >> 12) * 8;
- amdgpu_vm_copy_pte(adev, ib, pe, src, count);
-
-- } else if ((flags & AMDGPU_PTE_SYSTEM) || (count < 3)) {
-- amdgpu_vm_write_pte(adev, ib, pe, addr,
-- count, incr, flags);
-+ } else if (flags & AMDGPU_PTE_SYSTEM) {
-+ dma_addr_t *pages_addr = adev->gart.pages_addr;
-+ amdgpu_vm_write_pte(adev, ib, pages_addr, pe, addr,
-+ count, incr, flags);
-+
-+ } else if (count < 3) {
-+ amdgpu_vm_write_pte(adev, ib, NULL, pe, addr,
-+ count, incr, flags);
-
- } else {
- amdgpu_vm_set_pte_pde(adev, ib, pe, addr,
-@@ -385,24 +390,31 @@ error:
- }
-
- /**
-- * amdgpu_vm_map_gart - get the physical address of a gart page
-+ * amdgpu_vm_map_gart - Resolve gart mapping of addr
- *
-- * @adev: amdgpu_device pointer
-+ * @pages_addr: optional DMA address to use for lookup
- * @addr: the unmapped addr
- *
- * Look up the physical address of the page that the pte resolves
-- * to (cayman+).
-- * Returns the physical address of the page.
-+ * to and return the pointer for the page table entry.
- */
--uint64_t amdgpu_vm_map_gart(struct amdgpu_device *adev, uint64_t addr)
-+uint64_t amdgpu_vm_map_gart(const dma_addr_t *pages_addr, uint64_t addr)
- {
- uint64_t result;
-
-- /* page table offset */
-- result = adev->gart.pages_addr[addr >> PAGE_SHIFT];
-+ if (pages_addr) {
-+ /* page table offset */
-+ result = pages_addr[addr >> PAGE_SHIFT];
-+
-+ /* in case cpu page size != gpu page size*/
-+ result |= addr & (~PAGE_MASK);
-+
-+ } else {
-+ /* No mapping required */
-+ result = addr;
-+ }
-
-- /* in case cpu page size != gpu page size*/
-- result |= addr & (~PAGE_MASK);
-+ result &= 0xFFFFFFFFFFFFF000ULL;
-
- return result;
- }
-diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
-index c70d7b1..0602279 100644
---- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
-+++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
-@@ -714,7 +714,7 @@ static void cik_sdma_vm_copy_pte(struct amdgpu_ib *ib,
- * Update PTEs by writing them manually using sDMA (CIK).
- */
- static void cik_sdma_vm_write_pte(struct amdgpu_ib *ib,
-- uint64_t pe,
-+ const dma_addr_t *pages_addr, uint64_t pe,
- uint64_t addr, unsigned count,
- uint32_t incr, uint32_t flags)
- {
-@@ -733,14 +733,7 @@ static void cik_sdma_vm_write_pte(struct amdgpu_ib *ib,
- ib->ptr[ib->length_dw++] = upper_32_bits(pe);
- ib->ptr[ib->length_dw++] = ndw;
- for (; ndw > 0; ndw -= 2, --count, pe += 8) {
-- if (flags & AMDGPU_PTE_SYSTEM) {
-- value = amdgpu_vm_map_gart(ib->ring->adev, addr);
-- value &= 0xFFFFFFFFFFFFF000ULL;
-- } else if (flags & AMDGPU_PTE_VALID) {
-- value = addr;
-- } else {
-- value = 0;
-- }
-+ value = amdgpu_vm_map_gart(pages_addr, addr);
- addr += incr;
- value |= flags;
- ib->ptr[ib->length_dw++] = value;
-diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
-index e86f85f..0843f81 100644
---- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
-+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
-@@ -772,7 +772,7 @@ static void sdma_v2_4_vm_copy_pte(struct amdgpu_ib *ib,
- * Update PTEs by writing them manually using sDMA (CIK).
- */
- static void sdma_v2_4_vm_write_pte(struct amdgpu_ib *ib,
-- uint64_t pe,
-+ const dma_addr_t *pages_addr, uint64_t pe,
- uint64_t addr, unsigned count,
- uint32_t incr, uint32_t flags)
- {
-@@ -791,14 +791,7 @@ static void sdma_v2_4_vm_write_pte(struct amdgpu_ib *ib,
- ib->ptr[ib->length_dw++] = upper_32_bits(pe);
- ib->ptr[ib->length_dw++] = ndw;
- for (; ndw > 0; ndw -= 2, --count, pe += 8) {
-- if (flags & AMDGPU_PTE_SYSTEM) {
-- value = amdgpu_vm_map_gart(ib->ring->adev, addr);
-- value &= 0xFFFFFFFFFFFFF000ULL;
-- } else if (flags & AMDGPU_PTE_VALID) {
-- value = addr;
-- } else {
-- value = 0;
-- }
-+ value = amdgpu_vm_map_gart(pages_addr, addr);
- addr += incr;
- value |= flags;
- ib->ptr[ib->length_dw++] = value;
-diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
-index b2fbf96..7af4b57 100644
---- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
-+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
-@@ -922,7 +922,7 @@ static void sdma_v3_0_vm_copy_pte(struct amdgpu_ib *ib,
- * Update PTEs by writing them manually using sDMA (CIK).
- */
- static void sdma_v3_0_vm_write_pte(struct amdgpu_ib *ib,
-- uint64_t pe,
-+ const dma_addr_t *pages_addr, uint64_t pe,
- uint64_t addr, unsigned count,
- uint32_t incr, uint32_t flags)
- {
-@@ -941,14 +941,7 @@ static void sdma_v3_0_vm_write_pte(struct amdgpu_ib *ib,
- ib->ptr[ib->length_dw++] = upper_32_bits(pe);
- ib->ptr[ib->length_dw++] = ndw;
- for (; ndw > 0; ndw -= 2, --count, pe += 8) {
-- if (flags & AMDGPU_PTE_SYSTEM) {
-- value = amdgpu_vm_map_gart(ib->ring->adev, addr);
-- value &= 0xFFFFFFFFFFFFF000ULL;
-- } else if (flags & AMDGPU_PTE_VALID) {
-- value = addr;
-- } else {
-- value = 0;
-- }
-+ value = amdgpu_vm_map_gart(pages_addr, addr);
- addr += incr;
- value |= flags;
- ib->ptr[ib->length_dw++] = value;
---
-2.7.4
-