[PATCH v3] drm/amd/display: Add MST atomic routines

2019-10-16 Thread mikita.lipski
From: Mikita Lipski - Adding encoder atomic check to find vcpi slots for a connector - Using DRM helper functions to calculate PBN - Adding connector atomic check to release vcpi slots if connector loses CRTC - Calculate PBN and VCPI slots only once during atomic check and store them on crtc_sta

[PATCH v4] drm/amd/display: Add MST atomic routines

2019-10-17 Thread mikita.lipski
From: Mikita Lipski - Adding encoder atomic check to find vcpi slots for a connector - Using DRM helper functions to calculate PBN - Adding connector atomic check to release vcpi slots if connector loses CRTC - Calculate PBN and VCPI slots only once during atomic check and store them on crtc_sta

[PATCH v5] drm/amd/display: Add MST atomic routines

2019-10-24 Thread mikita.lipski
From: Mikita Lipski - Adding encoder atomic check to find vcpi slots for a connector - Using DRM helper functions to calculate PBN - Adding connector atomic check to release vcpi slots if connector loses CRTC - Calculate PBN and VCPI slots only once during atomic check and store them on crtc_sta

[PATCH v7] drm/amd/display: Add MST atomic routines

2019-10-28 Thread mikita.lipski
From: Mikita Lipski - Adding encoder atomic check to find vcpi slots for a connector - Using DRM helper functions to calculate PBN - Adding connector atomic check to release vcpi slots if connector loses CRTC - Calculate PBN and VCPI slots only once during atomic check and store them on crtc_sta

[PATCH v3 00/13] DSC MST support for AMDGPU

2019-10-29 Thread mikita.lipski
From: Mikita Lipski This set of patches is a continuation of DSC enablement patches for AMDGPU. This set enables DSC on MST. It also contains implementation of both encoder and connector atomic check routines. First 10 patches have been introduced in multiple iterations to the mailing list befo

[PATCH 03/13] drm/dp_mst: Parse FEC capability on MST ports

2019-10-29 Thread mikita.lipski
From: David Francis As of DP1.4, ENUM_PATH_RESOURCES returns a bit indicating if FEC can be supported up to that point in the MST network. The bit is the first byte of the ENUM_PATH_RESOURCES ack reply, bottom-most bit (refer to section 2.11.9.4 of DP standard, v1.4) That value is needed for FE

[PATCH 11/13] drm/amd/display: MST DSC compute fair share

2019-10-29 Thread mikita.lipski
From: David Francis If there is limited link bandwidth on a MST network, it must be divided fairly between the streams on that network Implement an algorithm to determine the correct DSC config for each stream The algorithm: This [ ] ( ) represents the range of b

[PATCH 08/13] drm/amd/display: Initialize DSC PPS variables to 0

2019-10-29 Thread mikita.lipski
From: David Francis For DSC MST, sometimes monitors would break out in full-screen static. The issue traced back to the PPS generation code, where these variables were being used uninitialized and were picking up garbage. memset to 0 to avoid this Reviewed-by: Nicholas Kazlauskas Signed-off-by

[PATCH 07/13] drm/dp_mst: Add new quirk for Synaptics MST hubs

2019-10-29 Thread mikita.lipski
From: Mikita Lipski Synaptics DP1.4 hubs (BRANCH_ID 0x90CC24) do not support virtual DPCD registers, but do support DSC. The DSC caps can be read from the physical aux, like in SST DSC. These hubs have many different DEVICE_IDs. Add a new quirk to detect this case. Reviewed-by: Wenjing Liu Rev

[PATCH 12/13] drm/dp_mst: Add DSC enablement helpers to DRM

2019-10-29 Thread mikita.lipski
From: Mikita Lipski Adding the following elements to add MST DSC support to DRM: - dsc_enable boolean flag to drm_dp_vcpi_allocation structure to signal, which port got DSC enabled - function drm_dp_helper_update_vcpi_slots_for_dsc allows reallocation of newly recalculated VCPI slots and raises

[PATCH 01/13] drm/amd/display: Add MST atomic routines

2019-10-29 Thread mikita.lipski
From: Mikita Lipski - Adding encoder atomic check to find vcpi slots for a connector - Using DRM helper functions to calculate PBN - Adding connector atomic check to release vcpi slots if connector loses CRTC - Calculate PBN and VCPI slots only once during atomic check and store them on crtc_sta

[PATCH 06/13] drm/dp_mst: Add helpers for MST DSC and virtual DPCD aux

2019-10-29 Thread mikita.lipski
From: David Francis Add drm_dp_mst_dsc_aux_for_port. To enable DSC, the DSC_ENABLED register might have to be written on the leaf port's DPCD, its parent's DPCD, or the MST manager's DPCD. This function finds the correct aux for the job. As part of this, add drm_dp_mst_is_virtual_dpcd. Virtual D

[PATCH 04/13] drm/dp_mst: Add MST support to DP DPCD R/W functions

2019-10-29 Thread mikita.lipski
From: David Francis Instead of having drm_dp_dpcd_read/write and drm_dp_mst_dpcd_read/write as entry points into the aux code, have drm_dp_dpcd_read/write handle both. This means that DRM drivers can make MST DPCD read/writes. v2: Fix spacing v3: Dump dpcd access on MST read/writes v4: Fix call

