Re: [Freedreno] [PATCH v4 07/19] drm/msm/dpu: drop zero features from dpu_mdp_cfg data

2023-07-02 Thread Abhinav Kumar
On 6/19/2023 2:25 PM, Dmitry Baryshkov wrote: Drop useless zero assignments to the dpu_mdp_cfg::features field. Reviewed-by: Marijn Suijten Tested-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- Reviewed-by: Abhinav Kumar

Re: [Freedreno] [PATCH v4 06/19] drm/msm/dpu: expand .clk_ctrls definitions

2023-07-02 Thread Abhinav Kumar
On 6/19/2023 2:25 PM, Dmitry Baryshkov wrote: Use more standard initialisation for .clk_ctrls definitions. Define a single .clk_ctrls field and use array init inside. Reviewed-by: Marijn Suijten Tested-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- Reviewed-by: Abhinav Kumar

Re: [Freedreno] [PATCH v4 05/19] drm/msm/dpu: drop enum dpu_mdp and MDP_TOP value

2023-07-02 Thread Abhinav Kumar
On 6/19/2023 2:25 PM, Dmitry Baryshkov wrote: Since there is always just a single MDP_TOP instance, drop the enum dpu_mdp and corresponding index value. Reviewed-by: Marijn Suijten Tested-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- Reviewed-by: Abhinav Kumar

Re: [Freedreno] [PATCH v4 04/19] drm/msm/dpu: drop dpu_mdss_cfg::mdp_count field

2023-07-02 Thread Abhinav Kumar
On 6/19/2023 2:25 PM, Dmitry Baryshkov wrote: There is always a single MDP TOP block. Drop the mdp_count field and stop declaring dpu_mdp_cfg instances as arrays. Tested-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- The change drops mdp_count and stops using the array which is fi

Re: [Freedreno] [PATCH v4 03/19] drm/msm/dpu: simplify peer LM handling

2023-07-02 Thread Abhinav Kumar
On 7/2/2023 6:36 PM, Dmitry Baryshkov wrote: On Mon, 3 Jul 2023 at 04:34, Abhinav Kumar wrote: On 6/19/2023 2:25 PM, Dmitry Baryshkov wrote: For each LM there is at max 1 peer LM which can be driven by the same CTL, so there no need to have a mask instead of just an ID of the peer LM.

Re: [Freedreno] [PATCH v4 03/19] drm/msm/dpu: simplify peer LM handling

2023-07-02 Thread Dmitry Baryshkov
On Mon, 3 Jul 2023 at 04:34, Abhinav Kumar wrote: > > > > On 6/19/2023 2:25 PM, Dmitry Baryshkov wrote: > > For each LM there is at max 1 peer LM which can be driven by the same > > CTL, so there no need to have a mask instead of just an ID of the peer > > LM. > > > > The change is ok but the word

Re: [Freedreno] [PATCH v4 03/19] drm/msm/dpu: simplify peer LM handling

2023-07-02 Thread Abhinav Kumar
On 6/19/2023 2:25 PM, Dmitry Baryshkov wrote: For each LM there is at max 1 peer LM which can be driven by the same CTL, so there no need to have a mask instead of just an ID of the peer LM. The change is ok but the wording seems incorrect. Are you implying that only LM0 and LM1 can be use

Re: [Freedreno] [PATCH v4 02/19] drm/msm/dpu: always use MSM_DP/DSI_CONTROLLER_n

2023-07-02 Thread Abhinav Kumar
On 6/19/2023 2:25 PM, Dmitry Baryshkov wrote: In several catalog entries we did not use existing MSM_DP_CONTROLLER_n constants. Fill them in. Also use freshly defined MSM_DSI_CONTROLLER_n for DSI interfaces. Reviewed-by: Marijn Suijten Tested-by: Marijn Suijten Signed-off-by: Dmitry Baryshk

[Freedreno] [PATCH 12/13] drm/msm: make fb debugfs file available only in KMS case

2023-07-02 Thread Dmitry Baryshkov
Don't register the 'fb' debugfs file, if there is no KMS (and so no framebuffers). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_debugfs.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugf

[Freedreno] [PATCH 13/13] drm/msm: carve out KMS code from msm_drv.c

