platform/kernel/linux-rpi.git
6 years agoamdgpu/dm: don't use after free.
Dave Airlie [Tue, 3 Oct 2017 04:27:15 +0000 (14:27 +1000)]
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>
6 years agoamdgpu/dc: kfree already checks for NULL.
Dave Airlie [Tue, 3 Oct 2017 04:27:14 +0000 (14:27 +1000)]
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>
6 years agoamdgpu/dc: fix a bunch of misc whitespace.
Dave Airlie [Tue, 3 Oct 2017 04:27:13 +0000 (14:27 +1000)]
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>
6 years agoamdgpu/dc: drop hw_sequencer_types.h
Dave Airlie [Tue, 3 Oct 2017 03:49:44 +0000 (13:49 +1000)]
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>
6 years agoamdgpu/dc: drop dce110_types.h
Dave Airlie [Tue, 3 Oct 2017 03:49:43 +0000 (13:49 +1000)]
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>
6 years agoamdgpu/dc: use kernel ilog2 for log_2.
Dave Airlie [Tue, 3 Oct 2017 03:49:42 +0000 (13:49 +1000)]
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>
6 years agoamdgpu/dc: don't memset after kzalloc.
Dave Airlie [Tue, 3 Oct 2017 02:37:33 +0000 (12:37 +1000)]
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>
6 years agoamdgpu/dc: inline dal grph object id functions.
Dave Airlie [Tue, 3 Oct 2017 02:36:54 +0000 (12:36 +1000)]
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>
6 years agoamdgpu/dc: inline dml_round_to_multiple
Dave Airlie [Fri, 29 Sep 2017 07:13:31 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: rename bios get_image symbol to something more searchable.
Dave Airlie [Fri, 29 Sep 2017 07:13:30 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: set some of the link dp code to static.
Dave Airlie [Fri, 29 Sep 2017 07:13:29 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: inline all the signal_types code.
Dave Airlie [Fri, 29 Sep 2017 07:13:28 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: inline fixed31_32 div_int
Dave Airlie [Fri, 29 Sep 2017 07:13:27 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: use the builtin constant p trick on the 31/32 fixed point.
Dave Airlie [Fri, 29 Sep 2017 07:13:26 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: allow inlining constant int to fixed a lot better.
Dave Airlie [Fri, 29 Sep 2017 07:13:25 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: inline some of the bw_fixed code.
Dave Airlie [Fri, 29 Sep 2017 07:13:24 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: move some one line dp functions to inlines.
Dave Airlie [Fri, 29 Sep 2017 07:13:23 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: hide some unused aux/i2c payload apis.
Dave Airlie [Fri, 29 Sep 2017 07:13:22 +0000 (17:13 +1000)]
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>
6 years agoamdgpu/dc: inline a bunch of the fixed 31_32 helpers.
Dave Airlie [Fri, 29 Sep 2017 05:45:08 +0000 (15:45 +1000)]
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>
6 years agoamdgpu/dc: inline some of the fixed 32_32 fns
Dave Airlie [Fri, 29 Sep 2017 05:45:07 +0000 (15:45 +1000)]
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>
6 years agoamdgpu/dc: fix construct return values on irq service.
Dave Airlie [Fri, 29 Sep 2017 04:34:42 +0000 (14:34 +1000)]
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>
6 years agoamdgpu: fixup construct to void paths on some more dc objects.
Dave Airlie [Fri, 29 Sep 2017 04:34:41 +0000 (14:34 +1000)]
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>
6 years agoamdgpu/dc: remove pointless return from build_pipe_hw_param
Dave Airlie [Fri, 29 Sep 2017 04:34:40 +0000 (14:34 +1000)]
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>
6 years agoamdgpu/dc: another round of dce/dcn construct cleanups.
Dave Airlie [Fri, 29 Sep 2017 04:34:39 +0000 (14:34 +1000)]
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>
6 years agoamdgpu/dc: cleanup construct returns in gpio.
Dave Airlie [Fri, 29 Sep 2017 04:34:38 +0000 (14:34 +1000)]
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>
6 years agoamdgpu/dc: remove pointless returns in the i2caux constructor paths. (v2)
Dave Airlie [Fri, 29 Sep 2017 05:44:54 +0000 (15:44 +1000)]
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>
6 years agoamdgpu/dc: make some audio functions return void
Dave Airlie [Fri, 29 Sep 2017 04:34:36 +0000 (14:34 +1000)]
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>
6 years agoamdgpu/dc: make program_regamma_pwl return void
Dave Airlie [Fri, 29 Sep 2017 04:34:35 +0000 (14:34 +1000)]
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>
6 years agoamdgpu/dc: make get_audio_clock_info return void.
Dave Airlie [Fri, 29 Sep 2017 04:34:34 +0000 (14:34 +1000)]
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>
6 years agoamdgpu/dc: make dce80 timing generator construct return void.
Dave Airlie [Fri, 29 Sep 2017 03:16:00 +0000 (13:16 +1000)]
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>
6 years agoamdgpu/dc: make dce transform constructor void
Dave Airlie [Fri, 29 Sep 2017 03:15:59 +0000 (13:15 +1000)]
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>
6 years agoamdgpu/dc: make opp construct void.
Dave Airlie [Fri, 29 Sep 2017 03:15:58 +0000 (13:15 +1000)]
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>
6 years agoamdgpu/dc: make link encoder construct void.
Dave Airlie [Fri, 29 Sep 2017 03:15:57 +0000 (13:15 +1000)]
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>
6 years agoamdgpu/dc: make stream encoder constructor return void.
Dave Airlie [Fri, 29 Sep 2017 03:15:56 +0000 (13:15 +1000)]
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>
6 years agoamdgpu/dc: make timing generator constructor return void.
Dave Airlie [Fri, 29 Sep 2017 03:15:55 +0000 (13:15 +1000)]
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>
6 years agoamdgpu/dc: constify a bunch of dc structs.
Dave Airlie [Fri, 29 Sep 2017 00:39:29 +0000 (10:39 +1000)]
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>
6 years agoamdgpu/dm: constify rgb formats.
Dave Airlie [Fri, 29 Sep 2017 00:32:24 +0000 (10:32 +1000)]
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>
6 years agoamdgpu/dm: constify plane type.
Dave Airlie [Fri, 29 Sep 2017 00:32:23 +0000 (10:32 +1000)]
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>
6 years agoamdgpu/dm: constify yuv_formats.
Dave Airlie [Fri, 29 Sep 2017 00:27:41 +0000 (10:27 +1000)]
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>
6 years agoamdgpu/dc: static constify update_surface_trace_level
Dave Airlie [Fri, 29 Sep 2017 00:23:15 +0000 (10:23 +1000)]
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>
6 years agoamdgpu/dc: drop dc_ver char
Dave Airlie [Fri, 29 Sep 2017 00:20:39 +0000 (10:20 +1000)]
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>
6 years agodrm/amd/display: Remove DWB
Harry Wentland [Thu, 28 Sep 2017 19:39:41 +0000 (15:39 -0400)]
drm/amd/display: Remove DWB

It's not in a good shape and currently completely unused.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agoamdgpu/dc: remove wait_reg/wait_reg_func interfaces.
Dave Airlie [Thu, 28 Sep 2017 03:29:32 +0000 (13:29 +1000)]
amdgpu/dc: remove wait_reg/wait_reg_func interfaces.

These aren't used in the tree anywhere, and there is a TODO.

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>
6 years agoamdgpu/dc: don't check for 0 on register read/writes always.
Dave Airlie [Thu, 28 Sep 2017 02:42:01 +0000 (12:42 +1000)]
amdgpu/dc: don't check for 0 on register read/writes always.

This adds ~50k to the driver text segment, and 10k to data segment.

   text    data     bss     dec     hex filename
2385556   39681    1045 2426282  2505aa drivers/gpu/drm/amd/amdgpu/amdgpu.o
  text    data     bss     dec     hex filename
2336593   28857    1045 2366495  241c1f drivers/gpu/drm/amd/amdgpu/amdgpu.o

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>
6 years agoamdgpu/dc: drop dml display_mode_support.c (v2)
Dave Airlie [Thu, 28 Sep 2017 02:29:53 +0000 (12:29 +1000)]
amdgpu/dc: drop dml display_mode_support.c (v2)

This code isn't used, and this function is huge, reimport later if
going 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>
6 years agoamdgpu/dc: separate out some common code from bios parsers.
Dave Airlie [Thu, 28 Sep 2017 01:24:06 +0000 (11:24 +1000)]
amdgpu/dc: separate out some common code from bios parsers.

This extracts the bios parser object id handling into a common 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>
6 years agoamdgpu/dc: drop dml_util_is_420
Dave Airlie [Thu, 28 Sep 2017 00:55:25 +0000 (10:55 +1000)]
amdgpu/dc: drop dml_util_is_420

This is unused 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>
6 years agoamdgpu/dc: inline a bunch of the dml wrappers.
Dave Airlie [Thu, 28 Sep 2017 00:45:26 +0000 (10:45 +1000)]
amdgpu/dc: inline a bunch of the dml wrappers.

This reduces code size.

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>
6 years agoamdgpu/dc: inline a bunch of float operations.
Dave Airlie [Thu, 28 Sep 2017 00:45:25 +0000 (10:45 +1000)]
amdgpu/dc: inline a bunch of float operations.

This reduces code size for 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>
6 years agoamdgpu/dc: drop display_pipe_clocks.c.
Dave Airlie [Thu, 28 Sep 2017 00:10:22 +0000 (10:10 +1000)]
amdgpu/dc: drop display_pipe_clocks.c.

This code isn't used at all in the kernel tree, perhaps it can wait to
be imported when it is. It also does a lot of floating point calcs,
so probably good to drop it until it's needed and we can ensure
proper fpu accessors.

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>
6 years agoamdgpu/dc: move filter taps to being static const data (v2)
Dave Airlie [Thu, 28 Sep 2017 00:22:48 +0000 (10:22 +1000)]
amdgpu/dc: move filter taps to being static const data (v2)

This just adds two accessor methods, and moves all the data
to static const.

v2: fix dcn build.

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>
6 years agoamdgpu/dc: add static to construct function
Dave Airlie [Wed, 27 Sep 2017 23:21:33 +0000 (09:21 +1000)]
amdgpu/dc: add static to construct function

There was a global construct symbol in the module symbols, kill it.

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>
6 years agodrm/doc: Reference AMD DC todos
Harry Wentland [Thu, 28 Sep 2017 15:53:19 +0000 (11:53 -0400)]
drm/doc: Reference AMD DC todos

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: DC I2C review
Harry Wentland [Wed, 27 Sep 2017 19:36:11 +0000 (15:36 -0400)]
drm/amd/display: DC I2C review

While reviewing I2C in DC identified a few places. Added a couple to the
TODO list.

1) Connector info read

See get_ext_display_connection_info

On some boards the connector information has to be read through a
special I2C channel. This line is only used for this purpose and only on
driver init.

2) SCDC stuff

This should all be reworked to go through DRM's SCDC code. When this is
done some unnecessary I2C code can be retired as well.

3) Max TMDS clock read

See dal_ddc_service_i2c_query_dp_dual_mode_adaptor

This should happen in DRM as well. I haven't checked if there's
currently functionality in DRM. If not we can propose something.

4) HDMI retimer programming

Some boards have an HDMI retimer that we need to program to pass PHY
compliance.

1 & 3 might be a good exercise if someone is looking for things to do.

v2: Merge dp_dual_mode_adaptor TODO

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Use kernel alloc/free
Harry Wentland [Wed, 27 Sep 2017 14:53:50 +0000 (10:53 -0400)]
drm/amd/display: Use kernel alloc/free

Abstractions are frowned upon.

cocci script:
virtual context
virtual patch
virtual org
virtual report

@@
expression ptr;
@@

- dm_alloc(ptr)
+ kzalloc(ptr, GFP_KERNEL)

@@
expression ptr, size;
@@

- dm_realloc(ptr, size)
+ krealloc(ptr, size, GFP_KERNEL)

@@
expression ptr;
@@

- dm_free(ptr)
+ kfree(ptr)

v2: use GFP_KERNEL, not GFP_ATOMIC. add cocci script

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd: DC pull request review
Daniel Vetter [Wed, 27 Sep 2017 10:15:50 +0000 (12:15 +0200)]
drm/amd: DC pull request review

Ok, here's one more attempt at scrolling through 130k diff.

Overall verdict from me is that DC is big project, and like any big
project it's never done. So at least for me the goal isn't to make
things perfect, becaue if that's the hoop to jump through we wouldn't
have any gpu drivers at all. More important is whether merging a new
driver base will benefit the overall subsystem, and here this
primarily means whether the DC team understands how upstream works and
is designed, and whether the code is largely aligned with upstream
(especially the atomic modeset) architecture.

Looking back over the last two years I think that's the case now, so

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
for merging this pull.

While scrolling through the pull I spotted a bunch more things that
should be refactored, but most of these will be a real pain with DC
is out of tree, and much easier in tree since in many of these areas
the in-tree helpers aren't up to snuff yet for what DC needs. That
kind of work is best done when there's one tree with everything
integrated.

That's also why I think we should merge DC into drm-next directly, so
we can get started on the integration polish right away. That has a
bit higher risk of Linus having a spazz, so here's my recommendation
for merging:

- There's a few additions to drm_dp_helper.h sprinkled all over the
  pull. I think those should be put into a patch of it's own, and
  merged first. No need to rebase DC, git merge will dtrt and not end
  up with duplicates.

- dm_alloc/realloc/free is something Dave Airlie noticed, and I agree
  it's an easy red flag that might upset Linus. cocci can fix this
  easy, so no real problem I think to patch up in one big patch (I
  thought we've had a "remove malloc wrappers" todo item in the very
  first review, apparently there was more than one such wrapper).

- The history is huge, but AMD folks want to keep it if possible, and
  I see the value in that. Would be good to get an ack from Linus for
  that (but shouldn't be an issue, not the first time we've merged the
  full history of out-of-tree work).

Short&longer term TODO items are still tracked, might be a good idea
to integrate those the overall drm todo in our gpu documentation, for
more visibility.

So in a way this is kinda like staging, except not with the horribly
broken process of having an entirely separate tree for staging drivers
which just makes refactoring needlessly painful (which defeats the
point of staging really). So staging-within-the-subsystem. We've had
that before, with early nouveau.

And yes some of the files are utterly horrible to read and not
anything close to kernel coding style standards. But that's the point,
they're essentially gospel from hw engineers that happens to be
parseable by gcc.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: drop experimental flag for vega10
Alex Deucher [Fri, 2 Jun 2017 18:38:03 +0000 (14:38 -0400)]
drm/amdgpu: drop experimental flag for vega10

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: fix pflip irq registor for raven
Bhawanpreet Lakha [Mon, 18 Sep 2017 19:19:31 +0000 (15:19 -0400)]
drm/amd/display: fix pflip irq registor for raven

The pflip registor index was incorrect, this was overriding the macro
and caused a dummy irq call.

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: don't clean-up bottom pipe plane_state
Shirish S [Tue, 26 Sep 2017 06:56:41 +0000 (12:26 +0530)]
drm/amd/display: don't clean-up bottom pipe plane_state

In the scenario of setting underlay, dc_validate_global_state()
is called after constructing the context with all
relevant bottom_pipe related configurations in dm_update_planes_state().

Currently, in dc_validate_global_state(), without checking for bottom_pipe's
existence, the pipe_ctx structure is initialised to 0, hence
nullyfying the plane_state of bottom_pipe which shall be accessed
in populate_initial_data() called from bw_calcs().

Due to this null pointer access kernel panics and leads to reboot
when underlay is tried to set.

This patch fixes the issue by no longer clearing the top_pipe. This
workaround is no longer required.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Remove unused dc_validate_guaranteed function
Harry Wentland [Sun, 24 Sep 2017 18:31:51 +0000 (14:31 -0400)]
drm/amd/display: Remove unused dc_validate_guaranteed function

It got refactored away and was never cleaned.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Reduce DC chattiness
Harry Wentland [Wed, 13 Sep 2017 00:04:48 +0000 (20:04 -0400)]
drm/amd/display: Reduce DC chattiness

Log DC init but default log level to 0 (default for
amdgpu_dc_log) otherwise. Bug reporters can still make
DC more chatty by using the dc_log module param.
    amdgpu.dc_log = 1

v2: Only provide runtime option, no compile time config

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Pass log_mask from DM
Harry Wentland [Tue, 12 Sep 2017 23:33:40 +0000 (19:33 -0400)]
drm/amd/display: Pass log_mask from DM

Linux and Windows often desire different log levels.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Add dc_log module parameter
Harry Wentland [Wed, 13 Sep 2017 00:02:11 +0000 (20:02 -0400)]
drm/amdgpu: Add dc_log module parameter

We want to make DC less chatty but still allow bug reporters to
provide more detailed logs.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Clean Kconfig formatting
Harry Wentland [Mon, 11 Sep 2017 22:48:27 +0000 (18:48 -0400)]
drm/amd/display: Clean Kconfig formatting

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Update include to bring in line with internal tree
Harry Wentland [Fri, 8 Sep 2017 14:25:25 +0000 (10:25 -0400)]
drm/amd/display: Update include to bring in line with internal tree

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Change comments to bring in line with internal tree
Harry Wentland [Fri, 8 Sep 2017 14:24:21 +0000 (10:24 -0400)]
drm/amd/display: Change comments to bring in line with internal tree

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Format changes to bring in line with internal tree
Harry Wentland [Fri, 8 Sep 2017 14:23:42 +0000 (10:23 -0400)]
drm/amd/display: Format changes to bring in line with internal tree

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Disable FBC for linear tiling
Roman Li [Tue, 5 Sep 2017 22:23:46 +0000 (18:23 -0400)]
drm/amd/display: Disable FBC for linear tiling

- Fixing text console on FBC-enabled builds

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Update DPP registers
Vitaly Prosyak [Tue, 5 Sep 2017 20:58:37 +0000 (15:58 -0500)]
drm/amd/display: Update DPP registers

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Create fake sink if needed when commit stream
Harry Wentland [Thu, 17 Aug 2017 18:58:07 +0000 (14:58 -0400)]
drm/amd/display: Create fake sink if needed when commit stream

The problem we're trying to fix is this (and similar):
1) X Desktop with single display
2) VT switch
3) Unplug display
4) VT switch back to X
5) re-plug same display

