aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/2569-drm-amd-display-add-missing-mod_vmid-destructor.patch
blob: 0efc292b1cf6068cd6d4f655f327e0fddb2dfbae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 971056e16f8547afbed61fa957f29f924bf976db Mon Sep 17 00:00:00 2001
From: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Date: Wed, 29 May 2019 11:24:35 -0400
Subject: [PATCH 2569/2940] drm/amd/display: add missing mod_vmid destructor

mod_vmid is missing a destructor.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/modules/inc/mod_vmid.h | 2 ++
 drivers/gpu/drm/amd/display/modules/vmid/vmid.c    | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_vmid.h b/drivers/gpu/drm/amd/display/modules/inc/mod_vmid.h
index c7672f3b837f..a3787fdf0c08 100644
--- a/drivers/gpu/drm/amd/display/modules/inc/mod_vmid.h
+++ b/drivers/gpu/drm/amd/display/modules/inc/mod_vmid.h
@@ -41,4 +41,6 @@ struct mod_vmid *mod_vmid_create(
 		unsigned int num_vmid,
 		struct dc_virtual_addr_space_config *va_config);
 
+void mod_vmid_destroy(struct mod_vmid *mod_vmid);
+
 #endif /* MOD_VMID_H_ */
diff --git a/drivers/gpu/drm/amd/display/modules/vmid/vmid.c b/drivers/gpu/drm/amd/display/modules/vmid/vmid.c
index 431052626d93..f0a153704f6e 100644
--- a/drivers/gpu/drm/amd/display/modules/vmid/vmid.c
+++ b/drivers/gpu/drm/amd/display/modules/vmid/vmid.c
@@ -156,3 +156,12 @@ struct mod_vmid *mod_vmid_create(
 fail_dc_null:
 	return NULL;
 }
+
+void mod_vmid_destroy(struct mod_vmid *mod_vmid)
+{
+	if (mod_vmid != NULL) {
+		struct core_vmid *core_vmid = MOD_VMID_TO_CORE(mod_vmid);
+
+		kfree(core_vmid);
+	}
+}
-- 
2.17.1