openwrt/staging/blogic.git
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>
7 years agodrm/amd/display: add explanation for surface_update_type
Dmytro Laktyushkin [Wed, 10 May 2017 22:24:24 +0000 (18:24 -0400)]
drm/amd/display: add explanation for surface_update_type

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 scaling info based surface update type check
Dmytro Laktyushkin [Wed, 10 May 2017 22:05:02 +0000 (18:05 -0400)]
drm/amd/display: fix scaling info based surface update type check

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 yuv pixel formats to pixel_format_to_bpp()
Dmytro Laktyushkin [Wed, 10 May 2017 15:35:07 +0000 (11:35 -0400)]
drm/amd/display: add yuv pixel formats to pixel_format_to_bpp()

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 scaling calculation for proper surface input format
Dmytro Laktyushkin [Tue, 9 May 2017 20:39:26 +0000 (16:39 -0400)]
drm/amd/display: fix scaling calculation for proper surface input format

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: DCE12 num_timing_generators should be 6
Harry Wentland [Fri, 5 May 2017 18:57:12 +0000 (14:57 -0400)]
drm/amd/display: DCE12 num_timing_generators should be 6

We should also use it to determine pipe count.

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 output transfer function to stream updates
Amy Zhang [Tue, 9 May 2017 18:45:54 +0000 (14:45 -0400)]
drm/amd/display: Move output transfer function to stream updates

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 freesync not working on raven
Corbin McElhanney [Tue, 9 May 2017 16:00:24 +0000 (12:00 -0400)]
drm/amd/display: fix freesync not working on raven

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: enable watermark range reporting to pplib
Dmytro Laktyushkin [Mon, 8 May 2017 15:26:43 +0000 (11:26 -0400)]
drm/amd/display: enable watermark range reporting to pplib

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: single channel bandwidth verses dual channel bandwidth
Charlene Liu [Mon, 8 May 2017 21:46:57 +0000 (17:46 -0400)]
drm/amd/display: single channel bandwidth verses dual channel bandwidth

DPM0, FCLK=MCLK, single channel bandwidth = dual channel bandwidth
for the rest of the DPM levels, single channel bandwidth = 1/2  dual channel bandwidth

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: Use MED update type if clip position changes
Harry Wentland [Thu, 27 Apr 2017 21:13:34 +0000 (17:13 -0400)]
drm/amd/display: Use MED update type if clip position changes

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add 64KB_S_T and 64KB_D_T swizzle mode.
Yongqiang Sun [Fri, 5 May 2017 20:33:11 +0000 (16:33 -0400)]
drm/amd/display: Add 64KB_S_T and 64KB_D_T swizzle mode.

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: switch to using calc_clk and cur_clk for dcn bw setting
Dmytro Laktyushkin [Wed, 3 May 2017 15:40:40 +0000 (11:40 -0400)]
drm/amd/display: switch to using calc_clk and cur_clk for dcn bw setting

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 bw related variable structure in val_ctx
Dmytro Laktyushkin [Tue, 2 May 2017 21:29:48 +0000 (17:29 -0400)]
drm/amd/display: refactor bw related variable structure in val_ctx

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: prevent assert on error of 1 in calc_freesync_range
Dmytro Laktyushkin [Fri, 5 May 2017 19:07:55 +0000 (15:07 -0400)]
drm/amd/display: prevent assert on error of 1 in calc_freesync_range

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 race.
Andrey Grodzovsky [Fri, 5 May 2017 15:30:06 +0000 (11:30 -0400)]
drm/amd/display: Fix race.

Problem :
A race between two adjecent page flips makes the earlier one
to release an alocated frame buffer for the subsequent one -
since there are 2 frambuffer swapped back and forth between flips,
the 'new' fb of the later flip is actually the 'previous' fb for the earlier flip.
Fix:
Don't set fb->address = 0 in cleanup hook, this is unnecessery and
erases the newly cached adress that was set in prepare_fb of the second
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: ifdef some code only needed for DCN
Harry Wentland [Wed, 3 May 2017 18:21:37 +0000 (14:21 -0400)]
drm/amd/display: ifdef some code only needed for DCN

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: Implement support for backlight optimization
Anthony Koo [Thu, 4 May 2017 18:09:09 +0000 (14:09 -0400)]
drm/amd/display: Implement support for backlight optimization

