openwrt/staging/blogic.git
7 years agodrm/amd/display: use different sr latencies for dpm0 dcn bw calc
Dmytro Laktyushkin [Tue, 20 Jun 2017 21:24:23 +0000 (17:24 -0400)]
drm/amd/display: use different sr latencies for dpm0 dcn bw calc

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: Remove check update type function.
Andrey Grodzovsky [Tue, 20 Jun 2017 14:56:35 +0000 (10:56 -0400)]
drm/amd/display: Remove check update type function.

Due to using dc_commit_surface_to_stream instead of build
stream and surface updates any surface commit today is
evlauted to full. Until we fix this and can corretly
evluate type of surface update, anything which is not page
flip or cursor update will be treted as full update chnage
and global lock will be aquired.

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 global lock function.
Andrey Grodzovsky [Tue, 20 Jun 2017 14:42:33 +0000 (10:42 -0400)]
drm/amd/display: Add global lock function.

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: MST atomic_get_property missing.
Andrey Grodzovsky [Mon, 19 Jun 2017 15:38:15 +0000 (11:38 -0400)]
drm/amd/display: MST atomic_get_property missing.

Missing function implementation was leading to EINVAL
in UMD thus not adding MST connector to X topology
and hence not getting set mode for it.

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: Create dm_plane_state.
Andrey Grodzovsky [Thu, 22 Jun 2017 21:37:22 +0000 (17:37 -0400)]
drm/amd/display: Create dm_plane_state.

Hook up dc_surface creation/destruction to dm_plane_state.
Rename amdgpu_drm_plane_state to dm_plane_state and do
minor cleanups.

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 pipe split disable regkey
Dmytro Laktyushkin [Fri, 16 Jun 2017 15:27:59 +0000 (11:27 -0400)]
drm/amd/display: add pipe split disable regkey

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: do full fe reprogram on full update
Dmytro Laktyushkin [Tue, 13 Jun 2017 21:14:51 +0000 (17:14 -0400)]
drm/amd/display: do full fe reprogram on full update

Fixes MPO entry in 2x4k scenario on raven

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: fix dc_post_update_surfaces_to_stream
Dmytro Laktyushkin [Tue, 13 Jun 2017 21:08:22 +0000 (17:08 -0400)]
drm/amd/display: fix dc_post_update_surfaces_to_stream

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: fix issues with incorrectly detecting UPDATE_TYPE_FULL
Anthony Koo [Wed, 14 Jun 2017 14:19:57 +0000 (10:19 -0400)]
drm/amd/display: fix issues with incorrectly detecting UPDATE_TYPE_FULL

This is due to how structures are being packed with padding added.
Structure field initialization doesn't clear the padding bytes, which cause
our memcmp to give incorrect result.

Move smaller structure parameters to end of structure.

Signed-off-by: Anthony Koo <anthony.koo@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@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 dc_check_update_surfaces_for_stream memcmp sequence
Dmytro Laktyushkin [Tue, 13 Jun 2017 20:31:49 +0000 (16:31 -0400)]
drm/amd/display: fix dc_check_update_surfaces_for_stream memcmp sequence

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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: Save hpd_src for dc_link
Zeyu Fan [Tue, 13 Jun 2017 15:54:10 +0000 (11:54 -0400)]
drm/amd/display: Save hpd_src for dc_link

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: RV stereo support
Vitaly Prosyak [Mon, 12 Jun 2017 16:03:26 +0000 (11:03 -0500)]
drm/amd/display: RV stereo support

Re-organize 3d declarations

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: Don't call DCN clk code for Vega
Harry Wentland [Fri, 9 Jun 2017 14:12:36 +0000 (10:12 -0400)]
drm/amd/display: Don't call DCN clk code for Vega

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: Handle commit plane with no FB.
Andrey Grodzovsky [Wed, 7 Jun 2017 22:28:43 +0000 (18:28 -0400)]
drm/amd/display: Handle commit plane with no FB.

1) Always call flip ISR, for any surface comit, not only for page flip.

2) For events not signaled in flip ISR, handle them in end of commit_tail.

3)Fix race condition between subsequent atomic calls by removing
  current state access AFTER drm_atomic_helper_commit_hw_done
  was called. After this call a pending next commit will
  swap in his own state into objects and proceed.

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: Get rid of seperate flip function.
Andrey Grodzovsky [Sun, 4 Jun 2017 13:11:56 +0000 (09:11 -0400)]
drm/amd/display: Get rid of seperate flip function.

