platform/kernel/linux-starfive.git
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years agodrm/amd/display: add backlight control in blankstream.
Charlene Liu [Mon, 28 Aug 2017 23:35:25 +0000 (19:35 -0400)]
drm/amd/display: add backlight control in blankstream.

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: not override the FMT setting set by VBIOS for eDP
Charlene Liu [Mon, 28 Aug 2017 23:33:23 +0000 (19:33 -0400)]
drm/amd/display: not override the FMT setting set by VBIOS for eDP

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: clean up functions in dcn10_dpp_cm
Yue Hin Lau [Mon, 28 Aug 2017 18:05:17 +0000 (14:05 -0400)]
drm/amd/display: clean up functions in dcn10_dpp_cm

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>
7 years agodrm/amd/display: only polling VSync Phase within VSync peroroid
Charlene Liu [Mon, 28 Aug 2017 20:28:34 +0000 (16:28 -0400)]
drm/amd/display: only polling VSync Phase within VSync peroroid

Signed-off-by: Charlene Liu <charlene.liu@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>
7 years agodrm/amd/display: Fix time out on boot
Eric Yang [Mon, 28 Aug 2017 20:50:17 +0000 (16:50 -0400)]
drm/amd/display: Fix time out on boot

On boot, hubp 0 is powergated during enable accel mode, so we time out
when we try to blank in undo wa.

Fix: Check power gate status before set blank

Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Move dis_clk into dc_state.
Andrey Grodzovsky [Mon, 28 Aug 2017 18:25:01 +0000 (14:25 -0400)]
drm/amd/display: Move dis_clk into dc_state.

dis_clk is single instance across pipes.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: add aux arbitration logic
Charlene Liu [Thu, 24 Aug 2017 21:12:48 +0000 (17:12 -0400)]
drm/amd/display: add aux arbitration logic

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>
7 years agodrm/amd/display: Add a clock source to a sharing pipe
Mikita Lipski [Wed, 23 Aug 2017 19:29:18 +0000 (15:29 -0400)]
drm/amd/display: Add a clock source to a sharing pipe

Fix to allow DVI displays to share the same clock source

Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Rename dc resource_validate_ctx methods
Bhawanpreet Lakha [Mon, 28 Aug 2017 16:04:23 +0000 (12:04 -0400)]
drm/amd/display: Rename dc resource_validate_ctx methods

Rename dc_resource methods from validate_ctx to state

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@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>
7 years agodrm/amd/display: Rename dc validate_context and current_context
Jerry Zuo [Fri, 25 Aug 2017 20:16:10 +0000 (16:16 -0400)]
drm/amd/display: Rename dc validate_context and current_context

Rename all the dc validate_context to dc_state and
dc current_context to current_state.

Signed-off-by: Jerry Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: clean up header file includes
Yue Hin Lau [Fri, 25 Aug 2017 20:13:55 +0000 (16:13 -0400)]
drm/amd/display: clean up header file includes

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>
7 years agodrm/amd/display: Remove mpc from bios left over, keep double buffer disabled.
Yongqiang Sun [Tue, 22 Aug 2017 19:03:06 +0000 (15:03 -0400)]
drm/amd/display: Remove mpc from bios left over, keep double buffer disabled.

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>
7 years agodrm/amd/display: DF C-state entry blocked when DPMS
Hersen Wu [Thu, 24 Aug 2017 21:40:00 +0000 (17:40 -0400)]
drm/amd/display: DF C-state entry blocked when DPMS

Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: move cm registers from ipp to dpp_cm
Yue Hin Lau [Sat, 19 Aug 2017 20:34:36 +0000 (16:34 -0400)]
drm/amd/display: move cm registers from ipp to dpp_cm

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>
7 years agodrm/amd/display: Update DSCL
Eric Bernstein [Thu, 24 Aug 2017 20:16:50 +0000 (16:16 -0400)]
drm/amd/display: Update DSCL

Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix MST downstream display not light up regression
Jerry Zuo [Thu, 24 Aug 2017 20:03:02 +0000 (16:03 -0400)]
drm/amd/display: Fix MST downstream display not light up regression

The fix is for the scenario: MST+SST chain together, and hook up
to the card.