2023-07-02 Thread Dmitry Baryshkov
The msm_drv.c contains generic code intermixed with KMS handling code. Move all KMS-related code to a separate msm_kms.c file, cleaning up init code while doing this move. This also prevents msm driver from registering modesetting / atomic interfaces in the headless case. Signed-off-by: Dmitry Bar

[Freedreno] [PATCH 11/13] drm/msm: only register 'kms' debug file if KMS is used

2023-07-02 Thread Dmitry Baryshkov
There is little point in having the empty debugfs file which always returns -ENODEV. Change this file to be created only if KMS is actually used. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_debugfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers

[Freedreno] [PATCH 09/13] drm/msm: rename msm_drv_shutdown() to msm_kms_shutdown()

2023-07-02 Thread Dmitry Baryshkov
The msm_drv_shutdown function should only be used in the KMS case. Rename it accordingly. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- drivers/gpu/drm/msm/msm

[Freedreno] [PATCH 07/13] drm/msm: rename msm_pm_prepare/complete to note the KMS nature

2023-07-02 Thread Dmitry Baryshkov
Rename the msm_pm_prepare() and msm_pm_complete() to msm_kms_pm_prepare() and msm_kms_pm_complete() consequently. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 ++-- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 4 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 4

[Freedreno] [PATCH 10/13] drm/msm: switch to drmm_mode_config_init()

2023-07-02 Thread Dmitry Baryshkov
Switch to drmm_mode_config_init() instead of drm_mode_config_init(). Drop drm_mode_config_cleanup() calls. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu

[Freedreno] [PATCH 08/13] drm/msm: remove shutdown callback from msm_platform_driver

2023-07-02 Thread Dmitry Baryshkov
The msm_drv_shutdown only makes sense for the KMS-enabled devices, while msm_platform_driver is only used in the headless case. Remove the shutdown callback from the driver structure. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.c | 1 - 1 file changed, 1 deletion(-) diff --g

[Freedreno] [PATCH 05/13] drm/msm: remove msm_drm_private::bridges field

2023-07-02 Thread Dmitry Baryshkov
As all output devices have switched to devm_drm_bridge_add(), we can drop the bridges array from struct msm_drm_private. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.c | 4 drivers/gpu/drm/msm/msm_drv.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/drivers/gpu/dr

[Freedreno] [PATCH 06/13] drm/msm: drop pm ops from the headless msm driver

2023-07-02 Thread Dmitry Baryshkov
The msm_pm_prepare()/msm_pm_complete() only make sense for the KMS-enabled devices, they have priv->kms guards inside. Drop global msm_pm_ops, which were used only by the headless msm device. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.c | 6 -- 1 file changed, 6 deletion

[Freedreno] [PATCH 02/13] drm/msm/hdmi: switch to devm_drm_bridge_add()

2023-07-02 Thread Dmitry Baryshkov
Make MSM HDMI driver use devm_drm_bridge_add() instead of plain drm_bridge_add(). As the driver doesn't require any additional cleanup, stop adding created bridge to the priv->bridges array. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c| 22 +-- driv

[Freedreno] [PATCH 04/13] drm/msm/dp: switch to devm_drm_bridge_add()

2023-07-02 Thread Dmitry Baryshkov
Make MSM DP driver use devm_drm_bridge_add() instead of plain drm_bridge_add(). As the driver doesn't require any additional cleanup, stop adding created bridge to the priv->bridges array. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 9 ++--- drivers/gpu/drm/msm

[Freedreno] [PATCH 03/13] drm/msm/dp: move pdev from struct dp_display_private to struct msm_dp

2023-07-02 Thread Dmitry Baryshkov
The dp_drm needs accessing the DP's platform device. Move pdev to the public structure. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 25 - drivers/gpu/drm/msm/dp/dp_display.h | 1 + 2 files changed, 13 insertions(+), 13 deletions(-) diff --g

[Freedreno] [PATCH 01/13] drm/msm/dsi: switch to devm_drm_bridge_add()

2023-07-02 Thread Dmitry Baryshkov
Make MSM DSI driver use devm_drm_bridge_add() instead of plain drm_bridge_add(). As the driver doesn't require any additional cleanup, stop adding created bridge to the priv->bridges array. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi.c | 28 +

[Freedreno] [PATCH 00/13] drm/msm: move KMS code from msm_drv.c

