openwrt/staging/blogic.git
7 years agodrm/amd/display: Fix eDP panel light-up
Roman Li [Tue, 25 Jul 2017 18:50:44 +0000 (14:50 -0400)]
drm/amd/display: Fix eDP panel light-up

 Power-down panel on disale only if sink exists
 otherwise it fails edid read during init sequence

Signed-off-by: Roman Li <Roman.Li@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: Use stream validation hook.
Andrey Grodzovsky [Mon, 24 Jul 2017 19:35:24 +0000 (15:35 -0400)]
drm/amd/display: Use stream validation hook.

Use dc_validate_stream from crtc atomic_check for single stream
validation.

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: Move stream validations into seperate function.
Andrey Grodzovsky [Fri, 21 Jul 2017 20:34:36 +0000 (16:34 -0400)]
drm/amd/display: Move stream validations into seperate function.

Stateless streams validations (not require resource population)
moved into hook to be called directly from DM.

Call dc_validate_stream be before validate_with_context for
non Linux APIs

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: break up plane disable and disconnect in set mode
Eric Yang [Mon, 24 Jul 2017 14:47:02 +0000 (10:47 -0400)]
drm/amd/display: break up plane disable and disconnect in set mode

Signed-off-by: Eric Yang <Eric.Yang2@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 plane disable sequence
Tony Cheng [Sun, 23 Jul 2017 19:22:47 +0000 (15:22 -0400)]
drm/amd/display: separate plane disable sequence

- disconnect:  trigger hw to disconnect plane on next vsync
- disable: disables HW block and disable clocks
- power_down: kill power

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: single PSR display not allow CSTATE sw w/a
Charlene Liu [Tue, 25 Jul 2017 01:41:28 +0000 (21:41 -0400)]
drm/amd/display: single PSR display not allow CSTATE sw w/a

Description:
HW issue when all the pipes are off, DCE_allow_cstate is 0.
New sequence : blank OTG only instead of previous OTG_master_en=0)

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: Roll core_gamma into dc_gamma
Harry Wentland [Mon, 24 Jul 2017 19:30:17 +0000 (15:30 -0400)]
drm/amd/display: Roll core_gamma into dc_gamma

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Roll gamma struct into core_gamma
Harry Wentland [Mon, 24 Jul 2017 19:20:50 +0000 (15:20 -0400)]
drm/amd/display: Roll gamma struct into core_gamma

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Roll core_sink into dc_sink
Harry Wentland [Mon, 24 Jul 2017 18:04:27 +0000 (14:04 -0400)]
drm/amd/display: Roll core_sink into dc_sink

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: Roll sink struct into core_sink
Harry Wentland [Mon, 24 Jul 2017 17:55:26 +0000 (13:55 -0400)]
drm/amd/display: Roll sink struct into core_sink

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: Roll core_link into dc_link
Harry Wentland [Sun, 23 Jul 2017 00:05:20 +0000 (20:05 -0400)]
drm/amd/display: Roll core_link into dc_link

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: Roll core_surface into dc_surface
Harry Wentland [Thu, 20 Jul 2017 15:43:32 +0000 (11:43 -0400)]
drm/amd/display: Roll core_surface into dc_surface

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 DCHUBBUB block from MemInput to HW sequencer.
Zeyu Fan [Sun, 23 Jul 2017 22:30:15 +0000 (18:30 -0400)]
drm/amd/display: Move DCHUBBUB block from MemInput to HW sequencer.

Signed-off-by: Zeyu Fan <Zeyu.Fan@amd.com>
Reviewed-by: Zeyu Fan <Zeyu.Fan@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 RGAM programming from opp to dpp
Yue Hin Lau [Sun, 23 Jul 2017 16:13:37 +0000 (12:13 -0400)]
drm/amd/display: move RGAM programming from opp to 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 YCbCr420 deep color mode not supported
Charlene Liu [Sun, 23 Jul 2017 20:45:45 +0000 (16:45 -0400)]
drm/amd/display: fix YCbCr420 deep color mode not supported

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 missing func for dce11o to avoid crash
Eric Yang [Mon, 24 Jul 2017 15:18:29 +0000 (11:18 -0400)]
drm/amd/display: add missing func for dce11o to avoid crash

