aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0481-drm-amdgpu-use-max_dw-in-ring_init.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0481-drm-amdgpu-use-max_dw-in-ring_init.patch')
-rw-r--r--common/recipes-kernel/linux/files/0481-drm-amdgpu-use-max_dw-in-ring_init.patch231
1 files changed, 0 insertions, 231 deletions
diff --git a/common/recipes-kernel/linux/files/0481-drm-amdgpu-use-max_dw-in-ring_init.patch b/common/recipes-kernel/linux/files/0481-drm-amdgpu-use-max_dw-in-ring_init.patch
deleted file mode 100644
index 56c731e4..00000000
--- a/common/recipes-kernel/linux/files/0481-drm-amdgpu-use-max_dw-in-ring_init.patch
+++ /dev/null
@@ -1,231 +0,0 @@
-From 1e23c826e9bd76db7279a457a9a4051c9937baee Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
-Date: Tue, 12 Apr 2016 16:26:34 +0200
-Subject: [PATCH 0481/1110] drm/amdgpu: use max_dw in ring_init
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Instead of specifying the total ring size calculate that from the maximum
-number of dw a submission can have and the number of concurrent submissions.
-
-This fixes UVD with 8 concurrent submissions or more.
-
-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_ring.c | 14 +++++---------
- drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 2 +-
- drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 4 ++--
- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 ++--
- drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 2 +-
- drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 2 +-
- drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 2 +-
- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 2 +-
- drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 4 ++--
- drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 4 ++--
- 10 files changed, 18 insertions(+), 22 deletions(-)
-
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
-index 7bd31ae..a91eca4 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
-@@ -215,18 +215,17 @@ int amdgpu_ring_restore(struct amdgpu_ring *ring,
- *
- * @adev: amdgpu_device pointer
- * @ring: amdgpu_ring structure holding ring information
-- * @ring_size: size of the ring
-+ * @max_ndw: maximum number of dw for ring alloc
- * @nop: nop packet for this ring
- *
- * Initialize the driver information for the selected ring (all asics).
- * Returns 0 on success, error on failure.
- */
- int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
-- unsigned ring_size, u32 nop, u32 align_mask,
-+ unsigned max_dw, u32 nop, u32 align_mask,
- struct amdgpu_irq_src *irq_src, unsigned irq_type,
- enum amdgpu_ring_type ring_type)
- {
-- u32 rb_bufsz;
- int r;
-
- if (ring->adev == NULL) {
-@@ -283,10 +282,8 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
- return r;
- }
-
-- /* Align ring size */
-- rb_bufsz = order_base_2(ring_size / 8);
-- ring_size = (1 << (rb_bufsz + 1)) * 4;
-- ring->ring_size = ring_size;
-+ ring->ring_size = roundup_pow_of_two(max_dw * 4 *
-+ amdgpu_sched_hw_submission);
- ring->align_mask = align_mask;
- ring->nop = nop;
- ring->type = ring_type;
-@@ -319,8 +316,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
- }
- }
- ring->ptr_mask = (ring->ring_size / 4) - 1;
-- ring->max_dw = DIV_ROUND_UP(ring->ring_size / 4,
-- amdgpu_sched_hw_submission);
-+ ring->max_dw = max_dw;
-
- if (amdgpu_debugfs_ring_init(adev, ring)) {
- DRM_ERROR("Failed to register debugfs file for rings !\n");
-diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
-index dd0cc1b..2a1e83f 100644
---- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
-+++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
-@@ -976,7 +976,7 @@ static int cik_sdma_sw_init(void *handle)
- ring = &adev->sdma.instance[i].ring;
- ring->ring_obj = NULL;
- sprintf(ring->name, "sdma%d", i);
-- r = amdgpu_ring_init(adev, ring, 256 * 1024,
-+ r = amdgpu_ring_init(adev, ring, 32 * 1024,
- SDMA_PACKET(SDMA_OPCODE_NOP, 0, 0), 0xf,
- &adev->sdma.trap_irq,
- (i == 0) ?
-diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
-index 177eb78..967150c 100644
---- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
-+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
-@@ -4414,7 +4414,7 @@ static int gfx_v7_0_sw_init(void *handle)
- ring = &adev->gfx.gfx_ring[i];
- ring->ring_obj = NULL;
- sprintf(ring->name, "gfx");
-- r = amdgpu_ring_init(adev, ring, 1024 * 1024,
-+ r = amdgpu_ring_init(adev, ring, 128 * 1024,
- PACKET3(PACKET3_NOP, 0x3FFF), 0xf,
- &adev->gfx.eop_irq, AMDGPU_CP_IRQ_GFX_EOP,
- AMDGPU_RING_TYPE_GFX);
-@@ -4441,7 +4441,7 @@ static int gfx_v7_0_sw_init(void *handle)
- sprintf(ring->name, "comp %d.%d.%d", ring->me, ring->pipe, ring->queue);
- irq_type = AMDGPU_CP_IRQ_COMPUTE_MEC1_PIPE0_EOP + ring->pipe;
- /* type-2 packets are deprecated on MEC, use type-3 instead */
-- r = amdgpu_ring_init(adev, ring, 1024 * 1024,
-+ r = amdgpu_ring_init(adev, ring, 128 * 1024,
- PACKET3(PACKET3_NOP, 0x3FFF), 0xf,
- &adev->gfx.eop_irq, irq_type,
- AMDGPU_RING_TYPE_COMPUTE);
-diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
-index 066f349..9839d4e 100644
---- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
-+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
-@@ -1570,7 +1570,7 @@ static int gfx_v8_0_sw_init(void *handle)
- ring->doorbell_index = AMDGPU_DOORBELL_GFX_RING0;
- }
-
-- r = amdgpu_ring_init(adev, ring, 1024 * 1024,
-+ r = amdgpu_ring_init(adev, ring, 128 * 1024,
- PACKET3(PACKET3_NOP, 0x3FFF), 0xf,
- &adev->gfx.eop_irq, AMDGPU_CP_IRQ_GFX_EOP,
- AMDGPU_RING_TYPE_GFX);
-@@ -1597,7 +1597,7 @@ static int gfx_v8_0_sw_init(void *handle)
- sprintf(ring->name, "comp %d.%d.%d", ring->me, ring->pipe, ring->queue);
- irq_type = AMDGPU_CP_IRQ_COMPUTE_MEC1_PIPE0_EOP + ring->pipe;
- /* type-2 packets are deprecated on MEC, use type-3 instead */
-- r = amdgpu_ring_init(adev, ring, 1024 * 1024,
-+ r = amdgpu_ring_init(adev, ring, 128 * 1024,
- PACKET3(PACKET3_NOP, 0x3FFF), 0xf,
- &adev->gfx.eop_irq, irq_type,
- AMDGPU_RING_TYPE_COMPUTE);
-diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
-index 96b63d9..82dc1e5 100644
---- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
-+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
-@@ -990,7 +990,7 @@ static int sdma_v2_4_sw_init(void *handle)
- ring->ring_obj = NULL;
- ring->use_doorbell = false;
- sprintf(ring->name, "sdma%d", i);
-- r = amdgpu_ring_init(adev, ring, 256 * 1024,
-+ r = amdgpu_ring_init(adev, ring, 32 * 1024,
- SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP), 0xf,
- &adev->sdma.trap_irq,
- (i == 0) ?
-diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
-index 0d6b9e2..c257cfa 100644
---- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
-+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
-@@ -114,7 +114,7 @@ static int uvd_v4_2_sw_init(void *handle)
-
- ring = &adev->uvd.ring;
- sprintf(ring->name, "uvd");
-- r = amdgpu_ring_init(adev, ring, 4096, CP_PACKET2, 0xf,
-+ r = amdgpu_ring_init(adev, ring, 512, CP_PACKET2, 0xf,
- &adev->uvd.irq, 0, AMDGPU_RING_TYPE_UVD);
-
- return r;
-diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
-index 84abf89..5f0d4f7 100644
---- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
-+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
-@@ -111,7 +111,7 @@ static int uvd_v5_0_sw_init(void *handle)
-
- ring = &adev->uvd.ring;
- sprintf(ring->name, "uvd");
-- r = amdgpu_ring_init(adev, ring, 4096, CP_PACKET2, 0xf,
-+ r = amdgpu_ring_init(adev, ring, 512, CP_PACKET2, 0xf,
- &adev->uvd.irq, 0, AMDGPU_RING_TYPE_UVD);
-
- return r;
-diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
-index c633b1a..7e7c3da 100644
---- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
-+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
-@@ -112,7 +112,7 @@ static int uvd_v6_0_sw_init(void *handle)
-
- ring = &adev->uvd.ring;
- sprintf(ring->name, "uvd");
-- r = amdgpu_ring_init(adev, ring, 4096, CP_PACKET2, 0xf,
-+ r = amdgpu_ring_init(adev, ring, 512, CP_PACKET2, 0xf,
- &adev->uvd.irq, 0, AMDGPU_RING_TYPE_UVD);
-
- return r;
-diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
-index c306cb9..ab9ee2a 100644
---- a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
-+++ b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
-@@ -201,14 +201,14 @@ static int vce_v2_0_sw_init(void *handle)
-
- ring = &adev->vce.ring[0];
- sprintf(ring->name, "vce0");
-- r = amdgpu_ring_init(adev, ring, 4096, VCE_CMD_NO_OP, 0xf,
-+ r = amdgpu_ring_init(adev, ring, 512, VCE_CMD_NO_OP, 0xf,
- &adev->vce.irq, 0, AMDGPU_RING_TYPE_VCE);
- if (r)
- return r;
-
- ring = &adev->vce.ring[1];
- sprintf(ring->name, "vce1");
-- r = amdgpu_ring_init(adev, ring, 4096, VCE_CMD_NO_OP, 0xf,
-+ r = amdgpu_ring_init(adev, ring, 512, VCE_CMD_NO_OP, 0xf,
- &adev->vce.irq, 0, AMDGPU_RING_TYPE_VCE);
- if (r)
- return r;
-diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
-index ce468ee..bf7bc84 100644
---- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
-+++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
-@@ -381,14 +381,14 @@ static int vce_v3_0_sw_init(void *handle)
-
- ring = &adev->vce.ring[0];
- sprintf(ring->name, "vce0");
-- r = amdgpu_ring_init(adev, ring, 4096, VCE_CMD_NO_OP, 0xf,
-+ r = amdgpu_ring_init(adev, ring, 512, VCE_CMD_NO_OP, 0xf,
- &adev->vce.irq, 0, AMDGPU_RING_TYPE_VCE);
- if (r)
- return r;
-
- ring = &adev->vce.ring[1];
- sprintf(ring->name, "vce1");
-- r = amdgpu_ring_init(adev, ring, 4096, VCE_CMD_NO_OP, 0xf,
-+ r = amdgpu_ring_init(adev, ring, 512, VCE_CMD_NO_OP, 0xf,
- &adev->vce.irq, 0, AMDGPU_RING_TYPE_VCE);
- if (r)
- return r;
---
-2.7.4
-