2023-07-02 Thread Dmitry Baryshkov
Currently both msm_drm_init() and msm_drm_uninit() functions are trying to handle both normal and headless Adreno cases. This results in a suboptimal code, since headless case still gets modesetting and atomic interfaces enabled. Two mentioned functions are a spaghetti of `if (priv->kms)' condition

[Freedreno] [PATCH v3 4/4] drm/msm/mdp5: move resource allocation to the _probe function

2023-07-02 Thread Dmitry Baryshkov
To let the probe function bail early if any of the resources is unavailable, move resource allocattion from kms_init directly to the probe callback. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 100 ++- 1 file chan

[Freedreno] [PATCH v3 3/4] drm/msm/mdp4: move resource allocation to the _probe function

2023-07-02 Thread Dmitry Baryshkov
To let the probe function bail early if any of the resources is unavailable, move resource allocattion from kms_init directly to the probe callback. While we are at it, replace irq_of_parse_and_map() with platform_get_irq(). Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers

[Freedreno] [PATCH v3 1/4] drm/msm: allow passing struct msm_kms to msm_drv_probe()

2023-07-02 Thread Dmitry Baryshkov
In preparation of moving resource allocation to the probe time, allow MSM KMS drivers to pass struct msm_kms pointer via msm_drv_probe(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 2 +- drivers/gpu/drm/msm/disp

[Freedreno] [PATCH v3 2/4] drm/msm/dpu: move resource allocation to the _probe function

2023-07-02 Thread Dmitry Baryshkov
To let the probe function bail early if any of the resources is unavailable, move resource allocattion from kms_init directly to the probe callback. While we are at it, replace irq_of_parse_and_map() with platform_get_irq(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_k

[Freedreno] [PATCH v3 0/4] drm/msm: move resource allocation to the _probe function

2023-07-02 Thread Dmitry Baryshkov
This patchset was left untouched for almost a year. Let's reiterate it in attempt to solve the long-standing issue. As discussed several times on IRC, move display subdriver resource allocation from kms_init to probe time to let it bail early. Changes since v2: - Move even more resource allocatio

[Freedreno] [PATCH] dt-bindings: cleanup DTS example whitespaces

2023-07-02 Thread Krzysztof Kozlowski
The DTS code coding style expects spaces around '=' sign. Signed-off-by: Krzysztof Kozlowski --- Rob, Maybe this could go via your tree? Rebased on your for-next: v6.4-rc2-45-gf0ac35049606 --- .../bindings/arm/arm,coresight-cti.yaml| 18 +- .../bindings/arm/keystone/ti

Re: [Freedreno] [PATCH v2] drm/msm/adreno: Assign revn to A635

2023-07-02 Thread Rob Clark
On Sun, Jul 2, 2023 at 7:34 AM Dmitry Baryshkov wrote: > > On 02/07/2023 17:31, Rob Clark wrote: > > On Sat, Jul 1, 2023 at 5:24 PM Dmitry Baryshkov > > wrote: > >> > >> On Sat, 1 Jul 2023 at 18:50, Rob Clark wrote: > >>> > >>> On Fri, Jun 30, 2023 at 4:12 PM Konrad Dybcio > >>> wrote: >

Re: [Freedreno] [PATCH v2] drm/msm/adreno: Assign revn to A635

2023-07-02 Thread Dmitry Baryshkov
On 02/07/2023 17:31, Rob Clark wrote: On Sat, Jul 1, 2023 at 5:24 PM Dmitry Baryshkov wrote: On Sat, 1 Jul 2023 at 18:50, Rob Clark wrote: On Fri, Jun 30, 2023 at 4:12 PM Konrad Dybcio wrote: Recently, a WARN_ON() was introduced to ensure that revn is filled before adreno_is_aXYZ is call

Re: [Freedreno] [PATCH v2] drm/msm/adreno: Assign revn to A635

2023-07-02 Thread Rob Clark
On Sat, Jul 1, 2023 at 5:24 PM Dmitry Baryshkov wrote: > > On Sat, 1 Jul 2023 at 18:50, Rob Clark wrote: > > > > On Fri, Jun 30, 2023 at 4:12 PM Konrad Dybcio > > wrote: > > > > > > Recently, a WARN_ON() was introduced to ensure that revn is filled before > > > adreno_is_aXYZ is called. This ho