openwrt/staging/blogic.git
7 years agodrm/amd/display: Block YCbCr formats for eDP. Revert previous change.
Zeyu Fan [Mon, 17 Apr 2017 23:02:19 +0000 (19:02 -0400)]
drm/amd/display: Block YCbCr formats for eDP. Revert previous change.

Signed-off-by: Zeyu Fan <Zeyu.Fan@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: make dc_commit_surfaces_to_stream() re-entrant
Shirish S [Wed, 12 Apr 2017 10:53:25 +0000 (16:23 +0530)]
drm/amd/display: make dc_commit_surfaces_to_stream() re-entrant

dc_commit_surfaces_to_stream() function currently
is handle's only one plane at a time.
This will not work if multiple planes have to be set to a crtc.

The functionality of dc_commit_surfaces_to_stream() with this patch
is slit into
1. Accumulate and initialise all the surfaces that needs to be
   set to a crtc.
2. Update the intialised set of surfaces to the steam in one go.

Hence dc_commit_surfaces_to_stream() is renamed to init_surfaces().
Once all the planes requested by user space are initialised,
dc_commit_surfaces_to_stream() shall sequentially populates *updates,
 *flip_addr, *plane_info and *scaling_info for all surfaces.

BUG: SWDEV-119421
TEST: (On Chromium OS for Stoney Only)
* Chromium UI comes up, on both eDP & DP.
* 'new_surface_count' now changes as per user input for e.g for
  all below run tests its 2, without this patch for the below
  tests it used to be 1
* Executed below tests to see YUV(underlay) & RGB planes on eDP
plane_test --format XR24 --size 500x100 -p --format YV12 --size 500x500
plane_test --format AR24 --size 500x50 -p --format YV12 --size 150x150
plane_test --format AR24 --size 500x50 -p --format YV12 --size 1366x768

Signed-off-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: update the YUV plane offsets
Shirish S [Tue, 25 Apr 2017 06:56:57 +0000 (12:26 +0530)]
drm/amd/display: update the YUV plane offsets

This patch updates the planes default offsets to
the appropriate ones, and aligns the pitch to 64 bits.

BUG=SWDEV-119421
TEST=Boots to UI on jadeite
TEST=
     plane_test --format AR24 --size 500x50 -p --format YV12 --size 500x500
     plane_test --format AR24 --size 500x50 -p --format YV12 --size 1280x720
     plane_test --format AR24 --size 500x50 -p --format YV12 --size 1366x768

Signed-off-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: initialize YUV plane capabilities
Shirish S [Thu, 27 Apr 2017 02:36:01 +0000 (22:36 -0400)]
drm/amd/display: initialize YUV plane capabilities

This patch populates the YUV surface configurations.

Tests: (On Chromium OS for Stoney Only)
builds without any errors.

Signed-off-by: Shirish S <shirish.s@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: Return context from validate_context
Harry Wentland [Wed, 29 Mar 2017 15:22:05 +0000 (11:22 -0400)]
drm/amd/display: Return context from validate_context

This will allow us to carry it from check to commit

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Move resource_validate_ctx_destruct to dc.h
Harry Wentland [Wed, 29 Mar 2017 15:15:14 +0000 (11:15 -0400)]
drm/amd/display: Move resource_validate_ctx_destruct to dc.h

This will be needed to clean up context once we add it to private
atomic state.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Copy ctx to current_context instead of assign
Harry Wentland [Thu, 6 Apr 2017 22:57:05 +0000 (18:57 -0400)]
drm/amd/display: Copy ctx to current_context instead of assign

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: pull commit_surfaces out of atomic_commit into helper function
Harry Wentland [Thu, 6 Apr 2017 20:22:33 +0000 (16:22 -0400)]
drm/amd/display: pull commit_surfaces out of atomic_commit into helper function

This should make things simpler when we try to rework this later when we
pass validate_context from atomic_check to atomic_commit.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: update dce8 & 10 bw programming
Dmytro Laktyushkin [Mon, 17 Apr 2017 15:39:19 +0000 (11:39 -0400)]
drm/amd/display: update dce8 & 10 bw programming

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Get rid of temp_flip_context
Harry Wentland [Thu, 6 Apr 2017 21:05:53 +0000 (17:05 -0400)]
drm/amd/display: Get rid of temp_flip_context