[PATCH 09/13] drm/amd/display: Validate DSC caps on MST endpoints

2019-10-29 Thread mikita.lipski
From: David Francis During MST mode enumeration, if a new dc_sink is created, populate it with dsc caps as appropriate. Use drm_dp_mst_dsc_aux_for_port to get the raw caps, then parse them onto dc_sink with dc_dsc_parse_dsc_dpcd. Reviewed-by: Wenjing Liu Signed-off-by: David Francis --- .../

[PATCH 05/13] drm/dp_mst: Fill branch->num_ports

2019-10-29 Thread mikita.lipski
From: David Francis This field on drm_dp_mst_branch was never filled It is initialized to zero when the port is kzallocced. When a port is added to the list, increment num_ports, and when a port is removed from the list, decrement num_ports. v2: remember to decrement on port removal v3: don't e

[PATCH 02/13] drm/dp_mst: Add PBN calculation for DSC modes

2019-10-29 Thread mikita.lipski
From: David Francis With DSC, bpp can be fractional in multiples of 1/16. Change drm_dp_calc_pbn_mode to reflect this, adding a new parameter bool dsc. When this parameter is true, treat the bpp parameter as having units not of bits per pixel, but 1/16 of a bit per pixel v2: Don't add separate

[PATCH 10/13] drm/amd/display: Write DSC enable to MST DPCD

2019-10-29 Thread mikita.lipski
From: David Francis Rework the dm_helpers_write_dsc_enable callback to handle the MST case. Use the cached dsc_aux field. Reviewed-by: Wenjing Liu Signed-off-by: David Francis --- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 19 ++- 1 file changed, 18 insertions(+), 1 dele

[PATCH 13/13] drm/amd/display: Recalculate VCPI slots for new DSC connectors

2019-10-29 Thread mikita.lipski
From: Mikita Lipski Since for DSC MST connector's PBN is claculated differently due to compression, we have to recalculate both PBN and VCPI slots for that connector. The function iterates through all the active streams to find, which have DSC enabled, then recalculates PBN for it and calls drm_

[PATCH 07/13] drm/dp_mst: Add new quirk for Synaptics MST hubs

2019-10-30 Thread mikita.lipski
From: Mikita Lipski Synaptics DP1.4 hubs (BRANCH_ID 0x90CC24) do not support virtual DPCD registers, but do support DSC. The DSC caps can be read from the physical aux, like in SST DSC. These hubs have many different DEVICE_IDs. Add a new quirk to detect this case. Reviewed-by: Wenjing Liu Rev

[PATCH 08/13] drm/amd/display: Initialize DSC PPS variables to 0

2019-10-30 Thread mikita.lipski
From: David Francis For DSC MST, sometimes monitors would break out in full-screen static. The issue traced back to the PPS generation code, where these variables were being used uninitialized and were picking up garbage. memset to 0 to avoid this Reviewed-by: Nicholas Kazlauskas Signed-off-by

[PATCH 10/13] drm/amd/display: Write DSC enable to MST DPCD

2019-10-30 Thread mikita.lipski
From: David Francis Rework the dm_helpers_write_dsc_enable callback to handle the MST case. Use the cached dsc_aux field. Reviewed-by: Wenjing Liu Signed-off-by: David Francis --- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 19 ++- 1 file changed, 18 insertions(+), 1 dele

[PATCH 02/13] drm/dp_mst: Add PBN calculation for DSC modes

2019-10-30 Thread mikita.lipski
From: David Francis With DSC, bpp can be fractional in multiples of 1/16. Change drm_dp_calc_pbn_mode to reflect this, adding a new parameter bool dsc. When this parameter is true, treat the bpp parameter as having units not of bits per pixel, but 1/16 of a bit per pixel v2: Don't add separate

[PATCH 04/13] drm/dp_mst: Add MST support to DP DPCD R/W functions

2019-10-30 Thread mikita.lipski
From: David Francis Instead of having drm_dp_dpcd_read/write and drm_dp_mst_dpcd_read/write as entry points into the aux code, have drm_dp_dpcd_read/write handle both. This means that DRM drivers can make MST DPCD read/writes. v2: Fix spacing v3: Dump dpcd access on MST read/writes v4: Fix call

[PATCH 06/13] drm/dp_mst: Add helpers for MST DSC and virtual DPCD aux

2019-10-30 Thread mikita.lipski
From: David Francis Add drm_dp_mst_dsc_aux_for_port. To enable DSC, the DSC_ENABLED register might have to be written on the leaf port's DPCD, its parent's DPCD, or the MST manager's DPCD. This function finds the correct aux for the job. As part of this, add drm_dp_mst_is_virtual_dpcd. Virtual D

[PATCH 03/13] drm/dp_mst: Parse FEC capability on MST ports

2019-10-30 Thread mikita.lipski
From: David Francis As of DP1.4, ENUM_PATH_RESOURCES returns a bit indicating if FEC can be supported up to that point in the MST network. The bit is the first byte of the ENUM_PATH_RESOURCES ack reply, bottom-most bit (refer to section 2.11.9.4 of DP standard, v1.4) That value is needed for FE

