Re: [Freedreno] [RFC PATCH 8/9] iommu/arm-smmu-qcom: Stop using mmu500 reset for v2 MMUs

2022-10-26 Thread Sai Prakash Ranjan
On 10/21/2022 10:25 PM, Dmitry Baryshkov wrote: The arm_mmu500_reset() writes into registers specific for MMU500. For the generic ARM SMMU v2 these registers (sACR) are defined as 'implementation defined'. Downstream Qualcomm driver for SMMUv2 doesn't touch them. Reviewed-by: Sai Prakash Ranja

Re: [Freedreno] [RFC PATCH 9/9] iommu/arm-smmu-qcom: Add generic qcom, smmu-500 match entry

2022-10-26 Thread Sai Prakash Ranjan
On 10/21/2022 10:25 PM, Dmitry Baryshkov wrote: Add generic qcom,smmu-500 compatibility string. Newer platforms should use this generic entry rather than declaring per-SoC entries. Reviewed-by: Sai Prakash Ranjan Tested-by: Sai Prakash Ranjan Signed-off-by: Dmitry Baryshkov --- drivers

Re: [Freedreno] [RFC PATCH 6/9] iommu/arm-smmu-qcom: provide separate implementation for SDM845-smmu-500

2022-10-26 Thread Sai Prakash Ranjan
On 10/21/2022 10:25 PM, Dmitry Baryshkov wrote: There is only one platform, which needs special care in the reset function, the SDM845. Add special handler for sdm845 and drop the qcom_smmu500_reset() function. Reviewed-by: Sai Prakash Ranjan Tested-by: Sai Prakash Ranjan Signed-off-by: D

Re: [Freedreno] [RFC PATCH 5/9] iommu/arm-smmu-qcom: Move the qcom, adreno-smmu check into qcom_smmu_create

2022-10-26 Thread Sai Prakash Ranjan
On 10/21/2022 10:25 PM, Dmitry Baryshkov wrote: Move special handling of qcom,adreno-smmu into qcom_smmu_create() function. This allows us to further customize the Adreno SMMU implementation. Note, this also adds two entries to the qcom_smmu_impl_of_match table. They were used with the qcom,adre

Re: [Freedreno] [RFC PATCH 4/9] iommu/arm-smmu-qcom: Move implementation data into match data

2022-10-26 Thread Sai Prakash Ranjan
On 10/21/2022 10:25 PM, Dmitry Baryshkov wrote: In preparation to rework of the implementation and configuration details, make qcom_smmu_create() accept new qcom_smmu_match_data structure pointer. Make implementation a field in this struct. Reviewed-by: Sai Prakash Ranjan Tested-by: Sai Praka

Re: [Freedreno] [RFC PATCH 7/9] iommu/arm-smmu-qcom: Merge table from arm-smmu-qcom-debug into match data

2022-10-26 Thread Sai Prakash Ranjan
On 10/21/2022 10:25 PM, Dmitry Baryshkov wrote: There is little point in having a separate match table in arm-smmu-qcom-debug.c. Merge it into the main match data table in arm-smmu-qcom.c Note, this also enables debug support for sm6375 and ACPI-based sc8180x systems, since these SoCs are expect

Re: [Freedreno] [PATCH v3 01/12] dt-bindings: display/msm: Add binding for SC8280XP MDSS

2022-10-26 Thread Bjorn Andersson
On Wed, Oct 26, 2022 at 12:54:41PM -0500, Rob Herring wrote: > On Tue, Oct 25, 2022 at 08:26:13PM -0700, Bjorn Andersson wrote: > > From: Bjorn Andersson > > > > Add binding for the display subsystem and display processing unit in the > > Qualcomm SC8280XP platform. > > > > Signed-off-by: Bjorn

Re: [Freedreno] [PATCH v3 12/12] arm64: dts: qcom: sa8295-adp: Enable DP instances

2022-10-26 Thread Bjorn Andersson
On Wed, Oct 26, 2022 at 01:50:15PM +0200, Johan Hovold wrote: > On Tue, Oct 25, 2022 at 08:26:24PM -0700, Bjorn Andersson wrote: > > From: Bjorn Andersson > > > > The SA8295P ADP has, among other interfaces, six MiniDP connectors which > > are connected to MDSS0 DP2 and DP3, and MDSS1 DP0 through

Re: [Freedreno] [PATCH v3 09/12] drm/msm/dp: HPD handling relates to next_bridge

2022-10-26 Thread Bjorn Andersson
On Wed, Oct 26, 2022 at 09:08:49AM +0300, Dmitry Baryshkov wrote: > > > On 26 October 2022 06:26:21 EEST, Bjorn Andersson > wrote: > >From: Bjorn Andersson > > > >The DisplayPort controller's internal HPD interrupt handling is used for > >cases where the HPD signal is connected to a GPIO which

Re: [Freedreno] [PATCH v4 06/10] drm/msm/dsi: Migrate to drm_dsc_compute_rc_parameters()

2022-10-26 Thread Dmitry Baryshkov
On 26/10/2022 21:28, Marijn Suijten wrote: As per the FIXME this code is entirely duplicate with what is already provided inside drm_dsc_compute_rc_parameters(), supposedly because that function was yielding "incorrect" results while in reality the panel driver(s?) used for testing were providing

[Freedreno] [PATCH v4 09/10] drm/msm/dpu1: Account for DSC's bits_per_pixel having 4 fractional bits

2022-10-26 Thread Marijn Suijten
According to the comment this DPU register contains the bits per pixel as a 6.4 fractional value, conveniently matching the contents of bits_per_pixel in struct drm_dsc_config which also uses 4 fractional bits. However, the downstream source this implementation was copy-pasted from has its bpp fie

[Freedreno] [PATCH v4 05/10] drm/msm/dsi: Appropriately set dsc->mux_word_size based on bpc

2022-10-26 Thread Marijn Suijten
This field is currently unread but will come into effect when duplicated code below is migrated to call drm_dsc_compute_rc_parameters(), which uses the bpc-dependent value of the local variable mux_words_size in much the same way. The hardcoded constant seems to be a remnant from the `/* bpc 8 */`

[Freedreno] [PATCH v4 08/10] drm/msm/dsi: Disallow 8 BPC DSC configuration for alternative BPC values

2022-10-26 Thread Marijn Suijten
According to the `/* bpc 8 */` comment below only values for a bits_per_component of 8 are currently hardcoded in place. This is further confirmed by downstream sources [1] containing different constants for other BPC values (and different initial_offset too, with an extra dependency on bits_per_p

[Freedreno] [PATCH v4 10/10] drm/msm/dsi: Prevent signed BPG offsets from bleeding into adjacent bits

2022-10-26 Thread Marijn Suijten
The bpg_offset array contains negative BPG offsets which fill the full 8 bits of a char thanks to two's complement: this however results in those bits bleeding into the next field when the value is packed into DSC PPS by the drm_dsc_helper function, which only expects range_bpg_offset to contain 6-

[Freedreno] [PATCH v4 06/10] drm/msm/dsi: Migrate to drm_dsc_compute_rc_parameters()

2022-10-26 Thread Marijn Suijten
As per the FIXME this code is entirely duplicate with what is already provided inside drm_dsc_compute_rc_parameters(), supposedly because that function was yielding "incorrect" results while in reality the panel driver(s?) used for testing were providing incorrect parameters. For example, this cod

[Freedreno] [PATCH v4 07/10] drm/msm/dsi: Account for DSC's bits_per_pixel having 4 fractional bits

2022-10-26 Thread Marijn Suijten
drm_dsc_config's bits_per_pixel field holds a fractional value with 4 bits, which all panel drivers should adhere to for drm_dsc_pps_payload_pack() to generate a valid payload. All code in the DSI driver here seems to assume that this field doesn't contain any fractional bits, hence resulting in t

[Freedreno] [PATCH v4 03/10] drm/msm/dsi: Use DIV_ROUND_UP instead of conditional increment on modulo

2022-10-26 Thread Marijn Suijten
This exact same math is used to compute bytes_in_slice above in dsi_update_dsc_timing(), also used to fill slice_chunk_size. Fixes: b9080324d6ca ("drm/msm/dsi: add support for dsc data") Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Marijn Suijten --- drivers/gpu/drm/

[Freedreno] [PATCH v4 04/10] drm/msm/dsi: Reuse earlier computed dsc->slice_chunk_size

2022-10-26 Thread Marijn Suijten
dsi_populate_dsc_params() is called prior to dsi_update_dsc_timing() and already computes a value for slice_chunk_size, whose value doesn't need to be recomputed and re-set here. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry

[Freedreno] [PATCH v4 02/10] drm/msm/dsi: Remove repeated calculation of slice_per_intf

2022-10-26 Thread Marijn Suijten
slice_per_intf is already computed for intf_width, which holds the same value as hdisplay. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Reviewed-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Reviewed-by: Abhinav Kumar Reviewed-by: Vinod Koul Reviewed-by: Dmitry Barys

[Freedreno] [PATCH v4 01/10] drm/msm/dsi: Remove useless math in DSC calculations

2022-10-26 Thread Marijn Suijten
Multiplying a value by 2 and adding 1 to it always results in a value that is uneven, and that 1 gets truncated immediately when performing integer division by 2 again. There is no "rounding" possible here. After that target_bpp_x16 is used to store a multiplication of bits_per_pixel by 16 which

[Freedreno] [PATCH v4 00/10] drm/msm: Fix math issues in MSM DSC implementation

2022-10-26 Thread Marijn Suijten
Various removals of complex yet unnecessary math, fixing all uses of drm_dsc_config::bits_per_pixel to deal with the fact that this field includes four fractional bits, and finally making sure that range_bpg_offset contains values 6-bits wide to prevent overflows in drm_dsc_pps_payload_pack(). Alt

Re: [Freedreno] [PATCH v3 01/12] dt-bindings: display/msm: Add binding for SC8280XP MDSS

2022-10-26 Thread Rob Herring
On Tue, Oct 25, 2022 at 08:26:13PM -0700, Bjorn Andersson wrote: > From: Bjorn Andersson > > Add binding for the display subsystem and display processing unit in the > Qualcomm SC8280XP platform. > > Signed-off-by: Bjorn Andersson > Signed-off-by: Bjorn Andersson > --- > > Changes since v2: >

Re: [Freedreno] [PATCH v3 01/12] dt-bindings: display/msm: Add binding for SC8280XP MDSS

2022-10-26 Thread Rob Herring
On Tue, 25 Oct 2022 20:26:13 -0700, Bjorn Andersson wrote: > From: Bjorn Andersson > > Add binding for the display subsystem and display processing unit in the > Qualcomm SC8280XP platform. > > Signed-off-by: Bjorn Andersson > Signed-off-by: Bjorn Andersson > --- > > Changes since v2: > - Cle

Re: [Freedreno] [PATCH v3 10/12] arm64: dts: qcom: sc8280xp: Define some of the display blocks

2022-10-26 Thread Johan Hovold
On Tue, Oct 25, 2022 at 08:26:22PM -0700, Bjorn Andersson wrote: > From: Bjorn Andersson > > Define the display clock controllers, the MDSS instances, the DP phys > and connect these together. > > Signed-off-by: Bjorn Andersson > Signed-off-by: Bjorn Andersson > --- > > Changes since v2: > -

Re: [Freedreno] [PATCH v3 12/12] arm64: dts: qcom: sa8295-adp: Enable DP instances

2022-10-26 Thread Johan Hovold
On Tue, Oct 25, 2022 at 08:26:24PM -0700, Bjorn Andersson wrote: > From: Bjorn Andersson > > The SA8295P ADP has, among other interfaces, six MiniDP connectors which > are connected to MDSS0 DP2 and DP3, and MDSS1 DP0 through DP3. > > Enable Display Clock controllers, MDSS instanced, MDPs, DP co

Re: [Freedreno] [PATCH v2 0/7] drm/bridge_connector: perform HPD enablement automatically

2022-10-26 Thread Dmitry Baryshkov
On 26/10/2022 14:21, Tomi Valkeinen wrote: On 24/10/2022 18:39, Dmitry Baryshkov wrote:  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP DRM driver do a proper work of calling drm_bridge_connector_en/disable_hpd() in right places. Rather than teaching each and every driver

Re: [Freedreno] [PATCH v2 0/7] drm/bridge_connector: perform HPD enablement automatically

2022-10-26 Thread Tomi Valkeinen
On 24/10/2022 18:39, Dmitry Baryshkov wrote: From all the drivers using drm_bridge_connector only iMX/dcss and OMAP DRM driver do a proper work of calling drm_bridge_connector_en/disable_hpd() in right places. Rather than teaching each and every driver how to properly handle drm_bridge_connector

Re: [Freedreno] [PATCH v2 2/7] drm/probe-helper: enable and disable HPD on connectors

2022-10-26 Thread Tomi Valkeinen
On 24/10/2022 18:39, Dmitry Baryshkov wrote: Intruct two drm_connector_helper_funcs: enable_hpd() and disable_hpd(). "Introduce"? They are called by drm_kms_helper_poll_enable() and drm_kms_helper_poll_disable() (and thus drm_kms_helper_poll_init() and drm_kms_helper_poll_fini()) respectively