If we need to update our context we can allocate memory.
No need to keep temporary memory for this.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Remove unused scratch_val_ctx
Harry Wentland [Thu, 6 Apr 2017 20:48:48 +0000 (16:48 -0400)]
drm/amd/display: Remove unused scratch_val_ctx

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: FreeSync LFC MIN/MAX update on current frame
Eric Cook [Wed, 12 Apr 2017 15:05:08 +0000 (11:05 -0400)]
drm/amd/display: FreeSync LFC MIN/MAX update on current frame

- Update BTR/LFC logic so that V_TOTAL_MIN/MAX will take affect on current frame
- Add in FreeSync update to MPO code path

Signed-off-by: Eric Cook <Eric.Cook@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add support for programming stereo sync
Vitaly Prosyak [Fri, 31 Mar 2017 20:25:04 +0000 (15:25 -0500)]
drm/amd/display: Add support for programming stereo sync

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Parse scanline registers
Sylvia Tsai [Tue, 11 Apr 2017 19:15:28 +0000 (15:15 -0400)]
drm/amd/display: Parse scanline registers

They could differ between ASIC generations

Signed-off-by: Sylvia Tsai <sylvia.tsai@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: use full surface update when stream is NULL
Charlene Liu [Wed, 12 Apr 2017 02:24:44 +0000 (22:24 -0400)]
drm/amd/display: use full surface update when stream is NULL

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix missing irq refactor causing potential i2c race
Jordan Lazare [Tue, 11 Apr 2017 15:40:18 +0000 (11:40 -0400)]
drm/amd/display: Fix missing irq refactor causing potential i2c race

Signed-off-by: Jordan Lazare <Jordan.Lazare@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 for tile MST
Ding Wang [Mon, 10 Apr 2017 18:02:23 +0000 (14:02 -0400)]
drm/amd/display: Fix for tile MST

- Set stream signal type to be SST when setting non-tile timing on MST
  tiled display.
  - Disable MST on sink after disabling MST link.
  - Enable MST on sink before enabling MST link.

Signed-off-by: Ding Wang <Ding.Wang@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: set NULL value during removal for remoteSink
Leon Elazar [Mon, 10 Apr 2017 13:37:11 +0000 (09:37 -0400)]
drm/amd/display: set NULL value during removal for remoteSink

In MST case during removal of remote sink its descriptor pointer wasn't freed corectly.

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: change mpo surface update check condition.
Yongqiang Sun [Thu, 6 Apr 2017 20:23:14 +0000 (16:23 -0400)]
drm/amd/display: change mpo surface update check condition.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add same check as reset pipes for programing backend regs.
Yongqiang Sun [Thu, 6 Apr 2017 20:21:58 +0000 (16:21 -0400)]
drm/amd/display: Add same check as reset pipes for programing backend regs.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Adding dm controlled signal type in dc_stream
Sylvia Tsai [Tue, 4 Apr 2017 21:28:17 +0000 (17:28 -0400)]
drm/amd/display: Adding dm controlled signal type in dc_stream

- Adding dm controlled signal type in dc_stream
- Adding fallback to dvi signal when output signal is hdmi and the connector
  type is not

Signed-off-by: Sylvia Tsai <sylvia.tsai@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Sylvia Tsai <Sylvia.Tsai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Memory was freed twice during disable
Leon Elazar [Tue, 4 Apr 2017 14:01:07 +0000 (10:01 -0400)]
drm/amd/display: Memory was freed twice during disable

1. get_ss_info_from_atombios function was allocating the memory populating the provided pointer
but them freeing the memory.
Since the pointer was return as a valid value, we are trying to free the same memory during clock resource destruction

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix hotspot programming during set cursor position.
Zeyu Fan [Mon, 3 Apr 2017 15:54:11 +0000 (11:54 -0400)]
drm/amd/display: Fix hotspot programming during set cursor position.

- Remove x,y hotspot from dc_cursor_attributes. Only program it
  through setPosition.