[PATCH 05/13] drm/dp_mst: Fill branch->num_ports

2019-10-30 Thread mikita.lipski
From: David Francis This field on drm_dp_mst_branch was never filled It is initialized to zero when the port is kzallocced. When a port is added to the list, increment num_ports, and when a port is removed from the list, decrement num_ports. v2: remember to decrement on port removal v3: don't e

[PATCH 01/13] drm/amd/display: Add MST atomic routines

2019-10-30 Thread mikita.lipski
From: Mikita Lipski - Adding encoder atomic check to find vcpi slots for a connector - Using DRM helper functions to calculate PBN - Adding connector atomic check to release vcpi slots if connector loses CRTC - Calculate PBN and VCPI slots only once during atomic check and store them on crtc_sta

[PATCH v4 00/13] DSC MST support for AMDGPU

2019-10-30 Thread mikita.lipski
From: Mikita Lipski This set of patches is a continuation of DSC enablement patches for AMDGPU. This set enables DSC on MST. It also contains implementation of both encoder and connector atomic check routines. First 10 patches have been introduced in multiple iterations to the mailing list befo

[PATCH 09/13] drm/amd/display: Validate DSC caps on MST endpoints

2019-10-30 Thread mikita.lipski
From: David Francis During MST mode enumeration, if a new dc_sink is created, populate it with dsc caps as appropriate. Use drm_dp_mst_dsc_aux_for_port to get the raw caps, then parse them onto dc_sink with dc_dsc_parse_dsc_dpcd. Reviewed-by: Wenjing Liu Signed-off-by: David Francis --- .../

[PATCH 13/13] drm/amd/display: Recalculate VCPI slots for new DSC connectors

2019-10-30 Thread mikita.lipski
From: Mikita Lipski Since for DSC MST connector's PBN is claculated differently due to compression, we have to recalculate both PBN and VCPI slots for that connector. The function iterates through all the active streams to find, which have DSC enabled, then recalculates PBN for it and calls drm_

[PATCH 12/13] drm/dp_mst: Add DSC enablement helpers to DRM

2019-10-30 Thread mikita.lipski
From: Mikita Lipski Adding the following elements to add MST DSC support to DRM: - dsc_enable boolean flag to drm_dp_vcpi_allocation structure to signal, which port got DSC enabled - function drm_dp_helper_update_vcpi_slots_for_dsc allows reallocation of newly recalculated VCPI slots and raises

[PATCH 11/13] drm/amd/display: MST DSC compute fair share

2019-10-30 Thread mikita.lipski
From: David Francis If there is limited link bandwidth on a MST network, it must be divided fairly between the streams on that network Implement an algorithm to determine the correct DSC config for each stream The algorithm: This [ ] ( ) represents the range of b

[PATCH v5 00/13] DSC MST support for DRM and AMDGPU

2019-11-07 Thread mikita.lipski
From: Mikita Lipski Patches are based of amd-staging-drm-next, the follow up set of patches will be sent for drm-tip This set of patches is a continuation of DSC enablement patches for AMDGPU. This set enables DSC on MST. It also contains implementation of both encoder and connector atomic check

[PATCH v6 02/13] drm/dp_mst: Parse FEC capability on MST ports

2019-11-07 Thread mikita.lipski
From: David Francis As of DP1.4, ENUM_PATH_RESOURCES returns a bit indicating if FEC can be supported up to that point in the MST network. The bit is the first byte of the ENUM_PATH_RESOURCES ack reply, bottom-most bit (refer to section 2.11.9.4 of DP standard, v1.4) That value is needed for FE

[PATCH v6 01/13] drm/dp_mst: Add PBN calculation for DSC modes

2019-11-07 Thread mikita.lipski
From: David Francis With DSC, bpp can be fractional in multiples of 1/16. Change drm_dp_calc_pbn_mode to reflect this, adding a new parameter bool dsc. When this parameter is true, treat the bpp parameter as having units not of bits per pixel, but 1/16 of a bit per pixel v2: Don't add separate

[PATCH v6 09/13] drm/amd/display: Write DSC enable to MST DPCD

2019-11-07 Thread mikita.lipski
From: David Francis Rework the dm_helpers_write_dsc_enable callback to handle the MST case. Use the cached dsc_aux field. Reviewed-by: Wenjing Liu Signed-off-by: David Francis --- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 19 ++- 1 file changed, 18 insertions(+), 1 dele

[PATCH v6 08/13] drm/amd/display: Validate DSC caps on MST endpoints

2019-11-07 Thread mikita.lipski
From: David Francis During MST mode enumeration, if a new dc_sink is created, populate it with dsc caps as appropriate. Use drm_dp_mst_dsc_aux_for_port to get the raw caps, then parse them onto dc_sink with dc_dsc_parse_dsc_dpcd. Reviewed-by: Wenjing Liu Signed-off-by: David Francis --- .../

[PATCH v6 05/13] drm/dp_mst: Add helpers for MST DSC and virtual DPCD aux