Signed-off-by: Eric Yang <Eric.Yang2@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 ocsc programming from opp to dpp
Tony Cheng [Sun, 23 Jul 2017 01:58:08 +0000 (21:58 -0400)]
drm/amd/display: move ocsc programming from opp to dpp

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Yuehin 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: add idle wait for passive surface update and modeset
Eric Yang [Sun, 23 Jul 2017 19:18:57 +0000 (15:18 -0400)]
drm/amd/display: add idle wait for passive surface update and modeset

Signed-off-by: Eric Yang <Eric.Yang2@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 generic_reg_wait 1000ms case
Eric Yang [Sun, 23 Jul 2017 18:17:09 +0000 (14:17 -0400)]
drm/amd/display: Fix generic_reg_wait 1000ms case

Signed-off-by: Eric Yang <Eric.Yang2@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 VGA to HWSS from TG
Tony Cheng [Thu, 13 Jul 2017 02:35:52 +0000 (22:35 -0400)]
drm/amd/display: move VGA to HWSS from TG

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Zeyu Fan <Zeyu.Fan@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 decide_link_settings
Ding Wang [Tue, 18 Jul 2017 21:18:11 +0000 (17:18 -0400)]
drm/amd/display: fix decide_link_settings

Signed-off-by: Ding Wang <Ding.Wang@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: Roll surface struct into core_surface
Harry Wentland [Thu, 20 Jul 2017 14:26:23 +0000 (10:26 -0400)]
drm/amd/display: Roll surface struct into core_surface

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: support for updated register headers on DCN
Dmytro Laktyushkin [Fri, 21 Jul 2017 21:35:16 +0000 (17:35 -0400)]
drm/amd/display: support for updated register headers on DCN

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: Change DTN_INFO macro
Wesley Chalmers [Thu, 20 Jul 2017 21:13:12 +0000 (17:13 -0400)]
drm/amd/display: Change DTN_INFO macro

Signed-off-by: Wesley Chalmers <Wesley.Chalmers@amd.com>
Reviewed-by: Wesley Chalmers <Wesley.Chalmers@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 logic for hdmi info packet bits.
Zeyu Fan [Thu, 20 Jul 2017 23:04:56 +0000 (19:04 -0400)]
drm/amd/display: Implement logic for hdmi info packet bits.

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: revert dcn10 soc defaults to 17 19
Dmytro Laktyushkin [Wed, 19 Jul 2017 00:13:05 +0000 (20:13 -0400)]
drm/amd/display: revert dcn10 soc defaults to 17 19

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: fix locking in apply_ctx_for_surface
Eric Yang [Thu, 20 Jul 2017 20:17:17 +0000 (16:17 -0400)]
drm/amd/display: fix locking in apply_ctx_for_surface

Signed-off-by: Eric Yang <Eric.Yang2@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: mpcc disconnect and pipe pg in multi-display
Tony Cheng [Thu, 20 Jul 2017 00:22:22 +0000 (20:22 -0400)]
drm/amd/display: mpcc disconnect and pipe pg in multi-display

still quite hacky.  but this address not properly shutdown pipe video underlay
+ enable another display case, as well as mode changes with video overlay.

Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Eric Yang <eric.yang2@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 dcn register headers
Dmytro Laktyushkin [Thu, 20 Jul 2017 18:51:16 +0000 (14:51 -0400)]
drm/amd/display: update dcn register headers

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: mpo debug sanity checks
Tony Cheng [Fri, 14 Jul 2017 18:07:16 +0000 (14:07 -0400)]
drm/amd/display: mpo debug sanity checks

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: plumbing to allow easy print of HW state for DTN
Tony Cheng [Thu, 20 Jul 2017 04:12:20 +0000 (00:12 -0400)]
drm/amd/display: plumbing to allow easy print of HW state for DTN

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Wesley Chalmers <Wesley.Chalmers@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: register programming consolidation
Tony Cheng [Thu, 13 Jul 2017 02:00:34 +0000 (22:00 -0400)]
drm/amd/display: register programming consolidation

