linux-2.6-microblaze.git
7 years agodrm/amd/display:: Fix NULL pointer in Raven hotplug
Jerry (Fangzhi) Zuo [Fri, 20 Oct 2017 20:45:53 +0000 (16:45 -0400)]
drm/amd/display:: Fix NULL pointer in Raven hotplug

Programming sequence to frontend and backend has been switched.
In such case, program_scaler() is gettingĀ called when programming
frontend, and should be removed from backend programming routine.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix memoryleak during S3 resume.
Leo (Sunpeng) Li [Fri, 20 Oct 2017 17:59:53 +0000 (13:59 -0400)]
drm/amd/display: Fix memoryleak during S3 resume.

Do not create dc_state within display_resume, since it's being
constructed within atomic check.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: add hardware_planes_only to list of affected planes
Shirish S [Wed, 27 Sep 2017 09:45:38 +0000 (15:15 +0530)]
drm/amd/display: add hardware_planes_only to list of affected planes

For SoC's having software designed cursor plane,
should be treated differently than hardware cursor planes.

The DRM core initializes cursor plane by default with
legacy_cursor_update set.

Hence legacy_cursor_update can be use effectively
to handle software cursor planes' update and atomicity
functionalities.

This patch uses this variable to decide in the atomic_check
to whether add a requested plane to the list of affected planes or
not, hence fixing the issue of co-existence of MPO, i.e,
setting of available hardware planes like underlay and
updation of cursor planes as well.

Without this patch when underlay is set from user space,
only blank screen with backlight is visible.

Signed-off-by: Shirish S <shirish.s@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 brace style
Tom St Denis [Tue, 17 Oct 2017 16:13:39 +0000 (12:13 -0400)]
drm/amd/display: Fix brace style

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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: Remove needless cast in amdgpu_dm_connector_init()
Tom St Denis [Tue, 17 Oct 2017 14:40:08 +0000 (10:40 -0400)]
drm/amd/display: Remove needless cast in amdgpu_dm_connector_init()

The cast of dc_link is redundant.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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 brace style in amdgpu_dm_connector_ddc_get_modes()
Tom St Denis [Tue, 17 Oct 2017 14:38:27 +0000 (10:38 -0400)]
drm/amd/display: Fix brace style in amdgpu_dm_connector_ddc_get_modes()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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 dm_drm_plane_reset()
Tom St Denis [Tue, 17 Oct 2017 14:16:39 +0000 (10:16 -0400)]
drm/amd/display: Tidy up dm_drm_plane_reset()

Move WARN_ON higher up and in doing so fix brace style.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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 indentation in create_eml_sink()
Tom St Denis [Tue, 17 Oct 2017 14:15:12 +0000 (10:15 -0400)]
drm/amd/display: Fix indentation in create_eml_sink()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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: Replace block with strncpy() in fill_audio_info()
Tom St Denis [Tue, 17 Oct 2017 13:46:54 +0000 (09:46 -0400)]
drm/amd/display: Replace block with strncpy() in fill_audio_info()

Replace inlined strncpy with library call.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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 brace style in amdgpu_dm_initialize_drm_device()
Tom St Denis [Tue, 17 Oct 2017 13:09:42 +0000 (09:09 -0400)]
drm/amd/display: Fix brace style in amdgpu_dm_initialize_drm_device()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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: Simplify handle_hpd_rx_irq()
Tom St Denis [Tue, 17 Oct 2017 13:04:25 +0000 (09:04 -0400)]
drm/amd/display: Simplify handle_hpd_rx_irq()

There is a local reference to the dc_link that wasn't being
used so we shorten references throughout the function.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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 brace style in dm_handle_hpd_rx_irq()
Tom St Denis [Tue, 17 Oct 2017 13:00:33 +0000 (09:00 -0400)]
drm/amd/display: Fix brace style in dm_handle_hpd_rx_irq()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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 brace style in amdgpu_dm_update_connector_after_detect()
Tom St Denis [Tue, 17 Oct 2017 12:59:18 +0000 (08:59 -0400)]
drm/amd/display: Fix brace style in amdgpu_dm_update_connector_after_detect()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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 indentation in dm_resume()
Tom St Denis [Tue, 17 Oct 2017 12:49:13 +0000 (08:49 -0400)]
drm/amd/display: Fix indentation in dm_resume()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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 indentation in dm_suspend()
Tom St Denis [Tue, 17 Oct 2017 12:48:44 +0000 (08:48 -0400)]
drm/amd/display: Fix indentation in dm_suspend()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.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: Simplify dm_late_init()
Tom St Denis [Tue, 17 Oct 2017 12:47:25 +0000 (08:47 -0400)]
drm/amd/display: Simplify dm_late_init()

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.grodzovsky@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu/dc: inline dml_round_to_multiple
Dave Airlie [Fri, 29 Sep 2017 07:13:31 +0000 (17:13 +1000)]
amdgpu/dc: inline dml_round_to_multiple