2019-11-07 Thread mikita.lipski
From: David Francis Add drm_dp_mst_dsc_aux_for_port. To enable DSC, the DSC_ENABLED register might have to be written on the leaf port's DPCD, its parent's DPCD, or the MST manager's DPCD. This function finds the correct aux for the job. As part of this, add drm_dp_mst_is_virtual_dpcd. Virtual D

[PATCH v6 04/13] drm/dp_mst: Fill branch->num_ports

2019-11-07 Thread mikita.lipski
From: David Francis This field on drm_dp_mst_branch was never filled It is initialized to zero when the port is kzallocced. When a port is added to the list, increment num_ports, and when a port is removed from the list, decrement num_ports. v2: remember to decrement on port removal v3: don't e

[PATCH v6 03/13] drm/dp_mst: Add MST support to DP DPCD R/W functions

2019-11-07 Thread mikita.lipski
From: David Francis Instead of having drm_dp_dpcd_read/write and drm_dp_mst_dpcd_read/write as entry points into the aux code, have drm_dp_dpcd_read/write handle both. This means that DRM drivers can make MST DPCD read/writes. v2: Fix spacing v3: Dump dpcd access on MST read/writes v4: Fix call

[PATCH v6 12/13] drm/amd/display: MST DSC compute fair share

2019-11-07 Thread mikita.lipski
From: David Francis If there is limited link bandwidth on a MST network, it must be divided fairly between the streams on that network Implement an algorithm to determine the correct DSC config for each stream The algorithm: This [ ] ( ) represents the range of b

[PATCH v6 07/13] drm/amd/display: Initialize DSC PPS variables to 0

2019-11-07 Thread mikita.lipski
From: David Francis For DSC MST, sometimes monitors would break out in full-screen static. The issue traced back to the PPS generation code, where these variables were being used uninitialized and were picking up garbage. memset to 0 to avoid this Reviewed-by: Nicholas Kazlauskas Signed-off-by

[PATCH v6 11/13] drm/dp_mst: Add branch bandwidth validation to MST atomic check

2019-11-07 Thread mikita.lipski
From: Mikita Lipski Adding PBN attribute to drm_dp_vcpi_allocation structure to keep track of how much bandwidth each Port requires. Adding drm_dp_mst_atomic_check_bw_limit to verify that state's bandwidth needs doesn't exceed available bandwidth. The funtion is called in drm_dp_mst_atomic_check

[PATCH v6 10/13] drm/dp_mst: Add DSC enablement helpers to DRM

2019-11-07 Thread mikita.lipski
From: Mikita Lipski Adding a helper function to be called by drivers outside of DRM to enable DSC on the MST ports. Function is called to recalculate VCPI allocation if DSC is enabled and raise the DSC flag to enable. In case of disabling DSC the flag is set to false and recalculation of VCPI sl

[PATCH v6 13/13] drm/amd/display: Recalculate VCPI slots for new DSC connectors

2019-11-07 Thread mikita.lipski
From: Mikita Lipski Since for DSC MST connector's PBN is claculated differently due to compression, we have to recalculate both PBN and VCPI slots for that connector. The function iterates through all the active streams to find, which have DSC enabled, then recalculates PBN for it and calls drm_

[PATCH v6 06/13] drm/dp_mst: Add new quirk for Synaptics MST hubs

2019-11-07 Thread mikita.lipski
From: Mikita Lipski Synaptics DP1.4 hubs (BRANCH_ID 0x90CC24) do not support virtual DPCD registers, but do support DSC. The DSC caps can be read from the physical aux, like in SST DSC. These hubs have many different DEVICE_IDs. Add a new quirk to detect this case. Reviewed-by: Wenjing Liu Rev

[PATCH 2/2] drm/amd/display: Fix coding error in connector atomic check

2019-11-12 Thread mikita.lipski
From: Mikita Lipski [why] For MST connector atomic check we have to check a new CRTC state instead of an old one, when checking if CRTC is disabled to release VCPI slots allocated. Signed-off-by: Mikita Lipski --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +- 1 file chang

[PATCH 1/2] drm/amd/display: Return correct error value

2019-11-12 Thread mikita.lipski
From: Mikita Lipski [why] The function is expected to return instance of the timing generator therefore we shouldn't be returning boolean in integer function, and we shouldn't be returning zero so changing it to -1. Signed-off-by: Mikita Lipski --- drivers/gpu/drm/amd/display/dc/core/dc_resour

[PATCH 2/2] drm/dsc: Use 32-bit integers for some DSC parameter calculations

2019-11-13 Thread mikita.lipski
From: Mikita Lipski [why] There are a few DSC PPS parameters, such as scale_increment_interval, that could overflow 16-bit integer if non-DSC-spec-compliant configuration was used. There is a check in the code against that, however 16-bit integer is used to store those values, which invalidates t

[PATCH 1/2] drm/dsc: Update drm_dsc to reflect native 4.2.0 DSC spec

2019-11-13 Thread mikita.lipski
From: Mikita Lipski [Why] Some parts of the DSC spec relating to 4.2.0 were not reflected in drm_dsc_compute_rc_parameters, causing unexpected config failures [How] Add nsl_bpg_offset and rbs_min computation Signed-off-by: David Francis Signed-off-by: Mikita Lipski --- drivers/gpu/drm/drm_ds