Before this we'd fail at step 4 when trying to create a dc_stream_state
because of a missing sink. This change will fake a sink in this case.

The same scenario applies to S3 resume.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Break out amdgpu_dm_connector
Harry Wentland [Tue, 5 Sep 2017 18:16:09 +0000 (14:16 -0400)]
drm/amd/display: Break out amdgpu_dm_connector

Stop using amdgpu_connector and roll our own. There is no overlap
with amdgpu.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Add 2X Cursor Magnification Code
pana [Fri, 1 Sep 2017 07:43:22 +0000 (15:43 +0800)]
drm/amd/display: Add 2X Cursor Magnification Code

Signed-off-by: Pandey, Arun <Arun.Pandey@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: No need to keep track of unreffed clk sources
Harry Wentland [Tue, 5 Sep 2017 19:50:48 +0000 (15:50 -0400)]
drm/amd/display: No need to keep track of unreffed clk sources

This simplifies clock source reprogramming a bit.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: move dwb registers to header file
Yue Hin Lau [Tue, 5 Sep 2017 15:50:34 +0000 (11:50 -0400)]
drm/amd/display: move dwb registers to header file

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: remove output_format from ipp_setup
Eric Bernstein [Thu, 31 Aug 2017 20:04:24 +0000 (16:04 -0400)]
drm/amd/display: remove output_format from ipp_setup

Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Remove switching of clk sources at end of commit
Harry Wentland [Mon, 28 Aug 2017 23:44:38 +0000 (19:44 -0400)]
drm/amd/display: Remove switching of clk sources at end of commit