remove redundant DPP_CLOCK_ENABLE in ipp. clock programmed by HWSS

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: fix index and union overwrite in compressor
Roman Li [Wed, 19 Jul 2017 20:59:14 +0000 (16:59 -0400)]
drm/amd/display: fix index and union overwrite in compressor

  Fixing 2 bugs in compressor:
- array out of bounds due to incorrect index
- compressor options always 0 due to union overwrite

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: Return hpd_irq_dpcd from hpd_rx handler
Wenjing Liu [Wed, 19 Jul 2017 17:18:26 +0000 (13:18 -0400)]
drm/amd/display: Return hpd_irq_dpcd from hpd_rx handler

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Wenjing Liu <Wenjing.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: Set i2c speed to 100khz for DCE11.2 and later.
Zeyu Fan [Wed, 19 Jul 2017 20:46:42 +0000 (16:46 -0400)]
drm/amd/display: Set i2c speed to 100khz for DCE11.2 and later.

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: fix dcn10_resource read_dce_straps
Dmytro Laktyushkin [Wed, 19 Jul 2017 18:32:21 +0000 (14:32 -0400)]
drm/amd/display: fix dcn10_resource read_dce_straps

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: Add missing SURFACE_TMZ register shift/mask
Harry Wentland [Fri, 4 Aug 2017 20:20:10 +0000 (16:20 -0400)]
drm/amd: Add missing SURFACE_TMZ register shift/mask

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/include: Add DCHUBBUB_TEST_DEBUG register defines
Harry Wentland [Tue, 25 Jul 2017 14:56:49 +0000 (10:56 -0400)]
drm/amd/include: Add DCHUBBUB_TEST_DEBUG register defines

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/include: Add DC_PINSTRAPS.AUDIO defines
Harry Wentland [Mon, 24 Jul 2017 21:23:45 +0000 (17:23 -0400)]
drm/amd/include: Add DC_PINSTRAPS.AUDIO defines

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Do not release state objects on atomic check fail
Leo (Sunpeng) Li [Tue, 18 Jul 2017 22:33:23 +0000 (18:33 -0400)]
drm/amd/display: Do not release state objects on atomic check fail

In any drm ioctl call, drm_atomic_state_clear() is called at the end to
destroy the states; even if atomic check fails. Therefore, releasing
states on atomic check failure is incorrect.

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@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: powergate fe of reused pipes to reset ttu
Eric Yang [Tue, 18 Jul 2017 19:50:47 +0000 (15:50 -0400)]
drm/amd/display: powergate fe of reused pipes to reset ttu

When we exit MPO, disconnected pipes cannot be immediately powergated
because registers are double buffered, and actual disconnection does
not happen until VUPDATE. So it is differred for many flips.
However in the case of exiting full screen, the transition from MPO
to grph only back to MPO is very fast and also involves increasing of
watermarks. Since the underlay pipe is never powergated in this
scenario, it keeps its old TTU counter, which causes allowPstateSwitch
signal to be de-asserted when compared to the new increased watermark.
Since the new pipe is not enabled yet, the signal will be continously
de-asserted and hangs SMU, who's waiting for the signal to do pstate
switching.

Signed-off-by: Eric Yang <Eric.Yang2@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 regkey for DRR control for internal panel
Anthony Koo [Tue, 18 Jul 2017 14:21:43 +0000 (10:21 -0400)]
drm/amd/display: Add regkey for DRR control for internal panel

Also need to change default to off

Signed-off-by: Anthony Koo <anthony.koo@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: revert order change of HUBP and MPC disable
Tony Cheng [Fri, 14 Jul 2017 17:42:23 +0000 (13:42 -0400)]
drm/amd/display: revert order change of HUBP and MPC disable

- root cause was we disable opp clk in MPC disconnect
- hubp_blank is not double buffered, so we can't blank until MPC disconnect or we have risk of underflow

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Eric Yang <eric.yang2@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 aviInfoFrame bar Info and add set_avMute
Charlene Liu [Mon, 17 Jul 2017 20:04:02 +0000 (16:04 -0400)]
drm/amd/display: fix aviInfoFrame bar Info and add set_avMute

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: properly turn off unused mpc before front end programming
Eric Yang [Mon, 17 Jul 2017 14:22:05 +0000 (10:22 -0400)]
drm/amd/display: properly turn off unused mpc before front end programming

MPCC_OPP_ID must be programmed to 0xf to properly turn off the mpcc.
However the software state of the mpcc must keep track of the opp that
the mpcc is attached to for reset to properly happen. This is kinda
hacky right now, but a good solution may involve a lot of work.

Signed-off-by: Eric Yang <Eric.Yang2@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 DVI connected to HDMI connector max tmds clock
Charlene Liu [Mon, 17 Jul 2017 21:46:49 +0000 (17:46 -0400)]
drm/amd/display: fix DVI connected to HDMI connector max tmds clock

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: link training fallback actions
Ding Wang [Thu, 13 Jul 2017 16:09:57 +0000 (12:09 -0400)]
drm/amd/display: link training fallback actions

Signed-off-by: Ding Wang <ding.wang@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 S3 gamma corruption.
Andrey Grodzovsky [Thu, 13 Jul 2017 20:27:08 +0000 (16:27 -0400)]
drm/amd/display: Fix S3 gamma corruption.

On S3 resume gamma is corrupted since no gamma programming
took place.

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: Move view port registers and programming to memory input.
Vitaly Prosyak [Thu, 13 Jul 2017 20:42:58 +0000 (15:42 -0500)]
drm/amd/display:  Move view port registers and programming to memory input.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@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: hwseq init sequence update
Dmytro Laktyushkin [Fri, 7 Jul 2017 21:21:45 +0000 (17:21 -0400)]
drm/amd/display: hwseq init sequence update

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: add line number to reg_wait timeout print
Dmytro Laktyushkin [Tue, 11 Jul 2017 17:48:17 +0000 (13:48 -0400)]
drm/amd/display: add line number to reg_wait timeout print

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: Release cached atomic state in S3.
Andrey Grodzovsky [Thu, 13 Jul 2017 14:56:48 +0000 (10:56 -0400)]
drm/amd/display: Release cached atomic state in S3.

Fixes memory leak.

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: Preserve refcount for S3 case.
Andrey Grodzovsky [Thu, 13 Jul 2017 14:52:47 +0000 (10:52 -0400)]
drm/amd/display: Preserve refcount for S3 case.

Curent_context is zerroed out for suspend, keep the refcount.
Minor code move in dc_commit_context_no_check

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: Rename trasnform to dpp for dcn's
Vitaly Prosyak [Wed, 5 Jul 2017 22:03:04 +0000 (17:03 -0500)]
drm/amd/display: Rename trasnform to dpp for dcn's

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@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 mpo exit hang
Eric Yang [Wed, 12 Jul 2017 22:38:04 +0000 (18:38 -0400)]
drm/amd/display: fix mpo exit hang

Signed-off-by: Eric Yang <Eric.Yang2@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: ensure OTG is locked before proceeding
Tony Cheng [Wed, 12 Jul 2017 13:00:14 +0000 (09:00 -0400)]
drm/amd/display: ensure OTG is locked before proceeding

also remove tg lock at init_hw as not all OTG is running

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: fix 4k@30 with 10bit deep color and avi for BT2020
Charlene Liu [Wed, 12 Jul 2017 19:49:46 +0000 (15:49 -0400)]
drm/amd/display: fix 4k@30 with 10bit deep color and avi for BT2020

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: avoid disabling opp clk before hubp is blanked.
Tony Cheng [Wed, 12 Jul 2017 15:54:10 +0000 (11:54 -0400)]
drm/amd/display: avoid disabling opp clk before hubp is blanked.

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Eric Yang <eric.yang2@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_validate_ctx refocunt fixes.
Andrey Grodzovsky [Tue, 11 Jul 2017 22:36:42 +0000 (18:36 -0400)]
drm/amd/display: dc_validate_ctx refocunt fixes.