This code is remanant of pre atomic age when flip was a
standalone IOCTL.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-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: DAL3 RV get DPREFCLK SpreadspectrumInfo from smu_info
Hersen Wu [Fri, 9 Jun 2017 15:32:06 +0000 (11:32 -0400)]
drm/amd/display: DAL3 RV get DPREFCLK SpreadspectrumInfo from smu_info

Signed-off-by: Hersen Wu <hersenxs.wu@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: RV stereo support
Vitaly Prosyak [Thu, 8 Jun 2017 20:55:02 +0000 (15:55 -0500)]
drm/amd/display: RV stereo support

HDMI frame pack and DP frame alternate in band

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: remove get_position() of underlay
Shirish S [Thu, 8 Jun 2017 06:25:06 +0000 (11:55 +0530)]
drm/amd/display: remove get_position() of underlay

get_position() returns CRTC vertical/horizontal counters,
hence it is not applicable for underlay which is plane and not
attached to one crtc.
This patch hence removes the callback from dce110_tg_v_funcs
and hence fixes a bug in dc_debug.c where in
get_position() for underlay pipe is called un-conditionally.

Witout this patch get_position() is called in case one has
to update underlay plane's data,
since callback implmented with an ASSERT(),
the old_surface_count and new_surface_count mismatches; causing
only one plane update which is not right and also assert makes the
rendering slow.

Signed-off-by: Shirish S <shirish.s@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 pipe split
Dmytro Laktyushkin [Mon, 29 May 2017 22:30:17 +0000 (18:30 -0400)]
drm/amd/display: enable pipe split

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: w/a for ycbcr output pre-multiplied alpha corruption
Dmytro Laktyushkin [Mon, 5 Jun 2017 19:08:10 +0000 (15:08 -0400)]
drm/amd/display: w/a for ycbcr output pre-multiplied alpha corruption

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: redesign mpc
Dmytro Laktyushkin [Thu, 1 Jun 2017 22:35:54 +0000 (18:35 -0400)]
drm/amd/display: redesign mpc

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: disable dcc when reset front end.
Yongqiang Sun [Thu, 8 Jun 2017 18:26:40 +0000 (14:26 -0400)]
drm/amd/display: disable dcc when reset 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: RV stereo support
Vitaly Prosyak [Wed, 7 Jun 2017 17:23:59 +0000 (12:23 -0500)]
drm/amd/display: RV stereo support

HDMI frame pack and DP frame alternate in band

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: add bw logging for dcn
Dmytro Laktyushkin [Wed, 7 Jun 2017 17:53:30 +0000 (13:53 -0400)]
drm/amd/display: add bw logging for dcn

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: fix enable_optc_clock reg_wait timeouts
Dmytro Laktyushkin [Wed, 7 Jun 2017 19:02:34 +0000 (15:02 -0400)]
drm/amd/display: fix enable_optc_clock reg_wait timeouts

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: Use surface update inuse for pending check.
Yongqiang Sun [Tue, 6 Jun 2017 20:41:00 +0000 (16:41 -0400)]
drm/amd/display: Use surface update inuse for pending 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: Temporary disable BTR FreeSync support for now
Anthony Koo [Tue, 6 Jun 2017 20:30:51 +0000 (16:30 -0400)]
drm/amd/display: Temporary disable BTR FreeSync support for now

Reduce timer tick interval for the static screen

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: propagate surface alpha setting from OS to DC
Dmytro Laktyushkin [Fri, 2 Jun 2017 23:01:37 +0000 (19:01 -0400)]
drm/amd/display: propagate surface alpha setting from OS to DC

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: Call program_gamut explicitly instead of entire set_plane
Zeyu Fan [Fri, 2 Jun 2017 21:25:49 +0000 (17:25 -0400)]
drm/amd/display: Call program_gamut explicitly instead of entire set_plane

This fixes on boot crush on Vega, Polaris with Dal3.

Signed-off-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: Add function to log connectivity
Zeyu Fan [Mon, 5 Jun 2017 21:56:05 +0000 (17:56 -0400)]
drm/amd/display: Add function to log connectivity

Signed-off-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 single link black screen
Charlene Liu [Mon, 5 Jun 2017 20:54:33 +0000 (16:54 -0400)]
drm/amd/display: fix single link black screen