This should be taken care of in validate now.

All of timing sync is quite broken at the moment anyways. Will submit
another patch set to address that.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Power down clock source at commit
Harry Wentland [Mon, 28 Aug 2017 23:05:17 +0000 (19:05 -0400)]
drm/amd/display: Power down clock source at commit

Still one more in dc_validate_global

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Don't reset clock source at unref
Harry Wentland [Mon, 28 Aug 2017 22:43:45 +0000 (18:43 -0400)]
drm/amd/display: Don't reset clock source at unref

Powering down the clock source during unref is unsafe as we might want
to unref during atomic_check

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: seperate dpp_cm_helper functions into new file
Yue Hin Lau [Tue, 29 Aug 2017 20:54:39 +0000 (16:54 -0400)]
drm/amd/display: seperate dpp_cm_helper functions into new file

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Fix context alloc failed logging
Andrew Jiang [Fri, 1 Sep 2017 20:03:16 +0000 (16:03 -0400)]
drm/amd/display: Fix context alloc failed logging

Since there was no return statement in the fail block immediately
preceding the context_alloc_fail block, any failure within the
function caused a context alloc failed error message to be printed.
Since the context_alloc_fail block is only used once, move it to
where the goto is directly and accompany it with a return statement.

Signed-off-by: Andrew Jiang <Andrew.Jiang@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: fix default dithering
Tony Cheng [Fri, 1 Sep 2017 20:14:01 +0000 (16:14 -0400)]
drm/amd/display: fix default dithering