In dc_resource_validate_ctx_copy_construct don't override dst
context refcount.

Remove extra retain to new ctx in dc_update_surfaces_and_stream

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: change order of HUBP and MPC disable according to HW guide
Tony Cheng [Wed, 12 Jul 2017 13:02:54 +0000 (09:02 -0400)]
drm/amd/display: change order of HUBP and MPC disable according to HW guide

blank hubp first before disconnect MPC

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Eric Yang <eric.yang2@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 eDP power isn't off when lid close
John Wu [Wed, 12 Jul 2017 06:25:52 +0000 (14:25 +0800)]
drm/amd/display: Fix eDP power isn't off when lid close

Signed-off-by: John Wu <john.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: Release dm_state->context when state is cleared.
Andrey Grodzovsky [Tue, 11 Jul 2017 18:42:57 +0000 (14:42 -0400)]
drm/amd/display: Release dm_state->context when state is cleared.

Handling a use case of TEST_ONLY request from DRM where commit is
not goiing to be called. We need to release the allocated dc_validate_context
in this case.

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: Skip DC validation for flips and cursor.
Andrey Grodzovsky [Tue, 11 Jul 2017 17:45:57 +0000 (13:45 -0400)]
drm/amd/display: Skip DC validation for flips and cursor.

Nothing to validate in DC in this case. Skip it.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@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: Introduce refcount for dc_validate_context
Andrey Grodzovsky [Tue, 11 Jul 2017 18:41:51 +0000 (14:41 -0400)]
drm/amd/display: Introduce refcount for dc_validate_context

Linux requires to be able to release allocated context
in case it was never commited.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@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: change non_dpm0 state's default SR latency
Charlene Liu [Tue, 11 Jul 2017 17:40:52 +0000 (13:40 -0400)]
drm/amd/display: change non_dpm0 state's default SR latency

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: Flattening to dc_transfer_func
Leo (Sunpeng) Li [Mon, 10 Jul 2017 18:04:21 +0000 (14:04 -0400)]
drm/amd/display: Flattening to dc_transfer_func

Flattening dc transfer functions in the following manner:
transfer_func > core_transfer_func > dc_transfer_func

References to deleted structs are updated as needed.

Signed-off-by: Leo (Sunpeng) Li <sunpeng.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: Attach surface to dm_plane_state.
Andrey Grodzovsky [Fri, 7 Jul 2017 20:14:12 +0000 (16:14 -0400)]
drm/amd/display: Attach surface to dm_plane_state.

Attach surface to state.
Remove Create surface from commit.
Propogate any surface creation and initialization error back to atomic_check caller.
clean outdated code in check and commit.

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: Clean dm_plane_state hooks.
Andrey Grodzovsky [Tue, 25 Jul 2017 22:11:18 +0000 (18:11 -0400)]
drm/amd/display: Clean dm_plane_state hooks.

New surface is created in check only, in duplicate we just
reference exsisting surface and in destroy we release 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: Leave all validate_ctx life cycle management to DC.
Andrey Grodzovsky [Mon, 10 Jul 2017 20:24:42 +0000 (16:24 -0400)]
drm/amd/display: Leave all validate_ctx life cycle management to DC.

Follow DC fix.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@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 context copy memory leak
Corbin McElhanney [Mon, 10 Jul 2017 19:52:10 +0000 (15:52 -0400)]
drm/amd/display: Fix context copy memory leak

This change corrects an error introduced in 355f123f. Instead of
using the copy constructor to assign the new context, we swap the
pointer.

Signed-off-by: Corbin McElhanney <corbin.mcelhanney@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: dal1.1 hwseq prog update
Dmytro Laktyushkin [Fri, 7 Jul 2017 15:24:13 +0000 (11:24 -0400)]
drm/amd/display: dal1.1 hwseq prog update

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: dal1.1 xfm prog update
Dmytro Laktyushkin [Fri, 7 Jul 2017 14:37:46 +0000 (10:37 -0400)]
drm/amd/display: dal1.1 xfm prog update

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: dal1.1 ipp prog update
Dmytro Laktyushkin [Thu, 6 Jul 2017 21:35:17 +0000 (17:35 -0400)]
drm/amd/display: dal1.1 ipp prog update

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: dal1.1 opp prog update
Dmytro Laktyushkin [Thu, 6 Jul 2017 19:58:25 +0000 (15:58 -0400)]
drm/amd/display: dal1.1 opp prog update

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: minor dcn10_hwseq clean up/refactor
Dmytro Laktyushkin [Thu, 6 Jul 2017 19:42:04 +0000 (15:42 -0400)]
drm/amd/display: minor dcn10_hwseq clean up/refactor

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: get dal1.1 to run
Dmytro Laktyushkin [Wed, 5 Jul 2017 16:00:28 +0000 (12:00 -0400)]
drm/amd/display: get dal1.1 to run

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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 MPO visual confirm
Anthony Koo [Thu, 6 Jul 2017 18:27:49 +0000 (14:27 -0400)]
drm/amd/display: Fix MPO visual confirm

1. Need to blend non-active area to show visual confirm borders
2. Set number of Visual Confirm lines based on pipe instance
3. Set Different colors representing surface format of bottom most plan

Signed-off-by: Anthony Koo <anthony.koo@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 dcn10 hw_sequencer to new reg access style
Dmytro Laktyushkin [Wed, 5 Jul 2017 10:57:49 +0000 (06:57 -0400)]
drm/amd/display: refactor dcn10 hw_sequencer to new reg access style

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: Refactor dc_commit_streams
Andrey Grodzovsky [Thu, 6 Jul 2017 17:53:15 +0000 (13:53 -0400)]
drm/amd/display: Refactor dc_commit_streams

Change it to sue dc_commit_context. dc_commit_context
is used directly from Linux DM.

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: call pplib to update clocks
Eric Yang [Thu, 6 Jul 2017 18:20:25 +0000 (14:20 -0400)]
drm/amd/display: call pplib to update clocks

Allow pplib to update fclk and dcfclk for different voltage levels.
PPlib's values for dispclk and phyclk is not correct, so we are not
getting it from them. fclk is currently not used correctly, although
does not effect the actual fclk we request.

Signed-off-by: Eric Yang <Eric.Yang2@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 how we disable pipe split
Eric Yang [Wed, 5 Jul 2017 19:30:18 +0000 (15:30 -0400)]
drm/amd/display: Change how we disable pipe split

Before this change, pipe split was disabled by bumping up dpp clock
bounding box for DPM level 0 and 1, this allows validation to pass
without splitting at a lower DPM level. This change reverts this
and instead lowers display clock at DPM level 0, this forces
configurations that need pipe split at DPM level 0 to go to
DPM level 1, where they can be driven without split.

Signed-off-by: Eric Yang <Eric.Yang2@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 modes that require read bw greater than 30%
Eric Yang [Tue, 27 Jun 2017 16:09:01 +0000 (12:09 -0400)]
drm/amd/display: block modes that require read bw greater than 30%

Signed-off-by: Eric Yang <Eric.Yang2@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 number of memory channel calc out of pplib call
Eric Yang [Tue, 4 Jul 2017 18:13:25 +0000 (14:13 -0400)]
drm/amd/display: move number of memory channel calc out of pplib call

Move number of memory channel calculation out of dcn_bw_update_from_pplib

Fill in fabric_and_dram_bandwidth for single channel case.

Signed-off-by: Eric Yang <Eric.Yang2@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 DPM bounding box
Tony Cheng [Sun, 4 Jun 2017 16:50:20 +0000 (12:50 -0400)]
drm/amd/display: update DPM bounding box

value based on STA  target aligned to FCLK for SS corners with 10% margin

also
- group all latency together
- group all voltage state related together

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Undo dc_update_surfaces_and_stream change.
Andrey Grodzovsky [Wed, 5 Jul 2017 17:28:24 +0000 (13:28 -0400)]
drm/amd/display: Undo dc_update_surfaces_and_stream change.

