platform/kernel/linux-starfive.git
7 years agodrm/amd/display: move regamma from opp to dpp for dce
Yue Hin Lau [Fri, 28 Jul 2017 17:08:03 +0000 (13:08 -0400)]
drm/amd/display: move regamma from opp to dpp for dce

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: Avoid full modeset when not required
Bhawanpreet Lakha [Fri, 28 Jul 2017 17:11:00 +0000 (13:11 -0400)]
drm/amd/display: Avoid full modeset when not required

Fix IGT test case (kms_atomic_transition)
-DRM sets the mode_changed flag, while we don't need to do a full
 modeset.
-We want to override the mode_changed flag in this case

If we don't do this, we will still bypass the modeset in DC. This will
fail to update the new stream_status, causing nullptr at a later stage
when trying to access stream_status"

We now avoid this by discarding the new_stream instead of partially
filling it.

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@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: Move and Rename "is_stream_changed()"
Bhawanpreet Lakha [Fri, 28 Jul 2017 16:07:38 +0000 (12:07 -0400)]
drm/amd/display: Move and Rename "is_stream_changed()"

 -Move "is_stream_changed()" to DC interface
 -Rename "is_stream_changed()" to "dc_is_stream_changed()"

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: fix >340 Mhz with deep color pipe split no display
Andrey Grodzovsky [Fri, 28 Jul 2017 22:21:22 +0000 (18:21 -0400)]
drm/amd/display: fix >340 Mhz with deep color pipe split no display

 the input to HW formula needs to take care the deep color.

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: fix bw_calc for hdmi and 420 outputs
Dmytro Laktyushkin [Fri, 28 Jul 2017 22:21:22 +0000 (18:21 -0400)]
drm/amd/display: fix bw_calc for hdmi and 420 outputs

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: Keep blank until set visibility to true after mode switch
Yongqiang Sun [Fri, 28 Jul 2017 19:33:38 +0000 (15:33 -0400)]
drm/amd/display: Keep blank until set visibility to true after mode switch

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 dcn fe reset memory access error
Dmytro Laktyushkin [Fri, 28 Jul 2017 18:16:13 +0000 (14:16 -0400)]
drm/amd/display: fix dcn fe reset memory access error

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 stateless surface validation to validate_resources
Andrey Grodzovsky [Thu, 27 Jul 2017 20:47:14 +0000 (16:47 -0400)]
drm/amd/display: Add stateless surface validation to validate_resources

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: Implement plane atomic_check.
Andrey Grodzovsky [Wed, 26 Jul 2017 19:52:28 +0000 (15:52 -0400)]
drm/amd/display: Implement plane atomic_check.

Use per surface validation hook.

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: Initial prototype of FBC implementation
Roman Li [Fri, 28 Jul 2017 00:00:06 +0000 (20:00 -0400)]
drm/amd/display: Initial prototype of FBC implementation

- Protected by ENABLE_FBC compile flag

Signed-off-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: Initial prototype of FBC implementation
Roman Li [Thu, 27 Jul 2017 23:53:55 +0000 (19:53 -0400)]
drm/amd/display: Initial prototype of FBC implementation

- Protected by ENABLE_FBC compile flag
- DC part will follow

Signed-off-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: add preferred mode from Video Format Preference Data Block
Andrey Grodzovsky [Wed, 26 Jul 2017 19:51:31 +0000 (15:51 -0400)]
drm/amd/display: add preferred mode from Video Format Preference Data Block

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Vitaly Prosyak <Vitaly.Prosyak@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 per surface validation hook.
Andrey Grodzovsky [Wed, 26 Jul 2017 19:51:31 +0000 (15:51 -0400)]
drm/amd/display: Add per surface validation hook.

For now just validate pixel format in the hook.

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: Fix DCN compile errors
Vikrant Mhaske [Thu, 27 Jul 2017 09:30:52 +0000 (17:30 +0800)]
drm/amd/display: Fix DCN compile errors

Fix for DCN compiler errors caused due to various submits

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: move ocsc programming from opp to dpp for dce
Yue Hin Lau [Tue, 25 Jul 2017 20:45:18 +0000 (16:45 -0400)]
drm/amd/display: move ocsc programming from opp to dpp for dce

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 ckeckpatch problems in amdgpu_dm
Harry Wentland [Thu, 27 Jul 2017 01:03:22 +0000 (21:03 -0400)]
drm/amd/display: Fix ckeckpatch problems in amdgpu_dm

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: Merge amdgpu_dm_types and amdgpu_dm
Harry Wentland [Thu, 10 Aug 2017 17:29:07 +0000 (13:29 -0400)]
drm/amd/display: Merge amdgpu_dm_types and amdgpu_dm