turns out to be a win to inline this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu/dc: drop dml_util_is_420
Dave Airlie [Thu, 28 Sep 2017 00:55:25 +0000 (10:55 +1000)]
amdgpu/dc: drop dml_util_is_420

This is unused code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add bunch of missing license headers in DML
Harry Wentland [Tue, 17 Oct 2017 02:58:18 +0000 (22:58 -0400)]
drm/amd/display: Add bunch of missing license headers in DML

All files should have MIT headers.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu/dc: inline a bunch of the dml wrappers.
Harry Wentland [Thu, 28 Sep 2017 00:45:26 +0000 (10:45 +1000)]
amdgpu/dc: inline a bunch of the dml wrappers.

This reduces the code size.

This is basically a redo of Dave's change with the same name
on top of the latest DML.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Small comment on dc_commit_planes_to_stream
Harry Wentland [Tue, 17 Oct 2017 00:10:00 +0000 (20:10 -0400)]
drm/amd/display: Small comment on dc_commit_planes_to_stream

Having one struct on the stack was somewhat confusing. Also mention
that the whole function should eventually go.

Signed-off-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: Minor update to DML
Dmytro Laktyushkin [Fri, 13 Oct 2017 02:45:25 +0000 (22:45 -0400)]
drm/amd/display: Minor update to DML

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: change dml numdpp var to uint
Dmytro Laktyushkin [Fri, 13 Oct 2017 16:53:38 +0000 (12:53 -0400)]
drm/amd/display: change dml numdpp var to uint

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: default force_single_disp_pipe_split = 1 on RV
Tony Cheng [Thu, 5 Oct 2017 18:38:46 +0000 (14:38 -0400)]
drm/amd/display: default force_single_disp_pipe_split = 1 on RV

1080p idle, stutter efficiency goes up from 95.8% to 97.8%
result in 5mW saving from APU and 8mW saving from DDR4

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 in dml vba
Harry Wentland [Fri, 13 Oct 2017 19:12:04 +0000 (15:12 -0400)]
drm/amd/display: Remove redundant condition in dml vba

Found by 0-day
https://lists.freedesktop.org/archives/dri-devel/2017-October/154698.html

Signed-off-by: Harry Wentland <harry.wentland@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: dal 3.1.07
Tony Cheng [Fri, 13 Oct 2017 02:18:12 +0000 (22:18 -0400)]
drm/amd/display: dal 3.1.07

- regression fixes in dal 3.1.06
- more linux upstream backport

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Reduce stack size of commit_planes_to_stream
Harry Wentland [Thu, 12 Oct 2017 18:15:26 +0000 (14:15 -0400)]
drm/amd/display: Reduce stack size of commit_planes_to_stream

This function likes to blow 1024 stack size when something is
added to the addr struct. For now just dynamically allocate.

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: Fix one more place for dc_stream_state leak
Harry Wentland [Tue, 12 Sep 2017 16:10:25 +0000 (17:10 +0100)]
drm/amd/display: Fix one more place for dc_stream_state leak

One more thing that happened due to uneven applying of patches. This
mirrors what Darren Salt fixed.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Move OS types to os_types.h
Harry Wentland [Thu, 12 Oct 2017 16:27:48 +0000 (12:27 -0400)]
drm/amd/display: Move OS types to os_types.h

Some of this stuff is not really dm_services

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: LGD panel willl flash line under window
Hersen Wu [Tue, 10 Oct 2017 20:28:02 +0000 (16:28 -0400)]
drm/amd/display: LGD panel willl flash line under window

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: DAL 3.1.06
Tony Cheng [Thu, 12 Oct 2017 14:59:42 +0000 (10:59 -0400)]
drm/amd/display: DAL 3.1.06