Signed-off-by: Zeyu Fan <Zeyu.Fan@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Zeyu Fan <Zeyu.Fan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: adding FCLK and DPPCLK clock types
Charlene Liu [Fri, 31 Mar 2017 21:40:15 +0000 (17:40 -0400)]
drm/amd/display: adding FCLK and DPPCLK clock types

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Prevent premature pageflip when comitting in vblank. (v3)
Mario Kleiner [Mon, 24 Apr 2017 16:54:20 +0000 (18:54 +0200)]
drm/amd/display: Prevent premature pageflip when comitting in vblank. (v3)

Make sure we do not program a hw pageflip inside vblank 'n' iff the
atomic flip is comitted while inside the same vblank 'n'. We must
defer such a flip by one refresh cycle to vblank 'n+1', unless this
is a DRM_MODE_PAGE_FLIP_ASYNC async pageflip, which must always
execute as soon as possible.

Without this, pageflips programmed via X11 GLX_OML_sync_control extensions
glXSwapBuffersMscOML(..., target_msc, ...); call and/or via DRI3/Present
PresentPixmap(..., target_msc, ...); request will complete one vblank
too early whenever target_msc > current_msc + 1, ie. more than 1 vblank
in the future. In such a case, the call of the pageflip ioctl() would be
triggered by a queued drmWaitVblank() vblank event, which itself gets
dispatched inside the vblank one frame before the target_msc vblank.

Testing with this patch does no longer show any problems with
OML_sync_control swap scheduling or flip completion timestamps.
Tested on R9 380 Tonga.

v2: Add acked/r-b by Harry and Michel.
v3: Feedback from Andrey: Must not wait an extra frame for
    DRM_MODE_PAGE_FLIP_ASYNC flips.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Acked-by: Harry Wentland <harry.wentland@amd.com> (v1)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Cc: Harry Wentland <Harry.Wentland@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix race between vblank irq and pageflip irq. (v2)
Mario Kleiner [Mon, 24 Apr 2017 09:46:44 +0000 (11:46 +0200)]
drm/amd/display: Fix race between vblank irq and pageflip irq. (v2)

Since DC now uses CRTC_VERTICAL_INTERRUPT0 as VBLANK irq trigger
and vblank interrupts actually happen earliest at start of vblank,
instead of a bit before vblank, we no longer need some of the
fudging logic to deal with too early vblank irq handling (grep for
lb_vblank_lead_lines). This itself fixes a pageflip scheduling
bug in DC, caused by uninitialized  use of lb_vblank_lead_lines,
with a wrong startup value of 0. Thanks to the new vblank irq
trigger this value of zero is now actually correct for DC :).

A new problem is that vblank irq's race against pflip irq's,
and as both can fire at first line of vblank, it is no longer
guaranteed that vblank irq handling (therefore -> drm_handle_vblank()
-> drm_update_vblank_count()) executes before pflip irq handling
for a given vblank interval when a pageflip completes. Therefore
the vblank count and timestamps emitted to user-space as part of
the pageflip completion event will be often stale and cause new
timestamping and swap scheduling errors in user-space.

This was observed with large frequency on R9 380 Tonga Pro.

Fix this by enforcing a vblank count+timestamp update right
before emitting the pageflip completion event from the pflip
irq handler. The logic in core drm_update_vblank_count() makes
sure that no redundant or conflicting updates happen, iow. the
call turns into a no-op if it wasn't needed for that vblank,
burning a few microseconds of cpu time though.

Successfully tested on AMD R9 380 "Tonga Pro" (VI/DCE 10)
with DC enabled on the current DC staging branch. Independent
measurement of pageflip completion timing with special hardware
measurement equipment now confirms correct pageflip timestamps
and counts in the pageflip completion events.

v2: Review comments by Michel, drop outdated paragraph
    about problem already fixed in 2nd patch of the series.
    Add acked/r-b by Harry and Michel.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Acked-by: Harry Wentland <harry.wentland@amd.com> (v1)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: get_atomic_property missing for drm_connector_funcs
Pratik Vishwakarma [Thu, 6 Apr 2017 07:48:20 +0000 (13:18 +0530)]
drm/amd/display: get_atomic_property missing for drm_connector_funcs

DRM_IOCTL_MODE_GETCONNECTOR fails with EINVAL on enabling DRIVER_ATOMIC
With this DRM_IOCTL_MODE_GETCONNECTOR returns all the connector properties.
freesync_property and freesync_capable_property return 0 currently.