Regression: Per stream validate_context build v2
Before dc_add_stream_to_ctx(), need to update/reset
stream signal type to SIGNAL_TYPE_DISPLAY_PORT_MST. Otherwise,
downstream device cannot be added to ctx due to the lack of signal
type info (SIGNAL_TYPE_NONE).
update_stream_signal() needs to be done after stream is created.

Signed-off-by: Jerry Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Use DRM provided page flip flag.
Andrey Grodzovsky [Wed, 23 Aug 2017 20:54:03 +0000 (16:54 -0400)]
drm/amd/display: Use DRM provided page flip flag.

Starting with 4.12 kernel DRM provides page flip flags so we
don't need to have our own copy.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: work around for 8k sleep crash
Yongqiang Sun [Thu, 24 Aug 2017 21:29:24 +0000 (17:29 -0400)]
drm/amd/display: work around for 8k sleep crash

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>
7 years agodrm/amd/display: do not reset lane count in EQ fallback
Wenjing Liu [Wed, 23 Aug 2017 21:02:34 +0000 (17:02 -0400)]
drm/amd/display: do not reset lane count in EQ fallback

[Description]
According to DP1.4 specs we should not reset lane count back
when falling back in failing EQ training.
This causes PHY test pattern compliance to fail as infinite LT
when LT fails EQ to 4 RBR and fails CR in a loop.

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>
7 years agodrm/amd/display: Clean up flattening core_dc to dc
Bhawanpreet Lakha [Wed, 23 Aug 2017 19:44:42 +0000 (15:44 -0400)]
drm/amd/display: Clean up flattening core_dc to dc

Clean up some code related to flattening core_dc commit
(Remove redundent dc = dc, which was the result of removing
DC_TO_CORE() macro)

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>
7 years agodrm/amd/display: Don't leak dc_stream_state.
Darren Salt [Tue, 12 Sep 2017 16:10:25 +0000 (17:10 +0100)]
drm/amd/display: Don't leak dc_stream_state.

Noticed while playing “Valley”, which was causing some 8MB of leakage per
second. kmemleak listed many entries looking like this:

    unreferenced object 0xffff8802c2951800 (size 1024):
      comm "Xorg", pid 2982, jiffies 4297410155 (age 392.787s)
      hex dump (first 32 bytes):
        00 50 f9 0c 04 88 ff ff 98 08 00 00 00 00 00 00  .P..............
        80 07 00 00 00 00 00 00 58 00 00 00 2c 00 00 00  ........X...,...
      backtrace:
        [<ffffffff810cd4c3>] create_object+0x13c/0x261
        [<ffffffff815abdc2>] kmemleak_alloc+0x20/0x3c
        [<ffffffff810cad1d>] slab_post_alloc_hook+0x42/0x52
        [<ffffffff810cb8e0>] kmem_cache_alloc+0x67/0x76
        [<ffffffff813bbb54>] dc_create_stream_for_sink+0x24/0x1cf
        [<ffffffff81373aaa>] create_stream_for_sink+0x6f/0x295
        [<ffffffff81373dc2>] dm_update_crtcs_state+0xa6/0x268
        [<ffffffff8137401e>] amdgpu_dm_atomic_check+0x9a/0x314
        [<ffffffff812ac3dd>] drm_atomic_check_only+0x17a/0x42d
        [<ffffffff812ac6a3>] drm_atomic_commit+0x13/0x4b
        [<ffffffff812ad1a5>] drm_atomic_connector_commit_dpms+0xcb/0xe8
        [<ffffffff812b1238>] drm_mode_obj_set_property_ioctl+0xe6/0x1e3
        [<ffffffff812b027b>] drm_mode_connector_property_set_ioctl+0x2b/0x2d
        [<ffffffff8129f427>] drm_ioctl_kernel+0x64/0x9d
        [<ffffffff8129f6a2>] drm_ioctl+0x230/0x316
        [<ffffffff812ca4d3>] amdgpu_drm_ioctl+0x4b/0x7d

v2: also handle break statements.

Signed-off-by: Darren Salt <devspam@moreofthesa.me.uk>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Refactor atomic check.
Andrey Grodzovsky [Fri, 18 Aug 2017 14:52:20 +0000 (10:52 -0400)]
drm/amd/display: Refactor atomic check.