Don't fall back to dual link DVI mode if the connector
is single Link only.

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: Fix DRR Enable on Desktop
Amy Zhang [Fri, 2 Jun 2017 20:33:47 +0000 (16:33 -0400)]
drm/amd/display: Fix DRR Enable on Desktop

- Block PSR in Full screen apps to prevent incorrect static screen curser events
- Reprogram static screen events when update freesync state
- Program static ramp variable active after other values are programmed
- Correct wrong assigning of the nominal and current vcount

Signed-off-by: Amy Zhang <Amy.Zhang@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 to call set PSR wait loop in dce_dmcu instead of dce_clocks
Amy Zhang [Wed, 31 May 2017 20:53:01 +0000 (16:53 -0400)]
drm/amd/display: Refactor to call set PSR wait loop in dce_dmcu instead of dce_clocks

Signed-off-by: Amy Zhang <Amy.Zhang@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: fix mpc alpha programming
Dmytro Laktyushkin [Fri, 2 Jun 2017 23:00:45 +0000 (19:00 -0400)]
drm/amd/display: fix mpc alpha programming

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: disable forced stutter disable after programming watermark
Tony Cheng [Fri, 2 Jun 2017 10:15:57 +0000 (06:15 -0400)]
drm/amd/display: disable forced stutter disable after programming watermark

vbios will disable stutter pre-OS.  driver re-enable after programming watermark

Signed-off-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: remove disable_clk_gate debug flag for DCN
Hersen Wu [Thu, 1 Jun 2017 19:49:16 +0000 (15:49 -0400)]
drm/amd/display: remove disable_clk_gate debug flag for DCN

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: Add assertion for invalid surface dimensions
Corbin McElhanney [Thu, 1 Jun 2017 20:54:53 +0000 (16:54 -0400)]
drm/amd/display: Add assertion for invalid surface dimensions

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: clean up mpc programing during fe reset
Dmytro Laktyushkin [Thu, 1 Jun 2017 16:27:00 +0000 (12:27 -0400)]
drm/amd/display: clean up mpc programing during fe reset

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: Don't update surface if dimensions are 0
Corbin McElhanney [Thu, 1 Jun 2017 19:40:04 +0000 (15:40 -0400)]
drm/amd/display: Don't update surface if dimensions are 0

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: Remove unsupported RGB formats
Leo (Sunpeng) Li [Thu, 1 Jun 2017 19:29:42 +0000 (15:29 -0400)]
drm/amd/display: Remove unsupported RGB formats

Do not broadcast (to DRM) unsupported RGB formats.

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: Enable DCN clock gating
Hersen Wu [Tue, 30 May 2017 19:26:14 +0000 (15:26 -0400)]
drm/amd/display: Enable DCN clock gating

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: Remove redundant member from amdgpu_plane.
Andrey Grodzovsky [Wed, 5 Apr 2017 16:02:45 +0000 (12:02 -0400)]
drm/amd/display: Remove redundant member from amdgpu_plane.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
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: Add function to get PSR state
Amy Zhang [Tue, 30 May 2017 20:16:57 +0000 (16:16 -0400)]
drm/amd/display: Add function to get PSR state

Signed-off-by: Amy Zhang <Amy.Zhang@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: Universal cursor plane hook-up.
Andrey Grodzovsky [Sun, 2 Apr 2017 15:55:41 +0000 (11:55 -0400)]
drm/amd/display: Universal cursor plane hook-up.

Switch from legacy cursor to DRM cursor plane. Cursor
is not an actual plane but more of a subplane of each
pipe. Bind a DRM cursor plane instance to each CRTC.
Eliminate seperate FB object allocation for cursor and
clean  dm_crtc_cursor_set.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
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: fix mpo + split pipe aquisition failure
Dmytro Laktyushkin [Tue, 30 May 2017 17:38:10 +0000 (13:38 -0400)]
drm/amd/display: fix mpo + split pipe aquisition failure

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: fix surface attachment handling of pipe split
Dmytro Laktyushkin [Mon, 29 May 2017 22:26:28 +0000 (18:26 -0400)]
drm/amd/display: fix surface attachment handling of pipe split

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: allow taking split pipes during resource mapping
Dmytro Laktyushkin [Mon, 29 May 2017 22:29:33 +0000 (18:29 -0400)]
drm/amd/display: allow taking split pipes during resource mapping

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: stop adjusting scl taps when scl ratio is one on dcn
Dmytro Laktyushkin [Thu, 25 May 2017 22:39:49 +0000 (18:39 -0400)]
drm/amd/display: stop adjusting scl taps when scl ratio is one 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: Don't commit surfaces if no stream
Harry Wentland [Thu, 25 May 2017 22:00:37 +0000 (18:00 -0400)]
drm/amd/display: Don't commit surfaces if no stream

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 NV12/NV21 as the YUV format
Shirish S [Thu, 25 May 2017 09:06:47 +0000 (14:36 +0530)]
drm/amd/display: update NV12/NV21 as the YUV format

This patch updates the YUV format supported to
NV12 and NV21 and hence updates the offsets.

BUG: SWDEV-119421
TEST: (On Chromium OS for Stoney Only)
    * Executed below tests to see YUV(underlay) & RGB planes on eDP
    plane_test --format XR24 --size 500x100 -p --format NV12 --size
    500x500

Signed-off-by: Shirish S <shirish.s@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: default spd packet to invalid
Jeff Smith [Fri, 19 May 2017 13:32:23 +0000 (08:32 -0500)]
drm/amd/display: default spd packet to invalid

Signed-off-by: Jeff Smith <whydoubt@gmail.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-order the luma chroma addres updation
Shirish S [Thu, 25 May 2017 09:10:21 +0000 (14:40 +0530)]
drm/amd/display: re-order the luma chroma addres updation

The DCE engine triggers scan as soon as the luma
address is updated, since it is updated before chroma address
the chroma data is not scanned out properly or in order.
This patch fixes this by re-ordering the same.

BUG: SWDEV-119421
TEST: (On Chromium OS for Stoney Only)
    * Executed below tests to see YUV(underlay) & RGB planes on eDP
      plane_test --format XR24 --size 500x100 -p --format NV12 --size 500x500
    * Chroma data is scanned properly.

Signed-off-by: Shirish S <shirish.s@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_links bug with empty DDI slot
Hersen Wu [Thu, 25 May 2017 14:55:54 +0000 (10:55 -0400)]
drm/amd/display: create_links bug with empty DDI slot

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: Don't guard x86 in Makefile
Harry Wentland [Thu, 25 May 2017 15:44:53 +0000 (11:44 -0400)]
drm/amd/display: Don't guard x86 in Makefile

make-kpkg doesn't seem to like it

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: Get rid of get_dm_commit_action
Andrey Grodzovsky [Wed, 24 May 2017 15:59:39 +0000 (11:59 -0400)]
drm/amd/display: Get rid of get_dm_commit_action

Use drm_atomic_crtc_needs_modeset instead.

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: fix NULL pointer in dm_commit_surfaces
Jerry Zuo [Wed, 24 May 2017 15:01:32 +0000 (11:01 -0400)]
drm/amd/display: fix NULL pointer in dm_commit_surfaces

Check if adding surface is failed to prevent NULL pointer deref.

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: Disable PSR entry abort to prevent intermittent freezes
Amy Zhang [Wed, 24 May 2017 18:53:50 +0000 (14:53 -0400)]
drm/amd/display: Disable PSR entry abort to prevent intermittent freezes

Signed-off-by: Amy Zhang <Amy.Zhang@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 FORCE_HDR timing flag
Zeyu Fan [Fri, 19 May 2017 19:52:00 +0000 (15:52 -0400)]
drm/amd/display: Add FORCE_HDR timing flag

Signed-off-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: Allow update stream without surface
Corbin McElhanney [Tue, 23 May 2017 19:26:57 +0000 (15:26 -0400)]
drm/amd/display: Allow update stream without surface

Passing NULL as surfaceUpdates to dc_update_surfaces_and_stream now
updates just the stream. Code that is dependent on srf_updates was moved
below the NULL check.

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: Add disable_psr debug flag
Charlene Liu [Tue, 23 May 2017 21:15:54 +0000 (17:15 -0400)]
drm/amd/display: Add disable_psr debug flag

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: Clean unused interface.
Andrey Grodzovsky [Tue, 23 May 2017 00:25:48 +0000 (20:25 -0400)]
drm/amd/display: Clean unused interface.

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: Fix handling of scaling and underscan.
Andrey Grodzovsky [Mon, 22 May 2017 21:55:38 +0000 (17:55 -0400)]
drm/amd/display: Fix handling of scaling and underscan.

Summury of changes:

1: Both in check and commit Connector properties were handled as
   part of for_each(crtc) loop while they shoud have been handled
   in a dedicated for_each(connector)
   loop since they are connector properties. Moved.

2: Removed hacky plane add in amdgpu_dm_connector_atomic_set_property
   to force iteration on plane forconnector property. This was
   causing double call to commit_surface_for_stream both in crtc loop
   and plane loop.
3: Remove middleman DC interface and  call dc_commit_surfaces_to_stream
   directly to increase code clarity.

Remove it from atomic_commit.

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: Limit DCN to x86 arch
Harry Wentland [Fri, 19 May 2017 02:13:19 +0000 (22:13 -0400)]
drm/amd/display: Limit DCN to x86 arch

DCN bw calcs currently rely on the following gcc options:
  -mhard-float -msse -mpreferred-stack-boundary=4

We probably shouldn't really try building this on architectures
other than x86.

CC: Alex Deucher <Alexander.Deucher@amd.com>
CC: Christian König <christian.koenig@amd.com>
CC: Michel Dänzer <michel.daenzer@amd.com>
CC: Tony Cheng <Tony.Cheng@amd.com>
CC: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
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: program scaler not called.
Andrey Grodzovsky [Fri, 19 May 2017 21:40:50 +0000 (17:40 -0400)]
drm/amd/display: program scaler not called.

Scaler code in case of UPDATE_TYPE_MED was not called
since new pipe context and current context are the same.

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: add always_scale debug flag to dc
Dmytro Laktyushkin [Fri, 19 May 2017 17:01:35 +0000 (13:01 -0400)]
drm/amd/display: add always_scale debug flag to dc

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/amdgpu: Enable DRIVER_ATOMIC flag for DAL.
Andrey Grodzovsky [Tue, 30 May 2017 20:49:59 +0000 (16:49 -0400)]
drm/amdgpu: Enable DRIVER_ATOMIC flag for DAL.

This flag is needed to pass several of IGT test cases.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/soc15: enable DC ip module for Raven
Alex Deucher [Fri, 2 Jun 2017 18:54:26 +0000 (14:54 -0400)]
drm/amdgpu/soc15: enable DC ip module for Raven

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: call amdgpu_dm_fini when hw_fini.
Rex Zhu [Mon, 22 May 2017 05:11:15 +0000 (13:11 +0800)]
drm/amd/display: call amdgpu_dm_fini when hw_fini.

to free up drm mode_config info.

fix issue: unload amdgpu, can't load amdgpu again.
[drm:drm_debugfs_init [drm]] *ERROR* Cannot create /sys/kernel/debug/dri/0
[drm:drm_minor_register [drm]] *ERROR* DRM: Failed to initialize /sys/kernel/debug/dri.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-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: No need to assert on stream_status
Harry Wentland [Fri, 19 May 2017 21:15:23 +0000 (17:15 -0400)]
drm/amd/display: No need to assert on stream_status

This will be NULL on a new stream. DC handles it gracefully.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Remove unused addr var in TG
Harry Wentland [Thu, 18 May 2017 15:40:53 +0000 (11:40 -0400)]
drm/amd/display: Remove unused addr var in TG

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Sun peng Li <Sunpeng.Li@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: fix flip register write sequence
Dmytro Laktyushkin [Thu, 18 May 2017 20:56:45 +0000 (16:56 -0400)]
drm/amd/display: fix flip register write sequence

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 GRPH_SURFACE_UPDATE_IMMEDIATE_EN field programming
Dmytro Laktyushkin [Thu, 18 May 2017 21:02:43 +0000 (17:02 -0400)]
drm/amd/display: remove GRPH_SURFACE_UPDATE_IMMEDIATE_EN field programming

This is causing asserts for dce 8 and 10 since they do not contain this
field. It is also unnecessary for later DCEs as it is left in it's
default state of 0

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: fix YUV surface address programming sequence
Tony Cheng [Thu, 18 May 2017 23:03:15 +0000 (19:03 -0400)]
drm/amd/display: fix YUV surface address programming sequence

need to program DCSURF_PRIMARY_SURFACE_ADDRESS last as HW automatically
latch rest of addr regs on write when SURFACE_UPDATE_LOCK is not used

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: Remove redundant condition.
Andrey Grodzovsky [Thu, 18 May 2017 17:35:22 +0000 (13:35 -0400)]
drm/amd/display: Remove redundant condition.