TESTS(On Chromium OS on Stoney Only)
* Builds without compilation errors.
* 'atomictest' proceeds after applying patch and fails with vblank event
timed out.
* Chromium OS ui comes up.

Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@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: Fallback on legacy properties in atomic_get_properties
Harry Wentland [Fri, 27 Jan 2017 15:55:20 +0000 (10:55 -0500)]
drm/amd/display: Fallback on legacy properties in atomic_get_properties

We still rely on legacy properties. Fallback on legacy properties until
we get to pull these into some atomic state.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Allow planes on all crtcs
Harry Wentland [Mon, 10 Apr 2017 19:37:32 +0000 (15:37 -0400)]
drm/amd/display: Allow planes on all crtcs

4.9 kernel will always add the assigned crtc to possible_crtcs on a
plane. This is no longer the case on newer kernels. Make sure we allow
any plane on any crtc.

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: fix nullptr on vega initialization
Alex Deucher [Thu, 15 Jun 2017 20:25:11 +0000 (16:25 -0400)]
drm/amd/display: fix nullptr on vega initialization

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix s3 hang on resume.
Andrey Grodzovsky [Fri, 31 Mar 2017 18:15:31 +0000 (14:15 -0400)]
drm/amd/display: Fix s3 hang on resume.

Avoid enabling CRTC_VERTICAL_INTERRUPT0 twice on resume.
It's enabled once from within manage_dm_interrupts in mode set
and another explicitly from amdgpu_dm_irq_resume_late.
Seems it lead to CRTC hang.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Log clock source in error condition
Jordan Lazare [Fri, 31 Mar 2017 21:14:20 +0000 (17:14 -0400)]
drm/amd/display: Log clock source in error condition

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Ignore visible flag when check surface update type.
Yongqiang Sun [Fri, 31 Mar 2017 17:53:42 +0000 (13:53 -0400)]
drm/amd/display: Ignore visible flag when check surface update type.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fill in vrefresh and min_vblank_time for dce8/dce10
Jordan Lazare [Thu, 30 Mar 2017 17:08:34 +0000 (13:08 -0400)]
drm/amd/display: Fill in vrefresh and min_vblank_time for dce8/dce10

PPLib is now calling into DC to get vrefresh and min_vblank_time, but
since full bandwidth calcs are missing for those generations, the pplib
structures were never being filled. This change fills the currently
required fields to prevent screen corruption.

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: PSR Aux Channel and Static Screen Support Fix
Amy Zhang [Thu, 30 Mar 2017 15:39:47 +0000 (11:39 -0400)]
drm/amd/display: PSR Aux Channel and Static Screen Support Fix

- Correct the aux channel selection according to DAL3

Signed-off-by: Amy Zhang <Amy.Zhang@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Refactor edid read.
Andrey Grodzovsky [Tue, 28 Mar 2017 20:57:52 +0000 (16:57 -0400)]
drm/amd/display: Refactor edid read.

Allow Linux to use DRM provided EDID read functioality
by moving  DAL edid implementation to module hence
removing this code from DC by this cleaning up DC
code for upstream.

v2: Removing ddc_service. No more need for it.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix i2c write flag.
Andrey Grodzovsky [Sun, 5 Mar 2017 01:56:46 +0000 (20:56 -0500)]
drm/amd/display: Fix i2c write flag.

I2C_M_RD was translated to write instead of read.

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: Remove get_connector_for_sink.
Andrey Grodzovsky [Tue, 14 Feb 2017 20:47:24 +0000 (15:47 -0500)]
drm/amd/display: Remove get_connector_for_sink.

Keep 1:1 relation between MST sink and it's MST connector.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Remove get_connector_for_link.
Andrey Grodzovsky [Tue, 14 Feb 2017 18:50:17 +0000 (13:50 -0500)]
drm/amd/display: Remove get_connector_for_link.

We can keep a 1:1 relation between a link and a physical
connector and hence skip the iteration. This function
is used in context of only physical connetors.

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 dce_calc surface pitch setting for non underlay pipes
Dmytro Laktyushkin [Wed, 29 Mar 2017 20:24:19 +0000 (16:24 -0400)]
drm/amd/display: fix dce_calc surface pitch setting for non underlay pipes

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Temporary disable PSR for HBR2 & HBR3
Zeyu Fan [Wed, 29 Mar 2017 21:21:56 +0000 (17:21 -0400)]
drm/amd/display: Temporary disable PSR for HBR2 & HBR3