- Add functionality to get real hw backlight level as opposed to user
level, meaning the level that takes into account backlight ramping
over time and backlight reduction due to Varibright
- Add backlight optimization which allows for a second OS state
that is able to control ABM

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: Continue with stream enable if DP link training fails.
Ken Chalmers [Thu, 4 May 2017 17:34:55 +0000 (13:34 -0400)]
drm/amd/display: Continue with stream enable if DP link training fails.

Not necessarily a fatal problem - some monitors will recover and show
the stream anyway if link training fails.

Signed-off-by: Ken Chalmers <ken.chalmers@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: do not set_mpc_tree if tree is already setup
Tony Cheng [Tue, 2 May 2017 21:01:10 +0000 (17:01 -0400)]
drm/amd/display: do not set_mpc_tree if tree is already setup

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: use signal type to decide whether to set backlight
Anthony Koo [Wed, 3 May 2017 19:19:07 +0000 (15:19 -0400)]
drm/amd/display: use signal type to decide whether to set backlight

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: Allow MPO on Raven
Leon Elazar [Fri, 24 Mar 2017 19:46:24 +0000 (15:46 -0400)]
drm/amd/display: Allow MPO on Raven

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: Only apply ctx for specific surface.
Yongqiang Sun [Wed, 3 May 2017 14:25:51 +0000 (10:25 -0400)]
drm/amd/display: Only apply ctx for specific surface.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: bw debug options now apply to dml as well
Dmytro Laktyushkin [Tue, 2 May 2017 20:58:39 +0000 (16:58 -0400)]
drm/amd/display: bw debug options now apply to dml as well

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: Keep DVI_SINGLE_LINK signal if low clk
Harry Wentland [Tue, 9 May 2017 14:41:42 +0000 (10:41 -0400)]
drm/amd/display: Keep DVI_SINGLE_LINK signal if low clk

If user is using DVI->HDMI dongle dual link signal might pose a
problem. Keep single link signal type if clk is lower than
max tmds clk.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: i2c/aux Remove link index.
Andrey Grodzovsky [Sun, 30 Apr 2017 13:20:55 +0000 (09:20 -0400)]
drm/amd/display: i2c/aux Remove link index.

Link index is an unnecessery level of inderection when
calling from kernel i2c/aux transfer into DAL.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Don't call PSR func if DMCU is off
Harry Wentland [Wed, 10 May 2017 19:56:17 +0000 (15:56 -0400)]
drm/amd/display: Don't call PSR func if DMCU is off

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/display: fix semicolon.cocci warnings
kbuild test robot [Thu, 11 May 2017 01:48:31 +0000 (09:48 +0800)]
drm/amdgpu/display: fix semicolon.cocci warnings

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_resource.c:1085:2-3: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

CC: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/display: fix semicolon.cocci warnings
kbuild test robot [Thu, 11 May 2017 01:48:31 +0000 (09:48 +0800)]
drm/amdgpu/display: fix semicolon.cocci warnings

drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_stream_encoder.c:411:23-24: Unneeded semicolon
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_stream_encoder.c:420:39-40: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

CC: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: enable dcn1.0 dc support on raven
Hawking Zhang [Mon, 6 Mar 2017 06:01:11 +0000 (14:01 +0800)]
drm/amdgpu: enable dcn1.0 dc support on raven

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/display: Enable DCN in DC
Alex Deucher [Thu, 15 Jun 2017 20:27:42 +0000 (16:27 -0400)]
drm/amdgpu/display: Enable DCN in DC

Enable DCN in DC.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/display: Add irq support for DCN
Harry Wentland [Mon, 8 May 2017 19:28:56 +0000 (15:28 -0400)]
drm/amdgpu/display: Add irq support for DCN

DCN code for display interrupts.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/display: Add i2c/aux support for DCN
Harry Wentland [Mon, 8 May 2017 19:26:37 +0000 (15:26 -0400)]
drm/amdgpu/display: Add i2c/aux support for DCN

Implement support for i2c and aux on DCN.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/display: Add gpio support for DCN
Harry Wentland [Mon, 8 May 2017 19:21:44 +0000 (15:21 -0400)]
drm/amdgpu/display: Add gpio support for DCN

GPIOs are used for i2c and other things.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/display: Add dml support for DCN
Harry Wentland [Mon, 8 May 2017 19:20:38 +0000 (15:20 -0400)]
drm/amdgpu/display: Add dml support for DCN

Display mode lib handles clock, watermark, and bandwidth
calculations for DCN.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>