Raven bug fixes
- RS3 MPO stability improvement
- SLS fixes
- AM4 fixes

DAL 3.1
- merge in upstream patches from DRM maintainer Dave Arilie
- hubp, dpp HW objects

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: rename dscl functions
Yue Hin Lau [Tue, 10 Oct 2017 21:58:41 +0000 (17:58 -0400)]
drm/amd/display: rename dscl functions

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: WA for 3 display play video hot plug.
Yongqiang Sun [Tue, 10 Oct 2017 18:01:33 +0000 (14:01 -0400)]
drm/amd/display: WA for 3 display play video hot plug.

Three monitor connected and playing a video will
occupy all 4 pipes, if hot plug forth display,
commit streams will be failed due to no free pipe
can be found.
Work around:
When forth monitor connected, mark video plane as
a fake plane, remove it in dc, keep it in dm and
report address to OS, until OS turn off MPO.

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 DIGD case when getting retimer settings
Andrew Jiang [Wed, 11 Oct 2017 19:12:58 +0000 (15:12 -0400)]
drm/amd/display: Add DIGD case when getting retimer settings

One of the HDMI ports map to DIGD, which we did not map to DP3 ext
HDMI settings. Add the DIGD case so that we can get proper retimer
settings from SBIOS for that port.

Signed-off-by: Andrew Jiang <Andrew.Jiang@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add chip mask to HDMI retimer/redriver check
Andrew Jiang [Wed, 11 Oct 2017 18:59:51 +0000 (14:59 -0400)]
drm/amd/display: Add chip mask to HDMI retimer/redriver check

There were cases where the chip caps held additional bits that led to
the retimer/redriver check failing; use the proper mask to ensure that
we have only the bits that we care about for the check in question.

Signed-off-by: Andrew Jiang <Andrew.Jiang@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Correct timings in build scaling params
Andrew Jiang [Tue, 10 Oct 2017 18:36:39 +0000 (14:36 -0400)]
drm/amd/display: Correct timings in build scaling params

A previous patch set the addressable timing as active + border,
when in fact, the VESA standard specifies active as equal to
addressable + border.

This patch makes the fix more correct and in line with the standard.

Signed-off-by: Andrew Jiang <Andrew.Jiang@amd.com>
Reviewed-by: Andrew Jiang <Andrew.Jiang@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: check SR_WATERMARK regs prior to write
Eric Bernstein [Wed, 11 Oct 2017 19:14:46 +0000 (15:14 -0400)]
drm/amd/display: check SR_WATERMARK regs prior to write

Signed-off-by: Eric Bernstein <eric.bernstein@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: drop display_pipe_clocks.c.
Dave Airlie [Thu, 28 Sep 2017 00:10:22 +0000 (10:10 +1000)]
drm/amd/display: drop display_pipe_clocks.c.

This code isn't used at all in the kernel tree, perhaps it can wait to
be imported when it is. It also does a lot of floating point calcs,
so probably good to drop it until it's needed and we can ensure
proper fpu accessors.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix up some whitespace in handle_cursor_update
Harry Wentland [Wed, 13 Sep 2017 00:04:48 +0000 (20:04 -0400)]
drm/amd/display: Fix up some whitespace in handle_cursor_update

Use combo of tabs and spaces

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Alex Deucher <alexander.deucher@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 warning about uninitialized variable
Harry Wentland [Wed, 4 Oct 2017 17:54:35 +0000 (13:54 -0400)]
drm/amd/display: Fix warning about uninitialized variable

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Don't set cursor address is 0 logging as errors
Andrew Jiang [Fri, 6 Oct 2017 22:02:23 +0000 (18:02 -0400)]
drm/amd/display: Don't set cursor address is 0 logging as errors

This actually happens quite a bit, and having it as an error causes
false positive messages when running tests.

Signed-off-by: Andrew Jiang <Andrew.Jiang@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 ifnullfree.cocci warnings
kbuild test robot [Thu, 12 Oct 2017 23:17:48 +0000 (07:17 +0800)]
drm/amd/display: fix ifnullfree.cocci warnings

drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/gpio_service.c:134:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/gpio_service.c:175:4-9: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Fixes: f09cd1f46388 ("drm/amd/display: Use kernel alloc/free")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/dc: fix semicolon.cocci warnings
kbuild test robot [Thu, 12 Oct 2017 23:35:54 +0000 (07:35 +0800)]
drm/amd/dc: fix semicolon.cocci warnings

drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/gpio_service.c:134:2-3: Unneeded semicolon

 Remove unneeded semicolon.

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

Fixes: 80be23c57868 ("drm/amd/dc: Add dc display driver (v2)")
CC: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix warning about overflow
Harry Wentland [Tue, 10 Oct 2017 15:23:50 +0000 (11:23 -0400)]
drm/amd/display: Fix warning about overflow

v2: convert value to bool using !!

Signed-off-by: Harry Wentland <harry.wentland@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 non-DCN build
Harry Wentland [Fri, 13 Oct 2017 16:42:01 +0000 (12:42 -0400)]
drm/amd/display: Fix non-DCN build

Acquire_first_split_pipe only makes sense for DCN.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: ASSERT on dc_create_state failing.
Leo (Sunpeng) Li [Fri, 6 Oct 2017 19:11:41 +0000 (15:11 -0400)]
drm/amd/display: ASSERT on dc_create_state failing.

dc_create_state() returns NULL on allocation failure. Raise warning when
that happens.

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: Report stream as different on scaling change
Leo (Sunpeng) Li [Fri, 6 Oct 2017 15:57:40 +0000 (11:57 -0400)]
drm/amd/display: Report stream as different on scaling change

When scaling is enabled, our preference is to scale up to the prefered
(native) mode. This means that hardware timings will be the same across
a modeset.

Therefore, also report mode as changed if source or destination
rectangle is different.

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: Set addressable region as active + border
Dmytro Laktyushkin [Thu, 5 Oct 2017 23:15:25 +0000 (19:15 -0400)]
drm/amd/display: Set addressable region as active + border

This ensures that we do not draw the blank region onscreen, and that we
do underscan instead.

Signed-off-by: Andrew Jiang <Andrew.Jiang@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 performance trace macro to dc
Dmytro Laktyushkin [Fri, 6 Oct 2017 19:40:07 +0000 (15:40 -0400)]
drm/amd/display: add performance trace macro 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: Remove a false-positive error message
Jerry Zuo [Fri, 6 Oct 2017 19:08:07 +0000 (15:08 -0400)]
drm/amd/display: Remove a false-positive error message

To avoid confusion, need to suppress the error message when get
-ERESTARTSYS error code. It is normal when getting interrupted
by signals in the process of a wait for the buffer to become
unreserved. Only propagate to user-mode for further action,
no need to pop up error message.

Signed-off-by: Jerry Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Sun peng Li <Sunpeng.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: Do not set bandwidth on page flips.
Leo (Sunpeng) Li [Wed, 4 Oct 2017 16:47:13 +0000 (12:47 -0400)]
drm/amd/display: Do not set bandwidth on page flips.

Which removes a lockdep warning for a possible deadlock situation:

While holding the drm event mutex (hard irq safe),
dc_post_update_surfaces_to_stream eventually acquires the atom context
lock, which is hard irq unsafe. We should only be calling it on full
updates anyways.

Also remove a redundant call to dc_post_update_surfaces_to_stream,
dc_commit_updates_for_stream already calls it.

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: rename transform to dpp for dcn
Yue Hin Lau [Thu, 5 Oct 2017 20:47:49 +0000 (16:47 -0400)]
drm/amd/display: rename transform to dpp for dcn

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Eric Bernstein <Eric.Bernstein@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 null check for cursor functions
Yue Hin Lau [Thu, 5 Oct 2017 21:57:35 +0000 (17:57 -0400)]
drm/amd/display: add null check for cursor functions

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: fix null dereference in reset hw ctx
Eric Yang [Thu, 5 Oct 2017 20:00:29 +0000 (16:00 -0400)]
drm/amd/display: fix null dereference in reset hw ctx

Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix a logic defect in cursor move
Jerry Zuo [Thu, 5 Oct 2017 19:37:46 +0000 (15:37 -0400)]
drm/amd/display: Fix a logic defect in cursor move

