Commit 712c76b3 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

Merge branches 'msm-next-lumag-core', 'msm-next-lumag-dpu',...

Merge branches 'msm-next-lumag-core', 'msm-next-lumag-dpu', 'msm-next-lumag-dp', 'msm-next-lumag-dsi' and 'msm-next-lumag-mdp5' into msm-next-lumag

Core:
- Add Marijn Suijten as drm/msm reviewer
- Adreno A660 bindings
- SM8350 MDSS bindings fix

DP:
- Removed obsolete USB-PD remains
- Documented DP compatible string for sm8550 platform

DPU:
- Added support for DPU on sm6350 and sm6375 platforms
- Implemented tearcheck support to support vsync on SM150 and newer platforms
- Enabled missing features (DSPP, DSC, split display) on sc8180x, sc8280xp, sm8450
- Enabled writeback on sc7280
- Enabled DSC on msm8998
- Native HDMI output support
- Dropped unused features: regdma, GC, IGC
- Fixed the DSC flush operations
- Simplified QoS handling, removing obsolete and unused features and merging
  SSPP and WB code paths
- Reworked dpu_encoder initialisation path

DSI:
- Added support for DSI and 28nm DSI PHY on MSM8226 platform
- Added support for DSI on sm6350 and sm6375 platforms
- Dropped powerup quirks in favour of using pre_enable_prev_first for
  downstream bridges
- Fixed 14nm DSI PHY programming