This separation stopped making sense a long time ago.

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: Rename firmware_info to dc_firmware_info
Harry Wentland [Wed, 26 Jul 2017 23:31:53 +0000 (19:31 -0400)]
drm/amd/display: Rename firmware_info to dc_firmware_info

This is to avoid conflicts with amdgpu's firmware_info once we
merge amdgpu_dm_types with amdgpu_dm.

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: update clocks we report to PPlib
Eric Yang [Wed, 26 Jul 2017 22:31:25 +0000 (18:31 -0400)]
drm/amd/display: update clocks we report to PPlib

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 detect caps for edp
Roman Li [Wed, 26 Jul 2017 20:27:37 +0000 (16:27 -0400)]
drm/amd/display: add detect caps for edp

1. The caps detect sequence for edp is different from dp.
   Added separate function for edp.
2. Removed max_link_setting and replaced it with verified
   to avoid confusion.
3. Reverted sink count guard for edp powerdown as unnecessary
   with the changes above.

Signed-off-by: Roman Li <Roman.Li@amd.com>
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 mpcc idle wait
Dmytro Laktyushkin [Wed, 26 Jul 2017 21:01:06 +0000 (17:01 -0400)]
drm/amd/display: fix mpcc idle wait

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: mpc block redesign
Dmytro Laktyushkin [Fri, 21 Jul 2017 21:46:50 +0000 (17:46 -0400)]
drm/amd/display: mpc block redesign

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: collapse dce11 reset_hw_ctx_wrap into 1 function
Dmytro Laktyushkin [Wed, 26 Jul 2017 20:54:39 +0000 (16:54 -0400)]
drm/amd/display: collapse dce11 reset_hw_ctx_wrap into 1 function

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: safeguard compressor api
Roman Li [Wed, 26 Jul 2017 18:42:38 +0000 (14:42 -0400)]
drm/amd/display: safeguard compressor api

Only call compressor api if it's available.

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: reduce 40s time out to 1s in disable crtc
Eric Yang [Wed, 26 Jul 2017 20:15:26 +0000 (16:15 -0400)]
drm/amd/display: reduce 40s time out to 1s in disable crtc

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: Roll stream into dc_stream
Leo (Sunpeng) Li [Wed, 26 Jul 2017 20:13:48 +0000 (16:13 -0400)]
drm/amd/display: Roll stream into dc_stream

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: Roll core_stream into dc_stream
Leo (Sunpeng) Li [Wed, 26 Jul 2017 00:51:26 +0000 (20:51 -0400)]
drm/amd/display: Roll core_stream into dc_stream

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: log HUBP using DTN logging
Tony Cheng [Wed, 26 Jul 2017 02:52:45 +0000 (22:52 -0400)]
drm/amd/display: log HUBP using DTN logging

also simplify DTN INFO.  all we need is a way to have DC log register states
some where we can compare with golden.  going through connectivity is overkill.

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: Add interfaces for new CM blocks
Vitaly Prosyak [Tue, 25 Jul 2017 14:01:13 +0000 (09:01 -0500)]
drm/amd/display: Add interfaces for new CM blocks

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@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: Disable timestamp and entry heading
Yongqiang Sun [Tue, 25 Jul 2017 21:11:26 +0000 (17:11 -0400)]
drm/amd/display: Disable timestamp and entry heading

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: Minor fix for dc_sink refactor
Harry Wentland [Mon, 24 Jul 2017 18:04:27 +0000 (14:04 -0400)]
drm/amd/display: Minor fix for dc_sink refactor

Signed-off-by: Harry Wentland <harry.wentland@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: Clean up some DCN1 guards
Zeyu Fan [Tue, 25 Jul 2017 19:14:24 +0000 (15:14 -0400)]
drm/amd/display: Clean up some DCN1 guards

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 ocsc programming from opp to dpp
Yue Hin Lau [Tue, 25 Jul 2017 20:02:33 +0000 (16:02 -0400)]
drm/amd/display: move ocsc 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 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>