Split into update crtcs and update plane functions.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Per plane validation context build.
Andrey Grodzovsky [Fri, 11 Aug 2017 14:43:45 +0000 (10:43 -0400)]
drm/amd/display: Per plane validation context build.

Introduce add/remove plane to/from context.
Make DC wrapper to use them in WIndows/Diags.
Use them in dc_update_surface_to_stream.
Call add/remove plane from Linux DM.

Remove dc_validation_set from dc_validate_global_state interface
and by this remove clean Linux DM from using it.

Signed-off-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>
7 years agodrm/amd/display: Block 6Ghz timing if SBIOS set HDMI_6G_en to 0
Charlene Liu [Wed, 23 Aug 2017 00:15:28 +0000 (20:15 -0400)]
drm/amd/display: Block 6Ghz timing if SBIOS set HDMI_6G_en to 0

Signed-off-by: Charlene Liu <charlene.liu@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>
7 years agodrm/amd/display: Safe stream encoder id in stream_status
Wenjing Liu [Tue, 22 Aug 2017 22:42:51 +0000 (18:42 -0400)]
drm/amd/display: Safe stream encoder id in stream_status

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>
7 years agodrm/amd/display: Fix return value from rx irq handler on up request
Wenjing Liu [Tue, 22 Aug 2017 19:49:57 +0000 (15:49 -0400)]
drm/amd/display: Fix return value from rx irq handler on up request

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Stop including atomfimrwareid.h directly
Harry Wentland [Tue, 22 Aug 2017 13:35:41 +0000 (09:35 -0400)]
drm/amd/display: Stop including atomfimrwareid.h directly

It's already included in atomfirmware.h

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Remove old, misleading comment
Harry Wentland [Tue, 22 Aug 2017 14:29:40 +0000 (10:29 -0400)]
drm/amd/display: Remove old, misleading comment

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Remove unneeded code
Bhawanpreet Lakha [Mon, 21 Aug 2017 20:28:39 +0000 (16:28 -0400)]
drm/amd/display: Remove unneeded code

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>
7 years agodrm/amd/display: retry LT on failing LT in automated request
Wenjing Liu [Mon, 21 Aug 2017 20:43:08 +0000 (16:43 -0400)]
drm/amd/display: retry LT on failing LT in automated request

[Description]
Link training is not retried in automated link training request.
In case link training is occasionally failing, there is not way to retry
so the requested lane settings will not set.

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>
7 years agodrm/amd/display: Change log level for DCN powergatting
Bhawanpreet Lakha [Mon, 21 Aug 2017 15:46:17 +0000 (11:46 -0400)]
drm/amd/display: Change log level for DCN powergatting

Change log level from LOG_DC to LOG_DEBUG
LOG_DC spams dmesg on linux when hotpluging

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>
7 years agodrm/amd/display: retire dm_pp_apply_clock_for_voltage_request
Tony Cheng [Sun, 20 Aug 2017 18:25:19 +0000 (14:25 -0400)]
drm/amd/display: retire dm_pp_apply_clock_for_voltage_request

set dcfclk and fclk req with pp_smu_display_requirement_rv

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>
7 years agodrm/amd/display: write dpcd 0x600 to 2 for DP/eDP when powerdown
Charlene Liu [Mon, 21 Aug 2017 16:59:41 +0000 (12:59 -0400)]
drm/amd/display: write dpcd 0x600 to 2 for DP/eDP when powerdown

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: version 3.1.01
Tony Cheng [Sat, 19 Aug 2017 12:55:58 +0000 (08:55 -0400)]
drm/amd/display: version 3.1.01

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>
7 years agodrm/amd/display: Enable double buffer when unblank crtc.
Yongqiang Sun [Mon, 21 Aug 2017 15:00:25 +0000 (11:00 -0400)]
drm/amd/display: Enable double buffer when unblank crtc.

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>
7 years agodrm/amd/display: dc: Remove unneeded includes in DCN
Harry Wentland [Tue, 22 Aug 2017 14:29:23 +0000 (10:29 -0400)]
drm/amd/display: dc: Remove unneeded includes in DCN

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: memory leak dwb
Tony Cheng [Sat, 19 Aug 2017 20:36:13 +0000 (16:36 -0400)]
drm/amd/display: memory leak dwb

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>
7 years agodrm/amd/display: cleanup naming of DCN DPP functions
Yue Hin Lau [Sat, 19 Aug 2017 16:10:28 +0000 (12:10 -0400)]
drm/amd/display: cleanup naming of DCN DPP 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>
7 years agodrm/amd/display: Fixed mpc add, enable always scaler for video surface.
Dmytro Laktyushkin [Fri, 28 Jul 2017 12:16:27 +0000 (08:16 -0400)]
drm/amd/display: Fixed mpc add, enable always scaler for video surface.

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>
7 years agodrm/amd/display: fix hubp mpcc and opp tracking
Dmytro Laktyushkin [Fri, 28 Jul 2017 12:16:27 +0000 (08:16 -0400)]
drm/amd/display: fix hubp mpcc and opp tracking