Signed-off-by: Zeyu Fan <Zeyu.Fan@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: refactor member referencing to improve readability
Reza Amini [Wed, 29 Mar 2017 16:05:15 +0000 (12:05 -0400)]
drm/amd/display: refactor member referencing to improve readability

Signed-off-by: Reza Amini <reza.amini@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 surface validation against stream rect
Reza Amini [Fri, 17 Mar 2017 19:24:09 +0000 (15:24 -0400)]
drm/amd/display: remove surface validation against stream rect

Surface information is by default copied from old context in dc_commit_stream.
Thus unchange streams will not be affected. For new streams, we shouldn't
validate the new mode against the surface configuration of old_context.

Signed-off-by: Reza Amini <reza.amini@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: update plane functionalities
Shirish S [Thu, 23 Mar 2017 09:24:40 +0000 (14:54 +0530)]
drm/amd/display: update plane functionalities

This patch introduces amdgpu_drm_plane_state
structure, which subclasses drm_plane_state and
holds data suitable for configuring hardware.

It switches reset(), atomic_duplicate_state()
& atomic_destroy_state() functions to new internal
implementation, earlier they were pointing to
drm core functions.

TESTS(On Chromium OS on Stoney Only)
* Builds without compilation errors.
* 'plane_test' passes for XR24 format
  based Overlay plane.
* Chromium OS ui comes up.

Signed-off-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix cleanup in amdgpu_dm_initialize_drm_device
Harry Wentland [Mon, 3 Apr 2017 17:36:26 +0000 (13:36 -0400)]
drm/amd/display: Fix cleanup in amdgpu_dm_initialize_drm_device

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: decouple per-crtc-plane model
Alex Deucher [Thu, 15 Jun 2017 20:24:01 +0000 (16:24 -0400)]
drm/amd/display: decouple per-crtc-plane model

Current design has per-crtc-plane model.
As a result, for asic's that support underlay,
are unable to expose it to user space for modesetting.

To enable this, the drm driver intialisation now runs
for number of surfaces instead of stream/crtc.

This patch plumbs surface capabilities to drm framework
so that it can be effectively used by user space.

Tests: (On Chromium OS for Stoney Only)
* 'modetest -p'  now shows additional plane
  with YUV capabilities in case of CZ and ST.
* 'plane_test' fails with below error:
  [drm:amdgpu_dm_connector_atomic_set_property [amdgpu]] *ERROR* Unsupported screen depth 0
  as ther is no support for YUYV
* Checked multimonitor display works fine

Signed-off-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: obtain usHBR3En bit from BP 1
Ding Wang [Mon, 27 Mar 2017 18:50:27 +0000 (14:50 -0400)]
drm/amd/display: obtain usHBR3En bit from BP 1

ASICs using bios parser 1 don't check HBR3 capability as there is no such
a bit usHBR3En in ATOM_ENCODER_CAP_RECORDER.
Therefore, will use ATOM_ENCODER_CAP_RECORDER_V2 and thus obtain the usHBR3En
bit.

Signed-off-by: Ding Wang <ding.wang@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: stereo support
Vitaly Prosyak [Mon, 27 Mar 2017 17:48:46 +0000 (12:48 -0500)]
drm/amd/display: stereo support

Frame sequential, top-bottom and side-by-side support.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: use CP2520-3 for PHY compliance automation
Tony Cheng [Mon, 27 Mar 2017 16:39:22 +0000 (12:39 -0400)]
drm/amd/display: use CP2520-3 for PHY compliance automation

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix MPO exit and cursor issue.
Yongqiang Sun [Mon, 27 Mar 2017 13:59:38 +0000 (09:59 -0400)]
drm/amd/display: Fix MPO exit and cursor issue.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: increase timeout for dmif dealloc
Roman Li [Fri, 24 Mar 2017 20:26:09 +0000 (16:26 -0400)]
drm/amd/display: increase timeout for dmif dealloc