Regression caused by: Ib98354194d7

Need to check crtc->stream before updating cursor attributes
and position.

Signed-off-by: Jerry Zuo <Jerry.Zuo@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: [RV] bug in cm programming
Vitaly Prosyak [Thu, 5 Oct 2017 15:45:50 +0000 (10:45 -0500)]
drm/amd/display: [RV] bug in cm programming

When surface bigger then 10 bpc the output pixel
does not match to the required value.Update CRC's.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@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: change when to set tap_hardcode_coeff
Bhawanpreet Lakha [Thu, 5 Oct 2017 17:32:29 +0000 (13:32 -0400)]
drm/amd/display: change when to set tap_hardcode_coeff

Set hardcode_coeff only when BOTH chroma and luma taps are
more than 1

without this underscan with h or v set to 0 darkens
the screen (either h or v set to 0, not both)

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@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: Expose some MPC functions for reuse
Eric Bernstein [Thu, 5 Oct 2017 18:27:27 +0000 (14:27 -0400)]
drm/amd/display: Expose some MPC functions for reuse

Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Reviewed-by: Eric Bernstein <Eric.Bernstein@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 underscan not using proper scaling
Bhawanpreet Lakha [Tue, 3 Oct 2017 17:53:51 +0000 (13:53 -0400)]
drm/amd/display: Fix underscan not using proper scaling

fix underscan not being set correctly

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Pull transfer func defines into DC
SivapiriyanKumarasamy [Wed, 4 Oct 2017 18:24:53 +0000 (14:24 -0400)]
drm/amd/display: Pull transfer func defines into DC

Signed-off-by: SivapiriyanKumarasamy <sivapiriyan.kumarasamy@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: renaming filename for hubp
Yue Hin Lau [Thu, 5 Oct 2017 16:30:14 +0000 (12:30 -0400)]
drm/amd/display: renaming filename for hubp

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: dal 3.1.05
Tony Cheng [Thu, 5 Oct 2017 18:15:44 +0000 (14:15 -0400)]
drm/amd/display: dal 3.1.05

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix up plane_states add/remove logic
Andrew Jiang [Wed, 4 Oct 2017 19:55:45 +0000 (15:55 -0400)]
drm/amd/display: Fix up plane_states add/remove logic

Our plane_states array trimming logic was faulty, we should be starting
to shuffle from the plane that was just released, not from the very
beginning of the array.

Also get rid of a leftover line that was setting the plane state at the
stream index to null, leading to issues. Also move the
dc_plane_state_retain call to where we reference plane_state, in case we
do hit the error case where we can't get a free pipe.

Signed-off-by: Andrew Jiang <Andrew.Jiang@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 newlines in pstate wait debug messages
Andrew Jiang [Wed, 4 Oct 2017 18:10:16 +0000 (14:10 -0400)]
drm/amd/display: Add missing newlines in pstate wait debug messages

These were spamming the debugger logs.

Signed-off-by: Andrew Jiang <Andrew.Jiang@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 DPP capabilities
Eric Bernstein [Mon, 2 Oct 2017 19:03:50 +0000 (15:03 -0400)]
drm/amd/display: Add DPP capabilities

Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: rename struct mem_input to hubp for dcn
Yue Hin Lau [Mon, 2 Oct 2017 18:39:42 +0000 (14:39 -0400)]
drm/amd/display: rename struct mem_input to hubp for dcn

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: group DCN watermark registers
Eric Bernstein [Wed, 4 Oct 2017 20:56:27 +0000 (16:56 -0400)]
drm/amd/display: group DCN watermark registers

Signed-off-by: Eric Bernstein <eric.bernstein@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: dal 3.1.04
Tony Cheng [Tue, 3 Oct 2017 22:19:01 +0000 (18:19 -0400)]
drm/amd/display: dal 3.1.04

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Ignore wrong tautological warning
Harry Wentland [Mon, 2 Oct 2017 19:27:26 +0000 (15:27 -0400)]
drm/amd/display: Ignore wrong tautological warning

Some of our HW calcs functions compares a var against
itself to check for NaN. Gcc isn't fond of it and wrongfully
warns about a tautological comparison. Disable this check
for dcn_calcs_math.c.