MDP5:
- Added support for display controller on MSM8226 platform
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
...@@ -29,6 +29,7 @@ properties: ...@@ -29,6 +29,7 @@ properties:
- items: - items:
- enum: - enum:
- qcom,sm8450-dp - qcom,sm8450-dp
- qcom,sm8550-dp
- const: qcom,sm8350-dp - const: qcom,sm8350-dp
reg: reg:
......
...@@ -15,6 +15,7 @@ properties: ...@@ -15,6 +15,7 @@ properties:
- items: - items:
- enum: - enum:
- qcom,apq8064-dsi-ctrl - qcom,apq8064-dsi-ctrl
- qcom,msm8226-dsi-ctrl
- qcom,msm8916-dsi-ctrl - qcom,msm8916-dsi-ctrl
- qcom,msm8953-dsi-ctrl - qcom,msm8953-dsi-ctrl
- qcom,msm8974-dsi-ctrl - qcom,msm8974-dsi-ctrl
...@@ -26,6 +27,8 @@ properties: ...@@ -26,6 +27,8 @@ properties:
- qcom,sdm660-dsi-ctrl - qcom,sdm660-dsi-ctrl
- qcom,sdm845-dsi-ctrl - qcom,sdm845-dsi-ctrl
- qcom,sm6115-dsi-ctrl - qcom,sm6115-dsi-ctrl
- qcom,sm6350-dsi-ctrl
- qcom,sm6375-dsi-ctrl
- qcom,sm8150-dsi-ctrl - qcom,sm8150-dsi-ctrl
- qcom,sm8250-dsi-ctrl - qcom,sm8250-dsi-ctrl
- qcom,sm8350-dsi-ctrl - qcom,sm8350-dsi-ctrl
...@@ -256,6 +259,7 @@ allOf: ...@@ -256,6 +259,7 @@ allOf:
compatible: compatible:
contains: contains:
enum: enum:
- qcom,msm8226-dsi-ctrl
- qcom,msm8974-dsi-ctrl - qcom,msm8974-dsi-ctrl
then: then:
properties: properties:
...@@ -297,6 +301,7 @@ allOf: ...@@ -297,6 +301,7 @@ allOf:
contains: contains:
enum: enum:
- qcom,msm8998-dsi-ctrl - qcom,msm8998-dsi-ctrl
- qcom,sm6350-dsi-ctrl
then: then:
properties: properties:
clocks: clocks:
...@@ -364,6 +369,7 @@ allOf: ...@@ -364,6 +369,7 @@ allOf:
enum: enum:
- qcom,sdm845-dsi-ctrl - qcom,sdm845-dsi-ctrl
- qcom,sm6115-dsi-ctrl - qcom,sm6115-dsi-ctrl
- qcom,sm6375-dsi-ctrl
then: then:
properties: properties:
clocks: clocks:
......
...@@ -15,10 +15,11 @@ allOf: ...@@ -15,10 +15,11 @@ allOf:
properties: properties:
compatible: compatible:
enum: enum:
- qcom,dsi-phy-28nm-8226
- qcom,dsi-phy-28nm-8960
- qcom,dsi-phy-28nm-hpm - qcom,dsi-phy-28nm-hpm
- qcom,dsi-phy-28nm-hpm-fam-b - qcom,dsi-phy-28nm-hpm-fam-b
- qcom,dsi-phy-28nm-lp - qcom,dsi-phy-28nm-lp
- qcom,dsi-phy-28nm-8960
reg: reg:
items: items:
......
...@@ -122,6 +122,7 @@ allOf: ...@@ -122,6 +122,7 @@ allOf:
contains: contains:
enum: enum:
- qcom,adreno-gmu-635.0 - qcom,adreno-gmu-635.0
- qcom,adreno-gmu-660.1
then: then:
properties: properties:
reg: reg:
......
...@@ -22,6 +22,7 @@ properties: ...@@ -22,6 +22,7 @@ properties:
- items: - items:
- enum: - enum:
- qcom,apq8084-mdp5 - qcom,apq8084-mdp5
- qcom,msm8226-mdp5
- qcom,msm8916-mdp5 - qcom,msm8916-mdp5
- qcom,msm8917-mdp5 - qcom,msm8917-mdp5
- qcom,msm8953-mdp5 - qcom,msm8953-mdp5
......
...@@ -122,6 +122,7 @@ patternProperties: ...@@ -122,6 +122,7 @@ patternProperties:
- qcom,dsi-phy-14nm-660 - qcom,dsi-phy-14nm-660
- qcom,dsi-phy-14nm-8953 - qcom,dsi-phy-14nm-8953
- qcom,dsi-phy-20nm - qcom,dsi-phy-20nm
- qcom,dsi-phy-28nm-8226
- qcom,dsi-phy-28nm-hpm - qcom,dsi-phy-28nm-hpm
- qcom,dsi-phy-28nm-lp - qcom,dsi-phy-28nm-lp
- qcom,hdmi-phy-8084 - qcom,hdmi-phy-8084
......
...@@ -13,7 +13,10 @@ $ref: /schemas/display/msm/dpu-common.yaml# ...@@ -13,7 +13,10 @@ $ref: /schemas/display/msm/dpu-common.yaml#
properties: properties:
compatible: compatible:
const: qcom,sc7180-dpu enum:
- qcom,sc7180-dpu
- qcom,sm6350-dpu
- qcom,sm6375-dpu
reg: reg:
items: items:
...@@ -26,6 +29,7 @@ properties: ...@@ -26,6 +29,7 @@ properties:
- const: vbif - const: vbif
clocks: clocks:
minItems: 6
items: items:
- description: Display hf axi clock - description: Display hf axi clock
- description: Display ahb clock - description: Display ahb clock
...@@ -33,8 +37,10 @@ properties: ...@@ -33,8 +37,10 @@ properties:
- description: Display lut clock - description: Display lut clock
- description: Display core clock - description: Display core clock
- description: Display vsync clock - description: Display vsync clock
- description: Display core throttle clock
clock-names: clock-names:
minItems: 6
items: items:
- const: bus - const: bus
- const: iface - const: iface
...@@ -42,6 +48,7 @@ properties: ...@@ -42,6 +48,7 @@ properties:
- const: lut - const: lut
- const: core - const: core
- const: vsync - const: vsync
- const: throttle
required: required:
- compatible - compatible
...@@ -52,6 +59,20 @@ required: ...@@ -52,6 +59,20 @@ required:
unevaluatedProperties: false unevaluatedProperties: false
allOf:
- if:
properties:
compatible:
const: qcom,sm6375-dpu
then:
properties:
clocks:
minItems: 7
clock-names:
minItems: 7
examples: examples:
- | - |
#include <dt-bindings/clock/qcom,dispcc-sc7180.h> #include <dt-bindings/clock/qcom,dispcc-sc7180.h>
......
# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/msm/qcom,sm6350-mdss.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm SM6350 Display MDSS
maintainers:
- Krishna Manikandan <quic_mkrishn@quicinc.com>
description:
SM6350 MSM Mobile Display Subsystem (MDSS), which encapsulates sub-blocks
like DPU display controller, DSI and DP interfaces etc.
$ref: /schemas/display/msm/mdss-common.yaml#
properties:
compatible:
const: qcom,sm6350-mdss
clocks:
items:
- description: Display AHB clock from gcc
- description: Display AXI clock from gcc
- description: Display core clock
clock-names:
items:
- const: iface
- const: bus
- const: core
iommus:
maxItems: 1
interconnects:
maxItems: 2
interconnect-names:
maxItems: 2
patternProperties:
"^display-controller@[0-9a-f]+$":
type: object
properties:
compatible:
const: qcom,sm6350-dpu
"^dsi@[0-9a-f]+$":
type: object
properties:
compatible:
items:
- const: qcom,sm6350-dsi-ctrl
- const: qcom,mdss-dsi-ctrl
"^phy@[0-9a-f]+$":
type: object
properties:
compatible:
const: qcom,dsi-phy-10nm
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,dispcc-sm6350.h>
#include <dt-bindings/clock/qcom,gcc-sm6350.h>
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/qcom-rpmpd.h>
display-subsystem@ae00000 {
compatible = "qcom,sm6350-mdss";
reg = <0x0ae00000 0x1000>;
reg-names = "mdss";
power-domains = <&dispcc MDSS_GDSC>;
clocks = <&gcc GCC_DISP_AHB_CLK>,
<&gcc GCC_DISP_AXI_CLK>,
<&dispcc DISP_CC_MDSS_MDP_CLK>;
clock-names = "iface", "bus", "core";
interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
interrupt-controller;
#interrupt-cells = <1>;
iommus = <&apps_smmu 0x800 0x2>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
display-controller@ae01000 {
compatible = "qcom,sm6350-dpu";
reg = <0x0ae01000 0x8f000>,
<0x0aeb0000 0x2008>;
reg-names = "mdp", "vbif";
clocks = <&gcc GCC_DISP_AXI_CLK>,
<&dispcc DISP_CC_MDSS_AHB_CLK>,
<&dispcc DISP_CC_MDSS_ROT_CLK>,
<&dispcc DISP_CC_MDSS_MDP_LUT_CLK>,
<&dispcc DISP_CC_MDSS_MDP_CLK>,
<&dispcc DISP_CC_MDSS_VSYNC_CLK>;
clock-names = "bus", "iface", "rot", "lut", "core",
"vsync";
assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>,
<&dispcc DISP_CC_MDSS_VSYNC_CLK>,
<&dispcc DISP_CC_MDSS_ROT_CLK>,
<&dispcc DISP_CC_MDSS_AHB_CLK>;
assigned-clock-rates = <300000000>,
<19200000>,
<19200000>,
<19200000>;
interrupt-parent = <&mdss>;
interrupts = <0>;
operating-points-v2 = <&mdp_opp_table>;
power-domains = <&rpmhpd SM6350_CX>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dpu_intf1_out: endpoint {
remote-endpoint = <&dsi0_in>;
};
};
port@1 {
reg = <1>;
dpu_intf2_out: endpoint {
remote-endpoint = <&dsi1_in>;
};
};
};
};
dsi@ae94000 {
compatible = "qcom,sm6350-dsi-ctrl", "qcom,mdss-dsi-ctrl";
reg = <0x0ae94000 0x400>;
reg-names = "dsi_ctrl";
interrupt-parent = <&mdss>;
interrupts = <4>;
clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK>,
<&dispcc DISP_CC_MDSS_BYTE0_INTF_CLK>,
<&dispcc DISP_CC_MDSS_PCLK0_CLK>,
<&dispcc DISP_CC_MDSS_ESC0_CLK>,
<&dispcc DISP_CC_MDSS_AHB_CLK>,
<&gcc GCC_DISP_AXI_CLK>;
clock-names = "byte",
"byte_intf",
"pixel",
"core",
"iface",
"bus";
assigned-clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK_SRC>,
<&dispcc DISP_CC_MDSS_PCLK0_CLK_SRC>;
assigned-clock-parents = <&dsi0_phy 0>, <&dsi0_phy 1>;
operating-points-v2 = <&dsi_opp_table>;
power-domains = <&rpmhpd SM6350_MX>;
phys = <&dsi0_phy>;
phy-names = "dsi";
#address-cells = <1>;
#size-cells = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dsi0_in: endpoint {
remote-endpoint = <&dpu_intf1_out>;
};
};
port@1 {
reg = <1>;
dsi0_out: endpoint {
};
};
};
};
dsi0_phy: phy@ae94400 {
compatible = "qcom,dsi-phy-10nm";
reg = <0x0ae94400 0x200>,
<0x0ae94600 0x280>,
<0x0ae94a00 0x1e0>;
reg-names = "dsi_phy",
"dsi_phy_lane",
"dsi_pll";
#clock-cells = <1>;
#phy-cells = <0>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>, <&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
};
};
...
# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/msm/qcom,sm6375-mdss.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm SM6375 Display MDSS
maintainers:
- Konrad Dybcio <konrad.dybcio@linaro.org>
description:
SM6375 MSM Mobile Display Subsystem (MDSS), which encapsulates sub-blocks
like DPU display controller, DSI and DP interfaces etc.
$ref: /schemas/display/msm/mdss-common.yaml#
properties:
compatible:
const: qcom,sm6375-mdss
clocks:
items:
- description: Display AHB clock from gcc
- description: Display AHB clock
- description: Display core clock
clock-names:
items:
- const: iface
- const: ahb
- const: core
iommus:
maxItems: 1
interconnects:
maxItems: 2
interconnect-names:
maxItems: 2
patternProperties:
"^display-controller@[0-9a-f]+$":
type: object
properties:
compatible:
const: qcom,sm6375-dpu
"^dsi@[0-9a-f]+$":
type: object
properties:
compatible:
items:
- const: qcom,sm6375-dsi-ctrl
- const: qcom,mdss-dsi-ctrl
"^phy@[0-9a-f]+$":
type: object
properties:
compatible:
const: qcom,sm6375-dsi-phy-7nm
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,rpmcc.h>
#include <dt-bindings/clock/qcom,sm6375-gcc.h>
#include <dt-bindings/clock/qcom,sm6375-dispcc.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/qcom-rpmpd.h>
display-subsystem@5e00000 {
compatible = "qcom,sm6375-mdss";
reg = <0x05e00000 0x1000>;
reg-names = "mdss";
power-domains = <&dispcc MDSS_GDSC>;
clocks = <&gcc GCC_DISP_AHB_CLK>,
<&dispcc DISP_CC_MDSS_AHB_CLK>,
<&dispcc DISP_CC_MDSS_MDP_CLK>;
clock-names = "iface", "ahb", "core";
interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
interrupt-controller;
#interrupt-cells = <1>;
iommus = <&apps_smmu 0x820 0x2>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
display-controller@5e01000 {
compatible = "qcom,sm6375-dpu";
reg = <0x05e01000 0x8e030>,
<0x05eb0000 0x2008>;
reg-names = "mdp", "vbif";
clocks = <&gcc GCC_DISP_HF_AXI_CLK>,
<&dispcc DISP_CC_MDSS_AHB_CLK>,
<&dispcc DISP_CC_MDSS_ROT_CLK>,
<&dispcc DISP_CC_MDSS_MDP_LUT_CLK>,
<&dispcc DISP_CC_MDSS_MDP_CLK>,
<&dispcc DISP_CC_MDSS_VSYNC_CLK>,
<&gcc GCC_DISP_THROTTLE_CORE_CLK>;
clock-names = "bus",
"iface",
"rot",
"lut",
"core",
"vsync",
"throttle";
assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
assigned-clock-rates = <19200000>;
operating-points-v2 = <&mdp_opp_table>;
power-domains = <&rpmpd SM6375_VDDCX>;
interrupt-parent = <&mdss>;
interrupts = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dpu_intf1_out: endpoint {
remote-endpoint = <&dsi0_in>;
};
};
port@1 {
reg = <1>;
dpu_intf2_out: endpoint {
remote-endpoint = <&dsi1_in>;
};
};
};
};
dsi@5e94000 {
compatible = "qcom,sm6375-dsi-ctrl", "qcom,mdss-dsi-ctrl";
reg = <0x05e94000 0x400>;
reg-names = "dsi_ctrl";
interrupt-parent = <&mdss>;
interrupts = <4>;
clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK>,
<&dispcc DISP_CC_MDSS_BYTE0_INTF_CLK>,
<&dispcc DISP_CC_MDSS_PCLK0_CLK>,
<&dispcc DISP_CC_MDSS_ESC0_CLK>,
<&dispcc DISP_CC_MDSS_AHB_CLK>,
<&gcc GCC_DISP_HF_AXI_CLK>;
clock-names = "byte",
"byte_intf",
"pixel",
"core",
"iface",
"bus";
assigned-clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK_SRC>,
<&dispcc DISP_CC_MDSS_PCLK0_CLK_SRC>;
assigned-clock-parents = <&mdss_dsi0_phy 0>, <&mdss_dsi0_phy 1>;
operating-points-v2 = <&dsi_opp_table>;
power-domains = <&rpmpd SM6375_VDDMX>;
phys = <&mdss_dsi0_phy>;
phy-names = "dsi";
#address-cells = <1>;
#size-cells = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dsi0_in: endpoint {
remote-endpoint = <&dpu_intf1_out>;
};
};
port@1 {
reg = <1>;
dsi0_out: endpoint {
};
};
};
};
mdss_dsi0_phy: phy@5e94400 {
compatible = "qcom,sm6375-dsi-phy-7nm";
reg = <0x05e94400 0x200>,
<0x05e94600 0x280>,
<0x05e94900 0x264>;
reg-names = "dsi_phy",
"dsi_phy_lane",
"dsi_pll";
#clock-cells = <1>;
#phy-cells = <0>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmcc RPM_SMD_XO_CLK_SRC>;
clock-names = "iface", "ref";
};
};
...
...@@ -64,7 +64,7 @@ patternProperties: ...@@ -64,7 +64,7 @@ patternProperties:
type: object type: object
properties: properties:
compatible: compatible:
const: qcom,dsi-phy-5nm-8350 const: qcom,sm8350-dsi-phy-5nm
unevaluatedProperties: false unevaluatedProperties: false
......
...@@ -6514,6 +6514,7 @@ M: Rob Clark <robdclark@gmail.com> ...@@ -6514,6 +6514,7 @@ M: Rob Clark <robdclark@gmail.com>
M: Abhinav Kumar <quic_abhinavk@quicinc.com> M: Abhinav Kumar <quic_abhinavk@quicinc.com>
M: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> M: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
R: Sean Paul <sean@poorly.run> R: Sean Paul <sean@poorly.run>
R: Marijn Suijten <marijn.suijten@somainline.org>
L: linux-arm-msm@vger.kernel.org L: linux-arm-msm@vger.kernel.org
L: dri-devel@lists.freedesktop.org L: dri-devel@lists.freedesktop.org
L: freedreno@lists.freedesktop.org L: freedreno@lists.freedesktop.org
......
...@@ -122,7 +122,6 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \ ...@@ -122,7 +122,6 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
dp/dp_ctrl.o \ dp/dp_ctrl.o \
dp/dp_display.o \ dp/dp_display.o \
dp/dp_drm.o \ dp/dp_drm.o \
dp/dp_hpd.o \
dp/dp_link.o \ dp/dp_link.o \
dp/dp_panel.o \ dp/dp_panel.o \
dp/dp_parser.o \ dp/dp_parser.o \
......
...@@ -69,7 +69,7 @@ static void roq_print(struct msm_gpu *gpu, struct drm_printer *p) ...@@ -69,7 +69,7 @@ static void roq_print(struct msm_gpu *gpu, struct drm_printer *p)
static int show(struct seq_file *m, void *arg) static int show(struct seq_file *m, void *arg)
{ {
struct drm_info_node *node = (struct drm_info_node *) m->private; struct drm_info_node *node = m->private;
struct drm_device *dev = node->minor->dev; struct drm_device *dev = node->minor->dev;
struct msm_drm_private *priv = dev->dev_private; struct msm_drm_private *priv = dev->dev_private;
struct drm_printer p = drm_seq_file_printer(m); struct drm_printer p = drm_seq_file_printer(m);
......
...@@ -30,7 +30,7 @@ static const struct dpu_mdp_cfg msm8998_mdp[] = { ...@@ -30,7 +30,7 @@ static const struct dpu_mdp_cfg msm8998_mdp[] = {
{ {
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x458, .base = 0x0, .len = 0x458,
.features = 0, .features = BIT(DPU_MDP_VSYNC_SEL),
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 },
...@@ -39,8 +39,8 @@ static const struct dpu_mdp_cfg msm8998_mdp[] = { ...@@ -39,8 +39,8 @@ static const struct dpu_mdp_cfg msm8998_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 12 }, .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 12 },
.clk_ctrls[DPU_CLK_CTRL_CURSOR0] = { .reg_off = 0x3a8, .bit_off = 15 }, .clk_ctrls[DPU_CLK_CTRL_CURSOR0] = { .reg_off = 0x3a8, .bit_off = 16 },
.clk_ctrls[DPU_CLK_CTRL_CURSOR1] = { .reg_off = 0x3b0, .bit_off = 15 }, .clk_ctrls[DPU_CLK_CTRL_CURSOR1] = { .reg_off = 0x3b0, .bit_off = 16 },
}, },
}; };
...@@ -104,40 +104,53 @@ static const struct dpu_lm_cfg msm8998_lm[] = { ...@@ -104,40 +104,53 @@ static const struct dpu_lm_cfg msm8998_lm[] = {
LM_BLK("lm_2", LM_2, 0x46000, MIXER_MSM8998_MASK, LM_BLK("lm_2", LM_2, 0x46000, MIXER_MSM8998_MASK,
&msm8998_lm_sblk, PINGPONG_2, LM_5, 0), &msm8998_lm_sblk, PINGPONG_2, LM_5, 0),
LM_BLK("lm_3", LM_3, 0x47000, MIXER_MSM8998_MASK, LM_BLK("lm_3", LM_3, 0x47000, MIXER_MSM8998_MASK,
&msm8998_lm_sblk, PINGPONG_MAX, 0, 0), &msm8998_lm_sblk, PINGPONG_NONE, 0, 0),
LM_BLK("lm_4", LM_4, 0x48000, MIXER_MSM8998_MASK, LM_BLK("lm_4", LM_4, 0x48000, MIXER_MSM8998_MASK,
&msm8998_lm_sblk, PINGPONG_MAX, 0, 0), &msm8998_lm_sblk, PINGPONG_NONE, 0, 0),
LM_BLK("lm_5", LM_5, 0x49000, MIXER_MSM8998_MASK, LM_BLK("lm_5", LM_5, 0x49000, MIXER_MSM8998_MASK,
&msm8998_lm_sblk, PINGPONG_3, LM_2, 0), &msm8998_lm_sblk, PINGPONG_3, LM_2, 0),
}; };
static const struct dpu_pingpong_cfg msm8998_pp[] = { static const struct dpu_pingpong_cfg msm8998_pp[] = {
PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk_te, PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SDM845_TE2_MASK, 0, sdm845_pp_sblk_te,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)),
PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, 0, sdm845_pp_sblk_te, PP_BLK("pingpong_1", PINGPONG_1, 0x70800, PINGPONG_SDM845_TE2_MASK, 0, sdm845_pp_sblk_te,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)),
PP_BLK("pingpong_2", PINGPONG_2, 0x71000, 0, sdm845_pp_sblk, PP_BLK("pingpong_2", PINGPONG_2, 0x71000, PINGPONG_SDM845_MASK, 0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)),
PP_BLK("pingpong_3", PINGPONG_3, 0x71800, 0, sdm845_pp_sblk, PP_BLK("pingpong_3", PINGPONG_3, 0x71800, PINGPONG_SDM845_MASK, 0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)),
}; };
static const struct dpu_dsc_cfg msm8998_dsc[] = {
DSC_BLK("dsc_0", DSC_0, 0x80000, 0),
DSC_BLK("dsc_1", DSC_1, 0x80400, 0),
};
static const struct dpu_dspp_cfg msm8998_dspp[] = { static const struct dpu_dspp_cfg msm8998_dspp[] = {
DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_MSM8998_MASK, DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
&msm8998_dspp_sblk), &msm8998_dspp_sblk),
DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_MSM8998_MASK, DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK,
&msm8998_dspp_sblk), &msm8998_dspp_sblk),
}; };
static const struct dpu_intf_cfg msm8998_intf[] = { static const struct dpu_intf_cfg msm8998_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 21, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 21, INTF_SDM845_MASK,
INTF_BLK("intf_1", INTF_1, 0x6a800, 0x280, INTF_DSI, 0, 21, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_2", INTF_2, 0x6b000, 0x280, INTF_DSI, 1, 21, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 28, 29), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_HDMI, 0, 21, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 30, 31), INTF_BLK("intf_1", INTF_1, 0x6a800, 0x280, INTF_DSI, 0, 21, INTF_SDM845_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27)),
INTF_BLK("intf_2", INTF_2, 0x6b000, 0x280, INTF_DSI, 1, 21, INTF_SDM845_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29)),
INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_HDMI, 0, 21, INTF_SDM845_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31)),
}; };
static const struct dpu_perf_cfg msm8998_perf_data = { static const struct dpu_perf_cfg msm8998_perf_data = {
...@@ -191,11 +204,12 @@ const struct dpu_mdss_cfg dpu_msm8998_cfg = { ...@@ -191,11 +204,12 @@ const struct dpu_mdss_cfg dpu_msm8998_cfg = {
.dspp = msm8998_dspp, .dspp = msm8998_dspp,
.pingpong_count = ARRAY_SIZE(msm8998_pp), .pingpong_count = ARRAY_SIZE(msm8998_pp),
.pingpong = msm8998_pp, .pingpong = msm8998_pp,
.dsc_count = ARRAY_SIZE(msm8998_dsc),
.dsc = msm8998_dsc,
.intf_count = ARRAY_SIZE(msm8998_intf), .intf_count = ARRAY_SIZE(msm8998_intf),
.intf = msm8998_intf, .intf = msm8998_intf,
.vbif_count = ARRAY_SIZE(msm8998_vbif), .vbif_count = ARRAY_SIZE(msm8998_vbif),
.vbif = msm8998_vbif, .vbif = msm8998_vbif,
.reg_dma_count = 0,
.perf = &msm8998_perf_data, .perf = &msm8998_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
......
...@@ -30,7 +30,7 @@ static const struct dpu_mdp_cfg sdm845_mdp[] = { ...@@ -30,7 +30,7 @@ static const struct dpu_mdp_cfg sdm845_mdp[] = {
{ {
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x45c, .base = 0x0, .len = 0x45c,
.features = BIT(DPU_MDP_AUDIO_SELECT), .features = BIT(DPU_MDP_AUDIO_SELECT) | BIT(DPU_MDP_VSYNC_SEL),
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 },
...@@ -102,24 +102,24 @@ static const struct dpu_lm_cfg sdm845_lm[] = { ...@@ -102,24 +102,24 @@ static const struct dpu_lm_cfg sdm845_lm[] = {
LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_2, LM_5, 0), &sdm845_lm_sblk, PINGPONG_2, LM_5, 0),
LM_BLK("lm_3", LM_3, 0x0, MIXER_SDM845_MASK, LM_BLK("lm_3", LM_3, 0x0, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_MAX, 0, 0), &sdm845_lm_sblk, PINGPONG_NONE, 0, 0),
LM_BLK("lm_4", LM_4, 0x0, MIXER_SDM845_MASK, LM_BLK("lm_4", LM_4, 0x0, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_MAX, 0, 0), &sdm845_lm_sblk, PINGPONG_NONE, 0, 0),
LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_3, LM_2, 0), &sdm845_lm_sblk, PINGPONG_3, LM_2, 0),
}; };
static const struct dpu_pingpong_cfg sdm845_pp[] = { static const struct dpu_pingpong_cfg sdm845_pp[] = {
PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk_te, PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SDM845_TE2_MASK, 0, sdm845_pp_sblk_te,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)),
PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, 0, sdm845_pp_sblk_te, PP_BLK("pingpong_1", PINGPONG_1, 0x70800, PINGPONG_SDM845_TE2_MASK, 0, sdm845_pp_sblk_te,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)),
PP_BLK("pingpong_2", PINGPONG_2, 0x71000, 0, sdm845_pp_sblk, PP_BLK("pingpong_2", PINGPONG_2, 0x71000, PINGPONG_SDM845_MASK, 0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)),
PP_BLK("pingpong_3", PINGPONG_3, 0x71800, 0, sdm845_pp_sblk, PP_BLK("pingpong_3", PINGPONG_3, 0x71800, PINGPONG_SDM845_MASK, 0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)),
}; };
...@@ -132,10 +132,18 @@ static const struct dpu_dsc_cfg sdm845_dsc[] = { ...@@ -132,10 +132,18 @@ static const struct dpu_dsc_cfg sdm845_dsc[] = {
}; };
static const struct dpu_intf_cfg sdm845_intf[] = { static const struct dpu_intf_cfg sdm845_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 24, INTF_SDM845_MASK,
INTF_BLK("intf_1", INTF_1, 0x6a800, 0x280, INTF_DSI, 0, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_2", INTF_2, 0x6b000, 0x280, INTF_DSI, 1, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 28, 29), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 1, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 30, 31), INTF_BLK("intf_1", INTF_1, 0x6a800, 0x280, INTF_DSI, 0, 24, INTF_SDM845_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27)),
INTF_BLK("intf_2", INTF_2, 0x6b000, 0x280, INTF_DSI, 1, 24, INTF_SDM845_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29)),
INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 1, 24, INTF_SDM845_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31)),
}; };
static const struct dpu_perf_cfg sdm845_perf_data = { static const struct dpu_perf_cfg sdm845_perf_data = {
...@@ -193,8 +201,6 @@ const struct dpu_mdss_cfg dpu_sdm845_cfg = { ...@@ -193,8 +201,6 @@ const struct dpu_mdss_cfg dpu_sdm845_cfg = {
.intf = sdm845_intf, .intf = sdm845_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif), .vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif, .vbif = sdm845_vbif,
.reg_dma_count = 1,
.dma_cfg = &sdm845_regdma,
.perf = &sdm845_perf_data, .perf = &sdm845_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
......
...@@ -128,22 +128,22 @@ static const struct dpu_dspp_cfg sm8150_dspp[] = { ...@@ -128,22 +128,22 @@ static const struct dpu_dspp_cfg sm8150_dspp[] = {
}; };
static const struct dpu_pingpong_cfg sm8150_pp[] = { static const struct dpu_pingpong_cfg sm8150_pp[] = {
PP_BLK("pingpong_0", PINGPONG_0, 0x70000, MERGE_3D_0, sdm845_pp_sblk, PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SM8150_MASK, MERGE_3D_0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), -1),
PP_BLK("pingpong_1", PINGPONG_1, 0x70800, MERGE_3D_0, sdm845_pp_sblk, PP_BLK("pingpong_1", PINGPONG_1, 0x70800, PINGPONG_SM8150_MASK, MERGE_3D_0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), -1),
PP_BLK("pingpong_2", PINGPONG_2, 0x71000, MERGE_3D_1, sdm845_pp_sblk, PP_BLK("pingpong_2", PINGPONG_2, 0x71000, PINGPONG_SM8150_MASK, MERGE_3D_1, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), -1),
PP_BLK("pingpong_3", PINGPONG_3, 0x71800, MERGE_3D_1, sdm845_pp_sblk, PP_BLK("pingpong_3", PINGPONG_3, 0x71800, PINGPONG_SM8150_MASK, MERGE_3D_1, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), -1),
PP_BLK("pingpong_4", PINGPONG_4, 0x72000, MERGE_3D_2, sdm845_pp_sblk, PP_BLK("pingpong_4", PINGPONG_4, 0x72000, PINGPONG_SM8150_MASK, MERGE_3D_2, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30),
-1), -1),
PP_BLK("pingpong_5", PINGPONG_5, 0x72800, MERGE_3D_2, sdm845_pp_sblk, PP_BLK("pingpong_5", PINGPONG_5, 0x72800, PINGPONG_SM8150_MASK, MERGE_3D_2, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31),
-1), -1),
}; };
...@@ -162,10 +162,20 @@ static const struct dpu_dsc_cfg sm8150_dsc[] = { ...@@ -162,10 +162,20 @@ static const struct dpu_dsc_cfg sm8150_dsc[] = {
}; };
static const struct dpu_intf_cfg sm8150_intf[] = { static const struct dpu_intf_cfg sm8150_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 24, INTF_SC7180_MASK,
INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2bc, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_2", INTF_2, 0x6b000, 0x2bc, INTF_DSI, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 28, 29), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 30, 31), INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2bc, INTF_DSI, 0, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)),
INTF_BLK_DSI_TE("intf_2", INTF_2, 0x6b000, 0x2bc, INTF_DSI, 1, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
DPU_IRQ_IDX(MDP_INTF2_TEAR_INTR, 2)),
INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 1, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31)),
}; };
static const struct dpu_perf_cfg sm8150_perf_data = { static const struct dpu_perf_cfg sm8150_perf_data = {
...@@ -220,15 +230,15 @@ const struct dpu_mdss_cfg dpu_sm8150_cfg = { ...@@ -220,15 +230,15 @@ const struct dpu_mdss_cfg dpu_sm8150_cfg = {
.intf = sm8150_intf, .intf = sm8150_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif), .vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif, .vbif = sdm845_vbif,
.reg_dma_count = 1,
.dma_cfg = &sm8150_regdma,
.perf = &sm8150_perf_data, .perf = &sm8150_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_INTR) | \ BIT(MDP_INTF0_INTR) | \
BIT(MDP_INTF1_INTR) | \ BIT(MDP_INTF1_INTR) | \
BIT(MDP_INTF1_TEAR_INTR) | \
BIT(MDP_INTF2_INTR) | \ BIT(MDP_INTF2_INTR) | \
BIT(MDP_INTF2_TEAR_INTR) | \
BIT(MDP_INTF3_INTR) | \ BIT(MDP_INTF3_INTR) | \
BIT(MDP_AD4_0_INTR) | \ BIT(MDP_AD4_0_INTR) | \
BIT(MDP_AD4_1_INTR), BIT(MDP_AD4_1_INTR),
......
...@@ -102,9 +102,9 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = { ...@@ -102,9 +102,9 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = {
static const struct dpu_lm_cfg sc8180x_lm[] = { static const struct dpu_lm_cfg sc8180x_lm[] = {
LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_0, LM_1, 0), &sdm845_lm_sblk, PINGPONG_0, LM_1, DSPP_0),
LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_1, LM_0, 0), &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1),
LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_2, LM_3, 0), &sdm845_lm_sblk, PINGPONG_2, LM_3, 0),
LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK,
...@@ -115,23 +115,34 @@ static const struct dpu_lm_cfg sc8180x_lm[] = { ...@@ -115,23 +115,34 @@ static const struct dpu_lm_cfg sc8180x_lm[] = {
&sdm845_lm_sblk, PINGPONG_5, LM_4, 0), &sdm845_lm_sblk, PINGPONG_5, LM_4, 0),
}; };
static const struct dpu_dspp_cfg sc8180x_dspp[] = {
DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
&sm8150_dspp_sblk),
DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK,
&sm8150_dspp_sblk),
DSPP_BLK("dspp_2", DSPP_2, 0x58000, DSPP_SC7180_MASK,
&sm8150_dspp_sblk),
DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK,
&sm8150_dspp_sblk),
};
static const struct dpu_pingpong_cfg sc8180x_pp[] = { static const struct dpu_pingpong_cfg sc8180x_pp[] = {
PP_BLK("pingpong_0", PINGPONG_0, 0x70000, MERGE_3D_0, sdm845_pp_sblk, PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SM8150_MASK, MERGE_3D_0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), -1),
PP_BLK("pingpong_1", PINGPONG_1, 0x70800, MERGE_3D_0, sdm845_pp_sblk, PP_BLK("pingpong_1", PINGPONG_1, 0x70800, PINGPONG_SM8150_MASK, MERGE_3D_0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), -1),
PP_BLK("pingpong_2", PINGPONG_2, 0x71000, MERGE_3D_1, sdm845_pp_sblk, PP_BLK("pingpong_2", PINGPONG_2, 0x71000, PINGPONG_SM8150_MASK, MERGE_3D_1, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), -1),
PP_BLK("pingpong_3", PINGPONG_3, 0x71800, MERGE_3D_1, sdm845_pp_sblk, PP_BLK("pingpong_3", PINGPONG_3, 0x71800, PINGPONG_SM8150_MASK, MERGE_3D_1, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), -1),
PP_BLK("pingpong_4", PINGPONG_4, 0x72000, MERGE_3D_2, sdm845_pp_sblk, PP_BLK("pingpong_4", PINGPONG_4, 0x72000, PINGPONG_SM8150_MASK, MERGE_3D_2, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30),
-1), -1),
PP_BLK("pingpong_5", PINGPONG_5, 0x72800, MERGE_3D_2, sdm845_pp_sblk, PP_BLK("pingpong_5", PINGPONG_5, 0x72800, PINGPONG_SM8150_MASK, MERGE_3D_2, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31),
-1), -1),
}; };
...@@ -142,14 +153,37 @@ static const struct dpu_merge_3d_cfg sc8180x_merge_3d[] = { ...@@ -142,14 +153,37 @@ static const struct dpu_merge_3d_cfg sc8180x_merge_3d[] = {
MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x83200), MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x83200),
}; };
static const struct dpu_dsc_cfg sc8180x_dsc[] = {
DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)),
DSC_BLK("dsc_1", DSC_1, 0x80400, BIT(DPU_DSC_OUTPUT_CTRL)),
DSC_BLK("dsc_2", DSC_2, 0x80800, BIT(DPU_DSC_OUTPUT_CTRL)),
DSC_BLK("dsc_3", DSC_3, 0x80c00, BIT(DPU_DSC_OUTPUT_CTRL)),
DSC_BLK("dsc_4", DSC_4, 0x81000, BIT(DPU_DSC_OUTPUT_CTRL)),
DSC_BLK("dsc_5", DSC_5, 0x81400, BIT(DPU_DSC_OUTPUT_CTRL)),
};
static const struct dpu_intf_cfg sc8180x_intf[] = { static const struct dpu_intf_cfg sc8180x_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7180_MASK,
INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2bc, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_2", INTF_2, 0x6b000, 0x2bc, INTF_DSI, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 28, 29), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2bc, INTF_DSI, 0, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)),
INTF_BLK_DSI_TE("intf_2", INTF_2, 0x6b000, 0x2bc, INTF_DSI, 1, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
DPU_IRQ_IDX(MDP_INTF2_TEAR_INTR, 2)),
/* INTF_3 is for MST, wired to INTF_DP 0 and 1, use dummy index until this is supported */ /* INTF_3 is for MST, wired to INTF_DP 0 and 1, use dummy index until this is supported */
INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 999, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 30, 31), INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 999, 24, INTF_SC7180_MASK,
INTF_BLK("intf_4", INTF_4, 0x6c000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 20, 21), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
INTF_BLK("intf_5", INTF_5, 0x6c800, 0x280, INTF_DP, MSM_DP_CONTROLLER_2, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 22, 23), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31)),
INTF_BLK("intf_4", INTF_4, 0x6c000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 20),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 21)),
INTF_BLK("intf_5", INTF_5, 0x6c800, 0x280, INTF_DP, MSM_DP_CONTROLLER_2, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 22),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 23)),
}; };
static const struct dpu_perf_cfg sc8180x_perf_data = { static const struct dpu_perf_cfg sc8180x_perf_data = {
...@@ -190,6 +224,10 @@ const struct dpu_mdss_cfg dpu_sc8180x_cfg = { ...@@ -190,6 +224,10 @@ const struct dpu_mdss_cfg dpu_sc8180x_cfg = {
.sspp = sc8180x_sspp, .sspp = sc8180x_sspp,
.mixer_count = ARRAY_SIZE(sc8180x_lm), .mixer_count = ARRAY_SIZE(sc8180x_lm),
.mixer = sc8180x_lm, .mixer = sc8180x_lm,
.dspp_count = ARRAY_SIZE(sc8180x_dspp),
.dspp = sc8180x_dspp,
.dsc_count = ARRAY_SIZE(sc8180x_dsc),
.dsc = sc8180x_dsc,
.pingpong_count = ARRAY_SIZE(sc8180x_pp), .pingpong_count = ARRAY_SIZE(sc8180x_pp),
.pingpong = sc8180x_pp, .pingpong = sc8180x_pp,
.merge_3d_count = ARRAY_SIZE(sc8180x_merge_3d), .merge_3d_count = ARRAY_SIZE(sc8180x_merge_3d),
...@@ -198,15 +236,15 @@ const struct dpu_mdss_cfg dpu_sc8180x_cfg = { ...@@ -198,15 +236,15 @@ const struct dpu_mdss_cfg dpu_sc8180x_cfg = {
.intf = sc8180x_intf, .intf = sc8180x_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif), .vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif, .vbif = sdm845_vbif,
.reg_dma_count = 1,
.dma_cfg = &sm8150_regdma,
.perf = &sc8180x_perf_data, .perf = &sc8180x_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_INTR) | \ BIT(MDP_INTF0_INTR) | \
BIT(MDP_INTF1_INTR) | \ BIT(MDP_INTF1_INTR) | \
BIT(MDP_INTF1_TEAR_INTR) | \
BIT(MDP_INTF2_INTR) | \ BIT(MDP_INTF2_INTR) | \
BIT(MDP_INTF2_TEAR_INTR) | \
BIT(MDP_INTF3_INTR) | \ BIT(MDP_INTF3_INTR) | \
BIT(MDP_INTF4_INTR) | \ BIT(MDP_INTF4_INTR) | \
BIT(MDP_INTF5_INTR) | \ BIT(MDP_INTF5_INTR) | \
......
...@@ -129,22 +129,22 @@ static const struct dpu_dspp_cfg sm8250_dspp[] = { ...@@ -129,22 +129,22 @@ static const struct dpu_dspp_cfg sm8250_dspp[] = {
}; };
static const struct dpu_pingpong_cfg sm8250_pp[] = { static const struct dpu_pingpong_cfg sm8250_pp[] = {
PP_BLK("pingpong_0", PINGPONG_0, 0x70000, MERGE_3D_0, sdm845_pp_sblk, PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SM8150_MASK, MERGE_3D_0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), -1),
PP_BLK("pingpong_1", PINGPONG_1, 0x70800, MERGE_3D_0, sdm845_pp_sblk, PP_BLK("pingpong_1", PINGPONG_1, 0x70800, PINGPONG_SM8150_MASK, MERGE_3D_0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), -1),
PP_BLK("pingpong_2", PINGPONG_2, 0x71000, MERGE_3D_1, sdm845_pp_sblk, PP_BLK("pingpong_2", PINGPONG_2, 0x71000, PINGPONG_SM8150_MASK, MERGE_3D_1, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), -1),
PP_BLK("pingpong_3", PINGPONG_3, 0x71800, MERGE_3D_1, sdm845_pp_sblk, PP_BLK("pingpong_3", PINGPONG_3, 0x71800, PINGPONG_SM8150_MASK, MERGE_3D_1, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), -1),
PP_BLK("pingpong_4", PINGPONG_4, 0x72000, MERGE_3D_2, sdm845_pp_sblk, PP_BLK("pingpong_4", PINGPONG_4, 0x72000, PINGPONG_SM8150_MASK, MERGE_3D_2, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30),
-1), -1),
PP_BLK("pingpong_5", PINGPONG_5, 0x72800, MERGE_3D_2, sdm845_pp_sblk, PP_BLK("pingpong_5", PINGPONG_5, 0x72800, PINGPONG_SM8150_MASK, MERGE_3D_2, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31),
-1), -1),
}; };
...@@ -163,10 +163,20 @@ static const struct dpu_dsc_cfg sm8250_dsc[] = { ...@@ -163,10 +163,20 @@ static const struct dpu_dsc_cfg sm8250_dsc[] = {
}; };
static const struct dpu_intf_cfg sm8250_intf[] = { static const struct dpu_intf_cfg sm8250_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 24, INTF_SC7180_MASK,
INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_2", INTF_2, 0x6b000, 0x2c0, INTF_DSI, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 28, 29), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 30, 31), INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)),
INTF_BLK_DSI_TE("intf_2", INTF_2, 0x6b000, 0x2c0, INTF_DSI, 1, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
DPU_IRQ_IDX(MDP_INTF2_TEAR_INTR, 2)),
INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 1, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31)),
}; };
static const struct dpu_wb_cfg sm8250_wb[] = { static const struct dpu_wb_cfg sm8250_wb[] = {
...@@ -228,15 +238,15 @@ const struct dpu_mdss_cfg dpu_sm8250_cfg = { ...@@ -228,15 +238,15 @@ const struct dpu_mdss_cfg dpu_sm8250_cfg = {
.vbif = sdm845_vbif, .vbif = sdm845_vbif,
.wb_count = ARRAY_SIZE(sm8250_wb), .wb_count = ARRAY_SIZE(sm8250_wb),
.wb = sm8250_wb, .wb = sm8250_wb,
.reg_dma_count = 1,
.dma_cfg = &sm8250_regdma,
.perf = &sm8250_perf_data, .perf = &sm8250_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_INTR) | \ BIT(MDP_INTF0_INTR) | \
BIT(MDP_INTF1_INTR) | \ BIT(MDP_INTF1_INTR) | \
BIT(MDP_INTF1_TEAR_INTR) | \
BIT(MDP_INTF2_INTR) | \ BIT(MDP_INTF2_INTR) | \
BIT(MDP_INTF2_TEAR_INTR) | \
BIT(MDP_INTF3_INTR) | \ BIT(MDP_INTF3_INTR) | \
BIT(MDP_INTF4_INTR), BIT(MDP_INTF4_INTR),
}; };
......
...@@ -76,17 +76,22 @@ static const struct dpu_lm_cfg sc7180_lm[] = { ...@@ -76,17 +76,22 @@ static const struct dpu_lm_cfg sc7180_lm[] = {
static const struct dpu_dspp_cfg sc7180_dspp[] = { static const struct dpu_dspp_cfg sc7180_dspp[] = {
DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
&sc7180_dspp_sblk), &sm8150_dspp_sblk),
}; };
static const struct dpu_pingpong_cfg sc7180_pp[] = { static const struct dpu_pingpong_cfg sc7180_pp[] = {
PP_BLK("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk, -1, -1), PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SM8150_MASK, 0, sdm845_pp_sblk, -1, -1),
PP_BLK("pingpong_1", PINGPONG_1, 0x70800, 0, sdm845_pp_sblk, -1, -1), PP_BLK("pingpong_1", PINGPONG_1, 0x70800, PINGPONG_SM8150_MASK, 0, sdm845_pp_sblk, -1, -1),
}; };
static const struct dpu_intf_cfg sc7180_intf[] = { static const struct dpu_intf_cfg sc7180_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7180_MASK,
INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)),
}; };
static const struct dpu_wb_cfg sc7180_wb[] = { static const struct dpu_wb_cfg sc7180_wb[] = {
...@@ -143,14 +148,13 @@ const struct dpu_mdss_cfg dpu_sc7180_cfg = { ...@@ -143,14 +148,13 @@ const struct dpu_mdss_cfg dpu_sc7180_cfg = {
.wb = sc7180_wb, .wb = sc7180_wb,
.vbif_count = ARRAY_SIZE(sdm845_vbif), .vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif, .vbif = sdm845_vbif,
.reg_dma_count = 1,
.dma_cfg = &sdm845_regdma,
.perf = &sc7180_perf_data, .perf = &sc7180_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_INTR) | \ BIT(MDP_INTF0_INTR) | \
BIT(MDP_INTF1_INTR), BIT(MDP_INTF1_INTR) | \
BIT(MDP_INTF1_TEAR_INTR),
}; };
#endif #endif
...@@ -60,14 +60,17 @@ static const struct dpu_dspp_cfg sm6115_dspp[] = { ...@@ -60,14 +60,17 @@ static const struct dpu_dspp_cfg sm6115_dspp[] = {
}; };
static const struct dpu_pingpong_cfg sm6115_pp[] = { static const struct dpu_pingpong_cfg sm6115_pp[] = {
PP_BLK("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk, PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SM8150_MASK, 0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), -1),
}; };
static const struct dpu_intf_cfg sm6115_intf[] = { static const struct dpu_intf_cfg sm6115_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x00000, 0x280, INTF_NONE, 0, 0, 0, 0, 0, 0), INTF_BLK("intf_0", INTF_0, 0x00000, 0x280, INTF_NONE, 0, 0, 0, 0, 0),
INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)),
}; };
static const struct dpu_perf_cfg sm6115_perf_data = { static const struct dpu_perf_cfg sm6115_perf_data = {
...@@ -122,7 +125,8 @@ const struct dpu_mdss_cfg dpu_sm6115_cfg = { ...@@ -122,7 +125,8 @@ const struct dpu_mdss_cfg dpu_sm6115_cfg = {
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF1_INTR), BIT(MDP_INTF1_INTR) | \
BIT(MDP_INTF1_TEAR_INTR),
}; };
#endif #endif
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2023, Linaro Limited
*/
#ifndef _DPU_6_4_SM6350_H
#define _DPU_6_4_SM6350_H
static const struct dpu_caps sm6350_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0x7,
.qseed_type = DPU_SSPP_SCALER_QSEED4,
.has_src_split = true,
.has_dim_layer = true,
.has_idle_pc = true,
.max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
};
static const struct dpu_ubwc_cfg sm6350_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_20,
.ubwc_swizzle = 6,
.highest_bank_bit = 1,
};
static const struct dpu_mdp_cfg sm6350_mdp[] = {
{
.name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494,
.features = 0,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
},
};
static const struct dpu_ctl_cfg sm6350_ctl[] = {
{
.name = "ctl_0", .id = CTL_0,
.base = 0x1000, .len = 0x1dc,
.features = BIT(DPU_CTL_ACTIVE_CFG),
.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9),
},
{
.name = "ctl_1", .id = CTL_1,
.base = 0x1200, .len = 0x1dc,
.features = BIT(DPU_CTL_ACTIVE_CFG),
.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10),
},
{
.name = "ctl_2", .id = CTL_2,
.base = 0x1400, .len = 0x1dc,
.features = BIT(DPU_CTL_ACTIVE_CFG),
.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11),
},
{
.name = "ctl_3", .id = CTL_3,
.base = 0x1600, .len = 0x1dc,
.features = BIT(DPU_CTL_ACTIVE_CFG),
.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12),
},
};
static const struct dpu_sspp_cfg sm6350_sspp[] = {
SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK,
sc7180_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0),
SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK,
sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0),
SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1f8, DMA_CURSOR_SDM845_MASK,
sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1),
SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1f8, DMA_CURSOR_SDM845_MASK,
sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2),
};
static const struct dpu_lm_cfg sm6350_lm[] = {
LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK,
&sc7180_lm_sblk, PINGPONG_0, LM_1, DSPP_0),
LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK,
&sc7180_lm_sblk, PINGPONG_1, LM_0, 0),
};
static const struct dpu_dspp_cfg sm6350_dspp[] = {
DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
&sm8150_dspp_sblk),
};
static struct dpu_pingpong_cfg sm6350_pp[] = {
PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SM8150_MASK, 0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
-1),
PP_BLK("pingpong_1", PINGPONG_1, 0x70800, PINGPONG_SM8150_MASK, 0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
-1),
};
static const struct dpu_dsc_cfg sm6350_dsc[] = {
DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)),
};
static const struct dpu_intf_cfg sm6350_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 35, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 35, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)),
};
static const struct dpu_perf_cfg sm6350_perf_data = {
.max_bw_low = 4200000,
.max_bw_high = 5100000,
.min_core_ib = 2500000,
.min_llcc_ib = 0,
.min_dram_ib = 1600000,
.min_prefill_lines = 35,
/* TODO: confirm danger_lut_tbl */
.danger_lut_tbl = {0xffff, 0xffff, 0x0},
.safe_lut_tbl = {0xff00, 0xff00, 0xffff},
.qos_lut_tbl = {
{.nentry = ARRAY_SIZE(sm6350_qos_linear_macrotile),
.entries = sm6350_qos_linear_macrotile
},
{.nentry = ARRAY_SIZE(sm6350_qos_linear_macrotile),
.entries = sm6350_qos_linear_macrotile
},
{.nentry = ARRAY_SIZE(sc7180_qos_nrt),
.entries = sc7180_qos_nrt
},
},
.cdp_cfg = {
{.rd_enable = 1, .wr_enable = 1},
{.rd_enable = 1, .wr_enable = 0}
},
.clk_inefficiency_factor = 105,
.bw_inefficiency_factor = 120,
};
const struct dpu_mdss_cfg dpu_sm6350_cfg = {
.caps = &sm6350_dpu_caps,
.ubwc = &sm6350_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm6350_mdp),
.mdp = sm6350_mdp,
.ctl_count = ARRAY_SIZE(sm6350_ctl),
.ctl = sm6350_ctl,
.sspp_count = ARRAY_SIZE(sm6350_sspp),
.sspp = sm6350_sspp,
.mixer_count = ARRAY_SIZE(sm6350_lm),
.mixer = sm6350_lm,
.dspp_count = ARRAY_SIZE(sm6350_dspp),
.dspp = sm6350_dspp,
.dsc_count = ARRAY_SIZE(sm6350_dsc),
.dsc = sm6350_dsc,
.pingpong_count = ARRAY_SIZE(sm6350_pp),
.pingpong = sm6350_pp,
.intf_count = ARRAY_SIZE(sm6350_intf),
.intf = sm6350_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif,
.perf = &sm6350_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_INTR) | \
BIT(MDP_INTF1_INTR) | \
BIT(MDP_INTF1_TEAR_INTR),
};
#endif
...@@ -57,14 +57,17 @@ static const struct dpu_dspp_cfg qcm2290_dspp[] = { ...@@ -57,14 +57,17 @@ static const struct dpu_dspp_cfg qcm2290_dspp[] = {
}; };
static const struct dpu_pingpong_cfg qcm2290_pp[] = { static const struct dpu_pingpong_cfg qcm2290_pp[] = {
PP_BLK("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk, PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SM8150_MASK, 0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), -1),
}; };
static const struct dpu_intf_cfg qcm2290_intf[] = { static const struct dpu_intf_cfg qcm2290_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x00000, 0x280, INTF_NONE, 0, 0, 0, 0, 0, 0), INTF_BLK("intf_0", INTF_0, 0x00000, 0x280, INTF_NONE, 0, 0, 0, 0, 0),
INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)),
}; };
static const struct dpu_perf_cfg qcm2290_perf_data = { static const struct dpu_perf_cfg qcm2290_perf_data = {
...@@ -112,7 +115,8 @@ const struct dpu_mdss_cfg dpu_qcm2290_cfg = { ...@@ -112,7 +115,8 @@ const struct dpu_mdss_cfg dpu_qcm2290_cfg = {
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF1_INTR), BIT(MDP_INTF1_INTR) | \
BIT(MDP_INTF1_TEAR_INTR),
}; };
#endif #endif
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2023, Linaro Limited
*/
#ifndef _DPU_6_9_SM6375_H
#define _DPU_6_9_SM6375_H
static const struct dpu_caps sm6375_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_LINE_WIDTH,
.max_mixer_blendstages = 0x4,
.qseed_type = DPU_SSPP_SCALER_QSEED4,
.has_dim_layer = true,
.has_idle_pc = true,
.max_linewidth = 2160,
.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
};
static const struct dpu_ubwc_cfg sm6375_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_20,
.ubwc_swizzle = 6,
.highest_bank_bit = 1,
};
static const struct dpu_mdp_cfg sm6375_mdp[] = {
{
.name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494,
.features = 0,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
},
};
static const struct dpu_ctl_cfg sm6375_ctl[] = {
{
.name = "ctl_0", .id = CTL_0,
.base = 0x1000, .len = 0x1dc,
.features = BIT(DPU_CTL_ACTIVE_CFG),
.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9),
},
};
static const struct dpu_sspp_cfg sm6375_sspp[] = {
SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK,
sm6115_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0),
SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK,
sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0),
};
static const struct dpu_lm_cfg sm6375_lm[] = {
LM_BLK("lm_0", LM_0, 0x44000, MIXER_QCM2290_MASK,
&qcm2290_lm_sblk, PINGPONG_0, 0, DSPP_0),
};
static const struct dpu_dspp_cfg sm6375_dspp[] = {
DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
&sm8150_dspp_sblk),
};
static const struct dpu_pingpong_cfg sm6375_pp[] = {
PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SM8150_MASK, 0, sdm845_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
-1),
};
static const struct dpu_dsc_cfg sm6375_dsc[] = {
DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)),
};
static const struct dpu_intf_cfg sm6375_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x00000, 0x280, INTF_NONE, 0, 0, 0, 0, 0),
INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)),
};
static const struct dpu_perf_cfg sm6375_perf_data = {
.max_bw_low = 5200000,
.max_bw_high = 6200000,
.min_core_ib = 2500000,
.min_llcc_ib = 0, /* No LLCC on this SoC */
.min_dram_ib = 1600000,
.min_prefill_lines = 24,
/* TODO: confirm danger_lut_tbl */
.danger_lut_tbl = {0xffff, 0xffff, 0x0},
.safe_lut_tbl = {0xfe00, 0xfe00, 0xffff},
.qos_lut_tbl = {
{.nentry = ARRAY_SIZE(sm6350_qos_linear_macrotile),
.entries = sm6350_qos_linear_macrotile
},
{.nentry = ARRAY_SIZE(sm6350_qos_linear_macrotile),
.entries = sm6350_qos_linear_macrotile
},
{.nentry = ARRAY_SIZE(sc7180_qos_nrt),
.entries = sc7180_qos_nrt
},
},
.cdp_cfg = {
{.rd_enable = 1, .wr_enable = 1},
{.rd_enable = 1, .wr_enable = 0}
},
.clk_inefficiency_factor = 105,
.bw_inefficiency_factor = 120,
};
const struct dpu_mdss_cfg dpu_sm6375_cfg = {
.caps = &sm6375_dpu_caps,
.ubwc = &sm6375_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm6375_mdp),
.mdp = sm6375_mdp,
.ctl_count = ARRAY_SIZE(sm6375_ctl),
.ctl = sm6375_ctl,
.sspp_count = ARRAY_SIZE(sm6375_sspp),
.sspp = sm6375_sspp,
.mixer_count = ARRAY_SIZE(sm6375_lm),
.mixer = sm6375_lm,
.dspp_count = ARRAY_SIZE(sm6375_dspp),
.dspp = sm6375_dspp,
.dsc_count = ARRAY_SIZE(sm6375_dsc),
.dsc = sm6375_dsc,
.pingpong_count = ARRAY_SIZE(sm6375_pp),
.pingpong = sm6375_pp,
.intf_count = ARRAY_SIZE(sm6375_intf),
.intf = sm6375_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif,
.perf = &sm6375_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF1_INTR) | \
BIT(MDP_INTF1_TEAR_INTR),
};
#endif
...@@ -129,16 +129,16 @@ static const struct dpu_dspp_cfg sm8350_dspp[] = { ...@@ -129,16 +129,16 @@ static const struct dpu_dspp_cfg sm8350_dspp[] = {
static const struct dpu_pingpong_cfg sm8350_pp[] = { static const struct dpu_pingpong_cfg sm8350_pp[] = {
PP_BLK_DITHER("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), -1),
PP_BLK_DITHER("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), -1),
PP_BLK_DITHER("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), -1),
PP_BLK_DITHER("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), -1),
PP_BLK_DITHER("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30),
-1), -1),
...@@ -154,10 +154,20 @@ static const struct dpu_merge_3d_cfg sm8350_merge_3d[] = { ...@@ -154,10 +154,20 @@ static const struct dpu_merge_3d_cfg sm8350_merge_3d[] = {
}; };
static const struct dpu_intf_cfg sm8350_intf[] = { static const struct dpu_intf_cfg sm8350_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK,
INTF_BLK("intf_1", INTF_1, 0x35000, 0x2c4, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_2", INTF_2, 0x36000, 0x2c4, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), INTF_BLK_DSI_TE("intf_1", INTF_1, 0x35000, 0x2c4, INTF_DSI, 0, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_7xxx_TEAR_INTR, 2)),
INTF_BLK_DSI_TE("intf_2", INTF_2, 0x36000, 0x2c4, INTF_DSI, 1, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
DPU_IRQ_IDX(MDP_INTF2_7xxx_TEAR_INTR, 2)),
INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31)),
}; };
static const struct dpu_perf_cfg sm8350_perf_data = { static const struct dpu_perf_cfg sm8350_perf_data = {
...@@ -211,15 +221,15 @@ const struct dpu_mdss_cfg dpu_sm8350_cfg = { ...@@ -211,15 +221,15 @@ const struct dpu_mdss_cfg dpu_sm8350_cfg = {
.intf = sm8350_intf, .intf = sm8350_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif), .vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif, .vbif = sdm845_vbif,
.reg_dma_count = 1,
.dma_cfg = &sm8350_regdma,
.perf = &sm8350_perf_data, .perf = &sm8350_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_7xxx_INTR) | \ BIT(MDP_INTF0_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_INTR) | \ BIT(MDP_INTF1_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_TEAR_INTR) | \
BIT(MDP_INTF2_7xxx_INTR) | \ BIT(MDP_INTF2_7xxx_INTR) | \
BIT(MDP_INTF2_7xxx_TEAR_INTR) | \
BIT(MDP_INTF3_7xxx_INTR), BIT(MDP_INTF3_7xxx_INTR),
}; };
......
...@@ -31,6 +31,7 @@ static const struct dpu_mdp_cfg sc7280_mdp[] = { ...@@ -31,6 +31,7 @@ static const struct dpu_mdp_cfg sc7280_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },
}, },
}; };
...@@ -83,7 +84,7 @@ static const struct dpu_lm_cfg sc7280_lm[] = { ...@@ -83,7 +84,7 @@ static const struct dpu_lm_cfg sc7280_lm[] = {
static const struct dpu_dspp_cfg sc7280_dspp[] = { static const struct dpu_dspp_cfg sc7280_dspp[] = {
DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
&sc7180_dspp_sblk), &sm8150_dspp_sblk),
}; };
static const struct dpu_pingpong_cfg sc7280_pp[] = { static const struct dpu_pingpong_cfg sc7280_pp[] = {
...@@ -93,10 +94,22 @@ static const struct dpu_pingpong_cfg sc7280_pp[] = { ...@@ -93,10 +94,22 @@ static const struct dpu_pingpong_cfg sc7280_pp[] = {
PP_BLK_DITHER("pingpong_3", PINGPONG_3, 0x6c000, 0, sc7280_pp_sblk, -1, -1), PP_BLK_DITHER("pingpong_3", PINGPONG_3, 0x6c000, 0, sc7280_pp_sblk, -1, -1),
}; };
static const struct dpu_wb_cfg sc7280_wb[] = {
WB_BLK("wb_2", WB_2, 0x65000, WB_SM8250_MASK, DPU_CLK_CTRL_WB2, 6,
VBIF_RT, MDP_SSPP_TOP0_INTR, 4096, 4),
};
static const struct dpu_intf_cfg sc7280_intf[] = { static const struct dpu_intf_cfg sc7280_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK,
INTF_BLK("intf_1", INTF_1, 0x35000, 0x2c4, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_5", INTF_5, 0x39000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 22, 23), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK_DSI_TE("intf_1", INTF_1, 0x35000, 0x2c4, INTF_DSI, 0, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_7xxx_TEAR_INTR, 2)),
INTF_BLK("intf_5", INTF_5, 0x39000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 22),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 23)),
}; };
static const struct dpu_perf_cfg sc7280_perf_data = { static const struct dpu_perf_cfg sc7280_perf_data = {
...@@ -142,6 +155,8 @@ const struct dpu_mdss_cfg dpu_sc7280_cfg = { ...@@ -142,6 +155,8 @@ const struct dpu_mdss_cfg dpu_sc7280_cfg = {
.mixer = sc7280_lm, .mixer = sc7280_lm,
.pingpong_count = ARRAY_SIZE(sc7280_pp), .pingpong_count = ARRAY_SIZE(sc7280_pp),
.pingpong = sc7280_pp, .pingpong = sc7280_pp,
.wb_count = ARRAY_SIZE(sc7280_wb),
.wb = sc7280_wb,
.intf_count = ARRAY_SIZE(sc7280_intf), .intf_count = ARRAY_SIZE(sc7280_intf),
.intf = sc7280_intf, .intf = sc7280_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif), .vbif_count = ARRAY_SIZE(sdm845_vbif),
...@@ -152,6 +167,7 @@ const struct dpu_mdss_cfg dpu_sc7280_cfg = { ...@@ -152,6 +167,7 @@ const struct dpu_mdss_cfg dpu_sc7280_cfg = {
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_7xxx_INTR) | \ BIT(MDP_INTF0_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_INTR) | \ BIT(MDP_INTF1_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_TEAR_INTR) | \
BIT(MDP_INTF5_7xxx_INTR), BIT(MDP_INTF5_7xxx_INTR),
}; };
......
...@@ -42,17 +42,18 @@ static const struct dpu_mdp_cfg sc8280xp_mdp[] = { ...@@ -42,17 +42,18 @@ static const struct dpu_mdp_cfg sc8280xp_mdp[] = {
}, },
}; };
/* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */
static const struct dpu_ctl_cfg sc8280xp_ctl[] = { static const struct dpu_ctl_cfg sc8280xp_ctl[] = {
{ {
.name = "ctl_0", .id = CTL_0, .name = "ctl_0", .id = CTL_0,
.base = 0x15000, .len = 0x204, .base = 0x15000, .len = 0x204,
.features = CTL_SC7280_MASK, .features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK,
.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9),
}, },
{ {
.name = "ctl_1", .id = CTL_1, .name = "ctl_1", .id = CTL_1,
.base = 0x16000, .len = 0x204, .base = 0x16000, .len = 0x204,
.features = CTL_SC7280_MASK, .features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK,
.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10),
}, },
{ {
...@@ -143,15 +144,35 @@ static const struct dpu_merge_3d_cfg sc8280xp_merge_3d[] = { ...@@ -143,15 +144,35 @@ static const struct dpu_merge_3d_cfg sc8280xp_merge_3d[] = {
/* TODO: INTF 3, 8 and 7 are used for MST, marked as INTF_NONE for now */ /* TODO: INTF 3, 8 and 7 are used for MST, marked as INTF_NONE for now */
static const struct dpu_intf_cfg sc8280xp_intf[] = { static const struct dpu_intf_cfg sc8280xp_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK,
INTF_BLK("intf_1", INTF_1, 0x35000, 0x300, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_2", INTF_2, 0x36000, 0x300, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_NONE, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), INTF_BLK_DSI_TE("intf_1", INTF_1, 0x35000, 0x300, INTF_DSI, 0, 24, INTF_SC7280_MASK,
INTF_BLK("intf_4", INTF_4, 0x38000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 20, 21), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
INTF_BLK("intf_5", INTF_5, 0x39000, 0x280, INTF_DP, MSM_DP_CONTROLLER_3, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 22, 23), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
INTF_BLK("intf_6", INTF_6, 0x3a000, 0x280, INTF_DP, MSM_DP_CONTROLLER_2, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 16, 17), DPU_IRQ_IDX(MDP_INTF1_7xxx_TEAR_INTR, 2)),
INTF_BLK("intf_7", INTF_7, 0x3b000, 0x280, INTF_NONE, MSM_DP_CONTROLLER_2, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 18, 19), INTF_BLK_DSI_TE("intf_2", INTF_2, 0x36000, 0x300, INTF_DSI, 1, 24, INTF_SC7280_MASK,
INTF_BLK("intf_8", INTF_8, 0x3c000, 0x280, INTF_NONE, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 12, 13), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
DPU_IRQ_IDX(MDP_INTF2_7xxx_TEAR_INTR, 2)),
INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_NONE, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31)),
INTF_BLK("intf_4", INTF_4, 0x38000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 20),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 21)),
INTF_BLK("intf_5", INTF_5, 0x39000, 0x280, INTF_DP, MSM_DP_CONTROLLER_3, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 22),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 23)),
INTF_BLK("intf_6", INTF_6, 0x3a000, 0x280, INTF_DP, MSM_DP_CONTROLLER_2, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 16),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 17)),
INTF_BLK("intf_7", INTF_7, 0x3b000, 0x280, INTF_NONE, MSM_DP_CONTROLLER_2, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 18),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 19)),
INTF_BLK("intf_8", INTF_8, 0x3c000, 0x280, INTF_NONE, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)),
}; };
static const struct dpu_perf_cfg sc8280xp_perf_data = { static const struct dpu_perf_cfg sc8280xp_perf_data = {
...@@ -202,15 +223,15 @@ const struct dpu_mdss_cfg dpu_sc8280xp_cfg = { ...@@ -202,15 +223,15 @@ const struct dpu_mdss_cfg dpu_sc8280xp_cfg = {
.intf = sc8280xp_intf, .intf = sc8280xp_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif), .vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif, .vbif = sdm845_vbif,
.reg_dma_count = 1,
.dma_cfg = &sc8280xp_regdma,
.perf = &sc8280xp_perf_data, .perf = &sc8280xp_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_7xxx_INTR) | \ BIT(MDP_INTF0_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_INTR) | \ BIT(MDP_INTF1_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_TEAR_INTR) | \
BIT(MDP_INTF2_7xxx_INTR) | \ BIT(MDP_INTF2_7xxx_INTR) | \
BIT(MDP_INTF2_7xxx_TEAR_INTR) | \
BIT(MDP_INTF3_7xxx_INTR) | \ BIT(MDP_INTF3_7xxx_INTR) | \
BIT(MDP_INTF4_7xxx_INTR) | \ BIT(MDP_INTF4_7xxx_INTR) | \
BIT(MDP_INTF5_7xxx_INTR) | \ BIT(MDP_INTF5_7xxx_INTR) | \
......
...@@ -47,7 +47,7 @@ static const struct dpu_ctl_cfg sm8450_ctl[] = { ...@@ -47,7 +47,7 @@ static const struct dpu_ctl_cfg sm8450_ctl[] = {
{ {
.name = "ctl_0", .id = CTL_0, .name = "ctl_0", .id = CTL_0,
.base = 0x15000, .len = 0x204, .base = 0x15000, .len = 0x204,
.features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY) | BIT(DPU_CTL_FETCH_ACTIVE), .features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK,
.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9),
}, },
{ {
...@@ -107,9 +107,9 @@ static const struct dpu_lm_cfg sm8450_lm[] = { ...@@ -107,9 +107,9 @@ static const struct dpu_lm_cfg sm8450_lm[] = {
LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1), &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1),
LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_2, LM_3, 0), &sdm845_lm_sblk, PINGPONG_2, LM_3, DSPP_2),
LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_3, LM_2, 0), &sdm845_lm_sblk, PINGPONG_3, LM_2, DSPP_3),
LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK,
&sdm845_lm_sblk, PINGPONG_4, LM_5, 0), &sdm845_lm_sblk, PINGPONG_4, LM_5, 0),
LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK,
...@@ -126,20 +126,20 @@ static const struct dpu_dspp_cfg sm8450_dspp[] = { ...@@ -126,20 +126,20 @@ static const struct dpu_dspp_cfg sm8450_dspp[] = {
DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK, DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK,
&sm8150_dspp_sblk), &sm8150_dspp_sblk),
}; };
/* FIXME: interrupts */
static const struct dpu_pingpong_cfg sm8450_pp[] = { static const struct dpu_pingpong_cfg sm8450_pp[] = {
PP_BLK_DITHER("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), -1),
PP_BLK_DITHER("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), -1),
PP_BLK_DITHER("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), -1),
PP_BLK_DITHER("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), -1),
PP_BLK_DITHER("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sc7280_pp_sblk, PP_BLK_DITHER("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sc7280_pp_sblk,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30),
-1), -1),
...@@ -162,10 +162,20 @@ static const struct dpu_merge_3d_cfg sm8450_merge_3d[] = { ...@@ -162,10 +162,20 @@ static const struct dpu_merge_3d_cfg sm8450_merge_3d[] = {
}; };
static const struct dpu_intf_cfg sm8450_intf[] = { static const struct dpu_intf_cfg sm8450_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK,
INTF_BLK("intf_1", INTF_1, 0x35000, 0x300, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_2", INTF_2, 0x36000, 0x300, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), INTF_BLK_DSI_TE("intf_1", INTF_1, 0x35000, 0x300, INTF_DSI, 0, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_7xxx_TEAR_INTR, 2)),
INTF_BLK_DSI_TE("intf_2", INTF_2, 0x36000, 0x300, INTF_DSI, 1, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
DPU_IRQ_IDX(MDP_INTF2_7xxx_TEAR_INTR, 2)),
INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31)),
}; };
static const struct dpu_perf_cfg sm8450_perf_data = { static const struct dpu_perf_cfg sm8450_perf_data = {
...@@ -219,15 +229,15 @@ const struct dpu_mdss_cfg dpu_sm8450_cfg = { ...@@ -219,15 +229,15 @@ const struct dpu_mdss_cfg dpu_sm8450_cfg = {
.intf = sm8450_intf, .intf = sm8450_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif), .vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif, .vbif = sdm845_vbif,
.reg_dma_count = 1,
.dma_cfg = &sm8450_regdma,
.perf = &sm8450_perf_data, .perf = &sm8450_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_7xxx_INTR) | \ BIT(MDP_INTF0_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_INTR) | \ BIT(MDP_INTF1_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_TEAR_INTR) | \
BIT(MDP_INTF2_7xxx_INTR) | \ BIT(MDP_INTF2_7xxx_INTR) | \
BIT(MDP_INTF2_7xxx_TEAR_INTR) | \
BIT(MDP_INTF3_7xxx_INTR), BIT(MDP_INTF3_7xxx_INTR),
}; };
......
...@@ -166,11 +166,20 @@ static const struct dpu_merge_3d_cfg sm8550_merge_3d[] = { ...@@ -166,11 +166,20 @@ static const struct dpu_merge_3d_cfg sm8550_merge_3d[] = {
}; };
static const struct dpu_intf_cfg sm8550_intf[] = { static const struct dpu_intf_cfg sm8550_intf[] = {
INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK,
/* TODO TE sub-blocks for intf1 & intf2 */ DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
INTF_BLK("intf_1", INTF_1, 0x35000, 0x300, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),
INTF_BLK("intf_2", INTF_2, 0x36000, 0x300, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), INTF_BLK_DSI_TE("intf_1", INTF_1, 0x35000, 0x300, INTF_DSI, 0, 24, INTF_SC7280_MASK,
INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
DPU_IRQ_IDX(MDP_INTF1_7xxx_TEAR_INTR, 2)),
INTF_BLK_DSI_TE("intf_2", INTF_2, 0x36000, 0x300, INTF_DSI, 1, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
DPU_IRQ_IDX(MDP_INTF2_7xxx_TEAR_INTR, 2)),
INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK,
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31)),
}; };
static const struct dpu_perf_cfg sm8550_perf_data = { static const struct dpu_perf_cfg sm8550_perf_data = {
...@@ -224,15 +233,15 @@ const struct dpu_mdss_cfg dpu_sm8550_cfg = { ...@@ -224,15 +233,15 @@ const struct dpu_mdss_cfg dpu_sm8550_cfg = {
.intf = sm8550_intf, .intf = sm8550_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif), .vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif, .vbif = sdm845_vbif,
.reg_dma_count = 1,
.dma_cfg = &sm8450_regdma,
.perf = &sm8550_perf_data, .perf = &sm8550_perf_data,
.mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \
BIT(MDP_SSPP_TOP0_INTR2) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
BIT(MDP_SSPP_TOP0_HIST_INTR) | \ BIT(MDP_SSPP_TOP0_HIST_INTR) | \
BIT(MDP_INTF0_7xxx_INTR) | \ BIT(MDP_INTF0_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_INTR) | \ BIT(MDP_INTF1_7xxx_INTR) | \
BIT(MDP_INTF1_7xxx_TEAR_INTR) | \
BIT(MDP_INTF2_7xxx_INTR) | \ BIT(MDP_INTF2_7xxx_INTR) | \
BIT(MDP_INTF2_7xxx_TEAR_INTR) | \
BIT(MDP_INTF3_7xxx_INTR), BIT(MDP_INTF3_7xxx_INTR),
}; };
......
...@@ -1392,7 +1392,7 @@ DEFINE_SHOW_ATTRIBUTE(_dpu_debugfs_status); ...@@ -1392,7 +1392,7 @@ DEFINE_SHOW_ATTRIBUTE(_dpu_debugfs_status);
static int dpu_crtc_debugfs_state_show(struct seq_file *s, void *v) static int dpu_crtc_debugfs_state_show(struct seq_file *s, void *v)
{ {
struct drm_crtc *crtc = (struct drm_crtc *) s->private; struct drm_crtc *crtc = s->private;
struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
seq_printf(s, "client type: %d\n", dpu_crtc_get_client_type(crtc)); seq_printf(s, "client type: %d\n", dpu_crtc_get_client_type(crtc));
......
This diff is collapsed.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* struct msm_display_info - defines display properties * struct msm_display_info - defines display properties
* @intf_type: DRM_MODE_ENCODER_ type * @intf_type: INTF_ type
* @num_of_h_tiles: Number of horizontal tiles in case of split interface * @num_of_h_tiles: Number of horizontal tiles in case of split interface
* @h_tile_instance: Controller instance used per tile. Number of elements is * @h_tile_instance: Controller instance used per tile. Number of elements is
* based on num_of_h_tiles * based on num_of_h_tiles
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* @dsc: DSC configuration data for DSC-enabled displays * @dsc: DSC configuration data for DSC-enabled displays
*/ */
struct msm_display_info { struct msm_display_info {
int intf_type; enum dpu_intf_type intf_type;
uint32_t num_of_h_tiles; uint32_t num_of_h_tiles;
uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY]; uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY];
bool is_cmd_mode; bool is_cmd_mode;
...@@ -130,20 +130,12 @@ void dpu_encoder_virt_runtime_resume(struct drm_encoder *encoder); ...@@ -130,20 +130,12 @@ void dpu_encoder_virt_runtime_resume(struct drm_encoder *encoder);
/** /**
* dpu_encoder_init - initialize virtual encoder object * dpu_encoder_init - initialize virtual encoder object
* @dev: Pointer to drm device structure * @dev: Pointer to drm device structure
* @drm_enc_mode: corresponding DRM_MODE_ENCODER_* constant
* @disp_info: Pointer to display information structure * @disp_info: Pointer to display information structure
* Returns: Pointer to newly created drm encoder * Returns: Pointer to newly created drm encoder
*/ */
struct drm_encoder *dpu_encoder_init( struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
struct drm_device *dev, int drm_enc_mode,
int drm_enc_mode);
/**
* dpu_encoder_setup - setup dpu_encoder for the display probed
* @dev: Pointer to drm device structure
* @enc: Pointer to the drm_encoder
* @disp_info: Pointer to the display info
*/
int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
struct msm_display_info *disp_info); struct msm_display_info *disp_info);
/** /**
......
...@@ -63,7 +63,6 @@ struct dpu_encoder_phys; ...@@ -63,7 +63,6 @@ struct dpu_encoder_phys;
/** /**
* struct dpu_encoder_phys_ops - Interface the physical encoders provide to * struct dpu_encoder_phys_ops - Interface the physical encoders provide to
* the containing virtual encoder. * the containing virtual encoder.
* @late_register: DRM Call. Add Userspace interfaces, debugfs.
* @prepare_commit: MSM Atomic Call, start of atomic commit sequence * @prepare_commit: MSM Atomic Call, start of atomic commit sequence
* @is_master: Whether this phys_enc is the current master * @is_master: Whether this phys_enc is the current master
* encoder. Can be switched at enable time. Based * encoder. Can be switched at enable time. Based
...@@ -93,8 +92,6 @@ struct dpu_encoder_phys; ...@@ -93,8 +92,6 @@ struct dpu_encoder_phys;
*/ */
struct dpu_encoder_phys_ops { struct dpu_encoder_phys_ops {
int (*late_register)(struct dpu_encoder_phys *encoder,
struct dentry *debugfs_root);
void (*prepare_commit)(struct dpu_encoder_phys *encoder); void (*prepare_commit)(struct dpu_encoder_phys *encoder);
bool (*is_master)(struct dpu_encoder_phys *encoder); bool (*is_master)(struct dpu_encoder_phys *encoder);
void (*atomic_mode_set)(struct dpu_encoder_phys *encoder, void (*atomic_mode_set)(struct dpu_encoder_phys *encoder,
...@@ -129,10 +126,10 @@ struct dpu_encoder_phys_ops { ...@@ -129,10 +126,10 @@ struct dpu_encoder_phys_ops {
/** /**
* enum dpu_intr_idx - dpu encoder interrupt index * enum dpu_intr_idx - dpu encoder interrupt index
* @INTR_IDX_VSYNC: Vsync interrupt for video mode panel * @INTR_IDX_VSYNC: Vsync interrupt for video mode panel
* @INTR_IDX_PINGPONG: Pingpong done unterrupt for cmd mode panel * @INTR_IDX_PINGPONG: Pingpong done interrupt for cmd mode panel
* @INTR_IDX_UNDERRUN: Underrun unterrupt for video and cmd mode panel * @INTR_IDX_UNDERRUN: Underrun interrupt for video and cmd mode panel
* @INTR_IDX_RDPTR: Readpointer done unterrupt for cmd mode panel * @INTR_IDX_RDPTR: Readpointer done interrupt for cmd mode panel
* @INTR_IDX_WB_DONE: Writeback fone interrupt for virtual connector * @INTR_IDX_WB_DONE: Writeback done interrupt for virtual connector
*/ */
enum dpu_intr_idx { enum dpu_intr_idx {
INTR_IDX_VSYNC, INTR_IDX_VSYNC,
...@@ -161,8 +158,6 @@ enum dpu_intr_idx { ...@@ -161,8 +158,6 @@ enum dpu_intr_idx {
* @enabled: Whether the encoder has enabled and running a mode * @enabled: Whether the encoder has enabled and running a mode
* @split_role: Role to play in a split-panel configuration * @split_role: Role to play in a split-panel configuration
* @intf_mode: Interface mode * @intf_mode: Interface mode
* @intf_idx: Interface index on dpu hardware
* @wb_idx: Writeback index on dpu hardware
* @enc_spinlock: Virtual-Encoder-Wide Spin Lock for IRQ purposes * @enc_spinlock: Virtual-Encoder-Wide Spin Lock for IRQ purposes
* @enable_state: Enable state tracking * @enable_state: Enable state tracking
* @vblank_refcount: Reference count of vblank request * @vblank_refcount: Reference count of vblank request
...@@ -176,6 +171,7 @@ enum dpu_intr_idx { ...@@ -176,6 +171,7 @@ enum dpu_intr_idx {
* pending. * pending.
* @pending_kickoff_wq: Wait queue for blocking until kickoff completes * @pending_kickoff_wq: Wait queue for blocking until kickoff completes
* @irq: IRQ indices * @irq: IRQ indices
* @has_intf_te: Interface TE configuration support
*/ */
struct dpu_encoder_phys { struct dpu_encoder_phys {
struct drm_encoder *parent; struct drm_encoder *parent;
...@@ -189,8 +185,6 @@ struct dpu_encoder_phys { ...@@ -189,8 +185,6 @@ struct dpu_encoder_phys {
struct drm_display_mode cached_mode; struct drm_display_mode cached_mode;
enum dpu_enc_split_role split_role; enum dpu_enc_split_role split_role;
enum dpu_intf_mode intf_mode; enum dpu_intf_mode intf_mode;
enum dpu_intf intf_idx;
enum dpu_wb wb_idx;
spinlock_t *enc_spinlock; spinlock_t *enc_spinlock;
enum dpu_enc_enable_state enable_state; enum dpu_enc_enable_state enable_state;
atomic_t vblank_refcount; atomic_t vblank_refcount;
...@@ -200,6 +194,7 @@ struct dpu_encoder_phys { ...@@ -200,6 +194,7 @@ struct dpu_encoder_phys {
atomic_t pending_kickoff_cnt; atomic_t pending_kickoff_cnt;
wait_queue_head_t pending_kickoff_wq; wait_queue_head_t pending_kickoff_wq;
int irq[INTR_IDX_MAX]; int irq[INTR_IDX_MAX];
bool has_intf_te;
}; };
static inline int dpu_encoder_phys_inc_pending(struct dpu_encoder_phys *phys) static inline int dpu_encoder_phys_inc_pending(struct dpu_encoder_phys *phys)
...@@ -256,16 +251,16 @@ struct dpu_encoder_phys_cmd { ...@@ -256,16 +251,16 @@ struct dpu_encoder_phys_cmd {
* @parent: Pointer to the containing virtual encoder * @parent: Pointer to the containing virtual encoder
* @parent_ops: Callbacks exposed by the parent to the phys_enc * @parent_ops: Callbacks exposed by the parent to the phys_enc
* @split_role: Role to play in a split-panel configuration * @split_role: Role to play in a split-panel configuration
* @intf_idx: Interface index this phys_enc will control * @hw_intf: Hardware interface to the intf registers
* @wb_idx: Writeback index this phys_enc will control * @hw_wb: Hardware interface to the wb registers
* @enc_spinlock: Virtual-Encoder-Wide Spin Lock for IRQ purposes * @enc_spinlock: Virtual-Encoder-Wide Spin Lock for IRQ purposes
*/ */
struct dpu_enc_phys_init_params { struct dpu_enc_phys_init_params {
struct dpu_kms *dpu_kms; struct dpu_kms *dpu_kms;
struct drm_encoder *parent; struct drm_encoder *parent;
enum dpu_enc_split_role split_role; enum dpu_enc_split_role split_role;
enum dpu_intf intf_idx; struct dpu_hw_intf *hw_intf;
enum dpu_wb wb_idx; struct dpu_hw_wb *hw_wb;
spinlock_t *enc_spinlock; spinlock_t *enc_spinlock;
}; };
...@@ -405,4 +400,7 @@ void dpu_encoder_frame_done_callback( ...@@ -405,4 +400,7 @@ void dpu_encoder_frame_done_callback(
struct drm_encoder *drm_enc, struct drm_encoder *drm_enc,
struct dpu_encoder_phys *ready_phys, u32 event); struct dpu_encoder_phys *ready_phys, u32 event);
void dpu_encoder_phys_init(struct dpu_encoder_phys *phys,
struct dpu_enc_phys_init_params *p);
#endif /* __dpu_encoder_phys_H__ */ #endif /* __dpu_encoder_phys_H__ */
...@@ -287,7 +287,6 @@ static void dpu_encoder_phys_vid_setup_timing_engine( ...@@ -287,7 +287,6 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
if (phys_enc->hw_intf->ops.bind_pingpong_blk) if (phys_enc->hw_intf->ops.bind_pingpong_blk)
phys_enc->hw_intf->ops.bind_pingpong_blk( phys_enc->hw_intf->ops.bind_pingpong_blk(
phys_enc->hw_intf, phys_enc->hw_intf,
true,
phys_enc->hw_pp->idx); phys_enc->hw_pp->idx);
if (phys_enc->hw_pp->merge_3d) if (phys_enc->hw_pp->merge_3d)
...@@ -699,7 +698,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init( ...@@ -699,7 +698,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
struct dpu_enc_phys_init_params *p) struct dpu_enc_phys_init_params *p)
{ {
struct dpu_encoder_phys *phys_enc = NULL; struct dpu_encoder_phys *phys_enc = NULL;
int i;
if (!p) { if (!p) {
DPU_ERROR("failed to create encoder due to invalid parameter\n"); DPU_ERROR("failed to create encoder due to invalid parameter\n");
...@@ -712,26 +710,14 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init( ...@@ -712,26 +710,14 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
phys_enc->intf_idx = p->intf_idx;
DPU_DEBUG_VIDENC(phys_enc, "\n"); DPU_DEBUG_VIDENC(phys_enc, "\n");
dpu_encoder_phys_init(phys_enc, p);
dpu_encoder_phys_vid_init_ops(&phys_enc->ops); dpu_encoder_phys_vid_init_ops(&phys_enc->ops);
phys_enc->parent = p->parent;
phys_enc->dpu_kms = p->dpu_kms;
phys_enc->split_role = p->split_role;
phys_enc->intf_mode = INTF_MODE_VIDEO; phys_enc->intf_mode = INTF_MODE_VIDEO;
phys_enc->enc_spinlock = p->enc_spinlock;
for (i = 0; i < ARRAY_SIZE(phys_enc->irq); i++)
phys_enc->irq[i] = -EINVAL;
atomic_set(&phys_enc->vblank_refcount, 0);
atomic_set(&phys_enc->pending_kickoff_cnt, 0);
init_waitqueue_head(&phys_enc->pending_kickoff_wq);
phys_enc->enable_state = DPU_ENC_DISABLED;
DPU_DEBUG_VIDENC(phys_enc, "created intf idx:%d\n", p->intf_idx); DPU_DEBUG_VIDENC(phys_enc, "created intf idx:%d\n", p->hw_intf->idx);
return phys_enc; return phys_enc;
} }
...@@ -102,7 +102,7 @@ static void dpu_encoder_phys_wb_set_qos_remap( ...@@ -102,7 +102,7 @@ static void dpu_encoder_phys_wb_set_qos_remap(
static void dpu_encoder_phys_wb_set_qos(struct dpu_encoder_phys *phys_enc) static void dpu_encoder_phys_wb_set_qos(struct dpu_encoder_phys *phys_enc)
{ {
struct dpu_hw_wb *hw_wb; struct dpu_hw_wb *hw_wb;
struct dpu_hw_wb_qos_cfg qos_cfg; struct dpu_hw_qos_cfg qos_cfg;
const struct dpu_mdss_cfg *catalog; const struct dpu_mdss_cfg *catalog;
const struct dpu_qos_lut_tbl *qos_lut_tb; const struct dpu_qos_lut_tbl *qos_lut_tb;
...@@ -115,7 +115,7 @@ static void dpu_encoder_phys_wb_set_qos(struct dpu_encoder_phys *phys_enc) ...@@ -115,7 +115,7 @@ static void dpu_encoder_phys_wb_set_qos(struct dpu_encoder_phys *phys_enc)
hw_wb = phys_enc->hw_wb; hw_wb = phys_enc->hw_wb;
memset(&qos_cfg, 0, sizeof(struct dpu_hw_wb_qos_cfg)); memset(&qos_cfg, 0, sizeof(struct dpu_hw_qos_cfg));
qos_cfg.danger_safe_en = true; qos_cfg.danger_safe_en = true;
qos_cfg.danger_lut = qos_cfg.danger_lut =
catalog->perf->danger_lut_tbl[DPU_QOS_LUT_USAGE_NRT]; catalog->perf->danger_lut_tbl[DPU_QOS_LUT_USAGE_NRT];
...@@ -140,7 +140,6 @@ static void dpu_encoder_phys_wb_setup_fb(struct dpu_encoder_phys *phys_enc, ...@@ -140,7 +140,6 @@ static void dpu_encoder_phys_wb_setup_fb(struct dpu_encoder_phys *phys_enc,
struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc); struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
struct dpu_hw_wb *hw_wb; struct dpu_hw_wb *hw_wb;
struct dpu_hw_wb_cfg *wb_cfg; struct dpu_hw_wb_cfg *wb_cfg;
struct dpu_hw_cdp_cfg cdp_cfg;
if (!phys_enc || !phys_enc->dpu_kms || !phys_enc->dpu_kms->catalog) { if (!phys_enc || !phys_enc->dpu_kms || !phys_enc->dpu_kms->catalog) {
DPU_ERROR("invalid encoder\n"); DPU_ERROR("invalid encoder\n");
...@@ -163,18 +162,10 @@ static void dpu_encoder_phys_wb_setup_fb(struct dpu_encoder_phys *phys_enc, ...@@ -163,18 +162,10 @@ static void dpu_encoder_phys_wb_setup_fb(struct dpu_encoder_phys *phys_enc,
hw_wb->ops.setup_outformat(hw_wb, wb_cfg); hw_wb->ops.setup_outformat(hw_wb, wb_cfg);
if (hw_wb->ops.setup_cdp) { if (hw_wb->ops.setup_cdp) {
memset(&cdp_cfg, 0, sizeof(struct dpu_hw_cdp_cfg)); const struct dpu_perf_cfg *perf = phys_enc->dpu_kms->catalog->perf;
cdp_cfg.enable = phys_enc->dpu_kms->catalog->perf->cdp_cfg hw_wb->ops.setup_cdp(hw_wb, wb_cfg->dest.format,
[DPU_PERF_CDP_USAGE_NRT].wr_enable; perf->cdp_cfg[DPU_PERF_CDP_USAGE_NRT].wr_enable);
cdp_cfg.ubwc_meta_enable =
DPU_FORMAT_IS_UBWC(wb_cfg->dest.format);
cdp_cfg.tile_amortize_enable =
DPU_FORMAT_IS_UBWC(wb_cfg->dest.format) ||
DPU_FORMAT_IS_TILE(wb_cfg->dest.format);
cdp_cfg.preload_ahead = DPU_WB_CDP_PRELOAD_AHEAD_64;
hw_wb->ops.setup_cdp(hw_wb, &cdp_cfg);
} }
if (hw_wb->ops.setup_outaddress) if (hw_wb->ops.setup_outaddress)
...@@ -219,7 +210,7 @@ static void dpu_encoder_phys_wb_setup_cdp(struct dpu_encoder_phys *phys_enc) ...@@ -219,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 */ /* setup which pp blk will connect to this wb */
if (hw_pp && phys_enc->hw_wb->ops.bind_pingpong_blk) 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_pp->idx);
phys_enc->hw_ctl->ops.setup_intf_cfg(phys_enc->hw_ctl, &intf_cfg); phys_enc->hw_ctl->ops.setup_intf_cfg(phys_enc->hw_ctl, &intf_cfg);
...@@ -249,7 +240,7 @@ static int dpu_encoder_phys_wb_atomic_check( ...@@ -249,7 +240,7 @@ static int dpu_encoder_phys_wb_atomic_check(
const struct drm_display_mode *mode = &crtc_state->mode; const struct drm_display_mode *mode = &crtc_state->mode;
DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n", DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n",
phys_enc->wb_idx, mode->name, mode->hdisplay, mode->vdisplay); phys_enc->hw_wb->idx, mode->name, mode->hdisplay, mode->vdisplay);
if (!conn_state || !conn_state->connector) { if (!conn_state || !conn_state->connector) {
DPU_ERROR("invalid connector state\n"); DPU_ERROR("invalid connector state\n");
...@@ -570,7 +561,7 @@ static void dpu_encoder_phys_wb_destroy(struct dpu_encoder_phys *phys_enc) ...@@ -570,7 +561,7 @@ static void dpu_encoder_phys_wb_destroy(struct dpu_encoder_phys *phys_enc)
if (!phys_enc) if (!phys_enc)
return; return;
DPU_DEBUG("[wb:%d]\n", phys_enc->wb_idx - WB_0); DPU_DEBUG("[wb:%d]\n", phys_enc->hw_wb->idx - WB_0);
kfree(phys_enc); kfree(phys_enc);
} }
...@@ -693,53 +684,32 @@ struct dpu_encoder_phys *dpu_encoder_phys_wb_init( ...@@ -693,53 +684,32 @@ struct dpu_encoder_phys *dpu_encoder_phys_wb_init(
{ {
struct dpu_encoder_phys *phys_enc = NULL; struct dpu_encoder_phys *phys_enc = NULL;
struct dpu_encoder_phys_wb *wb_enc = NULL; struct dpu_encoder_phys_wb *wb_enc = NULL;
int ret = 0;
int i;
DPU_DEBUG("\n"); DPU_DEBUG("\n");
if (!p || !p->parent) { if (!p || !p->parent) {
DPU_ERROR("invalid params\n"); DPU_ERROR("invalid params\n");
ret = -EINVAL; return ERR_PTR(-EINVAL);
goto fail_alloc;
} }
wb_enc = kzalloc(sizeof(*wb_enc), GFP_KERNEL); wb_enc = kzalloc(sizeof(*wb_enc), GFP_KERNEL);
if (!wb_enc) { if (!wb_enc) {
DPU_ERROR("failed to allocate wb phys_enc enc\n"); DPU_ERROR("failed to allocate wb phys_enc enc\n");
ret = -ENOMEM; return ERR_PTR(-ENOMEM);
goto fail_alloc;
} }
phys_enc = &wb_enc->base; phys_enc = &wb_enc->base;
phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
phys_enc->wb_idx = p->wb_idx; dpu_encoder_phys_init(phys_enc, p);
dpu_encoder_phys_wb_init_ops(&phys_enc->ops); dpu_encoder_phys_wb_init_ops(&phys_enc->ops);
phys_enc->parent = p->parent;
phys_enc->dpu_kms = p->dpu_kms;
phys_enc->split_role = p->split_role;
phys_enc->intf_mode = INTF_MODE_WB_LINE; phys_enc->intf_mode = INTF_MODE_WB_LINE;
phys_enc->wb_idx = p->wb_idx;
phys_enc->enc_spinlock = p->enc_spinlock;
atomic_set(&wb_enc->wbirq_refcount, 0); atomic_set(&wb_enc->wbirq_refcount, 0);
for (i = 0; i < ARRAY_SIZE(phys_enc->irq); i++)
phys_enc->irq[i] = -EINVAL;
atomic_set(&phys_enc->pending_kickoff_cnt, 0);
atomic_set(&phys_enc->vblank_refcount, 0);
wb_enc->wb_done_timeout_cnt = 0; wb_enc->wb_done_timeout_cnt = 0;
init_waitqueue_head(&phys_enc->pending_kickoff_wq); DPU_DEBUG("Created dpu_encoder_phys for wb %d\n", phys_enc->hw_wb->idx);
phys_enc->enable_state = DPU_ENC_DISABLED;
DPU_DEBUG("Created dpu_encoder_phys for wb %d\n",
phys_enc->wb_idx);
return phys_enc; return phys_enc;
fail_alloc:
return ERR_PTR(ret);
} }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "dpu_kms.h" #include "dpu_kms.h"
#define VIG_BASE_MASK \ #define VIG_BASE_MASK \
(BIT(DPU_SSPP_SRC) | BIT(DPU_SSPP_QOS) |\ (BIT(DPU_SSPP_QOS) |\
BIT(DPU_SSPP_CDP) |\ BIT(DPU_SSPP_CDP) |\
BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_EXCL_RECT)) BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_EXCL_RECT))
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#define VIG_QCM2290_MASK (VIG_BASE_MASK | BIT(DPU_SSPP_QOS_8LVL)) #define VIG_QCM2290_MASK (VIG_BASE_MASK | BIT(DPU_SSPP_QOS_8LVL))
#define DMA_MSM8998_MASK \ #define DMA_MSM8998_MASK \
(BIT(DPU_SSPP_SRC) | BIT(DPU_SSPP_QOS) |\ (BIT(DPU_SSPP_QOS) |\
BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\ BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\
BIT(DPU_SSPP_CDP) | BIT(DPU_SSPP_EXCL_RECT)) BIT(DPU_SSPP_CDP) | BIT(DPU_SSPP_EXCL_RECT))
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
(VIG_SC7280_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) (VIG_SC7280_MASK | BIT(DPU_SSPP_SMART_DMA_V2))
#define DMA_SDM845_MASK \ #define DMA_SDM845_MASK \
(BIT(DPU_SSPP_SRC) | BIT(DPU_SSPP_QOS) | BIT(DPU_SSPP_QOS_8LVL) |\ (BIT(DPU_SSPP_QOS) | BIT(DPU_SSPP_QOS_8LVL) |\
BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\ BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\
BIT(DPU_SSPP_CDP) | BIT(DPU_SSPP_EXCL_RECT)) BIT(DPU_SSPP_CDP) | BIT(DPU_SSPP_EXCL_RECT))
...@@ -75,11 +75,15 @@ ...@@ -75,11 +75,15 @@
#define MIXER_QCM2290_MASK \ #define MIXER_QCM2290_MASK \
(BIT(DPU_DIM_LAYER) | BIT(DPU_MIXER_COMBINED_ALPHA)) (BIT(DPU_DIM_LAYER) | BIT(DPU_MIXER_COMBINED_ALPHA))
#define PINGPONG_SDM845_MASK BIT(DPU_PINGPONG_DITHER) #define PINGPONG_SDM845_MASK \
(BIT(DPU_PINGPONG_DITHER) | BIT(DPU_PINGPONG_TE) | BIT(DPU_PINGPONG_DSC))
#define PINGPONG_SDM845_SPLIT_MASK \ #define PINGPONG_SDM845_TE2_MASK \
(PINGPONG_SDM845_MASK | BIT(DPU_PINGPONG_TE2)) (PINGPONG_SDM845_MASK | BIT(DPU_PINGPONG_TE2))
#define PINGPONG_SM8150_MASK \
(BIT(DPU_PINGPONG_DITHER) | BIT(DPU_PINGPONG_DSC))
#define CTL_SC7280_MASK \ #define CTL_SC7280_MASK \
(BIT(DPU_CTL_ACTIVE_CFG) | \ (BIT(DPU_CTL_ACTIVE_CFG) | \
BIT(DPU_CTL_FETCH_ACTIVE) | \ BIT(DPU_CTL_FETCH_ACTIVE) | \
...@@ -91,16 +95,17 @@ ...@@ -91,16 +95,17 @@
#define MERGE_3D_SM8150_MASK (0) #define MERGE_3D_SM8150_MASK (0)
#define DSPP_MSM8998_MASK BIT(DPU_DSPP_PCC) | BIT(DPU_DSPP_GC)
#define DSPP_SC7180_MASK BIT(DPU_DSPP_PCC) #define DSPP_SC7180_MASK BIT(DPU_DSPP_PCC)
#define INTF_SDM845_MASK (0) #define INTF_SDM845_MASK (0)
#define INTF_SC7180_MASK \ #define INTF_SC7180_MASK \
(BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) | BIT(DPU_INTF_STATUS_SUPPORTED)) (BIT(DPU_INTF_INPUT_CTRL) | \
BIT(DPU_INTF_TE) | \
BIT(DPU_INTF_STATUS_SUPPORTED) | \
BIT(DPU_DATA_HCTL_EN))
#define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN) #define INTF_SC7280_MASK (INTF_SC7180_MASK)
#define WB_SM8250_MASK (BIT(DPU_WB_LINE_MODE) | \ #define WB_SM8250_MASK (BIT(DPU_WB_LINE_MODE) | \
BIT(DPU_WB_UBWC) | \ BIT(DPU_WB_UBWC) | \
...@@ -252,8 +257,6 @@ static const uint32_t wb2_formats[] = { ...@@ -252,8 +257,6 @@ static const uint32_t wb2_formats[] = {
.maxdwnscale = MAX_DOWNSCALE_RATIO, \ .maxdwnscale = MAX_DOWNSCALE_RATIO, \
.maxupscale = MAX_UPSCALE_RATIO, \ .maxupscale = MAX_UPSCALE_RATIO, \
.smart_dma_priority = sdma_pri, \ .smart_dma_priority = sdma_pri, \
.src_blk = {.name = STRCAT("sspp_src_", num), \
.id = DPU_SSPP_SRC, .base = 0x00, .len = 0x150,}, \
.scaler_blk = {.name = STRCAT("sspp_scaler", num), \ .scaler_blk = {.name = STRCAT("sspp_scaler", num), \
.id = qseed_ver, \ .id = qseed_ver, \
.base = 0xa00, .len = 0xa0,}, \ .base = 0xa00, .len = 0xa0,}, \
...@@ -272,8 +275,6 @@ static const uint32_t wb2_formats[] = { ...@@ -272,8 +275,6 @@ static const uint32_t wb2_formats[] = {
.maxdwnscale = MAX_DOWNSCALE_RATIO, \ .maxdwnscale = MAX_DOWNSCALE_RATIO, \
.maxupscale = MAX_UPSCALE_RATIO, \ .maxupscale = MAX_UPSCALE_RATIO, \
.smart_dma_priority = sdma_pri, \ .smart_dma_priority = sdma_pri, \
.src_blk = {.name = STRCAT("sspp_src_", num), \
.id = DPU_SSPP_SRC, .base = 0x00, .len = 0x150,}, \
.scaler_blk = {.name = STRCAT("sspp_scaler", num), \ .scaler_blk = {.name = STRCAT("sspp_scaler", num), \
.id = qseed_ver, \ .id = qseed_ver, \
.base = 0xa00, .len = 0xa0,}, \ .base = 0xa00, .len = 0xa0,}, \
...@@ -292,8 +293,6 @@ static const uint32_t wb2_formats[] = { ...@@ -292,8 +293,6 @@ static const uint32_t wb2_formats[] = {
.maxdwnscale = SSPP_UNITY_SCALE, \ .maxdwnscale = SSPP_UNITY_SCALE, \
.maxupscale = SSPP_UNITY_SCALE, \ .maxupscale = SSPP_UNITY_SCALE, \
.smart_dma_priority = sdma_pri, \ .smart_dma_priority = sdma_pri, \
.src_blk = {.name = STRCAT("sspp_src_", num), \
.id = DPU_SSPP_SRC, .base = 0x00, .len = 0x150,}, \
.format_list = plane_formats, \ .format_list = plane_formats, \
.num_formats = ARRAY_SIZE(plane_formats), \ .num_formats = ARRAY_SIZE(plane_formats), \
.virt_format_list = plane_formats, \ .virt_format_list = plane_formats, \
...@@ -375,8 +374,6 @@ static const struct dpu_sspp_sub_blks sm8550_dma_sblk_5 = _DMA_SBLK("13", 6); ...@@ -375,8 +374,6 @@ static const struct dpu_sspp_sub_blks sm8550_dma_sblk_5 = _DMA_SBLK("13", 6);
.maxdwnscale = SSPP_UNITY_SCALE, \ .maxdwnscale = SSPP_UNITY_SCALE, \
.maxupscale = SSPP_UNITY_SCALE, \ .maxupscale = SSPP_UNITY_SCALE, \
.smart_dma_priority = sdma_pri, \ .smart_dma_priority = sdma_pri, \
.src_blk = {.name = STRCAT("sspp_src_", num), \
.id = DPU_SSPP_SRC, .base = 0x00, .len = 0x150,}, \
.format_list = plane_formats_yuv, \ .format_list = plane_formats_yuv, \
.num_formats = ARRAY_SIZE(plane_formats_yuv), \ .num_formats = ARRAY_SIZE(plane_formats_yuv), \
.virt_format_list = plane_formats, \ .virt_format_list = plane_formats, \
...@@ -449,13 +446,6 @@ static const struct dpu_lm_sub_blks qcm2290_lm_sblk = { ...@@ -449,13 +446,6 @@ static const struct dpu_lm_sub_blks qcm2290_lm_sblk = {
static const struct dpu_dspp_sub_blks msm8998_dspp_sblk = { static const struct dpu_dspp_sub_blks msm8998_dspp_sblk = {
.pcc = {.id = DPU_DSPP_PCC, .base = 0x1700, .pcc = {.id = DPU_DSPP_PCC, .base = 0x1700,
.len = 0x90, .version = 0x10007}, .len = 0x90, .version = 0x10007},
.gc = { .id = DPU_DSPP_GC, .base = 0x17c0,
.len = 0x90, .version = 0x10007},
};
static const struct dpu_dspp_sub_blks sc7180_dspp_sblk = {
.pcc = {.id = DPU_DSPP_PCC, .base = 0x1700,
.len = 0x90, .version = 0x10000},
}; };
static const struct dpu_dspp_sub_blks sm8150_dspp_sblk = { static const struct dpu_dspp_sub_blks sm8150_dspp_sblk = {
...@@ -501,21 +491,11 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = { ...@@ -501,21 +491,11 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = {
.intr_done = _done, \ .intr_done = _done, \
.intr_rdptr = _rdptr, \ .intr_rdptr = _rdptr, \
} }
#define PP_BLK_TE(_name, _id, _base, _merge_3d, _sblk, _done, _rdptr) \ #define PP_BLK(_name, _id, _base, _features, _merge_3d, _sblk, _done, _rdptr) \
{\ {\
.name = _name, .id = _id, \ .name = _name, .id = _id, \
.base = _base, .len = 0xd4, \ .base = _base, .len = 0xd4, \
.features = PINGPONG_SDM845_SPLIT_MASK, \ .features = _features, \
.merge_3d = _merge_3d, \
.sblk = &_sblk, \
.intr_done = _done, \
.intr_rdptr = _rdptr, \
}
#define PP_BLK(_name, _id, _base, _merge_3d, _sblk, _done, _rdptr) \
{\
.name = _name, .id = _id, \
.base = _base, .len = 0xd4, \
.features = PINGPONG_SDM845_MASK, \
.merge_3d = _merge_3d, \ .merge_3d = _merge_3d, \
.sblk = &_sblk, \ .sblk = &_sblk, \
.intr_done = _done, \ .intr_done = _done, \
...@@ -546,7 +526,21 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = { ...@@ -546,7 +526,21 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = {
/************************************************************* /*************************************************************
* INTF sub blocks config * INTF sub blocks config
*************************************************************/ *************************************************************/
#define INTF_BLK(_name, _id, _base, _len, _type, _ctrl_id, _progfetch, _features, _reg, _underrun_bit, _vsync_bit) \ #define INTF_BLK(_name, _id, _base, _len, _type, _ctrl_id, _progfetch, _features, _underrun, _vsync) \
{\
.name = _name, .id = _id, \
.base = _base, .len = _len, \
.features = _features, \
.type = _type, \
.controller_id = _ctrl_id, \
.prog_fetch_lines_worst_case = _progfetch, \
.intr_underrun = _underrun, \
.intr_vsync = _vsync, \
.intr_tear_rd_ptr = -1, \
}
/* DSI Interface sub-block with TEAR registers (since DPU 5.0.0) */
#define INTF_BLK_DSI_TE(_name, _id, _base, _len, _type, _ctrl_id, _progfetch, _features, _underrun, _vsync, _tear_rd_ptr) \
{\ {\
.name = _name, .id = _id, \ .name = _name, .id = _id, \
.base = _base, .len = _len, \ .base = _base, .len = _len, \
...@@ -554,8 +548,9 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = { ...@@ -554,8 +548,9 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = {
.type = _type, \ .type = _type, \
.controller_id = _ctrl_id, \ .controller_id = _ctrl_id, \
.prog_fetch_lines_worst_case = _progfetch, \ .prog_fetch_lines_worst_case = _progfetch, \
.intr_underrun = DPU_IRQ_IDX(_reg, _underrun_bit), \ .intr_underrun = _underrun, \
.intr_vsync = DPU_IRQ_IDX(_reg, _vsync_bit), \ .intr_vsync = _vsync, \
.intr_tear_rd_ptr = _tear_rd_ptr, \
} }
/************************************************************* /*************************************************************
...@@ -650,46 +645,6 @@ static const struct dpu_vbif_cfg sdm845_vbif[] = { ...@@ -650,46 +645,6 @@ static const struct dpu_vbif_cfg sdm845_vbif[] = {
}, },
}; };
static const struct dpu_reg_dma_cfg sc8280xp_regdma = {
.base = 0x0,
.version = 0x00020000,
.trigger_sel_off = 0x119c,
.xin_id = 7,
.clk_ctrl = DPU_CLK_CTRL_REG_DMA,
};
static const struct dpu_reg_dma_cfg sdm845_regdma = {
.base = 0x0, .version = 0x1, .trigger_sel_off = 0x119c
};
static const struct dpu_reg_dma_cfg sm8150_regdma = {
.base = 0x0, .version = 0x00010001, .trigger_sel_off = 0x119c
};
static const struct dpu_reg_dma_cfg sm8250_regdma = {
.base = 0x0,
.version = 0x00010002,
.trigger_sel_off = 0x119c,
.xin_id = 7,
.clk_ctrl = DPU_CLK_CTRL_REG_DMA,
};
static const struct dpu_reg_dma_cfg sm8350_regdma = {
.base = 0x400,
.version = 0x00020000,
.trigger_sel_off = 0x119c,
.xin_id = 7,
.clk_ctrl = DPU_CLK_CTRL_REG_DMA,
};
static const struct dpu_reg_dma_cfg sm8450_regdma = {
.base = 0x0,
.version = 0x00020000,
.trigger_sel_off = 0x119c,
.xin_id = 7,
.clk_ctrl = DPU_CLK_CTRL_REG_DMA,
};
/************************************************************* /*************************************************************
* PERF data config * PERF data config
*************************************************************/ *************************************************************/
...@@ -734,6 +689,10 @@ static const struct dpu_qos_lut_entry sc7180_qos_linear[] = { ...@@ -734,6 +689,10 @@ static const struct dpu_qos_lut_entry sc7180_qos_linear[] = {
{.fl = 0, .lut = 0x0011222222335777}, {.fl = 0, .lut = 0x0011222222335777},
}; };
static const struct dpu_qos_lut_entry sm6350_qos_linear_macrotile[] = {
{.fl = 0, .lut = 0x0011223445566777 },
};
static const struct dpu_qos_lut_entry sm8150_qos_linear[] = { static const struct dpu_qos_lut_entry sm8150_qos_linear[] = {
{.fl = 0, .lut = 0x0011222222223357 }, {.fl = 0, .lut = 0x0011222222223357 },
}; };
...@@ -789,7 +748,9 @@ static const struct dpu_qos_lut_entry sc7180_qos_nrt[] = { ...@@ -789,7 +748,9 @@ static const struct dpu_qos_lut_entry sc7180_qos_nrt[] = {
#include "catalog/dpu_6_0_sm8250.h" #include "catalog/dpu_6_0_sm8250.h"
#include "catalog/dpu_6_2_sc7180.h" #include "catalog/dpu_6_2_sc7180.h"
#include "catalog/dpu_6_3_sm6115.h" #include "catalog/dpu_6_3_sm6115.h"
#include "catalog/dpu_6_4_sm6350.h"
#include "catalog/dpu_6_5_qcm2290.h" #include "catalog/dpu_6_5_qcm2290.h"
#include "catalog/dpu_6_9_sm6375.h"
#include "catalog/dpu_7_0_sm8350.h" #include "catalog/dpu_7_0_sm8350.h"
#include "catalog/dpu_7_2_sc7280.h" #include "catalog/dpu_7_2_sc7280.h"
......
...@@ -48,6 +48,8 @@ enum { ...@@ -48,6 +48,8 @@ enum {
* @DPU_MDP_UBWC_1_5, Universal Bandwidth compression version 1.5 * @DPU_MDP_UBWC_1_5, Universal Bandwidth compression version 1.5
* @DPU_MDP_PERIPH_0_REMOVED Indicates that access to periph top0 block results * @DPU_MDP_PERIPH_0_REMOVED Indicates that access to periph top0 block results
* in a failure * in a failure
* @DPU_MDP_VSYNC_SEL Enables vsync source selection via MDP_VSYNC_SEL register
* (moved into INTF block since DPU 5.0.0)
* @DPU_MDP_MAX Maximum value * @DPU_MDP_MAX Maximum value
*/ */
...@@ -59,12 +61,12 @@ enum { ...@@ -59,12 +61,12 @@ enum {
DPU_MDP_UBWC_1_5, DPU_MDP_UBWC_1_5,
DPU_MDP_AUDIO_SELECT, DPU_MDP_AUDIO_SELECT,
DPU_MDP_PERIPH_0_REMOVED, DPU_MDP_PERIPH_0_REMOVED,
DPU_MDP_VSYNC_SEL,
DPU_MDP_MAX DPU_MDP_MAX
}; };
/** /**
* SSPP sub-blocks/features * SSPP sub-blocks/features
* @DPU_SSPP_SRC Src and fetch part of the pipes,
* @DPU_SSPP_SCALER_QSEED2, QSEED2 algorithm support * @DPU_SSPP_SCALER_QSEED2, QSEED2 algorithm support
* @DPU_SSPP_SCALER_QSEED3, QSEED3 alogorithm support * @DPU_SSPP_SCALER_QSEED3, QSEED3 alogorithm support
* @DPU_SSPP_SCALER_QSEED3LITE, QSEED3 Lite alogorithm support * @DPU_SSPP_SCALER_QSEED3LITE, QSEED3 Lite alogorithm support
...@@ -85,8 +87,7 @@ enum { ...@@ -85,8 +87,7 @@ enum {
* @DPU_SSPP_MAX maximum value * @DPU_SSPP_MAX maximum value
*/ */
enum { enum {
DPU_SSPP_SRC = 0x1, DPU_SSPP_SCALER_QSEED2 = 0x1,
DPU_SSPP_SCALER_QSEED2,
DPU_SSPP_SCALER_QSEED3, DPU_SSPP_SCALER_QSEED3,
DPU_SSPP_SCALER_QSEED3LITE, DPU_SSPP_SCALER_QSEED3LITE,
DPU_SSPP_SCALER_QSEED4, DPU_SSPP_SCALER_QSEED4,
...@@ -127,13 +128,9 @@ enum { ...@@ -127,13 +128,9 @@ enum {
/** /**
* DSPP sub-blocks * DSPP sub-blocks
* @DPU_DSPP_PCC Panel color correction block * @DPU_DSPP_PCC Panel color correction block
* @DPU_DSPP_GC Gamma correction block
* @DPU_DSPP_IGC Inverse gamma correction block
*/ */
enum { enum {
DPU_DSPP_PCC = 0x1, DPU_DSPP_PCC = 0x1,
DPU_DSPP_GC,
DPU_DSPP_IGC,
DPU_DSPP_MAX DPU_DSPP_MAX
}; };
...@@ -143,7 +140,8 @@ enum { ...@@ -143,7 +140,8 @@ enum {
* @DPU_PINGPONG_TE2 Additional tear check block for split pipes * @DPU_PINGPONG_TE2 Additional tear check block for split pipes
* @DPU_PINGPONG_SPLIT PP block supports split fifo * @DPU_PINGPONG_SPLIT PP block supports split fifo
* @DPU_PINGPONG_SLAVE PP block is a suitable slave for split fifo * @DPU_PINGPONG_SLAVE PP block is a suitable slave for split fifo
* @DPU_PINGPONG_DITHER, Dither blocks * @DPU_PINGPONG_DITHER Dither blocks
* @DPU_PINGPONG_DSC PP block supports DSC
* @DPU_PINGPONG_MAX * @DPU_PINGPONG_MAX
*/ */
enum { enum {
...@@ -152,6 +150,7 @@ enum { ...@@ -152,6 +150,7 @@ enum {
DPU_PINGPONG_SPLIT, DPU_PINGPONG_SPLIT,
DPU_PINGPONG_SLAVE, DPU_PINGPONG_SLAVE,
DPU_PINGPONG_DITHER, DPU_PINGPONG_DITHER,
DPU_PINGPONG_DSC,
DPU_PINGPONG_MAX DPU_PINGPONG_MAX
}; };
...@@ -278,14 +277,6 @@ enum { ...@@ -278,14 +277,6 @@ enum {
u32 base; \ u32 base; \
u32 len u32 len
/**
* struct dpu_src_blk: SSPP part of the source pipes
* @info: HW register and features supported by this sub-blk
*/
struct dpu_src_blk {
DPU_HW_SUBBLK_INFO;
};
/** /**
* struct dpu_scaler_blk: Scaler information * struct dpu_scaler_blk: Scaler information
* @info: HW register and features supported by this sub-blk * @info: HW register and features supported by this sub-blk
...@@ -385,20 +376,13 @@ struct dpu_caps { ...@@ -385,20 +376,13 @@ struct dpu_caps {
/** /**
* struct dpu_sspp_sub_blks : SSPP sub-blocks * struct dpu_sspp_sub_blks : SSPP sub-blocks
* common: Pointer to common configurations shared by sub blocks * common: Pointer to common configurations shared by sub blocks
* @creq_vblank: creq priority during vertical blanking
* @danger_vblank: danger priority during vertical blanking
* @maxdwnscale: max downscale ratio supported(without DECIMATION) * @maxdwnscale: max downscale ratio supported(without DECIMATION)
* @maxupscale: maxupscale ratio supported * @maxupscale: maxupscale ratio supported
* @smart_dma_priority: hw priority of rect1 of multirect pipe * @smart_dma_priority: hw priority of rect1 of multirect pipe
* @max_per_pipe_bw: maximum allowable bandwidth of this pipe in kBps * @max_per_pipe_bw: maximum allowable bandwidth of this pipe in kBps
* @qseed_ver: qseed version * @qseed_ver: qseed version
* @src_blk:
* @scaler_blk: * @scaler_blk:
* @csc_blk: * @csc_blk:
* @hsic:
* @memcolor:
* @pcc_blk:
* @igc_blk:
* @format_list: Pointer to list of supported formats * @format_list: Pointer to list of supported formats
* @num_formats: Number of supported formats * @num_formats: Number of supported formats
* @virt_format_list: Pointer to list of supported formats for virtual planes * @virt_format_list: Pointer to list of supported formats for virtual planes
...@@ -406,20 +390,13 @@ struct dpu_caps { ...@@ -406,20 +390,13 @@ struct dpu_caps {
* @dpu_rotation_cfg: inline rotation configuration * @dpu_rotation_cfg: inline rotation configuration
*/ */
struct dpu_sspp_sub_blks { struct dpu_sspp_sub_blks {
u32 creq_vblank;
u32 danger_vblank;
u32 maxdwnscale; u32 maxdwnscale;
u32 maxupscale; u32 maxupscale;
u32 smart_dma_priority; u32 smart_dma_priority;
u32 max_per_pipe_bw; u32 max_per_pipe_bw;
u32 qseed_ver; u32 qseed_ver;
struct dpu_src_blk src_blk;
struct dpu_scaler_blk scaler_blk; struct dpu_scaler_blk scaler_blk;
struct dpu_pp_blk csc_blk; struct dpu_pp_blk csc_blk;
struct dpu_pp_blk hsic_blk;
struct dpu_pp_blk memcolor_blk;
struct dpu_pp_blk pcc_blk;
struct dpu_pp_blk igc_blk;
const u32 *format_list; const u32 *format_list;
u32 num_formats; u32 num_formats;
...@@ -433,22 +410,18 @@ struct dpu_sspp_sub_blks { ...@@ -433,22 +410,18 @@ struct dpu_sspp_sub_blks {
* @maxwidth: Max pixel width supported by this mixer * @maxwidth: Max pixel width supported by this mixer
* @maxblendstages: Max number of blend-stages supported * @maxblendstages: Max number of blend-stages supported
* @blendstage_base: Blend-stage register base offset * @blendstage_base: Blend-stage register base offset
* @gc: gamma correction block
*/ */
struct dpu_lm_sub_blks { struct dpu_lm_sub_blks {
u32 maxwidth; u32 maxwidth;
u32 maxblendstages; u32 maxblendstages;
u32 blendstage_base[MAX_BLOCKS]; u32 blendstage_base[MAX_BLOCKS];
struct dpu_pp_blk gc;
}; };
/** /**
* struct dpu_dspp_sub_blks: Information of DSPP block * struct dpu_dspp_sub_blks: Information of DSPP block
* @gc : gamma correction block
* @pcc: pixel color correction block * @pcc: pixel color correction block
*/ */
struct dpu_dspp_sub_blks { struct dpu_dspp_sub_blks {
struct dpu_pp_blk gc;
struct dpu_pp_blk pcc; struct dpu_pp_blk pcc;
}; };
...@@ -554,7 +527,7 @@ struct dpu_sspp_cfg { ...@@ -554,7 +527,7 @@ struct dpu_sspp_cfg {
* @base register offset of this block * @base register offset of this block
* @features bit mask identifying sub-blocks/features * @features bit mask identifying sub-blocks/features
* @sblk: LM Sub-blocks information * @sblk: LM Sub-blocks information
* @pingpong: ID of connected PingPong, PINGPONG_MAX if unsupported * @pingpong: ID of connected PingPong, PINGPONG_NONE if unsupported
* @lm_pair_mask: Bitmask of LMs that can be controlled by same CTL * @lm_pair_mask: Bitmask of LMs that can be controlled by same CTL
*/ */
struct dpu_lm_cfg { struct dpu_lm_cfg {
...@@ -628,6 +601,7 @@ struct dpu_dsc_cfg { ...@@ -628,6 +601,7 @@ struct dpu_dsc_cfg {
* @prog_fetch_lines_worst_case Worst case latency num lines needed to prefetch * @prog_fetch_lines_worst_case Worst case latency num lines needed to prefetch
* @intr_underrun: index for INTF underrun interrupt * @intr_underrun: index for INTF underrun interrupt
* @intr_vsync: index for INTF VSYNC interrupt * @intr_vsync: index for INTF VSYNC interrupt
* @intr_tear_rd_ptr: Index for INTF TEAR_RD_PTR interrupt
*/ */
struct dpu_intf_cfg { struct dpu_intf_cfg {
DPU_HW_BLK_INFO; DPU_HW_BLK_INFO;
...@@ -636,6 +610,7 @@ struct dpu_intf_cfg { ...@@ -636,6 +610,7 @@ struct dpu_intf_cfg {
u32 prog_fetch_lines_worst_case; u32 prog_fetch_lines_worst_case;
s32 intr_underrun; s32 intr_underrun;
s32 intr_vsync; s32 intr_vsync;
s32 intr_tear_rd_ptr;
}; };
/** /**
...@@ -720,21 +695,6 @@ struct dpu_vbif_cfg { ...@@ -720,21 +695,6 @@ struct dpu_vbif_cfg {
u32 memtype_count; u32 memtype_count;
u32 memtype[MAX_XIN_COUNT]; u32 memtype[MAX_XIN_COUNT];
}; };
/**
* struct dpu_reg_dma_cfg - information of lut dma blocks
* @id enum identifying this block
* @base register offset of this block
* @features bit mask identifying sub-blocks/features
* @version version of lutdma hw block
* @trigger_sel_off offset to trigger select registers of lutdma
*/
struct dpu_reg_dma_cfg {
DPU_HW_BLK_INFO;
u32 version;
u32 trigger_sel_off;
u32 xin_id;
enum dpu_clk_ctrl_type clk_ctrl;
};
/** /**
* Define CDP use cases * Define CDP use cases
...@@ -850,9 +810,6 @@ struct dpu_mdss_cfg { ...@@ -850,9 +810,6 @@ struct dpu_mdss_cfg {
u32 wb_count; u32 wb_count;
const struct dpu_wb_cfg *wb; const struct dpu_wb_cfg *wb;
u32 reg_dma_count;
const struct dpu_reg_dma_cfg *dma_cfg;
u32 ad_count; u32 ad_count;
u32 dspp_count; u32 dspp_count;
...@@ -875,7 +832,9 @@ extern const struct dpu_mdss_cfg dpu_sc8180x_cfg; ...@@ -875,7 +832,9 @@ extern const struct dpu_mdss_cfg dpu_sc8180x_cfg;
extern const struct dpu_mdss_cfg dpu_sm8250_cfg; extern const struct dpu_mdss_cfg dpu_sm8250_cfg;
extern const struct dpu_mdss_cfg dpu_sc7180_cfg; extern const struct dpu_mdss_cfg dpu_sc7180_cfg;
extern const struct dpu_mdss_cfg dpu_sm6115_cfg; extern const struct dpu_mdss_cfg dpu_sm6115_cfg;
extern const struct dpu_mdss_cfg dpu_sm6350_cfg;
extern const struct dpu_mdss_cfg dpu_qcm2290_cfg; extern const struct dpu_mdss_cfg dpu_qcm2290_cfg;
extern const struct dpu_mdss_cfg dpu_sm6375_cfg;
extern const struct dpu_mdss_cfg dpu_sm8350_cfg; extern const struct dpu_mdss_cfg dpu_sm8350_cfg;
extern const struct dpu_mdss_cfg dpu_sc7280_cfg; extern const struct dpu_mdss_cfg dpu_sc7280_cfg;
extern const struct dpu_mdss_cfg dpu_sc8280xp_cfg; extern const struct dpu_mdss_cfg dpu_sc8280xp_cfg;
......
...@@ -53,23 +53,6 @@ static const u32 fetch_tbl[SSPP_MAX] = {CTL_INVALID_BIT, 16, 17, 18, 19, ...@@ -53,23 +53,6 @@ static const u32 fetch_tbl[SSPP_MAX] = {CTL_INVALID_BIT, 16, 17, 18, 19,
CTL_INVALID_BIT, CTL_INVALID_BIT, CTL_INVALID_BIT, CTL_INVALID_BIT, 0, CTL_INVALID_BIT, CTL_INVALID_BIT, CTL_INVALID_BIT, CTL_INVALID_BIT, 0,
1, 2, 3, CTL_INVALID_BIT, CTL_INVALID_BIT}; 1, 2, 3, CTL_INVALID_BIT, CTL_INVALID_BIT};
static const struct dpu_ctl_cfg *_ctl_offset(enum dpu_ctl ctl,
const struct dpu_mdss_cfg *m,
void __iomem *addr,
struct dpu_hw_blk_reg_map *b)
{
int i;
for (i = 0; i < m->ctl_count; i++) {
if (ctl == m->ctl[i].id) {
b->blk_addr = addr + m->ctl[i].base;
b->log_mask = DPU_DBG_MASK_CTL;
return &m->ctl[i];
}
}
return ERR_PTR(-ENOMEM);
}
static int _mixer_stages(const struct dpu_lm_cfg *mixer, int count, static int _mixer_stages(const struct dpu_lm_cfg *mixer, int count,
enum dpu_lm lm) enum dpu_lm lm)
{ {
...@@ -117,6 +100,10 @@ static inline void dpu_hw_ctl_clear_pending_flush(struct dpu_hw_ctl *ctx) ...@@ -117,6 +100,10 @@ static inline void dpu_hw_ctl_clear_pending_flush(struct dpu_hw_ctl *ctx)
trace_dpu_hw_ctl_clear_pending_flush(ctx->pending_flush_mask, trace_dpu_hw_ctl_clear_pending_flush(ctx->pending_flush_mask,
dpu_hw_ctl_get_flush_register(ctx)); dpu_hw_ctl_get_flush_register(ctx));
ctx->pending_flush_mask = 0x0; ctx->pending_flush_mask = 0x0;
ctx->pending_intf_flush_mask = 0;
ctx->pending_wb_flush_mask = 0;
ctx->pending_merge_3d_flush_mask = 0;
ctx->pending_dsc_flush_mask = 0;
memset(ctx->pending_dspp_flush_mask, 0, memset(ctx->pending_dspp_flush_mask, 0,
sizeof(ctx->pending_dspp_flush_mask)); sizeof(ctx->pending_dspp_flush_mask));
...@@ -156,6 +143,11 @@ static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx) ...@@ -156,6 +143,11 @@ static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx)
CTL_DSPP_n_FLUSH(dspp - DSPP_0), CTL_DSPP_n_FLUSH(dspp - DSPP_0),
ctx->pending_dspp_flush_mask[dspp - DSPP_0]); ctx->pending_dspp_flush_mask[dspp - DSPP_0]);
} }
if (ctx->pending_flush_mask & BIT(DSC_IDX))
DPU_REG_WRITE(&ctx->hw, CTL_DSC_FLUSH,
ctx->pending_dsc_flush_mask);
DPU_REG_WRITE(&ctx->hw, CTL_FLUSH, ctx->pending_flush_mask); DPU_REG_WRITE(&ctx->hw, CTL_FLUSH, ctx->pending_flush_mask);
} }
...@@ -302,6 +294,13 @@ static void dpu_hw_ctl_update_pending_flush_merge_3d_v1(struct dpu_hw_ctl *ctx, ...@@ -302,6 +294,13 @@ static void dpu_hw_ctl_update_pending_flush_merge_3d_v1(struct dpu_hw_ctl *ctx,
ctx->pending_flush_mask |= BIT(MERGE_3D_IDX); ctx->pending_flush_mask |= BIT(MERGE_3D_IDX);
} }
static void dpu_hw_ctl_update_pending_flush_dsc_v1(struct dpu_hw_ctl *ctx,
enum dpu_dsc dsc_num)
{
ctx->pending_dsc_flush_mask |= BIT(dsc_num - DSC_0);
ctx->pending_flush_mask |= BIT(DSC_IDX);
}
static void dpu_hw_ctl_update_pending_flush_dspp(struct dpu_hw_ctl *ctx, static void dpu_hw_ctl_update_pending_flush_dspp(struct dpu_hw_ctl *ctx,
enum dpu_dspp dspp, u32 dspp_sub_blk) enum dpu_dspp dspp, u32 dspp_sub_blk)
{ {
...@@ -330,15 +329,9 @@ static void dpu_hw_ctl_update_pending_flush_dspp_sub_blocks( ...@@ -330,15 +329,9 @@ static void dpu_hw_ctl_update_pending_flush_dspp_sub_blocks(
return; return;
switch (dspp_sub_blk) { switch (dspp_sub_blk) {
case DPU_DSPP_IGC:
ctx->pending_dspp_flush_mask[dspp - DSPP_0] |= BIT(2);
break;
case DPU_DSPP_PCC: case DPU_DSPP_PCC:
ctx->pending_dspp_flush_mask[dspp - DSPP_0] |= BIT(4); ctx->pending_dspp_flush_mask[dspp - DSPP_0] |= BIT(4);
break; break;
case DPU_DSPP_GC:
ctx->pending_dspp_flush_mask[dspp - DSPP_0] |= BIT(5);
break;
default: default:
return; return;
} }
...@@ -519,9 +512,6 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, ...@@ -519,9 +512,6 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
if ((test_bit(DPU_CTL_VM_CFG, &ctx->caps->features))) if ((test_bit(DPU_CTL_VM_CFG, &ctx->caps->features)))
mode_sel = CTL_DEFAULT_GROUP_ID << 28; mode_sel = CTL_DEFAULT_GROUP_ID << 28;
if (cfg->dsc)
DPU_REG_WRITE(&ctx->hw, CTL_DSC_FLUSH, cfg->dsc);
if (cfg->intf_mode_sel == DPU_CTL_MODE_SEL_CMD) if (cfg->intf_mode_sel == DPU_CTL_MODE_SEL_CMD)
mode_sel |= BIT(17); mode_sel |= BIT(17);
...@@ -541,10 +531,9 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, ...@@ -541,10 +531,9 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
if (cfg->merge_3d) if (cfg->merge_3d)
DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE, DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE,
BIT(cfg->merge_3d - MERGE_3D_0)); BIT(cfg->merge_3d - MERGE_3D_0));
if (cfg->dsc) {
DPU_REG_WRITE(&ctx->hw, CTL_FLUSH, DSC_IDX); if (cfg->dsc)
DPU_REG_WRITE(c, CTL_DSC_ACTIVE, cfg->dsc); DPU_REG_WRITE(c, CTL_DSC_ACTIVE, cfg->dsc);
}
} }
static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx, static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx,
...@@ -587,6 +576,7 @@ static void dpu_hw_ctl_reset_intf_cfg_v1(struct dpu_hw_ctl *ctx, ...@@ -587,6 +576,7 @@ static void dpu_hw_ctl_reset_intf_cfg_v1(struct dpu_hw_ctl *ctx,
u32 intf_active = 0; u32 intf_active = 0;
u32 wb_active = 0; u32 wb_active = 0;
u32 merge3d_active = 0; u32 merge3d_active = 0;
u32 dsc_active;
/* /*
* This API resets each portion of the CTL path namely, * This API resets each portion of the CTL path namely,
...@@ -616,6 +606,12 @@ static void dpu_hw_ctl_reset_intf_cfg_v1(struct dpu_hw_ctl *ctx, ...@@ -616,6 +606,12 @@ static void dpu_hw_ctl_reset_intf_cfg_v1(struct dpu_hw_ctl *ctx,
wb_active &= ~BIT(cfg->wb - WB_0); wb_active &= ~BIT(cfg->wb - WB_0);
DPU_REG_WRITE(c, CTL_WB_ACTIVE, wb_active); DPU_REG_WRITE(c, CTL_WB_ACTIVE, wb_active);
} }
if (cfg->dsc) {
dsc_active = DPU_REG_READ(c, CTL_DSC_ACTIVE);
dsc_active &= ~cfg->dsc;
DPU_REG_WRITE(c, CTL_DSC_ACTIVE, dsc_active);
}
} }
static void dpu_hw_ctl_set_fetch_pipe_active(struct dpu_hw_ctl *ctx, static void dpu_hw_ctl_set_fetch_pipe_active(struct dpu_hw_ctl *ctx,
...@@ -647,6 +643,8 @@ static void _setup_ctl_ops(struct dpu_hw_ctl_ops *ops, ...@@ -647,6 +643,8 @@ static void _setup_ctl_ops(struct dpu_hw_ctl_ops *ops,
ops->update_pending_flush_merge_3d = ops->update_pending_flush_merge_3d =
dpu_hw_ctl_update_pending_flush_merge_3d_v1; dpu_hw_ctl_update_pending_flush_merge_3d_v1;
ops->update_pending_flush_wb = dpu_hw_ctl_update_pending_flush_wb_v1; ops->update_pending_flush_wb = dpu_hw_ctl_update_pending_flush_wb_v1;
ops->update_pending_flush_dsc =
dpu_hw_ctl_update_pending_flush_dsc_v1;
} else { } else {
ops->trigger_flush = dpu_hw_ctl_trigger_flush; ops->trigger_flush = dpu_hw_ctl_trigger_flush;
ops->setup_intf_cfg = dpu_hw_ctl_intf_cfg; ops->setup_intf_cfg = dpu_hw_ctl_intf_cfg;
...@@ -676,29 +674,25 @@ static void _setup_ctl_ops(struct dpu_hw_ctl_ops *ops, ...@@ -676,29 +674,25 @@ static void _setup_ctl_ops(struct dpu_hw_ctl_ops *ops,
ops->set_active_pipes = dpu_hw_ctl_set_fetch_pipe_active; ops->set_active_pipes = dpu_hw_ctl_set_fetch_pipe_active;
}; };
struct dpu_hw_ctl *dpu_hw_ctl_init(enum dpu_ctl idx, struct dpu_hw_ctl *dpu_hw_ctl_init(const struct dpu_ctl_cfg *cfg,
void __iomem *addr, void __iomem *addr,
const struct dpu_mdss_cfg *m) u32 mixer_count,
const struct dpu_lm_cfg *mixer)
{ {
struct dpu_hw_ctl *c; struct dpu_hw_ctl *c;
const struct dpu_ctl_cfg *cfg;
c = kzalloc(sizeof(*c), GFP_KERNEL); c = kzalloc(sizeof(*c), GFP_KERNEL);
if (!c) if (!c)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cfg = _ctl_offset(idx, m, addr, &c->hw); c->hw.blk_addr = addr + cfg->base;
if (IS_ERR_OR_NULL(cfg)) { c->hw.log_mask = DPU_DBG_MASK_CTL;
kfree(c);
pr_err("failed to create dpu_hw_ctl %d\n", idx);
return ERR_PTR(-EINVAL);
}
c->caps = cfg; c->caps = cfg;
_setup_ctl_ops(&c->ops, c->caps->features); _setup_ctl_ops(&c->ops, c->caps->features);
c->idx = idx; c->idx = cfg->id;
c->mixer_count = m->mixer_count; c->mixer_count = mixer_count;
c->mixer_hw_caps = m->mixer; c->mixer_hw_caps = mixer;
return c; return c;
} }
......
...@@ -157,6 +157,15 @@ struct dpu_hw_ctl_ops { ...@@ -157,6 +157,15 @@ struct dpu_hw_ctl_ops {
void (*update_pending_flush_dspp)(struct dpu_hw_ctl *ctx, void (*update_pending_flush_dspp)(struct dpu_hw_ctl *ctx,
enum dpu_dspp blk, u32 dspp_sub_blk); enum dpu_dspp blk, u32 dspp_sub_blk);
/**
* OR in the given flushbits to the cached pending_(dsc_)flush_mask
* No effect on hardware
* @ctx: ctl path ctx pointer
* @blk: interface block index
*/
void (*update_pending_flush_dsc)(struct dpu_hw_ctl *ctx,
enum dpu_dsc blk);
/** /**
* Write the value of the pending_flush_mask to hardware * Write the value of the pending_flush_mask to hardware
* @ctx : ctl path ctx pointer * @ctx : ctl path ctx pointer
...@@ -229,6 +238,7 @@ struct dpu_hw_ctl_ops { ...@@ -229,6 +238,7 @@ struct dpu_hw_ctl_ops {
* @pending_flush_mask: storage for pending ctl_flush managed via ops * @pending_flush_mask: storage for pending ctl_flush managed via ops
* @pending_intf_flush_mask: pending INTF flush * @pending_intf_flush_mask: pending INTF flush
* @pending_wb_flush_mask: pending WB flush * @pending_wb_flush_mask: pending WB flush
* @pending_dsc_flush_mask: pending DSC flush
* @ops: operation list * @ops: operation list
*/ */
struct dpu_hw_ctl { struct dpu_hw_ctl {
...@@ -245,6 +255,7 @@ struct dpu_hw_ctl { ...@@ -245,6 +255,7 @@ struct dpu_hw_ctl {
u32 pending_wb_flush_mask; u32 pending_wb_flush_mask;
u32 pending_merge_3d_flush_mask; u32 pending_merge_3d_flush_mask;
u32 pending_dspp_flush_mask[DSPP_MAX - DSPP_0]; u32 pending_dspp_flush_mask[DSPP_MAX - DSPP_0];
u32 pending_dsc_flush_mask;
/* ops */ /* ops */
struct dpu_hw_ctl_ops ops; struct dpu_hw_ctl_ops ops;
...@@ -261,15 +272,17 @@ static inline struct dpu_hw_ctl *to_dpu_hw_ctl(struct dpu_hw_blk *hw) ...@@ -261,15 +272,17 @@ static inline struct dpu_hw_ctl *to_dpu_hw_ctl(struct dpu_hw_blk *hw)
} }
/** /**
* dpu_hw_ctl_init(): Initializes the ctl_path hw driver object. * dpu_hw_ctl_init() - Initializes the ctl_path hw driver object.
* should be called before accessing every ctl path registers. * Should be called before accessing any ctl_path register.
* @idx: ctl_path index for which driver object is required * @cfg: ctl_path catalog entry for which driver object is required
* @addr: mapped register io address of MDP * @addr: mapped register io address of MDP
* @m : pointer to mdss catalog data * @mixer_count: Number of mixers in @mixer
* @mixer: Pointer to an array of Layer Mixers defined in the catalog
*/ */
struct dpu_hw_ctl *dpu_hw_ctl_init(enum dpu_ctl idx, struct dpu_hw_ctl *dpu_hw_ctl_init(const struct dpu_ctl_cfg *cfg,
void __iomem *addr, void __iomem *addr,
const struct dpu_mdss_cfg *m); u32 mixer_count,
const struct dpu_lm_cfg *mixer);
/** /**
* dpu_hw_ctl_destroy(): Destroys ctl driver context * dpu_hw_ctl_destroy(): Destroys ctl driver context
......
...@@ -154,7 +154,6 @@ static void dpu_hw_dsc_config_thresh(struct dpu_hw_dsc *hw_dsc, ...@@ -154,7 +154,6 @@ static void dpu_hw_dsc_config_thresh(struct dpu_hw_dsc *hw_dsc,
static void dpu_hw_dsc_bind_pingpong_blk( static void dpu_hw_dsc_bind_pingpong_blk(
struct dpu_hw_dsc *hw_dsc, struct dpu_hw_dsc *hw_dsc,
bool enable,
const enum dpu_pingpong pp) const enum dpu_pingpong pp)
{ {
struct dpu_hw_blk_reg_map *c = &hw_dsc->hw; struct dpu_hw_blk_reg_map *c = &hw_dsc->hw;
...@@ -163,36 +162,19 @@ static void dpu_hw_dsc_bind_pingpong_blk( ...@@ -163,36 +162,19 @@ static void dpu_hw_dsc_bind_pingpong_blk(
dsc_ctl_offset = DSC_CTL(hw_dsc->idx); dsc_ctl_offset = DSC_CTL(hw_dsc->idx);
if (enable) if (pp)
mux_cfg = (pp - PINGPONG_0) & 0x7; mux_cfg = (pp - PINGPONG_0) & 0x7;
DRM_DEBUG_KMS("%s dsc:%d %s pp:%d\n", if (pp)
enable ? "Binding" : "Unbinding", DRM_DEBUG_KMS("Binding dsc:%d to pp:%d\n",
hw_dsc->idx - DSC_0, hw_dsc->idx - DSC_0, pp - PINGPONG_0);
enable ? "to" : "from", else
pp - PINGPONG_0); DRM_DEBUG_KMS("Unbinding dsc:%d from any pp\n",
hw_dsc->idx - DSC_0);
DPU_REG_WRITE(c, dsc_ctl_offset, mux_cfg); DPU_REG_WRITE(c, dsc_ctl_offset, mux_cfg);
} }
static const struct dpu_dsc_cfg *_dsc_offset(enum dpu_dsc dsc,
const struct dpu_mdss_cfg *m,
void __iomem *addr,
struct dpu_hw_blk_reg_map *b)
{
int i;
for (i = 0; i < m->dsc_count; i++) {
if (dsc == m->dsc[i].id) {
b->blk_addr = addr + m->dsc[i].base;
b->log_mask = DPU_DBG_MASK_DSC;
return &m->dsc[i];
}
}
return NULL;
}
static void _setup_dsc_ops(struct dpu_hw_dsc_ops *ops, static void _setup_dsc_ops(struct dpu_hw_dsc_ops *ops,
unsigned long cap) unsigned long cap)
{ {
...@@ -203,23 +185,19 @@ static void _setup_dsc_ops(struct dpu_hw_dsc_ops *ops, ...@@ -203,23 +185,19 @@ static void _setup_dsc_ops(struct dpu_hw_dsc_ops *ops,
ops->dsc_bind_pingpong_blk = dpu_hw_dsc_bind_pingpong_blk; ops->dsc_bind_pingpong_blk = dpu_hw_dsc_bind_pingpong_blk;
}; };
struct dpu_hw_dsc *dpu_hw_dsc_init(enum dpu_dsc idx, void __iomem *addr, struct dpu_hw_dsc *dpu_hw_dsc_init(const struct dpu_dsc_cfg *cfg,
const struct dpu_mdss_cfg *m) void __iomem *addr)
{ {
struct dpu_hw_dsc *c; struct dpu_hw_dsc *c;
const struct dpu_dsc_cfg *cfg;
c = kzalloc(sizeof(*c), GFP_KERNEL); c = kzalloc(sizeof(*c), GFP_KERNEL);
if (!c) if (!c)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cfg = _dsc_offset(idx, m, addr, &c->hw); c->hw.blk_addr = addr + cfg->base;
if (IS_ERR_OR_NULL(cfg)) { c->hw.log_mask = DPU_DBG_MASK_DSC;
kfree(c);
return ERR_PTR(-EINVAL);
}
c->idx = idx; c->idx = cfg->id;
c->caps = cfg; c->caps = cfg;
_setup_dsc_ops(&c->ops, c->caps->features); _setup_dsc_ops(&c->ops, c->caps->features);
......
...@@ -44,7 +44,6 @@ struct dpu_hw_dsc_ops { ...@@ -44,7 +44,6 @@ struct dpu_hw_dsc_ops {
struct drm_dsc_config *dsc); struct drm_dsc_config *dsc);
void (*dsc_bind_pingpong_blk)(struct dpu_hw_dsc *hw_dsc, void (*dsc_bind_pingpong_blk)(struct dpu_hw_dsc *hw_dsc,
bool enable,
enum dpu_pingpong pp); enum dpu_pingpong pp);
}; };
...@@ -61,14 +60,13 @@ struct dpu_hw_dsc { ...@@ -61,14 +60,13 @@ struct dpu_hw_dsc {
}; };
/** /**
* dpu_hw_dsc_init - initializes the dsc block for the passed dsc idx. * dpu_hw_dsc_init() - Initializes the DSC hw driver object.
* @idx: DSC index for which driver object is required * @cfg: DSC catalog entry for which driver object is required
* @addr: Mapped register io address of MDP * @addr: Mapped register io address of MDP
* @m: Pointer to mdss catalog data * Return: Error code or allocated dpu_hw_dsc context
* Returns: Error code or allocated dpu_hw_dsc context
*/ */
struct dpu_hw_dsc *dpu_hw_dsc_init(enum dpu_dsc idx, void __iomem *addr, struct dpu_hw_dsc *dpu_hw_dsc_init(const struct dpu_dsc_cfg *cfg,
const struct dpu_mdss_cfg *m); void __iomem *addr);
/** /**
* dpu_hw_dsc_destroy - destroys dsc driver context * dpu_hw_dsc_destroy - destroys dsc driver context
......
...@@ -68,49 +68,23 @@ static void _setup_dspp_ops(struct dpu_hw_dspp *c, ...@@ -68,49 +68,23 @@ static void _setup_dspp_ops(struct dpu_hw_dspp *c,
c->ops.setup_pcc = dpu_setup_dspp_pcc; c->ops.setup_pcc = dpu_setup_dspp_pcc;
} }
static const struct dpu_dspp_cfg *_dspp_offset(enum dpu_dspp dspp, struct dpu_hw_dspp *dpu_hw_dspp_init(const struct dpu_dspp_cfg *cfg,
const struct dpu_mdss_cfg *m, void __iomem *addr)
void __iomem *addr,
struct dpu_hw_blk_reg_map *b)
{
int i;
if (!m || !addr || !b)
return ERR_PTR(-EINVAL);
for (i = 0; i < m->dspp_count; i++) {
if (dspp == m->dspp[i].id) {
b->blk_addr = addr + m->dspp[i].base;
b->log_mask = DPU_DBG_MASK_DSPP;
return &m->dspp[i];
}
}
return ERR_PTR(-EINVAL);
}
struct dpu_hw_dspp *dpu_hw_dspp_init(enum dpu_dspp idx,
void __iomem *addr,
const struct dpu_mdss_cfg *m)
{ {
struct dpu_hw_dspp *c; struct dpu_hw_dspp *c;
const struct dpu_dspp_cfg *cfg;
if (!addr || !m) if (!addr)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
c = kzalloc(sizeof(*c), GFP_KERNEL); c = kzalloc(sizeof(*c), GFP_KERNEL);
if (!c) if (!c)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cfg = _dspp_offset(idx, m, addr, &c->hw); c->hw.blk_addr = addr + cfg->base;
if (IS_ERR_OR_NULL(cfg)) { c->hw.log_mask = DPU_DBG_MASK_DSPP;
kfree(c);
return ERR_PTR(-EINVAL);
}
/* Assign ops */ /* Assign ops */
c->idx = idx; c->idx = cfg->id;
c->cap = cfg; c->cap = cfg;
_setup_dspp_ops(c, c->cap->features); _setup_dspp_ops(c, c->cap->features);
......
...@@ -79,14 +79,14 @@ static inline struct dpu_hw_dspp *to_dpu_hw_dspp(struct dpu_hw_blk *hw) ...@@ -79,14 +79,14 @@ static inline struct dpu_hw_dspp *to_dpu_hw_dspp(struct dpu_hw_blk *hw)
} }
/** /**
* dpu_hw_dspp_init - initializes the dspp hw driver object. * dpu_hw_dspp_init() - Initializes the DSPP hw driver object.
* should be called once before accessing every dspp. * should be called once before accessing every DSPP.
* @idx: DSPP index for which driver object is required * @cfg: DSPP catalog entry for which driver object is required
* @addr: Mapped register io address of MDP * @addr: Mapped register io address of MDP
* @Return: pointer to structure or ERR_PTR * Return: pointer to structure or ERR_PTR
*/ */
struct dpu_hw_dspp *dpu_hw_dspp_init(enum dpu_dspp idx, struct dpu_hw_dspp *dpu_hw_dspp_init(const struct dpu_dspp_cfg *cfg,
void __iomem *addr, const struct dpu_mdss_cfg *m); void __iomem *addr);
/** /**
* dpu_hw_dspp_destroy(): Destroys DSPP driver context * dpu_hw_dspp_destroy(): Destroys DSPP driver context
......
...@@ -17,30 +17,26 @@ ...@@ -17,30 +17,26 @@
* Register offsets in MDSS register file for the interrupt registers * Register offsets in MDSS register file for the interrupt registers
* w.r.t. the MDP base * w.r.t. the MDP base
*/ */
#define MDP_SSPP_TOP0_OFF 0x0 #define MDP_INTF_OFF(intf) (0x6A000 + 0x800 * (intf))
#define MDP_INTF_0_OFF 0x6A000 #define MDP_INTF_INTR_EN(intf) (MDP_INTF_OFF(intf) + 0x1c0)
#define MDP_INTF_1_OFF 0x6A800 #define MDP_INTF_INTR_STATUS(intf) (MDP_INTF_OFF(intf) + 0x1c4)
#define MDP_INTF_2_OFF 0x6B000 #define MDP_INTF_INTR_CLEAR(intf) (MDP_INTF_OFF(intf) + 0x1c8)
#define MDP_INTF_3_OFF 0x6B800 #define MDP_INTF_TEAR_OFF(intf) (0x6D700 + 0x100 * (intf))
#define MDP_INTF_4_OFF 0x6C000 #define MDP_INTF_INTR_TEAR_EN(intf) (MDP_INTF_TEAR_OFF(intf) + 0x000)
#define MDP_INTF_5_OFF 0x6C800 #define MDP_INTF_INTR_TEAR_STATUS(intf) (MDP_INTF_TEAR_OFF(intf) + 0x004)
#define INTF_INTR_EN 0x1c0 #define MDP_INTF_INTR_TEAR_CLEAR(intf) (MDP_INTF_TEAR_OFF(intf) + 0x008)
#define INTF_INTR_STATUS 0x1c4 #define MDP_AD4_OFF(ad4) (0x7C000 + 0x1000 * (ad4))
#define INTF_INTR_CLEAR 0x1c8 #define MDP_AD4_INTR_EN_OFF(ad4) (MDP_AD4_OFF(ad4) + 0x41c)
#define MDP_AD4_0_OFF 0x7C000 #define MDP_AD4_INTR_CLEAR_OFF(ad4) (MDP_AD4_OFF(ad4) + 0x424)
#define MDP_AD4_1_OFF 0x7D000 #define MDP_AD4_INTR_STATUS_OFF(ad4) (MDP_AD4_OFF(ad4) + 0x420)
#define MDP_AD4_INTR_EN_OFF 0x41c #define MDP_INTF_REV_7xxx_OFF(intf) (0x34000 + 0x1000 * (intf))
#define MDP_AD4_INTR_CLEAR_OFF 0x424 #define MDP_INTF_REV_7xxx_INTR_EN(intf) (MDP_INTF_REV_7xxx_OFF(intf) + 0x1c0)
#define MDP_AD4_INTR_STATUS_OFF 0x420 #define MDP_INTF_REV_7xxx_INTR_STATUS(intf) (MDP_INTF_REV_7xxx_OFF(intf) + 0x1c4)
#define MDP_INTF_0_OFF_REV_7xxx 0x34000 #define MDP_INTF_REV_7xxx_INTR_CLEAR(intf) (MDP_INTF_REV_7xxx_OFF(intf) + 0x1c8)
#define MDP_INTF_1_OFF_REV_7xxx 0x35000 #define MDP_INTF_REV_7xxx_TEAR_OFF(intf) (0x34800 + 0x1000 * (intf))
#define MDP_INTF_2_OFF_REV_7xxx 0x36000 #define MDP_INTF_REV_7xxx_INTR_TEAR_EN(intf) (MDP_INTF_REV_7xxx_TEAR_OFF(intf) + 0x000)
#define MDP_INTF_3_OFF_REV_7xxx 0x37000 #define MDP_INTF_REV_7xxx_INTR_TEAR_STATUS(intf) (MDP_INTF_REV_7xxx_TEAR_OFF(intf) + 0x004)
#define MDP_INTF_4_OFF_REV_7xxx 0x38000 #define MDP_INTF_REV_7xxx_INTR_TEAR_CLEAR(intf) (MDP_INTF_REV_7xxx_TEAR_OFF(intf) + 0x008)
#define MDP_INTF_5_OFF_REV_7xxx 0x39000
#define MDP_INTF_6_OFF_REV_7xxx 0x3a000
#define MDP_INTF_7_OFF_REV_7xxx 0x3b000
#define MDP_INTF_8_OFF_REV_7xxx 0x3c000
/** /**
* struct dpu_intr_reg - array of DPU register sets * struct dpu_intr_reg - array of DPU register sets
...@@ -61,104 +57,124 @@ struct dpu_intr_reg { ...@@ -61,104 +57,124 @@ struct dpu_intr_reg {
*/ */
static const struct dpu_intr_reg dpu_intr_set[] = { static const struct dpu_intr_reg dpu_intr_set[] = {
[MDP_SSPP_TOP0_INTR] = { [MDP_SSPP_TOP0_INTR] = {
MDP_SSPP_TOP0_OFF+INTR_CLEAR, INTR_CLEAR,
MDP_SSPP_TOP0_OFF+INTR_EN, INTR_EN,
MDP_SSPP_TOP0_OFF+INTR_STATUS INTR_STATUS
}, },
[MDP_SSPP_TOP0_INTR2] = { [MDP_SSPP_TOP0_INTR2] = {
MDP_SSPP_TOP0_OFF+INTR2_CLEAR, INTR2_CLEAR,
MDP_SSPP_TOP0_OFF+INTR2_EN, INTR2_EN,
MDP_SSPP_TOP0_OFF+INTR2_STATUS INTR2_STATUS
}, },
[MDP_SSPP_TOP0_HIST_INTR] = { [MDP_SSPP_TOP0_HIST_INTR] = {
MDP_SSPP_TOP0_OFF+HIST_INTR_CLEAR, HIST_INTR_CLEAR,
MDP_SSPP_TOP0_OFF+HIST_INTR_EN, HIST_INTR_EN,
MDP_SSPP_TOP0_OFF+HIST_INTR_STATUS HIST_INTR_STATUS
}, },
[MDP_INTF0_INTR] = { [MDP_INTF0_INTR] = {
MDP_INTF_0_OFF+INTF_INTR_CLEAR, MDP_INTF_INTR_CLEAR(0),
MDP_INTF_0_OFF+INTF_INTR_EN, MDP_INTF_INTR_EN(0),
MDP_INTF_0_OFF+INTF_INTR_STATUS MDP_INTF_INTR_STATUS(0)
}, },
[MDP_INTF1_INTR] = { [MDP_INTF1_INTR] = {
MDP_INTF_1_OFF+INTF_INTR_CLEAR, MDP_INTF_INTR_CLEAR(1),
MDP_INTF_1_OFF+INTF_INTR_EN, MDP_INTF_INTR_EN(1),
MDP_INTF_1_OFF+INTF_INTR_STATUS MDP_INTF_INTR_STATUS(1)
}, },
[MDP_INTF2_INTR] = { [MDP_INTF2_INTR] = {
MDP_INTF_2_OFF+INTF_INTR_CLEAR, MDP_INTF_INTR_CLEAR(2),
MDP_INTF_2_OFF+INTF_INTR_EN, MDP_INTF_INTR_EN(2),
MDP_INTF_2_OFF+INTF_INTR_STATUS MDP_INTF_INTR_STATUS(2)
}, },
[MDP_INTF3_INTR] = { [MDP_INTF3_INTR] = {
MDP_INTF_3_OFF+INTF_INTR_CLEAR, MDP_INTF_INTR_CLEAR(3),
MDP_INTF_3_OFF+INTF_INTR_EN, MDP_INTF_INTR_EN(3),
MDP_INTF_3_OFF+INTF_INTR_STATUS MDP_INTF_INTR_STATUS(3)
}, },
[MDP_INTF4_INTR] = { [MDP_INTF4_INTR] = {
MDP_INTF_4_OFF+INTF_INTR_CLEAR, MDP_INTF_INTR_CLEAR(4),
MDP_INTF_4_OFF+INTF_INTR_EN, MDP_INTF_INTR_EN(4),
MDP_INTF_4_OFF+INTF_INTR_STATUS MDP_INTF_INTR_STATUS(4)
}, },
[MDP_INTF5_INTR] = { [MDP_INTF5_INTR] = {
MDP_INTF_5_OFF+INTF_INTR_CLEAR, MDP_INTF_INTR_CLEAR(5),
MDP_INTF_5_OFF+INTF_INTR_EN, MDP_INTF_INTR_EN(5),
MDP_INTF_5_OFF+INTF_INTR_STATUS MDP_INTF_INTR_STATUS(5)
},
[MDP_INTF1_TEAR_INTR] = {
MDP_INTF_INTR_TEAR_CLEAR(1),
MDP_INTF_INTR_TEAR_EN(1),
MDP_INTF_INTR_TEAR_STATUS(1)
},
[MDP_INTF2_TEAR_INTR] = {
MDP_INTF_INTR_TEAR_CLEAR(2),
MDP_INTF_INTR_TEAR_EN(2),
MDP_INTF_INTR_TEAR_STATUS(2)
}, },
[MDP_AD4_0_INTR] = { [MDP_AD4_0_INTR] = {
MDP_AD4_0_OFF + MDP_AD4_INTR_CLEAR_OFF, MDP_AD4_INTR_CLEAR_OFF(0),
MDP_AD4_0_OFF + MDP_AD4_INTR_EN_OFF, MDP_AD4_INTR_EN_OFF(0),
MDP_AD4_0_OFF + MDP_AD4_INTR_STATUS_OFF, MDP_AD4_INTR_STATUS_OFF(0),
}, },
[MDP_AD4_1_INTR] = { [MDP_AD4_1_INTR] = {
MDP_AD4_1_OFF + MDP_AD4_INTR_CLEAR_OFF, MDP_AD4_INTR_CLEAR_OFF(1),
MDP_AD4_1_OFF + MDP_AD4_INTR_EN_OFF, MDP_AD4_INTR_EN_OFF(1),
MDP_AD4_1_OFF + MDP_AD4_INTR_STATUS_OFF, MDP_AD4_INTR_STATUS_OFF(1),
}, },
[MDP_INTF0_7xxx_INTR] = { [MDP_INTF0_7xxx_INTR] = {
MDP_INTF_0_OFF_REV_7xxx+INTF_INTR_CLEAR, MDP_INTF_REV_7xxx_INTR_CLEAR(0),
MDP_INTF_0_OFF_REV_7xxx+INTF_INTR_EN, MDP_INTF_REV_7xxx_INTR_EN(0),
MDP_INTF_0_OFF_REV_7xxx+INTF_INTR_STATUS MDP_INTF_REV_7xxx_INTR_STATUS(0)
}, },
[MDP_INTF1_7xxx_INTR] = { [MDP_INTF1_7xxx_INTR] = {
MDP_INTF_1_OFF_REV_7xxx+INTF_INTR_CLEAR, MDP_INTF_REV_7xxx_INTR_CLEAR(1),
MDP_INTF_1_OFF_REV_7xxx+INTF_INTR_EN, MDP_INTF_REV_7xxx_INTR_EN(1),
MDP_INTF_1_OFF_REV_7xxx+INTF_INTR_STATUS MDP_INTF_REV_7xxx_INTR_STATUS(1)
},
[MDP_INTF1_7xxx_TEAR_INTR] = {
MDP_INTF_REV_7xxx_INTR_TEAR_CLEAR(1),
MDP_INTF_REV_7xxx_INTR_TEAR_EN(1),
MDP_INTF_REV_7xxx_INTR_TEAR_STATUS(1)
}, },
[MDP_INTF2_7xxx_INTR] = { [MDP_INTF2_7xxx_INTR] = {
MDP_INTF_2_OFF_REV_7xxx+INTF_INTR_CLEAR, MDP_INTF_REV_7xxx_INTR_CLEAR(2),
MDP_INTF_2_OFF_REV_7xxx+INTF_INTR_EN, MDP_INTF_REV_7xxx_INTR_EN(2),
MDP_INTF_2_OFF_REV_7xxx+INTF_INTR_STATUS MDP_INTF_REV_7xxx_INTR_STATUS(2)
},
[MDP_INTF2_7xxx_TEAR_INTR] = {
MDP_INTF_REV_7xxx_INTR_TEAR_CLEAR(2),
MDP_INTF_REV_7xxx_INTR_TEAR_EN(2),
MDP_INTF_REV_7xxx_INTR_TEAR_STATUS(2)
}, },
[MDP_INTF3_7xxx_INTR] = { [MDP_INTF3_7xxx_INTR] = {
MDP_INTF_3_OFF_REV_7xxx+INTF_INTR_CLEAR, MDP_INTF_REV_7xxx_INTR_CLEAR(3),
MDP_INTF_3_OFF_REV_7xxx+INTF_INTR_EN, MDP_INTF_REV_7xxx_INTR_EN(3),
MDP_INTF_3_OFF_REV_7xxx+INTF_INTR_STATUS MDP_INTF_REV_7xxx_INTR_STATUS(3)
}, },
[MDP_INTF4_7xxx_INTR] = { [MDP_INTF4_7xxx_INTR] = {
MDP_INTF_4_OFF_REV_7xxx+INTF_INTR_CLEAR, MDP_INTF_REV_7xxx_INTR_CLEAR(4),
MDP_INTF_4_OFF_REV_7xxx+INTF_INTR_EN, MDP_INTF_REV_7xxx_INTR_EN(4),
MDP_INTF_4_OFF_REV_7xxx+INTF_INTR_STATUS MDP_INTF_REV_7xxx_INTR_STATUS(4)
}, },
[MDP_INTF5_7xxx_INTR] = { [MDP_INTF5_7xxx_INTR] = {
MDP_INTF_5_OFF_REV_7xxx+INTF_INTR_CLEAR, MDP_INTF_REV_7xxx_INTR_CLEAR(5),
MDP_INTF_5_OFF_REV_7xxx+INTF_INTR_EN, MDP_INTF_REV_7xxx_INTR_EN(5),
MDP_INTF_5_OFF_REV_7xxx+INTF_INTR_STATUS MDP_INTF_REV_7xxx_INTR_STATUS(5)
}, },
[MDP_INTF6_7xxx_INTR] = { [MDP_INTF6_7xxx_INTR] = {
MDP_INTF_6_OFF_REV_7xxx+INTF_INTR_CLEAR, MDP_INTF_REV_7xxx_INTR_CLEAR(6),
MDP_INTF_6_OFF_REV_7xxx+INTF_INTR_EN, MDP_INTF_REV_7xxx_INTR_EN(6),
MDP_INTF_6_OFF_REV_7xxx+INTF_INTR_STATUS MDP_INTF_REV_7xxx_INTR_STATUS(6)
}, },
[MDP_INTF7_7xxx_INTR] = { [MDP_INTF7_7xxx_INTR] = {
MDP_INTF_7_OFF_REV_7xxx+INTF_INTR_CLEAR, MDP_INTF_REV_7xxx_INTR_CLEAR(7),
MDP_INTF_7_OFF_REV_7xxx+INTF_INTR_EN, MDP_INTF_REV_7xxx_INTR_EN(7),
MDP_INTF_7_OFF_REV_7xxx+INTF_INTR_STATUS MDP_INTF_REV_7xxx_INTR_STATUS(7)
}, },
[MDP_INTF8_7xxx_INTR] = { [MDP_INTF8_7xxx_INTR] = {
MDP_INTF_8_OFF_REV_7xxx+INTF_INTR_CLEAR, MDP_INTF_REV_7xxx_INTR_CLEAR(8),
MDP_INTF_8_OFF_REV_7xxx+INTF_INTR_EN, MDP_INTF_REV_7xxx_INTR_EN(8),
MDP_INTF_8_OFF_REV_7xxx+INTF_INTR_STATUS MDP_INTF_REV_7xxx_INTR_STATUS(8)
}, },
}; };
......
...@@ -23,11 +23,15 @@ enum dpu_hw_intr_reg { ...@@ -23,11 +23,15 @@ enum dpu_hw_intr_reg {
MDP_INTF3_INTR, MDP_INTF3_INTR,
MDP_INTF4_INTR, MDP_INTF4_INTR,
MDP_INTF5_INTR, MDP_INTF5_INTR,
MDP_INTF1_TEAR_INTR,
MDP_INTF2_TEAR_INTR,
MDP_AD4_0_INTR, MDP_AD4_0_INTR,
MDP_AD4_1_INTR, MDP_AD4_1_INTR,
MDP_INTF0_7xxx_INTR, MDP_INTF0_7xxx_INTR,
MDP_INTF1_7xxx_INTR, MDP_INTF1_7xxx_INTR,
MDP_INTF1_7xxx_TEAR_INTR,
MDP_INTF2_7xxx_INTR, MDP_INTF2_7xxx_INTR,
MDP_INTF2_7xxx_TEAR_INTR,
MDP_INTF3_7xxx_INTR, MDP_INTF3_7xxx_INTR,
MDP_INTF4_7xxx_INTR, MDP_INTF4_7xxx_INTR,
MDP_INTF5_7xxx_INTR, MDP_INTF5_7xxx_INTR,
...@@ -67,7 +71,7 @@ struct dpu_hw_intr { ...@@ -67,7 +71,7 @@ struct dpu_hw_intr {
/** /**
* dpu_hw_intr_init(): Initializes the interrupts hw object * dpu_hw_intr_init(): Initializes the interrupts hw object
* @addr: mapped register io address of MDP * @addr: mapped register io address of MDP
* @m : pointer to mdss catalog data * @m: pointer to MDSS catalog data
*/ */
struct dpu_hw_intr *dpu_hw_intr_init(void __iomem *addr, struct dpu_hw_intr *dpu_hw_intr_init(void __iomem *addr,
const struct dpu_mdss_cfg *m); const struct dpu_mdss_cfg *m);
......
This diff is collapsed.
...@@ -60,6 +60,16 @@ struct intf_status { ...@@ -60,6 +60,16 @@ struct intf_status {
* feed pixels to this interface * feed pixels to this interface
* @setup_misr: enable/disable MISR * @setup_misr: enable/disable MISR
* @collect_misr: read MISR signature * @collect_misr: read MISR signature
* @enable_tearcheck: Enables vsync generation and sets up init value of read
* pointer and programs the tear check configuration
* @disable_tearcheck: Disables tearcheck block
* @connect_external_te: Read, modify, write to either set or clear listening to external TE
* Return: 1 if TE was originally connected, 0 if not, or -ERROR
* @get_vsync_info: Provides the programmed and current line_count
* @setup_autorefresh: Configure and enable the autorefresh config
* @get_autorefresh: Retrieve autorefresh config from hardware
* Return: 0 on success, -ETIMEDOUT on timeout
* @vsync_sel: Select vsync signal for tear-effect configuration
*/ */
struct dpu_hw_intf_ops { struct dpu_hw_intf_ops {
void (*setup_timing_gen)(struct dpu_hw_intf *intf, void (*setup_timing_gen)(struct dpu_hw_intf *intf,
...@@ -78,10 +88,24 @@ struct dpu_hw_intf_ops { ...@@ -78,10 +88,24 @@ struct dpu_hw_intf_ops {
u32 (*get_line_count)(struct dpu_hw_intf *intf); u32 (*get_line_count)(struct dpu_hw_intf *intf);
void (*bind_pingpong_blk)(struct dpu_hw_intf *intf, void (*bind_pingpong_blk)(struct dpu_hw_intf *intf,
bool enable,
const enum dpu_pingpong pp); const enum dpu_pingpong pp);
void (*setup_misr)(struct dpu_hw_intf *intf, bool enable, u32 frame_count); void (*setup_misr)(struct dpu_hw_intf *intf, bool enable, u32 frame_count);
int (*collect_misr)(struct dpu_hw_intf *intf, u32 *misr_value); int (*collect_misr)(struct dpu_hw_intf *intf, u32 *misr_value);
// Tearcheck on INTF since DPU 5.0.0
int (*enable_tearcheck)(struct dpu_hw_intf *intf, struct dpu_hw_tear_check *cfg);
int (*disable_tearcheck)(struct dpu_hw_intf *intf);
int (*connect_external_te)(struct dpu_hw_intf *intf, bool enable_external_te);
void (*vsync_sel)(struct dpu_hw_intf *intf, u32 vsync_source);
/**
* Disable autorefresh if enabled
*/
void (*disable_autorefresh)(struct dpu_hw_intf *intf, uint32_t encoder_id, u16 vdisplay);
}; };
struct dpu_hw_intf { struct dpu_hw_intf {
...@@ -90,22 +114,19 @@ struct dpu_hw_intf { ...@@ -90,22 +114,19 @@ struct dpu_hw_intf {
/* intf */ /* intf */
enum dpu_intf idx; enum dpu_intf idx;
const struct dpu_intf_cfg *cap; const struct dpu_intf_cfg *cap;
const struct dpu_mdss_cfg *mdss;
/* ops */ /* ops */
struct dpu_hw_intf_ops ops; struct dpu_hw_intf_ops ops;
}; };
/** /**
* dpu_hw_intf_init(): Initializes the intf driver for the passed * dpu_hw_intf_init() - Initializes the INTF driver for the passed
* interface idx. * interface catalog entry.
* @idx: interface index for which driver object is required * @cfg: interface catalog entry for which driver object is required
* @addr: mapped register io address of MDP * @addr: mapped register io address of MDP
* @m : pointer to mdss catalog data
*/ */
struct dpu_hw_intf *dpu_hw_intf_init(enum dpu_intf idx, struct dpu_hw_intf *dpu_hw_intf_init(const struct dpu_intf_cfg *cfg,
void __iomem *addr, void __iomem *addr);
const struct dpu_mdss_cfg *m);
/** /**
* dpu_hw_intf_destroy(): Destroys INTF driver context * dpu_hw_intf_destroy(): Destroys INTF driver context
......
...@@ -30,24 +30,6 @@ ...@@ -30,24 +30,6 @@
#define LM_MISR_SIGNATURE 0x314 #define LM_MISR_SIGNATURE 0x314
static const struct dpu_lm_cfg *_lm_offset(enum dpu_lm mixer,
const struct dpu_mdss_cfg *m,
void __iomem *addr,
struct dpu_hw_blk_reg_map *b)
{
int i;
for (i = 0; i < m->mixer_count; i++) {
if (mixer == m->mixer[i].id) {
b->blk_addr = addr + m->mixer[i].base;
b->log_mask = DPU_DBG_MASK_LM;
return &m->mixer[i];
}
}
return ERR_PTR(-ENOMEM);
}
/** /**
* _stage_offset(): returns the relative offset of the blend registers * _stage_offset(): returns the relative offset of the blend registers
* for the stage to be setup * for the stage to be setup
...@@ -160,8 +142,7 @@ static void dpu_hw_lm_setup_color3(struct dpu_hw_mixer *ctx, ...@@ -160,8 +142,7 @@ static void dpu_hw_lm_setup_color3(struct dpu_hw_mixer *ctx,
DPU_REG_WRITE(c, LM_OP_MODE, op_mode); DPU_REG_WRITE(c, LM_OP_MODE, op_mode);
} }
static void _setup_mixer_ops(const struct dpu_mdss_cfg *m, static void _setup_mixer_ops(struct dpu_hw_lm_ops *ops,
struct dpu_hw_lm_ops *ops,
unsigned long features) unsigned long features)
{ {
ops->setup_mixer_out = dpu_hw_lm_setup_out; ops->setup_mixer_out = dpu_hw_lm_setup_out;
...@@ -175,27 +156,27 @@ static void _setup_mixer_ops(const struct dpu_mdss_cfg *m, ...@@ -175,27 +156,27 @@ static void _setup_mixer_ops(const struct dpu_mdss_cfg *m,
ops->collect_misr = dpu_hw_lm_collect_misr; ops->collect_misr = dpu_hw_lm_collect_misr;
} }
struct dpu_hw_mixer *dpu_hw_lm_init(enum dpu_lm idx, struct dpu_hw_mixer *dpu_hw_lm_init(const struct dpu_lm_cfg *cfg,
void __iomem *addr, void __iomem *addr)
const struct dpu_mdss_cfg *m)
{ {
struct dpu_hw_mixer *c; struct dpu_hw_mixer *c;
const struct dpu_lm_cfg *cfg;
if (cfg->pingpong == PINGPONG_NONE) {
DPU_DEBUG("skip mixer %d without pingpong\n", cfg->id);
return NULL;
}
c = kzalloc(sizeof(*c), GFP_KERNEL); c = kzalloc(sizeof(*c), GFP_KERNEL);
if (!c) if (!c)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cfg = _lm_offset(idx, m, addr, &c->hw); c->hw.blk_addr = addr + cfg->base;
if (IS_ERR_OR_NULL(cfg)) { c->hw.log_mask = DPU_DBG_MASK_LM;
kfree(c);
return ERR_PTR(-EINVAL);
}
/* Assign ops */ /* Assign ops */
c->idx = idx; c->idx = cfg->id;
c->cap = cfg; c->cap = cfg;
_setup_mixer_ops(m, &c->ops, c->cap->features); _setup_mixer_ops(&c->ops, c->cap->features);
return c; return c;
} }
......
...@@ -93,15 +93,13 @@ static inline struct dpu_hw_mixer *to_dpu_hw_mixer(struct dpu_hw_blk *hw) ...@@ -93,15 +93,13 @@ static inline struct dpu_hw_mixer *to_dpu_hw_mixer(struct dpu_hw_blk *hw)
} }
/** /**
* dpu_hw_lm_init(): Initializes the mixer hw driver object. * dpu_hw_lm_init() - Initializes the mixer hw driver object.
* should be called once before accessing every mixer. * should be called once before accessing every mixer.
* @idx: mixer index for which driver object is required * @cfg: mixer catalog entry for which driver object is required
* @addr: mapped register io address of MDP * @addr: mapped register io address of MDP
* @m : pointer to mdss catalog data
*/ */
struct dpu_hw_mixer *dpu_hw_lm_init(enum dpu_lm idx, struct dpu_hw_mixer *dpu_hw_lm_init(const struct dpu_lm_cfg *cfg,
void __iomem *addr, void __iomem *addr);
const struct dpu_mdss_cfg *m);
/** /**
* dpu_hw_lm_destroy(): Destroys layer mixer driver context * dpu_hw_lm_destroy(): Destroys layer mixer driver context
......
...@@ -191,7 +191,8 @@ enum dpu_dsc { ...@@ -191,7 +191,8 @@ enum dpu_dsc {
}; };
enum dpu_pingpong { enum dpu_pingpong {
PINGPONG_0 = 1, PINGPONG_NONE,
PINGPONG_0,
PINGPONG_1, PINGPONG_1,
PINGPONG_2, PINGPONG_2,
PINGPONG_3, PINGPONG_3,
...@@ -463,4 +464,52 @@ struct dpu_mdss_color { ...@@ -463,4 +464,52 @@ struct dpu_mdss_color {
#define DPU_DBG_MASK_DSPP (1 << 10) #define DPU_DBG_MASK_DSPP (1 << 10)
#define DPU_DBG_MASK_DSC (1 << 11) #define DPU_DBG_MASK_DSC (1 << 11)
/**
* struct dpu_hw_tear_check - Struct contains parameters to configure
* tear-effect module. This structure is used to configure tear-check
* logic present either in ping-pong or in interface module.
* @vsync_count: Ratio of MDP VSYNC clk freq(Hz) to refresh rate divided
* by no of lines
* @sync_cfg_height: Total vertical lines (display height - 1)
* @vsync_init_val: Init value to which the read pointer gets loaded at
* vsync edge
* @sync_threshold_start: Read pointer threshold start ROI for write operation
* @sync_threshold_continue: The minimum number of lines the write pointer
* needs to be above the read pointer
* @start_pos: The position from which the start_threshold value is added
* @rd_ptr_irq: The read pointer line at which interrupt has to be generated
* @hw_vsync_mode: Sync with external frame sync input
*/
struct dpu_hw_tear_check {
/*
* This is ratio of MDP VSYNC clk freq(Hz) to
* refresh rate divided by no of lines
*/
u32 vsync_count;
u32 sync_cfg_height;
u32 vsync_init_val;
u32 sync_threshold_start;
u32 sync_threshold_continue;
u32 start_pos;
u32 rd_ptr_irq;
u8 hw_vsync_mode;
};
/**
* struct dpu_hw_pp_vsync_info - Struct contains parameters to configure
* read and write pointers for command mode panels
* @rd_ptr_init_val: Value of rd pointer at vsync edge
* @rd_ptr_frame_count: Num frames sent since enabling interface
* @rd_ptr_line_count: Current line on panel (rd ptr)
* @wr_ptr_line_count: Current line within pp fifo (wr ptr)
* @intf_frame_count: Frames read from intf
*/
struct dpu_hw_pp_vsync_info {
u32 rd_ptr_init_val;
u32 rd_ptr_frame_count;
u32 rd_ptr_line_count;
u32 wr_ptr_line_count;
u32 intf_frame_count;
};
#endif /* _DPU_HW_MDSS_H */ #endif /* _DPU_HW_MDSS_H */
...@@ -14,24 +14,6 @@ ...@@ -14,24 +14,6 @@
#define MERGE_3D_MUX 0x000 #define MERGE_3D_MUX 0x000
#define MERGE_3D_MODE 0x004 #define MERGE_3D_MODE 0x004
static const struct dpu_merge_3d_cfg *_merge_3d_offset(enum dpu_merge_3d idx,
const struct dpu_mdss_cfg *m,
void __iomem *addr,
struct dpu_hw_blk_reg_map *b)
{
int i;
for (i = 0; i < m->merge_3d_count; i++) {
if (idx == m->merge_3d[i].id) {
b->blk_addr = addr + m->merge_3d[i].base;
b->log_mask = DPU_DBG_MASK_PINGPONG;
return &m->merge_3d[i];
}
}
return ERR_PTR(-EINVAL);
}
static void dpu_hw_merge_3d_setup_3d_mode(struct dpu_hw_merge_3d *merge_3d, static void dpu_hw_merge_3d_setup_3d_mode(struct dpu_hw_merge_3d *merge_3d,
enum dpu_3d_blend_mode mode_3d) enum dpu_3d_blend_mode mode_3d)
{ {
...@@ -55,24 +37,19 @@ static void _setup_merge_3d_ops(struct dpu_hw_merge_3d *c, ...@@ -55,24 +37,19 @@ static void _setup_merge_3d_ops(struct dpu_hw_merge_3d *c,
c->ops.setup_3d_mode = dpu_hw_merge_3d_setup_3d_mode; c->ops.setup_3d_mode = dpu_hw_merge_3d_setup_3d_mode;
}; };
struct dpu_hw_merge_3d *dpu_hw_merge_3d_init(enum dpu_merge_3d idx, struct dpu_hw_merge_3d *dpu_hw_merge_3d_init(const struct dpu_merge_3d_cfg *cfg,
void __iomem *addr, void __iomem *addr)
const struct dpu_mdss_cfg *m)
{ {
struct dpu_hw_merge_3d *c; struct dpu_hw_merge_3d *c;
const struct dpu_merge_3d_cfg *cfg;
c = kzalloc(sizeof(*c), GFP_KERNEL); c = kzalloc(sizeof(*c), GFP_KERNEL);
if (!c) if (!c)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cfg = _merge_3d_offset(idx, m, addr, &c->hw); c->hw.blk_addr = addr + cfg->base;
if (IS_ERR_OR_NULL(cfg)) { c->hw.log_mask = DPU_DBG_MASK_PINGPONG;
kfree(c);
return ERR_PTR(-EINVAL);
}
c->idx = idx; c->idx = cfg->id;
c->caps = cfg; c->caps = cfg;
_setup_merge_3d_ops(c, c->caps->features); _setup_merge_3d_ops(c, c->caps->features);
......
...@@ -46,16 +46,14 @@ static inline struct dpu_hw_merge_3d *to_dpu_hw_merge_3d(struct dpu_hw_blk *hw) ...@@ -46,16 +46,14 @@ static inline struct dpu_hw_merge_3d *to_dpu_hw_merge_3d(struct dpu_hw_blk *hw)
} }
/** /**
* dpu_hw_merge_3d_init - initializes the merge_3d driver for the passed * dpu_hw_merge_3d_init() - Initializes the merge_3d driver for the passed
* merge_3d idx. * merge3d catalog entry.
* @idx: Pingpong index for which driver object is required * @cfg: Pingpong catalog entry for which driver object is required
* @addr: Mapped register io address of MDP * @addr: Mapped register io address of MDP
* @m: Pointer to mdss catalog data * Return: Error code or allocated dpu_hw_merge_3d context
* Returns: Error code or allocated dpu_hw_merge_3d context
*/ */
struct dpu_hw_merge_3d *dpu_hw_merge_3d_init(enum dpu_merge_3d idx, struct dpu_hw_merge_3d *dpu_hw_merge_3d_init(const struct dpu_merge_3d_cfg *cfg,
void __iomem *addr, void __iomem *addr);
const struct dpu_mdss_cfg *m);
/** /**
* dpu_hw_merge_3d_destroy - destroys merge_3d driver context * dpu_hw_merge_3d_destroy - destroys merge_3d driver context
......
...@@ -42,24 +42,6 @@ static u32 dither_depth_map[DITHER_DEPTH_MAP_INDEX] = { ...@@ -42,24 +42,6 @@ static u32 dither_depth_map[DITHER_DEPTH_MAP_INDEX] = {
0, 0, 0, 0, 0, 0, 0, 1, 2 0, 0, 0, 0, 0, 0, 0, 1, 2
}; };
static const struct dpu_pingpong_cfg *_pingpong_offset(enum dpu_pingpong pp,
const struct dpu_mdss_cfg *m,
void __iomem *addr,
struct dpu_hw_blk_reg_map *b)
{
int i;
for (i = 0; i < m->pingpong_count; i++) {
if (pp == m->pingpong[i].id) {
b->blk_addr = addr + m->pingpong[i].base;
b->log_mask = DPU_DBG_MASK_PINGPONG;
return &m->pingpong[i];
}
}
return ERR_PTR(-EINVAL);
}
static void dpu_hw_pp_setup_dither(struct dpu_hw_pingpong *pp, static void dpu_hw_pp_setup_dither(struct dpu_hw_pingpong *pp,
struct dpu_hw_dither_cfg *cfg) struct dpu_hw_dither_cfg *cfg)
{ {
...@@ -91,7 +73,7 @@ static void dpu_hw_pp_setup_dither(struct dpu_hw_pingpong *pp, ...@@ -91,7 +73,7 @@ static void dpu_hw_pp_setup_dither(struct dpu_hw_pingpong *pp,
DPU_REG_WRITE(c, base + PP_DITHER_EN, 1); DPU_REG_WRITE(c, base + PP_DITHER_EN, 1);
} }
static int dpu_hw_pp_setup_te_config(struct dpu_hw_pingpong *pp, static int dpu_hw_pp_enable_te(struct dpu_hw_pingpong *pp,
struct dpu_hw_tear_check *te) struct dpu_hw_tear_check *te)
{ {
struct dpu_hw_blk_reg_map *c; struct dpu_hw_blk_reg_map *c;
...@@ -118,6 +100,8 @@ static int dpu_hw_pp_setup_te_config(struct dpu_hw_pingpong *pp, ...@@ -118,6 +100,8 @@ static int dpu_hw_pp_setup_te_config(struct dpu_hw_pingpong *pp,
DPU_REG_WRITE(c, PP_SYNC_WRCOUNT, DPU_REG_WRITE(c, PP_SYNC_WRCOUNT,
(te->start_pos + te->sync_threshold_start + 1)); (te->start_pos + te->sync_threshold_start + 1));
DPU_REG_WRITE(c, PP_TEAR_CHECK_EN, 1);
return 0; return 0;
} }
...@@ -144,24 +128,7 @@ static bool dpu_hw_pp_get_autorefresh_config(struct dpu_hw_pingpong *pp, ...@@ -144,24 +128,7 @@ static bool dpu_hw_pp_get_autorefresh_config(struct dpu_hw_pingpong *pp,
return !!((val & BIT(31)) >> 31); return !!((val & BIT(31)) >> 31);
} }
static int dpu_hw_pp_poll_timeout_wr_ptr(struct dpu_hw_pingpong *pp, static int dpu_hw_pp_disable_te(struct dpu_hw_pingpong *pp)
u32 timeout_us)
{
struct dpu_hw_blk_reg_map *c;
u32 val;
int rc;
if (!pp)
return -EINVAL;
c = &pp->hw;
rc = readl_poll_timeout(c->blk_addr + PP_LINE_COUNT,
val, (val & 0xffff) >= 1, 10, timeout_us);
return rc;
}
static int dpu_hw_pp_enable_te(struct dpu_hw_pingpong *pp, bool enable)
{ {
struct dpu_hw_blk_reg_map *c; struct dpu_hw_blk_reg_map *c;
...@@ -169,7 +136,7 @@ static int dpu_hw_pp_enable_te(struct dpu_hw_pingpong *pp, bool enable) ...@@ -169,7 +136,7 @@ static int dpu_hw_pp_enable_te(struct dpu_hw_pingpong *pp, bool enable)
return -EINVAL; return -EINVAL;
c = &pp->hw; c = &pp->hw;
DPU_REG_WRITE(c, PP_TEAR_CHECK_EN, enable); DPU_REG_WRITE(c, PP_TEAR_CHECK_EN, 0);
return 0; return 0;
} }
...@@ -245,6 +212,49 @@ static u32 dpu_hw_pp_get_line_count(struct dpu_hw_pingpong *pp) ...@@ -245,6 +212,49 @@ static u32 dpu_hw_pp_get_line_count(struct dpu_hw_pingpong *pp)
return line; return line;
} }
static void dpu_hw_pp_disable_autorefresh(struct dpu_hw_pingpong *pp,
uint32_t encoder_id, u16 vdisplay)
{
struct dpu_hw_pp_vsync_info info;
int trial = 0;
/* If autorefresh is already disabled, we have nothing to do */
if (!dpu_hw_pp_get_autorefresh_config(pp, NULL))
return;
/*
* If autorefresh is enabled, disable it and make sure it is safe to
* proceed with current frame commit/push. Sequence followed is,
* 1. Disable TE
* 2. Disable autorefresh config
* 4. Poll for frame transfer ongoing to be false
* 5. Enable TE back
*/
dpu_hw_pp_connect_external_te(pp, false);
dpu_hw_pp_setup_autorefresh_config(pp, 0, false);
do {
udelay(DPU_ENC_MAX_POLL_TIMEOUT_US);
if ((trial * DPU_ENC_MAX_POLL_TIMEOUT_US)
> (KICKOFF_TIMEOUT_MS * USEC_PER_MSEC)) {
DPU_ERROR("enc%d pp%d disable autorefresh failed\n",
encoder_id, pp->idx - PINGPONG_0);
break;
}
trial++;
dpu_hw_pp_get_vsync_info(pp, &info);
} while (info.wr_ptr_line_count > 0 &&
info.wr_ptr_line_count < vdisplay);
dpu_hw_pp_connect_external_te(pp, true);
DPU_DEBUG("enc%d pp%d disabled autorefresh\n",
encoder_id, pp->idx - PINGPONG_0);
}
static int dpu_hw_pp_dsc_enable(struct dpu_hw_pingpong *pp) static int dpu_hw_pp_dsc_enable(struct dpu_hw_pingpong *pp)
{ {
struct dpu_hw_blk_reg_map *c = &pp->hw; struct dpu_hw_blk_reg_map *c = &pp->hw;
...@@ -274,40 +284,37 @@ static int dpu_hw_pp_setup_dsc(struct dpu_hw_pingpong *pp) ...@@ -274,40 +284,37 @@ static int dpu_hw_pp_setup_dsc(struct dpu_hw_pingpong *pp)
static void _setup_pingpong_ops(struct dpu_hw_pingpong *c, static void _setup_pingpong_ops(struct dpu_hw_pingpong *c,
unsigned long features) unsigned long features)
{ {
c->ops.setup_tearcheck = dpu_hw_pp_setup_te_config; if (test_bit(DPU_PINGPONG_TE, &features)) {
c->ops.enable_tearcheck = dpu_hw_pp_enable_te; c->ops.enable_tearcheck = dpu_hw_pp_enable_te;
c->ops.disable_tearcheck = dpu_hw_pp_disable_te;
c->ops.connect_external_te = dpu_hw_pp_connect_external_te; c->ops.connect_external_te = dpu_hw_pp_connect_external_te;
c->ops.get_vsync_info = dpu_hw_pp_get_vsync_info;
c->ops.setup_autorefresh = dpu_hw_pp_setup_autorefresh_config;
c->ops.get_autorefresh = dpu_hw_pp_get_autorefresh_config;
c->ops.poll_timeout_wr_ptr = dpu_hw_pp_poll_timeout_wr_ptr;
c->ops.get_line_count = dpu_hw_pp_get_line_count; c->ops.get_line_count = dpu_hw_pp_get_line_count;
c->ops.disable_autorefresh = dpu_hw_pp_disable_autorefresh;
}
if (test_bit(DPU_PINGPONG_DSC, &features)) {
c->ops.setup_dsc = dpu_hw_pp_setup_dsc; c->ops.setup_dsc = dpu_hw_pp_setup_dsc;
c->ops.enable_dsc = dpu_hw_pp_dsc_enable; c->ops.enable_dsc = dpu_hw_pp_dsc_enable;
c->ops.disable_dsc = dpu_hw_pp_dsc_disable; c->ops.disable_dsc = dpu_hw_pp_dsc_disable;
}
if (test_bit(DPU_PINGPONG_DITHER, &features)) if (test_bit(DPU_PINGPONG_DITHER, &features))
c->ops.setup_dither = dpu_hw_pp_setup_dither; c->ops.setup_dither = dpu_hw_pp_setup_dither;
}; };
struct dpu_hw_pingpong *dpu_hw_pingpong_init(enum dpu_pingpong idx, struct dpu_hw_pingpong *dpu_hw_pingpong_init(const struct dpu_pingpong_cfg *cfg,
void __iomem *addr, void __iomem *addr)
const struct dpu_mdss_cfg *m)
{ {
struct dpu_hw_pingpong *c; struct dpu_hw_pingpong *c;
const struct dpu_pingpong_cfg *cfg;
c = kzalloc(sizeof(*c), GFP_KERNEL); c = kzalloc(sizeof(*c), GFP_KERNEL);
if (!c) if (!c)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cfg = _pingpong_offset(idx, m, addr, &c->hw); c->hw.blk_addr = addr + cfg->base;
if (IS_ERR_OR_NULL(cfg)) { c->hw.log_mask = DPU_DBG_MASK_PINGPONG;
kfree(c);
return ERR_PTR(-EINVAL);
}
c->idx = idx; c->idx = cfg->id;
c->caps = cfg; c->caps = cfg;
_setup_pingpong_ops(c, c->caps->features); _setup_pingpong_ops(c, c->caps->features);
......
This diff is collapsed.
This diff is collapsed.
...@@ -130,24 +130,12 @@ static void dpu_hw_setup_vsync_source(struct dpu_hw_mdp *mdp, ...@@ -130,24 +130,12 @@ static void dpu_hw_setup_vsync_source(struct dpu_hw_mdp *mdp,
struct dpu_vsync_source_cfg *cfg) struct dpu_vsync_source_cfg *cfg)
{ {
struct dpu_hw_blk_reg_map *c; struct dpu_hw_blk_reg_map *c;
u32 reg, wd_load_value, wd_ctl, wd_ctl2, i; u32 reg, wd_load_value, wd_ctl, wd_ctl2;
static const u32 pp_offset[PINGPONG_MAX] = {0xC, 0x8, 0x4, 0x13, 0x18};
if (!mdp || !cfg || (cfg->pp_count > ARRAY_SIZE(cfg->ppnumber))) if (!mdp || !cfg)
return; return;
c = &mdp->hw; c = &mdp->hw;
reg = DPU_REG_READ(c, MDP_VSYNC_SEL);
for (i = 0; i < cfg->pp_count; i++) {
int pp_idx = cfg->ppnumber[i] - PINGPONG_0;
if (pp_idx >= ARRAY_SIZE(pp_offset))
continue;
reg &= ~(0xf << pp_offset[pp_idx]);
reg |= (cfg->vsync_source & 0xf) << pp_offset[pp_idx];
}
DPU_REG_WRITE(c, MDP_VSYNC_SEL, reg);
if (cfg->vsync_source >= DPU_VSYNC_SOURCE_WD_TIMER_4 && if (cfg->vsync_source >= DPU_VSYNC_SOURCE_WD_TIMER_4 &&
cfg->vsync_source <= DPU_VSYNC_SOURCE_WD_TIMER_0) { cfg->vsync_source <= DPU_VSYNC_SOURCE_WD_TIMER_0) {
...@@ -194,6 +182,33 @@ static void dpu_hw_setup_vsync_source(struct dpu_hw_mdp *mdp, ...@@ -194,6 +182,33 @@ static void dpu_hw_setup_vsync_source(struct dpu_hw_mdp *mdp,
} }
} }
static void dpu_hw_setup_vsync_source_and_vsync_sel(struct dpu_hw_mdp *mdp,
struct dpu_vsync_source_cfg *cfg)
{
struct dpu_hw_blk_reg_map *c;
u32 reg, i;
static const u32 pp_offset[PINGPONG_MAX] = {0xC, 0x8, 0x4, 0x13, 0x18};
if (!mdp || !cfg || (cfg->pp_count > ARRAY_SIZE(cfg->ppnumber)))
return;
c = &mdp->hw;
reg = DPU_REG_READ(c, MDP_VSYNC_SEL);
for (i = 0; i < cfg->pp_count; i++) {
int pp_idx = cfg->ppnumber[i] - PINGPONG_0;
if (pp_idx >= ARRAY_SIZE(pp_offset))
continue;
reg &= ~(0xf << pp_offset[pp_idx]);
reg |= (cfg->vsync_source & 0xf) << pp_offset[pp_idx];
}
DPU_REG_WRITE(c, MDP_VSYNC_SEL, reg);
dpu_hw_setup_vsync_source(mdp, cfg);
}
static void dpu_hw_get_safe_status(struct dpu_hw_mdp *mdp, static void dpu_hw_get_safe_status(struct dpu_hw_mdp *mdp,
struct dpu_danger_safe_status *status) struct dpu_danger_safe_status *status)
{ {
...@@ -241,7 +256,12 @@ static void _setup_mdp_ops(struct dpu_hw_mdp_ops *ops, ...@@ -241,7 +256,12 @@ static void _setup_mdp_ops(struct dpu_hw_mdp_ops *ops,
ops->setup_split_pipe = dpu_hw_setup_split_pipe; ops->setup_split_pipe = dpu_hw_setup_split_pipe;
ops->setup_clk_force_ctrl = dpu_hw_setup_clk_force_ctrl; ops->setup_clk_force_ctrl = dpu_hw_setup_clk_force_ctrl;
ops->get_danger_status = dpu_hw_get_danger_status; ops->get_danger_status = dpu_hw_get_danger_status;
if (cap & BIT(DPU_MDP_VSYNC_SEL))
ops->setup_vsync_source = dpu_hw_setup_vsync_source_and_vsync_sel;
else
ops->setup_vsync_source = dpu_hw_setup_vsync_source; ops->setup_vsync_source = dpu_hw_setup_vsync_source;
ops->get_safe_status = dpu_hw_get_safe_status; ops->get_safe_status = dpu_hw_get_safe_status;
if (cap & BIT(DPU_MDP_AUDIO_SELECT)) if (cap & BIT(DPU_MDP_AUDIO_SELECT))
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -106,14 +106,13 @@ struct dpu_hw_vbif { ...@@ -106,14 +106,13 @@ struct dpu_hw_vbif {
}; };
/** /**
* dpu_hw_vbif_init - initializes the vbif driver for the passed interface idx * dpu_hw_vbif_init() - Initializes the VBIF driver for the passed
* @idx: Interface index for which driver object is required * VBIF catalog entry.
* @cfg: VBIF catalog entry for which driver object is required
* @addr: Mapped register io address of MDSS * @addr: Mapped register io address of MDSS
* @m: Pointer to mdss catalog data
*/ */
struct dpu_hw_vbif *dpu_hw_vbif_init(enum dpu_vbif idx, struct dpu_hw_vbif *dpu_hw_vbif_init(const struct dpu_vbif_cfg *cfg,
void __iomem *addr, void __iomem *addr);
const struct dpu_mdss_cfg *m);
void dpu_hw_vbif_destroy(struct dpu_hw_vbif *vbif); void dpu_hw_vbif_destroy(struct dpu_hw_vbif *vbif);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -229,7 +229,7 @@ static void mdp5_kms_destroy(struct msm_kms *kms) ...@@ -229,7 +229,7 @@ static void mdp5_kms_destroy(struct msm_kms *kms)
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
static int smp_show(struct seq_file *m, void *arg) static int smp_show(struct seq_file *m, void *arg)
{ {
struct drm_info_node *node = (struct drm_info_node *) m->private; struct drm_info_node *node = m->private;
struct drm_device *dev = node->minor->dev; struct drm_device *dev = node->minor->dev;
struct msm_drm_private *priv = dev->dev_private; struct msm_drm_private *priv = dev->dev_private;
struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms)); struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms));
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "dp_catalog.h" #include "dp_catalog.h"
struct dp_ctrl { struct dp_ctrl {
bool orientation;
atomic_t aborted; atomic_t aborted;
bool wide_bus_en; bool wide_bus_en;
}; };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment