aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0476-drm-amd-make-some-function-local-tables-static-const.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0476-drm-amd-make-some-function-local-tables-static-const.patch')
-rw-r--r--common/recipes-kernel/linux/files/0476-drm-amd-make-some-function-local-tables-static-const.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0476-drm-amd-make-some-function-local-tables-static-const.patch b/common/recipes-kernel/linux/files/0476-drm-amd-make-some-function-local-tables-static-const.patch
new file mode 100644
index 00000000..c8ffd833
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0476-drm-amd-make-some-function-local-tables-static-const.patch
@@ -0,0 +1,76 @@
+From 56f49f8e2454f2b0b66f5dc2c24d29e49bbac0ae Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= <nils.wallmenius@gmail.com>
+Date: Sun, 10 Apr 2016 16:30:04 +0200
+Subject: [PATCH 0476/1110] drm/amd: make some function-local tables static
+ const
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+These tables were initialized on stack on each call, avoid that
+and save a little bit of text size.
+
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 2 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/ppevvmath.h | 8 ++++----
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+index cd639c3..33e47a4 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+@@ -141,7 +141,7 @@ out_cleanup:
+ void amdgpu_benchmark(struct amdgpu_device *adev, int test_number)
+ {
+ int i;
+- int common_modes[AMDGPU_BENCHMARK_COMMON_MODES_N] = {
++ static const int common_modes[AMDGPU_BENCHMARK_COMMON_MODES_N] = {
+ 640 * 480 * 4,
+ 720 * 480 * 4,
+ 800 * 600 * 4,
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+index 119cdc2..60a0c9a 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+@@ -439,7 +439,7 @@ static void amdgpu_connector_add_common_modes(struct drm_encoder *encoder,
+ struct drm_display_mode *mode = NULL;
+ struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode;
+ int i;
+- struct mode_size {
++ static const struct mode_size {
+ int w;
+ int h;
+ } common_modes[17] = {
+diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppevvmath.h b/drivers/gpu/drm/amd/powerplay/hwmgr/ppevvmath.h
+index b10df32..009bd59 100644
+--- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppevvmath.h
++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppevvmath.h
+@@ -127,8 +127,8 @@ fInt fExponential(fInt exponent) /*Can be used to calculate e^exponent*/
+ fInt solution = fPositiveOne; /*Starting off with baseline of 1 */
+ fInt error_term;
+
+- uint32_t k_array[11] = {55452, 27726, 13863, 6931, 4055, 2231, 1178, 606, 308, 155, 78};
+- uint32_t expk_array[11] = {2560000, 160000, 40000, 20000, 15000, 12500, 11250, 10625, 10313, 10156, 10078};
++ static const uint32_t k_array[11] = {55452, 27726, 13863, 6931, 4055, 2231, 1178, 606, 308, 155, 78};
++ static const uint32_t expk_array[11] = {2560000, 160000, 40000, 20000, 15000, 12500, 11250, 10625, 10313, 10156, 10078};
+
+ if (GreaterThan(fZERO, exponent)) {
+ exponent = fNegate(exponent);
+@@ -162,8 +162,8 @@ fInt fNaturalLog(fInt value)
+ fInt solution = ConvertToFraction(0); /*Starting off with baseline of 0 */
+ fInt error_term;
+
+- uint32_t k_array[10] = {160000, 40000, 20000, 15000, 12500, 11250, 10625, 10313, 10156, 10078};
+- uint32_t logk_array[10] = {27726, 13863, 6931, 4055, 2231, 1178, 606, 308, 155, 78};
++ static const uint32_t k_array[10] = {160000, 40000, 20000, 15000, 12500, 11250, 10625, 10313, 10156, 10078};
++ static const uint32_t logk_array[10] = {27726, 13863, 6931, 4055, 2231, 1178, 606, 308, 155, 78};
+
+ while (GreaterThan(fAdd(value, fNegativeOne), upper_bound)) {
+ for (i = 0; i < 10; i++) {
+--
+2.7.4
+