[PATCH v7 00/17] DSC MST support for DRM and AMDGPU

2019-11-16 Thread mikita.lipski
From: Mikita Lipski Patches are based of amd-staging-drm-next, the follow up set of patches will be sent for drm-tip This set of patches is a continuation of DSC enablement patches for AMDGPU. This set enables DSC on MST. It also contains implementation of both encoder and connector atomic check

[PATCH v7 12/17] drm/dp_mst: Add branch bandwidth validation to MST atomic check

2019-11-16 Thread mikita.lipski
From: Mikita Lipski Adding PBN attribute to drm_dp_vcpi_allocation structure to keep track of how much bandwidth each Port requires. Adding drm_dp_mst_atomic_check_bw_limit to verify that state's bandwidth needs doesn't exceed available bandwidth. The funtion is called in drm_dp_mst_atomic_check

[PATCH v7 09/17] drm/amd/display: Write DSC enable to MST DPCD

2019-11-16 Thread mikita.lipski
From: David Francis Rework the dm_helpers_write_dsc_enable callback to handle the MST case. Use the cached dsc_aux field. Reviewed-by: Wenjing Liu Signed-off-by: David Francis Signed-off-by: Mikita Lipski --- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 19 ++- 1 file cha

[PATCH v7 01/17] drm/dp_mst: Add PBN calculation for DSC modes

2019-11-16 Thread mikita.lipski
From: David Francis With DSC, bpp can be fractional in multiples of 1/16. Change drm_dp_calc_pbn_mode to reflect this, adding a new parameter bool dsc. When this parameter is true, treat the bpp parameter as having units not of bits per pixel, but 1/16 of a bit per pixel v2: Don't add separate

[PATCH v7 11/17] drm/dp_mst: Add DSC enablement helpers to DRM

2019-11-16 Thread mikita.lipski
From: Mikita Lipski Adding a helper function to be called by drivers outside of DRM to enable DSC on the MST ports. Function is called to recalculate VCPI allocation if DSC is enabled and raise the DSC flag to enable. In case of disabling DSC the flag is set to false and recalculation of VCPI sl

[PATCH v7 06/17] drm/dp_mst: Add new quirk for Synaptics MST hubs

2019-11-16 Thread mikita.lipski
From: Mikita Lipski Synaptics DP1.4 hubs (BRANCH_ID 0x90CC24) do not support virtual DPCD registers, but do support DSC. The DSC caps can be read from the physical aux, like in SST DSC. These hubs have many different DEVICE_IDs. Add a new quirk to detect this case. Reviewed-by: Wenjing Liu Rev

[PATCH v7 13/17] drm/dp_mst: Add helper to trigger modeset on affected DSC MST CRTCs

2019-11-16 Thread mikita.lipski
From: Mikita Lipski [why] Whenever a connector on an MST network is changed or undergoes a modeset, the DSC configs for each stream on that topology will be recalculated. This can change their required bandwidth, requiring a full reprogramming, as though a modeset was performed, even if that stre

[PATCH v7 03/17] drm/dp_mst: Add MST support to DP DPCD R/W functions

2019-11-16 Thread mikita.lipski
From: David Francis Instead of having drm_dp_dpcd_read/write and drm_dp_mst_dpcd_read/write as entry points into the aux code, have drm_dp_dpcd_read/write handle both. This means that DRM drivers can make MST DPCD read/writes. v2: Fix spacing v3: Dump dpcd access on MST read/writes v4: Fix call

[PATCH v7 10/17] drm/dp_mst: Manually overwrite PBN divider for calculating timeslots

2019-11-16 Thread mikita.lipski
From: Mikita Lipski [why] For DSC case we cannot always use topology manager's PBN divider variable. The default divider does not take FEC into account. Therefore we should allow driver to calculate its own divider based on the link rate and count its handling, as it is hw specific. [how] Pass pb

[PATCH v7 17/17] drm/amd/display: Trigger modesets on MST DSC connectors

2019-11-16 Thread mikita.lipski
From: Mikita Lipski Whenever a connector on an MST network is attached, detached, or undergoes a modeset, the DSC configs for each stream on that topology will be recalculated. This can change their required bandwidth, requiring a full reprogramming, as though a modeset was performed, even if tha

[PATCH v7 04/17] drm/dp_mst: Fill branch->num_ports

2019-11-16 Thread mikita.lipski
From: David Francis This field on drm_dp_mst_branch was never filled It is initialized to zero when the port is kzallocced. When a port is added to the list, increment num_ports, and when a port is removed from the list, decrement num_ports. v2: remember to decrement on port removal v3: don't e

[PATCH v7 07/17] drm/amd/display: Initialize DSC PPS variables to 0

2019-11-16 Thread mikita.lipski
From: David Francis For DSC MST, sometimes monitors would break out in full-screen static. The issue traced back to the PPS generation code, where these variables were being used uninitialized and were picking up garbage. memset to 0 to avoid this Reviewed-by: Nicholas Kazlauskas Signed-off-by

[PATCH v7 05/17] drm/dp_mst: Add helpers for MST DSC and virtual DPCD aux

