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

Li, Sun peng (Leo) Sunpeng.Li at amd.com
Fri Oct 11 20:54:09 UTC 2019


On 2019-10-11 12:26 p.m., Nicholas Kazlauskas wrote:
> [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 <Philip.Yang at amd.com>
> Cc: Harry Wentland <harry.wentland at amd.com>
> Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
> Cc: Leo Li <sunpeng.li at amd.com>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com

Reviewed-by: Leo Li <sunpeng.li at amd.com>
Thanks!

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> index b43bb7f90e4e..2233d293a707 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> @@ -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;
>  }
>  
> 


More information about the amd-gfx mailing list