bug: default is mapped to no dithering.

default to spatial dithering based on color depth

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Enable dcn10_power_on_fe log by default
Harry Wentland [Thu, 31 Aug 2017 20:08:51 +0000 (16:08 -0400)]
drm/amd/display: Enable dcn10_power_on_fe log by default

This should only happen on full update. If this ever happens
on regular pageflips it needs to be debugged.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: fix crc_source_select use hardcoded color depth
Charlene Liu [Fri, 1 Sep 2017 16:51:47 +0000 (12:51 -0400)]
drm/amd/display: fix crc_source_select use hardcoded color depth

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: set CP2520 Test pattern to use DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE
Wenjing Liu [Thu, 31 Aug 2017 20:49:56 +0000 (16:49 -0400)]
drm/amd/display: set CP2520 Test pattern to use DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: USB-C to HDMI dongle not light
Hersen Wu [Mon, 11 Sep 2017 20:42:14 +0000 (16:42 -0400)]
drm/amd/display: USB-C to HDMI dongle not light

RV1 support only USB-C active DP-2-HDMI dongle. HPD short pulse is
generated only for DP signal.

When processing HPD short pulse, it must be DP active dongle. No need
for I2C-Over-AUX detection.

v2: Add description

Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: dce110: fix plane validation
Shirish S [Mon, 21 Aug 2017 08:32:17 +0000 (14:02 +0530)]
drm/amd/display: dce110: fix plane validation