In some use-cases, e.g. multiple 4K displays,
exisitng wait time for reg update of 30msec timed out
during mode setiing that sometimes resulted in system bad state
as we continue without waiting for registry update complete.
Increasing timeout to 35msec fixes that problem.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: voltage request related change
Charlene Liu [Fri, 24 Mar 2017 20:54:02 +0000 (16:54 -0400)]
drm/amd/display: voltage request related change

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: use CRTC_VERTICAL_INTERRUPT0 as a trigger for VBLANK.
Andrey Grodzovsky [Thu, 23 Mar 2017 19:30:35 +0000 (15:30 -0400)]
drm/amd/display: use CRTC_VERTICAL_INTERRUPT0 as a trigger for VBLANK.

Register ISR hnadler on the new interrupt.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: use CRTC_VERTICAL_INTERRUPT0 as VBLANK trigger.
Andrey Grodzovsky [Thu, 23 Mar 2017 19:27:15 +0000 (15:27 -0400)]
drm/amd/display: use CRTC_VERTICAL_INTERRUPT0 as VBLANK trigger.

VBLANK interrupt is driven bu line buffer vcounter which is
ahead of CRTC vcounter. Use an interrupt that fires at the actual
CRTC vblank start boundry.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Rename bandwidth_calcs.h to dce_calcs.h
Harry Wentland [Tue, 21 Mar 2017 22:17:12 +0000 (18:17 -0400)]
drm/amd/display: Rename bandwidth_calcs.h to dce_calcs.h

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Power on front end during set mode.
Yongqiang Sun [Thu, 23 Mar 2017 14:34:06 +0000 (10:34 -0400)]
drm/amd/display: Power on front end during set mode.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add audio/video ContainerId implementation
xhdu [Tue, 21 Mar 2017 15:05:32 +0000 (11:05 -0400)]
drm/amd/display: Add audio/video ContainerId implementation

Leave hardcoded if no ContainerId provided by DM.

Signed-off-by: Duke Du <Duke.Du@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: using calculated values for VReady/Startup
Charlene Liu [Tue, 21 Mar 2017 19:16:04 +0000 (15:16 -0400)]
drm/amd/display: using calculated values for VReady/Startup

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: remove redundant check
Charlene Liu [Mon, 20 Mar 2017 18:49:53 +0000 (14:49 -0400)]
drm/amd/display: remove redundant check

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: DP is hotplugged, HDMI with 4:2:0 corruption
Charlene Liu [Fri, 17 Mar 2017 17:09:09 +0000 (13:09 -0400)]
drm/amd/display: DP is hotplugged, HDMI with 4:2:0 corruption

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix applying surface to underlay pipe
Leon Elazar [Fri, 17 Mar 2017 16:02:58 +0000 (12:02 -0400)]
drm/amd/display: Fix applying surface to underlay pipe

1. Locking all pipes before doing any changes
2. Applying surface for both top and bottom pipes

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Set cursor pitch to cursor width (in pixels).
Andrey Grodzovsky [Wed, 22 Feb 2017 19:23:51 +0000 (14:23 -0500)]
drm/amd/display: Set cursor pitch to cursor width (in pixels).

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Unhardcode cursor size reported back to UMD.
Andrey Grodzovsky [Wed, 22 Feb 2017 19:24:11 +0000 (14:24 -0500)]
drm/amd/display: Unhardcode cursor size reported back to UMD.

This will return back MAX cursor size for given ASIC.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Unhardcode acrtc->max_cursor_{height,width}
Andrey Grodzovsky [Wed, 22 Feb 2017 20:31:47 +0000 (15:31 -0500)]
drm/amd/display: Unhardcode acrtc->max_cursor_{height,width}

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@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 gfx9 parameters reading for DC.
Andrey Grodzovsky [Wed, 8 Feb 2017 20:58:50 +0000 (15:58 -0500)]
drm/amd/display: Fix gfx9 parameters reading for DC.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fix the NULL pointer. (v2)
Andrey Grodzovsky [Thu, 16 Mar 2017 19:51:00 +0000 (15:51 -0400)]
drm/amd/display: Fix the NULL pointer. (v2)

ret value in amdgpu_dm_atomic_check was not rest to EINVAL
after drm_atomic_add_affected_planes and by this making
any subsequent validation failure pass when returning
to atomic_check.

