summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* drm/amd/display: Create DWB resource for DCN2Charlene Liu2019-06-225-1/+134
| | | | | | | | | | | [Description] dcn20 has num_dwb =1 in the res cap, but not created. Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Reviewed-by: Duke Du <Duke.Du@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Intermittent DCN2 pipe hang on mode changeAric Cyr2019-06-222-5/+12
| | | | | | | | | | | | | | | [Why] GSL is being used to synchronize pipes when vsync is off but on transition to vsync on during a mode change GSL is not being reset correctly. [How] Disable GSL on any plane that is disabled. Signed-off-by: Aric Cyr <aric.cyr@amd.com> Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Add support for extended DSC DPCD capsNikola Cornij2019-06-226-60/+289
| | | | | | | | | | | | [why] A few of the new DSC DPCD caps were introduced by a DP 1.4a SCR in order to give DSC branch decoders a chance to expose their maximum throughput and maximum line width limitations. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Do a reg update instead of set when writing ODM color formatNikola Cornij2019-06-221-1/+1
| | | | | | | | | | | | | [why] If a set is done, DSC settings are zeroed out, leading to no DSC for the modes that require ODM, such as 8k60. This was a regression introduced by 5a4f26295176bbfc776c75aaf0f6dd8ccf806958. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Eric Bernstein <Eric.Bernstein@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: add flags for gamut map libraryVitaly Prosyak2019-06-221-1/+23
| | | | | | | | | | | | | [Why & How] Gamut map lib provides a wider gamut mapping options vs BT2390 Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com> Acked-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Acked-by: Vitaly Prosyak <Vitaly.Prosyak@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: block passive dongle EDID Emulation for USB-C portsSamson Tam2019-06-221-0/+2
| | | | | | | | | | | | | | | [Why] Emulating passive dongle on USB-C port causes issue on some asics. [How] Check for DP_IS_USB_C flag in bios parser and propagate it to encoder features flags. If DP_IS_USB_C flag is set and it is trying to emulate passive dongle, then return fail. Signed-off-by: Samson Tam <Samson.Tam@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: DCHUB requestors numbers for Navi.Yongqiang Sun2019-06-221-1/+23
| | | | | | | | | | | | | | | | | | | | | | | [Why] The DCHub arbiter has a mechanism to dynamically rate limit the DCHub request stream to the fabric. If the memory controller is fully utilized and the DCHub requestors are well ahead of their amortized schedule, then it is safe to prevent the next winner from being committed and sent to the fabric. The utilization of the memory controller is approximated by ensuring that the number of outstanding requests is greater than a threshold specified by the ARB_MIN_REQ_OUTSTANDING. To determine that the DCHub requestors are well ahead of the amortized schedule, the slack of the next winner is compared with the ARB_SAT_LEVEL in DLG RefClk cycles. [How] The recommended settings to enable thise dynamic limiting for Navi is 180 requests. Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Add 170Mpix/sec DSC throughput supportNikola Cornij2019-06-223-245/+12
| | | | | | | | | | | | | | [why] It was missing, although defined in DP spec [how] - Add handling of this value to DSC code - Also remove unused file dsc_helpers.c Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Joshua Aberback <Joshua.Aberback@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: add SW_USE_I2C_REG request.Charlene Liu2019-06-221-0/+2
| | | | | | | | | | | [Description] This is for DC_I2c arbitration use between HW use/SW use and DMCU use. Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Make sure line size is not zero in DCN2 line buffer size ↵Nikola Cornij2019-06-221-4/+13
| | | | | | | | | | | | | | | | calculations [why] 'Divide by zero' error happens when line size happens to be zero. [how] The code that makes sure line size minimum value can be 1 was already present in DCN1 part of the driver, this is mearly a port to DCN2. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Change DCN2 vupdate start programmingEryk Brol2019-06-221-6/+3
| | | | | | | | | | | | | | | | [Why] In order to ensure that incoming flips are latched and complete immediately, we need to program the vupdate interrupt to come during the back porch of each frame. [How] Program the vupdate start_line to be in the back porch like it's done for DCN1. Signed-off-by: Eryk Brol <eryk.brol@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Refactor program watermark.Yongqiang Sun2019-06-222-1/+5
| | | | | | | | | | Refactor programming watermark function: Divided into urgent watermark, stutter watermark and pstate watermark. Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: fix dcn2 mpc split decisionDmytro Laktyushkin2019-06-221-1/+1
| | | | | | | | | | | The split condition is broken and will always activate at the moment. Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Add hubp_init entry to hubp vtableCharlene Liu2019-06-224-5/+11
| | | | | | | | | | | | | | Different HW will need to init HUBP differently. For now, add a vtable entry, and hook a NO-OP for DCN1 and DCN2. In addition, future HW will need to access the HUBPREQ_DEBUG and CUR_TTU_CNTL0 register for hubp_init. Add that here. Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Fix ODM combine data formatIlya Bakoulin2019-06-225-5/+20
| | | | | | | | | | | | | | | [Why] OPTC data format was left at its default value (444) when enabling ODM combine. This caused issues with FPGA capture. [How] Write the OPTC_DATA_FORMAT field when enabling ODM combine. Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com> Reviewed-by: Eric Bernstein <Eric.Bernstein@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Remove duplicate define of TO_DCN20_HUBBUBYongqiang Sun2019-06-221-3/+0
| | | | | | | | Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Add power down display on boot flagThomas Lim2019-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | [Why] Due to the generic introduction of seamless boot, the display is no longer blanked upon boot. However, this causes corruption on some systems that does not lock the memory in the non-secure boot case, resulting in brief corruption on boot due to garbage being written into the frame buffer. [How] Add a flag, read during DC init, to determine whether display should be blanked on boot. Default to true. Signed-off-by: Thomas Lim <Thomas.Lim@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Consider DSC target bpp precision when calculating DSC ↵Nikola Cornij2019-06-222-12/+23
| | | | | | | | | | | | | | | | | | target bpp [why] DSC target bpp precision is a decoder DPCD and an AMD encoder capability. It must be taken into account when calculating target bitrate. [how] Add a DC DSC function that does this calculation. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Acked-by: Tony Cheng <Tony.Cheng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: enable abm on dcn2Josip Pavic2019-06-222-7/+27
| | | | | | | | | | | | | | | [Why] ABM is currently not enabled on DCN2. [How] Update the register name list for DCN2 and un-comment the code that creates the abm object. Signed-off-by: Josip Pavic <Josip.Pavic@amd.com> Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Implement DSC MST fair share algorithmWenjing Liu2019-06-223-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | [why] The current policy will always enable DSC to 12 bpp regardless of if the current bandwidth is enough for MST displays. This logic is not optimal because user will get lower quality output if DSC compression is enabled. This change to is to implement a DSC MST bandwidth fair share algorithm so we will dynamically decide if DSC is needed and what quality (target bpp) is needed to fairly destribute the MST bandwidth in one MST topology. This will allow user to see the most optimal image quality with the given bandwidth. [how] We will start with lowest bandwidth possible and run a Max-Min fairness algorithm to fairly distribute the available bandwidth. If there is still remaining bandwidth, we will try to fit the timing without DSC compression. Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com> Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Acquire DSC HW resource only if required by streamNikola Cornij2019-06-224-73/+97
| | | | | | | | | | | | | | | | [why] There are ASICs that have fewer DSC engines than pipes, which makes DSC a resource that should be used only if required. [how] Acquire DSC HW resource if required by stream and release when not required anymore. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Disable display writeback on Linux for NV10hersen wu2019-06-221-1/+1
| | | | | | | | | | | | [WHY] system crash when initialize dwb current linux driver does not support dwb. disable this feature for now. [HOW] set num_dwb = 0 to disable dwb for now Signed-off-by: hersen wu <hersenxs.wu@amd.com> Reviewed-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Add vupdate interrupt sources to NV10hersen wu2019-06-221-0/+12
| | | | | | | | | | | | | | [WHY] linux upstream already has interrupt vupdate for freesync in dcn10. dcn20 interrupt shares the same source code as dcn10. but dcn20 interrupt translator does not add vupdate interrupt. this cause index of vupdate aarray be negative which causes crash. [HOW] add vupdate into dc interrupt transltor Signed-off-by: hersen wu <hersenxs.wu@amd.com> Reviewed-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Mark DSC resource as unused after copying to the secondary ↵Nikola Cornij2019-06-221-0/+3
| | | | | | | | | | | | | | | | | ODM pipe [why] DSC resource has to be acquired before it can be used and simply copying a reference to it is very likely to cause problems when accessing DSC. [how] Set DSC resource pointer to NULL to mark it as unused after primary pipe resources were copied to the secondary ODM pipe. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Change Min fclk to 1.2GhzTyler DiBattista2019-06-221-2/+2
| | | | | | | | | | | | | | | | [Why] Some nightly tests are failing since the new value for fclk is a bit too low. Also, a new test for the maximum downscale case was needed. [How] Updated the default value for fclk to be 1.2GHz. Signed-off-by: Tyler DiBattista <tyler.dibattista@amd.com> Reviewed-by: Eric Bernstein <Eric.Bernstein@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Acked-by: Tony Cheng <Tony.Cheng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: add global master update lock for DCN2Wenjing Liu2019-06-225-1/+72
| | | | | | | | | | | | | | | | | | [why] when an update programming sequence requires both front end and back end pipe to be updated synchronously, a global update lock needs to be set to ensure that we don't get a frame with only front end update but not the back end update. [how] setup global lock parameters on enable_stream_timing. enable global lock when pipe_control_lock_global is called. disable global lock when pipe_control_lock is called. Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Remove REFCYC regsYongqiang Sun2019-06-221-5/+2
| | | | | | | | | | | | | [Why] Some register fields are not needed. [How] remove them Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Add profiling tools for bandwidth validationJoshua Aberback2019-06-221-0/+13
| | | | | | | | | | | | | | | [Why] We used this change to investigate the performance of bandwidth validation, it will be useful to have if we need to investigate further. [How] We use performance counter tick numbers to profile performance, they live at dc->debug.bw_val_profile (set .enable in debugger to turn on measuring). Signed-off-by: Joshua Aberback <joshua.aberback@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Optimize bandwidth validation by adding early returnJoshua Aberback2019-06-223-18/+31
| | | | | | | | | | | | | | We can split validation into three parts: getting voltage level, getting watermarks, and rq/dlg calculations. The voltage level is enough to answer the question "do we support this state", and the rest of it is to determine what hardware programming is needed to support the state. Most of the calls to validate_bandwidth only care about the first part, so we added an early return in that case Signed-off-by: Joshua Aberback <joshua.aberback@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Properly guard display_mode_vba with DCN2Leo Li2019-06-223-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Why] display_mode_vba is for DCN2 and up. When building for upstream (DCN1 enabled only), there will be a build error, since display_mode_vba.c/h is stripped out. Note that building DCN1 only with internal dal-dev is still fine, since display_mode_vba.h is not stripped out internally - only in upstream. The make directives therefore stll work, and so will any #include's. [How] Since subsequent generations require DCN2 enabled anyways, guard the makefile directive for display_mode_vba.o with DCN2. Guard any includes with DCN2. In addition, guard the entire contents of display_mode_vba.h with DCN2, to simulate the file being stripped out in upstream. A forward declaration for 'struct display_mode_lib' also needs to be added in display_mode_lib.h. Previously, display_mode_vba.h contained the forward declaration, and display_mode_lib.h in turn included it. This won't work if mode_vba.h is stripped out, requring mode_lib.h to do so itself. Signed-off-by: Leo Li <sunpeng.li@amd.com> Reviewed-by: Harry Wentland <Harry.Wentland@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Guard DML_FAIL_DSC_VALIDATION_FAILURELeo Li2019-06-221-0/+2
| | | | | | | | | | | | | [Why] Usage of this enum is DSC-only. [How] Guard it with CONFIG_DRM_AMD_DC_DSC_SUPPORT. Signed-off-by: Leo Li <sunpeng.li@amd.com> Reviewed-by: Harry Wentland <Harry.Wentland@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Add 3dlut control flagsVitaly Prosyak2019-06-221-18/+18
| | | | | | | | | | | | [Why & How] The follow up change Improve some naming for fields and structs Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Acked-by: Vitaly Prosyak <Vitaly.Prosyak@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: fix can not turn on two displays due to DSC_RESOURCE failed.Charlene Liu2019-06-221-0/+6
| | | | | | | | | | | | | | [Why] Can not turn on two displays at the same time with the asic having only one DSC. DC_DSC_RESOURCE allocation failed. [Solution] Only add_dsc if the timing is dsc capable based on diag_dc and num_dsc Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Wesley Chalmers <Wesley.Chalmers@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Fix DCFCLK and SOCCLK not setIlya Bakoulin2019-06-221-0/+4
| | | | | | | | | | | | | | | [Why] If voltage level > 0, DCFCLK and SOCCLK could be 0 during DML calculations, which ended up causing an assert. [How] Initialize dcfclk_mhz and socclk_mhz values according to the voltage level. Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com> Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: DCN2 reg refactorsYongqiang Sun2019-06-222-7/+42
| | | | | | | | | Added some regs and exposed some functions for future use Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Add some tm3dlut flagsVitaly Prosyak2019-06-222-12/+37
| | | | | | | | | | | Move flags from color_gamma.h to mod_shared.h and add more options and setting structures Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Acked-by: Vitaly Prosyak <Vitaly.Prosyak@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Make sure DSC slice height is divisible by 2 for 4:2:0 ↵Nikola Cornij2019-06-221-2/+11
| | | | | | | | | | | color format [why] DSC spec requires this Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Use 1/8th DSC target bitrate precision for N4:2:2 and 4:2:0 ↵Nikola Cornij2019-06-221-0/+4
| | | | | | | | | | | | | | | | | | formats [why] On at least some of the devices (e.g. Realtek scaler) we get a black screen if 1/16th precision is used. [how] Work around it by reducing precision to 1/8th for N4:2:2 and 4:2:0 color formats. This is a safe workaround and would have a very mild impact on the quality. The issue is still to be root-caused and fixed correctly. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: isolate global double buffer lock programmingWenjing Liu2019-06-224-53/+35
| | | | | | | | | | | | | | | | [why] Global optic double buffer lock is currently disabled due to incorrect programming sequence that affects non global lock. [how] Isolate global lock programming sequence out of non global lock programming sequence, so it can be enabled without affecting non global lock. Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com> Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Remove additional FEC link bandwidth reductionNikola Cornij2019-06-221-3/+2
| | | | | | | | | | | | | | | [why] This is now done in the original link bandwidth calculation and DSC must not do this anymore. [how] Remove the line of code that should have been removed when transition to correctly applying FEC overhead was made. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: move dsc clock from plane_resource to stream_resourceTony Cheng2019-06-222-4/+3
| | | | | | | | | code restructure. Signed-off-by: Tony Cheng <tony.cheng@amd.com> Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: fix fpga fclk programmingDmytro Laktyushkin2019-06-221-3/+6
| | | | | | | | | We shouldnt need overhead on top of dppclk when setting fclk. Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Reviewed-by: Eric Bernstein <Eric.Bernstein@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: remove target_dpp hack for dscWenjing Liu2019-06-221-21/+6
| | | | | | | | | Remove dc_dsc hack for MST policy Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com> Reviewed-by: Nikola Cornij <Nikola.Cornij@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: remove legacy DSC functionsWenjing Liu2019-06-222-124/+9
| | | | | | | | | | | | | | | [why] Clean up some dsc legacy functions that are no longer needed. [how] remove two dsc functions in dc_dsc, use dc_bandwidth_in_kbps_from_timing instead of calc_required_bandwidth_for_timing. Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com> Reviewed-by: Nikola Cornij <Nikola.Cornij@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Remove dependency on pipe->plane for immedaite flip statusJoshua Aberback2019-06-222-5/+7
| | | | | | | | | | | | | | | | | | [Why] dcn20_apply_ctx_for_surface can be called with 0 planes, which means we should blank the display. In this case when we get down to dcn20_setup_gsl_group_as_lock, pipe_ctx->plane_state is NULL, but we don't check for it. However, this function is only called by dcn20_pipe_control_lock, and in that function we alraedy have a local for the immediate flip status, which is what we care about in the plane state. [How] - pass in immediate flip status as parameter Signed-off-by: Joshua Aberback <joshua.aberback@amd.com> Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: fix dsc validationDmytro Laktyushkin2019-06-225-40/+60
| | | | | | | | | | | | | Currently dsc is validated not taking the image width limitation into mind. This change addresses that, but due to previous design being limited to non odm dsc validation additional sequence changes are made. Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Reviewed-by: Nikola Cornij <Nikola.Cornij@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Properly set u clockAidan Wood2019-06-221-1/+1
| | | | | | | | | | | | | | [Why] u clk set request was being sent in units of mts, when it needed to be in units of Mhz [How] add a division by 16 to convert from mts to Mhz Signed-off-by: Aidan Wood <Aidan.Wood@amd.com> Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Properly set DCF clockAidan Wood2019-06-221-2/+5
| | | | | | | | | | | | | | | | | | | [Why] If num_states == 0 we did update_bound_box which doesn't updated any max clocks if num_states == 0, therefore we need to do cap_soc_clocks instead, also SMU cannot set DCF clock to a higher than or equal to freq than SOC clock [How] Add a num_states != 0 check for update_bounding_box to be run, and after we run get_maximum_sustainable_clocks we now check if the reported max value of DCF is higher than SOC and if necessary set it to 1000 (becomes 1 after division by 1000) lower than SOC Signed-off-by: Aidan Wood <Aidan.Wood@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Calculate link bandwidth in a common functionNikola Cornij2019-06-223-15/+7
| | | | | | | | | | | | | | | | | | [why] Currently link bandwidth is calculated in various places using the same multi-step formula. Doing this in one common place makes sure the same formula will indeed be applied to all link bandwidth calculations. It also makes it possible to apply link-setting-specific adjustments that affect effective link bandwidth. [how] Replace all implementations of link bandwidth calculation with a call to a function. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Nikola Cornij <Nikola.Cornij@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/display: Add a flags union for 3dlut transformation matrixVitaly Prosyak2019-06-221-0/+12
| | | | | | | | | | | | | | [Why & How] When TM is enabled with 3dlut, we apply conversion to dcip3 in gamut remap matrix, if source area less than dcip3. If it is bigger, we remap to bt2020. The added flags will be used to facilitate this logic. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>