For MPO to work with per surface rendering and flipping,
the previous logic of restricting plane[1] only as underlay
needs to be removed.
validate_surface_sets() now checks only the width and height
bounds in case of underlay rather than checking format.

Without this patch one cannot set underlay only.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Request to have DCN RV pipe Harvesting
Hersen Wu [Mon, 28 Aug 2017 21:15:34 +0000 (17:15 -0400)]
drm/amd/display: Request to have DCN RV pipe Harvesting

TODO: Current change only work for sucessive last fused pipe,
like p3, or p3,p2. It does not work for fused p1,p2.

Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Use TPS4 instead of CP2520_3 for phy pattern 7
Wenjing Liu [Wed, 30 Aug 2017 21:49:39 +0000 (17:49 -0400)]
drm/amd/display: Use TPS4 instead of CP2520_3 for phy pattern 7

[Description]
We originally use TPS4 phy test pattern for test pattern 7.
On RV we switched to a new method to use CP2520.
CP2520 should produce the same result.
However in reality, it fails DP PHY automation test.
We use the original method instead.

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Remove sanity check.
Yongqiang Sun [Wed, 30 Aug 2017 18:29:40 +0000 (14:29 -0400)]
drm/amd/display: Remove sanity check.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Added negative check for vertical line start.
Yongqiang Sun [Wed, 30 Aug 2017 15:55:40 +0000 (11:55 -0400)]
drm/amd/display: Added negative check for vertical line start.

