amdgpu/dc: allow inlining constant int to fixed a lot better.
authorDave Airlie <airlied@redhat.com>
Fri, 29 Sep 2017 07:13:25 +0000 (17:13 +1000)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 29 Sep 2017 17:03:35 +0000 (13:03 -0400)
commitdfd1e5ce673b8b2557d622dc99735e2d7ad5ba5b
tree5f8a372e95965654f0431344623895945faecc91
parent1fcd8c53b0c45c405433b5d78a5e2b2d858bd3af
amdgpu/dc: allow inlining constant int to fixed a lot better.

This uses two things that might be Linux specific,
__builtin_constant_p (might be gcc)
and
BUILD_BUG_ON. (maybe other dm's can have something similiar).

This saves 4k in the bw calcs code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/calcs/bw_fixed.c
drivers/gpu/drm/amd/display/dc/inc/bw_fixed.h