This should be handled by mi and mpc only

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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>
7 years agodrm/amd/display: Remove unnecessary assignemnt
Harry Wentland [Thu, 17 Aug 2017 18:57:27 +0000 (14:57 -0400)]
drm/amd/display: Remove unnecessary assignemnt

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>
7 years agodrm/amd/display: Disable stutter for Raven
Bhawanpreet Lakha [Thu, 17 Aug 2017 21:00:47 +0000 (17:00 -0400)]
drm/amd/display: Disable stutter for Raven

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@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>
7 years agodrm/amd/display: Fix two MST not light up regressions
Jerry Zuo [Thu, 17 Aug 2017 20:05:37 +0000 (16:05 -0400)]
drm/amd/display: Fix two MST not light up regressions

1. Change 100104: Move verify link cap after read edid causes MST
   link_cap struct not being set. It leads to zero denominator
   pbn_per_slot value, leading to the crash at
   dal_fixed31_32_div(). Skip MST link training for now and will
   need to add MST specific link traning routine later.

2. Change 98822: Adding edp supports changes link setting
   condition from max_link to verified_link. It leads to MST is
   getting wrong link settings.
   e.g. LINK_SPREAD_05_DOWNSPREAD_30KHZ not set in MST case

Signed-off-by: Jerry Zuo <Jerry.Zuo@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>
7 years agodrm/amd/display: separate cm functions out from dcn10_dpp
Yue Hin Lau [Thu, 17 Aug 2017 21:17:37 +0000 (17:17 -0400)]
drm/amd/display: separate cm functions out from dcn10_dpp

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>
7 years agodrm/amd/display: re-enable audio after LT test
Wenjing Liu [Thu, 17 Aug 2017 20:24:11 +0000 (16:24 -0400)]
drm/amd/display: re-enable audio after LT test

[Description]
Audio should be attached to the same pipe once it is attached.
We will not remove audio endpoint in disable stream.
We will reeanble the audio after automated link training test

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@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>
7 years agodrm/amd/display: Cache edp config in dc link
Wenjing Liu [Tue, 15 Aug 2017 23:10:14 +0000 (19:10 -0400)]
drm/amd/display: Cache edp config in dc link

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>
7 years agodrm/amd/display: separate scl functions out from dcn10_dpp
Yue Hin Lau [Tue, 15 Aug 2017 21:44:19 +0000 (17:44 -0400)]
drm/amd/display: separate scl functions out from dcn10_dpp

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>
7 years agodrm/amd/display: Fix FBC disable for stereo
Roman Li [Thu, 17 Aug 2017 20:14:45 +0000 (16:14 -0400)]
drm/amd/display: Fix FBC disable for stereo

Removed FBC disable from dc_enable_stereo().
It should be implemented in stereo_setup callback, which is not
implemented yet. Otherwise it always disable FBC regardless
if stereo supported or not.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Log OTG registers with dcn10 hw state
Corbin McElhanney [Wed, 16 Aug 2017 15:49:07 +0000 (11:49 -0400)]
drm/amd/display: Log OTG registers with dcn10 hw state

Signed-off-by: Corbin McElhanney <corbin.mcelhanney@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>
7 years agodrm/amd/display: fix not enter/exit PSR with latest driver/SBIOS
Charlene Liu [Thu, 17 Aug 2017 00:25:42 +0000 (20:25 -0400)]
drm/amd/display: fix not enter/exit PSR with latest driver/SBIOS

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>
7 years agodrm/amd/display: increase polling interval for fbc status update
Roman Li [Wed, 16 Aug 2017 23:06:49 +0000 (19:06 -0400)]
drm/amd/display: increase polling interval for fbc status update