2019-11-16 Thread mikita.lipski
From: David Francis Add drm_dp_mst_dsc_aux_for_port. To enable DSC, the DSC_ENABLED register might have to be written on the leaf port's DPCD, its parent's DPCD, or the MST manager's DPCD. This function finds the correct aux for the job. As part of this, add drm_dp_mst_is_virtual_dpcd. Virtual D

[PATCH v7 02/17] drm/dp_mst: Parse FEC capability on MST ports

2019-11-16 Thread mikita.lipski
From: David Francis As of DP1.4, ENUM_PATH_RESOURCES returns a bit indicating if FEC can be supported up to that point in the MST network. The bit is the first byte of the ENUM_PATH_RESOURCES ack reply, bottom-most bit (refer to section 2.11.9.4 of DP standard, v1.4) That value is needed for FE

[PATCH v7 14/17] drm/amd/display: Add PBN per slot calculation for DSC

2019-11-16 Thread mikita.lipski
From: Mikita Lipski [why] Need to calculate VCPI slots differently for DSC to take in account current link rate, link count and FEC. [how] Add helper to get pbn_div from dc_link Signed-off-by: Mikita Lipski --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 8 .../gpu/drm

[PATCH v7 16/17] drm/amd/display: Recalculate VCPI slots for new DSC connectors

2019-11-16 Thread mikita.lipski
From: Mikita Lipski [why] Since for DSC MST connector's PBN is claculated differently due to compression, we have to recalculate both PBN and VCPI slots for that connector. [how] The function iterates through all the active streams to find, which have DSC enabled, then recalculates PBN for it an

[PATCH v7 08/17] drm/amd/display: Validate DSC caps on MST endpoints

2019-11-16 Thread mikita.lipski
From: David Francis During MST mode enumeration, if a new dc_sink is created, populate it with dsc caps as appropriate. Use drm_dp_mst_dsc_aux_for_port to get the raw caps, then parse them onto dc_sink with dc_dsc_parse_dsc_dpcd. Reviewed-by: Wenjing Liu Signed-off-by: David Francis Signed-of

[PATCH v7 15/17] drm/amd/display: MST DSC compute fair share

2019-11-16 Thread mikita.lipski
From: David Francis If there is limited link bandwidth on a MST network, it must be divided fairly between the streams on that network Implement an algorithm to determine the correct DSC config for each stream The algorithm: This [ ] ( ) represents the range of b

[PATCH] drm/dsc: Return unsigned long on compute offset

2019-11-19 Thread mikita.lipski
From: Mikita Lipski We shouldn't compare int with unsigned long to find the max value and since we are not expecting negative value returned from compute_offset we should make this function return unsigned long so we can compare the values when computing rc parameters. Cc: Nikola Cornij Cc: Har

[PATCH v2] drm/dsc: Return unsigned long on compute offset

2019-11-22 Thread mikita.lipski
From: Mikita Lipski We shouldn't compare int with unsigned long to find the max value and since we are not expecting negative value returned from compute_offset we should make this function return unsigned long so we can compare the values when computing rc parameters. v2: Modified function para

[PATCH v8 02/17] drm/dp_mst: Parse FEC capability on MST ports

2019-12-03 Thread mikita.lipski
From: David Francis As of DP1.4, ENUM_PATH_RESOURCES returns a bit indicating if FEC can be supported up to that point in the MST network. The bit is the first byte of the ENUM_PATH_RESOURCES ack reply, bottom-most bit (refer to section 2.11.9.4 of DP standard, v1.4) That value is needed for FE

[PATCH v8 01/17] drm/dp_mst: Add PBN calculation for DSC modes

2019-12-03 Thread mikita.lipski
From: David Francis With DSC, bpp can be fractional in multiples of 1/16. Change drm_dp_calc_pbn_mode to reflect this, adding a new parameter bool dsc. When this parameter is true, treat the bpp parameter as having units not of bits per pixel, but 1/16 of a bit per pixel v2: Don't add separate

[PATCH v8 08/17] drm/amd/display: Validate DSC caps on MST endpoints

2019-12-03 Thread mikita.lipski
From: David Francis During MST mode enumeration, if a new dc_sink is created, populate it with dsc caps as appropriate. Use drm_dp_mst_dsc_aux_for_port to get the raw caps, then parse them onto dc_sink with dc_dsc_parse_dsc_dpcd. Reviewed-by: Wenjing Liu Signed-off-by: David Francis Signed-of

[PATCH v8 11/17] drm/dp_mst: Add DSC enablement helpers to DRM

2019-12-03 Thread mikita.lipski
From: Mikita Lipski Adding a helper function to be called by drivers outside of DRM to enable DSC on the MST ports. Function is called to recalculate VCPI allocation if DSC is enabled and raise the DSC flag to enable. In case of disabling DSC the flag is set to false and recalculation of VCPI sl

[PATCH v8 03/17] drm/dp_mst: Add MST support to DP DPCD R/W functions

2019-12-03 Thread mikita.lipski
From: David Francis Instead of having drm_dp_dpcd_read/write and drm_dp_mst_dpcd_read/write as entry points into the aux code, have drm_dp_dpcd_read/write handle both. This means that DRM drivers can make MST DPCD read/writes. v2: Fix spacing v3: Dump dpcd access on MST read/writes v4: Fix call