Signed-off-by: Harry Wentland <harry.wentland@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: Handle case when stream not found in set_dpms
Eric Yang [Tue, 3 Oct 2017 22:15:51 +0000 (18:15 -0400)]
drm/amd/display: Handle case when stream not found in set_dpms

When validate with context fail to add stream to the context, we have
a case where set_dpms won't be able to find the stream that need to
be disabled.

Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: add dpms state to DC follow up
Hersen Wu [Tue, 3 Oct 2017 20:47:02 +0000 (16:47 -0400)]
drm/amd/display: add dpms state to DC follow up

Signed-off-by: Hersen Wu <hersenxs.wu@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: Fixed switching mode half screen gamma incorrect.
Yongqiang Sun [Tue, 3 Oct 2017 19:03:49 +0000 (15:03 -0400)]
drm/amd/display: Fixed switching mode half screen gamma incorrect.

Half screen gamma setting and cursor are incorrect
when switching mode through win+p due to wrong programming
gamma sequence (In case of bottom pipe, gamma and cursor are
programmed before front end programmed, pipe is power gated).

change:
1. Cache curor attributes to stream
2. Move set gamma and cursor inside front end
   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 dpms state to DC
Hersen Wu [Fri, 29 Sep 2017 20:36:34 +0000 (16:36 -0400)]
drm/amd/display: add dpms state to DC

- avoid eDP screen flash 4 times when resume from s3
- improve s3 and boot time

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 max_video_width cap to dc
Dmytro Laktyushkin [Tue, 3 Oct 2017 16:54:18 +0000 (12:54 -0400)]
drm/amd/display: add max_video_width cap to dc

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: block video planes >4k on dcn10
Dmytro Laktyushkin [Tue, 3 Oct 2017 15:11:28 +0000 (11:11 -0400)]
drm/amd/display: block video planes >4k on dcn10

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: increase pstate wait timeout
Bhawanpreet Lakha [Mon, 2 Oct 2017 17:40:02 +0000 (13:40 -0400)]
drm/amd/display: increase pstate wait timeout

For linux it takes longer than 40us so increasing it to
200us. Also added debug prints regarding the change

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@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: reject 3D mode based on static debug flag.
Charlene Liu [Mon, 2 Oct 2017 22:01:36 +0000 (18:01 -0400)]
drm/amd/display: reject 3D mode based on static debug flag.

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@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 re-enabling stutter for raven
Bhawanpreet Lakha [Mon, 2 Oct 2017 16:00:24 +0000 (12:00 -0400)]
drm/amd/display: fix re-enabling stutter for raven

We were overwriting the whole register which was re-enabling
stutter for raven. Now we are reading the register then setting
the values only for pstate.

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@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 debug flag for VSR support
Charlene Liu [Mon, 2 Oct 2017 20:25:58 +0000 (16:25 -0400)]
drm/amd/display: Add debug flag for VSR support

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: wa to program split pipedegamma regs after mode set.
Yongqiang Sun [Mon, 2 Oct 2017 21:08:24 +0000 (17:08 -0400)]
drm/amd/display: wa to program split pipedegamma regs after mode set.

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 extend to second screen mode hang
Yongqiang Sun [Thu, 28 Sep 2017 21:18:27 +0000 (17:18 -0400)]
drm/amd/display: Fixed extend to second screen mode hang

1. Fixed acquire free split pipe bug.
2. Change return value for dc_add_stream_to_ctx
   from bool to enum.
4. Remove redundant apply_ctx_for_surface calling
5. Unlock pipe after back end 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 stereo_support debug flag
Charlene Liu [Sun, 1 Oct 2017 01:03:40 +0000 (21:03 -0400)]
drm/amd/display: Add stereo_support debug flag

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: clean up dcn10 dpp after HW review
Eric Bernstein [Fri, 29 Sep 2017 19:30:17 +0000 (15:30 -0400)]
drm/amd/display: clean up dcn10 dpp after HW review

Signed-off-by: Eric Bernstein <eric.bernstein@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 drm_modeset_lock in MST code
Jerry Zuo [Thu, 28 Sep 2017 20:58:32 +0000 (16:58 -0400)]
drm/amd/display: Remove drm_modeset_lock in MST code

