aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0297-drm-amdgpu-gfx7-LOC-reduction-in-gfx_v7_0_setup_rb.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0297-drm-amdgpu-gfx7-LOC-reduction-in-gfx_v7_0_setup_rb.patch')
-rw-r--r--common/recipes-kernel/linux/files/0297-drm-amdgpu-gfx7-LOC-reduction-in-gfx_v7_0_setup_rb.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0297-drm-amdgpu-gfx7-LOC-reduction-in-gfx_v7_0_setup_rb.patch b/common/recipes-kernel/linux/files/0297-drm-amdgpu-gfx7-LOC-reduction-in-gfx_v7_0_setup_rb.patch
new file mode 100644
index 00000000..31219bcd
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0297-drm-amdgpu-gfx7-LOC-reduction-in-gfx_v7_0_setup_rb.patch
@@ -0,0 +1,43 @@
+From 57ff151880cced48d72bcf4d5334864e6a4bc0a7 Mon Sep 17 00:00:00 2001
+From: Tom St Denis <tom.stdenis@amd.com>
+Date: Mon, 8 Feb 2016 12:34:19 -0500
+Subject: [PATCH 0297/1110] drm/amdgpu/gfx7: LOC reduction in gfx_v7_0_setup_rb
+
+Reduce for loop with bitmask to simple complement and mask
+
+Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+index adaa3f8..940dc0b 100644
+--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+@@ -1648,7 +1648,7 @@ static void gfx_v7_0_setup_rb(struct amdgpu_device *adev,
+ u32 max_rb_num_per_se)
+ {
+ int i, j;
+- u32 data, mask;
++ u32 data;
+ u32 disabled_rbs = 0;
+ u32 enabled_rbs = 0;
+
+@@ -1666,12 +1666,7 @@ static void gfx_v7_0_setup_rb(struct amdgpu_device *adev,
+ gfx_v7_0_select_se_sh(adev, 0xffffffff, 0xffffffff);
+ mutex_unlock(&adev->grbm_idx_mutex);
+
+- mask = 1;
+- for (i = 0; i < max_rb_num_per_se * se_num; i++) {
+- if (!(disabled_rbs & mask))
+- enabled_rbs |= mask;
+- mask <<= 1;
+- }
++ enabled_rbs = (~disabled_rbs) & ((1UL<<(max_rb_num_per_se*se_num))-1);
+
+ adev->gfx.config.backend_enable_mask = enabled_rbs;
+
+--
+2.7.4
+