Skip to contentSkip to conversation

drm/amd/display: Free gamma after calculating legacy transfer function

PATCH In review Nicholas Kazlauskas 2 participants 2 messages Oct 11, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Free gamma after calculating legacy transfer function

[Why]
We're leaking memory by not freeing the gamma used to calculate the transfer function for legacy gamma.

[How]
Release the gamma after we're done with it.

Cc Philip Yang <[email protected]>
Cc Harry Wentland <[email protected]>
Cc Bhawanpreet Lakha <[email protected]>
Cc Leo Li <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +2 -0
index b43bb7f90e4e..2233d293a707 100644
@@ -210,6 +210,8 @@ static int __set_legacy_tf(struct dc_transfer_func *func,
 	res = mod_color_calculate_regamma_params(func, gamma, true, has_rom,
 						 NULL);
 
+	dc_gamma_release(&gamma);
+
 	return res ? 0 : -ENOMEM;
 }
 
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20191011162610.1112-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org

Reviewed-by Leo Li
#2 lore raw
Quoted 4 lines · Nicholas Kazlauskas

[Why]
We're leaking memory by not freeing the gamma used to calculate the transfer function for legacy gamma.

Quoted 8 lines

[How]
Release the gamma after we're done with it.

Cc Philip Yang <[email protected]>
Cc Harry Wentland <[email protected]>
Cc Bhawanpreet Lakha <[email protected]>
Cc Leo Li <[email protected]>

Thanks!

Quoted 10 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +0 -0
index b43bb7f90e4e..2233d293a707 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c static int __set_legacy_tf(struct dc_transfer_func *func, · line 217

Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +2 -0
@@ -210,6 +210,8 @@ static int __set_legacy_tf(struct dc_transfer_func *func,
 	res = mod_color_calculate_regamma_params(func, gamma, true, has_rom,
 						 NULL);
 
+	dc_gamma_release(&gamma);
+
 	return res ? 0 : -ENOMEM;
 }
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx