openwrt/staging/blogic.git
7 years agodrm/amd/display: Remove power gating debug flags
Harry Wentland [Thu, 19 Jan 2017 23:58:33 +0000 (18:58 -0500)]
drm/amd/display: Remove power gating debug flags

They're not used anywhere

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Don't reserve pipe for underlay on ASIC without underlay
Harry Wentland [Mon, 23 Jan 2017 16:49:24 +0000 (11:49 -0500)]
drm/amd/display: Don't reserve pipe for underlay on ASIC without underlay

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Jordan Lazare <Jordan.Lazare@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: add missing dcc update on flip call
Dmytro Laktyushkin [Tue, 17 Jan 2017 22:40:13 +0000 (17:40 -0500)]
drm/amd/display: add missing dcc update on flip call

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-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 index in irq init loop
Andrey Grodzovsky [Wed, 19 Apr 2017 17:55:35 +0000 (13:55 -0400)]
drm/amd/display: Clean index in irq init loop

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Register on VLBLANK ISR.
Andrey Grodzovsky [Wed, 19 Apr 2017 17:29:11 +0000 (13:29 -0400)]
drm/amd/display: Register on VLBLANK ISR.

Switch from VUPDATE to VBLANK.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-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: Add interrupt entries for VBLANK isr.
Andrey Grodzovsky [Mon, 16 Jan 2017 21:16:22 +0000 (16:16 -0500)]
drm/amd/display: Add interrupt entries for VBLANK isr.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-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: Add missing MI masks
Leon Elazar [Tue, 17 Jan 2017 21:16:04 +0000 (16:16 -0500)]
drm/amd/display: Add missing MI masks

This will fix the memory Input programing with MST tiled display.
This Fix should fix connectivity problems with MST tiled Display

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Acked-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: Fix missing conditions in hw sequencer.
Zeyu Fan [Tue, 17 Jan 2017 20:14:11 +0000 (15:14 -0500)]
drm/amd/display: Fix missing conditions in hw sequencer.

Signed-off-by: Zeyu Fan <Zeyu.Fan@amd.com>
Acked-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: rename BGRA8888 to ABGR8888
Tony Cheng [Tue, 17 Jan 2017 01:50:47 +0000 (20:50 -0500)]
drm/amd/display: rename BGRA8888 to ABGR8888

DC actually support ABGR8888 instead of BGRA8888 (R/B swap rather than endian swap) ,
rename to avoid confusion

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Remove meta_pitch
Dmytro Laktyushkin [Tue, 17 Jan 2017 16:18:55 +0000 (11:18 -0500)]
drm/amd/display: Remove meta_pitch

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-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: refactor clk_resync to avoid assertion
Tony Cheng [Tue, 17 Jan 2017 01:37:08 +0000 (20:37 -0500)]
drm/amd/display: refactor clk_resync to avoid assertion

- not all DCE has PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE bit defined.

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: HDR Enablement For Applications
Amy Zhang [Fri, 13 Jan 2017 21:49:26 +0000 (16:49 -0500)]
drm/amd/display: HDR Enablement For Applications

- Made sure dest color space is updated in stream and info frame
- Optimized segment distribution algorithm for regamma mapping

Signed-off-by: Amy Zhang <Amy.Zhang@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Set default degamma to sRGB instead of bypass
Amy Zhang [Fri, 13 Jan 2017 21:19:36 +0000 (16:19 -0500)]
drm/amd/display: Set default degamma to sRGB instead of bypass

Signed-off-by: Amy Zhang <Amy.Zhang@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: enable clock gating and dchubp power gating
Tony Cheng [Fri, 6 Jan 2017 20:55:47 +0000 (15:55 -0500)]
drm/amd/display: enable clock gating and dchubp power gating

also refactor to clean reduce loc to achieve same logic

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: remove calculate_adjustments in conversion.h
Tony Cheng [Sun, 15 Jan 2017 01:56:08 +0000 (20:56 -0500)]
drm/amd/display: remove calculate_adjustments in conversion.h

- these are moved to color module

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: remove dead code
Tony Cheng [Sun, 15 Jan 2017 01:56:08 +0000 (20:56 -0500)]
drm/amd/display: remove dead code

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: remove SIGNAL_TYPE_WIRELESS
Tony Cheng [Sun, 15 Jan 2017 01:48:21 +0000 (20:48 -0500)]
drm/amd/display: remove SIGNAL_TYPE_WIRELESS

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: remove hw_info_frame
Tony Cheng [Sun, 15 Jan 2017 01:36:14 +0000 (20:36 -0500)]
drm/amd/display: remove hw_info_frame

- construct using encoder_info_frame directly

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: remove hw_crtc_timing
Tony Cheng [Sat, 14 Jan 2017 23:57:57 +0000 (18:57 -0500)]
drm/amd/display: remove hw_crtc_timing

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: remove un-used defines and dead code
Tony Cheng [Sat, 14 Jan 2017 16:46:53 +0000 (11:46 -0500)]
drm/amd/display: remove un-used defines and dead code

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: assert if mask is 0 in set_reg_field_value_ex
Tony Cheng [Sat, 14 Jan 2017 06:44:52 +0000 (01:44 -0500)]
drm/amd/display: assert if mask is 0 in set_reg_field_value_ex

-  mask = 0 means something is wrong in caller and no register field will be updated

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: mode change without breaking unaffected streams
Tony Cheng [Fri, 13 Jan 2017 04:18:33 +0000 (23:18 -0500)]
drm/amd/display: mode change without breaking unaffected streams

- include clock constraint logic in validate
- in dc_commit_streams, include surfaces of unaffected streams

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Use pflip prepare and submit parts (v2)
Andrey Grodzovsky [Wed, 9 Nov 2016 10:41:51 +0000 (05:41 -0500)]
drm/amd/display: Use pflip prepare and submit parts (v2)

Use new functions so flip failures can be gracefully handled

v2:
Avoid -EINVAL returned from amdgpu_crtc_prepare_flip in some
error cases, it is not allowed according to expected
return values for atomic_commit hook.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: No audio output heard from DP panel
Hersen Wu [Fri, 13 Jan 2017 15:10:26 +0000 (10:10 -0500)]
drm/amd/display: No audio output heard from DP panel

Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Eagle Yeh <eagle.yeh@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fixing some fallout from dc_target removal
Leon Elazar [Wed, 11 Jan 2017 19:33:36 +0000 (14:33 -0500)]
drm/amd/display: Fixing some fallout from dc_target removal

Also avoid allocating memory dce110_set_output_transfer_func
if not needed

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Acked-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: Disable Modules at Runtime
Anthony Koo [Thu, 12 Jan 2017 19:24:11 +0000 (14:24 -0500)]
drm/amd/display: Disable Modules at Runtime

Add NULL check in modules

Signed-off-by: Anthony Koo <anthony.koo@amd.com>
Acked-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: Output Transfer Function Regamma Refactor
Amy Zhang [Thu, 5 Jan 2017 22:12:20 +0000 (17:12 -0500)]
drm/amd/display: Output Transfer Function Regamma Refactor

- Create translation function to translate logical format to hw format
- Refactor to use transfer function in dc instead of input gamma

Signed-off-by: Amy Zhang <Amy.Zhang@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Null check clock source.
Yongqiang Sun [Wed, 11 Jan 2017 20:52:06 +0000 (15:52 -0500)]
drm/amd/display: Null check clock source.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-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: Remove dc_target object
Aric Cyr [Thu, 29 Dec 2016 20:27:12 +0000 (15:27 -0500)]
drm/amd/display: Remove dc_target object

dc_target does not fit well into DRM framework so removed it.
This will prevent the driver from leveraging the pipe-split
code for tiled displays, so will have to be handled at a higher
level.  Most places that used dc_target now directly use dc_stream
instead.

Signed-off-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: Pass visible flag into surface programming
Yongqiang Sun [Mon, 9 Jan 2017 14:42:33 +0000 (09:42 -0500)]
drm/amd/display: Pass visible flag into surface programming

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: Add Polaris12 to bw_calc
Joshua Aberback [Tue, 10 Jan 2017 19:05:49 +0000 (14:05 -0500)]
drm/amd/display: Add Polaris12 to bw_calc

Signed-off-by: Joshua Aberback <Joshua.Aberback@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 DTO as clock on DP if not
Ding Wang [Tue, 10 Jan 2017 17:47:37 +0000 (12:47 -0500)]
drm/amd/display: Use DTO as clock on DP if not

Use DVO as pixel clock for DP before enabling link
PHY. Otherwise, when switching from HDMI passive dongle
to DP on the same connector, the PHY PLL is used as
pixel clock, and CRTC would stop working.

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: start using linux hdmi header
Dave Airlie [Mon, 9 Jan 2017 23:33:32 +0000 (09:33 +1000)]
drm/amd/display: start using linux hdmi header

DAL has defines for things, and it doesn't even use them itself.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: drop min/max wrappers
Dave Airlie [Mon, 9 Jan 2017 22:35:47 +0000 (08:35 +1000)]
drm/amd/display: drop min/max wrappers

These aren't needed, and aren't really used in too many places.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Support 64-bit Polaris11 5k VSR
Joshua Aberback [Mon, 9 Jan 2017 21:26:58 +0000 (16:26 -0500)]
drm/amd/display: Support 64-bit Polaris11 5k VSR

- pass full asic_id info into bw_calc_init instead of only version enum
- 64-bit Polaris11 needs an extra microsecond of dmif_urgent_latency
- add helper to convert from asic_id.family to bw_calc version enum

Signed-off-by: Joshua Aberback <Joshua.Aberback@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: When signal type of sink is none, use link type for stream
Joshua Aberback [Mon, 9 Jan 2017 19:43:08 +0000 (14:43 -0500)]
drm/amd/display: When signal type of sink is none, use link type for stream

Signed-off-by: Joshua Aberback <Joshua.Aberback@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 blank functionality
Hersen Wu [Fri, 6 Jan 2017 21:23:18 +0000 (16:23 -0500)]
drm/amd/display: set blank functionality

1. remove the sleep mechanism while set_blank true from
the timing generator.
Since Hw sequencer is the one that manages the flow
he will be responsible for wait for blanck in a critical places.

Signed-off-by: Leon Elazar <leon.elazar@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: blank mechanism for supporting MPO
Leon Elazar [Thu, 5 Jan 2017 22:47:43 +0000 (17:47 -0500)]
drm/amd/display: blank mechanism for supporting MPO

blank/unblanck functionality apply_ctx_for_surface will update planes visibility
by manipulating Blender and CRTC HW modules.

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Reviewed-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 cursor disappearing after resume
Arindam Nath [Mon, 9 Jan 2017 06:20:27 +0000 (11:50 +0530)]
drm/amd/display: fix cursor disappearing after resume

Since during suspend, the cursor registers are cleared,
once the system resumes back, the cursor remains disabled.
cursor_set_attributes() only sets the cursor attributes
along with cursor size and surface address, but does not
enable the cursor back on.

We need to save the current cursor location so that
we can resume back to the same location. This is done
in dm_crtc_cursor_move(), where we save the current
cursor location into cursor_x and cursor_y. Later during
resume we use these same values to set the cursor
position along with cursor attributes.

Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/virt: disable dc
Xiangliang Yu [Tue, 10 Jan 2017 09:34:52 +0000 (17:34 +0800)]
drm/amdgpu/virt: disable dc

Virtualization don't need the dc, disable it.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Don't fail validation for SIGNAL_TYPE_VIRTUAL
Yongqiang Sun [Fri, 6 Jan 2017 16:21:47 +0000 (11:21 -0500)]
drm/amd/display: Don't fail validation for SIGNAL_TYPE_VIRTUAL

Signed-off-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 HDMI deep color debug flag
Tony Cheng [Thu, 5 Jan 2017 17:59:34 +0000 (12:59 -0500)]
drm/amd/display: remove HDMI deep color debug flag

Signed-off-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 Infoframe byte 28-31 doesn't get written out to register
Tony Cheng [Thu, 5 Jan 2017 16:29:27 +0000 (11:29 -0500)]
drm/amd/display: fix Infoframe byte 28-31 doesn't get written out to register

Signed-off-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: Check hdr support before setting.
Yongqiang Sun [Thu, 5 Jan 2017 16:26:59 +0000 (11:26 -0500)]
drm/amd/display: Check hdr support before setting.

In case of programing info frame to
some monitors don't support HDR, it will
result in black screen or corruption when
unplug monitor.
By checking hdr flag to avoid unnecessary
setting for monitors don't support HDR.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix wrong index bug in set_avi_info_frame
Harry Wentland [Wed, 4 Jan 2017 23:54:29 +0000 (18:54 -0500)]
drm/amd/display: Fix wrong index bug in set_avi_info_frame

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: Fix warnings in DC
Harry Wentland [Wed, 4 Jan 2017 23:48:07 +0000 (18:48 -0500)]
drm/amd/display: Fix warnings in DC

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: Fix misleading indentation bug in link_encoder
Harry Wentland [Wed, 4 Jan 2017 23:43:04 +0000 (18:43 -0500)]
drm/amd/display: Fix misleading indentation bug in link_encoder

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: Remove unused function in gamma_calcs
Harry Wentland [Wed, 4 Jan 2017 23:41:25 +0000 (18:41 -0500)]
drm/amd/display: Remove unused function in gamma_calcs

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: [MST] Fix startup sequence v3.
Andrey Grodzovsky [Thu, 29 Dec 2016 18:21:31 +0000 (13:21 -0500)]
drm/amd/display: [MST] Fix startup sequence v3.

Problem: MST topology discovery was started before fbdev
init causing kernel panic on boot.
Fix: Defer MST to late init hook, after fbdev strucutres
already initilized.

v2: Add explicit late_init hook function in DAL.
v3:
Change signature of detect_mst_link_for_all_connectors
from void* to drm_dev*

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix DP PHY test pre-emphasis not set properly
Hersen Wu [Wed, 4 Jan 2017 15:22:35 +0000 (10:22 -0500)]
drm/amd/display: Fix DP PHY test pre-emphasis not set properly

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: fix gamma for dpms usecase
Roman Li [Tue, 3 Jan 2017 18:46:45 +0000 (13:46 -0500)]
drm/amd/display: fix gamma for dpms usecase

For dpms usecase we need to set surface transfer function
regardless of gamma set 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: limit HBR3 support to Polaris and up
Tony Cheng [Tue, 3 Jan 2017 17:40:40 +0000 (12:40 -0500)]
drm/amd/display: limit HBR3 support to Polaris and up

- also fix YCbCr420 supported on Polaris and up

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: simplify link_encoder
Tony Cheng [Thu, 29 Dec 2016 15:56:32 +0000 (10:56 -0500)]
drm/amd/display: simplify link_encoder

- remove unnecessary feature flags
- remove wireless and VGA validation

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 link retraining hw sequence for auto test
Hersen Wu [Thu, 29 Dec 2016 19:58:54 +0000 (14:58 -0500)]
drm/amd/display: Fix link retraining hw sequence for auto test

Signed-off-by: Hersen Wu <hersenxs.wu@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 link retraining hw sequence
Zeyu Fan [Fri, 23 Dec 2016 21:53:12 +0000 (16:53 -0500)]
drm/amd/display: Fix link retraining hw sequence

Signed-off-by: Zeyu Fan <Zeyu.Fan@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: Remove unused color and power modules
Harry Wentland [Thu, 29 Dec 2016 20:27:07 +0000 (15:27 -0500)]
drm/amd/display: Remove unused color and power modules

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: enable option to disable HDR related updates.
Tony Cheng [Fri, 23 Dec 2016 16:08:43 +0000 (11:08 -0500)]
drm/amd/display: enable option to disable HDR related updates.

Signed-off-by: Tony Cheng <tony.cheng@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 color module crash when hotplug monitors.
Anthony Koo [Fri, 23 Dec 2016 20:43:04 +0000 (15:43 -0500)]
drm/amd/display: Fix color module crash when hotplug monitors.

Assume we have two monitors, and monitor 0 is unplugged.
This shifts the internal state of index 1 to index 0 by memcpy.
This means there are two copies of the gamma pointer previously
owned by state[1].

When hotplug occurs, this re-assigns the new display with state[1],
which has some garbage left over from before, including the
gamma pointer.

We should correctly clear unused states and re-initialize correctly.

Also, due to async nature of the hotplug and other events like commit,
we also need to safe guard against sink that has been removed.

Signed-off-by: Anthony Koo <anthony.koo@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@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 HBR3 and TPS4 capable flags
Hersen Wu [Fri, 23 Dec 2016 20:13:13 +0000 (15:13 -0500)]
drm/amd/display: set HBR3 and TPS4 capable flags

Signed-off-by: Hersen Wu <hersenxs.wu@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: Set gamma to NULL at release
Yongqiang Sun [Fri, 23 Dec 2016 15:18:08 +0000 (10:18 -0500)]
drm/amd/display: Set gamma to NULL at release

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: Add missing function to fix crash for DP Test pattern 4
Hersen Wu [Fri, 23 Dec 2016 15:39:22 +0000 (10:39 -0500)]
drm/amd/display: Add missing function to fix crash for DP Test pattern 4

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: Don't use target before null check
Harry Wentland [Fri, 23 Dec 2016 15:53:24 +0000 (10:53 -0500)]
drm/amd/display: Don't use target before null check

It might blow up.

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: debug option to disable color module fucntionality
Tony Cheng [Fri, 23 Dec 2016 12:20:53 +0000 (07:20 -0500)]
drm/amd/display: debug option to disable color module fucntionality

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: debug opt disable hdmi deep color
Tony Cheng [Fri, 23 Dec 2016 12:12:19 +0000 (07:12 -0500)]
drm/amd/display: debug opt disable hdmi deep color

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: DAL3: HDR10 Infoframe encoding
Andrew Wong [Thu, 22 Dec 2016 20:41:30 +0000 (15:41 -0500)]
drm/amd/display: DAL3: HDR10 Infoframe encoding

- Add HDR metadata struct
- Add register programming calculations
- Added HDR metadata to surface and update_surface
- Add HDR info packet programming for DP port

Signed-off-by: Andrew Wong <andrew.wong1@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: Allow multiple instance of DTO regs
Tony Cheng [Thu, 22 Dec 2016 19:54:50 +0000 (14:54 -0500)]
drm/amd/display: Allow multiple instance of DTO regs

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Pass adev to fill_plane_attr
Andrey Grodzovsky [Thu, 15 Dec 2016 05:53:04 +0000 (00:53 -0500)]
drm/amd/display: Pass adev to fill_plane_attr

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add refcount debug assert
Andrey Grodzovsky [Tue, 20 Dec 2016 23:01:30 +0000 (18:01 -0500)]
drm/amd/display: Add refcount debug assert

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fixed crash caused by unnecessary clock source in split pipe.
Yongqiang Sun [Thu, 22 Dec 2016 18:07:11 +0000 (13:07 -0500)]
drm/amd/display: Fixed crash caused by unnecessary clock source in split pipe.

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: Fixed split update bug.
Yongqiang Sun [Thu, 22 Dec 2016 15:48:19 +0000 (10:48 -0500)]
drm/amd/display: Fixed split update bug.

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 licensing header
Harry Wentland [Thu, 22 Dec 2016 15:25:57 +0000 (10:25 -0500)]
drm/amd/display: Fix licensing header

Signed-off-by: Harry Wentland <harry.wentland@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: Fixed crash
Yongqiang Sun [Wed, 21 Dec 2016 21:48:51 +0000 (16:48 -0500)]
drm/amd/display: Fixed crash

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: reset transfer_func to NULL on release
Yongqiang Sun [Wed, 21 Dec 2016 16:13:48 +0000 (11:13 -0500)]
drm/amd/display: reset transfer_func to NULL on release

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: don't crash if stream is NULL when trying to share clocks
Yongqiang Sun [Wed, 21 Dec 2016 16:16:48 +0000 (11:16 -0500)]
drm/amd/display: don't crash if stream is NULL when trying to share clocks

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: Implement gamma correction using input LUT
Aric Cyr [Wed, 21 Dec 2016 01:24:24 +0000 (20:24 -0500)]
drm/amd/display: Implement gamma correction using input LUT

The dc_gamma in dc_surface will be programmed to the input
LUT if provided.  If dc_gamma is not provided in dc_surface
regamma may be used to emulate gamma.

Some refactor and cleanup included as well.

Signed-off-by: Aric Cyr <aric.cyr@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: Reset gamma to NULL after release
Anthony Koo [Tue, 20 Dec 2016 23:48:11 +0000 (18:48 -0500)]
drm/amd/display: Reset gamma to NULL after release

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: track cursor width in ipp
Tony Cheng [Tue, 20 Dec 2016 15:54:38 +0000 (10:54 -0500)]
drm/amd/display: track cursor width in ipp

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 dcc param to surface
Leon Elazar [Mon, 19 Dec 2016 17:00:05 +0000 (12:00 -0500)]
drm/amd/display: Add dcc param to surface

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 clock source refactor
Dmytro Laktyushkin [Mon, 19 Dec 2016 20:41:49 +0000 (15:41 -0500)]
drm/amd/display: minor clock source refactor

This should make it easier to share code with newer ASICs

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 pitch to cursor attributes
Tony Cheng [Mon, 19 Dec 2016 23:54:15 +0000 (18:54 -0500)]
drm/amd/display: add pitch to cursor attributes

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: 4k split black out due to incorrect cursor
Tony Cheng [Mon, 19 Dec 2016 17:54:40 +0000 (12:54 -0500)]
drm/amd/display: 4k split black out due to incorrect cursor

- add handling to program both cursor for left and right pipe
- add guard to disable cursor in case where cursor isn't visible to prevent pipe hang

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix Regamma end point
Anthony Koo [Mon, 19 Dec 2016 20:16:12 +0000 (15:16 -0500)]
drm/amd/display: Fix Regamma end point

1. HW register programmed to wrong value
2. End slope for PQ case not calculated correctly

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: Framework for degamma and regramma through color module
Amy Zhang [Mon, 12 Dec 2016 21:57:40 +0000 (16:57 -0500)]
drm/amd/display: Framework for degamma and regramma through color module

Signed-off-by: Amy Zhang <Amy.Zhang@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: assign correct enum for edp revision
Dave Airlie [Tue, 13 Dec 2016 06:41:12 +0000 (16:41 +1000)]
drm/amd/display: assign correct enum for edp revision

There are 2 edp enum revisions, no idea why, drop one, and just
assign 1.1 to the default value.

Signed-off-by: Dave Airlie <airlied@redhat.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: port to using drm dpcd defines
Dave Airlie [Tue, 13 Dec 2016 06:41:11 +0000 (16:41 +1000)]
drm/amd/display: port to using drm dpcd defines

We only keep one list of these defines in the kernel, so we should use it.

Signed-off-by: Dave Airlie <airlied@redhat.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 dpcd structs into dp_types header
Harry Wentland [Mon, 19 Dec 2016 19:10:53 +0000 (14:10 -0500)]
drm/amd/display: Move dpcd structs into dp_types header

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: drop setmode complete notifier
Dave Airlie [Tue, 13 Dec 2016 06:41:09 +0000 (16:41 +1000)]
drm/amd/display: drop setmode complete notifier