Restoring conditional call to in_transfer_func since no reason
to call it unconditionally.

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: Remove acrtc->stream
Andrey Grodzovsky [Thu, 29 Jun 2017 16:03:59 +0000 (12:03 -0400)]
drm/amd/display: Remove acrtc->stream

Remove acrtc->stream and move it into dm_crtc_state.
This allows to get rid of dm_atomic_state->dm_set.
Also reuse streams created in atomic_check during
commit.

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: Update atomic state hooks.
Andrey Grodzovsky [Thu, 29 Jun 2017 14:41:17 +0000 (10:41 -0400)]
drm/amd/display: Update atomic state hooks.

Reimplement atomic_state_alloc and atomic_state_clear to
release validate_ctx.

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: Use validate_context from atomic_check in commit
Harry Wentland [Wed, 28 Jun 2017 17:23:04 +0000 (13:23 -0400)]
drm/amd/display: Use validate_context from atomic_check in commit

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: Add validate_context to atomic_state
Harry Wentland [Wed, 29 Mar 2017 15:25:24 +0000 (11:25 -0400)]
drm/amd/display: Add validate_context to atomic_state

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: Commit validation set from state
Harry Wentland [Mon, 6 Mar 2017 14:43:30 +0000 (09:43 -0500)]
drm/amd/display: Commit validation set from state

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: Add correct retain/release
Harry Wentland [Fri, 3 Mar 2017 19:50:00 +0000 (14:50 -0500)]
drm/amd/display: Add correct retain/release

Needed by objs in dm_atomic_state

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: Hook dm private state into atomic_check
Harry Wentland [Tue, 27 Jun 2017 18:35:17 +0000 (14:35 -0400)]
drm/amd/display: Hook dm private state into 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: Create dm_atomic_state
Harry Wentland [Tue, 27 Jun 2017 15:55:43 +0000 (11:55 -0400)]
drm/amd/display: Create dm_atomic_state

We really want to use the new private_atomic_state but can't right now
as we have to maintain some backward compatibility to older kernels. For
now let's follow Intel's approach and extend the drm_atomic_state.

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: set drr during program timing.
Yongqiang Sun [Mon, 26 Jun 2017 20:25:10 +0000 (16:25 -0400)]
drm/amd/display: set drr during program timing.

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: Remove SMU_INTERRUPT_CONTROL
Dmytro Laktyushkin [Thu, 29 Jun 2017 22:01:35 +0000 (18:01 -0400)]
drm/amd/display: Remove SMU_INTERRUPT_CONTROL

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: Enable ipp compilation
Dmytro Laktyushkin [Wed, 28 Jun 2017 22:58:27 +0000 (18:58 -0400)]
drm/amd/display: Enable ipp compilation

Update relevant registers

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: Rename DCN opp specific function prefixes to oppn10
Dmytro Laktyushkin [Wed, 28 Jun 2017 22:41:22 +0000 (18:41 -0400)]
drm/amd/display: Rename DCN opp specific function prefixes to oppn10

Also update relevant registers.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: Rename DCN mem input specific function prefixes to min.
Dmytro Laktyushkin [Wed, 28 Jun 2017 20:31:58 +0000 (16:31 -0400)]
drm/amd/display: Rename DCN mem input specific function prefixes to min.

Also updated relevant registers.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: Rename DCN TG specific function prefixes to tg
Dmytro Laktyushkin [Wed, 28 Jun 2017 18:33:29 +0000 (14:33 -0400)]
drm/amd/display: Rename DCN TG specific function prefixes to tg

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: Set static screen register for stoney/carrizo
Bhawanpreet Lakha [Fri, 30 Jun 2017 19:19:55 +0000 (15:19 -0400)]
drm/amd/display: Set static screen register for stoney/carrizo

-Set CRTC_STATIC_SCREEN_EVENT for stoney/carrizo for FBC implementation
-Code is currently guarded with "ENABLE_FBC" compile time flag

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@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>