You cannot have modeset and flip in the same call for
same CRTC, in such case it will be set mode and set plane,
not a flip.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@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: Query for update plane type.
Andrey Grodzovsky [Thu, 18 May 2017 15:03:17 +0000 (11:03 -0400)]
drm/amd/display: Query for update plane type.

Use DC interface to query for plane update type
so in case of FULL update you flush any outstanding
commits.

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: Tidy up mem_input_program_surface_flip_and_addr()
Tom St Denis [Tue, 16 May 2017 14:22:05 +0000 (10:22 -0400)]
drm/amd/display: Tidy up mem_input_program_surface_flip_and_addr()

Signed-off-by: Tom St Denis <tom.stdenis@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: Tidy up dce120_clock_source_create()
Tom St Denis [Tue, 16 May 2017 14:22:04 +0000 (10:22 -0400)]
drm/amd/display: Tidy up dce120_clock_source_create()

Also change sizeof to be automatic based on type declaration.

Signed-off-by: Tom St Denis <tom.stdenis@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 indentation in dce120_tg_set_blank()
Tom St Denis [Tue, 16 May 2017 14:22:03 +0000 (10:22 -0400)]
drm/amd/display: Clean up indentation in dce120_tg_set_blank()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Make dce120_tg_is_blanked() more legible
Tom St Denis [Tue, 16 May 2017 14:22:02 +0000 (10:22 -0400)]
drm/amd/display: Make dce120_tg_is_blanked() more legible

Signed-off-by: Tom St Denis <tom.stdenis@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 indentation in dce120_tg_program_timing()
Tom St Denis [Tue, 16 May 2017 14:22:01 +0000 (10:22 -0400)]
drm/amd/display: Fix indentation in dce120_tg_program_timing()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Tidy up dce120_timing_generator_enable_advanced_request()
Tom St Denis [Tue, 16 May 2017 14:22:00 +0000 (10:22 -0400)]
drm/amd/display: Tidy up dce120_timing_generator_enable_advanced_request()

Simplify the function by removing identical looking code blocks.

Signed-off-by: Tom St Denis <tom.stdenis@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 ASSR enablement on DP to EDP converter
Ayyappa Chandolu [Fri, 12 May 2017 11:35:55 +0000 (17:05 +0530)]
drm/amd/display: Fix ASSR enablement on DP to EDP converter

ASSR mode is not enable when we connect eDP panel via DP to eDP converter.
connector_signal is coming as SIGNAL_TYPE_DISPLAY_PORT. Present code
ignoring panel_mode_edp for SIGNAL_TYPE_DISPLAY_PORT. Added checking
panel_mode_edp for all signals.

Signed-off-by: Ayyappa Chandolu <Ayyappa.Chandolu@amd.com>
Reviewed-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: Add missed wait_for_prev_commits.
Andrey Grodzovsky [Wed, 17 May 2017 22:05:36 +0000 (18:05 -0400)]
drm/amd/display: Add missed wait_for_prev_commits.

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: Implement input gamma LUT
Leo (Sunpeng) Li [Tue, 16 May 2017 20:07:30 +0000 (16:07 -0400)]
drm/amd/display: Implement input gamma LUT

1. Implemented dcn10_ipp_program_input_lut(), following the existing
   interface.
2. Added missing registers as needed
3. Change to REG_GET for *ram_select() funcs.
4. Removed gamma table init from DiagsDM::make_surface() for resolving
   CRC errors. Reason: Legacy LUT will be deprecated soon for Raven in
   favor of degamma/regamma.

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: Refactor use_lut() from dce110 to dce
Leo (Sunpeng) Li [Tue, 16 May 2017 17:52:28 +0000 (13:52 -0400)]
drm/amd/display: Refactor use_lut() from dce110 to dce

use_lut() checks if the input surface's pixel format is compatible with
a 256 entry LUT. This function can be used across different versions and
not just dce11.

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: revert dc_get_validate_context re-entrancy fix
Dmytro Laktyushkin [Wed, 17 May 2017 20:56:56 +0000 (16:56 -0400)]
drm/amd/display: revert dc_get_validate_context re-entrancy fix

