[Freedreno] [PATCH v2 1/2] drm/msm/dpu: use PINGPONG_NONE to unbind INTF from PP
Currently the driver passes the PINGPONG index to dpu_hw_intf_ops::bind_pingpong_blk() callback and uses separate boolean flag to tell whether INTF should be bound or unbound. Simplify this by passing PINGPONG_NONE in case of unbinding and drop the flag completely. Signed-off-by: Dmitry Baryshkov --- Changes since v1: - Dropped != PINGPONG_NONE (Marijn) --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 4 +--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 - drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 1 - 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 2e1873d29c4b..3e543d664c98 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -2090,8 +2090,8 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc) for (i = 0; i < dpu_enc->num_phys_encs; i++) { if (dpu_enc->phys_encs[i] && phys_enc->hw_intf->ops.bind_pingpong_blk) phys_enc->hw_intf->ops.bind_pingpong_blk( - dpu_enc->phys_encs[i]->hw_intf, false, - dpu_enc->phys_encs[i]->hw_pp->idx); + dpu_enc->phys_encs[i]->hw_intf, + PINGPONG_NONE); /* mark INTF flush as pending */ if (phys_enc->hw_ctl->ops.update_pending_flush_intf) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index 4f8c9187f76d..107f0eff958c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -66,7 +66,6 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( if (test_bit(DPU_CTL_ACTIVE_CFG, &ctl->caps->features) && phys_enc->hw_intf->ops.bind_pingpong_blk) phys_enc->hw_intf->ops.bind_pingpong_blk( phys_enc->hw_intf, - true, phys_enc->hw_pp->idx); } @@ -553,8 +552,7 @@ static void dpu_encoder_phys_cmd_disable(struct dpu_encoder_phys *phys_enc) if (phys_enc->hw_intf->ops.bind_pingpong_blk) { phys_enc->hw_intf->ops.bind_pingpong_blk( phys_enc->hw_intf, - false, - phys_enc->hw_pp->idx); + PINGPONG_NONE); ctl = phys_enc->hw_ctl; ctl->ops.update_pending_flush_intf(ctl, phys_enc->hw_intf->idx); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index e26629e9e303..662d74ded1b9 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -287,7 +287,6 @@ static void dpu_encoder_phys_vid_setup_timing_engine( if (phys_enc->hw_intf->ops.bind_pingpong_blk) phys_enc->hw_intf->ops.bind_pingpong_blk( phys_enc->hw_intf, - true, phys_enc->hw_pp->idx); if (phys_enc->hw_pp->merge_3d) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c index 5dce18236d87..530f82e34c1e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c @@ -267,7 +267,6 @@ static void dpu_hw_intf_setup_prg_fetch( static void dpu_hw_intf_bind_pingpong_blk( struct dpu_hw_intf *intf, - bool enable, const enum dpu_pingpong pp) { struct dpu_hw_blk_reg_map *c = &intf->hw; @@ -276,7 +275,7 @@ static void dpu_hw_intf_bind_pingpong_blk( mux_cfg = DPU_REG_READ(c, INTF_MUX); mux_cfg &= ~0xf; - if (enable) + if (pp) mux_cfg |= (pp - PINGPONG_0) & 0x7; else mux_cfg |= 0xf; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h index 73b0885918f8..33895eca1211 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h @@ -88,7 +88,6 @@ struct dpu_hw_intf_ops { u32 (*get_line_count)(struct dpu_hw_intf *intf); void (*bind_pingpong_blk)(struct dpu_hw_intf *intf, - bool enable, const enum dpu_pingpong pp); void (*setup_misr)(struct dpu_hw_intf *intf, bool enable, u32 frame_count); int (*collect_misr)(struct dpu_h
[Freedreno] [PATCH v2 2/2] drm/msm/dpu: use PINGPONG_NONE to unbind WB from PP
Currently the driver passes the PINGPONG index to dpu_hw_wb_ops::bind_pingpong_blk() callback and uses separate boolean flag to tell whether WB should be bound or unbound. Simplify this by passing PINGPONG_NONE in case of unbinding and drop the flag completely. Suggested-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 3e543d664c98..493905a5b63a 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -2080,8 +2080,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc) if (phys_enc->hw_wb) { /* disable the PP block */ if (phys_enc->hw_wb->ops.bind_pingpong_blk) - phys_enc->hw_wb->ops.bind_pingpong_blk(phys_enc->hw_wb, false, - phys_enc->hw_pp->idx); + phys_enc->hw_wb->ops.bind_pingpong_blk(phys_enc->hw_wb, PINGPONG_NONE); /* mark WB flush as pending */ if (phys_enc->hw_ctl->ops.update_pending_flush_wb) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c index e9325cafb1a8..a466ff70a4d6 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c @@ -210,7 +210,7 @@ static void dpu_encoder_phys_wb_setup_cdp(struct dpu_encoder_phys *phys_enc) /* setup which pp blk will connect to this wb */ if (hw_pp && phys_enc->hw_wb->ops.bind_pingpong_blk) - phys_enc->hw_wb->ops.bind_pingpong_blk(phys_enc->hw_wb, true, + phys_enc->hw_wb->ops.bind_pingpong_blk(phys_enc->hw_wb, phys_enc->hw_pp->idx); phys_enc->hw_ctl->ops.setup_intf_cfg(phys_enc->hw_ctl, &intf_cfg); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c index dcffd6cc47fc..ebc416400382 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c @@ -154,7 +154,7 @@ static void dpu_hw_wb_setup_cdp(struct dpu_hw_wb *ctx, static void dpu_hw_wb_bind_pingpong_blk( struct dpu_hw_wb *ctx, - bool enable, const enum dpu_pingpong pp) + const enum dpu_pingpong pp) { struct dpu_hw_blk_reg_map *c; int mux_cfg; @@ -167,7 +167,7 @@ static void dpu_hw_wb_bind_pingpong_blk( mux_cfg = DPU_REG_READ(c, WB_MUX); mux_cfg &= ~0xf; - if (enable) + if (pp) mux_cfg |= (pp - PINGPONG_0) & 0x7; else mux_cfg |= 0xf; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h index c7f792eeb55c..2d7db2efa3d0 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h @@ -49,7 +49,7 @@ struct dpu_hw_wb_ops { bool enable); void (*bind_pingpong_blk)(struct dpu_hw_wb *ctx, - bool enable, const enum dpu_pingpong pp); + const enum dpu_pingpong pp); }; /** -- 2.39.2
Re: [Freedreno] [PATCH] drm/msm: Use struct fb_info.screen_buffer
On Mon, 22 May 2023 21:17:01 +0200, Thomas Zimmermann wrote: > The fbdev framebuffer is in system memory. Store the address in > the field 'screen_buffer'. Fixes the following sparse warning. > > ../drivers/gpu/drm/msm/msm_fbdev.c:124:26: warning: incorrect type in > assignment (different address spaces) > ../drivers/gpu/drm/msm/msm_fbdev.c:124:26:expected char [noderef] __iomem > *screen_base > ../drivers/gpu/drm/msm/msm_fbdev.c:124:26:got void * > > [...] Applied, thanks! [1/1] drm/msm: Use struct fb_info.screen_buffer https://gitlab.freedesktop.org/lumag/msm/-/commit/4fb5ad612c5c Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v3 0/7] drm/msm/dpu: simplify DPU encoder init
On Thu, 01 Jun 2023 20:22:29 +0300, Dmitry Baryshkov wrote: > Rework dpu_encoder initialization code, simplifying calling sequences > and separating common init parts. > > Changes since v2: > - Rebased on top of msm-next-lumag branch > > Changes since v1: > - Withdrawn two pathes for a later consideration > - Changed dpu_encoder_phys_init() to return void (Abhinav) > - Added small simplifications of dpu_encoder_phys_cmd_init() and > dpu_encoder_phys_wb_init() > > [...] Applied, thanks! [1/7] drm/msm/dpu: merge dpu_encoder_init() and dpu_encoder_setup() https://gitlab.freedesktop.org/lumag/msm/-/commit/9b930f14e530 [2/7] drm/msm/dpu: separate common function to init physical encoder https://gitlab.freedesktop.org/lumag/msm/-/commit/7731ee3b06c1 [3/7] drm/msm/dpu: drop duplicated intf/wb indices from encoder structs https://gitlab.freedesktop.org/lumag/msm/-/commit/8ea432b8428e [4/7] drm/msm/dpu: inline dpu_encoder_get_wb() https://gitlab.freedesktop.org/lumag/msm/-/commit/04ada3d8380a [5/7] drm/msm/dpu: call dpu_rm_get_intf() from dpu_encoder_get_intf() https://gitlab.freedesktop.org/lumag/msm/-/commit/004be38657f4 [6/7] drm/msm/dpu: drop temp variable from dpu_encoder_phys_cmd_init() https://gitlab.freedesktop.org/lumag/msm/-/commit/ed02d3dd18dc [7/7] drm/msm/dpu: simplify dpu_encoder_phys_wb_init() https://gitlab.freedesktop.org/lumag/msm/-/commit/5d1227d1c7a3 Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v14 00/10] add DSC 1.2 dpu supports
On Thu, 25 May 2023 10:40:48 -0700, Kuogee Hsieh wrote: > This series adds the DPU side changes to support DSC 1.2 encoder. This > was validated with both DSI DSC 1.2 panel and DP DSC 1.2 monitor. > The DSI and DP parts will be pushed later on top of this change. > This seriel is rebase on [1], [2] and catalog fixes from rev-4 of [3]. > > [1]: https://patchwork.freedesktop.org/series/116851/ > [2]: https://patchwork.freedesktop.org/series/116615/ > [3]: https://patchwork.freedesktop.org/series/112332/ > > [...] Applied, thanks! [01/10] drm/msm/dpu: set DSC flush bit correctly at MDP CTL flush register https://gitlab.freedesktop.org/lumag/msm/-/commit/12cef323c903 [03/10] drm/msm/dpu: add DPU_PINGPONG_DSC feature bit for DPU < 7.0.0 https://gitlab.freedesktop.org/lumag/msm/-/commit/c20c44403e11 [04/10] drm/msm/dpu: Guard PINGPONG DSC ops behind DPU_PINGPONG_DSC bit https://gitlab.freedesktop.org/lumag/msm/-/commit/108ff1417795 [05/10] drm/msm/dpu: Introduce PINGPONG_NONE to disconnect DSC from PINGPONG https://gitlab.freedesktop.org/lumag/msm/-/commit/d45be1ccd330 [07/10] drm/msm/dpu: always clear every individual pending flush mask https://gitlab.freedesktop.org/lumag/msm/-/commit/625cbb077007 [08/10] drm/msm/dpu: separate DSC flush update out of interface https://gitlab.freedesktop.org/lumag/msm/-/commit/761c629d1860 [10/10] drm/msm/dpu: Tear down DSC datapath on encoder cleanup https://gitlab.freedesktop.org/lumag/msm/-/commit/997ed53dd693 (Omitted patches 02/10, 06/10, 09/10) Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v2 0/3] arm64: dts: qcom: add DP Controller to SM8550 DTS
On Thu, 01 Jun 2023 12:09:46 +0200, Neil Armstrong wrote: > The DP output is shared with the USB3 SuperSpeed lanes and is > usually connected to an USB-C port which Altmode is controlled > by the PMIC Glink infrastructure. > > DT changes tying the DP controller to the USB-C port on the QRD > board will be sent later. > > [...] Applied, thanks! [1/3] dt-bindings: display: msm: dp-controller: document SM8550 compatible https://gitlab.freedesktop.org/lumag/msm/-/commit/76015b9e573e Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v3 0/9] drm/msm/dpu: simplify QoS/CDP programming
On Fri, 19 May 2023 01:22:29 +0300, Dmitry Baryshkov wrote: > Merge SSPP and WB code programming QoS and CDP. This allows us to drop > intermediate structures and duplicate code. > > Changes since v2: > - Moved SSPP_VIG_CSC_10_OP_MODE close to other CSC10 defines (Jeykumar) > > Changes since v1: > - Fixed kerneldoc for _dpu_plane_set_qos_ctrl() > - Fixed danger_safe_en programming conditions (Jeykumar) > - Simplified the code surrounding setup_cdp() calls (Jeykumar) > > [...] Applied, thanks! [1/9] drm/msm/dpu: fix SSPP register definitions https://gitlab.freedesktop.org/lumag/msm/-/commit/5f31d7e61ddf [2/9] drm/msm/dpu: simplify CDP programming https://gitlab.freedesktop.org/lumag/msm/-/commit/48b3207e4ed9 [3/9] drm/msm/dpu: fix the condition for (not) applying QoS to CURSOR SSPP https://gitlab.freedesktop.org/lumag/msm/-/commit/2defa907ed50 [4/9] drm/msm/dpu: rearrange QoS setting code https://gitlab.freedesktop.org/lumag/msm/-/commit/78c2925de971 [5/9] drm/msm/dpu: drop DPU_PLANE_QOS_VBLANK_CTRL https://gitlab.freedesktop.org/lumag/msm/-/commit/d5f86e50f031 [6/9] drm/msm/dpu: simplify qos_ctrl handling https://gitlab.freedesktop.org/lumag/msm/-/commit/f68098003dc3 [7/9] drm/msm/dpu: drop DPU_PLANE_QOS_PANIC_CTRL https://gitlab.freedesktop.org/lumag/msm/-/commit/9ccff1d2c062 [8/9] drm/msm/dpu: remove struct dpu_hw_pipe_qos_cfg https://gitlab.freedesktop.org/lumag/msm/-/commit/a5ebb27bffcc [9/9] drm/msm/dpu: use common helper for WB and SSPP QoS setup https://gitlab.freedesktop.org/lumag/msm/-/commit/5fe0faa62461 Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH 1/3] drm/msm/dp: Drop now unused dp_hpd module
On Sun, 14 May 2023 20:02:54 -0700, Bjorn Andersson wrote: > The dp_hpd module is a remnant from the downstream design and is now > completely unused. Drop it and all references to it. > > Applied, thanks! [2/3] drm/msm/dp: Clean up logs dp_power module https://gitlab.freedesktop.org/lumag/msm/-/commit/9f93258549db [3/3] drm/msm/dp: Clean up pdev/dev duplication in dp_power https://gitlab.freedesktop.org/lumag/msm/-/commit/9edac2eec47c Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH] drm/msm: Remove unnecessary (void*) conversions
On Mon, 22 May 2023 09:32:13 +0800, Su Hui wrote: > Pointer variables of (void*) type do not require type cast. > > Applied, thanks! [1/1] drm/msm: Remove unnecessary (void*) conversions https://gitlab.freedesktop.org/lumag/msm/-/commit/eea9cf72b718 Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v3 0/7] Display support for MSM8226
On Thu, 01 Jun 2023 19:00:07 +0200, Luca Weiss wrote: > This series adds the required configs for MDP5 and DSI blocks that are > needed for MDSS on MSM8226. Finally we can add the new nodes into the > dts. > > Tested on apq8026-lg-lenok and msm8926-htc-memul. > > > [...] Applied, thanks! [1/7] dt-bindings: msm: dsi-phy-28nm: Document msm8226 compatible https://gitlab.freedesktop.org/lumag/msm/-/commit/d01eb3421b10 [2/7] dt-bindings: display/msm: dsi-controller-main: Add msm8226 compatible https://gitlab.freedesktop.org/lumag/msm/-/commit/46ccf3e0ed63 [3/7] dt-bindings: display/msm: qcom,mdp5: Add msm8226 compatible https://gitlab.freedesktop.org/lumag/msm/-/commit/c6e79fd5c80d [4/7] drm/msm/mdp5: Add MDP5 configuration for MSM8226 https://gitlab.freedesktop.org/lumag/msm/-/commit/eed3f9c7c36a [5/7] drm/msm/dsi: Add configuration for MSM8226 https://gitlab.freedesktop.org/lumag/msm/-/commit/82cf4954a0d5 [6/7] drm/msm/dsi: Add phy configuration for MSM8226 https://gitlab.freedesktop.org/lumag/msm/-/commit/1531d0b9235e Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v2 1/2] drm/msm/dsi: remove extra call to dsi_get_pclk_rate()
On Sat, 20 May 2023 23:01:02 +0300, Dmitry Baryshkov wrote: > In dsi_calc_clk_rate_v2() there is no need to call dsi_get_pclk_rate(). > This function has just been called (from dsi_calc_pclk()) and its > result is stored at msm_host->pixel_clk_rate. Use this variable > directly. > > Applied, thanks! [1/2] drm/msm/dsi: remove extra call to dsi_get_pclk_rate() https://gitlab.freedesktop.org/lumag/msm/-/commit/6de6c28d97c0 [2/2] drm/msm/dsi: use mult_frac for pclk_bpp calculation https://gitlab.freedesktop.org/lumag/msm/-/commit/374918d2c396 Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v2 1/3] drm/msm/dpu: drop dpu_encoder_phys_ops::late_register()
On Sun, 21 May 2023 22:22:28 +0300, Dmitry Baryshkov wrote: > This callback has been unused since the driver being added. Drop it now. > > Applied, thanks! [1/3] drm/msm/dpu: drop dpu_encoder_phys_ops::late_register() https://gitlab.freedesktop.org/lumag/msm/-/commit/95666ca7431c [2/3] drm/msm/dpu: drop (mostly) unused DPU_NAME_SIZE define https://gitlab.freedesktop.org/lumag/msm/-/commit/a659098d78d6 Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v2] drm/msm/dp: remove most of usbpd-related remains
On Sat, 20 May 2023 21:20:50 +0300, Dmitry Baryshkov wrote: > Remove most of remains of downstream usbpd code. Mainline kernel uses > different approach for managing Type-C / USB-PD, so this remains unused. > > Applied, thanks! [1/1] drm/msm/dp: remove most of usbpd-related remains https://gitlab.freedesktop.org/lumag/msm/-/commit/1c5f6051ffdf Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v2] drm/msm/dpu: clean up dpu_kms_get_clk_rate() returns
On Fri, 26 May 2023 14:51:59 +0300, Dan Carpenter wrote: > Static analysis tools complain about the -EINVAL error code being > stored in an unsigned variable. Let's change this to match > the clk_get_rate() function which is type unsigned long and returns > zero on error. > > Applied, thanks! [1/1] drm/msm/dpu: clean up dpu_kms_get_clk_rate() returns https://gitlab.freedesktop.org/lumag/msm/-/commit/025e3d97867c Best regards, -- Dmitry Baryshkov
Re: [Freedreno] [PATCH v3 6/7] drm/msm/dsi: Add phy configuration for MSM8226
On 01/06/2023 20:00, Luca Weiss wrote: MSM8226 uses a modified PLL lock sequence compared to MSM8974, which is based on the function dsi_pll_enable_seq_m in the msm-3.10 kernel. Worth noting that the msm-3.10 downstream kernel also will try other sequences in case this one doesn't work, but during testing it has shown that the _m sequence succeeds first time also: .pll_enable_seqs[0] = dsi_pll_enable_seq_m, .pll_enable_seqs[1] = dsi_pll_enable_seq_m, .pll_enable_seqs[2] = dsi_pll_enable_seq_d, .pll_enable_seqs[3] = dsi_pll_enable_seq_d, .pll_enable_seqs[4] = dsi_pll_enable_seq_f1, .pll_enable_seqs[5] = dsi_pll_enable_seq_c, .pll_enable_seqs[6] = dsi_pll_enable_seq_e, We may need to expand this in the future. Signed-off-by: Luca Weiss --- drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 2 + drivers/gpu/drm/msm/dsi/phy/dsi_phy.h | 3 +- drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c | 97 ++ 3 files changed, 101 insertions(+), 1 deletion(-) Reviewed-by: Dmitry Baryshkov -- With best wishes Dmitry
Re: [Freedreno] [PATCH] drm/msm/dpu: re-introduce dpu core revision to the catalog
On 31/05/2023 21:25, Abhinav Kumar wrote: On 5/31/2023 3:07 AM, Dmitry Baryshkov wrote: On 31/05/2023 06:05, Abhinav Kumar wrote: On 5/30/2023 7:53 PM, Dmitry Baryshkov wrote: On Wed, 31 May 2023 at 03:54, Abhinav Kumar wrote: With [1] dpu core revision was dropped in favor of using the compatible string from the device tree to select the dpu catalog being used in the device. This approach works well however also necessitates adding catalog entries for small register level details as dpu capabilities and/or features bloating the catalog unnecessarily. Examples include but are not limited to data_compress, interrupt register set, widebus etc. Introduce the dpu core revision back as an entry to the catalog so that we can just use dpu revision checks and enable those bits which should be enabled unconditionally and not controlled by a catalog and also simplify the changes to do something like: if (dpu_core_revision > x && dpu_core_revision < x) enable the bit; Also, add some of the useful macros back to be able to use dpu core revision effectively. [1]: https://patchwork.freedesktop.org/patch/530891/?series=113910&rev=4 Signed-off-by: Abhinav Kumar --- .../msm/disp/dpu1/catalog/dpu_3_0_msm8998.h | 1 + .../msm/disp/dpu1/catalog/dpu_4_0_sdm845.h | 1 + .../msm/disp/dpu1/catalog/dpu_5_0_sm8150.h | 1 + .../msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h | 1 + .../msm/disp/dpu1/catalog/dpu_6_0_sm8250.h | 1 + .../msm/disp/dpu1/catalog/dpu_6_2_sc7180.h | 1 + .../msm/disp/dpu1/catalog/dpu_6_3_sm6115.h | 1 + .../msm/disp/dpu1/catalog/dpu_6_5_qcm2290.h | 1 + .../msm/disp/dpu1/catalog/dpu_7_0_sm8350.h | 1 + .../msm/disp/dpu1/catalog/dpu_7_2_sc7280.h | 1 + .../msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h | 1 + .../msm/disp/dpu1/catalog/dpu_8_1_sm8450.h | 1 + .../msm/disp/dpu1/catalog/dpu_9_0_sm8550.h | 1 + .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 31 ++- 14 files changed, 43 insertions(+), 1 deletion(-) [skipped catalog changes] diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h index 677048cc3b7d..cc4aa75a1219 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h @@ -19,6 +19,33 @@ */ #define MAX_BLOCKS 12 +#define DPU_HW_VER(MAJOR, MINOR, STEP)\ + unsigned int)MAJOR & 0xF) << 28) |\ + ((MINOR & 0xFFF) << 16) |\ + (STEP & 0x)) + +#define DPU_HW_MAJOR(rev)((rev) >> 28) +#define DPU_HW_MINOR(rev)(((rev) >> 16) & 0xFFF) +#define DPU_HW_STEP(rev)((rev) & 0x) +#define DPU_HW_MAJOR_MINOR(rev)((rev) >> 16) + +#define IS_DPU_MAJOR_MINOR_SAME(rev1, rev2) \ +(DPU_HW_MAJOR_MINOR((rev1)) == DPU_HW_MAJOR_MINOR((rev2))) + +#define DPU_HW_VER_300 DPU_HW_VER(3, 0, 0) /* 8998 v1.0 */ +#define DPU_HW_VER_400 DPU_HW_VER(4, 0, 0) /* sdm845 v1.0 */ +#define DPU_HW_VER_500 DPU_HW_VER(5, 0, 0) /* sm8150 v1.0 */ +#define DPU_HW_VER_510 DPU_HW_VER(5, 1, 1) /* sc8180 */ +#define DPU_HW_VER_600 DPU_HW_VER(6, 0, 0) /* sm8250 */ +#define DPU_HW_VER_620 DPU_HW_VER(6, 2, 0) /* sc7180 v1.0 */ +#define DPU_HW_VER_630 DPU_HW_VER(6, 3, 0) /* sm6115|sm4250 */ +#define DPU_HW_VER_650 DPU_HW_VER(6, 5, 0) /* qcm2290|sm4125 */ +#define DPU_HW_VER_700 DPU_HW_VER(7, 0, 0) /* sm8350 */ +#define DPU_HW_VER_720 DPU_HW_VER(7, 2, 0) /* sc7280 */ +#define DPU_HW_VER_800 DPU_HW_VER(8, 0, 0) /* sc8280xp */ +#define DPU_HW_VER_810 DPU_HW_VER(8, 1, 0) /* sm8450 */ +#define DPU_HW_VER_900 DPU_HW_VER(9, 0, 0) /* sm8550 */ Instead of having defines for all SoCs (which can quickly become unmanageable) and can cause merge conflicts, I'd suggest inlining all the defines into respective catalog files. Sure, that can be done. Also, I'm not sure that the "step" should be a part of the catalog. I know that this follows the hardware revision. However, please correct me if I'm wrong, different step levels are used for revisions of the same SoC. The original code that was reading the hw revision from the hardware register, listed both 5.0.0 and 5.0.1 for sm8150. This is one of the things i noticed while making this change. Before the catalog rework, we used to handle even steps as we used to read that from the register and match it with the mdss_cfg handler. But after the rework, we dont handle steps anymore. Yes, you are right that different step levels are used for the revisions of the same SOC and so with that, i dont expect or atleast am not aware of DPU differences between steps but I am not able to rule it out. So are you suggesting we drop step altogether and DPU_HW_VER() macro shall only handle major and minor versions? With the current chipsets I see, it should not make a difference . Its just that I am not sure if that will never happen. Yes. The goal of this rework would be to drop generic features and to replace those checks with DP
Re: [Freedreno] [PATCH v14 02/10] drm/msm/dpu: add DSC blocks to the catalog of MSM8998 and SC8180X
On 25/05/2023 20:40, Kuogee Hsieh wrote: From: Abhinav Kumar Some platforms have DSC blocks which have not been declared in the catalog. Complete DSC 1.1 support for all platforms by adding the missing blocks to MSM8998 and SC8180X. Changes in v9: -- add MSM8998 and SC8180x to commit title Changes in v10: -- fix grammar at commit text Changes in v12: -- fix "titil" with "title" at changes in v9 Changes in v14: -- "dsc" tp "DSC" at commit title Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten --- drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_3_0_msm8998.h | 7 +++ drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h | 11 +++ 2 files changed, 18 insertions(+) The sc8180x changes conflict with the patch at [1], which is already applied. [1] https://patchwork.freedesktop.org/patch/531490/ -- With best wishes Dmitry
Re: [Freedreno] [PATCH] drm/msm: Use struct fb_info.screen_buffer
On 22/05/2023 22:17, Thomas Zimmermann wrote: The fbdev framebuffer is in system memory. Store the address in the field 'screen_buffer'. Fixes the following sparse warning. ../drivers/gpu/drm/msm/msm_fbdev.c:124:26: warning: incorrect type in assignment (different address spaces) ../drivers/gpu/drm/msm/msm_fbdev.c:124:26:expected char [noderef] __iomem *screen_base ../drivers/gpu/drm/msm/msm_fbdev.c:124:26:got void * Signed-off-by: Thomas Zimmermann Reviewed-by: Dmitry Baryshkov -- With best wishes Dmitry
Re: [Freedreno] [PATCH 3/3] drm/msm/dp: Clean up pdev/dev duplication in dp_power
On 21/05/2023 06:53, Bjorn Andersson wrote: On Sat, May 20, 2023 at 04:26:59AM +0300, Dmitry Baryshkov wrote: On 15/05/2023 06:02, Bjorn Andersson wrote: The dp_power module keeps track of both the DP controller's struct platform_device and struct device - with the prior pulled out of the dp_parser module. Clean up the duplication by dropping the platform_device reference and just track the passed struct device. Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_power.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_power.c b/drivers/gpu/drm/msm/dp/dp_power.c index 031d2eefef07..9be645f91211 100644 --- a/drivers/gpu/drm/msm/dp/dp_power.c +++ b/drivers/gpu/drm/msm/dp/dp_power.c @@ -14,7 +14,6 @@ struct dp_power_private { struct dp_parser *parser; - struct platform_device *pdev; struct device *dev; struct drm_device *drm_dev; struct clk *link_clk_src; @@ -28,7 +27,7 @@ static int dp_power_clk_init(struct dp_power_private *power) { int rc = 0; struct dss_module_power *core, *ctrl, *stream; - struct device *dev = &power->pdev->dev; + struct device *dev = power->dev; core = &power->parser->mp[DP_CORE_PM]; ctrl = &power->parser->mp[DP_CTRL_PM]; @@ -153,7 +152,7 @@ int dp_power_client_init(struct dp_power *dp_power) power = container_of(dp_power, struct dp_power_private, dp_power); - pm_runtime_enable(&power->pdev->dev); + pm_runtime_enable(power->dev); return dp_power_clk_init(power); } @@ -164,7 +163,7 @@ void dp_power_client_deinit(struct dp_power *dp_power) power = container_of(dp_power, struct dp_power_private, dp_power); - pm_runtime_disable(&power->pdev->dev); + pm_runtime_disable(power->dev); } int dp_power_init(struct dp_power *dp_power, bool flip) @@ -174,11 +173,11 @@ int dp_power_init(struct dp_power *dp_power, bool flip) power = container_of(dp_power, struct dp_power_private, dp_power); - pm_runtime_get_sync(&power->pdev->dev); + pm_runtime_get_sync(power->dev); rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); if (rc) - pm_runtime_put_sync(&power->pdev->dev); + pm_runtime_put_sync(power->dev); return rc; } @@ -190,7 +189,7 @@ int dp_power_deinit(struct dp_power *dp_power) power = container_of(dp_power, struct dp_power_private, dp_power); dp_power_clk_enable(dp_power, DP_CORE_PM, false); - pm_runtime_put_sync(&power->pdev->dev); + pm_runtime_put_sync(power->dev); return 0; } @@ -199,12 +198,11 @@ struct dp_power *dp_power_get(struct device *dev, struct dp_parser *parser) Technically we don't even need to pass struct device here, we can get it from parser->pdev->dev. Right, but afaict dp_init_sub_modules() passes struct device * as first parameter to all the "module" initializers. So it feels reasonable to keep it, for now, for symmetry. What do you think? Reviewed-by: Dmitry Baryshkov -- With best wishes Dmitry