aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/4211-drm-amd-display-Do-not-create-memory-allocation-if-s.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/4211-drm-amd-display-Do-not-create-memory-allocation-if-s.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/4211-drm-amd-display-Do-not-create-memory-allocation-if-s.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/4211-drm-amd-display-Do-not-create-memory-allocation-if-s.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/4211-drm-amd-display-Do-not-create-memory-allocation-if-s.patch
new file mode 100644
index 00000000..c4d533ed
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/4211-drm-amd-display-Do-not-create-memory-allocation-if-s.patch
@@ -0,0 +1,54 @@
+From f06c43e6131a531e7518419117bef4ab69951975 Mon Sep 17 00:00:00 2001
+From: Anthony Koo <Anthony.Koo@amd.com>
+Date: Fri, 6 Apr 2018 12:07:19 -0400
+Subject: [PATCH 4211/5725] drm/amd/display: Do not create memory allocation if
+ stats not enabled
+
+Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
+Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
+Acked-by: Harry Wentland <harry.wentland@amd.com>
+---
+ drivers/gpu/drm/amd/display/modules/stats/stats.c | 26 +++++++++++++----------
+ 1 file changed, 15 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/modules/stats/stats.c b/drivers/gpu/drm/amd/display/modules/stats/stats.c
+index ed5f680..48e0219 100644
+--- a/drivers/gpu/drm/amd/display/modules/stats/stats.c
++++ b/drivers/gpu/drm/amd/display/modules/stats/stats.c
+@@ -115,18 +115,22 @@ struct mod_stats *mod_stats_create(struct dc *dc)
+ &reg_data, sizeof(unsigned int), &flag))
+ core_stats->enabled = reg_data;
+
+- core_stats->entries = DAL_STATS_ENTRIES_REGKEY_DEFAULT;
+- if (dm_read_persistent_data(dc->ctx, NULL, NULL,
+- DAL_STATS_ENTRIES_REGKEY,
+- &reg_data, sizeof(unsigned int), &flag)) {
+- if (reg_data > DAL_STATS_ENTRIES_REGKEY_MAX)
+- core_stats->entries = DAL_STATS_ENTRIES_REGKEY_MAX;
+- else
+- core_stats->entries = reg_data;
+- }
++ if (core_stats->enabled) {
++ core_stats->entries = DAL_STATS_ENTRIES_REGKEY_DEFAULT;
++ if (dm_read_persistent_data(dc->ctx, NULL, NULL,
++ DAL_STATS_ENTRIES_REGKEY,
++ &reg_data, sizeof(unsigned int), &flag)) {
++ if (reg_data > DAL_STATS_ENTRIES_REGKEY_MAX)
++ core_stats->entries = DAL_STATS_ENTRIES_REGKEY_MAX;
++ else
++ core_stats->entries = reg_data;
++ }
+
+- core_stats->time = kzalloc(sizeof(struct stats_time_cache) * core_stats->entries,
+- GFP_KERNEL);
++ core_stats->time = kzalloc(sizeof(struct stats_time_cache) * core_stats->entries,
++ GFP_KERNEL);
++ } else {
++ core_stats->entries = 0;
++ }
+
+ if (core_stats->time == NULL)
+ goto fail_construct;
+--
+2.7.4
+