Dave Airlie
c6fa531809
amdgpu/dc: kill some deadcode in dc core.
...
Moves one function to an inline, but kills a bunch of deadcode.
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 >
2017-10-06 13:07:39 -04:00
Dave Airlie
c1199962f5
amdgpu/dc: fix indentation on a couple of returns.
...
These were misaligned.
found by the cocci ifcol script.
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 >
2017-10-06 13:07:06 -04:00
Dave Airlie
ae3a27d19b
amdgpu/dm: don't use after free.
...
This dereference acrtc after freeing it.
Found by the kfree cocci script.
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 >
2017-10-06 13:05:22 -04:00
Dave Airlie
d029810caa
amdgpu/dc: kfree already checks for NULL.
...
Don't bother checking for it.
Found with the cocci ifnullfree.cocci script.
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 >
2017-10-06 13:05:03 -04:00
Dave Airlie
5667ff5c11
amdgpu/dc: fix a bunch of misc whitespace.
...
This just aligns a few things with kernel style.
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 >
2017-10-06 13:04:42 -04:00
Dave Airlie
2016b641f4
amdgpu/dc: drop hw_sequencer_types.h
...
This isn't used or required.
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 >
2017-10-06 13:03:20 -04:00
Dave Airlie
bd42a6f451
amdgpu/dc: drop dce110_types.h
...
Doesn't appear to be used.
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 >
2017-10-06 13:02:57 -04:00
Dave Airlie
23d433fabe
amdgpu/dc: use kernel ilog2 for log_2.
...
This should produce the same result.
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 >
2017-10-06 13:00:27 -04:00
Dave Airlie
4ee67c71b8
amdgpu/dc: don't memset after kzalloc.
...
We allocate this struct zeroed, so don't need to memset in the
constructor.
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 >
2017-10-06 12:59:20 -04:00
Dave Airlie
48aa3ddfd5
amdgpu/dc: inline dal grph object id functions.
...
This is worth 400 bytes.
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 >
2017-10-06 12:58:50 -04:00
Dave Airlie
ebec44a245
BackMerge tag 'v4.14-rc3' into drm-next
...
Linux 4.14-rc3
Requested by Daniel for the tracing build fix in fixes.
2017-10-03 09:35:04 +10:00
Rex Zhu
e5f23736a8
drm/amd/powerplay: refine code in amd_powerplay.c (v2)
...
1. use flag PP_DPM_DISABLED within powerplay
notify amdgpu dpm state by cgs interface.
2. delete redundant virtualization check in
powerplay
v2: squash in fix for hwmgr_init (Rex)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-10-01 17:34:18 -04:00
Dave Airlie
659333de48
drm/amdgpu: use designated initialiser for thermal_irq_src.
...
This fixes the 0-day build warning.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
2017-10-01 11:27:41 +10:00
Dave Airlie
d8c893b44b
amdgpu/dc: inline dml_round_to_multiple
...
turns out to be a win to inline this.
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 >
2017-09-29 13:04:16 -04:00
Dave Airlie
2a206cc20a
amdgpu/dc: rename bios get_image symbol to something more searchable.
...
This just makes it easier to find.
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 >
2017-09-29 13:04:10 -04:00
Dave Airlie
04e212926f
amdgpu/dc: set some of the link dp code to static.
...
These aren't currently used outside this file.
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 >
2017-09-29 13:04:03 -04:00
Dave Airlie
69e3fdaabe
amdgpu/dc: inline all the signal_types code.
...
This is worth 300 bytes, and one less source file.
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 >
2017-09-29 13:03:56 -04:00
Dave Airlie
bd6d15769e
amdgpu/dc: inline fixed31_32 div_int
...
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 >
2017-09-29 13:03:49 -04:00
Dave Airlie
c233e91b0f
amdgpu/dc: use the builtin constant p trick on the 31/32 fixed point.
...
This only gets us 100 bytes, but may as well be consistent.
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 >
2017-09-29 13:03:43 -04:00
Dave Airlie
dfd1e5ce67
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 >
2017-09-29 13:03:35 -04:00
Dave Airlie
1fcd8c53b0
amdgpu/dc: inline some of the bw_fixed code.
...
This results in a ~4.5k code size reduction.
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 >
2017-09-29 13:03:28 -04:00
Dave Airlie
450619d328
amdgpu/dc: move some one line dp functions to inlines.
...
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 >
2017-09-29 13:03:22 -04:00
Dave Airlie
736b4f153b
amdgpu/dc: hide some unused aux/i2c payload apis.
...
I've no idea if these are used on other platforms, but they
aren't used outside this file here, so make them static.
Drops 300 bytes.
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 >
2017-09-29 13:03:15 -04:00
Dave Airlie
204de25fd0
amdgpu/dc: inline a bunch of the fixed 31_32 helpers.
...
This decreases code size by a few hundred bytes.
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 >
2017-09-29 13:03:09 -04:00
Dave Airlie
c4fee87961
amdgpu/dc: inline some of the fixed 32_32 fns
...
This drops ~400 bytes here.
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 >
2017-09-29 13:03:01 -04:00
Dave Airlie
6be663b5bd
amdgpu/dc: fix construct return values on irq service.
...
This just removes more unused return/errors paths.
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 >
2017-09-29 13:02:54 -04:00
Dave Airlie
db6c3bdcfe
amdgpu: fixup construct to void paths on some more dc objects.
...
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 >
2017-09-29 13:02:48 -04:00
Dave Airlie
94de2bbdfa
amdgpu/dc: remove pointless return from build_pipe_hw_param
...
This never returned anything else.
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 >
2017-09-29 13:02:41 -04:00
Dave Airlie
c13b408b81
amdgpu/dc: another round of dce/dcn construct cleanups.
...
This removes any remaining pointless return codepaths from the
DCE 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 >
2017-09-29 13:02:34 -04:00
Dave Airlie
0e1c42fd18
amdgpu/dc: cleanup construct returns in gpio.
...
This is similiar to previous patches, don't return when we don't
need to, also do error checking before allocating memory, makes
it simpler to cleanup after.
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 >
2017-09-29 13:02:28 -04:00
Dave Airlie
b08c3ca4e9
amdgpu/dc: remove pointless returns in the i2caux constructor paths. (v2)
...
There was lots of return true, and error checking that was never used
in these paths.
Just remove it all.
v2: I missed one return true.
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 >
2017-09-29 13:02:21 -04:00
Dave Airlie
4179cd8137
amdgpu/dc: make some audio functions return void
...
There is no need to check for these pointers being valid
at this level. Check earlier if required.
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 >
2017-09-29 13:02:14 -04:00
Dave Airlie
4dec2aa9eb
amdgpu/dc: make program_regamma_pwl return void
...
The return value was unused.
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 >
2017-09-29 13:02:08 -04:00
Dave Airlie
2c9a7908b4
amdgpu/dc: make get_audio_clock_info return void.
...
This function never returned false under any sane circumstances.
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 >
2017-09-29 13:02:02 -04:00
Dave Airlie
99913a171d
amdgpu/dc: make dce80 timing generator construct return void.
...
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 >
2017-09-29 13:01:55 -04:00
Dave Airlie
5fb005c458
amdgpu/dc: make dce transform constructor void
...
This never returns anything but true.
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 >
2017-09-29 13:01:49 -04:00
Dave Airlie
9cf29399f6
amdgpu/dc: make opp construct void.
...
This doesn't return anything except true.
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 >
2017-09-29 13:01:42 -04:00
Dave Airlie
c60ae11201
amdgpu/dc: make link encoder construct void.
...
This only ever returned true.
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 >
2017-09-29 13:01:36 -04:00
Dave Airlie
f29f918f28
amdgpu/dc: make stream encoder constructor return void.
...
The checks weren't useful here really.
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 >
2017-09-29 13:01:29 -04:00
Dave Airlie
ca19d1a68b
amdgpu/dc: make timing generator constructor return void.
...
This can't fail as is.
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 >
2017-09-29 13:01:21 -04:00
Dave Airlie
395f669eb6
amdgpu/dc: constify a bunch of dc structs.
...
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 >
2017-09-29 13:01:15 -04:00
Dave Airlie
d90371b0f5
amdgpu/dm: constify rgb formats.
...
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 >
2017-09-29 13:01:09 -04:00
Dave Airlie
e04a6123a4
amdgpu/dm: constify plane type.
...
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 >
2017-09-29 13:01:02 -04:00
Dave Airlie
99d1abf8f4
amdgpu/dm: constify yuv_formats.
...
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 >
2017-09-29 13:00:56 -04:00
Dave Airlie
b8a1d69ccb
amdgpu/dc: static constify update_surface_trace_level
...
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 >
2017-09-29 13:00:49 -04:00
Dave Airlie
2dc3e4a86c
amdgpu/dc: drop dc_ver char
...
This isn't referenced anywhere, and if it was it should be const.
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 >
2017-09-29 13:00:17 -04:00
Dave Airlie
63cdc76e29
amdgpu/pp: rewrite fiji pwr virus upload code.
...
Along the same lines as rewriting the polaris code, this rewrites
the fiji code, and reduces the driver size by ~40k.
Signed-off-by: Dave Airlie <airlied@redhat.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-09-29 12:24:40 -04:00
Dave Airlie
6f5c2f9d3c
amdgpu/pp: rewrite polaris pwrvirus upload code.
...
This reduces the pwrvirus table size by 30k, by moving the
sequences of writes to the data register into blocks.
Signed-off-by: Dave Airlie <airlied@redhat.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-09-29 12:24:40 -04:00
Dave Airlie
c6622f3afc
amdgpu/nbio: use constant nbio_hdp_flush_reg structs.
...
This removes the init path as well, since the init path
just did some constant init of some structs.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-09-29 12:24:39 -04:00
Dave Airlie
35b31f7c64
amdgpu/soc15: make the pcie index/data registers constant.
...
These don't seem to change at runtime, and the initialisers
are constant data. This could be improved by not selecting
the apu/non-apu path on each pcie read/write access.
Signed-off-by: Dave Airlie <airlied@redhat.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-09-29 12:24:38 -04:00