v2: Add WARN_ON print for dc_commit_streams in
amdgpu_dm_atomic_commit_tail since this should never
fail.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: support PHY compliance automation for CP2520 pattern 1/2/3
Tony Cheng [Tue, 14 Mar 2017 23:16:36 +0000 (19:16 -0400)]
drm/amd/display: support PHY compliance automation for CP2520 pattern 1/2/3

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: support CP2520 pattern 2 for HBR2 compliance
Tony Cheng [Tue, 14 Mar 2017 20:30:06 +0000 (16:30 -0400)]
drm/amd/display: support CP2520 pattern 2 for HBR2 compliance

- also some clean up

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Use stream_enc to get head pipe.
Yongqiang Sun [Tue, 14 Mar 2017 20:41:50 +0000 (16:41 -0400)]
drm/amd/display: Use stream_enc to get head pipe.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: remove dc_pre_update_surfaces_to_stream from dc use
Dmytro Laktyushkin [Tue, 14 Mar 2017 16:30:29 +0000 (12:30 -0400)]
drm/amd/display: remove dc_pre_update_surfaces_to_stream from dc use

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: use extended receiver cap for dpcd ver
Tony Cheng [Tue, 14 Mar 2017 05:40:53 +0000 (01:40 -0400)]
drm/amd/display: use extended receiver cap for dpcd ver

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: changing the dc_update_surfaces_and_stream
Leon Elazar [Tue, 14 Mar 2017 15:54:31 +0000 (11:54 -0400)]
drm/amd/display: changing the dc_update_surfaces_and_stream

1. Adding the ability to update the stream parameters during FULL_UPDATE type

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: fix bw calc internal initialization error
Dmytro Laktyushkin [Tue, 14 Mar 2017 15:16:11 +0000 (11:16 -0400)]
drm/amd/display: fix bw calc internal initialization error

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Fixed bandwidth calculation error when converting fractions
Logatharshan Thothiralingam [Thu, 9 Mar 2017 16:37:26 +0000 (11:37 -0500)]
drm/amd/display: Fixed bandwidth calculation error when converting fractions

[Problem]
VSR greyed out

[Root cause]
When converting fractions, we were using the integer function, which let to
a large display clock and the view was not supported

[Solution]
Change the integer to fraction functions

Signed-off-by: Logatharshan Thothiralingam <logatharshan.thothiralingam@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: adding new dc_update_surfaces_and_stream
Leon Elazar [Thu, 9 Mar 2017 19:38:15 +0000 (14:38 -0500)]
drm/amd/display: adding new dc_update_surfaces_and_stream

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/soc15: enable dc on vega10
Alex Deucher [Wed, 19 Apr 2017 21:28:47 +0000 (17:28 -0400)]
drm/amdgpu/soc15: enable dc on vega10

Add the DC display module to drive the DCE12 IP on vega10.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Remove DCE12 guards
Alex Deucher [Thu, 15 Jun 2017 20:21:43 +0000 (16:21 -0400)]
drm/amd/display: Remove DCE12 guards

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Less log spam
Jordan Lazare [Wed, 8 Mar 2017 19:04:16 +0000 (14:04 -0500)]
drm/amd/display: Less log spam

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: need to handle DCE_Info table ver4.2
Charlene Liu [Tue, 7 Mar 2017 21:54:32 +0000 (16:54 -0500)]
drm/amd/display: need to handle DCE_Info table ver4.2

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Enable DCE12 support
Alex Deucher [Thu, 15 Jun 2017 20:20:24 +0000 (16:20 -0400)]
drm/amd/display: Enable DCE12 support

This wires DCE12 support into DC and enables it.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add DCE12 core support
Harry Wentland [Mon, 6 Mar 2017 19:36:02 +0000 (14:36 -0500)]
drm/amd/display: Add DCE12 core support

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add DCE12 irq support
Harry Wentland [Mon, 6 Mar 2017 19:34:18 +0000 (14:34 -0500)]
drm/amd/display: Add DCE12 irq support

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add DCE12 i2c/aux support
Harry Wentland [Mon, 6 Mar 2017 19:33:19 +0000 (14:33 -0500)]
drm/amd/display: Add DCE12 i2c/aux support

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add DCE12 gpio support
Harry Wentland [Mon, 6 Mar 2017 19:32:06 +0000 (14:32 -0500)]
drm/amd/display: Add DCE12 gpio support

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Add DCE12 bios parser support
Harry Wentland [Mon, 6 Mar 2017 19:29:52 +0000 (14:29 -0500)]
drm/amd/display: Add DCE12 bios parser support

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: get display info from DC when DC enabled.
Rex Zhu [Tue, 28 Feb 2017 08:21:27 +0000 (16:21 +0800)]
drm/amdgpu: get display info from DC when DC enabled.