[PATCH v8 14/17] drm/amd/display: MST DSC compute fair share

2019-12-03 Thread mikita.lipski
From: David Francis If there is limited link bandwidth on a MST network, it must be divided fairly between the streams on that network Implement an algorithm to determine the correct DSC config for each stream The algorithm: This [ ] ( ) represents the range of b

[PATCH v8 00/17] DSC MST support for DRM and AMDGPU

2019-12-03 Thread mikita.lipski
From: Mikita Lipski This set of patches is a continuation of DSC enablement patches for AMDGPU. This set enables DSC on MST. It also contains implementation of both encoder and connector atomic check routines. These patches have been introduced in multiple iterations to the mailing list before.

[PATCH v8 12/17] drm/dp_mst: Add branch bandwidth validation to MST atomic check

2019-12-03 Thread mikita.lipski
From: Mikita Lipski Adding PBN attribute to drm_dp_vcpi_allocation structure to keep track of how much bandwidth each Port requires. Adding drm_dp_mst_atomic_check_bw_limit to verify that state's bandwidth needs doesn't exceed available bandwidth. The funtion is called in drm_dp_mst_atomic_check

[PATCH v8 07/17] drm/amd/display: Initialize DSC PPS variables to 0

2019-12-03 Thread mikita.lipski
From: David Francis For DSC MST, sometimes monitors would break out in full-screen static. The issue traced back to the PPS generation code, where these variables were being used uninitialized and were picking up garbage. memset to 0 to avoid this Reviewed-by: Nicholas Kazlauskas Signed-off-by

[PATCH v8 09/17] drm/amd/display: Write DSC enable to MST DPCD

2019-12-03 Thread mikita.lipski
From: David Francis Rework the dm_helpers_write_dsc_enable callback to handle the MST case. Use the cached dsc_aux field. Reviewed-by: Wenjing Liu Signed-off-by: David Francis Signed-off-by: Mikita Lipski --- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 19 ++- 1 file cha

[PATCH v8 05/17] drm/dp_mst: Add helpers for MST DSC and virtual DPCD aux

2019-12-03 Thread mikita.lipski
From: David Francis Add drm_dp_mst_dsc_aux_for_port. To enable DSC, the DSC_ENABLED register might have to be written on the leaf port's DPCD, its parent's DPCD, or the MST manager's DPCD. This function finds the correct aux for the job. As part of this, add drm_dp_mst_is_virtual_dpcd. Virtual D

[PATCH v8 06/17] drm/dp_mst: Add new quirk for Synaptics MST hubs

2019-12-03 Thread mikita.lipski
From: Mikita Lipski Synaptics DP1.4 hubs (BRANCH_ID 0x90CC24) do not support virtual DPCD registers, but do support DSC. The DSC caps can be read from the physical aux, like in SST DSC. These hubs have many different DEVICE_IDs. Add a new quirk to detect this case. Reviewed-by: Wenjing Liu Rev

[PATCH v8 13/17] drm/amd/display: Add PBN per slot calculation for DSC

2019-12-03 Thread mikita.lipski
From: Mikita Lipski [why] Need to calculate VCPI slots differently for DSC to take in account current link rate, link count and FEC. [how] Add helper to get pbn_div from dc_link Signed-off-by: Mikita Lipski --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 8 .../gpu/drm

[PATCH v8 04/17] drm/dp_mst: Fill branch->num_ports

2019-12-03 Thread mikita.lipski
From: David Francis This field on drm_dp_mst_branch was never filled It is initialized to zero when the port is kzallocced. When a port is added to the list, increment num_ports, and when a port is removed from the list, decrement num_ports. v2: remember to decrement on port removal v3: don't e

[PATCH v8 10/17] drm/dp_mst: Manually overwrite PBN divider for calculating timeslots

2019-12-03 Thread mikita.lipski
From: Mikita Lipski [why] For DSC case we cannot always use topology manager's PBN divider variable. The default divider does not take FEC into account. Therefore we should allow driver to calculate its own divider based on the link rate and count its handling, as it is hw specific. [how] Pass pb

[PATCH v8 16/17] drm/dp_mst: Add helper to trigger modeset on affected DSC MST CRTCs

2019-12-03 Thread mikita.lipski
From: Mikita Lipski [why] Whenever a connector on an MST network is changed or undergoes a modeset, the DSC configs for each stream on that topology will be recalculated. This can change their required bandwidth, requiring a full reprogramming, as though a modeset was performed, even if that stre

[PATCH v8 15/17] drm/amd/display: Recalculate VCPI slots for new DSC connectors

2019-12-03 Thread mikita.lipski
From: Mikita Lipski [why] Since for DSC MST connector's PBN is claculated differently due to compression, we have to recalculate both PBN and VCPI slots for that connector. [how] The function iterates through all the active streams to find, which have DSC enabled, then recalculates PBN for it an

[PATCH v8 17/17] drm/amd/display: Trigger modesets on MST DSC connectors

2019-12-03 Thread mikita.lipski
From: Mikita Lipski Whenever a connector on an MST network is attached, detached, or undergoes a modeset, the DSC configs for each stream on that topology will be recalculated. This can change their required bandwidth, requiring a full reprogramming, as though a modeset was performed, even if tha

