linux/drivers/gpu/drm/amd/display/modules
Krunoslav Kovac e752058b86 drm/amd/display: Optimize gamma calculations
[Why&How]

1. Stack usage is pretty high as fixed31_32 struct is 8 bytes and we
have functions with >30 vars on the stack.

2. Optimize gamma calculation by reducing number of calls to
dc_fixpt_pow Our X points are divided into 32 regions wth 16 pts each.
Each region is 2x the previous, meaning x[i] = 2*x[i-16] for i>=16.
Using (2x)^gamma = 2^gamma * x^gamma, we can recursively compute powers
of gamma, we just need first 16 pts to start it up. dc_fixpt_pow() is
expensive, it computes x^y by doing exp(y*logx) Exp is done by Taylor
series approximation, and log by Newton-like approximation that also
uses exp internally. In short, it's significantly heavier than
run-of-the-mill addition/subtraction/multiply.

Signed-off-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2019-07-18 14:27:25 -05:00
..
color drm/amd/display: Optimize gamma calculations 2019-07-18 14:27:25 -05:00
freesync drm/amd: drop use of drmp.h in os_types.h 2019-06-10 22:59:45 +02:00
inc drm/amd/display: add missing mod_vmid destructor 2019-06-22 09:34:14 -05:00
info_packet drm/amd/display: Use VCP for extended colorimetry 2019-05-24 12:21:00 -05:00
power drm/amd/display: Add missing newline at end of file 2019-06-17 11:02:03 -05:00
stats drm/amd/display: remove redundant null pointer check before kfree 2018-09-26 21:09:12 -05:00
vmid drm/amd/display: add missing mod_vmid destructor 2019-06-22 09:34:14 -05:00