Signed-off-by: Dave Airlie <airlied@redhat.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: drop get platform info
Dave Airlie [Tue, 13 Dec 2016 06:41:08 +0000 (16:41 +1000)]
drm/amd/display: drop get platform info

Signed-off-by: Dave Airlie <airlied@redhat.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: drop register logger and pid/tgid getters
Dave Airlie [Tue, 13 Dec 2016 06:41:07 +0000 (16:41 +1000)]
drm/amd/display: drop register logger and pid/tgid getters

While I'm sure this is useful I think we should bring it back later.

It's usage of pid/tgid is incorrect, you have to get/put
pid/tgids not store them away.

Signed-off-by: Dave Airlie <airlied@redhat.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 some unused wrappers
Dave Airlie [Tue, 13 Dec 2016 06:41:06 +0000 (16:41 +1000)]
drm/amd/display: remove some unused wrappers

Signed-off-by: Dave Airlie <airlied@redhat.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 dc hub - this seems unused.
Dave Airlie [Tue, 13 Dec 2016 06:41:05 +0000 (16:41 +1000)]
drm/amd/display: remove dc hub - this seems unused.

Signed-off-by: Dave Airlie <airlied@redhat.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 programming of gamma end points
Anthony Koo [Fri, 16 Dec 2016 17:12:03 +0000 (12:12 -0500)]
drm/amd/display: Fix programming of gamma end points

Signed-off-by: Anthony Koo <anthony.koo@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 distribution of segments for PQ
Anthony Koo [Fri, 16 Dec 2016 17:12:03 +0000 (12:12 -0500)]
drm/amd/display: Fix distribution of segments for PQ

For PQ case, redistribution of segments should be done differently
for FP16 case in order to handle content above FP16 value of 1.0

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: OPP refactor and consolidation for DCE.
Zeyu Fan [Wed, 14 Dec 2016 23:54:41 +0000 (18:54 -0500)]
drm/amd/display: OPP refactor and consolidation for DCE.

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: Implement PQ curve based on output transfer function
Anthony Koo [Fri, 16 Dec 2016 17:12:03 +0000 (12:12 -0500)]
drm/amd/display: Implement PQ curve based on output transfer function

Refactor part 5 - Regamma programming should be dependent on Output
transfer function type

Program sRGB gamma or PQ transfer function based on output transfer
function.

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: Refactor to move gamma correction to module
Anthony Koo [Fri, 16 Dec 2016 15:43:21 +0000 (10:43 -0500)]
drm/amd/display: Refactor to move gamma correction to module

Refactor part 4 - Moving input gamma correction programming into color module

DM will translate to dc_gamma structure, but programming will be moved into
the color module. Later, this will allow gamma correction to be added on top of
in/out transfer function curves.

Signed-off-by: Anthony Koo <anthony.koo@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: define reg helpers to update registers with 8 and 9 fields
Dmytro Laktyushkin [Thu, 15 Dec 2016 18:53:15 +0000 (13:53 -0500)]
drm/amd/display: define reg helpers to update registers with 8 and 9 fields

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 output transfer function to stream
Anthony Koo [Thu, 15 Dec 2016 17:09:46 +0000 (12:09 -0500)]
drm/amd/display: Refactor output transfer function to stream

Refactor part 3 - Moving output transfer function from surface to stream

Split HWSS to program degamma and regamma separately.
Degamma should be dependent on input transfer function.
And Regamma should depend on the desired output transfer function.

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 hotplug regression after code refactor
Roman Li [Thu, 15 Dec 2016 16:51:09 +0000 (11:51 -0500)]
drm/amd/display: fix hotplug regression after code refactor

The condition logic of REG_WAIT in dce110_stream_encoder_dp_blank()
got inverted after refactoring.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add debug option to disable dmcu
Yongqiang Sun [Thu, 15 Dec 2016 15:50:48 +0000 (10:50 -0500)]
drm/amd/display: Add debug option to disable dmcu

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>