1.Fixing error message:
"wait counter exceeded, changes to HW not applied"
2. Added "FBC status changed to 0/1" logs

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Enable Vega by default.
Harry Wentland [Fri, 15 Sep 2017 18:07:30 +0000 (14:07 -0400)]
drm/amd/display: Enable Vega by default.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Move copy_construct from state_alloc to atomic_check.
Leo (Sunpeng) Li [Thu, 21 Sep 2017 20:13:00 +0000 (16:13 -0400)]
drm/amd/display: Move copy_construct from state_alloc to atomic_check.

Previously atomic_check assumed that dc_state is allocated and filled
in. This is not the case when we hit EDEADLK and have to backup and
retry.

We could change atomic_state_clear but that revealed some other
problems. For now let's create and construct dc_state in atomic_check.

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Refactor dc_state creation into a function.
Leo (Sunpeng) Li [Thu, 7 Sep 2017 20:46:34 +0000 (16:46 -0400)]
drm/amd/display: Refactor dc_state creation into a function.

For less repetition and easy debugging.

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Per stream validate_context build v2.
Andrey Grodzovsky [Mon, 31 Jul 2017 15:29:25 +0000 (11:29 -0400)]
drm/amd/display: Per stream validate_context build v2.

Until now new context would start as empty, then populated
with exsisting pipes + new. Now we start with duplication
of existing context and then add/delete from the context
pipes as needed.

This allows to do a per stream resource
population, start discarding dc_validation_set
and by this brings DC closer to to DRM.

v2: Add some fixes and rebase.

Signed-off-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>
7 years agodrm/amd/display: refactor pplib/smu communication
Tony Cheng [Sun, 13 Aug 2017 17:50:52 +0000 (13:50 -0400)]
drm/amd/display: refactor pplib/smu communication

new per SoC interface instead legacy interface with lots of un-used
field that only cause confusion

model pp_smu like one of our HW objects with func_ptr interface
to call into it.  struct pp_smu as handle to call pp/smu

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Implement HDMI retimer settings for RV AM4 support.
Zeyu Fan [Mon, 14 Aug 2017 22:43:11 +0000 (18:43 -0400)]
drm/amd/display: Implement HDMI retimer settings for RV AM4 support.

Signed-off-by: Zeyu Fan <Zeyu.Fan@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>
7 years agodrm/amd/display: move vm registers to hwsequencer
Yue Hin Lau [Mon, 14 Aug 2017 22:17:01 +0000 (18:17 -0400)]
drm/amd/display: move vm registers to hwsequencer

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>
7 years agodrm/amd/display: remove fake address reporting when blank
Tony Cheng [Thu, 3 Aug 2017 12:49:41 +0000 (08:49 -0400)]
drm/amd/display: remove fake address reporting when blank

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>
7 years agodrm/amd/display: Fix FBC compilation
Roman Li [Mon, 14 Aug 2017 21:35:08 +0000 (17:35 -0400)]
drm/amd/display: Fix FBC compilation

- Fixing compilation with ENABLE_FBC flag
  which was broken after flattening core_dc to dc

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Jerry Zuo <Jerry.Zuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Leave DCN config guard around fpu header
Harry Wentland [Thu, 10 Aug 2017 20:16:20 +0000 (16:16 -0400)]
drm/amd/display: Leave DCN config guard around fpu header

See
https://lists.freedesktop.org/archives/dri-devel/2017-August/149938.html

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: eDP power sequence T9 fail
Charlene Liu [Fri, 11 Aug 2017 17:22:02 +0000 (13:22 -0400)]
drm/amd/display: eDP power sequence T9 fail

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: blank otg before power gate front end.
Yongqiang Sun [Fri, 11 Aug 2017 15:23:30 +0000 (11:23 -0400)]
drm/amd/display: blank otg before power gate front end.

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>
7 years agodrm/amd/display: Use MAX_PIPES for DTO reg arrays
Dmytro Laktyushkin [Thu, 3 Aug 2017 20:41:48 +0000 (16:41 -0400)]
drm/amd/display: Use MAX_PIPES for DTO reg arrays

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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>