Locks are no longer needed since the drm framework takes care of
correct locking.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
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: Do not access fbdev helper members
Jerry Zuo [Thu, 28 Sep 2017 20:20:30 +0000 (16:20 -0400)]
drm/amd/display: Do not access fbdev helper members

Original code is no longer needed and tested without loop.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
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: Fix irq enable/disable on resume.
Roman Li [Thu, 28 Sep 2017 16:57:21 +0000 (12:57 -0400)]
drm/amd/display: Fix irq enable/disable on resume.

Fixing loop boundaries in irq enable/disable on resume.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Mikita Lipski <Mikita.Lipski@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Making hubp1_program_surface_config public
Yue Hin Lau [Thu, 28 Sep 2017 20:09:56 +0000 (16:09 -0400)]
drm/amd/display: Making hubp1_program_surface_config public

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: arbitration find the matching dig-az first.
Charlene Liu [Thu, 28 Sep 2017 19:38:01 +0000 (15:38 -0400)]
drm/amd/display: arbitration find the matching dig-az first.

[Description]
this change is in branch already.
without this change, after resume, az_inst might swapped.

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: renaming mem input to hubp
Yue Hin Lau [Thu, 28 Sep 2017 18:54:58 +0000 (14:54 -0400)]
drm/amd/display: renaming mem input to hubp

Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: audio dynamic resource acquired related
Charlene Liu [Thu, 28 Sep 2017 03:23:16 +0000 (23:23 -0400)]
drm/amd/display: audio dynamic resource acquired related

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Program front end first when set mode.
Yongqiang Sun [Thu, 28 Sep 2017 14:40:10 +0000 (10:40 -0400)]
drm/amd/display: Program front end first when set 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: make FBC configurable option
Shirish S [Tue, 26 Sep 2017 10:05:42 +0000 (15:35 +0530)]
drm/amd/display: make FBC configurable option

Currently FBC is guarded with ENABLE_FBC macro,
which needs to be manually enabled in Makefile.

This patch moves it to Kconfig so that there
wont be any need to additional patch to be carried
for enabling or disabling on every SoC.

Signed-off-by: Shirish S <shirish.s@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 hotplug after s3 resume.
Roman Li [Wed, 27 Sep 2017 21:57:37 +0000 (17:57 -0400)]
drm/amd/display: Fix hotplug after s3 resume.

On S3 resume the HPD6 irq source was not reenabled
due to loop boundary bug.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Mikita Lipski <Mikita.Lipski@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: wrong VM setting cause invalid DF request from DCN
Tony Cheng [Wed, 27 Sep 2017 02:16:11 +0000 (22:16 -0400)]
drm/amd/display: wrong VM setting cause invalid DF request from DCN

fix typo in register field.  we are lucky the shift/mask is the same, no behavior change

add globals to experiment with using different VM settings

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: Enable double buffer as per vertical interrupt enabled.
Yongqiang Sun [Wed, 27 Sep 2017 21:28:11 +0000 (17:28 -0400)]
drm/amd/display: Enable double buffer as per vertical interrupt enabled.

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: change dml vba cursor count define to correct one
Dmytro Laktyushkin [Wed, 20 Sep 2017 22:32:51 +0000 (18:32 -0400)]
drm/amd/display: change dml vba cursor count define to correct one

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: extract global sync params from vba
Dmytro Laktyushkin [Wed, 20 Sep 2017 21:50:02 +0000 (17:50 -0400)]
drm/amd/display: extract global sync params from vba

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 mode support check to dml vba code
Dmytro Laktyushkin [Fri, 15 Sep 2017 20:03:09 +0000 (16:03 -0400)]
drm/amd/display: add mode support check to dml vba code

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: Restructuring and cleaning up DML
Dmytro Laktyushkin [Wed, 23 Aug 2017 20:43:17 +0000 (16:43 -0400)]
drm/amd/display: Restructuring and cleaning up DML

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 agoRevert "amdgpu/dc: inline a bunch of float operations."
Harry Wentland [Tue, 17 Oct 2017 02:15:57 +0000 (22:15 -0400)]
Revert "amdgpu/dc: inline a bunch of float operations."

This reverts commit d1209512e028a917e6e70b13297ff185234ba24d.

Unfortunately these clash with our DML update from the HW guys.

Rerolling this after the fact won't save us anything anymore,
unfortunately so we're back to non-inline for this.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>