Apply dc_get_validate_context re-entrancy fix to dc_validate_resources instead

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: make dc_get_validate_context re-entrant
Dmytro Laktyushkin [Wed, 17 May 2017 20:05:40 +0000 (16:05 -0400)]
drm/amd/display: make dc_get_validate_context re-entrant

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: Fix 5th display lightup on Vega10
Roman Li [Wed, 17 May 2017 16:07:30 +0000 (12:07 -0400)]
drm/amd/display: Fix 5th display lightup on Vega10

- fixing bug in calculation of reg offset for D5VGA_CONTROL

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: read VM settings from MMHUB
Tony Cheng [Wed, 17 May 2017 01:27:01 +0000 (21:27 -0400)]
drm/amd/display: read VM settings from MMHUB

instead of GC, as after GFX off, GC can be power gated any time

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: Unify loop for surface update and page flip.
Andrey Grodzovsky [Mon, 15 May 2017 22:55:38 +0000 (18:55 -0400)]
drm/amd/display: Unify loop for surface update and page flip.

Remove extra loop we have for page flips and do flips in same loop we do
for surface create/update.
Add documentation for synchronization between commits on different crtcs.
Rename function to have DM prefix.

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 missing GRPH_UPDATE_LOCK field macro for dce_mem_input
Dmytro Laktyushkin [Wed, 17 May 2017 14:59:53 +0000 (10:59 -0400)]
drm/amd/display: add missing GRPH_UPDATE_LOCK field macro for dce_mem_input

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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 dcn10 cursor set position hang
Leo (Sunpeng) Li [Tue, 16 May 2017 13:55:20 +0000 (09:55 -0400)]
drm/amd/display: Fix dcn10 cursor set position hang

Calling dcn10_cursor_set_position() before dcn10_cursor_set_attributes()
with invalid (0-value) attributes can cause the ASIC to hang. This fix
checks that address.quadpart is non-zero within set_position before calling
set_attributes.

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@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 unused interface.
Andrey Grodzovsky [Mon, 15 May 2017 18:47:02 +0000 (14:47 -0400)]
drm/amd/display: Clean unused interface.

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 dc_update_surfaces_for_stream for flip.
Andrey Grodzovsky [Mon, 15 May 2017 17:59:31 +0000 (13:59 -0400)]
drm/amd/display: Use dc_update_surfaces_for_stream for flip.

Today we use special interface for flip because of fear of cuncurency issues
over dc->current_ctx. This should be no longer an issue when flipping on
multiple CRTCs concurently since for fast update (as flip is) no new context
is created and the exsisitng is not destroyed. For full updates case when
removing or adding streams on once CRTC while flipping on another
Adding all current active CRTC's states to the atomic commit in
amdgpu_dm_atomic_check will garntee that any such full update commit
will wait for completion of any outstanding flip.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@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: dce 8 - 12 mem_input refactor to new style
Dmytro Laktyushkin [Mon, 15 May 2017 12:31:51 +0000 (08:31 -0400)]
drm/amd/display: dce 8 - 12 mem_input refactor to new 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: Disable ABM when eDP is disabled
Amy Zhang [Fri, 12 May 2017 19:54:29 +0000 (15:54 -0400)]
drm/amd/display: Disable ABM when eDP is disabled

- Add immediate ABM disable when eDP is disabled
- Fix purple screen when ABM is mistakenly enabled
on non eDP display

Signed-off-by: Amy Zhang <Amy.Zhang@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 slow FPS.
Andrey Grodzovsky [Fri, 12 May 2017 20:19:15 +0000 (16:19 -0400)]
drm/amd/display: Fix slow FPS.

Typo in expresion.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@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: fix mpo blanking out on one of planes being set not visible
Dmytro Laktyushkin [Thu, 11 May 2017 21:15:14 +0000 (17:15 -0400)]
drm/amd/display: fix mpo blanking out on one of planes being set not visible

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: Program CSC Mode For BT2020
Amy Zhang [Thu, 11 May 2017 21:13:20 +0000 (17:13 -0400)]
drm/amd/display: Program CSC Mode For BT2020

- Add BT2020 color space in the set output csc default

Signed-off-by: Amy Zhang <Amy.Zhang@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 duplicate entry from log_mask
Harry Wentland [Mon, 15 May 2017 18:23:09 +0000 (14:23 -0400)]
drm/amd/display: Remove duplicate entry from log_mask

As pointed out by kbuild test robot and Julia Lawall.

CC: Julia Lawall <julia.lawall@lip6.fr>
CC: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>