In case of vstartup happens before vsync, set vertical line
start to 0.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Get OTG info if OTG master enabled
Logatharshan Thothiralingam [Fri, 18 Aug 2017 23:09:57 +0000 (19:09 -0400)]
drm/amd/display: Get OTG info if OTG master enabled

Signed-off-by: Logatharshan Thothiralingam <logatharshan.thothiralingam@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Remove unused flip_flags from amdgpu_crtc
Harry Wentland [Fri, 1 Sep 2017 01:17:05 +0000 (21:17 -0400)]
drm/amdgpu: Remove unused flip_flags from amdgpu_crtc

No more need since Andrey's change to use drm_crtc's version

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: clean up cm register programming functions
Yue Hin Lau [Tue, 29 Aug 2017 19:01:06 +0000 (15:01 -0400)]
drm/amd/display: clean up cm register programming functions

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: delete dead code
Tony Cheng [Mon, 28 Aug 2017 13:51:03 +0000 (09:51 -0400)]
drm/amd/display: delete dead code

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Don't spam log with failed validation
Harry Wentland [Mon, 28 Aug 2017 14:59:39 +0000 (10:59 -0400)]
drm/amd/display: Don't spam log with failed validation

In a lot of case we fail validation of timings for legitimate
reasons. No need to print an error.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Restore missing DCE8 xfm regs
Harry Wentland [Sat, 26 Aug 2017 02:34:51 +0000 (22:34 -0400)]
drm/amd/display: Restore missing DCE8 xfm regs

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Set add_stream_ctx for CZ, Hawaii and others
Harry Wentland [Fri, 25 Aug 2017 20:33:40 +0000 (16:33 -0400)]
drm/amd/display: Set add_stream_ctx for CZ, Hawaii and others

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Disable OTG double buffer.
Yongqiang Sun [Tue, 29 Aug 2017 19:27:20 +0000 (15:27 -0400)]
drm/amd/display: Disable OTG double buffer.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Program reg for vertical interrupt.
Yongqiang Sun [Tue, 29 Aug 2017 16:50:21 +0000 (12:50 -0400)]
drm/amd/display: Program reg for vertical interrupt.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: program fbc for scatter/gather
Roman Li [Fri, 25 Aug 2017 20:44:20 +0000 (16:44 -0400)]
drm/amd/display: program fbc for scatter/gather

Fixing screen flickering when FBC enabled on Stoney

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>