[PATCH v9] drm/dp_mst: Add PBN calculation for DSC modes

2019-12-03 Thread mikita.lipski
From: David Francis With DSC, bpp can be fractional in multiples of 1/16. Change drm_dp_calc_pbn_mode to reflect this, adding a new parameter bool dsc. When this parameter is true, treat the bpp parameter as having units not of bits per pixel, but 1/16 of a bit per pixel v2: Don't add separate

[PATCH v9 06/18] drm/dp_mst: Add new quirk for Synaptics MST hubs

2019-12-13 Thread mikita.lipski
From: Mikita Lipski Synaptics DP1.4 hubs (BRANCH_ID 0x90CC24) do not support virtual DPCD registers, but do support DSC. The DSC caps can be read from the physical aux, like in SST DSC. These hubs have many different DEVICE_IDs. Add a new quirk to detect this case. v2: Fix error when checking r

[PATCH v9 04/18] drm/dp_mst: Fill branch->num_ports

2019-12-13 Thread mikita.lipski
From: David Francis This field on drm_dp_mst_branch was never filled It is initialized to zero when the port is kzallocced. When a port is added to the list, increment num_ports, and when a port is removed from the list, decrement num_ports. v2: remember to decrement on port removal v3: don't e

[PATCH v9 03/18] drm/dp_mst: Add MST support to DP DPCD R/W functions

2019-12-13 Thread mikita.lipski
From: David Francis Instead of having drm_dp_dpcd_read/write and drm_dp_mst_dpcd_read/write as entry points into the aux code, have drm_dp_dpcd_read/write handle both. This means that DRM drivers can make MST DPCD read/writes. v2: Fix spacing v3: Dump dpcd access on MST read/writes v4: Fix call

[PATCH v9 01/18] drm/dp_mst: Add PBN calculation for DSC modes

2019-12-13 Thread mikita.lipski
From: David Francis With DSC, bpp can be fractional in multiples of 1/16. Change drm_dp_calc_pbn_mode to reflect this, adding a new parameter bool dsc. When this parameter is true, treat the bpp parameter as having units not of bits per pixel, but 1/16 of a bit per pixel v2: Don't add separate

[PATCH v9 02/18] drm/dp_mst: Parse FEC capability on MST ports

2019-12-13 Thread mikita.lipski
From: David Francis As of DP1.4, ENUM_PATH_RESOURCES returns a bit indicating if FEC can be supported up to that point in the MST network. The bit is the first byte of the ENUM_PATH_RESOURCES ack reply, bottom-most bit (refer to section 2.11.9.4 of DP standard, v1.4) That value is needed for FE

[PATCH v9 09/18] drm/amd/display: Write DSC enable to MST DPCD

2019-12-13 Thread mikita.lipski
From: David Francis Rework the dm_helpers_write_dsc_enable callback to handle the MST case. Use the cached dsc_aux field. Reviewed-by: Wenjing Liu Signed-off-by: David Francis Signed-off-by: Mikita Lipski --- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 19 ++- 1 file cha

[PATCH v9 11/18] drm/dp_mst: Add DSC enablement helpers to DRM

2019-12-13 Thread mikita.lipski
From: Mikita Lipski Adding a helper function to be called by drivers outside of DRM to enable DSC on the MST ports. Function is called to recalculate VCPI allocation if DSC is enabled and raise the DSC flag to enable. In case of disabling DSC the flag is set to false and recalculation of VCPI sl

[PATCH v9 18/18] drm/amd/display: Trigger modesets on MST DSC connectors

2019-12-13 Thread mikita.lipski
From: Mikita Lipski Whenever a connector on an MST network is attached, detached, or undergoes a modeset, the DSC configs for each stream on that topology will be recalculated. This can change their required bandwidth, requiring a full reprogramming, as though a modeset was performed, even if tha

[PATCH v9 14/18] drm/amd/display: Add PBN per slot calculation for DSC

2019-12-13 Thread mikita.lipski
From: Mikita Lipski [why] Need to calculate VCPI slots differently for DSC to take in account current link rate, link count and FEC. [how] Add helper to get pbn_div from dc_link Cc: Harry Wentland Cc: Lyude Paul Signed-off-by: Mikita Lipski --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst

[PATCH v9 12/18] drm/dp_mst: Add branch bandwidth validation to MST atomic check

2019-12-13 Thread mikita.lipski
From: Mikita Lipski [why] Adding PBN attribute to drm_dp_vcpi_allocation structure to keep track of how much bandwidth each Port requires. Adding drm_dp_mst_atomic_check_bw_limit to verify that state's bandwidth needs doesn't exceed available bandwidth. The funtion is called in drm_dp_mst_atomic_

[PATCH v9 00/18] DSC MST support for DRM and AMDGPU

2019-12-13 Thread mikita.lipski
From: Mikita Lipski This set of patches is a continuation of DSC enablement patches for AMDGPU. This set enables DSC on MST. It also contains implementation of both encoder and connector atomic check routines. These patches have been introduced in multiple iterations to the mailing list before.

  1   2   >