Signed-off-by: Rex Zhu <Rex.Zhu@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 incorrect vp adjustment
Dmytro Laktyushkin [Wed, 8 Mar 2017 18:45:33 +0000 (13:45 -0500)]
drm/amd/display: fix incorrect vp adjustment

Viewport would be incorrectly adjusted when surface was used
for multiple displays

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Less log spam
Jordan Lazare [Wed, 8 Mar 2017 19:04:16 +0000 (14:04 -0500)]
drm/amd/display: Less log spam

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: fix viewport adjustment on rotated surface
Dmytro Laktyushkin [Mon, 6 Mar 2017 23:02:30 +0000 (18:02 -0500)]
drm/amd/display: fix viewport adjustment on rotated surface

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: fix hsplit viewport calculation for rotated/mirrored usecases
Dmytro Laktyushkin [Mon, 6 Mar 2017 19:57:28 +0000 (14:57 -0500)]
drm/amd/display: fix hsplit viewport calculation for rotated/mirrored usecases

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: add init calculation to scaler params
Dmytro Laktyushkin [Wed, 1 Mar 2017 23:27:17 +0000 (18:27 -0500)]
drm/amd/display: add init calculation to scaler params

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Refactor on dc_sink structure.
Zeyu Fan [Tue, 7 Mar 2017 16:48:50 +0000 (11:48 -0500)]
drm/amd/display: Refactor on dc_sink structure.

Signed-off-by: Zeyu Fan <Zeyu.Fan@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Switch to DRM helpers in s3.
Andrey Grodzovsky [Thu, 20 Apr 2017 19:59:25 +0000 (15:59 -0400)]
drm/amd/display: Switch to DRM helpers in s3.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Do not copy bottom pipe when map resource.
Yongqiang Sun [Mon, 6 Mar 2017 19:58:59 +0000 (14:58 -0500)]
drm/amd/display: Do not copy bottom pipe when map resource.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: After program backend, also program front end regs.
Yongqiang Sun [Fri, 3 Mar 2017 14:37:11 +0000 (09:37 -0500)]
drm/amd/display: After program backend, also program front end regs.

Issue:
In case of two 4K@60 + one non-4k monitor, when unplug non-4k monitor,
the remain two 4k monitor don't work properly.
Reason:
In that case, two 4k use two pipes and no split, when unplug happens,
those two monitor will use 4 pipes and split, but on that time, frontend
is not programed properly.
Solution:
After programed backend, front end should be programmed as per new pipe
setting.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: TPS4 logic typo fix
Charlene Liu [Fri, 3 Mar 2017 20:16:03 +0000 (15:16 -0500)]
drm/amd/display: TPS4 logic typo fix

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: move refclk from dc to resource_pool
Charlene Liu [Fri, 3 Mar 2017 18:44:35 +0000 (13:44 -0500)]
drm/amd/display: move refclk from dc to resource_pool

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Memory leak fix during disable
Leon Elazar [Fri, 3 Mar 2017 19:37:08 +0000 (14:37 -0500)]
drm/amd/display: Memory leak fix during disable

1.current_context memory wasn't released at
dc_post_update_surfaces_to_stream during context swap.

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: refclock from bios firmwareInfoTable
Charlene Liu [Fri, 3 Mar 2017 02:18:03 +0000 (21:18 -0500)]
drm/amd/display: refclock from bios firmwareInfoTable

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/display: Simplify some DMCU waits
Amy Zhang [Wed, 1 Mar 2017 14:46:20 +0000 (09:46 -0500)]
drm/amd/display: Simplify some DMCU waits

Signed-off-by: Amy Zhang <Amy.Zhang@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>