[Freedreno] [RFC] drm/msm/a6xx: Fix devcore register range bugs

2022-12-29 Thread Rob Clark
From: Rob Clark RB_MRT_FLAG_BUFFER is 0x8903->0xa91a inclusive.. don't split it (with a hole) in the ps_cluster_rac and don't accidentially re-dump part of the range in ps_cluster_rbp. Signed-off-by: Rob Clark --- I'm not 100% sure about this, because the RB_RB_SUB_BLOCK_SEL_CNTL_CD stuff makes

[Freedreno] [PATCH v2 25/27] drm/msm/dpu: rework static color fill code

2022-12-29 Thread Dmitry Baryshkov
Rework static color fill code to separate the pipe / pipe_cfg handling. This is a preparation for the r_pipe support. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 70 +-- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/driver

[Freedreno] [PATCH v2 18/27] drm/msm/dpu: simplify dpu_plane_validate_src()

2022-12-29 Thread Dmitry Baryshkov
Since the driver uses clipped src coordinates, there is no need to check against the fb coordinates. Remove corresponding checks and inline dpu_plane_validate_src(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 30 --- 1 file changed, 10 ins

[Freedreno] [PATCH v2 27/27] drm/msm/dpu: add support for wide planes

2022-12-29 Thread Dmitry Baryshkov
Typically SSPP can support rectangle with width up to 2560. However it's possible to use multirect feature and split source to use the SSPP to output two consecutive rectangles. This commit brings in this capability to support wider screen resolutions. Signed-off-by: Dmitry Baryshkov --- drivers

[Freedreno] [PATCH v2 21/27] drm/msm/dpu: make _dpu_plane_calc_clk accept mode directly

2022-12-29 Thread Dmitry Baryshkov
Rework bandwidth/clock calculation functions to use mode directly rather than fetching it through the plane data. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 39 ++- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/drivers/gp

[Freedreno] [PATCH v2 26/27] drm/msm/dpu: split pipe handling from _dpu_crtc_blend_setup_mixer

2022-12-29 Thread Dmitry Baryshkov
Rework _dpu_crtc_blend_setup_mixer() to split away pipe handling to a separate functon. This is a preparation for the r_pipe support. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 86 --- drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h | 10 ++- 2

[Freedreno] [PATCH v2 07/27] drm/msm/dpu: drop dpu_plane_pipe function

2022-12-29 Thread Dmitry Baryshkov
There no more need for the dpu_plane_pipe() function, crtc code can access pstate->pipe_hw.idx directly. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 5 - drivers/gpu/drm/msm/di

[Freedreno] [PATCH v2 23/27] drm/msm/dpu: rework dpu_plane_atomic_check()

2022-12-29 Thread Dmitry Baryshkov
Split pipe-dependent code from dpu_plane_atomic_check() into the separate function dpu_plane_atomic_check_pipe(). This is one of preparational steps to add r_pipe support. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 91 +-- 1 file changed,

[Freedreno] [PATCH v2 08/27] drm/msm/dpu: introduce struct dpu_sw_pipe

2022-12-29 Thread Dmitry Baryshkov
Wrap SSPP and multirect index/mode into a single structure that represents software view on the pipe used. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c| 9 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 16 ++- drivers/gpu/drm/

[Freedreno] [PATCH v2 24/27] drm/msm/dpu: rework plane CSC setting

2022-12-29 Thread Dmitry Baryshkov
Rework the code flushing CSC settings for the plane. Separate out the pipe and pipe_cfg as a preparation for r_pipe support. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 45 +-- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a

[Freedreno] [PATCH v2 22/27] drm/msm/dpu: rework dpu_plane_sspp_atomic_update()

2022-12-29 Thread Dmitry Baryshkov
Split pipe-dependent code from dpu_plane_sspp_atomic_update() into the separate function dpu_plane_sspp_update_pipe(). This is one of preparational steps to add r_pipe support. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 113 -- 1 file chan

[Freedreno] [PATCH v2 20/27] drm/msm/dpu: populate SmartDMA features in hw catalog

2022-12-29 Thread Dmitry Baryshkov
Downstream driver uses dpu->caps->smart_dma_rev to update sspp->cap->features with the bit corresponding to the supported SmartDMA version. Upstream driver does not do this, resulting in SSPP subdriver not enbaling setup_multirect callback. Add corresponding SmartDMA SSPP feature bits to dpu hw cat

[Freedreno] [PATCH v2 16/27] drm/msm/dpu: drop redundant plane dst check from dpu_crtc_atomic_check()

2022-12-29 Thread Dmitry Baryshkov
The helper drm_atomic_helper_check_plane_state() already checks whether the scaled and clipped plane falls into the CRTC visible region (and clears plane_state->visible if it doesn't). Drop the redundant check from dpu_crtc_atomic_check(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/

[Freedreno] [PATCH v2 13/27] drm/msm/dpu: drop src_split and multirect check from dpu_crtc_atomic_check

2022-12-29 Thread Dmitry Baryshkov
Neither source split nor multirect are properly supported at this moment. Both of these checks depend on normalized_zpos being equal for several planes (which is never the case for normalized zpos). Drop these checks to simplify dpu_crtc_atomic_check(). The actual support for either of these featur

[Freedreno] [PATCH v2 12/27] drm/msm/dpu: remove dpu_hw_fmt_layout from struct dpu_hw_pipe_cfg

2022-12-29 Thread Dmitry Baryshkov
Remove dpu_hw_fmt_layout instance from struct dpu_hw_pipe_cfg, leaving only src_rect and dst_rect. This way right and left pipes will have separate dpu_hw_pipe_cfg isntances, while the layout is common to both of them. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp

[Freedreno] [PATCH v2 19/27] drm/msm/dpu: rewrite plane's QoS-related functions to take dpu_sw_pipe and dpu_format

2022-12-29 Thread Dmitry Baryshkov
Rewrite dpu_plane's QoS related functions to take struct dpu_sw_pipe and struct dpu_format as arguments rather than fetching them from the pstate or drm_framebuffer. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 98 +++ 1 file changed, 47 ins

[Freedreno] [PATCH v2 17/27] drm/msm/dpu: add dpu_hw_pipe_cfg to dpu_plane_state

2022-12-29 Thread Dmitry Baryshkov
Now as all accesses to pipe_cfg and pstate have been cleaned, re-add struct dpu_hw_pipe_cfg back to dpu_plane_state, so that dpu_plane_atomic_check() and dpu_plane_atomic_update() do not have a chance to disagree about src/dst rectangles (currently dpu_plane_atomic_check() uses unclipped rectangles

[Freedreno] [PATCH v2 10/27] drm/msm/dpu: pass dpu_format to _dpu_hw_sspp_setup_scaler3()

2022-12-29 Thread Dmitry Baryshkov
There is no need to pass full dpu_hw_pipe_cfg instance to _dpu_hw_sspp_setup_scaler3, pass just struct dpu_format pointer. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 9 - drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 7 +++ drivers/gpu/drm/msm/d

[Freedreno] [PATCH v2 06/27] drm/msm/dpu: move pipe_hw to dpu_plane_state

2022-12-29 Thread Dmitry Baryshkov
In preparation to adding fully virtualized planes, move struct dpu_hw_sspp instance from struct dpu_plane to struct dpu_plane_state, as it will become a part of state (allocated during atomic check) rather than part of a plane (allocated during boot). Signed-off-by: Dmitry Baryshkov --- drivers/

[Freedreno] [PATCH v2 11/27] drm/msm/dpu: move stride programming to dpu_hw_sspp_setup_sourceaddress

2022-12-29 Thread Dmitry Baryshkov
Move stride programming to dpu_hw_sspp_setup_sourceaddress(), so that dpu_hw_sspp_setup_rects() programs only source and destination rectangles. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 57 +++-- 1 file changed, 29 insertions(+), 28 deleti

[Freedreno] [PATCH v2 14/27] drm/msm/dpu: don't use unsupported blend stages

2022-12-29 Thread Dmitry Baryshkov
The dpu_crtc_atomic_check() compares blending stage with DPU_STAGE_MAX (maximum amount of blending stages supported by the driver), however we should compare it against .max_mixer_blendstages, the maximum blend stage supported by the mixer. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm

[Freedreno] [PATCH v2 15/27] drm/msm/dpu: move the rest of plane checks to dpu_plane_atomic_check()

2022-12-29 Thread Dmitry Baryshkov
Move plane state updates from dpu_crtc_atomic_check() to the function where they belong: to dpu_plane_atomic_check(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 18 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 18 ++ drivers/

[Freedreno] [PATCH v2 09/27] drm/msm/dpu: use dpu_sw_pipe for dpu_hw_sspp callbacks

2022-12-29 Thread Dmitry Baryshkov
Where feasible, use dpu_sw_pipe rather than a combo of dpu_hw_sspp and multirect_index/_mode arguments. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 59 + drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 46 +--

[Freedreno] [PATCH v2 05/27] drm/msm/dpu: drop EAGAIN check from dpu_format_populate_layout

2022-12-29 Thread Dmitry Baryshkov
The pipe's layout is not cached, corresponding data structure is zeroed out each time in the dpu_plane_sspp_atomic_update(), right before the call to _dpu_plane_set_scanout() -> dpu_format_populate_layout(). Drop plane_addr comparison against previous layout and corresponding EAGAIN handling. Sig

[Freedreno] [PATCH v2 04/27] drm/msm/dpu: move SSPP debugfs creation to dpu_kms.c

2022-12-29 Thread Dmitry Baryshkov
As SSPP blocks are now visible through dpu_kms->rm.sspp_blocks, move SSPP debugfs creation from dpu_plane to dpu_kms. We are going to break the 1:1 correspondence between planes and SSPPs, so it makes no sense anymore to create SSPP debugfs entries in dpu_plane.c Reviewed-by: Abhinav Kumar Signed

[Freedreno] [PATCH v2 00/27] drm/msm/dpu: wide planes support

2022-12-29 Thread Dmitry Baryshkov
It took me a way longer to finish than I expected. And more patches that I previously hoped (despite having several patches already being merged from v1). This patchset brings in multirect usage to support using two SSPP rectangles for a single plane. Full virtual planes support is omitted from th

[Freedreno] [PATCH v2 03/27] drm/msm/dpu: move SSPP allocation to the RM

2022-12-29 Thread Dmitry Baryshkov
Follow the example of all other hw blocks and initialize SSPP blocks in Resource Manager. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 17 - drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c| 22 ++ drivers/gpu/drm/msm/disp/dpu1/dpu

[Freedreno] [PATCH v2 02/27] drm/msm/dpu: rename struct dpu_hw_pipe to dpu_hw_sspp

2022-12-29 Thread Dmitry Baryshkov
For all hardware blocks except SSPP the corresponding struct is named after the block. Rename dpu_hw_pipe (SSPP structure) to dpu_hw_sspp. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 42 ++--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 42

[Freedreno] [PATCH v2 01/27] drm/msm/dpu: set pdpu->is_rt_pipe early in dpu_plane_sspp_atomic_update()

2022-12-29 Thread Dmitry Baryshkov
The function dpu_plane_sspp_atomic_update() updates pdpu->is_rt_pipe flag, but after the commit 854f6f1c653b ("drm/msm/dpu: update the qos remap only if the client type changes") it sets the flag late, after all the qos functions have updated QoS programming. Move the flag update back to the place

Re: [Freedreno] (subset) [PATCH v2 1/3] dt-bindings: display/msm: Add SM8150 MDSS & DPU

2022-12-29 Thread Bjorn Andersson
On Thu, 29 Dec 2022 11:05:08 +0100, Konrad Dybcio wrote: > Add bindings for the display hardware on SM8150. > > Applied, thanks! [2/3] arm64: dts: qcom: sm8150: Add DISPCC node commit: 2ef3bb17c45c5b83204a845bbe4045eed11bc759 [3/3] arm64: dts: qcom: sm8150: Wire up MDSS commit: 9887

Re: [Freedreno] (subset) [PATCH v6 00/18] mdss-dsi-ctrl binding and dts fixes

2022-12-29 Thread Bjorn Andersson
On Fri, 23 Dec 2022 02:10:07 +, Bryan O'Donoghue wrote: > V6: > - Squashes a number of patches per Krzysztof's comments on bisectability > - Adds in Acked-by Rob and Krzysztof > > V5: > - Adds compat strings to bindings/display/msm/qcom,SoC-mdss.yaml - Dmitry > - Re-orders simple fixes to the

[Freedreno] [PATCH v3 1/1] dt-bindings: msm: dsi-phy-28nm: Add missing qcom, dsi-phy-regulator-ldo-mode

2022-12-29 Thread Bryan O'Donoghue
Add in missing qcom,dsi-phy-regulator-ldo-mode to the 28nm DSI PHY. When converting from .txt to .yaml we missed this one. Fixes: 4dbe55c97741 ("dt-bindings: msm: dsi: add yaml schemas for DSI bindings") Reviewed-by: Dmitry Baryshkov Signed-off-by: Bryan O'Donoghue --- .../devicetree/bindings/d

[Freedreno] [PATCH v3 0/1] Fixup documentation for dsi-phy-28nm

2022-12-29 Thread Bryan O'Donoghue
V3: Moves change to last item in list so as not to break-up grouping of reg/reg-names V2: This is the one remaining patch I had from a previous series for mdss-dsi-ctrl and the dsi-phy. The mdss-dsi-ctrl set became a bigger so I split out the 28nm phy fixes. I'm resubmitting with Dmitry's RB as

Re: [Freedreno] [PATCH v2 2/3] arm64: dts: qcom: sm8150: Add DISPCC node

2022-12-29 Thread Dmitry Baryshkov
On Thu, 29 Dec 2022 at 12:05, Konrad Dybcio wrote: > > Years after the SoC support has been added, it's high time for it to > get dispcc going. Add the node to ensure that. > > Tested-by: Marijn Suijten # Xperia 5 > Reviewed-by: Marijn Suijten > Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry

Re: [Freedreno] [PATCH] drm/msm/adreno: Make adreno quirks not overwrite each other

2022-12-29 Thread Marijn Suijten
On 2022-12-29 11:18:45, Konrad Dybcio wrote: > So far the adreno quirks have all been assigned with an OR operator, > which is problematic, because they were assigned consecutive integer > values, which makes checking them with an AND operator kind of no bueno.. > > Switch to using BIT(n) so that

[Freedreno] [PATCH] drm/msm/adreno: Make adreno quirks not overwrite each other

2022-12-29 Thread Konrad Dybcio
So far the adreno quirks have all been assigned with an OR operator, which is problematic, because they were assigned consecutive integer values, which makes checking them with an AND operator kind of no bueno.. Switch to using BIT(n) so that only the quirks that the programmer chose are taken int

[Freedreno] [PATCH v2 3/3] arm64: dts: qcom: sm8150: Wire up MDSS

2022-12-29 Thread Konrad Dybcio
Add required nodes for MDSS and hook up provided clocks in DISPCC. This setup is almost identical to 8[23]50. Tested-by: Marijn Suijten # Xperia 5 Reviewed-by: Marijn Suijten Signed-off-by: Konrad Dybcio --- v1 -> v2: - Pick up tags - mdss@ -> display-subsystem@ arch/arm64/boot/dts/qcom/sm815

[Freedreno] [PATCH v2 2/3] arm64: dts: qcom: sm8150: Add DISPCC node

2022-12-29 Thread Konrad Dybcio
Years after the SoC support has been added, it's high time for it to get dispcc going. Add the node to ensure that. Tested-by: Marijn Suijten # Xperia 5 Reviewed-by: Marijn Suijten Signed-off-by: Konrad Dybcio --- v1 -> v2: - Pick up tags - Remove required-opps - Move power-domains up arch/arm

[Freedreno] [PATCH v2 1/3] dt-bindings: display/msm: Add SM8150 MDSS & DPU

2022-12-29 Thread Konrad Dybcio
Add bindings for the display hardware on SM8150. Reviewed-by: Rob Herring Signed-off-by: Konrad Dybcio --- v1 -> v2: - Pick up tags .../bindings/display/msm/qcom,sm8150-dpu.yaml | 92 + .../display/msm/qcom,sm8150-mdss.yaml | 330 ++ 2 files changed, 422 insertions

Re: [Freedreno] [PATCH v2 1/1] dt-bindings: msm: dsi-phy-28nm: Add missing qcom, dsi-phy-regulator-ldo-mode

2022-12-29 Thread Krzysztof Kozlowski
On 28/12/2022 14:11, Bryan O'Donoghue wrote: > Add in missing qcom,dsi-phy-regulator-ldo-mode to the 28nm DSI PHY. > When converting from .txt to .yaml we missed this one. > > Fixes: 4dbe55c97741 ("dt-bindings: msm: dsi: add yaml schemas for DSI > bindings") > Reviewed-by: Dmitry Baryshkov > Sig