main pull request for v6.4 Core Display: ============ * Bugfixes for error handling during probe * rework UBWC decoder programming * prepare_commit cleanup * bindings for SM8550 (MDSS, DPU), SM8450 (DP) * timeout calculation fixup * atomic: use drm_crtc_next_vblank_start() instead of our own custom thing to calculate the start of next vblank DP: == * interrupts cleanup DPU: === * DSPP sub-block flush on sc7280 * support AR30 in addition to XR30 format * Allow using REC_0 and REC_1 to handle wide (4k) RGB planes * Split the HW catalog into individual per-SoC files DSI: === * rework DSI instance ID detection on obscure platforms GPU: === * uapi C++ compatibility fix * a6xx: More robust gdsc reset * a3xx and a4xx devfreq support * update generated headers * various cleanups and fixes * GPU and GEM updates to avoid allocations which could trigger reclaim (shrinker) in fence signaling path * dma-fence deadline hint support and wait-boost * a640 speedbin support * a650 speedbin support Conflicts in drivers/gpu/drm/msm/adreno/adreno_gpu.c: Conflict between the 7fa5047a436b ("drm: Use of_property_present() for testing DT property presence") and 9f251f934012 ("drm/msm/adreno: Use OPP for every GPU generation"). The latter removed the of_ function call outright, so I went with what's in the PR unchanged.
Unified · Split
| @@ -15,16 +15,21 @@ description: | · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | properties: | 16 | properties: |
| 17 | compatible: | 17 | compatible: |
| 18 | enum: | 18 | oneOf: |
| 19 | - qcom,sc7180-dp | 19 | - enum: |
| 20 | - qcom,sc7280-dp | 20 | - qcom,sc7180-dp |
| 21 | - qcom,sc7280-edp | 21 | - qcom,sc7280-dp |
| 22 | - qcom,sc8180x-dp | 22 | - qcom,sc7280-edp |
| 23 | - qcom,sc8180x-edp | 23 | - qcom,sc8180x-dp |
| 24 | - qcom,sc8280xp-dp | 24 | - qcom,sc8180x-edp |
| 25 | - qcom,sc8280xp-edp | 25 | - qcom,sc8280xp-dp |
| 26 | - qcom,sdm845-dp | 26 | - qcom,sc8280xp-edp |
| 27 | - qcom,sm8350-dp | 27 | - qcom,sdm845-dp |
| 28 | - qcom,sm8350-dp | ||
| 29 | - items: | ||
| 30 | - enum: | ||
| 31 | - qcom,sm8450-dp | ||
| 32 | - const: qcom,sm8350-dp | ||
| 28 | 33 | ||
| 29 | reg: | 34 | reg: |
| 30 | minItems: 4 | 35 | minItems: 4 |
| @@ -25,16 +25,16 @@ properties: · 24 unmodified lines | |||
| 25 | - qcom,sc7280-dsi-ctrl | 25 | - qcom,sc7280-dsi-ctrl |
| 26 | - qcom,sdm660-dsi-ctrl | 26 | - qcom,sdm660-dsi-ctrl |
| 27 | - qcom,sdm845-dsi-ctrl | 27 | - qcom,sdm845-dsi-ctrl |
| 28 | - qcom,sm6115-dsi-ctrl | ||
| 28 | - qcom,sm8150-dsi-ctrl | 29 | - qcom,sm8150-dsi-ctrl |
| 29 | - qcom,sm8250-dsi-ctrl | 30 | - qcom,sm8250-dsi-ctrl |
| 30 | - qcom,sm8350-dsi-ctrl | 31 | - qcom,sm8350-dsi-ctrl |
| 31 | - qcom,sm8450-dsi-ctrl | 32 | - qcom,sm8450-dsi-ctrl |
| 32 | - qcom,sm8550-dsi-ctrl | 33 | - qcom,sm8550-dsi-ctrl |
| 33 | - const: qcom,mdss-dsi-ctrl | 34 | - const: qcom,mdss-dsi-ctrl |
| 34 | - items: | 35 | - enum: |
| 35 | - enum: | 36 | - qcom,dsi-ctrl-6g-qcm2290 |
| 36 | - dsi-ctrl-6g-qcm2290 | 37 | - qcom,mdss-dsi-ctrl # This should always come with an SoC-specific compatible |
| 37 | - const: qcom,mdss-dsi-ctrl | ||
| 38 | deprecated: true | 38 | deprecated: true |
| 39 | 39 | ||
| 40 | reg: | 40 | reg: |
| @@ -351,6 +351,7 @@ allOf: · 310 unmodified lines | |||
| 351 | contains: | 351 | contains: |
| 352 | enum: | 352 | enum: |
| 353 | - qcom,sdm845-dsi-ctrl | 353 | - qcom,sdm845-dsi-ctrl |
| 354 | - qcom,sm6115-dsi-ctrl | ||
| 354 | then: | 355 | then: |
| 355 | properties: | 356 | properties: |
| 356 | clocks: | 357 | clocks: |
| @@ -40,7 +40,13 @@ patternProperties: · 39 unmodified lines | |||
| 40 | type: object | 40 | type: object |
| 41 | properties: | 41 | properties: |
| 42 | compatible: | 42 | compatible: |
| 43 | const: qcom,dsi-ctrl-6g-qcm2290 | 43 | oneOf: |
| 44 | - items: | ||
| 45 | - const: qcom,sm6115-dsi-ctrl | ||
| 46 | - const: qcom,mdss-dsi-ctrl | ||
| 47 | - description: Old binding, please don't use | ||
| 48 | deprecated: true | ||
| 49 | const: qcom,dsi-ctrl-6g-qcm2290 | ||
| 44 | 50 | ||
| 45 | "^phy@[0-9a-f]+$": | 51 | "^phy@[0-9a-f]+$": |
| 46 | type: object | 52 | type: object |
| @@ -114,7 +120,7 @@ examples: · 67 unmodified lines | |||
| 114 | }; | 120 | }; |
| 115 | 121 | ||
| 116 | dsi@5e94000 { | 122 | dsi@5e94000 { |
| 117 | compatible = "qcom,dsi-ctrl-6g-qcm2290"; | 123 | compatible = "qcom,sm6115-dsi-ctrl", "qcom,mdss-dsi-ctrl"; |
| 118 | reg = <0x05e94000 0x400>; | 124 | reg = <0x05e94000 0x400>; |
| 119 | reg-names = "dsi_ctrl"; | 125 | reg-names = "dsi_ctrl"; |
| 120 | 126 | ||
| @@ -54,7 +54,7 @@ patternProperties: · 53 unmodified lines | |||
| 54 | type: object | 54 | type: object |
| 55 | properties: | 55 | properties: |
| 56 | compatible: | 56 | compatible: |
| 57 | const: qcom,dsi-phy-5nm-8450 | 57 | const: qcom,sm8450-dsi-phy-5nm |
| 58 | 58 | ||
| 59 | required: | 59 | required: |
| 60 | - compatible | 60 | - compatible |
| @@ -254,7 +254,7 @@ examples: · 193 unmodified lines | |||
| 254 | }; | 254 | }; |
| 255 | 255 | ||
| 256 | dsi0_phy: phy@ae94400 { | 256 | dsi0_phy: phy@ae94400 { |
| 257 | compatible = "qcom,dsi-phy-5nm-8450"; | 257 | compatible = "qcom,sm8450-dsi-phy-5nm"; |
| 258 | reg = <0x0ae94400 0x200>, | 258 | reg = <0x0ae94400 0x200>, |
| 259 | <0x0ae94600 0x280>, | 259 | <0x0ae94600 0x280>, |
| 260 | <0x0ae94900 0x260>; | 260 | <0x0ae94900 0x260>; |
| @@ -325,7 +325,7 @@ examples: · 64 unmodified lines | |||
| 325 | }; | 325 | }; |
| 326 | 326 | ||
| 327 | dsi1_phy: phy@ae96400 { | 327 | dsi1_phy: phy@ae96400 { |
| 328 | compatible = "qcom,dsi-phy-5nm-8450"; | 328 | compatible = "qcom,sm8450-dsi-phy-5nm"; |
| 329 | reg = <0x0ae96400 0x200>, | 329 | reg = <0x0ae96400 0x200>, |
| 330 | <0x0ae96600 0x280>, | 330 | <0x0ae96600 0x280>, |
| 331 | <0x0ae96900 0x260>; | 331 | <0x0ae96900 0x260>; |
| @@ -0,0 +1,133 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause | ||
| 2 | %YAML 1.2 | ||
| 3 | --- | ||
| 4 | $id: http://devicetree.org/schemas/display/msm/qcom,sm8550-dpu.yaml# | ||
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | ||
| 6 | |||
| 7 | title: Qualcomm SM8550 Display DPU | ||
| 8 | |||
| 9 | maintainers: | ||
| 10 | - Neil Armstrong <neil.armstrong@linaro.org> | ||
| 11 | |||
| 12 | $ref: /schemas/display/msm/dpu-common.yaml# | ||
| 13 | |||
| 14 | properties: | ||
| 15 | compatible: | ||
| 16 | const: qcom,sm8550-dpu | ||
| 17 | |||
| 18 | reg: | ||
| 19 | items: | ||
| 20 | - description: Address offset and size for mdp register set | ||
| 21 | - description: Address offset and size for vbif register set | ||
| 22 | |||
| 23 | reg-names: | ||
| 24 | items: | ||
| 25 | - const: mdp | ||
| 26 | - const: vbif | ||
| 27 | |||
| 28 | clocks: | ||
| 29 | items: | ||
| 30 | - description: Display AHB | ||
| 31 | - description: Display hf axi | ||
| 32 | - description: Display MDSS ahb | ||
| 33 | - description: Display lut | ||
| 34 | - description: Display core | ||
| 35 | - description: Display vsync | ||
| 36 | |||
| 37 | clock-names: | ||
| 38 | items: | ||
| 39 | - const: bus | ||
| 40 | - const: nrt_bus | ||
| 41 | - const: iface | ||
| 42 | - const: lut | ||
| 43 | - const: core | ||
| 44 | - const: vsync | ||
| 45 | |||
| 46 | required: | ||
| 47 | - compatible | ||
| 48 | - reg | ||
| 49 | - reg-names | ||
| 50 | - clocks | ||
| 51 | - clock-names | ||
| 52 | |||
| 53 | unevaluatedProperties: false | ||
| 54 | |||
| 55 | examples: | ||
| 56 | - | | ||
| 57 | #include <dt-bindings/clock/qcom,sm8550-dispcc.h> | ||
| 58 | #include <dt-bindings/clock/qcom,sm8550-gcc.h> | ||
| 59 | #include <dt-bindings/interrupt-controller/arm-gic.h> | ||
| 60 | #include <dt-bindings/power/qcom-rpmpd.h> | ||
| 61 | |||
| 62 | display-controller@ae01000 { | ||
| 63 | compatible = "qcom,sm8550-dpu"; | ||
| 64 | reg = <0x0ae01000 0x8f000>, | ||
| 65 | <0x0aeb0000 0x2008>; | ||
| 66 | reg-names = "mdp", "vbif"; | ||
| 67 | |||
| 68 | clocks = <&gcc GCC_DISP_AHB_CLK>, | ||
| 69 | <&gcc GCC_DISP_HF_AXI_CLK>, | ||
| 70 | <&dispcc DISP_CC_MDSS_AHB_CLK>, | ||
| 71 | <&dispcc DISP_CC_MDSS_MDP_LUT_CLK>, | ||
| 72 | <&dispcc DISP_CC_MDSS_MDP_CLK>, | ||
| 73 | <&dispcc DISP_CC_MDSS_VSYNC_CLK>; | ||
| 74 | clock-names = "bus", | ||
| 75 | "nrt_bus", | ||
| 76 | "iface", | ||
| 77 | "lut", | ||
| 78 | "core", | ||
| 79 | "vsync"; | ||
| 80 | |||
| 81 | assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>; | ||
| 82 | assigned-clock-rates = <19200000>; | ||
| 83 | |||
| 84 | operating-points-v2 = <&mdp_opp_table>; | ||
| 85 | power-domains = <&rpmhpd SM8550_MMCX>; | ||
| 86 | |||
| 87 | interrupt-parent = <&mdss>; | ||
| 88 | interrupts = <0>; | ||
| 89 | |||
| 90 | ports { | ||
| 91 | #address-cells = <1>; | ||
| 92 | #size-cells = <0>; | ||
| 93 | |||
| 94 | port@0 { | ||
| 95 | reg = <0>; | ||
| 96 | dpu_intf1_out: endpoint { | ||
| 97 | remote-endpoint = <&dsi0_in>; | ||
| 98 | }; | ||
| 99 | }; | ||
| 100 | |||
| 101 | port@1 { | ||
| 102 | reg = <1>; | ||
| 103 | dpu_intf2_out: endpoint { | ||
| 104 | remote-endpoint = <&dsi1_in>; | ||
| 105 | }; | ||
| 106 | }; | ||
| 107 | }; | ||
| 108 | |||
| 109 | mdp_opp_table: opp-table { | ||
| 110 | compatible = "operating-points-v2"; | ||
| 111 | |||
| 112 | opp-200000000 { | ||
| 113 | opp-hz = /bits/ 64 <200000000>; | ||
| 114 | required-opps = <&rpmhpd_opp_low_svs>; | ||
| 115 | }; | ||
| 116 | |||
| 117 | opp-325000000 { | ||
| 118 | opp-hz = /bits/ 64 <325000000>; | ||
| 119 | required-opps = <&rpmhpd_opp_svs>; | ||
| 120 | }; | ||
| 121 | |||
| 122 | opp-375000000 { | ||
| 123 | opp-hz = /bits/ 64 <375000000>; | ||
| 124 | required-opps = <&rpmhpd_opp_svs_l1>; | ||
| 125 | }; | ||
| 126 | |||
| 127 | opp-514000000 { | ||
| 128 | opp-hz = /bits/ 64 <514000000>; | ||
| 129 | required-opps = <&rpmhpd_opp_nom>; | ||
| 130 | }; | ||
| 131 | }; | ||
| 132 | }; | ||
| 133 | ... | ||
| @@ -0,0 +1,333 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause | ||
| 2 | %YAML 1.2 | ||
| 3 | --- | ||
| 4 | $id: http://devicetree.org/schemas/display/msm/qcom,sm8550-mdss.yaml# | ||
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | ||
| 6 | |||
| 7 | title: Qualcomm SM8550 Display MDSS | ||
| 8 | |||
| 9 | maintainers: | ||
| 10 | - Neil Armstrong <neil.armstrong@linaro.org> | ||
| 11 | |||
| 12 | description: | ||
| 13 | SM8550 MSM Mobile Display Subsystem(MDSS), which encapsulates sub-blocks like | ||
| 14 | DPU display controller, DSI and DP interfaces etc. | ||
| 15 | |||
| 16 | $ref: /schemas/display/msm/mdss-common.yaml# | ||
| 17 | |||
| 18 | properties: | ||
| 19 | compatible: | ||
| 20 | const: qcom,sm8550-mdss | ||
| 21 | |||
| 22 | clocks: | ||
| 23 | items: | ||
| 24 | - description: Display MDSS AHB | ||
| 25 | - description: Display AHB | ||
| 26 | - description: Display hf AXI | ||
| 27 | - description: Display core | ||
| 28 | |||
| 29 | iommus: | ||
| 30 | maxItems: 1 | ||
| 31 | |||
| 32 | interconnects: | ||
| 33 | maxItems: 2 | ||
| 34 | |||
| 35 | interconnect-names: | ||
| 36 | maxItems: 2 | ||
| 37 | |||
| 38 | patternProperties: | ||
| 39 | "^display-controller@[0-9a-f]+$": | ||
| 40 | type: object | ||
| 41 | properties: | ||
| 42 | compatible: | ||
| 43 | const: qcom,sm8550-dpu | ||
| 44 | |||
| 45 | "^dsi@[0-9a-f]+$": | ||
| 46 | type: object | ||
| 47 | properties: | ||
| 48 | compatible: | ||
| 49 | items: | ||
| 50 | - const: qcom,sm8550-dsi-ctrl | ||
| 51 | - const: qcom,mdss-dsi-ctrl | ||
| 52 | |||
| 53 | "^phy@[0-9a-f]+$": | ||
| 54 | type: object | ||
| 55 | properties: | ||
| 56 | compatible: | ||
| 57 | const: qcom,sm8550-dsi-phy-4nm | ||
| 58 | |||
| 59 | required: | ||
| 60 | - compatible | ||
| 61 | |||
| 62 | unevaluatedProperties: false | ||
| 63 | |||
| 64 | examples: | ||
| 65 | - | | ||
| 66 | #include <dt-bindings/clock/qcom,sm8550-dispcc.h> | ||
| 67 | #include <dt-bindings/clock/qcom,sm8550-gcc.h> | ||
| 68 | #include <dt-bindings/clock/qcom,rpmh.h> | ||
| 69 | #include <dt-bindings/interrupt-controller/arm-gic.h> | ||
| 70 | #include <dt-bindings/interconnect/qcom,sm8550-rpmh.h> | ||
| 71 | #include <dt-bindings/power/qcom-rpmpd.h> | ||
| 72 | |||
| 73 | display-subsystem@ae00000 { | ||
| 74 | compatible = "qcom,sm8550-mdss"; | ||
| 75 | reg = <0x0ae00000 0x1000>; | ||
| 76 | reg-names = "mdss"; | ||
| 77 | |||
| 78 | interconnects = <&mmss_noc MASTER_MDP 0 &gem_noc SLAVE_LLCC 0>, | ||
| 79 | <&mc_virt MASTER_LLCC 0 &mc_virt SLAVE_EBI1 0>; | ||
| 80 | interconnect-names = "mdp0-mem", "mdp1-mem"; | ||
| 81 | |||
| 82 | resets = <&dispcc DISP_CC_MDSS_CORE_BCR>; | ||
| 83 | |||
| 84 | power-domains = <&dispcc MDSS_GDSC>; | ||
| 85 | |||
| 86 | clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>, | ||
| 87 | <&gcc GCC_DISP_AHB_CLK>, | ||
| 88 | <&gcc GCC_DISP_HF_AXI_CLK>, | ||
| 89 | <&dispcc DISP_CC_MDSS_MDP_CLK>; | ||
| 90 | clock-names = "iface", "bus", "nrt_bus", "core"; | ||
| 91 | |||
| 92 | interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>; | ||
| 93 | interrupt-controller; | ||
| 94 | #interrupt-cells = <1>; | ||
| 95 | |||
| 96 | iommus = <&apps_smmu 0x1c00 0x2>; | ||
| 97 | |||
| 98 | #address-cells = <1>; | ||
| 99 | #size-cells = <1>; | ||
| 100 | ranges; | ||
| 101 | |||
| 102 | display-controller@ae01000 { | ||
| 103 | compatible = "qcom,sm8550-dpu"; | ||
| 104 | reg = <0x0ae01000 0x8f000>, | ||
| 105 | <0x0aeb0000 0x2008>; | ||
| 106 | reg-names = "mdp", "vbif"; | ||
| 107 | |||
| 108 | clocks = <&gcc GCC_DISP_AHB_CLK>, | ||
| 109 | <&gcc GCC_DISP_HF_AXI_CLK>, | ||
| 110 | <&dispcc DISP_CC_MDSS_AHB_CLK>, | ||
| 111 | <&dispcc DISP_CC_MDSS_MDP_LUT_CLK>, | ||
| 112 | <&dispcc DISP_CC_MDSS_MDP_CLK>, | ||
| 113 | <&dispcc DISP_CC_MDSS_VSYNC_CLK>; | ||
| 114 | clock-names = "bus", | ||
| 115 | "nrt_bus", | ||
| 116 | "iface", | ||
| 117 | "lut", | ||
| 118 | "core", | ||
| 119 | "vsync"; | ||
| 120 | |||
| 121 | assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>; | ||
| 122 | assigned-clock-rates = <19200000>; | ||
| 123 | |||
| 124 | operating-points-v2 = <&mdp_opp_table>; | ||
| 125 | power-domains = <&rpmhpd SM8550_MMCX>; | ||
| 126 | |||
| 127 | interrupt-parent = <&mdss>; | ||
| 128 | interrupts = <0>; | ||
| 129 | |||
| 130 | ports { | ||
| 131 | #address-cells = <1>; | ||
| 132 | #size-cells = <0>; | ||
| 133 | |||
| 134 | port@0 { | ||
| 135 | reg = <0>; | ||
| 136 | dpu_intf1_out: endpoint { | ||
| 137 | remote-endpoint = <&dsi0_in>; | ||
| 138 | }; | ||
| 139 | }; | ||
| 140 | |||
| 141 | port@1 { | ||
| 142 | reg = <1>; | ||
| 143 | dpu_intf2_out: endpoint { | ||
| 144 | remote-endpoint = <&dsi1_in>; | ||
| 145 | }; | ||
| 146 | }; | ||
| 147 | }; | ||
| 148 | |||
| 149 | mdp_opp_table: opp-table { | ||
| 150 | compatible = "operating-points-v2"; | ||
| 151 | |||
| 152 | opp-200000000 { | ||
| 153 | opp-hz = /bits/ 64 <200000000>; | ||
| 154 | required-opps = <&rpmhpd_opp_low_svs>; | ||
| 155 | }; | ||
| 156 | |||
| 157 | opp-325000000 { | ||
| 158 | opp-hz = /bits/ 64 <325000000>; | ||
| 159 | required-opps = <&rpmhpd_opp_svs>; | ||
| 160 | }; | ||
| 161 | |||
| 162 | opp-375000000 { | ||
| 163 | opp-hz = /bits/ 64 <375000000>; | ||
| 164 | required-opps = <&rpmhpd_opp_svs_l1>; | ||
| 165 | }; | ||
| 166 | |||
| 167 | opp-514000000 { | ||
| 168 | opp-hz = /bits/ 64 <514000000>; | ||
| 169 | required-opps = <&rpmhpd_opp_nom>; | ||
| 170 | }; | ||
| 171 | }; | ||
| 172 | }; | ||
| 173 | |||
| 174 | dsi@ae94000 { | ||
| 175 | compatible = "qcom,sm8550-dsi-ctrl", "qcom,mdss-dsi-ctrl"; | ||
| 176 | reg = <0x0ae94000 0x400>; | ||
| 177 | reg-names = "dsi_ctrl"; | ||
| 178 | |||
| 179 | interrupt-parent = <&mdss>; | ||
| 180 | interrupts = <4>; | ||
| 181 | |||
| 182 | clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK>, | ||
| 183 | <&dispcc DISP_CC_MDSS_BYTE0_INTF_CLK>, | ||
| 184 | <&dispcc DISP_CC_MDSS_PCLK0_CLK>, | ||
| 185 | <&dispcc DISP_CC_MDSS_ESC0_CLK>, | ||
| 186 | <&dispcc DISP_CC_MDSS_AHB_CLK>, | ||
| 187 | <&gcc GCC_DISP_HF_AXI_CLK>; | ||
| 188 | clock-names = "byte", | ||
| 189 | "byte_intf", | ||
| 190 | "pixel", | ||
| 191 | "core", | ||
| 192 | "iface", | ||
| 193 | "bus"; | ||
| 194 | |||
| 195 | assigned-clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK_SRC>, | ||
| 196 | <&dispcc DISP_CC_MDSS_PCLK0_CLK_SRC>; | ||
| 197 | assigned-clock-parents = <&dsi0_phy 0>, <&dsi0_phy 1>; | ||
| 198 | |||
| 199 | operating-points-v2 = <&dsi_opp_table>; | ||
| 200 | power-domains = <&rpmhpd SM8550_MMCX>; | ||
| 201 | |||
| 202 | phys = <&dsi0_phy>; | ||
| 203 | phy-names = "dsi"; | ||
| 204 | |||
| 205 | #address-cells = <1>; | ||
| 206 | #size-cells = <0>; | ||
| 207 | |||
| 208 | ports { | ||
| 209 | #address-cells = <1>; | ||
| 210 | #size-cells = <0>; | ||
| 211 | |||
| 212 | port@0 { | ||
| 213 | reg = <0>; | ||
| 214 | dsi0_in: endpoint { | ||
| 215 | remote-endpoint = <&dpu_intf1_out>; | ||
| 216 | }; | ||
| 217 | }; | ||
| 218 | |||
| 219 | port@1 { | ||
| 220 | reg = <1>; | ||
| 221 | dsi0_out: endpoint { | ||
| 222 | }; | ||
| 223 | }; | ||
| 224 | }; | ||
| 225 | |||
| 226 | dsi_opp_table: opp-table { | ||
| 227 | compatible = "operating-points-v2"; | ||
| 228 | |||
| 229 | opp-187500000 { | ||
| 230 | opp-hz = /bits/ 64 <187500000>; | ||
| 231 | required-opps = <&rpmhpd_opp_low_svs>; | ||
| 232 | }; | ||
| 233 | |||
| 234 | opp-300000000 { | ||
| 235 | opp-hz = /bits/ 64 <300000000>; | ||
| 236 | required-opps = <&rpmhpd_opp_svs>; | ||
| 237 | }; | ||
| 238 | |||
| 239 | opp-358000000 { | ||
| 240 | opp-hz = /bits/ 64 <358000000>; | ||
| 241 | required-opps = <&rpmhpd_opp_svs_l1>; | ||
| 242 | }; | ||
| 243 | }; | ||
| 244 | }; | ||
| 245 | |||
| 246 | dsi0_phy: phy@ae94400 { | ||
| 247 | compatible = "qcom,sm8550-dsi-phy-4nm"; | ||
| 248 | reg = <0x0ae95000 0x200>, | ||
| 249 | <0x0ae95200 0x280>, | ||
| 250 | <0x0ae95500 0x400>; | ||
| 251 | reg-names = "dsi_phy", | ||
| 252 | "dsi_phy_lane", | ||
| 253 | "dsi_pll"; | ||
| 254 | |||
| 255 | #clock-cells = <1>; | ||
| 256 | #phy-cells = <0>; | ||
| 257 | |||
| 258 | clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>, | ||
| 259 | <&rpmhcc RPMH_CXO_CLK>; | ||
| 260 | clock-names = "iface", "ref"; | ||
| 261 | }; | ||
| 262 | |||
| 263 | dsi@ae96000 { | ||
| 264 | compatible = "qcom,sm8550-dsi-ctrl", "qcom,mdss-dsi-ctrl"; | ||
| 265 | reg = <0x0ae96000 0x400>; | ||
| 266 | reg-names = "dsi_ctrl"; | ||
| 267 | |||
| 268 | interrupt-parent = <&mdss>; | ||
| 269 | interrupts = <5>; | ||
| 270 | |||
| 271 | clocks = <&dispcc DISP_CC_MDSS_BYTE1_CLK>, | ||
| 272 | <&dispcc DISP_CC_MDSS_BYTE1_INTF_CLK>, | ||
| 273 | <&dispcc DISP_CC_MDSS_PCLK1_CLK>, | ||
| 274 | <&dispcc DISP_CC_MDSS_ESC1_CLK>, | ||
| 275 | <&dispcc DISP_CC_MDSS_AHB_CLK>, | ||
| 276 | <&gcc GCC_DISP_HF_AXI_CLK>; | ||
| 277 | clock-names = "byte", | ||
| 278 | "byte_intf", | ||
| 279 | "pixel", | ||
| 280 | "core", | ||
| 281 | "iface", | ||
| 282 | "bus"; | ||
| 283 | |||
| 284 | assigned-clocks = <&dispcc DISP_CC_MDSS_BYTE1_CLK_SRC>, | ||
| 285 | <&dispcc DISP_CC_MDSS_PCLK1_CLK_SRC>; | ||
| 286 | assigned-clock-parents = <&dsi1_phy 0>, <&dsi1_phy 1>; | ||
| 287 | |||
| 288 | operating-points-v2 = <&dsi_opp_table>; | ||
| 289 | power-domains = <&rpmhpd SM8550_MMCX>; | ||
| 290 | |||
| 291 | phys = <&dsi1_phy>; | ||
| 292 | phy-names = "dsi"; | ||
| 293 | |||
| 294 | #address-cells = <1>; | ||
| 295 | #size-cells = <0>; | ||
| 296 | |||
| 297 | ports { | ||
| 298 | #address-cells = <1>; | ||
| 299 | #size-cells = <0>; | ||
| 300 | |||
| 301 | port@0 { | ||
| 302 | reg = <0>; | ||
| 303 | dsi1_in: endpoint { | ||
| 304 | remote-endpoint = <&dpu_intf2_out>; | ||
| 305 | }; | ||
| 306 | }; | ||
| 307 | |||
| 308 | port@1 { | ||
| 309 | reg = <1>; | ||
| 310 | dsi1_out: endpoint { | ||
| 311 | }; | ||
| 312 | }; | ||
| 313 | }; | ||
| 314 | }; | ||
| 315 | |||
| 316 | dsi1_phy: phy@ae96400 { | ||
| 317 | compatible = "qcom,sm8550-dsi-phy-4nm"; | ||
| 318 | reg = <0x0ae97000 0x200>, | ||
| 319 | <0x0ae97200 0x280>, | ||
| 320 | <0x0ae97500 0x400>; | ||
| 321 | reg-names = "dsi_phy", | ||
| 322 | "dsi_phy_lane", | ||
| 323 | "dsi_pll"; | ||
| 324 | |||
| 325 | #clock-cells = <1>; | ||
| 326 | #phy-cells = <0>; | ||
| 327 | |||
| 328 | clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>, | ||
| 329 | <&rpmhcc RPMH_CXO_CLK>; | ||
| 330 | clock-names = "iface", "ref"; | ||
| 331 | }; | ||
| 332 | }; | ||
| 333 | ... | ||
| @@ -6518,6 +6518,7 @@ L: linux-arm-msm@vger.kernel.org · 6517 unmodified lines | |||
| 6518 | L: dri-devel@lists.freedesktop.org | 6518 | L: dri-devel@lists.freedesktop.org |
| 6519 | L: freedreno@lists.freedesktop.org | 6519 | L: freedreno@lists.freedesktop.org |
| 6520 | S: Maintained | 6520 | S: Maintained |
| 6521 | B: https://gitlab.freedesktop.org/drm/msm/-/issues | ||
| 6521 | T: git https://gitlab.freedesktop.org/drm/msm.git | 6522 | T: git https://gitlab.freedesktop.org/drm/msm.git |
| 6522 | F: Documentation/devicetree/bindings/display/msm/ | 6523 | F: Documentation/devicetree/bindings/display/msm/ |
| 6523 | F: drivers/gpu/drm/msm/ | 6524 | F: drivers/gpu/drm/msm/ |
| @@ -111,30 +111,82 @@ static void panel_bridge_detach(struct drm_bridge *bridge) · 110 unmodified lines | |||
| 111 | drm_connector_cleanup(connector); | 111 | drm_connector_cleanup(connector); |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | static void panel_bridge_pre_enable(struct drm_bridge *bridge) | 114 | static void panel_bridge_atomic_pre_enable(struct drm_bridge *bridge, |
| 115 | struct drm_bridge_state *old_bridge_state) | ||
| 115 | { | 116 | { |
| 116 | struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); | 117 | struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); |
| 118 | struct drm_atomic_state *atomic_state = old_bridge_state->base.state; | ||
| 119 | struct drm_encoder *encoder = bridge->encoder; | ||
| 120 | struct drm_crtc *crtc; | ||
| 121 | struct drm_crtc_state *old_crtc_state; | ||
| 122 | |||
| 123 | crtc = drm_atomic_get_new_crtc_for_encoder(atomic_state, encoder); | ||
| 124 | if (!crtc) | ||
| 125 | return; | ||
| 126 | |||
| 127 | old_crtc_state = drm_atomic_get_old_crtc_state(atomic_state, crtc); | ||
| 128 | if (old_crtc_state && old_crtc_state->self_refresh_active) | ||
| 129 | return; | ||
| 117 | 130 | ||
| 118 | drm_panel_prepare(panel_bridge->panel); | 131 | drm_panel_prepare(panel_bridge->panel); |
| 119 | } | 132 | } |
| 120 | 133 | ||
| 121 | static void panel_bridge_enable(struct drm_bridge *bridge) | 134 | static void panel_bridge_atomic_enable(struct drm_bridge *bridge, |
| 135 | struct drm_bridge_state *old_bridge_state) | ||
| 122 | { | 136 | { |
| 123 | struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); | 137 | struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); |
| 138 | struct drm_atomic_state *atomic_state = old_bridge_state->base.state; | ||
| 139 | struct drm_encoder *encoder = bridge->encoder; | ||
| 140 | struct drm_crtc *crtc; | ||
| 141 | struct drm_crtc_state *old_crtc_state; | ||
| 142 | |||
| 143 | crtc = drm_atomic_get_new_crtc_for_encoder(atomic_state, encoder); | ||
| 144 | if (!crtc) | ||
| 145 | return; | ||
| 146 | |||
| 147 | old_crtc_state = drm_atomic_get_old_crtc_state(atomic_state, crtc); | ||
| 148 | if (old_crtc_state && old_crtc_state->self_refresh_active) | ||
| 149 | return; | ||
| 124 | 150 | ||
| 125 | drm_panel_enable(panel_bridge->panel); | 151 | drm_panel_enable(panel_bridge->panel); |
| 126 | } | 152 | } |
| 127 | 153 | ||
| 128 | static void panel_bridge_disable(struct drm_bridge *bridge) | 154 | static void panel_bridge_atomic_disable(struct drm_bridge *bridge, |
| 155 | struct drm_bridge_state *old_bridge_state) | ||
| 129 | { | 156 | { |
| 130 | struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); | 157 | struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); |
| 158 | struct drm_atomic_state *atomic_state = old_bridge_state->base.state; | ||
| 159 | struct drm_encoder *encoder = bridge->encoder; | ||
| 160 | struct drm_crtc *crtc; | ||
| 161 | struct drm_crtc_state *new_crtc_state; | ||
| 162 | |||
| 163 | crtc = drm_atomic_get_old_crtc_for_encoder(atomic_state, encoder); | ||
| 164 | if (!crtc) | ||
| 165 | return; | ||
| 166 | |||
| 167 | new_crtc_state = drm_atomic_get_new_crtc_state(atomic_state, crtc); | ||
| 168 | if (new_crtc_state && new_crtc_state->self_refresh_active) | ||
| 169 | return; | ||
| 131 | 170 | ||
| 132 | drm_panel_disable(panel_bridge->panel); | 171 | drm_panel_disable(panel_bridge->panel); |
| 133 | } | 172 | } |
| 134 | 173 | ||
| 135 | static void panel_bridge_post_disable(struct drm_bridge *bridge) | 174 | static void panel_bridge_atomic_post_disable(struct drm_bridge *bridge, |
| 175 | struct drm_bridge_state *old_bridge_state) | ||
| 136 | { | 176 | { |
| 137 | struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); | 177 | struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); |
| 178 | struct drm_atomic_state *atomic_state = old_bridge_state->base.state; | ||
| 179 | struct drm_encoder *encoder = bridge->encoder; | ||
| 180 | struct drm_crtc *crtc; | ||
| 181 | struct drm_crtc_state *new_crtc_state; | ||
| 182 | |||
| 183 | crtc = drm_atomic_get_old_crtc_for_encoder(atomic_state, encoder); | ||
| 184 | if (!crtc) | ||
| 185 | return; | ||
| 186 | |||
| 187 | new_crtc_state = drm_atomic_get_new_crtc_state(atomic_state, crtc); | ||
| 188 | if (new_crtc_state && new_crtc_state->self_refresh_active) | ||
| 189 | return; | ||
| 138 | 190 | ||
| 139 | drm_panel_unprepare(panel_bridge->panel); | 191 | drm_panel_unprepare(panel_bridge->panel); |
| 140 | } | 192 | } |
| @@ -161,10 +213,10 @@ static void panel_bridge_debugfs_init(struct drm_bridge *bridge, · 20 unmodified lines | |||
| 161 | static const struct drm_bridge_funcs panel_bridge_bridge_funcs = { | 213 | static const struct drm_bridge_funcs panel_bridge_bridge_funcs = { |
| 162 | .attach = panel_bridge_attach, | 214 | .attach = panel_bridge_attach, |
| 163 | .detach = panel_bridge_detach, | 215 | .detach = panel_bridge_detach, |
| 164 | .pre_enable = panel_bridge_pre_enable, | 216 | .atomic_pre_enable = panel_bridge_atomic_pre_enable, |
| 165 | .enable = panel_bridge_enable, | 217 | .atomic_enable = panel_bridge_atomic_enable, |
| 166 | .disable = panel_bridge_disable, | 218 | .atomic_disable = panel_bridge_atomic_disable, |
| 167 | .post_disable = panel_bridge_post_disable, | 219 | .atomic_post_disable = panel_bridge_atomic_post_disable, |
| 168 | .get_modes = panel_bridge_get_modes, | 220 | .get_modes = panel_bridge_get_modes, |
| 169 | .atomic_reset = drm_atomic_helper_bridge_reset, | 221 | .atomic_reset = drm_atomic_helper_bridge_reset, |
| 170 | .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, | 222 | .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, |
| @@ -984,6 +984,66 @@ drm_atomic_get_new_connector_for_encoder(const struct drm_atomic_state *state, · 983 unmodified lines | |||
| 984 | } | 984 | } |
| 985 | EXPORT_SYMBOL(drm_atomic_get_new_connector_for_encoder); | 985 | EXPORT_SYMBOL(drm_atomic_get_new_connector_for_encoder); |
| 986 | 986 | ||
| 987 | /** | ||
| 988 | * drm_atomic_get_old_crtc_for_encoder - Get old crtc for an encoder | ||
| 989 | * @state: Atomic state | ||
| 990 | * @encoder: The encoder to fetch the crtc state for | ||
| 991 | * | ||
| 992 | * This function finds and returns the crtc that was connected to @encoder | ||
| 993 | * as specified by the @state. | ||
| 994 | * | ||
| 995 | * Returns: The old crtc connected to @encoder, or NULL if the encoder is | ||
| 996 | * not connected. | ||
| 997 | */ | ||
| 998 | struct drm_crtc * | ||
| 999 | drm_atomic_get_old_crtc_for_encoder(struct drm_atomic_state *state, | ||
| 1000 | struct drm_encoder *encoder) | ||
| 1001 | { | ||
| 1002 | struct drm_connector *connector; | ||
| 1003 | struct drm_connector_state *conn_state; | ||
| 1004 | |||
| 1005 | connector = drm_atomic_get_old_connector_for_encoder(state, encoder); | ||
| 1006 | if (!connector) | ||
| 1007 | return NULL; | ||
| 1008 | |||
| 1009 | conn_state = drm_atomic_get_old_connector_state(state, connector); | ||
| 1010 | if (!conn_state) | ||
| 1011 | return NULL; | ||
| 1012 | |||
| 1013 | return conn_state->crtc; | ||
| 1014 | } | ||
| 1015 | EXPORT_SYMBOL(drm_atomic_get_old_crtc_for_encoder); | ||
| 1016 | |||
| 1017 | /** | ||
| 1018 | * drm_atomic_get_new_crtc_for_encoder - Get new crtc for an encoder | ||
| 1019 | * @state: Atomic state | ||
| 1020 | * @encoder: The encoder to fetch the crtc state for | ||
| 1021 | * | ||
| 1022 | * This function finds and returns the crtc that will be connected to @encoder | ||
| 1023 | * as specified by the @state. | ||
| 1024 | * | ||
| 1025 | * Returns: The new crtc connected to @encoder, or NULL if the encoder is | ||
| 1026 | * not connected. | ||
| 1027 | */ | ||
| 1028 | struct drm_crtc * | ||
| 1029 | drm_atomic_get_new_crtc_for_encoder(struct drm_atomic_state *state, | ||
| 1030 | struct drm_encoder *encoder) | ||
| 1031 | { | ||
| 1032 | struct drm_connector *connector; | ||
| 1033 | struct drm_connector_state *conn_state; | ||
| 1034 | |||
| 1035 | connector = drm_atomic_get_new_connector_for_encoder(state, encoder); | ||
| 1036 | if (!connector) | ||
| 1037 | return NULL; | ||
| 1038 | |||
| 1039 | conn_state = drm_atomic_get_new_connector_state(state, connector); | ||
| 1040 | if (!conn_state) | ||
| 1041 | return NULL; | ||
| 1042 | |||
| 1043 | return conn_state->crtc; | ||
| 1044 | } | ||
| 1045 | EXPORT_SYMBOL(drm_atomic_get_new_crtc_for_encoder); | ||
| 1046 | |||
| 987 | /** | 1047 | /** |
| 988 | * drm_atomic_get_connector_state - get connector state | 1048 | * drm_atomic_get_connector_state - get connector state |
| 989 | * @state: global atomic state object | 1049 | * @state: global atomic state object |
| @@ -1337,7 +1337,15 @@ drm_gem_lru_remove(struct drm_gem_object *obj) · 1336 unmodified lines | |||
| 1337 | } | 1337 | } |
| 1338 | EXPORT_SYMBOL(drm_gem_lru_remove); | 1338 | EXPORT_SYMBOL(drm_gem_lru_remove); |
| 1339 | 1339 | ||
| 1340 | static void | 1340 | /** |
| 1341 | * drm_gem_lru_move_tail_locked - move the object to the tail of the LRU | ||
| 1342 | * | ||
| 1343 | * Like &drm_gem_lru_move_tail but lru lock must be held | ||
| 1344 | * | ||
| 1345 | * @lru: The LRU to move the object into. | ||
| 1346 | * @obj: The GEM object to move into this LRU | ||
| 1347 | */ | ||
| 1348 | void | ||
| 1341 | drm_gem_lru_move_tail_locked(struct drm_gem_lru *lru, struct drm_gem_object *obj) | 1349 | drm_gem_lru_move_tail_locked(struct drm_gem_lru *lru, struct drm_gem_object *obj) |
| 1342 | { | 1350 | { |
| 1343 | lockdep_assert_held_once(lru->lock); | 1351 | lockdep_assert_held_once(lru->lock); |
| @@ -1349,6 +1357,7 @@ drm_gem_lru_move_tail_locked(struct drm_gem_lru *lru, struct drm_gem_object *obj · 5 unmodified lines | |||
| 1349 | list_add_tail(&obj->lru_node, &lru->list); | 1357 | list_add_tail(&obj->lru_node, &lru->list); |
| 1350 | obj->lru = lru; | 1358 | obj->lru = lru; |
| 1351 | } | 1359 | } |
| 1360 | EXPORT_SYMBOL(drm_gem_lru_move_tail_locked); | ||
| 1352 | 1361 | ||
| 1353 | /** | 1362 | /** |
| 1354 | * drm_gem_lru_move_tail - move the object to the tail of the LRU | 1363 | * drm_gem_lru_move_tail - move the object to the tail of the LRU |
| @@ -9,6 +9,7 @@ config DRM_MSM · 8 unmodified lines | |||
| 9 | depends on QCOM_OCMEM || QCOM_OCMEM=n | 9 | depends on QCOM_OCMEM || QCOM_OCMEM=n |
| 10 | depends on QCOM_LLCC || QCOM_LLCC=n | 10 | depends on QCOM_LLCC || QCOM_LLCC=n |
| 11 | depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n | 11 | depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n |
| 12 | depends on PM | ||
| 12 | select IOMMU_IO_PGTABLE | 13 | select IOMMU_IO_PGTABLE |
| 13 | select QCOM_MDT_LOADER if ARCH_QCOM | 14 | select QCOM_MDT_LOADER if ARCH_QCOM |
| 14 | select REGULATOR | 15 | select REGULATOR |
| @@ -28,6 +29,7 @@ config DRM_MSM · 13 unmodified lines | |||
| 28 | select SYNC_FILE | 29 | select SYNC_FILE |
| 29 | select PM_OPP | 30 | select PM_OPP |
| 30 | select NVMEM | 31 | select NVMEM |
| 32 | select PM_GENERIC_DOMAINS | ||
| 31 | help | 33 | help |
| 32 | DRM/KMS driver for MSM/snapdragon. | 34 | DRM/KMS driver for MSM/snapdragon. |
| 33 | 35 | ||
| @@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2021-01-30 18:25:22) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 15434 bytes, from 2023-03-10 18:32:53) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11404 bytes, from 2023-03-10 18:32:53) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 9055 bytes, from 2023-03-10 18:32:52) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52) |
| 24 | 24 | ||
| 25 | Copyright (C) 2013-2021 by the following authors: | 25 | Copyright (C) 2013-2023 by the following authors: |
| 26 | - Rob Clark <robdclark@gmail.com> (robclark) | 26 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 28 | 28 | ||
| @@ -1060,6 +1060,12 @@ enum a2xx_mh_perfcnt_select { · 1031 unmodified lines | |||
| 1060 | AXI_TOTAL_READ_REQUEST_DATA_BEATS = 181, | 1060 | AXI_TOTAL_READ_REQUEST_DATA_BEATS = 181, |
| 1061 | }; | 1061 | }; |
| 1062 | 1062 | ||
| 1063 | enum perf_mode_cnt { | ||
| 1064 | PERF_STATE_RESET = 0, | ||
| 1065 | PERF_STATE_ENABLE = 1, | ||
| 1066 | PERF_STATE_FREEZE = 2, | ||
| 1067 | }; | ||
| 1068 | |||
| 1063 | enum adreno_mmu_clnt_beh { | 1069 | enum adreno_mmu_clnt_beh { |
| 1064 | BEH_NEVR = 0, | 1070 | BEH_NEVR = 0, |
| 1065 | BEH_TRAN_RNG = 1, | 1071 | BEH_TRAN_RNG = 1, |
| @@ -1307,6 +1313,18 @@ static inline uint32_t A2XX_MH_MMU_VA_RANGE_VA_BASE(uint32_t val) · 241 unmodified lines | |||
| 1307 | #define A2XX_RBBM_PM_OVERRIDE1_MH_TCROQ_SCLK_PM_OVERRIDE 0x80000000 | 1313 | #define A2XX_RBBM_PM_OVERRIDE1_MH_TCROQ_SCLK_PM_OVERRIDE 0x80000000 |
| 1308 | 1314 | ||
| 1309 | #define REG_A2XX_RBBM_PM_OVERRIDE2 0x0000039d | 1315 | #define REG_A2XX_RBBM_PM_OVERRIDE2 0x0000039d |
| 1316 | #define A2XX_RBBM_PM_OVERRIDE2_PA_REG_SCLK_PM_OVERRIDE 0x00000001 | ||
| 1317 | #define A2XX_RBBM_PM_OVERRIDE2_PA_PA_SCLK_PM_OVERRIDE 0x00000002 | ||
| 1318 | #define A2XX_RBBM_PM_OVERRIDE2_PA_AG_SCLK_PM_OVERRIDE 0x00000004 | ||
| 1319 | #define A2XX_RBBM_PM_OVERRIDE2_VGT_REG_SCLK_PM_OVERRIDE 0x00000008 | ||
| 1320 | #define A2XX_RBBM_PM_OVERRIDE2_VGT_FIFOS_SCLK_PM_OVERRIDE 0x00000010 | ||
| 1321 | #define A2XX_RBBM_PM_OVERRIDE2_VGT_VGT_SCLK_PM_OVERRIDE 0x00000020 | ||
| 1322 | #define A2XX_RBBM_PM_OVERRIDE2_DEBUG_PERF_SCLK_PM_OVERRIDE 0x00000040 | ||
| 1323 | #define A2XX_RBBM_PM_OVERRIDE2_PERM_SCLK_PM_OVERRIDE 0x00000080 | ||
| 1324 | #define A2XX_RBBM_PM_OVERRIDE2_GC_GA_GMEM0_PM_OVERRIDE 0x00000100 | ||
| 1325 | #define A2XX_RBBM_PM_OVERRIDE2_GC_GA_GMEM1_PM_OVERRIDE 0x00000200 | ||
| 1326 | #define A2XX_RBBM_PM_OVERRIDE2_GC_GA_GMEM2_PM_OVERRIDE 0x00000400 | ||
| 1327 | #define A2XX_RBBM_PM_OVERRIDE2_GC_GA_GMEM3_PM_OVERRIDE 0x00000800 | ||
| 1310 | 1328 | ||
| 1311 | #define REG_A2XX_RBBM_DEBUG_OUT 0x000003a0 | 1329 | #define REG_A2XX_RBBM_DEBUG_OUT 0x000003a0 |
| 1312 | 1330 | ||
| @@ -1334,6 +1352,12 @@ static inline uint32_t A2XX_MH_MMU_VA_RANGE_VA_BASE(uint32_t val) · 21 unmodified lines | |||
| 1334 | #define REG_A2XX_RBBM_PERIPHID2 0x000003fa | 1352 | #define REG_A2XX_RBBM_PERIPHID2 0x000003fa |
| 1335 | 1353 | ||
| 1336 | #define REG_A2XX_CP_PERFMON_CNTL 0x00000444 | 1354 | #define REG_A2XX_CP_PERFMON_CNTL 0x00000444 |
| 1355 | #define A2XX_CP_PERFMON_CNTL_PERF_MODE_CNT__MASK 0x00000007 | ||
| 1356 | #define A2XX_CP_PERFMON_CNTL_PERF_MODE_CNT__SHIFT 0 | ||
| 1357 | static inline uint32_t A2XX_CP_PERFMON_CNTL_PERF_MODE_CNT(enum perf_mode_cnt val) | ||
| 1358 | { | ||
| 1359 | return ((val) << A2XX_CP_PERFMON_CNTL_PERF_MODE_CNT__SHIFT) & A2XX_CP_PERFMON_CNTL_PERF_MODE_CNT__MASK; | ||
| 1360 | } | ||
| 1337 | 1361 | ||
| 1338 | #define REG_A2XX_CP_PERFCOUNTER_SELECT 0x00000445 | 1362 | #define REG_A2XX_CP_PERFCOUNTER_SELECT 0x00000445 |
| 1339 | 1363 | ||
| @@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2021-01-30 18:25:22) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 15434 bytes, from 2023-03-10 18:32:53) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11404 bytes, from 2023-03-10 18:32:53) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 9055 bytes, from 2023-03-10 18:32:52) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52) |
| 24 | 24 | ||
| 25 | Copyright (C) 2013-2021 by the following authors: | 25 | Copyright (C) 2013-2022 by the following authors: |
| 26 | - Rob Clark <robdclark@gmail.com> (robclark) | 26 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 28 | 28 | ||
| @@ -477,6 +477,16 @@ static struct msm_gpu_state *a3xx_gpu_state_get(struct msm_gpu *gpu) · 476 unmodified lines | |||
| 477 | return state; | 477 | return state; |
| 478 | } | 478 | } |
| 479 | 479 | ||
| 480 | static u64 a3xx_gpu_busy(struct msm_gpu *gpu, unsigned long *out_sample_rate) | ||
| 481 | { | ||
| 482 | u64 busy_cycles; | ||
| 483 | |||
| 484 | busy_cycles = gpu_read64(gpu, REG_A3XX_RBBM_PERFCTR_RBBM_1_LO); | ||
| 485 | *out_sample_rate = clk_get_rate(gpu->core_clk); | ||
| 486 | |||
| 487 | return busy_cycles; | ||
| 488 | } | ||
| 489 | |||
| 480 | static u32 a3xx_get_rptr(struct msm_gpu *gpu, struct msm_ringbuffer *ring) | 490 | static u32 a3xx_get_rptr(struct msm_gpu *gpu, struct msm_ringbuffer *ring) |
| 481 | { | 491 | { |
| 482 | ring->memptrs->rptr = gpu_read(gpu, REG_AXXX_CP_RB_RPTR); | 492 | ring->memptrs->rptr = gpu_read(gpu, REG_AXXX_CP_RB_RPTR); |
| @@ -498,6 +508,7 @@ static const struct adreno_gpu_funcs funcs = { · 15 unmodified lines | |||
| 498 | #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP) | 508 | #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP) |
| 499 | .show = adreno_show, | 509 | .show = adreno_show, |
| 500 | #endif | 510 | #endif |
| 511 | .gpu_busy = a3xx_gpu_busy, | ||
| 501 | .gpu_state_get = a3xx_gpu_state_get, | 512 | .gpu_state_get = a3xx_gpu_state_get, |
| 502 | .gpu_state_put = adreno_gpu_state_put, | 513 | .gpu_state_put = adreno_gpu_state_put, |
| 503 | .create_address_space = adreno_create_address_space, | 514 | .create_address_space = adreno_create_address_space, |
| @@ -8,19 +8,19 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2021-01-30 18:25:22) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 15434 bytes, from 2023-03-10 18:32:53) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11404 bytes, from 2023-03-10 18:32:53) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 9055 bytes, from 2023-03-10 18:32:52) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52) |
| 24 | 24 | ||
| 25 | Copyright (C) 2013-2022 by the following authors: | 25 | Copyright (C) 2013-2022 by the following authors: |
| 26 | - Rob Clark <robdclark@gmail.com> (robclark) | 26 | - Rob Clark <robdclark@gmail.com> (robclark) |
| @@ -3159,6 +3159,18 @@ static inline uint32_t A4XX_TPL1_TP_TEX_COUNT_GS(uint32_t val) · 3132 unmodified lines | |||
| 3159 | #define REG_A4XX_TPL1_TP_GS_BORDER_COLOR_BASE_ADDR 0x0000238d | 3159 | #define REG_A4XX_TPL1_TP_GS_BORDER_COLOR_BASE_ADDR 0x0000238d |
| 3160 | 3160 | ||
| 3161 | #define REG_A4XX_TPL1_TP_FS_TEX_COUNT 0x000023a0 | 3161 | #define REG_A4XX_TPL1_TP_FS_TEX_COUNT 0x000023a0 |
| 3162 | #define A4XX_TPL1_TP_FS_TEX_COUNT_FS__MASK 0x000000ff | ||
| 3163 | #define A4XX_TPL1_TP_FS_TEX_COUNT_FS__SHIFT 0 | ||
| 3164 | static inline uint32_t A4XX_TPL1_TP_FS_TEX_COUNT_FS(uint32_t val) | ||
| 3165 | { | ||
| 3166 | return ((val) << A4XX_TPL1_TP_FS_TEX_COUNT_FS__SHIFT) & A4XX_TPL1_TP_FS_TEX_COUNT_FS__MASK; | ||
| 3167 | } | ||
| 3168 | #define A4XX_TPL1_TP_FS_TEX_COUNT_CS__MASK 0x0000ff00 | ||
| 3169 | #define A4XX_TPL1_TP_FS_TEX_COUNT_CS__SHIFT 8 | ||
| 3170 | static inline uint32_t A4XX_TPL1_TP_FS_TEX_COUNT_CS(uint32_t val) | ||
| 3171 | { | ||
| 3172 | return ((val) << A4XX_TPL1_TP_FS_TEX_COUNT_CS__SHIFT) & A4XX_TPL1_TP_FS_TEX_COUNT_CS__MASK; | ||
| 3173 | } | ||
| 3162 | 3174 | ||
| 3163 | #define REG_A4XX_TPL1_TP_FS_BORDER_COLOR_BASE_ADDR 0x000023a1 | 3175 | #define REG_A4XX_TPL1_TP_FS_BORDER_COLOR_BASE_ADDR 0x000023a1 |
| 3164 | 3176 | ||
| @@ -611,6 +611,16 @@ static int a4xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) · 610 unmodified lines | |||
| 611 | return 0; | 611 | return 0; |
| 612 | } | 612 | } |
| 613 | 613 | ||
| 614 | static u64 a4xx_gpu_busy(struct msm_gpu *gpu, unsigned long *out_sample_rate) | ||
| 615 | { | ||
| 616 | u64 busy_cycles; | ||
| 617 | |||
| 618 | busy_cycles = gpu_read64(gpu, REG_A4XX_RBBM_PERFCTR_RBBM_1_LO); | ||
| 619 | *out_sample_rate = clk_get_rate(gpu->core_clk); | ||
| 620 | |||
| 621 | return busy_cycles; | ||
| 622 | } | ||
| 623 | |||
| 614 | static u32 a4xx_get_rptr(struct msm_gpu *gpu, struct msm_ringbuffer *ring) | 624 | static u32 a4xx_get_rptr(struct msm_gpu *gpu, struct msm_ringbuffer *ring) |
| 615 | { | 625 | { |
| 616 | ring->memptrs->rptr = gpu_read(gpu, REG_A4XX_CP_RB_RPTR); | 626 | ring->memptrs->rptr = gpu_read(gpu, REG_A4XX_CP_RB_RPTR); |
| @@ -632,6 +642,7 @@ static const struct adreno_gpu_funcs funcs = { · 15 unmodified lines | |||
| 632 | #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP) | 642 | #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP) |
| 633 | .show = adreno_show, | 643 | .show = adreno_show, |
| 634 | #endif | 644 | #endif |
| 645 | .gpu_busy = a4xx_gpu_busy, | ||
| 635 | .gpu_state_get = a4xx_gpu_state_get, | 646 | .gpu_state_get = a4xx_gpu_state_get, |
| 636 | .gpu_state_put = adreno_gpu_state_put, | 647 | .gpu_state_put = adreno_gpu_state_put, |
| 637 | .create_address_space = adreno_create_address_space, | 648 | .create_address_space = adreno_create_address_space, |
| @@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2021-01-30 18:25:22) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 15434 bytes, from 2023-03-10 18:32:53) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11404 bytes, from 2023-03-10 18:32:53) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 9055 bytes, from 2023-03-10 18:32:52) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52) |
| 24 | 24 | ||
| 25 | Copyright (C) 2013-2022 by the following authors: | 25 | Copyright (C) 2013-2023 by the following authors: |
| 26 | - Rob Clark <robdclark@gmail.com> (robclark) | 26 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 28 | 28 | ||
| @@ -4218,6 +4218,7 @@ static inline uint32_t A5XX_SP_CS_CONFIG_SHADEROBJOFFSET(uint32_t val) · 4189 unmodified lines | |||
| 4218 | #define REG_A5XX_SP_FS_CONFIG_MAX_CONST 0x0000e58b | 4218 | #define REG_A5XX_SP_FS_CONFIG_MAX_CONST 0x0000e58b |
| 4219 | 4219 | ||
| 4220 | #define REG_A5XX_SP_VS_CTRL_REG0 0x0000e590 | 4220 | #define REG_A5XX_SP_VS_CTRL_REG0 0x0000e590 |
| 4221 | #define A5XX_SP_VS_CTRL_REG0_BUFFER 0x00000004 | ||
| 4221 | #define A5XX_SP_VS_CTRL_REG0_THREADSIZE__MASK 0x00000008 | 4222 | #define A5XX_SP_VS_CTRL_REG0_THREADSIZE__MASK 0x00000008 |
| 4222 | #define A5XX_SP_VS_CTRL_REG0_THREADSIZE__SHIFT 3 | 4223 | #define A5XX_SP_VS_CTRL_REG0_THREADSIZE__SHIFT 3 |
| 4223 | static inline uint32_t A5XX_SP_VS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) | 4224 | static inline uint32_t A5XX_SP_VS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) |
| @@ -4316,6 +4317,7 @@ static inline uint32_t A5XX_SP_VS_VPC_DST_REG_OUTLOC3(uint32_t val) · 92 unmodified lines | |||
| 4316 | #define REG_A5XX_SP_VS_OBJ_START_HI 0x0000e5ad | 4317 | #define REG_A5XX_SP_VS_OBJ_START_HI 0x0000e5ad |
| 4317 | 4318 | ||
| 4318 | #define REG_A5XX_SP_FS_CTRL_REG0 0x0000e5c0 | 4319 | #define REG_A5XX_SP_FS_CTRL_REG0 0x0000e5c0 |
| 4320 | #define A5XX_SP_FS_CTRL_REG0_BUFFER 0x00000004 | ||
| 4319 | #define A5XX_SP_FS_CTRL_REG0_THREADSIZE__MASK 0x00000008 | 4321 | #define A5XX_SP_FS_CTRL_REG0_THREADSIZE__MASK 0x00000008 |
| 4320 | #define A5XX_SP_FS_CTRL_REG0_THREADSIZE__SHIFT 3 | 4322 | #define A5XX_SP_FS_CTRL_REG0_THREADSIZE__SHIFT 3 |
| 4321 | static inline uint32_t A5XX_SP_FS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) | 4323 | static inline uint32_t A5XX_SP_FS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) |
| @@ -4406,6 +4408,7 @@ static inline uint32_t A5XX_SP_FS_MRT_REG_COLOR_FORMAT(enum a5xx_color_fmt val) · 84 unmodified lines | |||
| 4406 | #define REG_A5XX_UNKNOWN_E5DB 0x0000e5db | 4408 | #define REG_A5XX_UNKNOWN_E5DB 0x0000e5db |
| 4407 | 4409 | ||
| 4408 | #define REG_A5XX_SP_CS_CTRL_REG0 0x0000e5f0 | 4410 | #define REG_A5XX_SP_CS_CTRL_REG0 0x0000e5f0 |
| 4411 | #define A5XX_SP_CS_CTRL_REG0_BUFFER 0x00000004 | ||
| 4409 | #define A5XX_SP_CS_CTRL_REG0_THREADSIZE__MASK 0x00000008 | 4412 | #define A5XX_SP_CS_CTRL_REG0_THREADSIZE__MASK 0x00000008 |
| 4410 | #define A5XX_SP_CS_CTRL_REG0_THREADSIZE__SHIFT 3 | 4413 | #define A5XX_SP_CS_CTRL_REG0_THREADSIZE__SHIFT 3 |
| 4411 | static inline uint32_t A5XX_SP_CS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) | 4414 | static inline uint32_t A5XX_SP_CS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) |
| @@ -4440,6 +4443,7 @@ static inline uint32_t A5XX_SP_CS_CTRL_REG0_BRANCHSTACK(uint32_t val) · 28 unmodified lines | |||
| 4440 | #define REG_A5XX_SP_CS_OBJ_START_HI 0x0000e5f4 | 4443 | #define REG_A5XX_SP_CS_OBJ_START_HI 0x0000e5f4 |
| 4441 | 4444 | ||
| 4442 | #define REG_A5XX_SP_HS_CTRL_REG0 0x0000e600 | 4445 | #define REG_A5XX_SP_HS_CTRL_REG0 0x0000e600 |
| 4446 | #define A5XX_SP_HS_CTRL_REG0_BUFFER 0x00000004 | ||
| 4443 | #define A5XX_SP_HS_CTRL_REG0_THREADSIZE__MASK 0x00000008 | 4447 | #define A5XX_SP_HS_CTRL_REG0_THREADSIZE__MASK 0x00000008 |
| 4444 | #define A5XX_SP_HS_CTRL_REG0_THREADSIZE__SHIFT 3 | 4448 | #define A5XX_SP_HS_CTRL_REG0_THREADSIZE__SHIFT 3 |
| 4445 | static inline uint32_t A5XX_SP_HS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) | 4449 | static inline uint32_t A5XX_SP_HS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) |
| @@ -4474,6 +4478,7 @@ static inline uint32_t A5XX_SP_HS_CTRL_REG0_BRANCHSTACK(uint32_t val) · 28 unmodified lines | |||
| 4474 | #define REG_A5XX_SP_HS_OBJ_START_HI 0x0000e604 | 4478 | #define REG_A5XX_SP_HS_OBJ_START_HI 0x0000e604 |
| 4475 | 4479 | ||
| 4476 | #define REG_A5XX_SP_DS_CTRL_REG0 0x0000e610 | 4480 | #define REG_A5XX_SP_DS_CTRL_REG0 0x0000e610 |
| 4481 | #define A5XX_SP_DS_CTRL_REG0_BUFFER 0x00000004 | ||
| 4477 | #define A5XX_SP_DS_CTRL_REG0_THREADSIZE__MASK 0x00000008 | 4482 | #define A5XX_SP_DS_CTRL_REG0_THREADSIZE__MASK 0x00000008 |
| 4478 | #define A5XX_SP_DS_CTRL_REG0_THREADSIZE__SHIFT 3 | 4483 | #define A5XX_SP_DS_CTRL_REG0_THREADSIZE__SHIFT 3 |
| 4479 | static inline uint32_t A5XX_SP_DS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) | 4484 | static inline uint32_t A5XX_SP_DS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) |
| @@ -4508,6 +4513,7 @@ static inline uint32_t A5XX_SP_DS_CTRL_REG0_BRANCHSTACK(uint32_t val) · 28 unmodified lines | |||
| 4508 | #define REG_A5XX_SP_DS_OBJ_START_HI 0x0000e62d | 4513 | #define REG_A5XX_SP_DS_OBJ_START_HI 0x0000e62d |
| 4509 | 4514 | ||
| 4510 | #define REG_A5XX_SP_GS_CTRL_REG0 0x0000e640 | 4515 | #define REG_A5XX_SP_GS_CTRL_REG0 0x0000e640 |
| 4516 | #define A5XX_SP_GS_CTRL_REG0_BUFFER 0x00000004 | ||
| 4511 | #define A5XX_SP_GS_CTRL_REG0_THREADSIZE__MASK 0x00000008 | 4517 | #define A5XX_SP_GS_CTRL_REG0_THREADSIZE__MASK 0x00000008 |
| 4512 | #define A5XX_SP_GS_CTRL_REG0_THREADSIZE__SHIFT 3 | 4518 | #define A5XX_SP_GS_CTRL_REG0_THREADSIZE__SHIFT 3 |
| 4513 | static inline uint32_t A5XX_SP_GS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) | 4519 | static inline uint32_t A5XX_SP_GS_CTRL_REG0_THREADSIZE(enum a3xx_threadsize val) |
| @@ -4665,11 +4671,11 @@ static inline uint32_t A5XX_HLSQ_CONTROL_2_REG_SAMPLEMASK(uint32_t val) · 151 unmodified lines | |||
| 4665 | { | 4671 | { |
| 4666 | return ((val) << A5XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__SHIFT) & A5XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__MASK; | 4672 | return ((val) << A5XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__SHIFT) & A5XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__MASK; |
| 4667 | } | 4673 | } |
| 4668 | #define A5XX_HLSQ_CONTROL_2_REG_SIZE__MASK 0xff000000 | 4674 | #define A5XX_HLSQ_CONTROL_2_REG_CENTERRHW__MASK 0xff000000 |
| 4669 | #define A5XX_HLSQ_CONTROL_2_REG_SIZE__SHIFT 24 | 4675 | #define A5XX_HLSQ_CONTROL_2_REG_CENTERRHW__SHIFT 24 |
| 4670 | static inline uint32_t A5XX_HLSQ_CONTROL_2_REG_SIZE(uint32_t val) | 4676 | static inline uint32_t A5XX_HLSQ_CONTROL_2_REG_CENTERRHW(uint32_t val) |
| 4671 | { | 4677 | { |
| 4672 | return ((val) << A5XX_HLSQ_CONTROL_2_REG_SIZE__SHIFT) & A5XX_HLSQ_CONTROL_2_REG_SIZE__MASK; | 4678 | return ((val) << A5XX_HLSQ_CONTROL_2_REG_CENTERRHW__SHIFT) & A5XX_HLSQ_CONTROL_2_REG_CENTERRHW__MASK; |
| 4673 | } | 4679 | } |
| 4674 | 4680 | ||
| 4675 | #define REG_A5XX_HLSQ_CONTROL_3_REG 0x0000e787 | 4681 | #define REG_A5XX_HLSQ_CONTROL_3_REG 0x0000e787 |
| @@ -567,7 +567,7 @@ static void a5xx_ucode_check_version(struct a5xx_gpu *a5xx_gpu, · 566 unmodified lines | |||
| 567 | msm_gem_put_vaddr(obj); | 567 | msm_gem_put_vaddr(obj); |
| 568 | } | 568 | } |
| 569 | 569 | ||
| 570 | static int a5xx_ucode_init(struct msm_gpu *gpu) | 570 | static int a5xx_ucode_load(struct msm_gpu *gpu) |
| 571 | { | 571 | { |
| 572 | struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); | 572 | struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); |
| 573 | struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu); | 573 | struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu); |
| @@ -605,9 +605,24 @@ static int a5xx_ucode_init(struct msm_gpu *gpu) · 31 unmodified lines | |||
| 605 | a5xx_ucode_check_version(a5xx_gpu, a5xx_gpu->pfp_bo); | 605 | a5xx_ucode_check_version(a5xx_gpu, a5xx_gpu->pfp_bo); |
| 606 | } | 606 | } |
| 607 | 607 | ||
| 608 | gpu_write64(gpu, REG_A5XX_CP_ME_INSTR_BASE_LO, a5xx_gpu->pm4_iova); | 608 | if (a5xx_gpu->has_whereami) { |
| 609 | if (!a5xx_gpu->shadow_bo) { | ||
| 610 | a5xx_gpu->shadow = msm_gem_kernel_new(gpu->dev, | ||
| 611 | sizeof(u32) * gpu->nr_rings, | ||
| 612 | MSM_BO_WC | MSM_BO_MAP_PRIV, | ||
| 613 | gpu->aspace, &a5xx_gpu->shadow_bo, | ||
| 614 | &a5xx_gpu->shadow_iova); | ||
| 609 | 615 | ||
| 610 | gpu_write64(gpu, REG_A5XX_CP_PFP_INSTR_BASE_LO, a5xx_gpu->pfp_iova); | 616 | if (IS_ERR(a5xx_gpu->shadow)) |
| 617 | return PTR_ERR(a5xx_gpu->shadow); | ||
| 618 | |||
| 619 | msm_gem_object_set_name(a5xx_gpu->shadow_bo, "shadow"); | ||
| 620 | } | ||
| 621 | } else if (gpu->nr_rings > 1) { | ||
| 622 | /* Disable preemption if WHERE_AM_I isn't available */ | ||
| 623 | a5xx_preempt_fini(gpu); | ||
| 624 | gpu->nr_rings = 1; | ||
| 625 | } | ||
| 611 | 626 | ||
| 612 | return 0; | 627 | return 0; |
| 613 | } | 628 | } |
| @@ -900,9 +915,8 @@ static int a5xx_hw_init(struct msm_gpu *gpu) · 286 unmodified lines | |||
| 900 | if (adreno_is_a530(adreno_gpu) || adreno_is_a540(adreno_gpu)) | 915 | if (adreno_is_a530(adreno_gpu) || adreno_is_a540(adreno_gpu)) |
| 901 | a5xx_gpmu_ucode_init(gpu); | 916 | a5xx_gpmu_ucode_init(gpu); |
| 902 | 917 | ||
| 903 | ret = a5xx_ucode_init(gpu); | 918 | gpu_write64(gpu, REG_A5XX_CP_ME_INSTR_BASE_LO, a5xx_gpu->pm4_iova); |
| 904 | if (ret) | 919 | gpu_write64(gpu, REG_A5XX_CP_PFP_INSTR_BASE_LO, a5xx_gpu->pfp_iova); |
| 905 | return ret; | ||
| 906 | 920 | ||
| 907 | /* Set the ringbuffer address */ | 921 | /* Set the ringbuffer address */ |
| 908 | gpu_write64(gpu, REG_A5XX_CP_RB_BASE, gpu->rb[0]->iova); | 922 | gpu_write64(gpu, REG_A5XX_CP_RB_BASE, gpu->rb[0]->iova); |
| @@ -916,27 +930,10 @@ static int a5xx_hw_init(struct msm_gpu *gpu) · 7 unmodified lines | |||
| 916 | gpu_write(gpu, REG_A5XX_CP_RB_CNTL, | 930 | gpu_write(gpu, REG_A5XX_CP_RB_CNTL, |
| 917 | MSM_GPU_RB_CNTL_DEFAULT | AXXX_CP_RB_CNTL_NO_UPDATE); | 931 | MSM_GPU_RB_CNTL_DEFAULT | AXXX_CP_RB_CNTL_NO_UPDATE); |
| 918 | 932 | ||
| 919 | /* Create a privileged buffer for the RPTR shadow */ | 933 | /* Configure the RPTR shadow if needed: */ |
| 920 | if (a5xx_gpu->has_whereami) { | 934 | if (a5xx_gpu->shadow_bo) { |
| 921 | if (!a5xx_gpu->shadow_bo) { | ||
| 922 | a5xx_gpu->shadow = msm_gem_kernel_new(gpu->dev, | ||
| 923 | sizeof(u32) * gpu->nr_rings, | ||
| 924 | MSM_BO_WC | MSM_BO_MAP_PRIV, | ||
| 925 | gpu->aspace, &a5xx_gpu->shadow_bo, | ||
| 926 | &a5xx_gpu->shadow_iova); | ||
| 927 | |||
| 928 | if (IS_ERR(a5xx_gpu->shadow)) | ||
| 929 | return PTR_ERR(a5xx_gpu->shadow); | ||
| 930 | |||
| 931 | msm_gem_object_set_name(a5xx_gpu->shadow_bo, "shadow"); | ||
| 932 | } | ||
| 933 | |||
| 934 | gpu_write64(gpu, REG_A5XX_CP_RB_RPTR_ADDR, | 935 | gpu_write64(gpu, REG_A5XX_CP_RB_RPTR_ADDR, |
| 935 | shadowptr(a5xx_gpu, gpu->rb[0])); | 936 | shadowptr(a5xx_gpu, gpu->rb[0])); |
| 936 | } else if (gpu->nr_rings > 1) { | ||
| 937 | /* Disable preemption if WHERE_AM_I isn't available */ | ||
| 938 | a5xx_preempt_fini(gpu); | ||
| 939 | gpu->nr_rings = 1; | ||
| 940 | } | 937 | } |
| 941 | 938 | ||
| 942 | a5xx_preempt_hw_init(gpu); | 939 | a5xx_preempt_hw_init(gpu); |
| @@ -1099,14 +1096,19 @@ bool a5xx_idle(struct msm_gpu *gpu, struct msm_ringbuffer *ring) · 156 unmodified lines | |||
| 1099 | static int a5xx_fault_handler(void *arg, unsigned long iova, int flags, void *data) | 1096 | static int a5xx_fault_handler(void *arg, unsigned long iova, int flags, void *data) |
| 1100 | { | 1097 | { |
| 1101 | struct msm_gpu *gpu = arg; | 1098 | struct msm_gpu *gpu = arg; |
| 1102 | pr_warn_ratelimited("*** gpu fault: iova=%08lx, flags=%d (%u,%u,%u,%u)\n", | 1099 | struct adreno_smmu_fault_info *info = data; |
| 1103 | iova, flags, | 1100 | char block[12] = "unknown"; |
| 1101 | u32 scratch[] = { | ||
| 1104 | gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(4)), | 1102 | gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(4)), |
| 1105 | gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(5)), | 1103 | gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(5)), |
| 1106 | gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(6)), | 1104 | gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(6)), |
| 1107 | gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(7))); | 1105 | gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(7)), |
| 1106 | }; | ||
| 1108 | 1107 | ||
| 1109 | return 0; | 1108 | if (info) |
| 1109 | snprintf(block, sizeof(block), "%x", info->fsynr1); | ||
| 1110 | |||
| 1111 | return adreno_fault_handler(gpu, iova, flags, info, block, scratch); | ||
| 1110 | } | 1112 | } |
| 1111 | 1113 | ||
| 1112 | static void a5xx_cp_err_irq(struct msm_gpu *gpu) | 1114 | static void a5xx_cp_err_irq(struct msm_gpu *gpu) |
| @@ -1682,6 +1684,7 @@ static const struct adreno_gpu_funcs funcs = { · 569 unmodified lines | |||
| 1682 | .get_param = adreno_get_param, | 1684 | .get_param = adreno_get_param, |
| 1683 | .set_param = adreno_set_param, | 1685 | .set_param = adreno_set_param, |
| 1684 | .hw_init = a5xx_hw_init, | 1686 | .hw_init = a5xx_hw_init, |
| 1687 | .ucode_load = a5xx_ucode_load, | ||
| 1685 | .pm_suspend = a5xx_pm_suspend, | 1688 | .pm_suspend = a5xx_pm_suspend, |
| 1686 | .pm_resume = a5xx_pm_resume, | 1689 | .pm_resume = a5xx_pm_resume, |
| 1687 | .recover = a5xx_recover, | 1690 | .recover = a5xx_recover, |
| @@ -1743,6 +1746,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) · 55 unmodified lines | |||
| 1743 | struct a5xx_gpu *a5xx_gpu = NULL; | 1746 | struct a5xx_gpu *a5xx_gpu = NULL; |
| 1744 | struct adreno_gpu *adreno_gpu; | 1747 | struct adreno_gpu *adreno_gpu; |
| 1745 | struct msm_gpu *gpu; | 1748 | struct msm_gpu *gpu; |
| 1749 | unsigned int nr_rings; | ||
| 1746 | int ret; | 1750 | int ret; |
| 1747 | 1751 | ||
| 1748 | if (!pdev) { | 1752 | if (!pdev) { |
| @@ -1763,7 +1767,12 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) · 14 unmodified lines | |||
| 1763 | 1767 | ||
| 1764 | check_speed_bin(&pdev->dev); | 1768 | check_speed_bin(&pdev->dev); |
| 1765 | 1769 | ||
| 1766 | ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 4); | 1770 | nr_rings = 4; |
| 1771 | |||
| 1772 | if (adreno_is_a510(adreno_gpu)) | ||
| 1773 | nr_rings = 1; | ||
| 1774 | |||
| 1775 | ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, nr_rings); | ||
| 1767 | if (ret) { | 1776 | if (ret) { |
| 1768 | a5xx_destroy(&(a5xx_gpu->base.base)); | 1777 | a5xx_destroy(&(a5xx_gpu->base.base)); |
| 1769 | return ERR_PTR(ret); | 1778 | return ERR_PTR(ret); |
| @@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2021-01-30 18:25:22) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 15434 bytes, from 2023-03-10 18:32:53) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11404 bytes, from 2023-03-10 18:32:53) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 9055 bytes, from 2023-03-10 18:32:52) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52) |
| 24 | 24 | ||
| 25 | Copyright (C) 2013-2022 by the following authors: | 25 | Copyright (C) 2013-2023 by the following authors: |
| 26 | - Rob Clark <robdclark@gmail.com> (robclark) | 26 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 28 | 28 | ||
| @@ -911,6 +911,7 @@ enum a6xx_ztest_mode { · 882 unmodified lines | |||
| 911 | A6XX_EARLY_Z = 0, | 911 | A6XX_EARLY_Z = 0, |
| 912 | A6XX_LATE_Z = 1, | 912 | A6XX_LATE_Z = 1, |
| 913 | A6XX_EARLY_LRZ_LATE_Z = 2, | 913 | A6XX_EARLY_LRZ_LATE_Z = 2, |
| 914 | A6XX_INVALID_ZTEST = 3, | ||
| 914 | }; | 915 | }; |
| 915 | 916 | ||
| 916 | enum a6xx_sequenced_thread_dist { | 917 | enum a6xx_sequenced_thread_dist { |
| @@ -946,6 +947,12 @@ enum a6xx_buffers_location { · 29 unmodified lines | |||
| 946 | BUFFERS_IN_SYSMEM = 3, | 947 | BUFFERS_IN_SYSMEM = 3, |
| 947 | }; | 948 | }; |
| 948 | 949 | ||
| 950 | enum a6xx_lrz_dir_status { | ||
| 951 | LRZ_DIR_LE = 1, | ||
| 952 | LRZ_DIR_GE = 2, | ||
| 953 | LRZ_DIR_INVALID = 3, | ||
| 954 | }; | ||
| 955 | |||
| 949 | enum a6xx_fragcoord_sample_mode { | 956 | enum a6xx_fragcoord_sample_mode { |
| 950 | FRAGCOORD_CENTER = 0, | 957 | FRAGCOORD_CENTER = 0, |
| 951 | FRAGCOORD_SAMPLE = 3, | 958 | FRAGCOORD_SAMPLE = 3, |
| @@ -978,6 +985,11 @@ enum a6xx_threadsize { · 26 unmodified lines | |||
| 978 | THREAD128 = 1, | 985 | THREAD128 = 1, |
| 979 | }; | 986 | }; |
| 980 | 987 | ||
| 988 | enum a6xx_bindless_descriptor_size { | ||
| 989 | BINDLESS_DESCRIPTOR_16B = 1, | ||
| 990 | BINDLESS_DESCRIPTOR_64B = 3, | ||
| 991 | }; | ||
| 992 | |||
| 981 | enum a6xx_isam_mode { | 993 | enum a6xx_isam_mode { |
| 982 | ISAMMODE_GL = 2, | 994 | ISAMMODE_GL = 2, |
| 983 | }; | 995 | }; |
| @@ -1030,6 +1042,8 @@ enum a6xx_tex_type { · 46 unmodified lines | |||
| 1030 | 1042 | ||
| 1031 | #define A6XX_RBBM_INT_0_MASK_RBBM_GPU_IDLE 0x00000001 | 1043 | #define A6XX_RBBM_INT_0_MASK_RBBM_GPU_IDLE 0x00000001 |
| 1032 | #define A6XX_RBBM_INT_0_MASK_CP_AHB_ERROR 0x00000002 | 1044 | #define A6XX_RBBM_INT_0_MASK_CP_AHB_ERROR 0x00000002 |
| 1045 | #define A6XX_RBBM_INT_0_MASK_CP_IPC_INTR_0 0x00000010 | ||
| 1046 | #define A6XX_RBBM_INT_0_MASK_CP_IPC_INTR_1 0x00000020 | ||
| 1033 | #define A6XX_RBBM_INT_0_MASK_RBBM_ATB_ASYNCFIFO_OVERFLOW 0x00000040 | 1047 | #define A6XX_RBBM_INT_0_MASK_RBBM_ATB_ASYNCFIFO_OVERFLOW 0x00000040 |
| 1034 | #define A6XX_RBBM_INT_0_MASK_RBBM_GPC_ERROR 0x00000080 | 1048 | #define A6XX_RBBM_INT_0_MASK_RBBM_GPC_ERROR 0x00000080 |
| 1035 | #define A6XX_RBBM_INT_0_MASK_CP_SW 0x00000100 | 1049 | #define A6XX_RBBM_INT_0_MASK_CP_SW 0x00000100 |
| @@ -1040,15 +1054,19 @@ enum a6xx_tex_type { · 4 unmodified lines | |||
| 1040 | #define A6XX_RBBM_INT_0_MASK_CP_IB2 0x00002000 | 1054 | #define A6XX_RBBM_INT_0_MASK_CP_IB2 0x00002000 |
| 1041 | #define A6XX_RBBM_INT_0_MASK_CP_IB1 0x00004000 | 1055 | #define A6XX_RBBM_INT_0_MASK_CP_IB1 0x00004000 |
| 1042 | #define A6XX_RBBM_INT_0_MASK_CP_RB 0x00008000 | 1056 | #define A6XX_RBBM_INT_0_MASK_CP_RB 0x00008000 |
| 1057 | #define A6XX_RBBM_INT_0_MASK_PM4CPINTERRUPT 0x00008000 | ||
| 1058 | #define A6XX_RBBM_INT_0_MASK_PM4CPINTERRUPTLPAC 0x00010000 | ||
| 1043 | #define A6XX_RBBM_INT_0_MASK_CP_RB_DONE_TS 0x00020000 | 1059 | #define A6XX_RBBM_INT_0_MASK_CP_RB_DONE_TS 0x00020000 |
| 1044 | #define A6XX_RBBM_INT_0_MASK_CP_WT_DONE_TS 0x00040000 | 1060 | #define A6XX_RBBM_INT_0_MASK_CP_WT_DONE_TS 0x00040000 |
| 1045 | #define A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS 0x00100000 | 1061 | #define A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS 0x00100000 |
| 1062 | #define A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS_LPAC 0x00200000 | ||
| 1046 | #define A6XX_RBBM_INT_0_MASK_RBBM_ATB_BUS_OVERFLOW 0x00400000 | 1063 | #define A6XX_RBBM_INT_0_MASK_RBBM_ATB_BUS_OVERFLOW 0x00400000 |
| 1047 | #define A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT 0x00800000 | 1064 | #define A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT 0x00800000 |
| 1048 | #define A6XX_RBBM_INT_0_MASK_UCHE_OOB_ACCESS 0x01000000 | 1065 | #define A6XX_RBBM_INT_0_MASK_UCHE_OOB_ACCESS 0x01000000 |
| 1049 | #define A6XX_RBBM_INT_0_MASK_UCHE_TRAP_INTR 0x02000000 | 1066 | #define A6XX_RBBM_INT_0_MASK_UCHE_TRAP_INTR 0x02000000 |
| 1050 | #define A6XX_RBBM_INT_0_MASK_DEBBUS_INTR_0 0x04000000 | 1067 | #define A6XX_RBBM_INT_0_MASK_DEBBUS_INTR_0 0x04000000 |
| 1051 | #define A6XX_RBBM_INT_0_MASK_DEBBUS_INTR_1 0x08000000 | 1068 | #define A6XX_RBBM_INT_0_MASK_DEBBUS_INTR_1 0x08000000 |
| 1069 | #define A6XX_RBBM_INT_0_MASK_TSBWRITEERROR 0x10000000 | ||
| 1052 | #define A6XX_RBBM_INT_0_MASK_ISDB_CPU_IRQ 0x40000000 | 1070 | #define A6XX_RBBM_INT_0_MASK_ISDB_CPU_IRQ 0x40000000 |
| 1053 | #define A6XX_RBBM_INT_0_MASK_ISDB_UNDER_DEBUG 0x80000000 | 1071 | #define A6XX_RBBM_INT_0_MASK_ISDB_UNDER_DEBUG 0x80000000 |
| 1054 | #define A6XX_CP_INT_CP_OPCODE_ERROR 0x00000001 | 1072 | #define A6XX_CP_INT_CP_OPCODE_ERROR 0x00000001 |
| @@ -1058,15 +1076,21 @@ enum a6xx_tex_type { · 3 unmodified lines | |||
| 1058 | #define A6XX_CP_INT_CP_AHB_ERROR 0x00000020 | 1076 | #define A6XX_CP_INT_CP_AHB_ERROR 0x00000020 |
| 1059 | #define A6XX_CP_INT_CP_VSD_PARITY_ERROR 0x00000040 | 1077 | #define A6XX_CP_INT_CP_VSD_PARITY_ERROR 0x00000040 |
| 1060 | #define A6XX_CP_INT_CP_ILLEGAL_INSTR_ERROR 0x00000080 | 1078 | #define A6XX_CP_INT_CP_ILLEGAL_INSTR_ERROR 0x00000080 |
| 1079 | #define A6XX_CP_INT_CP_OPCODE_ERROR_LPAC 0x00000100 | ||
| 1080 | #define A6XX_CP_INT_CP_UCODE_ERROR_LPAC 0x00000200 | ||
| 1081 | #define A6XX_CP_INT_CP_HW_FAULT_ERROR_LPAC 0x00000400 | ||
| 1082 | #define A6XX_CP_INT_CP_REGISTER_PROTECTION_ERROR_LPAC 0x00000800 | ||
| 1083 | #define A6XX_CP_INT_CP_ILLEGAL_INSTR_ERROR_LPAC 0x00001000 | ||
| 1084 | #define A6XX_CP_INT_CP_OPCODE_ERROR_BV 0x00002000 | ||
| 1085 | #define A6XX_CP_INT_CP_UCODE_ERROR_BV 0x00004000 | ||
| 1086 | #define A6XX_CP_INT_CP_HW_FAULT_ERROR_BV 0x00008000 | ||
| 1087 | #define A6XX_CP_INT_CP_REGISTER_PROTECTION_ERROR_BV 0x00010000 | ||
| 1088 | #define A6XX_CP_INT_CP_ILLEGAL_INSTR_ERROR_BV 0x00020000 | ||
| 1061 | #define REG_A6XX_CP_RB_BASE 0x00000800 | 1089 | #define REG_A6XX_CP_RB_BASE 0x00000800 |
| 1062 | 1090 | ||
| 1063 | #define REG_A6XX_CP_RB_BASE_HI 0x00000801 | ||
| 1064 | |||
| 1065 | #define REG_A6XX_CP_RB_CNTL 0x00000802 | 1091 | #define REG_A6XX_CP_RB_CNTL 0x00000802 |
| 1066 | 1092 | ||
| 1067 | #define REG_A6XX_CP_RB_RPTR_ADDR_LO 0x00000804 | 1093 | #define REG_A6XX_CP_RB_RPTR_ADDR 0x00000804 |
| 1068 | |||
| 1069 | #define REG_A6XX_CP_RB_RPTR_ADDR_HI 0x00000805 | ||
| 1070 | 1094 | ||
| 1071 | #define REG_A6XX_CP_RB_RPTR 0x00000806 | 1095 | #define REG_A6XX_CP_RB_RPTR 0x00000806 |
| 1072 | 1096 | ||
| @@ -1083,26 +1107,28 @@ enum a6xx_tex_type { · 10 unmodified lines | |||
| 1083 | 1107 | ||
| 1084 | #define REG_A6XX_CP_PROTECT_STATUS 0x00000824 | 1108 | #define REG_A6XX_CP_PROTECT_STATUS 0x00000824 |
| 1085 | 1109 | ||
| 1110 | #define REG_A6XX_CP_STATUS_1 0x00000825 | ||
| 1111 | |||
| 1086 | #define REG_A6XX_CP_SQE_INSTR_BASE 0x00000830 | 1112 | #define REG_A6XX_CP_SQE_INSTR_BASE 0x00000830 |
| 1087 | 1113 | ||
| 1088 | #define REG_A6XX_CP_MISC_CNTL 0x00000840 | 1114 | #define REG_A6XX_CP_MISC_CNTL 0x00000840 |
| 1089 | 1115 | ||
| 1090 | #define REG_A6XX_CP_CHICKEN_DBG 0x00000841 | ||
| 1091 | |||
| 1092 | #define REG_A6XX_CP_APRIV_CNTL 0x00000844 | 1116 | #define REG_A6XX_CP_APRIV_CNTL 0x00000844 |
| 1093 | 1117 | ||
| 1118 | #define REG_A6XX_CP_PREEMPT_THRESHOLD 0x000008c0 | ||
| 1119 | |||
| 1094 | #define REG_A6XX_CP_ROQ_THRESHOLDS_1 0x000008c1 | 1120 | #define REG_A6XX_CP_ROQ_THRESHOLDS_1 0x000008c1 |
| 1095 | #define A6XX_CP_ROQ_THRESHOLDS_1_RB_LO__MASK 0x000000ff | 1121 | #define A6XX_CP_ROQ_THRESHOLDS_1_MRB_START__MASK 0x000000ff |
| 1096 | #define A6XX_CP_ROQ_THRESHOLDS_1_RB_LO__SHIFT 0 | 1122 | #define A6XX_CP_ROQ_THRESHOLDS_1_MRB_START__SHIFT 0 |
| 1097 | static inline uint32_t A6XX_CP_ROQ_THRESHOLDS_1_RB_LO(uint32_t val) | 1123 | static inline uint32_t A6XX_CP_ROQ_THRESHOLDS_1_MRB_START(uint32_t val) |
| 1098 | { | 1124 | { |
| 1099 | return ((val >> 2) << A6XX_CP_ROQ_THRESHOLDS_1_RB_LO__SHIFT) & A6XX_CP_ROQ_THRESHOLDS_1_RB_LO__MASK; | 1125 | return ((val >> 2) << A6XX_CP_ROQ_THRESHOLDS_1_MRB_START__SHIFT) & A6XX_CP_ROQ_THRESHOLDS_1_MRB_START__MASK; |
| 1100 | } | 1126 | } |
| 1101 | #define A6XX_CP_ROQ_THRESHOLDS_1_RB_HI__MASK 0x0000ff00 | 1127 | #define A6XX_CP_ROQ_THRESHOLDS_1_VSD_START__MASK 0x0000ff00 |
| 1102 | #define A6XX_CP_ROQ_THRESHOLDS_1_RB_HI__SHIFT 8 | 1128 | #define A6XX_CP_ROQ_THRESHOLDS_1_VSD_START__SHIFT 8 |
| 1103 | static inline uint32_t A6XX_CP_ROQ_THRESHOLDS_1_RB_HI(uint32_t val) | 1129 | static inline uint32_t A6XX_CP_ROQ_THRESHOLDS_1_VSD_START(uint32_t val) |
| 1104 | { | 1130 | { |
| 1105 | return ((val >> 2) << A6XX_CP_ROQ_THRESHOLDS_1_RB_HI__SHIFT) & A6XX_CP_ROQ_THRESHOLDS_1_RB_HI__MASK; | 1131 | return ((val >> 2) << A6XX_CP_ROQ_THRESHOLDS_1_VSD_START__SHIFT) & A6XX_CP_ROQ_THRESHOLDS_1_VSD_START__MASK; |
| 1106 | } | 1132 | } |
| 1107 | #define A6XX_CP_ROQ_THRESHOLDS_1_IB1_START__MASK 0x00ff0000 | 1133 | #define A6XX_CP_ROQ_THRESHOLDS_1_IB1_START__MASK 0x00ff0000 |
| 1108 | #define A6XX_CP_ROQ_THRESHOLDS_1_IB1_START__SHIFT 16 | 1134 | #define A6XX_CP_ROQ_THRESHOLDS_1_IB1_START__SHIFT 16 |
| @@ -1164,27 +1190,21 @@ static inline uint32_t A6XX_CP_PROTECT_REG_MASK_LEN(uint32_t val) · 55 unmodified lines | |||
| 1164 | 1190 | ||
| 1165 | #define REG_A6XX_CP_CONTEXT_SWITCH_CNTL 0x000008a0 | 1191 | #define REG_A6XX_CP_CONTEXT_SWITCH_CNTL 0x000008a0 |
| 1166 | 1192 | ||
| 1167 | #define REG_A6XX_CP_CONTEXT_SWITCH_SMMU_INFO_LO 0x000008a1 | 1193 | #define REG_A6XX_CP_CONTEXT_SWITCH_SMMU_INFO 0x000008a1 |
| 1168 | |||
| 1169 | #define REG_A6XX_CP_CONTEXT_SWITCH_SMMU_INFO_HI 0x000008a2 | ||
| 1170 | 1194 | ||
| 1171 | #define REG_A6XX_CP_CONTEXT_SWITCH_PRIV_NON_SECURE_RESTORE_ADDR_LO 0x000008a3 | 1195 | #define REG_A6XX_CP_CONTEXT_SWITCH_PRIV_NON_SECURE_RESTORE_ADDR 0x000008a3 |
| 1172 | 1196 | ||
| 1173 | #define REG_A6XX_CP_CONTEXT_SWITCH_PRIV_NON_SECURE_RESTORE_ADDR_HI 0x000008a4 | 1197 | #define REG_A6XX_CP_CONTEXT_SWITCH_PRIV_SECURE_RESTORE_ADDR 0x000008a5 |
| 1174 | 1198 | ||
| 1175 | #define REG_A6XX_CP_CONTEXT_SWITCH_PRIV_SECURE_RESTORE_ADDR_LO 0x000008a5 | 1199 | #define REG_A6XX_CP_CONTEXT_SWITCH_NON_PRIV_RESTORE_ADDR 0x000008a7 |
| 1176 | 1200 | ||
| 1177 | #define REG_A6XX_CP_CONTEXT_SWITCH_PRIV_SECURE_RESTORE_ADDR_HI 0x000008a6 | 1201 | #define REG_A7XX_CP_CONTEXT_SWITCH_LEVEL_STATUS 0x000008ab |
| 1178 | |||
| 1179 | #define REG_A6XX_CP_CONTEXT_SWITCH_NON_PRIV_RESTORE_ADDR_LO 0x000008a7 | ||
| 1180 | |||
| 1181 | #define REG_A6XX_CP_CONTEXT_SWITCH_NON_PRIV_RESTORE_ADDR_HI 0x000008a8 | ||
| 1182 | 1202 | ||
| 1183 | static inline uint32_t REG_A6XX_CP_PERFCTR_CP_SEL(uint32_t i0) { return 0x000008d0 + 0x1*i0; } | 1203 | static inline uint32_t REG_A6XX_CP_PERFCTR_CP_SEL(uint32_t i0) { return 0x000008d0 + 0x1*i0; } |
| 1184 | 1204 | ||
| 1185 | #define REG_A6XX_CP_CRASH_SCRIPT_BASE_LO 0x00000900 | 1205 | static inline uint32_t REG_A7XX_CP_BV_PERFCTR_CP_SEL(uint32_t i0) { return 0x000008e0 + 0x1*i0; } |
| 1186 | 1206 | ||
| 1187 | #define REG_A6XX_CP_CRASH_SCRIPT_BASE_HI 0x00000901 | 1207 | #define REG_A6XX_CP_CRASH_SCRIPT_BASE 0x00000900 |
| 1188 | 1208 | ||
| 1189 | #define REG_A6XX_CP_CRASH_DUMP_CNTL 0x00000902 | 1209 | #define REG_A6XX_CP_CRASH_DUMP_CNTL 0x00000902 |
| 1190 | 1210 | ||
| @@ -1212,63 +1232,165 @@ static inline uint32_t REG_A6XX_CP_PERFCTR_CP_SEL(uint32_t i0) { return 0x000008 · 21 unmodified lines | |||
| 1212 | 1232 | ||
| 1213 | #define REG_A6XX_CP_IB1_BASE 0x00000928 | 1233 | #define REG_A6XX_CP_IB1_BASE 0x00000928 |
| 1214 | 1234 | ||
| 1215 | #define REG_A6XX_CP_IB1_BASE_HI 0x00000929 | ||
| 1216 | |||
| 1217 | #define REG_A6XX_CP_IB1_REM_SIZE 0x0000092a | 1235 | #define REG_A6XX_CP_IB1_REM_SIZE 0x0000092a |
| 1218 | 1236 | ||
| 1219 | #define REG_A6XX_CP_IB2_BASE 0x0000092b | 1237 | #define REG_A6XX_CP_IB2_BASE 0x0000092b |
| 1220 | 1238 | ||
| 1221 | #define REG_A6XX_CP_IB2_BASE_HI 0x0000092c | ||
| 1222 | |||
| 1223 | #define REG_A6XX_CP_IB2_REM_SIZE 0x0000092d | 1239 | #define REG_A6XX_CP_IB2_REM_SIZE 0x0000092d |
| 1224 | 1240 | ||
| 1225 | #define REG_A6XX_CP_SDS_BASE 0x0000092e | 1241 | #define REG_A6XX_CP_SDS_BASE 0x0000092e |
| 1226 | 1242 | ||
| 1227 | #define REG_A6XX_CP_SDS_BASE_HI 0x0000092f | ||
| 1228 | |||
| 1229 | #define REG_A6XX_CP_SDS_REM_SIZE 0x00000930 | 1243 | #define REG_A6XX_CP_SDS_REM_SIZE 0x00000930 |
| 1230 | 1244 | ||
| 1231 | #define REG_A6XX_CP_MRB_BASE 0x00000931 | 1245 | #define REG_A6XX_CP_MRB_BASE 0x00000931 |
| 1232 | 1246 | ||
| 1233 | #define REG_A6XX_CP_MRB_BASE_HI 0x00000932 | ||
| 1234 | |||
| 1235 | #define REG_A6XX_CP_MRB_REM_SIZE 0x00000933 | 1247 | #define REG_A6XX_CP_MRB_REM_SIZE 0x00000933 |
| 1236 | 1248 | ||
| 1237 | #define REG_A6XX_CP_VSD_BASE 0x00000934 | 1249 | #define REG_A6XX_CP_VSD_BASE 0x00000934 |
| 1238 | 1250 | ||
| 1239 | #define REG_A6XX_CP_VSD_BASE_HI 0x00000935 | 1251 | #define REG_A6XX_CP_ROQ_RB_STAT 0x00000939 |
| 1252 | #define A6XX_CP_ROQ_RB_STAT_RPTR__MASK 0x000003ff | ||
| 1253 | #define A6XX_CP_ROQ_RB_STAT_RPTR__SHIFT 0 | ||
| 1254 | static inline uint32_t A6XX_CP_ROQ_RB_STAT_RPTR(uint32_t val) | ||
| 1255 | { | ||
| 1256 | return ((val) << A6XX_CP_ROQ_RB_STAT_RPTR__SHIFT) & A6XX_CP_ROQ_RB_STAT_RPTR__MASK; | ||
| 1257 | } | ||
| 1258 | #define A6XX_CP_ROQ_RB_STAT_WPTR__MASK 0x03ff0000 | ||
| 1259 | #define A6XX_CP_ROQ_RB_STAT_WPTR__SHIFT 16 | ||
| 1260 | static inline uint32_t A6XX_CP_ROQ_RB_STAT_WPTR(uint32_t val) | ||
| 1261 | { | ||
| 1262 | return ((val) << A6XX_CP_ROQ_RB_STAT_WPTR__SHIFT) & A6XX_CP_ROQ_RB_STAT_WPTR__MASK; | ||
| 1263 | } | ||
| 1264 | |||
| 1265 | #define REG_A6XX_CP_ROQ_IB1_STAT 0x0000093a | ||
| 1266 | #define A6XX_CP_ROQ_IB1_STAT_RPTR__MASK 0x000003ff | ||
| 1267 | #define A6XX_CP_ROQ_IB1_STAT_RPTR__SHIFT 0 | ||
| 1268 | static inline uint32_t A6XX_CP_ROQ_IB1_STAT_RPTR(uint32_t val) | ||
| 1269 | { | ||
| 1270 | return ((val) << A6XX_CP_ROQ_IB1_STAT_RPTR__SHIFT) & A6XX_CP_ROQ_IB1_STAT_RPTR__MASK; | ||
| 1271 | } | ||
| 1272 | #define A6XX_CP_ROQ_IB1_STAT_WPTR__MASK 0x03ff0000 | ||
| 1273 | #define A6XX_CP_ROQ_IB1_STAT_WPTR__SHIFT 16 | ||
| 1274 | static inline uint32_t A6XX_CP_ROQ_IB1_STAT_WPTR(uint32_t val) | ||
| 1275 | { | ||
| 1276 | return ((val) << A6XX_CP_ROQ_IB1_STAT_WPTR__SHIFT) & A6XX_CP_ROQ_IB1_STAT_WPTR__MASK; | ||
| 1277 | } | ||
| 1278 | |||
| 1279 | #define REG_A6XX_CP_ROQ_IB2_STAT 0x0000093b | ||
| 1280 | #define A6XX_CP_ROQ_IB2_STAT_RPTR__MASK 0x000003ff | ||
| 1281 | #define A6XX_CP_ROQ_IB2_STAT_RPTR__SHIFT 0 | ||
| 1282 | static inline uint32_t A6XX_CP_ROQ_IB2_STAT_RPTR(uint32_t val) | ||
| 1283 | { | ||
| 1284 | return ((val) << A6XX_CP_ROQ_IB2_STAT_RPTR__SHIFT) & A6XX_CP_ROQ_IB2_STAT_RPTR__MASK; | ||
| 1285 | } | ||
| 1286 | #define A6XX_CP_ROQ_IB2_STAT_WPTR__MASK 0x03ff0000 | ||
| 1287 | #define A6XX_CP_ROQ_IB2_STAT_WPTR__SHIFT 16 | ||
| 1288 | static inline uint32_t A6XX_CP_ROQ_IB2_STAT_WPTR(uint32_t val) | ||
| 1289 | { | ||
| 1290 | return ((val) << A6XX_CP_ROQ_IB2_STAT_WPTR__SHIFT) & A6XX_CP_ROQ_IB2_STAT_WPTR__MASK; | ||
| 1291 | } | ||
| 1292 | |||
| 1293 | #define REG_A6XX_CP_ROQ_SDS_STAT 0x0000093c | ||
| 1294 | #define A6XX_CP_ROQ_SDS_STAT_RPTR__MASK 0x000003ff | ||
| 1295 | #define A6XX_CP_ROQ_SDS_STAT_RPTR__SHIFT 0 | ||
| 1296 | static inline uint32_t A6XX_CP_ROQ_SDS_STAT_RPTR(uint32_t val) | ||
| 1297 | { | ||
| 1298 | return ((val) << A6XX_CP_ROQ_SDS_STAT_RPTR__SHIFT) & A6XX_CP_ROQ_SDS_STAT_RPTR__MASK; | ||
| 1299 | } | ||
| 1300 | #define A6XX_CP_ROQ_SDS_STAT_WPTR__MASK 0x03ff0000 | ||
| 1301 | #define A6XX_CP_ROQ_SDS_STAT_WPTR__SHIFT 16 | ||
| 1302 | static inline uint32_t A6XX_CP_ROQ_SDS_STAT_WPTR(uint32_t val) | ||
| 1303 | { | ||
| 1304 | return ((val) << A6XX_CP_ROQ_SDS_STAT_WPTR__SHIFT) & A6XX_CP_ROQ_SDS_STAT_WPTR__MASK; | ||
| 1305 | } | ||
| 1306 | |||
| 1307 | #define REG_A6XX_CP_ROQ_MRB_STAT 0x0000093d | ||
| 1308 | #define A6XX_CP_ROQ_MRB_STAT_RPTR__MASK 0x000003ff | ||
| 1309 | #define A6XX_CP_ROQ_MRB_STAT_RPTR__SHIFT 0 | ||
| 1310 | static inline uint32_t A6XX_CP_ROQ_MRB_STAT_RPTR(uint32_t val) | ||
| 1311 | { | ||
| 1312 | return ((val) << A6XX_CP_ROQ_MRB_STAT_RPTR__SHIFT) & A6XX_CP_ROQ_MRB_STAT_RPTR__MASK; | ||
| 1313 | } | ||
| 1314 | #define A6XX_CP_ROQ_MRB_STAT_WPTR__MASK 0x03ff0000 | ||
| 1315 | #define A6XX_CP_ROQ_MRB_STAT_WPTR__SHIFT 16 | ||
| 1316 | static inline uint32_t A6XX_CP_ROQ_MRB_STAT_WPTR(uint32_t val) | ||
| 1317 | { | ||
| 1318 | return ((val) << A6XX_CP_ROQ_MRB_STAT_WPTR__SHIFT) & A6XX_CP_ROQ_MRB_STAT_WPTR__MASK; | ||
| 1319 | } | ||
| 1320 | |||
| 1321 | #define REG_A6XX_CP_ROQ_VSD_STAT 0x0000093e | ||
| 1322 | #define A6XX_CP_ROQ_VSD_STAT_RPTR__MASK 0x000003ff | ||
| 1323 | #define A6XX_CP_ROQ_VSD_STAT_RPTR__SHIFT 0 | ||
| 1324 | static inline uint32_t A6XX_CP_ROQ_VSD_STAT_RPTR(uint32_t val) | ||
| 1325 | { | ||
| 1326 | return ((val) << A6XX_CP_ROQ_VSD_STAT_RPTR__SHIFT) & A6XX_CP_ROQ_VSD_STAT_RPTR__MASK; | ||
| 1327 | } | ||
| 1328 | #define A6XX_CP_ROQ_VSD_STAT_WPTR__MASK 0x03ff0000 | ||
| 1329 | #define A6XX_CP_ROQ_VSD_STAT_WPTR__SHIFT 16 | ||
| 1330 | static inline uint32_t A6XX_CP_ROQ_VSD_STAT_WPTR(uint32_t val) | ||
| 1331 | { | ||
| 1332 | return ((val) << A6XX_CP_ROQ_VSD_STAT_WPTR__SHIFT) & A6XX_CP_ROQ_VSD_STAT_WPTR__MASK; | ||
| 1333 | } | ||
| 1334 | |||
| 1335 | #define REG_A6XX_CP_IB1_DWORDS 0x00000943 | ||
| 1336 | |||
| 1337 | #define REG_A6XX_CP_IB2_DWORDS 0x00000944 | ||
| 1338 | |||
| 1339 | #define REG_A6XX_CP_SDS_DWORDS 0x00000945 | ||
| 1240 | 1340 | ||
| 1241 | #define REG_A6XX_CP_MRB_DWORDS 0x00000946 | 1341 | #define REG_A6XX_CP_MRB_DWORDS 0x00000946 |
| 1242 | 1342 | ||
| 1243 | #define REG_A6XX_CP_VSD_DWORDS 0x00000947 | 1343 | #define REG_A6XX_CP_VSD_DWORDS 0x00000947 |
| 1244 | 1344 | ||
| 1245 | #define REG_A6XX_CP_CSQ_IB1_STAT 0x00000949 | 1345 | #define REG_A6XX_CP_ROQ_AVAIL_RB 0x00000948 |
| 1246 | #define A6XX_CP_CSQ_IB1_STAT_REM__MASK 0xffff0000 | 1346 | #define A6XX_CP_ROQ_AVAIL_RB_REM__MASK 0xffff0000 |
| 1247 | #define A6XX_CP_CSQ_IB1_STAT_REM__SHIFT 16 | 1347 | #define A6XX_CP_ROQ_AVAIL_RB_REM__SHIFT 16 |
| 1248 | static inline uint32_t A6XX_CP_CSQ_IB1_STAT_REM(uint32_t val) | 1348 | static inline uint32_t A6XX_CP_ROQ_AVAIL_RB_REM(uint32_t val) |
| 1249 | { | 1349 | { |
| 1250 | return ((val) << A6XX_CP_CSQ_IB1_STAT_REM__SHIFT) & A6XX_CP_CSQ_IB1_STAT_REM__MASK; | 1350 | return ((val) << A6XX_CP_ROQ_AVAIL_RB_REM__SHIFT) & A6XX_CP_ROQ_AVAIL_RB_REM__MASK; |
| 1251 | } | 1351 | } |
| 1252 | 1352 | ||
| 1253 | #define REG_A6XX_CP_CSQ_IB2_STAT 0x0000094a | 1353 | #define REG_A6XX_CP_ROQ_AVAIL_IB1 0x00000949 |
| 1254 | #define A6XX_CP_CSQ_IB2_STAT_REM__MASK 0xffff0000 | 1354 | #define A6XX_CP_ROQ_AVAIL_IB1_REM__MASK 0xffff0000 |
| 1255 | #define A6XX_CP_CSQ_IB2_STAT_REM__SHIFT 16 | 1355 | #define A6XX_CP_ROQ_AVAIL_IB1_REM__SHIFT 16 |
| 1256 | static inline uint32_t A6XX_CP_CSQ_IB2_STAT_REM(uint32_t val) | 1356 | static inline uint32_t A6XX_CP_ROQ_AVAIL_IB1_REM(uint32_t val) |
| 1257 | { | 1357 | { |
| 1258 | return ((val) << A6XX_CP_CSQ_IB2_STAT_REM__SHIFT) & A6XX_CP_CSQ_IB2_STAT_REM__MASK; | 1358 | return ((val) << A6XX_CP_ROQ_AVAIL_IB1_REM__SHIFT) & A6XX_CP_ROQ_AVAIL_IB1_REM__MASK; |
| 1259 | } | 1359 | } |
| 1260 | 1360 | ||
| 1261 | #define REG_A6XX_CP_MRQ_MRB_STAT 0x0000094c | 1361 | #define REG_A6XX_CP_ROQ_AVAIL_IB2 0x0000094a |
| 1262 | #define A6XX_CP_MRQ_MRB_STAT_REM__MASK 0xffff0000 | 1362 | #define A6XX_CP_ROQ_AVAIL_IB2_REM__MASK 0xffff0000 |
| 1263 | #define A6XX_CP_MRQ_MRB_STAT_REM__SHIFT 16 | 1363 | #define A6XX_CP_ROQ_AVAIL_IB2_REM__SHIFT 16 |
| 1264 | static inline uint32_t A6XX_CP_MRQ_MRB_STAT_REM(uint32_t val) | 1364 | static inline uint32_t A6XX_CP_ROQ_AVAIL_IB2_REM(uint32_t val) |
| 1265 | { | 1365 | { |
| 1266 | return ((val) << A6XX_CP_MRQ_MRB_STAT_REM__SHIFT) & A6XX_CP_MRQ_MRB_STAT_REM__MASK; | 1366 | return ((val) << A6XX_CP_ROQ_AVAIL_IB2_REM__SHIFT) & A6XX_CP_ROQ_AVAIL_IB2_REM__MASK; |
| 1267 | } | 1367 | } |
| 1268 | 1368 | ||
| 1269 | #define REG_A6XX_CP_ALWAYS_ON_COUNTER_LO 0x00000980 | 1369 | #define REG_A6XX_CP_ROQ_AVAIL_SDS 0x0000094b |
| 1370 | #define A6XX_CP_ROQ_AVAIL_SDS_REM__MASK 0xffff0000 | ||
| 1371 | #define A6XX_CP_ROQ_AVAIL_SDS_REM__SHIFT 16 | ||
| 1372 | static inline uint32_t A6XX_CP_ROQ_AVAIL_SDS_REM(uint32_t val) | ||
| 1373 | { | ||
| 1374 | return ((val) << A6XX_CP_ROQ_AVAIL_SDS_REM__SHIFT) & A6XX_CP_ROQ_AVAIL_SDS_REM__MASK; | ||
| 1375 | } | ||
| 1270 | 1376 | ||
| 1271 | #define REG_A6XX_CP_ALWAYS_ON_COUNTER_HI 0x00000981 | 1377 | #define REG_A6XX_CP_ROQ_AVAIL_MRB 0x0000094c |
| 1378 | #define A6XX_CP_ROQ_AVAIL_MRB_REM__MASK 0xffff0000 | ||
| 1379 | #define A6XX_CP_ROQ_AVAIL_MRB_REM__SHIFT 16 | ||
| 1380 | static inline uint32_t A6XX_CP_ROQ_AVAIL_MRB_REM(uint32_t val) | ||
| 1381 | { | ||
| 1382 | return ((val) << A6XX_CP_ROQ_AVAIL_MRB_REM__SHIFT) & A6XX_CP_ROQ_AVAIL_MRB_REM__MASK; | ||
| 1383 | } | ||
| 1384 | |||
| 1385 | #define REG_A6XX_CP_ROQ_AVAIL_VSD 0x0000094d | ||
| 1386 | #define A6XX_CP_ROQ_AVAIL_VSD_REM__MASK 0xffff0000 | ||
| 1387 | #define A6XX_CP_ROQ_AVAIL_VSD_REM__SHIFT 16 | ||
| 1388 | static inline uint32_t A6XX_CP_ROQ_AVAIL_VSD_REM(uint32_t val) | ||
| 1389 | { | ||
| 1390 | return ((val) << A6XX_CP_ROQ_AVAIL_VSD_REM__SHIFT) & A6XX_CP_ROQ_AVAIL_VSD_REM__MASK; | ||
| 1391 | } | ||
| 1392 | |||
| 1393 | #define REG_A6XX_CP_ALWAYS_ON_COUNTER 0x00000980 | ||
| 1272 | 1394 | ||
| 1273 | #define REG_A6XX_CP_AHB_CNTL 0x0000098d | 1395 | #define REG_A6XX_CP_AHB_CNTL 0x0000098d |
| 1274 | 1396 | ||
| @@ -1276,12 +1398,70 @@ static inline uint32_t A6XX_CP_MRQ_MRB_STAT_REM(uint32_t val) · 1 unmodified line | |||
| 1276 | 1398 | ||
| 1277 | #define REG_A6XX_CP_APERTURE_CNTL_CD 0x00000a03 | 1399 | #define REG_A6XX_CP_APERTURE_CNTL_CD 0x00000a03 |
| 1278 | 1400 | ||
| 1401 | #define REG_A7XX_CP_BV_PROTECT_STATUS 0x00000a61 | ||
| 1402 | |||
| 1403 | #define REG_A7XX_CP_BV_HW_FAULT 0x00000a64 | ||
| 1404 | |||
| 1405 | #define REG_A7XX_CP_BV_DRAW_STATE_ADDR 0x00000a81 | ||
| 1406 | |||
| 1407 | #define REG_A7XX_CP_BV_DRAW_STATE_DATA 0x00000a82 | ||
| 1408 | |||
| 1409 | #define REG_A7XX_CP_BV_ROQ_DBG_ADDR 0x00000a83 | ||
| 1410 | |||
| 1411 | #define REG_A7XX_CP_BV_ROQ_DBG_DATA 0x00000a84 | ||
| 1412 | |||
| 1413 | #define REG_A7XX_CP_BV_SQE_UCODE_DBG_ADDR 0x00000a85 | ||
| 1414 | |||
| 1415 | #define REG_A7XX_CP_BV_SQE_UCODE_DBG_DATA 0x00000a86 | ||
| 1416 | |||
| 1417 | #define REG_A7XX_CP_BV_SQE_STAT_ADDR 0x00000a87 | ||
| 1418 | |||
| 1419 | #define REG_A7XX_CP_BV_SQE_STAT_DATA 0x00000a88 | ||
| 1420 | |||
| 1421 | #define REG_A7XX_CP_BV_MEM_POOL_DBG_ADDR 0x00000a96 | ||
| 1422 | |||
| 1423 | #define REG_A7XX_CP_BV_MEM_POOL_DBG_DATA 0x00000a97 | ||
| 1424 | |||
| 1425 | #define REG_A7XX_CP_BV_RB_RPTR_ADDR 0x00000a98 | ||
| 1426 | |||
| 1427 | #define REG_A7XX_CP_RESOURCE_TBL_DBG_ADDR 0x00000a9a | ||
| 1428 | |||
| 1429 | #define REG_A7XX_CP_RESOURCE_TBL_DBG_DATA 0x00000a9b | ||
| 1430 | |||
| 1431 | #define REG_A7XX_CP_BV_APRIV_CNTL 0x00000ad0 | ||
| 1432 | |||
| 1433 | #define REG_A7XX_CP_BV_CHICKEN_DBG 0x00000ada | ||
| 1434 | |||
| 1435 | #define REG_A7XX_CP_LPAC_DRAW_STATE_ADDR 0x00000b0a | ||
| 1436 | |||
| 1437 | #define REG_A7XX_CP_LPAC_DRAW_STATE_DATA 0x00000b0b | ||
| 1438 | |||
| 1439 | #define REG_A7XX_CP_LPAC_ROQ_DBG_ADDR 0x00000b0c | ||
| 1440 | |||
| 1441 | #define REG_A7XX_CP_SQE_AC_UCODE_DBG_ADDR 0x00000b27 | ||
| 1442 | |||
| 1443 | #define REG_A7XX_CP_SQE_AC_UCODE_DBG_DATA 0x00000b28 | ||
| 1444 | |||
| 1445 | #define REG_A7XX_CP_SQE_AC_STAT_ADDR 0x00000b29 | ||
| 1446 | |||
| 1447 | #define REG_A7XX_CP_SQE_AC_STAT_DATA 0x00000b2a | ||
| 1448 | |||
| 1449 | #define REG_A7XX_CP_LPAC_APRIV_CNTL 0x00000b31 | ||
| 1450 | |||
| 1279 | #define REG_A6XX_CP_LPAC_PROG_FIFO_SIZE 0x00000b34 | 1451 | #define REG_A6XX_CP_LPAC_PROG_FIFO_SIZE 0x00000b34 |
| 1280 | 1452 | ||
| 1453 | #define REG_A7XX_CP_LPAC_ROQ_DBG_DATA 0x00000b35 | ||
| 1454 | |||
| 1455 | #define REG_A7XX_CP_LPAC_FIFO_DBG_DATA 0x00000b36 | ||
| 1456 | |||
| 1457 | #define REG_A7XX_CP_LPAC_FIFO_DBG_ADDR 0x00000b40 | ||
| 1458 | |||
| 1281 | #define REG_A6XX_CP_LPAC_SQE_INSTR_BASE 0x00000b82 | 1459 | #define REG_A6XX_CP_LPAC_SQE_INSTR_BASE 0x00000b82 |
| 1282 | 1460 | ||
| 1283 | #define REG_A6XX_VSC_ADDR_MODE_CNTL 0x00000c01 | 1461 | #define REG_A6XX_VSC_ADDR_MODE_CNTL 0x00000c01 |
| 1284 | 1462 | ||
| 1463 | #define REG_A6XX_RBBM_GPR0_CNTL 0x00000018 | ||
| 1464 | |||
| 1285 | #define REG_A6XX_RBBM_INT_0_STATUS 0x00000201 | 1465 | #define REG_A6XX_RBBM_INT_0_STATUS 0x00000201 |
| 1286 | 1466 | ||
| 1287 | #define REG_A6XX_RBBM_STATUS 0x00000210 | 1467 | #define REG_A6XX_RBBM_STATUS 0x00000210 |
| @@ -1310,11 +1490,27 @@ static inline uint32_t A6XX_CP_MRQ_MRB_STAT_REM(uint32_t val) · 22 unmodified lines | |||
| 1310 | #define A6XX_RBBM_STATUS_CP_AHB_BUSY_CP_MASTER 0x00000002 | 1490 | #define A6XX_RBBM_STATUS_CP_AHB_BUSY_CP_MASTER 0x00000002 |
| 1311 | #define A6XX_RBBM_STATUS_CP_AHB_BUSY_CX_MASTER 0x00000001 | 1491 | #define A6XX_RBBM_STATUS_CP_AHB_BUSY_CX_MASTER 0x00000001 |
| 1312 | 1492 | ||
| 1493 | #define REG_A6XX_RBBM_STATUS1 0x00000211 | ||
| 1494 | |||
| 1495 | #define REG_A6XX_RBBM_STATUS2 0x00000212 | ||
| 1496 | |||
| 1313 | #define REG_A6XX_RBBM_STATUS3 0x00000213 | 1497 | #define REG_A6XX_RBBM_STATUS3 0x00000213 |
| 1314 | #define A6XX_RBBM_STATUS3_SMMU_STALLED_ON_FAULT 0x01000000 | 1498 | #define A6XX_RBBM_STATUS3_SMMU_STALLED_ON_FAULT 0x01000000 |
| 1315 | 1499 | ||
| 1316 | #define REG_A6XX_RBBM_VBIF_GX_RESET_STATUS 0x00000215 | 1500 | #define REG_A6XX_RBBM_VBIF_GX_RESET_STATUS 0x00000215 |
| 1317 | 1501 | ||
| 1502 | #define REG_A7XX_RBBM_CLOCK_MODE_CP 0x00000260 | ||
| 1503 | |||
| 1504 | #define REG_A7XX_RBBM_CLOCK_MODE_BV_LRZ 0x00000284 | ||
| 1505 | |||
| 1506 | #define REG_A7XX_RBBM_CLOCK_MODE_BV_GRAS 0x00000285 | ||
| 1507 | |||
| 1508 | #define REG_A7XX_RBBM_CLOCK_MODE2_GRAS 0x00000286 | ||
| 1509 | |||
| 1510 | #define REG_A7XX_RBBM_CLOCK_MODE_BV_VFD 0x00000287 | ||
| 1511 | |||
| 1512 | #define REG_A7XX_RBBM_CLOCK_MODE_BV_GPC 0x00000288 | ||
| 1513 | |||
| 1318 | static inline uint32_t REG_A6XX_RBBM_PERFCTR_CP(uint32_t i0) { return 0x00000400 + 0x2*i0; } | 1514 | static inline uint32_t REG_A6XX_RBBM_PERFCTR_CP(uint32_t i0) { return 0x00000400 + 0x2*i0; } |
| 1319 | 1515 | ||
| 1320 | static inline uint32_t REG_A6XX_RBBM_PERFCTR_RBBM(uint32_t i0) { return 0x0000041c + 0x2*i0; } | 1516 | static inline uint32_t REG_A6XX_RBBM_PERFCTR_RBBM(uint32_t i0) { return 0x0000041c + 0x2*i0; } |
| @@ -1347,6 +1543,62 @@ static inline uint32_t REG_A6XX_RBBM_PERFCTR_LRZ(uint32_t i0) { return 0x000004e · 26 unmodified lines | |||
| 1347 | 1543 | ||
| 1348 | static inline uint32_t REG_A6XX_RBBM_PERFCTR_CMP(uint32_t i0) { return 0x000004f2 + 0x2*i0; } | 1544 | static inline uint32_t REG_A6XX_RBBM_PERFCTR_CMP(uint32_t i0) { return 0x000004f2 + 0x2*i0; } |
| 1349 | 1545 | ||
| 1546 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_CP(uint32_t i0) { return 0x00000300 + 0x2*i0; } | ||
| 1547 | |||
| 1548 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_RBBM(uint32_t i0) { return 0x0000031c + 0x2*i0; } | ||
| 1549 | |||
| 1550 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_PC(uint32_t i0) { return 0x00000324 + 0x2*i0; } | ||
| 1551 | |||
| 1552 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_VFD(uint32_t i0) { return 0x00000334 + 0x2*i0; } | ||
| 1553 | |||
| 1554 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_HLSQ(uint32_t i0) { return 0x00000344 + 0x2*i0; } | ||
| 1555 | |||
| 1556 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_VPC(uint32_t i0) { return 0x00000350 + 0x2*i0; } | ||
| 1557 | |||
| 1558 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_CCU(uint32_t i0) { return 0x0000035c + 0x2*i0; } | ||
| 1559 | |||
| 1560 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_TSE(uint32_t i0) { return 0x00000366 + 0x2*i0; } | ||
| 1561 | |||
| 1562 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_RAS(uint32_t i0) { return 0x0000036e + 0x2*i0; } | ||
| 1563 | |||
| 1564 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_UCHE(uint32_t i0) { return 0x00000376 + 0x2*i0; } | ||
| 1565 | |||
| 1566 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_TP(uint32_t i0) { return 0x0000038e + 0x2*i0; } | ||
| 1567 | |||
| 1568 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_SP(uint32_t i0) { return 0x000003a6 + 0x2*i0; } | ||
| 1569 | |||
| 1570 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_RB(uint32_t i0) { return 0x000003d6 + 0x2*i0; } | ||
| 1571 | |||
| 1572 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_VSC(uint32_t i0) { return 0x000003e6 + 0x2*i0; } | ||
| 1573 | |||
| 1574 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_LRZ(uint32_t i0) { return 0x000003ea + 0x2*i0; } | ||
| 1575 | |||
| 1576 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_CMP(uint32_t i0) { return 0x000003f2 + 0x2*i0; } | ||
| 1577 | |||
| 1578 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_UFC(uint32_t i0) { return 0x000003fa + 0x2*i0; } | ||
| 1579 | |||
| 1580 | static inline uint32_t REG_A7XX_RBBM_PERFCTR2_HLSQ(uint32_t i0) { return 0x00000410 + 0x2*i0; } | ||
| 1581 | |||
| 1582 | static inline uint32_t REG_A7XX_RBBM_PERFCTR2_CP(uint32_t i0) { return 0x0000041c + 0x2*i0; } | ||
| 1583 | |||
| 1584 | static inline uint32_t REG_A7XX_RBBM_PERFCTR2_SP(uint32_t i0) { return 0x0000042a + 0x2*i0; } | ||
| 1585 | |||
| 1586 | static inline uint32_t REG_A7XX_RBBM_PERFCTR2_TP(uint32_t i0) { return 0x00000442 + 0x2*i0; } | ||
| 1587 | |||
| 1588 | static inline uint32_t REG_A7XX_RBBM_PERFCTR2_UFC(uint32_t i0) { return 0x0000044e + 0x2*i0; } | ||
| 1589 | |||
| 1590 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_BV_PC(uint32_t i0) { return 0x00000460 + 0x2*i0; } | ||
| 1591 | |||
| 1592 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_BV_VFD(uint32_t i0) { return 0x00000470 + 0x2*i0; } | ||
| 1593 | |||
| 1594 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_BV_VPC(uint32_t i0) { return 0x00000480 + 0x2*i0; } | ||
| 1595 | |||
| 1596 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_BV_TSE(uint32_t i0) { return 0x0000048c + 0x2*i0; } | ||
| 1597 | |||
| 1598 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_BV_RAS(uint32_t i0) { return 0x00000494 + 0x2*i0; } | ||
| 1599 | |||
| 1600 | static inline uint32_t REG_A7XX_RBBM_PERFCTR_BV_LRZ(uint32_t i0) { return 0x0000049c + 0x2*i0; } | ||
| 1601 | |||
| 1350 | #define REG_A6XX_RBBM_PERFCTR_CNTL 0x00000500 | 1602 | #define REG_A6XX_RBBM_PERFCTR_CNTL 0x00000500 |
| 1351 | 1603 | ||
| 1352 | #define REG_A6XX_RBBM_PERFCTR_LOAD_CMD0 0x00000501 | 1604 | #define REG_A6XX_RBBM_PERFCTR_LOAD_CMD0 0x00000501 |
| @@ -1371,6 +1623,10 @@ static inline uint32_t REG_A6XX_RBBM_PERFCTR_RBBM_SEL(uint32_t i0) { return 0x00 · 18 unmodified lines | |||
| 1371 | 1623 | ||
| 1372 | #define REG_A6XX_RBBM_ISDB_CNT 0x00000533 | 1624 | #define REG_A6XX_RBBM_ISDB_CNT 0x00000533 |
| 1373 | 1625 | ||
| 1626 | #define REG_A7XX_RBBM_NC_MODE_CNTL 0x00000534 | ||
| 1627 | |||
| 1628 | #define REG_A7XX_RBBM_SNAPSHOT_STATUS 0x00000535 | ||
| 1629 | |||
| 1374 | #define REG_A6XX_RBBM_PRIMCTR_0_LO 0x00000540 | 1630 | #define REG_A6XX_RBBM_PRIMCTR_0_LO 0x00000540 |
| 1375 | 1631 | ||
| 1376 | #define REG_A6XX_RBBM_PRIMCTR_0_HI 0x00000541 | 1632 | #define REG_A6XX_RBBM_PRIMCTR_0_HI 0x00000541 |
| @@ -1417,9 +1673,7 @@ static inline uint32_t REG_A6XX_RBBM_PERFCTR_RBBM_SEL(uint32_t i0) { return 0x00 · 40 unmodified lines | |||
| 1417 | 1673 | ||
| 1418 | #define REG_A6XX_RBBM_SECVID_TRUST_CNTL 0x0000f400 | 1674 | #define REG_A6XX_RBBM_SECVID_TRUST_CNTL 0x0000f400 |
| 1419 | 1675 | ||
| 1420 | #define REG_A6XX_RBBM_SECVID_TSB_TRUSTED_BASE_LO 0x0000f800 | 1676 | #define REG_A6XX_RBBM_SECVID_TSB_TRUSTED_BASE 0x0000f800 |
| 1421 | |||
| 1422 | #define REG_A6XX_RBBM_SECVID_TSB_TRUSTED_BASE_HI 0x0000f801 | ||
| 1423 | 1677 | ||
| 1424 | #define REG_A6XX_RBBM_SECVID_TSB_TRUSTED_SIZE 0x0000f802 | 1678 | #define REG_A6XX_RBBM_SECVID_TSB_TRUSTED_SIZE 0x0000f802 |
| 1425 | 1679 | ||
| @@ -1427,6 +1681,8 @@ static inline uint32_t REG_A6XX_RBBM_PERFCTR_RBBM_SEL(uint32_t i0) { return 0x00 · 1 unmodified line | |||
| 1427 | 1681 | ||
| 1428 | #define REG_A6XX_RBBM_SECVID_TSB_ADDR_MODE_CNTL 0x0000f810 | 1682 | #define REG_A6XX_RBBM_SECVID_TSB_ADDR_MODE_CNTL 0x0000f810 |
| 1429 | 1683 | ||
| 1684 | #define REG_A7XX_RBBM_SECVID_TSB_STATUS 0x0000fc00 | ||
| 1685 | |||
| 1430 | #define REG_A6XX_RBBM_VBIF_CLIENT_QOS_CNTL 0x00000010 | 1686 | #define REG_A6XX_RBBM_VBIF_CLIENT_QOS_CNTL 0x00000010 |
| 1431 | 1687 | ||
| 1432 | #define REG_A6XX_RBBM_GBIF_CLIENT_QOS_CNTL 0x00000011 | 1688 | #define REG_A6XX_RBBM_GBIF_CLIENT_QOS_CNTL 0x00000011 |
| @@ -1438,12 +1694,18 @@ static inline uint32_t REG_A6XX_RBBM_PERFCTR_RBBM_SEL(uint32_t i0) { return 0x00 · 5 unmodified lines | |||
| 1438 | #define REG_A6XX_RBBM_WAIT_FOR_GPU_IDLE_CMD 0x0000001c | 1694 | #define REG_A6XX_RBBM_WAIT_FOR_GPU_IDLE_CMD 0x0000001c |
| 1439 | #define A6XX_RBBM_WAIT_FOR_GPU_IDLE_CMD_WAIT_GPU_IDLE 0x00000001 | 1695 | #define A6XX_RBBM_WAIT_FOR_GPU_IDLE_CMD_WAIT_GPU_IDLE 0x00000001 |
| 1440 | 1696 | ||
| 1697 | #define REG_A7XX_RBBM_GBIF_HALT 0x00000016 | ||
| 1698 | |||
| 1699 | #define REG_A7XX_RBBM_GBIF_HALT_ACK 0x00000017 | ||
| 1700 | |||
| 1441 | #define REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL 0x0000001f | 1701 | #define REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL 0x0000001f |
| 1442 | 1702 | ||
| 1443 | #define REG_A6XX_RBBM_INT_CLEAR_CMD 0x00000037 | 1703 | #define REG_A6XX_RBBM_INT_CLEAR_CMD 0x00000037 |
| 1444 | 1704 | ||
| 1445 | #define REG_A6XX_RBBM_INT_0_MASK 0x00000038 | 1705 | #define REG_A6XX_RBBM_INT_0_MASK 0x00000038 |
| 1446 | 1706 | ||
| 1707 | #define REG_A7XX_RBBM_INT_2_MASK 0x0000003a | ||
| 1708 | |||
| 1447 | #define REG_A6XX_RBBM_SP_HYST_CNT 0x00000042 | 1709 | #define REG_A6XX_RBBM_SP_HYST_CNT 0x00000042 |
| 1448 | 1710 | ||
| 1449 | #define REG_A6XX_RBBM_SW_RESET_CMD 0x00000043 | 1711 | #define REG_A6XX_RBBM_SW_RESET_CMD 0x00000043 |
| @@ -1674,6 +1936,8 @@ static inline uint32_t REG_A6XX_RBBM_PERFCTR_RBBM_SEL(uint32_t i0) { return 0x00 · 224 unmodified lines | |||
| 1674 | 1936 | ||
| 1675 | #define REG_A6XX_RBBM_CLOCK_HYST_TEX_FCHE 0x00000122 | 1937 | #define REG_A6XX_RBBM_CLOCK_HYST_TEX_FCHE 0x00000122 |
| 1676 | 1938 | ||
| 1939 | #define REG_A6XX_RBBM_LPAC_GBIF_CLIENT_QOS_CNTL 0x000005ff | ||
| 1940 | |||
| 1677 | #define REG_A6XX_DBGC_CFG_DBGBUS_SEL_A 0x00000600 | 1941 | #define REG_A6XX_DBGC_CFG_DBGBUS_SEL_A 0x00000600 |
| 1678 | 1942 | ||
| 1679 | #define REG_A6XX_DBGC_CFG_DBGBUS_SEL_B 0x00000601 | 1943 | #define REG_A6XX_DBGC_CFG_DBGBUS_SEL_B 0x00000601 |
| @@ -1852,25 +2116,15 @@ static inline uint32_t REG_A6XX_VSC_PERFCTR_VSC_SEL(uint32_t i0) { return 0x0000 · 172 unmodified lines | |||
| 1852 | 2116 | ||
| 1853 | #define REG_A6XX_UCHE_MODE_CNTL 0x00000e01 | 2117 | #define REG_A6XX_UCHE_MODE_CNTL 0x00000e01 |
| 1854 | 2118 | ||
| 1855 | #define REG_A6XX_UCHE_WRITE_RANGE_MAX_LO 0x00000e05 | 2119 | #define REG_A6XX_UCHE_WRITE_RANGE_MAX 0x00000e05 |
| 1856 | |||
| 1857 | #define REG_A6XX_UCHE_WRITE_RANGE_MAX_HI 0x00000e06 | ||
| 1858 | |||
| 1859 | #define REG_A6XX_UCHE_WRITE_THRU_BASE_LO 0x00000e07 | ||
| 1860 | 2120 | ||
| 1861 | #define REG_A6XX_UCHE_WRITE_THRU_BASE_HI 0x00000e08 | 2121 | #define REG_A6XX_UCHE_WRITE_THRU_BASE 0x00000e07 |
| 1862 | 2122 | ||
| 1863 | #define REG_A6XX_UCHE_TRAP_BASE_LO 0x00000e09 | 2123 | #define REG_A6XX_UCHE_TRAP_BASE 0x00000e09 |
| 1864 | 2124 | ||
| 1865 | #define REG_A6XX_UCHE_TRAP_BASE_HI 0x00000e0a | 2125 | #define REG_A6XX_UCHE_GMEM_RANGE_MIN 0x00000e0b |
| 1866 | 2126 | ||
| 1867 | #define REG_A6XX_UCHE_GMEM_RANGE_MIN_LO 0x00000e0b | 2127 | #define REG_A6XX_UCHE_GMEM_RANGE_MAX 0x00000e0d |
| 1868 | |||
| 1869 | #define REG_A6XX_UCHE_GMEM_RANGE_MIN_HI 0x00000e0c | ||
| 1870 | |||
| 1871 | #define REG_A6XX_UCHE_GMEM_RANGE_MAX_LO 0x00000e0d | ||
| 1872 | |||
| 1873 | #define REG_A6XX_UCHE_GMEM_RANGE_MAX_HI 0x00000e0e | ||
| 1874 | 2128 | ||
| 1875 | #define REG_A6XX_UCHE_CACHE_WAYS 0x00000e17 | 2129 | #define REG_A6XX_UCHE_CACHE_WAYS 0x00000e17 |
| 1876 | 2130 | ||
| @@ -1886,6 +2140,8 @@ static inline uint32_t A6XX_UCHE_CLIENT_PF_PERFSEL(uint32_t val) · 9 unmodified lines | |||
| 1886 | 2140 | ||
| 1887 | static inline uint32_t REG_A6XX_UCHE_PERFCTR_UCHE_SEL(uint32_t i0) { return 0x00000e1c + 0x1*i0; } | 2141 | static inline uint32_t REG_A6XX_UCHE_PERFCTR_UCHE_SEL(uint32_t i0) { return 0x00000e1c + 0x1*i0; } |
| 1888 | 2142 | ||
| 2143 | #define REG_A6XX_UCHE_GBIF_GX_CONFIG 0x00000e3a | ||
| 2144 | |||
| 1889 | #define REG_A6XX_UCHE_CMDQ_CONFIG 0x00000e3c | 2145 | #define REG_A6XX_UCHE_CMDQ_CONFIG 0x00000e3c |
| 1890 | 2146 | ||
| 1891 | #define REG_A6XX_VBIF_VERSION 0x00003000 | 2147 | #define REG_A6XX_VBIF_VERSION 0x00003000 |
| @@ -1983,6 +2239,8 @@ static inline uint32_t A6XX_VBIF_TEST_BUS2_CTRL1_DATA_SEL(uint32_t val) · 91 unmodified lines | |||
| 1983 | 2239 | ||
| 1984 | #define REG_A6XX_GBIF_PERF_PWR_CNT_EN 0x00003cc0 | 2240 | #define REG_A6XX_GBIF_PERF_PWR_CNT_EN 0x00003cc0 |
| 1985 | 2241 | ||
| 2242 | #define REG_A6XX_GBIF_PERF_PWR_CNT_CLR 0x00003cc1 | ||
| 2243 | |||
| 1986 | #define REG_A6XX_GBIF_PERF_CNT_SEL 0x00003cc2 | 2244 | #define REG_A6XX_GBIF_PERF_CNT_SEL 0x00003cc2 |
| 1987 | 2245 | ||
| 1988 | #define REG_A6XX_GBIF_PERF_PWR_CNT_SEL 0x00003cc3 | 2246 | #define REG_A6XX_GBIF_PERF_PWR_CNT_SEL 0x00003cc3 |
| @@ -2105,7 +2363,7 @@ static inline uint32_t REG_A6XX_VSC_DRAW_STRM_SIZE_REG(uint32_t i0) { return 0x0 · 116 unmodified lines | |||
| 2105 | #define A6XX_GRAS_CL_CNTL_CLIP_DISABLE 0x00000001 | 2363 | #define A6XX_GRAS_CL_CNTL_CLIP_DISABLE 0x00000001 |
| 2106 | #define A6XX_GRAS_CL_CNTL_ZNEAR_CLIP_DISABLE 0x00000002 | 2364 | #define A6XX_GRAS_CL_CNTL_ZNEAR_CLIP_DISABLE 0x00000002 |
| 2107 | #define A6XX_GRAS_CL_CNTL_ZFAR_CLIP_DISABLE 0x00000004 | 2365 | #define A6XX_GRAS_CL_CNTL_ZFAR_CLIP_DISABLE 0x00000004 |
| 2108 | #define A6XX_GRAS_CL_CNTL_UNK5 0x00000020 | 2366 | #define A6XX_GRAS_CL_CNTL_Z_CLAMP_ENABLE 0x00000020 |
| 2109 | #define A6XX_GRAS_CL_CNTL_ZERO_GB_SCALE_Z 0x00000040 | 2367 | #define A6XX_GRAS_CL_CNTL_ZERO_GB_SCALE_Z 0x00000040 |
| 2110 | #define A6XX_GRAS_CL_CNTL_VP_CLIP_CODE_IGNORE 0x00000080 | 2368 | #define A6XX_GRAS_CL_CNTL_VP_CLIP_CODE_IGNORE 0x00000080 |
| 2111 | #define A6XX_GRAS_CL_CNTL_VP_XFORM_DISABLE 0x00000100 | 2369 | #define A6XX_GRAS_CL_CNTL_VP_XFORM_DISABLE 0x00000100 |
| @@ -2420,11 +2678,12 @@ static inline uint32_t A6XX_GRAS_SC_CNTL_SEQUENCED_THREAD_DISTRIBUTION(enum a6xx · 308 unmodified lines | |||
| 2420 | { | 2678 | { |
| 2421 | return ((val) << A6XX_GRAS_SC_CNTL_SEQUENCED_THREAD_DISTRIBUTION__SHIFT) & A6XX_GRAS_SC_CNTL_SEQUENCED_THREAD_DISTRIBUTION__MASK; | 2679 | return ((val) << A6XX_GRAS_SC_CNTL_SEQUENCED_THREAD_DISTRIBUTION__SHIFT) & A6XX_GRAS_SC_CNTL_SEQUENCED_THREAD_DISTRIBUTION__MASK; |
| 2422 | } | 2680 | } |
| 2423 | #define A6XX_GRAS_SC_CNTL_UNK9__MASK 0x00000e00 | 2681 | #define A6XX_GRAS_SC_CNTL_UNK9 0x00000200 |
| 2424 | #define A6XX_GRAS_SC_CNTL_UNK9__SHIFT 9 | 2682 | #define A6XX_GRAS_SC_CNTL_ROTATION__MASK 0x00000c00 |
| 2425 | static inline uint32_t A6XX_GRAS_SC_CNTL_UNK9(uint32_t val) | 2683 | #define A6XX_GRAS_SC_CNTL_ROTATION__SHIFT 10 |
| 2684 | static inline uint32_t A6XX_GRAS_SC_CNTL_ROTATION(uint32_t val) | ||
| 2426 | { | 2685 | { |
| 2427 | return ((val) << A6XX_GRAS_SC_CNTL_UNK9__SHIFT) & A6XX_GRAS_SC_CNTL_UNK9__MASK; | 2686 | return ((val) << A6XX_GRAS_SC_CNTL_ROTATION__SHIFT) & A6XX_GRAS_SC_CNTL_ROTATION__MASK; |
| 2428 | } | 2687 | } |
| 2429 | #define A6XX_GRAS_SC_CNTL_EARLYVIZOUTEN 0x00001000 | 2688 | #define A6XX_GRAS_SC_CNTL_EARLYVIZOUTEN 0x00001000 |
| 2430 | 2689 | ||
| @@ -2697,12 +2956,14 @@ static inline uint32_t A6XX_GRAS_SC_WINDOW_SCISSOR_BR_Y(uint32_t val) · 266 unmodified lines | |||
| 2697 | #define A6XX_GRAS_LRZ_CNTL_FC_ENABLE 0x00000008 | 2956 | #define A6XX_GRAS_LRZ_CNTL_FC_ENABLE 0x00000008 |
| 2698 | #define A6XX_GRAS_LRZ_CNTL_Z_TEST_ENABLE 0x00000010 | 2957 | #define A6XX_GRAS_LRZ_CNTL_Z_TEST_ENABLE 0x00000010 |
| 2699 | #define A6XX_GRAS_LRZ_CNTL_Z_BOUNDS_ENABLE 0x00000020 | 2958 | #define A6XX_GRAS_LRZ_CNTL_Z_BOUNDS_ENABLE 0x00000020 |
| 2700 | #define A6XX_GRAS_LRZ_CNTL_UNK6__MASK 0x000003c0 | 2959 | #define A6XX_GRAS_LRZ_CNTL_DIR__MASK 0x000000c0 |
| 2701 | #define A6XX_GRAS_LRZ_CNTL_UNK6__SHIFT 6 | 2960 | #define A6XX_GRAS_LRZ_CNTL_DIR__SHIFT 6 |
| 2702 | static inline uint32_t A6XX_GRAS_LRZ_CNTL_UNK6(uint32_t val) | 2961 | static inline uint32_t A6XX_GRAS_LRZ_CNTL_DIR(enum a6xx_lrz_dir_status val) |
| 2703 | { | 2962 | { |
| 2704 | return ((val) << A6XX_GRAS_LRZ_CNTL_UNK6__SHIFT) & A6XX_GRAS_LRZ_CNTL_UNK6__MASK; | 2963 | return ((val) << A6XX_GRAS_LRZ_CNTL_DIR__SHIFT) & A6XX_GRAS_LRZ_CNTL_DIR__MASK; |
| 2705 | } | 2964 | } |
| 2965 | #define A6XX_GRAS_LRZ_CNTL_DIR_WRITE 0x00000100 | ||
| 2966 | #define A6XX_GRAS_LRZ_CNTL_DISABLE_ON_WRONG_DIR 0x00000200 | ||
| 2706 | 2967 | ||
| 2707 | #define REG_A6XX_GRAS_LRZ_PS_INPUT_CNTL 0x00008101 | 2968 | #define REG_A6XX_GRAS_LRZ_PS_INPUT_CNTL 0x00008101 |
| 2708 | #define A6XX_GRAS_LRZ_PS_INPUT_CNTL_SAMPLEID 0x00000001 | 2969 | #define A6XX_GRAS_LRZ_PS_INPUT_CNTL_SAMPLEID 0x00000001 |
| @@ -2754,24 +3015,24 @@ static inline uint32_t A6XX_GRAS_LRZ_FAST_CLEAR_BUFFER_BASE(uint32_t val) · 45 unmodified lines | |||
| 2754 | #define REG_A6XX_GRAS_SAMPLE_CNTL 0x00008109 | 3015 | #define REG_A6XX_GRAS_SAMPLE_CNTL 0x00008109 |
| 2755 | #define A6XX_GRAS_SAMPLE_CNTL_PER_SAMP_MODE 0x00000001 | 3016 | #define A6XX_GRAS_SAMPLE_CNTL_PER_SAMP_MODE 0x00000001 |
| 2756 | 3017 | ||
| 2757 | #define REG_A6XX_GRAS_UNKNOWN_810A 0x0000810a | 3018 | #define REG_A6XX_GRAS_LRZ_DEPTH_VIEW 0x0000810a |
| 2758 | #define A6XX_GRAS_UNKNOWN_810A_UNK0__MASK 0x000007ff | 3019 | #define A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_LAYER__MASK 0x000007ff |
| 2759 | #define A6XX_GRAS_UNKNOWN_810A_UNK0__SHIFT 0 | 3020 | #define A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_LAYER__SHIFT 0 |
| 2760 | static inline uint32_t A6XX_GRAS_UNKNOWN_810A_UNK0(uint32_t val) | 3021 | static inline uint32_t A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_LAYER(uint32_t val) |
| 2761 | { | 3022 | { |
| 2762 | return ((val) << A6XX_GRAS_UNKNOWN_810A_UNK0__SHIFT) & A6XX_GRAS_UNKNOWN_810A_UNK0__MASK; | 3023 | return ((val) << A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_LAYER__SHIFT) & A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_LAYER__MASK; |
| 2763 | } | 3024 | } |
| 2764 | #define A6XX_GRAS_UNKNOWN_810A_UNK16__MASK 0x07ff0000 | 3025 | #define A6XX_GRAS_LRZ_DEPTH_VIEW_LAYER_COUNT__MASK 0x07ff0000 |
| 2765 | #define A6XX_GRAS_UNKNOWN_810A_UNK16__SHIFT 16 | 3026 | #define A6XX_GRAS_LRZ_DEPTH_VIEW_LAYER_COUNT__SHIFT 16 |
| 2766 | static inline uint32_t A6XX_GRAS_UNKNOWN_810A_UNK16(uint32_t val) | 3027 | static inline uint32_t A6XX_GRAS_LRZ_DEPTH_VIEW_LAYER_COUNT(uint32_t val) |
| 2767 | { | 3028 | { |
| 2768 | return ((val) << A6XX_GRAS_UNKNOWN_810A_UNK16__SHIFT) & A6XX_GRAS_UNKNOWN_810A_UNK16__MASK; | 3029 | return ((val) << A6XX_GRAS_LRZ_DEPTH_VIEW_LAYER_COUNT__SHIFT) & A6XX_GRAS_LRZ_DEPTH_VIEW_LAYER_COUNT__MASK; |
| 2769 | } | 3030 | } |
| 2770 | #define A6XX_GRAS_UNKNOWN_810A_UNK28__MASK 0xf0000000 | 3031 | #define A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_MIP_LEVEL__MASK 0xf0000000 |
| 2771 | #define A6XX_GRAS_UNKNOWN_810A_UNK28__SHIFT 28 | 3032 | #define A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_MIP_LEVEL__SHIFT 28 |
| 2772 | static inline uint32_t A6XX_GRAS_UNKNOWN_810A_UNK28(uint32_t val) | 3033 | static inline uint32_t A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_MIP_LEVEL(uint32_t val) |
| 2773 | { | 3034 | { |
| 2774 | return ((val) << A6XX_GRAS_UNKNOWN_810A_UNK28__SHIFT) & A6XX_GRAS_UNKNOWN_810A_UNK28__MASK; | 3035 | return ((val) << A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_MIP_LEVEL__SHIFT) & A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_MIP_LEVEL__MASK; |
| 2775 | } | 3036 | } |
| 2776 | 3037 | ||
| 2777 | #define REG_A6XX_GRAS_UNKNOWN_8110 0x00008110 | 3038 | #define REG_A6XX_GRAS_UNKNOWN_8110 0x00008110 |
| @@ -2900,6 +3161,8 @@ static inline uint32_t A6XX_GRAS_2D_RESOLVE_CNTL_2_Y(uint32_t val) · 122 unmodified lines | |||
| 2900 | 3161 | ||
| 2901 | #define REG_A6XX_GRAS_ADDR_MODE_CNTL 0x00008601 | 3162 | #define REG_A6XX_GRAS_ADDR_MODE_CNTL 0x00008601 |
| 2902 | 3163 | ||
| 3164 | #define REG_A7XX_GRAS_NC_MODE_CNTL 0x00008602 | ||
| 3165 | |||
| 2903 | static inline uint32_t REG_A6XX_GRAS_PERFCTR_TSE_SEL(uint32_t i0) { return 0x00008610 + 0x1*i0; } | 3166 | static inline uint32_t REG_A6XX_GRAS_PERFCTR_TSE_SEL(uint32_t i0) { return 0x00008610 + 0x1*i0; } |
| 2904 | 3167 | ||
| 2905 | static inline uint32_t REG_A6XX_GRAS_PERFCTR_RAS_SEL(uint32_t i0) { return 0x00008614 + 0x1*i0; } | 3168 | static inline uint32_t REG_A6XX_GRAS_PERFCTR_RAS_SEL(uint32_t i0) { return 0x00008614 + 0x1*i0; } |
| @@ -3126,7 +3389,7 @@ static inline uint32_t A6XX_RB_RENDER_CONTROL0_COORD_MASK(uint32_t val) · 220 unmodified lines | |||
| 3126 | 3389 | ||
| 3127 | #define REG_A6XX_RB_RENDER_CONTROL1 0x0000880a | 3390 | #define REG_A6XX_RB_RENDER_CONTROL1 0x0000880a |
| 3128 | #define A6XX_RB_RENDER_CONTROL1_SAMPLEMASK 0x00000001 | 3391 | #define A6XX_RB_RENDER_CONTROL1_SAMPLEMASK 0x00000001 |
| 3129 | #define A6XX_RB_RENDER_CONTROL1_UNK1 0x00000002 | 3392 | #define A6XX_RB_RENDER_CONTROL1_POSTDEPTHCOVERAGE 0x00000002 |
| 3130 | #define A6XX_RB_RENDER_CONTROL1_FACENESS 0x00000004 | 3393 | #define A6XX_RB_RENDER_CONTROL1_FACENESS 0x00000004 |
| 3131 | #define A6XX_RB_RENDER_CONTROL1_SAMPLEID 0x00000008 | 3394 | #define A6XX_RB_RENDER_CONTROL1_SAMPLEID 0x00000008 |
| 3132 | #define A6XX_RB_RENDER_CONTROL1_FRAGCOORDSAMPLEMODE__MASK 0x00000030 | 3395 | #define A6XX_RB_RENDER_CONTROL1_FRAGCOORDSAMPLEMODE__MASK 0x00000030 |
| @@ -3135,7 +3398,7 @@ static inline uint32_t A6XX_RB_RENDER_CONTROL1_FRAGCOORDSAMPLEMODE(enum a6xx_fra · 2 unmodified lines | |||
| 3135 | { | 3398 | { |
| 3136 | return ((val) << A6XX_RB_RENDER_CONTROL1_FRAGCOORDSAMPLEMODE__SHIFT) & A6XX_RB_RENDER_CONTROL1_FRAGCOORDSAMPLEMODE__MASK; | 3399 | return ((val) << A6XX_RB_RENDER_CONTROL1_FRAGCOORDSAMPLEMODE__SHIFT) & A6XX_RB_RENDER_CONTROL1_FRAGCOORDSAMPLEMODE__MASK; |
| 3137 | } | 3400 | } |
| 3138 | #define A6XX_RB_RENDER_CONTROL1_SIZE 0x00000040 | 3401 | #define A6XX_RB_RENDER_CONTROL1_CENTERRHW 0x00000040 |
| 3139 | #define A6XX_RB_RENDER_CONTROL1_LINELENGTHEN 0x00000080 | 3402 | #define A6XX_RB_RENDER_CONTROL1_LINELENGTHEN 0x00000080 |
| 3140 | #define A6XX_RB_RENDER_CONTROL1_FOVEATION 0x00000100 | 3403 | #define A6XX_RB_RENDER_CONTROL1_FOVEATION 0x00000100 |
| 3141 | 3404 | ||
| @@ -3691,7 +3954,7 @@ static inline uint32_t A6XX_RB_WINDOW_OFFSET_Y(uint32_t val) · 549 unmodified lines | |||
| 3691 | } | 3954 | } |
| 3692 | 3955 | ||
| 3693 | #define REG_A6XX_RB_SAMPLE_COUNT_CONTROL 0x00008891 | 3956 | #define REG_A6XX_RB_SAMPLE_COUNT_CONTROL 0x00008891 |
| 3694 | #define A6XX_RB_SAMPLE_COUNT_CONTROL_UNK0 0x00000001 | 3957 | #define A6XX_RB_SAMPLE_COUNT_CONTROL_DISABLE 0x00000001 |
| 3695 | #define A6XX_RB_SAMPLE_COUNT_CONTROL_COPY 0x00000002 | 3958 | #define A6XX_RB_SAMPLE_COUNT_CONTROL_COPY 0x00000002 |
| 3696 | 3959 | ||
| 3697 | #define REG_A6XX_RB_LRZ_CNTL 0x00008898 | 3960 | #define REG_A6XX_RB_LRZ_CNTL 0x00008898 |
| @@ -3783,12 +4046,12 @@ static inline uint32_t A6XX_RB_WINDOW_OFFSET2_Y(uint32_t val) · 85 unmodified lines | |||
| 3783 | return ((val) << A6XX_RB_WINDOW_OFFSET2_Y__SHIFT) & A6XX_RB_WINDOW_OFFSET2_Y__MASK; | 4046 | return ((val) << A6XX_RB_WINDOW_OFFSET2_Y__SHIFT) & A6XX_RB_WINDOW_OFFSET2_Y__MASK; |
| 3784 | } | 4047 | } |
| 3785 | 4048 | ||
| 3786 | #define REG_A6XX_RB_MSAA_CNTL 0x000088d5 | 4049 | #define REG_A6XX_RB_BLIT_GMEM_MSAA_CNTL 0x000088d5 |
| 3787 | #define A6XX_RB_MSAA_CNTL_SAMPLES__MASK 0x00000018 | 4050 | #define A6XX_RB_BLIT_GMEM_MSAA_CNTL_SAMPLES__MASK 0x00000018 |
| 3788 | #define A6XX_RB_MSAA_CNTL_SAMPLES__SHIFT 3 | 4051 | #define A6XX_RB_BLIT_GMEM_MSAA_CNTL_SAMPLES__SHIFT 3 |
| 3789 | static inline uint32_t A6XX_RB_MSAA_CNTL_SAMPLES(enum a3xx_msaa_samples val) | 4052 | static inline uint32_t A6XX_RB_BLIT_GMEM_MSAA_CNTL_SAMPLES(enum a3xx_msaa_samples val) |
| 3790 | { | 4053 | { |
| 3791 | return ((val) << A6XX_RB_MSAA_CNTL_SAMPLES__SHIFT) & A6XX_RB_MSAA_CNTL_SAMPLES__MASK; | 4054 | return ((val) << A6XX_RB_BLIT_GMEM_MSAA_CNTL_SAMPLES__SHIFT) & A6XX_RB_BLIT_GMEM_MSAA_CNTL_SAMPLES__MASK; |
| 3792 | } | 4055 | } |
| 3793 | 4056 | ||
| 3794 | #define REG_A6XX_RB_BLIT_BASE_GMEM 0x000088d6 | 4057 | #define REG_A6XX_RB_BLIT_BASE_GMEM 0x000088d6 |
| @@ -3892,17 +4155,17 @@ static inline uint32_t A6XX_RB_BLIT_INFO_CLEAR_MASK(uint32_t val) · 97 unmodified lines | |||
| 3892 | { | 4155 | { |
| 3893 | return ((val) << A6XX_RB_BLIT_INFO_CLEAR_MASK__SHIFT) & A6XX_RB_BLIT_INFO_CLEAR_MASK__MASK; | 4156 | return ((val) << A6XX_RB_BLIT_INFO_CLEAR_MASK__SHIFT) & A6XX_RB_BLIT_INFO_CLEAR_MASK__MASK; |
| 3894 | } | 4157 | } |
| 3895 | #define A6XX_RB_BLIT_INFO_UNK8__MASK 0x00000300 | 4158 | #define A6XX_RB_BLIT_INFO_LAST__MASK 0x00000300 |
| 3896 | #define A6XX_RB_BLIT_INFO_UNK8__SHIFT 8 | 4159 | #define A6XX_RB_BLIT_INFO_LAST__SHIFT 8 |
| 3897 | static inline uint32_t A6XX_RB_BLIT_INFO_UNK8(uint32_t val) | 4160 | static inline uint32_t A6XX_RB_BLIT_INFO_LAST(uint32_t val) |
| 3898 | { | 4161 | { |
| 3899 | return ((val) << A6XX_RB_BLIT_INFO_UNK8__SHIFT) & A6XX_RB_BLIT_INFO_UNK8__MASK; | 4162 | return ((val) << A6XX_RB_BLIT_INFO_LAST__SHIFT) & A6XX_RB_BLIT_INFO_LAST__MASK; |
| 3900 | } | 4163 | } |
| 3901 | #define A6XX_RB_BLIT_INFO_UNK12__MASK 0x0000f000 | 4164 | #define A6XX_RB_BLIT_INFO_BUFFER_ID__MASK 0x0000f000 |
| 3902 | #define A6XX_RB_BLIT_INFO_UNK12__SHIFT 12 | 4165 | #define A6XX_RB_BLIT_INFO_BUFFER_ID__SHIFT 12 |
| 3903 | static inline uint32_t A6XX_RB_BLIT_INFO_UNK12(uint32_t val) | 4166 | static inline uint32_t A6XX_RB_BLIT_INFO_BUFFER_ID(uint32_t val) |
| 3904 | { | 4167 | { |
| 3905 | return ((val) << A6XX_RB_BLIT_INFO_UNK12__SHIFT) & A6XX_RB_BLIT_INFO_UNK12__MASK; | 4168 | return ((val) << A6XX_RB_BLIT_INFO_BUFFER_ID__SHIFT) & A6XX_RB_BLIT_INFO_BUFFER_ID__MASK; |
| 3906 | } | 4169 | } |
| 3907 | 4170 | ||
| 3908 | #define REG_A6XX_RB_UNKNOWN_88F0 0x000088f0 | 4171 | #define REG_A6XX_RB_UNKNOWN_88F0 0x000088f0 |
| @@ -4173,16 +4436,23 @@ static inline uint32_t A6XX_RB_2D_DST_FLAGS_PLANE_PITCH(uint32_t val) · 264 unmodified lines | |||
| 4173 | 4436 | ||
| 4174 | #define REG_A6XX_RB_UNKNOWN_8E01 0x00008e01 | 4437 | #define REG_A6XX_RB_UNKNOWN_8E01 0x00008e01 |
| 4175 | 4438 | ||
| 4176 | #define REG_A6XX_RB_UNKNOWN_8E04 0x00008e04 | 4439 | #define REG_A6XX_RB_DBG_ECO_CNTL 0x00008e04 |
| 4177 | 4440 | ||
| 4178 | #define REG_A6XX_RB_ADDR_MODE_CNTL 0x00008e05 | 4441 | #define REG_A6XX_RB_ADDR_MODE_CNTL 0x00008e05 |
| 4179 | 4442 | ||
| 4180 | #define REG_A6XX_RB_CCU_CNTL 0x00008e07 | 4443 | #define REG_A6XX_RB_CCU_CNTL 0x00008e07 |
| 4181 | #define A6XX_RB_CCU_CNTL_COLOR_OFFSET__MASK 0xff800000 | 4444 | #define A6XX_RB_CCU_CNTL_CONCURRENT_RESOLVE 0x00000004 |
| 4182 | #define A6XX_RB_CCU_CNTL_COLOR_OFFSET__SHIFT 23 | 4445 | #define A6XX_RB_CCU_CNTL_DEPTH_OFFSET_HI__MASK 0x00000080 |
| 4183 | static inline uint32_t A6XX_RB_CCU_CNTL_COLOR_OFFSET(uint32_t val) | 4446 | #define A6XX_RB_CCU_CNTL_DEPTH_OFFSET_HI__SHIFT 7 |
| 4447 | static inline uint32_t A6XX_RB_CCU_CNTL_DEPTH_OFFSET_HI(uint32_t val) | ||
| 4184 | { | 4448 | { |
| 4185 | return ((val >> 12) << A6XX_RB_CCU_CNTL_COLOR_OFFSET__SHIFT) & A6XX_RB_CCU_CNTL_COLOR_OFFSET__MASK; | 4449 | return ((val) << A6XX_RB_CCU_CNTL_DEPTH_OFFSET_HI__SHIFT) & A6XX_RB_CCU_CNTL_DEPTH_OFFSET_HI__MASK; |
| 4450 | } | ||
| 4451 | #define A6XX_RB_CCU_CNTL_COLOR_OFFSET_HI__MASK 0x00000200 | ||
| 4452 | #define A6XX_RB_CCU_CNTL_COLOR_OFFSET_HI__SHIFT 9 | ||
| 4453 | static inline uint32_t A6XX_RB_CCU_CNTL_COLOR_OFFSET_HI(uint32_t val) | ||
| 4454 | { | ||
| 4455 | return ((val) << A6XX_RB_CCU_CNTL_COLOR_OFFSET_HI__SHIFT) & A6XX_RB_CCU_CNTL_COLOR_OFFSET_HI__MASK; | ||
| 4186 | } | 4456 | } |
| 4187 | #define A6XX_RB_CCU_CNTL_DEPTH_OFFSET__MASK 0x001ff000 | 4457 | #define A6XX_RB_CCU_CNTL_DEPTH_OFFSET__MASK 0x001ff000 |
| 4188 | #define A6XX_RB_CCU_CNTL_DEPTH_OFFSET__SHIFT 12 | 4458 | #define A6XX_RB_CCU_CNTL_DEPTH_OFFSET__SHIFT 12 |
| @@ -4191,7 +4461,12 @@ static inline uint32_t A6XX_RB_CCU_CNTL_DEPTH_OFFSET(uint32_t val) · 2 unmodified lines | |||
| 4191 | return ((val >> 12) << A6XX_RB_CCU_CNTL_DEPTH_OFFSET__SHIFT) & A6XX_RB_CCU_CNTL_DEPTH_OFFSET__MASK; | 4461 | return ((val >> 12) << A6XX_RB_CCU_CNTL_DEPTH_OFFSET__SHIFT) & A6XX_RB_CCU_CNTL_DEPTH_OFFSET__MASK; |
| 4192 | } | 4462 | } |
| 4193 | #define A6XX_RB_CCU_CNTL_GMEM 0x00400000 | 4463 | #define A6XX_RB_CCU_CNTL_GMEM 0x00400000 |
| 4194 | #define A6XX_RB_CCU_CNTL_UNK2 0x00000004 | 4464 | #define A6XX_RB_CCU_CNTL_COLOR_OFFSET__MASK 0xff800000 |
| 4465 | #define A6XX_RB_CCU_CNTL_COLOR_OFFSET__SHIFT 23 | ||
| 4466 | static inline uint32_t A6XX_RB_CCU_CNTL_COLOR_OFFSET(uint32_t val) | ||
| 4467 | { | ||
| 4468 | return ((val >> 12) << A6XX_RB_CCU_CNTL_COLOR_OFFSET__SHIFT) & A6XX_RB_CCU_CNTL_COLOR_OFFSET__MASK; | ||
| 4469 | } | ||
| 4195 | 4470 | ||
| 4196 | #define REG_A6XX_RB_NC_MODE_CNTL 0x00008e08 | 4471 | #define REG_A6XX_RB_NC_MODE_CNTL 0x00008e08 |
| 4197 | #define A6XX_RB_NC_MODE_CNTL_MODE 0x00000001 | 4472 | #define A6XX_RB_NC_MODE_CNTL_MODE 0x00000001 |
| @@ -4225,6 +4500,8 @@ static inline uint32_t REG_A6XX_RB_PERFCTR_CCU_SEL(uint32_t i0) { return 0x00008 · 27 unmodified lines | |||
| 4225 | 4500 | ||
| 4226 | static inline uint32_t REG_A6XX_RB_PERFCTR_CMP_SEL(uint32_t i0) { return 0x00008e2c + 0x1*i0; } | 4501 | static inline uint32_t REG_A6XX_RB_PERFCTR_CMP_SEL(uint32_t i0) { return 0x00008e2c + 0x1*i0; } |
| 4227 | 4502 | ||
| 4503 | static inline uint32_t REG_A7XX_RB_PERFCTR_UFC_SEL(uint32_t i0) { return 0x00008e30 + 0x1*i0; } | ||
| 4504 | |||
| 4228 | #define REG_A6XX_RB_RB_SUB_BLOCK_SEL_CNTL_HOST 0x00008e3b | 4505 | #define REG_A6XX_RB_RB_SUB_BLOCK_SEL_CNTL_HOST 0x00008e3b |
| 4229 | 4506 | ||
| 4230 | #define REG_A6XX_RB_RB_SUB_BLOCK_SEL_CNTL_CD 0x00008e3d | 4507 | #define REG_A6XX_RB_RB_SUB_BLOCK_SEL_CNTL_CD 0x00008e3d |
| @@ -4440,7 +4717,13 @@ static inline uint32_t A6XX_VPC_SO_BUFFER_SIZE(uint32_t val) · 209 unmodified lines | |||
| 4440 | return ((val >> 2) << A6XX_VPC_SO_BUFFER_SIZE__SHIFT) & A6XX_VPC_SO_BUFFER_SIZE__MASK; | 4717 | return ((val >> 2) << A6XX_VPC_SO_BUFFER_SIZE__SHIFT) & A6XX_VPC_SO_BUFFER_SIZE__MASK; |
| 4441 | } | 4718 | } |
| 4442 | 4719 | ||
| 4443 | static inline uint32_t REG_A6XX_VPC_SO_NCOMP(uint32_t i0) { return 0x0000921d + 0x7*i0; } | 4720 | static inline uint32_t REG_A6XX_VPC_SO_BUFFER_STRIDE(uint32_t i0) { return 0x0000921d + 0x7*i0; } |
| 4721 | #define A6XX_VPC_SO_BUFFER_STRIDE__MASK 0x000003ff | ||
| 4722 | #define A6XX_VPC_SO_BUFFER_STRIDE__SHIFT 0 | ||
| 4723 | static inline uint32_t A6XX_VPC_SO_BUFFER_STRIDE(uint32_t val) | ||
| 4724 | { | ||
| 4725 | return ((val >> 2) << A6XX_VPC_SO_BUFFER_STRIDE__SHIFT) & A6XX_VPC_SO_BUFFER_STRIDE__MASK; | ||
| 4726 | } | ||
| 4444 | 4727 | ||
| 4445 | static inline uint32_t REG_A6XX_VPC_SO_BUFFER_OFFSET(uint32_t i0) { return 0x0000921e + 0x7*i0; } | 4728 | static inline uint32_t REG_A6XX_VPC_SO_BUFFER_OFFSET(uint32_t i0) { return 0x0000921e + 0x7*i0; } |
| 4446 | #define A6XX_VPC_SO_BUFFER_OFFSET__MASK 0xfffffffc | 4729 | #define A6XX_VPC_SO_BUFFER_OFFSET__MASK 0xfffffffc |
| @@ -4597,7 +4880,7 @@ static inline uint32_t A6XX_VPC_SO_STREAM_CNTL_STREAM_ENABLE(uint32_t val) · 150 unmodified lines | |||
| 4597 | #define REG_A6XX_VPC_SO_DISABLE 0x00009306 | 4880 | #define REG_A6XX_VPC_SO_DISABLE 0x00009306 |
| 4598 | #define A6XX_VPC_SO_DISABLE_DISABLE 0x00000001 | 4881 | #define A6XX_VPC_SO_DISABLE_DISABLE 0x00000001 |
| 4599 | 4882 | ||
| 4600 | #define REG_A6XX_VPC_UNKNOWN_9600 0x00009600 | 4883 | #define REG_A6XX_VPC_DBG_ECO_CNTL 0x00009600 |
| 4601 | 4884 | ||
| 4602 | #define REG_A6XX_VPC_ADDR_MODE_CNTL 0x00009601 | 4885 | #define REG_A6XX_VPC_ADDR_MODE_CNTL 0x00009601 |
| 4603 | 4886 | ||
| @@ -4607,6 +4890,8 @@ static inline uint32_t A6XX_VPC_SO_STREAM_CNTL_STREAM_ENABLE(uint32_t val) · 3 unmodified lines | |||
| 4607 | 4890 | ||
| 4608 | static inline uint32_t REG_A6XX_VPC_PERFCTR_VPC_SEL(uint32_t i0) { return 0x00009604 + 0x1*i0; } | 4891 | static inline uint32_t REG_A6XX_VPC_PERFCTR_VPC_SEL(uint32_t i0) { return 0x00009604 + 0x1*i0; } |
| 4609 | 4892 | ||
| 4893 | static inline uint32_t REG_A7XX_VPC_PERFCTR_VPC_SEL(uint32_t i0) { return 0x0000960b + 0x1*i0; } | ||
| 4894 | |||
| 4610 | #define REG_A6XX_PC_TESS_NUM_VERTEX 0x00009800 | 4895 | #define REG_A6XX_PC_TESS_NUM_VERTEX 0x00009800 |
| 4611 | 4896 | ||
| 4612 | #define REG_A6XX_PC_HS_INPUT_SIZE 0x00009801 | 4897 | #define REG_A6XX_PC_HS_INPUT_SIZE 0x00009801 |
| @@ -4646,7 +4931,12 @@ static inline uint32_t A6XX_PC_TESS_CNTL_OUTPUT(enum a6xx_tess_output val) · 33 unmodified lines | |||
| 4646 | #define REG_A6XX_PC_PRIMID_PASSTHRU 0x00009806 | 4931 | #define REG_A6XX_PC_PRIMID_PASSTHRU 0x00009806 |
| 4647 | 4932 | ||
| 4648 | #define REG_A6XX_PC_SO_STREAM_CNTL 0x00009808 | 4933 | #define REG_A6XX_PC_SO_STREAM_CNTL 0x00009808 |
| 4649 | #define A6XX_PC_SO_STREAM_CNTL_STREAM_ENABLE 0x00008000 | 4934 | #define A6XX_PC_SO_STREAM_CNTL_STREAM_ENABLE__MASK 0x00078000 |
| 4935 | #define A6XX_PC_SO_STREAM_CNTL_STREAM_ENABLE__SHIFT 15 | ||
| 4936 | static inline uint32_t A6XX_PC_SO_STREAM_CNTL_STREAM_ENABLE(uint32_t val) | ||
| 4937 | { | ||
| 4938 | return ((val) << A6XX_PC_SO_STREAM_CNTL_STREAM_ENABLE__SHIFT) & A6XX_PC_SO_STREAM_CNTL_STREAM_ENABLE__MASK; | ||
| 4939 | } | ||
| 4650 | 4940 | ||
| 4651 | #define REG_A6XX_PC_DGEN_SU_CONSERVATIVE_RAS_CNTL 0x0000980a | 4941 | #define REG_A6XX_PC_DGEN_SU_CONSERVATIVE_RAS_CNTL 0x0000980a |
| 4652 | #define A6XX_PC_DGEN_SU_CONSERVATIVE_RAS_CNTL_CONSERVATIVERASEN 0x00000001 | 4942 | #define A6XX_PC_DGEN_SU_CONSERVATIVE_RAS_CNTL_CONSERVATIVERASEN 0x00000001 |
| @@ -4936,6 +5226,8 @@ static inline uint32_t A6XX_PC_BIN_DRAW_STRM(uint32_t val) · 283 unmodified lines | |||
| 4936 | 5226 | ||
| 4937 | static inline uint32_t REG_A6XX_PC_PERFCTR_PC_SEL(uint32_t i0) { return 0x00009e34 + 0x1*i0; } | 5227 | static inline uint32_t REG_A6XX_PC_PERFCTR_PC_SEL(uint32_t i0) { return 0x00009e34 + 0x1*i0; } |
| 4938 | 5228 | ||
| 5229 | static inline uint32_t REG_A7XX_PC_PERFCTR_PC_SEL(uint32_t i0) { return 0x00009e42 + 0x1*i0; } | ||
| 5230 | |||
| 4939 | #define REG_A6XX_PC_UNKNOWN_9E72 0x00009e72 | 5231 | #define REG_A6XX_PC_UNKNOWN_9E72 0x00009e72 |
| 4940 | 5232 | ||
| 4941 | #define REG_A6XX_VFD_CONTROL_0 0x0000a000 | 5233 | #define REG_A6XX_VFD_CONTROL_0 0x0000a000 |
| @@ -5138,9 +5430,11 @@ static inline uint32_t A6XX_VFD_DEST_CNTL_INSTR_REGID(uint32_t val) · 196 unmodified lines | |||
| 5138 | 5430 | ||
| 5139 | static inline uint32_t REG_A6XX_VFD_PERFCTR_VFD_SEL(uint32_t i0) { return 0x0000a610 + 0x1*i0; } | 5431 | static inline uint32_t REG_A6XX_VFD_PERFCTR_VFD_SEL(uint32_t i0) { return 0x0000a610 + 0x1*i0; } |
| 5140 | 5432 | ||
| 5433 | static inline uint32_t REG_A7XX_VFD_PERFCTR_VFD_SEL(uint32_t i0) { return 0x0000a610 + 0x1*i0; } | ||
| 5434 | |||
| 5141 | #define REG_A6XX_SP_VS_CTRL_REG0 0x0000a800 | 5435 | #define REG_A6XX_SP_VS_CTRL_REG0 0x0000a800 |
| 5142 | #define A6XX_SP_VS_CTRL_REG0_MERGEDREGS 0x00100000 | 5436 | #define A6XX_SP_VS_CTRL_REG0_MERGEDREGS 0x00100000 |
| 5143 | #define A6XX_SP_VS_CTRL_REG0_UNK21 0x00200000 | 5437 | #define A6XX_SP_VS_CTRL_REG0_EARLYPREAMBLE 0x00200000 |
| 5144 | #define A6XX_SP_VS_CTRL_REG0_THREADMODE__MASK 0x00000001 | 5438 | #define A6XX_SP_VS_CTRL_REG0_THREADMODE__MASK 0x00000001 |
| 5145 | #define A6XX_SP_VS_CTRL_REG0_THREADMODE__SHIFT 0 | 5439 | #define A6XX_SP_VS_CTRL_REG0_THREADMODE__SHIFT 0 |
| 5146 | static inline uint32_t A6XX_SP_VS_CTRL_REG0_THREADMODE(enum a3xx_threadmode val) | 5440 | static inline uint32_t A6XX_SP_VS_CTRL_REG0_THREADMODE(enum a3xx_threadmode val) |
| @@ -5318,7 +5612,7 @@ static inline uint32_t A6XX_SP_VS_PVT_MEM_HW_STACK_OFFSET_OFFSET(uint32_t val) · 171 unmodified lines | |||
| 5318 | } | 5612 | } |
| 5319 | 5613 | ||
| 5320 | #define REG_A6XX_SP_HS_CTRL_REG0 0x0000a830 | 5614 | #define REG_A6XX_SP_HS_CTRL_REG0 0x0000a830 |
| 5321 | #define A6XX_SP_HS_CTRL_REG0_UNK20 0x00100000 | 5615 | #define A6XX_SP_HS_CTRL_REG0_EARLYPREAMBLE 0x00100000 |
| 5322 | #define A6XX_SP_HS_CTRL_REG0_THREADMODE__MASK 0x00000001 | 5616 | #define A6XX_SP_HS_CTRL_REG0_THREADMODE__MASK 0x00000001 |
| 5323 | #define A6XX_SP_HS_CTRL_REG0_THREADMODE__SHIFT 0 | 5617 | #define A6XX_SP_HS_CTRL_REG0_THREADMODE__SHIFT 0 |
| 5324 | static inline uint32_t A6XX_SP_HS_CTRL_REG0_THREADMODE(enum a3xx_threadmode val) | 5618 | static inline uint32_t A6XX_SP_HS_CTRL_REG0_THREADMODE(enum a3xx_threadmode val) |
| @@ -5428,7 +5722,7 @@ static inline uint32_t A6XX_SP_HS_PVT_MEM_HW_STACK_OFFSET_OFFSET(uint32_t val) · 103 unmodified lines | |||
| 5428 | } | 5722 | } |
| 5429 | 5723 | ||
| 5430 | #define REG_A6XX_SP_DS_CTRL_REG0 0x0000a840 | 5724 | #define REG_A6XX_SP_DS_CTRL_REG0 0x0000a840 |
| 5431 | #define A6XX_SP_DS_CTRL_REG0_MERGEDREGS 0x00100000 | 5725 | #define A6XX_SP_DS_CTRL_REG0_EARLYPREAMBLE 0x00100000 |
| 5432 | #define A6XX_SP_DS_CTRL_REG0_THREADMODE__MASK 0x00000001 | 5726 | #define A6XX_SP_DS_CTRL_REG0_THREADMODE__MASK 0x00000001 |
| 5433 | #define A6XX_SP_DS_CTRL_REG0_THREADMODE__SHIFT 0 | 5727 | #define A6XX_SP_DS_CTRL_REG0_THREADMODE__SHIFT 0 |
| 5434 | static inline uint32_t A6XX_SP_DS_CTRL_REG0_THREADMODE(enum a3xx_threadmode val) | 5728 | static inline uint32_t A6XX_SP_DS_CTRL_REG0_THREADMODE(enum a3xx_threadmode val) |
| @@ -5606,7 +5900,7 @@ static inline uint32_t A6XX_SP_DS_PVT_MEM_HW_STACK_OFFSET_OFFSET(uint32_t val) · 171 unmodified lines | |||
| 5606 | } | 5900 | } |
| 5607 | 5901 | ||
| 5608 | #define REG_A6XX_SP_GS_CTRL_REG0 0x0000a870 | 5902 | #define REG_A6XX_SP_GS_CTRL_REG0 0x0000a870 |
| 5609 | #define A6XX_SP_GS_CTRL_REG0_UNK20 0x00100000 | 5903 | #define A6XX_SP_GS_CTRL_REG0_EARLYPREAMBLE 0x00100000 |
| 5610 | #define A6XX_SP_GS_CTRL_REG0_THREADMODE__MASK 0x00000001 | 5904 | #define A6XX_SP_GS_CTRL_REG0_THREADMODE__MASK 0x00000001 |
| 5611 | #define A6XX_SP_GS_CTRL_REG0_THREADMODE__SHIFT 0 | 5905 | #define A6XX_SP_GS_CTRL_REG0_THREADMODE__SHIFT 0 |
| 5612 | static inline uint32_t A6XX_SP_GS_CTRL_REG0_THREADMODE(enum a3xx_threadmode val) | 5906 | static inline uint32_t A6XX_SP_GS_CTRL_REG0_THREADMODE(enum a3xx_threadmode val) |
| @@ -5862,12 +6156,8 @@ static inline uint32_t A6XX_SP_FS_CTRL_REG0_THREADSIZE(enum a6xx_threadsize val) · 249 unmodified lines | |||
| 5862 | #define A6XX_SP_FS_CTRL_REG0_UNK24 0x01000000 | 6156 | #define A6XX_SP_FS_CTRL_REG0_UNK24 0x01000000 |
| 5863 | #define A6XX_SP_FS_CTRL_REG0_UNK25 0x02000000 | 6157 | #define A6XX_SP_FS_CTRL_REG0_UNK25 0x02000000 |
| 5864 | #define A6XX_SP_FS_CTRL_REG0_PIXLODENABLE 0x04000000 | 6158 | #define A6XX_SP_FS_CTRL_REG0_PIXLODENABLE 0x04000000 |
| 5865 | #define A6XX_SP_FS_CTRL_REG0_UNK27__MASK 0x18000000 | 6159 | #define A6XX_SP_FS_CTRL_REG0_UNK27 0x08000000 |
| 5866 | #define A6XX_SP_FS_CTRL_REG0_UNK27__SHIFT 27 | 6160 | #define A6XX_SP_FS_CTRL_REG0_EARLYPREAMBLE 0x10000000 |
| 5867 | static inline uint32_t A6XX_SP_FS_CTRL_REG0_UNK27(uint32_t val) | ||
| 5868 | { | ||
| 5869 | return ((val) << A6XX_SP_FS_CTRL_REG0_UNK27__SHIFT) & A6XX_SP_FS_CTRL_REG0_UNK27__MASK; | ||
| 5870 | } | ||
| 5871 | #define A6XX_SP_FS_CTRL_REG0_MERGEDREGS 0x80000000 | 6161 | #define A6XX_SP_FS_CTRL_REG0_MERGEDREGS 0x80000000 |
| 5872 | #define A6XX_SP_FS_CTRL_REG0_THREADMODE__MASK 0x00000001 | 6162 | #define A6XX_SP_FS_CTRL_REG0_THREADMODE__MASK 0x00000001 |
| 5873 | #define A6XX_SP_FS_CTRL_REG0_THREADMODE__SHIFT 0 | 6163 | #define A6XX_SP_FS_CTRL_REG0_THREADMODE__SHIFT 0 |
| @@ -6069,18 +6359,14 @@ static inline uint32_t A6XX_SP_FS_PREFETCH_CNTL_COUNT(uint32_t val) · 195 unmodified lines | |||
| 6069 | { | 6359 | { |
| 6070 | return ((val) << A6XX_SP_FS_PREFETCH_CNTL_COUNT__SHIFT) & A6XX_SP_FS_PREFETCH_CNTL_COUNT__MASK; | 6360 | return ((val) << A6XX_SP_FS_PREFETCH_CNTL_COUNT__SHIFT) & A6XX_SP_FS_PREFETCH_CNTL_COUNT__MASK; |
| 6071 | } | 6361 | } |
| 6072 | #define A6XX_SP_FS_PREFETCH_CNTL_UNK3 0x00000008 | 6362 | #define A6XX_SP_FS_PREFETCH_CNTL_IJ_WRITE_DISABLE 0x00000008 |
| 6073 | #define A6XX_SP_FS_PREFETCH_CNTL_UNK4__MASK 0x00000ff0 | 6363 | #define A6XX_SP_FS_PREFETCH_CNTL_UNK4 0x00000010 |
| 6074 | #define A6XX_SP_FS_PREFETCH_CNTL_UNK4__SHIFT 4 | 6364 | #define A6XX_SP_FS_PREFETCH_CNTL_WRITE_COLOR_TO_OUTPUT 0x00000020 |
| 6075 | static inline uint32_t A6XX_SP_FS_PREFETCH_CNTL_UNK4(uint32_t val) | 6365 | #define A6XX_SP_FS_PREFETCH_CNTL_UNK6__MASK 0x00007fc0 |
| 6366 | #define A6XX_SP_FS_PREFETCH_CNTL_UNK6__SHIFT 6 | ||
| 6367 | static inline uint32_t A6XX_SP_FS_PREFETCH_CNTL_UNK6(uint32_t val) | ||
| 6076 | { | 6368 | { |
| 6077 | return ((val) << A6XX_SP_FS_PREFETCH_CNTL_UNK4__SHIFT) & A6XX_SP_FS_PREFETCH_CNTL_UNK4__MASK; | 6369 | return ((val) << A6XX_SP_FS_PREFETCH_CNTL_UNK6__SHIFT) & A6XX_SP_FS_PREFETCH_CNTL_UNK6__MASK; |
| 6078 | } | ||
| 6079 | #define A6XX_SP_FS_PREFETCH_CNTL_UNK12__MASK 0x00007000 | ||
| 6080 | #define A6XX_SP_FS_PREFETCH_CNTL_UNK12__SHIFT 12 | ||
| 6081 | static inline uint32_t A6XX_SP_FS_PREFETCH_CNTL_UNK12(uint32_t val) | ||
| 6082 | { | ||
| 6083 | return ((val) << A6XX_SP_FS_PREFETCH_CNTL_UNK12__SHIFT) & A6XX_SP_FS_PREFETCH_CNTL_UNK12__MASK; | ||
| 6084 | } | 6370 | } |
| 6085 | 6371 | ||
| 6086 | static inline uint32_t REG_A6XX_SP_FS_PREFETCH(uint32_t i0) { return 0x0000a99f + 0x1*i0; } | 6372 | static inline uint32_t REG_A6XX_SP_FS_PREFETCH(uint32_t i0) { return 0x0000a99f + 0x1*i0; } |
| @@ -6117,9 +6403,11 @@ static inline uint32_t A6XX_SP_FS_PREFETCH_CMD_WRMASK(uint32_t val) · 30 unmodified lines | |||
| 6117 | return ((val) << A6XX_SP_FS_PREFETCH_CMD_WRMASK__SHIFT) & A6XX_SP_FS_PREFETCH_CMD_WRMASK__MASK; | 6403 | return ((val) << A6XX_SP_FS_PREFETCH_CMD_WRMASK__SHIFT) & A6XX_SP_FS_PREFETCH_CMD_WRMASK__MASK; |
| 6118 | } | 6404 | } |
| 6119 | #define A6XX_SP_FS_PREFETCH_CMD_HALF 0x04000000 | 6405 | #define A6XX_SP_FS_PREFETCH_CMD_HALF 0x04000000 |
| 6120 | #define A6XX_SP_FS_PREFETCH_CMD_CMD__MASK 0xf8000000 | 6406 | #define A6XX_SP_FS_PREFETCH_CMD_UNK27 0x08000000 |
| 6121 | #define A6XX_SP_FS_PREFETCH_CMD_CMD__SHIFT 27 | 6407 | #define A6XX_SP_FS_PREFETCH_CMD_BINDLESS 0x10000000 |
| 6122 | static inline uint32_t A6XX_SP_FS_PREFETCH_CMD_CMD(uint32_t val) | 6408 | #define A6XX_SP_FS_PREFETCH_CMD_CMD__MASK 0xe0000000 |
| 6409 | #define A6XX_SP_FS_PREFETCH_CMD_CMD__SHIFT 29 | ||
| 6410 | static inline uint32_t A6XX_SP_FS_PREFETCH_CMD_CMD(enum a6xx_tex_prefetch_cmd val) | ||
| 6123 | { | 6411 | { |
| 6124 | return ((val) << A6XX_SP_FS_PREFETCH_CMD_CMD__SHIFT) & A6XX_SP_FS_PREFETCH_CMD_CMD__MASK; | 6412 | return ((val) << A6XX_SP_FS_PREFETCH_CMD_CMD__SHIFT) & A6XX_SP_FS_PREFETCH_CMD_CMD__MASK; |
| 6125 | } | 6413 | } |
| @@ -6161,7 +6449,7 @@ static inline uint32_t A6XX_SP_CS_CTRL_REG0_THREADSIZE(enum a6xx_threadsize val) · 35 unmodified lines | |||
| 6161 | } | 6449 | } |
| 6162 | #define A6XX_SP_CS_CTRL_REG0_UNK21 0x00200000 | 6450 | #define A6XX_SP_CS_CTRL_REG0_UNK21 0x00200000 |
| 6163 | #define A6XX_SP_CS_CTRL_REG0_UNK22 0x00400000 | 6451 | #define A6XX_SP_CS_CTRL_REG0_UNK22 0x00400000 |
| 6164 | #define A6XX_SP_CS_CTRL_REG0_SEPARATEPROLOG 0x00800000 | 6452 | #define A6XX_SP_CS_CTRL_REG0_EARLYPREAMBLE 0x00800000 |
| 6165 | #define A6XX_SP_CS_CTRL_REG0_MERGEDREGS 0x80000000 | 6453 | #define A6XX_SP_CS_CTRL_REG0_MERGEDREGS 0x80000000 |
| 6166 | #define A6XX_SP_CS_CTRL_REG0_THREADMODE__MASK 0x00000001 | 6454 | #define A6XX_SP_CS_CTRL_REG0_THREADMODE__MASK 0x00000001 |
| 6167 | #define A6XX_SP_CS_CTRL_REG0_THREADMODE__SHIFT 0 | 6455 | #define A6XX_SP_CS_CTRL_REG0_THREADMODE__SHIFT 0 |
| @@ -6355,7 +6643,19 @@ static inline uint32_t A6XX_SP_CS_TEX_CONST(uint32_t val) · 187 unmodified lines | |||
| 6355 | 6643 | ||
| 6356 | static inline uint32_t REG_A6XX_SP_CS_BINDLESS_BASE(uint32_t i0) { return 0x0000a9e8 + 0x2*i0; } | 6644 | static inline uint32_t REG_A6XX_SP_CS_BINDLESS_BASE(uint32_t i0) { return 0x0000a9e8 + 0x2*i0; } |
| 6357 | 6645 | ||
| 6358 | static inline uint32_t REG_A6XX_SP_CS_BINDLESS_BASE_ADDR(uint32_t i0) { return 0x0000a9e8 + 0x2*i0; } | 6646 | static inline uint32_t REG_A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR(uint32_t i0) { return 0x0000a9e8 + 0x2*i0; } |
| 6647 | #define A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__MASK 0x00000003 | ||
| 6648 | #define A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__SHIFT 0 | ||
| 6649 | static inline uint32_t A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE(enum a6xx_bindless_descriptor_size val) | ||
| 6650 | { | ||
| 6651 | return ((val) << A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__SHIFT) & A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__MASK; | ||
| 6652 | } | ||
| 6653 | #define A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_ADDR__MASK 0xfffffffc | ||
| 6654 | #define A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_ADDR__SHIFT 2 | ||
| 6655 | static inline uint32_t A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_ADDR(uint32_t val) | ||
| 6656 | { | ||
| 6657 | return ((val >> 2) << A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_ADDR__SHIFT) & A6XX_SP_CS_BINDLESS_BASE_DESCRIPTOR_ADDR__MASK; | ||
| 6658 | } | ||
| 6359 | 6659 | ||
| 6360 | #define REG_A6XX_SP_CS_IBO 0x0000a9f2 | 6660 | #define REG_A6XX_SP_CS_IBO 0x0000a9f2 |
| 6361 | #define A6XX_SP_CS_IBO__MASK 0xffffffff | 6661 | #define A6XX_SP_CS_IBO__MASK 0xffffffff |
| @@ -6406,7 +6706,19 @@ static inline uint32_t A6XX_SP_FS_CONFIG_NIBO(uint32_t val) · 44 unmodified lines | |||
| 6406 | 6706 | ||
| 6407 | static inline uint32_t REG_A6XX_SP_BINDLESS_BASE(uint32_t i0) { return 0x0000ab10 + 0x2*i0; } | 6707 | static inline uint32_t REG_A6XX_SP_BINDLESS_BASE(uint32_t i0) { return 0x0000ab10 + 0x2*i0; } |
| 6408 | 6708 | ||
| 6409 | static inline uint32_t REG_A6XX_SP_BINDLESS_BASE_ADDR(uint32_t i0) { return 0x0000ab10 + 0x2*i0; } | 6709 | static inline uint32_t REG_A6XX_SP_BINDLESS_BASE_DESCRIPTOR(uint32_t i0) { return 0x0000ab10 + 0x2*i0; } |
| 6710 | #define A6XX_SP_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__MASK 0x00000003 | ||
| 6711 | #define A6XX_SP_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__SHIFT 0 | ||
| 6712 | static inline uint32_t A6XX_SP_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE(enum a6xx_bindless_descriptor_size val) | ||
| 6713 | { | ||
| 6714 | return ((val) << A6XX_SP_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__SHIFT) & A6XX_SP_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__MASK; | ||
| 6715 | } | ||
| 6716 | #define A6XX_SP_BINDLESS_BASE_DESCRIPTOR_ADDR__MASK 0xfffffffc | ||
| 6717 | #define A6XX_SP_BINDLESS_BASE_DESCRIPTOR_ADDR__SHIFT 2 | ||
| 6718 | static inline uint32_t A6XX_SP_BINDLESS_BASE_DESCRIPTOR_ADDR(uint32_t val) | ||
| 6719 | { | ||
| 6720 | return ((val >> 2) << A6XX_SP_BINDLESS_BASE_DESCRIPTOR_ADDR__SHIFT) & A6XX_SP_BINDLESS_BASE_DESCRIPTOR_ADDR__MASK; | ||
| 6721 | } | ||
| 6410 | 6722 | ||
| 6411 | #define REG_A6XX_SP_IBO 0x0000ab1a | 6723 | #define REG_A6XX_SP_IBO 0x0000ab1a |
| 6412 | #define A6XX_SP_IBO__MASK 0xffffffff | 6724 | #define A6XX_SP_IBO__MASK 0xffffffff |
| @@ -6436,7 +6748,7 @@ static inline uint32_t A6XX_SP_2D_DST_FORMAT_MASK(uint32_t val) · 23 unmodified lines | |||
| 6436 | return ((val) << A6XX_SP_2D_DST_FORMAT_MASK__SHIFT) & A6XX_SP_2D_DST_FORMAT_MASK__MASK; | 6748 | return ((val) << A6XX_SP_2D_DST_FORMAT_MASK__SHIFT) & A6XX_SP_2D_DST_FORMAT_MASK__MASK; |
| 6437 | } | 6749 | } |
| 6438 | 6750 | ||
| 6439 | #define REG_A6XX_SP_UNKNOWN_AE00 0x0000ae00 | 6751 | #define REG_A6XX_SP_DBG_ECO_CNTL 0x0000ae00 |
| 6440 | 6752 | ||
| 6441 | #define REG_A6XX_SP_ADDR_MODE_CNTL 0x0000ae01 | 6753 | #define REG_A6XX_SP_ADDR_MODE_CNTL 0x0000ae01 |
| 6442 | 6754 | ||
| @@ -6457,6 +6769,12 @@ static inline uint32_t A6XX_SP_2D_DST_FORMAT_MASK(uint32_t val) · 14 unmodified lines | |||
| 6457 | 6769 | ||
| 6458 | static inline uint32_t REG_A6XX_SP_PERFCTR_SP_SEL(uint32_t i0) { return 0x0000ae10 + 0x1*i0; } | 6770 | static inline uint32_t REG_A6XX_SP_PERFCTR_SP_SEL(uint32_t i0) { return 0x0000ae10 + 0x1*i0; } |
| 6459 | 6771 | ||
| 6772 | static inline uint32_t REG_A7XX_SP_PERFCTR_HLSQ_SEL(uint32_t i0) { return 0x0000ae60 + 0x1*i0; } | ||
| 6773 | |||
| 6774 | #define REG_A7XX_SP_READ_SEL 0x0000ae6d | ||
| 6775 | |||
| 6776 | static inline uint32_t REG_A7XX_SP_PERFCTR_SP_SEL(uint32_t i0) { return 0x0000ae80 + 0x1*i0; } | ||
| 6777 | |||
| 6460 | #define REG_A6XX_SP_CONTEXT_SWITCH_GFX_PREEMPTION_SAFE_MODE 0x0000be22 | 6778 | #define REG_A6XX_SP_CONTEXT_SWITCH_GFX_PREEMPTION_SAFE_MODE 0x0000be22 |
| 6461 | 6779 | ||
| 6462 | #define REG_A6XX_SP_PS_TP_BORDER_COLOR_BASE_ADDR 0x0000b180 | 6780 | #define REG_A6XX_SP_PS_TP_BORDER_COLOR_BASE_ADDR 0x0000b180 |
| @@ -6887,6 +7205,8 @@ static inline uint32_t A6XX_HLSQ_FS_CNTL_0_UNK2(uint32_t val) · 424 unmodified lines | |||
| 6887 | 7205 | ||
| 6888 | #define REG_A6XX_HLSQ_CONTROL_1_REG 0x0000b982 | 7206 | #define REG_A6XX_HLSQ_CONTROL_1_REG 0x0000b982 |
| 6889 | 7207 | ||
| 7208 | #define REG_A7XX_HLSQ_CONTROL_1_REG 0x0000a9c7 | ||
| 7209 | |||
| 6890 | #define REG_A6XX_HLSQ_CONTROL_2_REG 0x0000b983 | 7210 | #define REG_A6XX_HLSQ_CONTROL_2_REG 0x0000b983 |
| 6891 | #define A6XX_HLSQ_CONTROL_2_REG_FACEREGID__MASK 0x000000ff | 7211 | #define A6XX_HLSQ_CONTROL_2_REG_FACEREGID__MASK 0x000000ff |
| 6892 | #define A6XX_HLSQ_CONTROL_2_REG_FACEREGID__SHIFT 0 | 7212 | #define A6XX_HLSQ_CONTROL_2_REG_FACEREGID__SHIFT 0 |
| @@ -6906,11 +7226,37 @@ static inline uint32_t A6XX_HLSQ_CONTROL_2_REG_SAMPLEMASK(uint32_t val) · 13 unmodified lines | |||
| 6906 | { | 7226 | { |
| 6907 | return ((val) << A6XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__SHIFT) & A6XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__MASK; | 7227 | return ((val) << A6XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__SHIFT) & A6XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__MASK; |
| 6908 | } | 7228 | } |
| 6909 | #define A6XX_HLSQ_CONTROL_2_REG_SIZE__MASK 0xff000000 | 7229 | #define A6XX_HLSQ_CONTROL_2_REG_CENTERRHW__MASK 0xff000000 |
| 6910 | #define A6XX_HLSQ_CONTROL_2_REG_SIZE__SHIFT 24 | 7230 | #define A6XX_HLSQ_CONTROL_2_REG_CENTERRHW__SHIFT 24 |
| 6911 | static inline uint32_t A6XX_HLSQ_CONTROL_2_REG_SIZE(uint32_t val) | 7231 | static inline uint32_t A6XX_HLSQ_CONTROL_2_REG_CENTERRHW(uint32_t val) |
| 7232 | { | ||
| 7233 | return ((val) << A6XX_HLSQ_CONTROL_2_REG_CENTERRHW__SHIFT) & A6XX_HLSQ_CONTROL_2_REG_CENTERRHW__MASK; | ||
| 7234 | } | ||
| 7235 | |||
| 7236 | #define REG_A7XX_HLSQ_CONTROL_2_REG 0x0000a9c8 | ||
| 7237 | #define A7XX_HLSQ_CONTROL_2_REG_FACEREGID__MASK 0x000000ff | ||
| 7238 | #define A7XX_HLSQ_CONTROL_2_REG_FACEREGID__SHIFT 0 | ||
| 7239 | static inline uint32_t A7XX_HLSQ_CONTROL_2_REG_FACEREGID(uint32_t val) | ||
| 7240 | { | ||
| 7241 | return ((val) << A7XX_HLSQ_CONTROL_2_REG_FACEREGID__SHIFT) & A7XX_HLSQ_CONTROL_2_REG_FACEREGID__MASK; | ||
| 7242 | } | ||
| 7243 | #define A7XX_HLSQ_CONTROL_2_REG_SAMPLEID__MASK 0x0000ff00 | ||
| 7244 | #define A7XX_HLSQ_CONTROL_2_REG_SAMPLEID__SHIFT 8 | ||
| 7245 | static inline uint32_t A7XX_HLSQ_CONTROL_2_REG_SAMPLEID(uint32_t val) | ||
| 7246 | { | ||
| 7247 | return ((val) << A7XX_HLSQ_CONTROL_2_REG_SAMPLEID__SHIFT) & A7XX_HLSQ_CONTROL_2_REG_SAMPLEID__MASK; | ||
| 7248 | } | ||
| 7249 | #define A7XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__MASK 0x00ff0000 | ||
| 7250 | #define A7XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__SHIFT 16 | ||
| 7251 | static inline uint32_t A7XX_HLSQ_CONTROL_2_REG_SAMPLEMASK(uint32_t val) | ||
| 7252 | { | ||
| 7253 | return ((val) << A7XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__SHIFT) & A7XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__MASK; | ||
| 7254 | } | ||
| 7255 | #define A7XX_HLSQ_CONTROL_2_REG_CENTERRHW__MASK 0xff000000 | ||
| 7256 | #define A7XX_HLSQ_CONTROL_2_REG_CENTERRHW__SHIFT 24 | ||
| 7257 | static inline uint32_t A7XX_HLSQ_CONTROL_2_REG_CENTERRHW(uint32_t val) | ||
| 6912 | { | 7258 | { |
| 6913 | return ((val) << A6XX_HLSQ_CONTROL_2_REG_SIZE__SHIFT) & A6XX_HLSQ_CONTROL_2_REG_SIZE__MASK; | 7259 | return ((val) << A7XX_HLSQ_CONTROL_2_REG_CENTERRHW__SHIFT) & A7XX_HLSQ_CONTROL_2_REG_CENTERRHW__MASK; |
| 6914 | } | 7260 | } |
| 6915 | 7261 | ||
| 6916 | #define REG_A6XX_HLSQ_CONTROL_3_REG 0x0000b984 | 7262 | #define REG_A6XX_HLSQ_CONTROL_3_REG 0x0000b984 |
| @@ -6939,6 +7285,32 @@ static inline uint32_t A6XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID(uint32_t val) · 22 unmodified lines | |||
| 6939 | return ((val) << A6XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__SHIFT) & A6XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__MASK; | 7285 | return ((val) << A6XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__SHIFT) & A6XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__MASK; |
| 6940 | } | 7286 | } |
| 6941 | 7287 | ||
| 7288 | #define REG_A7XX_HLSQ_CONTROL_3_REG 0x0000a9c9 | ||
| 7289 | #define A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_PIXEL__MASK 0x000000ff | ||
| 7290 | #define A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_PIXEL__SHIFT 0 | ||
| 7291 | static inline uint32_t A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_PIXEL(uint32_t val) | ||
| 7292 | { | ||
| 7293 | return ((val) << A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_PIXEL__SHIFT) & A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_PIXEL__MASK; | ||
| 7294 | } | ||
| 7295 | #define A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_PIXEL__MASK 0x0000ff00 | ||
| 7296 | #define A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_PIXEL__SHIFT 8 | ||
| 7297 | static inline uint32_t A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_PIXEL(uint32_t val) | ||
| 7298 | { | ||
| 7299 | return ((val) << A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_PIXEL__SHIFT) & A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_PIXEL__MASK; | ||
| 7300 | } | ||
| 7301 | #define A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_CENTROID__MASK 0x00ff0000 | ||
| 7302 | #define A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_CENTROID__SHIFT 16 | ||
| 7303 | static inline uint32_t A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_CENTROID(uint32_t val) | ||
| 7304 | { | ||
| 7305 | return ((val) << A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_CENTROID__SHIFT) & A7XX_HLSQ_CONTROL_3_REG_IJ_PERSP_CENTROID__MASK; | ||
| 7306 | } | ||
| 7307 | #define A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__MASK 0xff000000 | ||
| 7308 | #define A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__SHIFT 24 | ||
| 7309 | static inline uint32_t A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID(uint32_t val) | ||
| 7310 | { | ||
| 7311 | return ((val) << A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__SHIFT) & A7XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__MASK; | ||
| 7312 | } | ||
| 7313 | |||
| 6942 | #define REG_A6XX_HLSQ_CONTROL_4_REG 0x0000b985 | 7314 | #define REG_A6XX_HLSQ_CONTROL_4_REG 0x0000b985 |
| 6943 | #define A6XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE__MASK 0x000000ff | 7315 | #define A6XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE__MASK 0x000000ff |
| 6944 | #define A6XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE__SHIFT 0 | 7316 | #define A6XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE__SHIFT 0 |
| @@ -6965,6 +7337,32 @@ static inline uint32_t A6XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID(uint32_t val) · 20 unmodified lines | |||
| 6965 | return ((val) << A6XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__SHIFT) & A6XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__MASK; | 7337 | return ((val) << A6XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__SHIFT) & A6XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__MASK; |
| 6966 | } | 7338 | } |
| 6967 | 7339 | ||
| 7340 | #define REG_A7XX_HLSQ_CONTROL_4_REG 0x0000a9ca | ||
| 7341 | #define A7XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE__MASK 0x000000ff | ||
| 7342 | #define A7XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE__SHIFT 0 | ||
| 7343 | static inline uint32_t A7XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE(uint32_t val) | ||
| 7344 | { | ||
| 7345 | return ((val) << A7XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE__SHIFT) & A7XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE__MASK; | ||
| 7346 | } | ||
| 7347 | #define A7XX_HLSQ_CONTROL_4_REG_IJ_LINEAR_SAMPLE__MASK 0x0000ff00 | ||
| 7348 | #define A7XX_HLSQ_CONTROL_4_REG_IJ_LINEAR_SAMPLE__SHIFT 8 | ||
| 7349 | static inline uint32_t A7XX_HLSQ_CONTROL_4_REG_IJ_LINEAR_SAMPLE(uint32_t val) | ||
| 7350 | { | ||
| 7351 | return ((val) << A7XX_HLSQ_CONTROL_4_REG_IJ_LINEAR_SAMPLE__SHIFT) & A7XX_HLSQ_CONTROL_4_REG_IJ_LINEAR_SAMPLE__MASK; | ||
| 7352 | } | ||
| 7353 | #define A7XX_HLSQ_CONTROL_4_REG_XYCOORDREGID__MASK 0x00ff0000 | ||
| 7354 | #define A7XX_HLSQ_CONTROL_4_REG_XYCOORDREGID__SHIFT 16 | ||
| 7355 | static inline uint32_t A7XX_HLSQ_CONTROL_4_REG_XYCOORDREGID(uint32_t val) | ||
| 7356 | { | ||
| 7357 | return ((val) << A7XX_HLSQ_CONTROL_4_REG_XYCOORDREGID__SHIFT) & A7XX_HLSQ_CONTROL_4_REG_XYCOORDREGID__MASK; | ||
| 7358 | } | ||
| 7359 | #define A7XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__MASK 0xff000000 | ||
| 7360 | #define A7XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__SHIFT 24 | ||
| 7361 | static inline uint32_t A7XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID(uint32_t val) | ||
| 7362 | { | ||
| 7363 | return ((val) << A7XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__SHIFT) & A7XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__MASK; | ||
| 7364 | } | ||
| 7365 | |||
| 6968 | #define REG_A6XX_HLSQ_CONTROL_5_REG 0x0000b986 | 7366 | #define REG_A6XX_HLSQ_CONTROL_5_REG 0x0000b986 |
| 6969 | #define A6XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID__MASK 0x000000ff | 7367 | #define A6XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID__MASK 0x000000ff |
| 6970 | #define A6XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID__SHIFT 0 | 7368 | #define A6XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID__SHIFT 0 |
| @@ -6979,6 +7377,20 @@ static inline uint32_t A6XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID(uint32_t va · 8 unmodified lines | |||
| 6979 | return ((val) << A6XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__SHIFT) & A6XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__MASK; | 7377 | return ((val) << A6XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__SHIFT) & A6XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__MASK; |
| 6980 | } | 7378 | } |
| 6981 | 7379 | ||
| 7380 | #define REG_A7XX_HLSQ_CONTROL_5_REG 0x0000a9cb | ||
| 7381 | #define A7XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID__MASK 0x000000ff | ||
| 7382 | #define A7XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID__SHIFT 0 | ||
| 7383 | static inline uint32_t A7XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID(uint32_t val) | ||
| 7384 | { | ||
| 7385 | return ((val) << A7XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID__SHIFT) & A7XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID__MASK; | ||
| 7386 | } | ||
| 7387 | #define A7XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__MASK 0x0000ff00 | ||
| 7388 | #define A7XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__SHIFT 8 | ||
| 7389 | static inline uint32_t A7XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID(uint32_t val) | ||
| 7390 | { | ||
| 7391 | return ((val) << A7XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__SHIFT) & A7XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__MASK; | ||
| 7392 | } | ||
| 7393 | |||
| 6982 | #define REG_A6XX_HLSQ_CS_CNTL 0x0000b987 | 7394 | #define REG_A6XX_HLSQ_CS_CNTL 0x0000b987 |
| 6983 | #define A6XX_HLSQ_CS_CNTL_CONSTLEN__MASK 0x000000ff | 7395 | #define A6XX_HLSQ_CS_CNTL_CONSTLEN__MASK 0x000000ff |
| 6984 | #define A6XX_HLSQ_CS_CNTL_CONSTLEN__SHIFT 0 | 7396 | #define A6XX_HLSQ_CS_CNTL_CONSTLEN__SHIFT 0 |
| @@ -7124,7 +7536,19 @@ static inline uint32_t A6XX_HLSQ_LOAD_STATE_FRAG_EXT_SRC_ADDR(uint32_t val) · 139 unmodified lines | |||
| 7124 | 7536 | ||
| 7125 | static inline uint32_t REG_A6XX_HLSQ_CS_BINDLESS_BASE(uint32_t i0) { return 0x0000b9c0 + 0x2*i0; } | 7537 | static inline uint32_t REG_A6XX_HLSQ_CS_BINDLESS_BASE(uint32_t i0) { return 0x0000b9c0 + 0x2*i0; } |
| 7126 | 7538 | ||
| 7127 | static inline uint32_t REG_A6XX_HLSQ_CS_BINDLESS_BASE_ADDR(uint32_t i0) { return 0x0000b9c0 + 0x2*i0; } | 7539 | static inline uint32_t REG_A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR(uint32_t i0) { return 0x0000b9c0 + 0x2*i0; } |
| 7540 | #define A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__MASK 0x00000003 | ||
| 7541 | #define A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__SHIFT 0 | ||
| 7542 | static inline uint32_t A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE(enum a6xx_bindless_descriptor_size val) | ||
| 7543 | { | ||
| 7544 | return ((val) << A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__SHIFT) & A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__MASK; | ||
| 7545 | } | ||
| 7546 | #define A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_ADDR__MASK 0xfffffffc | ||
| 7547 | #define A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_ADDR__SHIFT 2 | ||
| 7548 | static inline uint32_t A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_ADDR(uint32_t val) | ||
| 7549 | { | ||
| 7550 | return ((val >> 2) << A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_ADDR__SHIFT) & A6XX_HLSQ_CS_BINDLESS_BASE_DESCRIPTOR_ADDR__MASK; | ||
| 7551 | } | ||
| 7128 | 7552 | ||
| 7129 | #define REG_A6XX_HLSQ_CS_UNKNOWN_B9D0 0x0000b9d0 | 7553 | #define REG_A6XX_HLSQ_CS_UNKNOWN_B9D0 0x0000b9d0 |
| 7130 | #define A6XX_HLSQ_CS_UNKNOWN_B9D0_SHARED_SIZE__MASK 0x0000001f | 7554 | #define A6XX_HLSQ_CS_UNKNOWN_B9D0_SHARED_SIZE__MASK 0x0000001f |
| @@ -7204,7 +7628,19 @@ static inline uint32_t A6XX_HLSQ_FS_CNTL_CONSTLEN(uint32_t val) · 73 unmodified lines | |||
| 7204 | 7628 | ||
| 7205 | static inline uint32_t REG_A6XX_HLSQ_BINDLESS_BASE(uint32_t i0) { return 0x0000bb20 + 0x2*i0; } | 7629 | static inline uint32_t REG_A6XX_HLSQ_BINDLESS_BASE(uint32_t i0) { return 0x0000bb20 + 0x2*i0; } |
| 7206 | 7630 | ||
| 7207 | static inline uint32_t REG_A6XX_HLSQ_BINDLESS_BASE_ADDR(uint32_t i0) { return 0x0000bb20 + 0x2*i0; } | 7631 | static inline uint32_t REG_A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR(uint32_t i0) { return 0x0000bb20 + 0x2*i0; } |
| 7632 | #define A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__MASK 0x00000003 | ||
| 7633 | #define A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__SHIFT 0 | ||
| 7634 | static inline uint32_t A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE(enum a6xx_bindless_descriptor_size val) | ||
| 7635 | { | ||
| 7636 | return ((val) << A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__SHIFT) & A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_DESC_SIZE__MASK; | ||
| 7637 | } | ||
| 7638 | #define A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_ADDR__MASK 0xfffffffc | ||
| 7639 | #define A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_ADDR__SHIFT 2 | ||
| 7640 | static inline uint32_t A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_ADDR(uint32_t val) | ||
| 7641 | { | ||
| 7642 | return ((val >> 2) << A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_ADDR__SHIFT) & A6XX_HLSQ_BINDLESS_BASE_DESCRIPTOR_ADDR__MASK; | ||
| 7643 | } | ||
| 7208 | 7644 | ||
| 7209 | #define REG_A6XX_HLSQ_2D_EVENT_CMD 0x0000bd80 | 7645 | #define REG_A6XX_HLSQ_2D_EVENT_CMD 0x0000bd80 |
| 7210 | #define A6XX_HLSQ_2D_EVENT_CMD_STATE_ID__MASK 0x0000ff00 | 7646 | #define A6XX_HLSQ_2D_EVENT_CMD_STATE_ID__MASK 0x0000ff00 |
| @@ -7224,7 +7660,7 @@ static inline uint32_t A6XX_HLSQ_2D_EVENT_CMD_EVENT(enum vgt_event_type val) · 13 unmodified lines | |||
| 7224 | 7660 | ||
| 7225 | #define REG_A6XX_HLSQ_UNKNOWN_BE01 0x0000be01 | 7661 | #define REG_A6XX_HLSQ_UNKNOWN_BE01 0x0000be01 |
| 7226 | 7662 | ||
| 7227 | #define REG_A6XX_HLSQ_UNKNOWN_BE04 0x0000be04 | 7663 | #define REG_A6XX_HLSQ_DBG_ECO_CNTL 0x0000be04 |
| 7228 | 7664 | ||
| 7229 | #define REG_A6XX_HLSQ_ADDR_MODE_CNTL 0x0000be05 | 7665 | #define REG_A6XX_HLSQ_ADDR_MODE_CNTL 0x0000be05 |
| 7230 | 7666 | ||
| @@ -7234,6 +7670,8 @@ static inline uint32_t REG_A6XX_HLSQ_PERFCTR_HLSQ_SEL(uint32_t i0) { return 0x00 · 3 unmodified lines | |||
| 7234 | 7670 | ||
| 7235 | #define REG_A6XX_HLSQ_CONTEXT_SWITCH_GFX_PREEMPTION_SAFE_MODE 0x0000be22 | 7671 | #define REG_A6XX_HLSQ_CONTEXT_SWITCH_GFX_PREEMPTION_SAFE_MODE 0x0000be22 |
| 7236 | 7672 | ||
| 7673 | #define REG_A7XX_SP_AHB_READ_APERTURE 0x0000c000 | ||
| 7674 | |||
| 7237 | #define REG_A6XX_CP_EVENT_START 0x0000d600 | 7675 | #define REG_A6XX_CP_EVENT_START 0x0000d600 |
| 7238 | #define A6XX_CP_EVENT_START_STATE_ID__MASK 0x000000ff | 7676 | #define A6XX_CP_EVENT_START_STATE_ID__MASK 0x000000ff |
| 7239 | #define A6XX_CP_EVENT_START_STATE_ID__SHIFT 0 | 7677 | #define A6XX_CP_EVENT_START_STATE_ID__SHIFT 0 |
| @@ -7426,7 +7864,18 @@ static inline uint32_t A6XX_TEX_CONST_1_HEIGHT(uint32_t val) · 186 unmodified lines | |||
| 7426 | } | 7864 | } |
| 7427 | 7865 | ||
| 7428 | #define REG_A6XX_TEX_CONST_2 0x00000002 | 7866 | #define REG_A6XX_TEX_CONST_2 0x00000002 |
| 7429 | #define A6XX_TEX_CONST_2_BUFFER 0x00000010 | 7867 | #define A6XX_TEX_CONST_2_STRUCTSIZETEXELS__MASK 0x0000fff0 |
| 7868 | #define A6XX_TEX_CONST_2_STRUCTSIZETEXELS__SHIFT 4 | ||
| 7869 | static inline uint32_t A6XX_TEX_CONST_2_STRUCTSIZETEXELS(uint32_t val) | ||
| 7870 | { | ||
| 7871 | return ((val) << A6XX_TEX_CONST_2_STRUCTSIZETEXELS__SHIFT) & A6XX_TEX_CONST_2_STRUCTSIZETEXELS__MASK; | ||
| 7872 | } | ||
| 7873 | #define A6XX_TEX_CONST_2_STARTOFFSETTEXELS__MASK 0x003f0000 | ||
| 7874 | #define A6XX_TEX_CONST_2_STARTOFFSETTEXELS__SHIFT 16 | ||
| 7875 | static inline uint32_t A6XX_TEX_CONST_2_STARTOFFSETTEXELS(uint32_t val) | ||
| 7876 | { | ||
| 7877 | return ((val) << A6XX_TEX_CONST_2_STARTOFFSETTEXELS__SHIFT) & A6XX_TEX_CONST_2_STARTOFFSETTEXELS__MASK; | ||
| 7878 | } | ||
| 7430 | #define A6XX_TEX_CONST_2_PITCHALIGN__MASK 0x0000000f | 7879 | #define A6XX_TEX_CONST_2_PITCHALIGN__MASK 0x0000000f |
| 7431 | #define A6XX_TEX_CONST_2_PITCHALIGN__SHIFT 0 | 7880 | #define A6XX_TEX_CONST_2_PITCHALIGN__SHIFT 0 |
| 7432 | static inline uint32_t A6XX_TEX_CONST_2_PITCHALIGN(uint32_t val) | 7881 | static inline uint32_t A6XX_TEX_CONST_2_PITCHALIGN(uint32_t val) |
| @@ -7485,6 +7934,12 @@ static inline uint32_t A6XX_TEX_CONST_5_DEPTH(uint32_t val) · 52 unmodified lines | |||
| 7485 | } | 7934 | } |
| 7486 | 7935 | ||
| 7487 | #define REG_A6XX_TEX_CONST_6 0x00000006 | 7936 | #define REG_A6XX_TEX_CONST_6 0x00000006 |
| 7937 | #define A6XX_TEX_CONST_6_MIN_LOD_CLAMP__MASK 0x00000fff | ||
| 7938 | #define A6XX_TEX_CONST_6_MIN_LOD_CLAMP__SHIFT 0 | ||
| 7939 | static inline uint32_t A6XX_TEX_CONST_6_MIN_LOD_CLAMP(float val) | ||
| 7940 | { | ||
| 7941 | return ((((uint32_t)(val * 256.0))) << A6XX_TEX_CONST_6_MIN_LOD_CLAMP__SHIFT) & A6XX_TEX_CONST_6_MIN_LOD_CLAMP__MASK; | ||
| 7942 | } | ||
| 7488 | #define A6XX_TEX_CONST_6_PLANE_PITCH__MASK 0xffffff00 | 7943 | #define A6XX_TEX_CONST_6_PLANE_PITCH__MASK 0xffffff00 |
| 7489 | #define A6XX_TEX_CONST_6_PLANE_PITCH__SHIFT 8 | 7944 | #define A6XX_TEX_CONST_6_PLANE_PITCH__SHIFT 8 |
| 7490 | static inline uint32_t A6XX_TEX_CONST_6_PLANE_PITCH(uint32_t val) | 7945 | static inline uint32_t A6XX_TEX_CONST_6_PLANE_PITCH(uint32_t val) |
| @@ -621,6 +621,8 @@ setup_pdc: · 620 unmodified lines | |||
| 621 | /* ensure no writes happen before the uCode is fully written */ | 621 | /* ensure no writes happen before the uCode is fully written */ |
| 622 | wmb(); | 622 | wmb(); |
| 623 | 623 | ||
| 624 | a6xx_rpmh_stop(gmu); | ||
| 625 | |||
| 624 | err: | 626 | err: |
| 625 | if (!IS_ERR_OR_NULL(pdcptr)) | 627 | if (!IS_ERR_OR_NULL(pdcptr)) |
| 626 | iounmap(pdcptr); | 628 | iounmap(pdcptr); |
| @@ -753,7 +755,6 @@ static int a6xx_gmu_fw_load(struct a6xx_gmu *gmu) · 126 unmodified lines | |||
| 753 | 755 | ||
| 754 | static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state) | 756 | static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state) |
| 755 | { | 757 | { |
| 756 | static bool rpmh_init; | ||
| 757 | struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu); | 758 | struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu); |
| 758 | struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; | 759 | struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; |
| 759 | int ret; | 760 | int ret; |
| @@ -776,15 +777,9 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state) · 16 unmodified lines | |||
| 776 | /* Turn on register retention */ | 777 | /* Turn on register retention */ |
| 777 | gmu_write(gmu, REG_A6XX_GMU_GENERAL_7, 1); | 778 | gmu_write(gmu, REG_A6XX_GMU_GENERAL_7, 1); |
| 778 | 779 | ||
| 779 | /* We only need to load the RPMh microcode once */ | 780 | ret = a6xx_rpmh_start(gmu); |
| 780 | if (!rpmh_init) { | 781 | if (ret) |
| 781 | a6xx_gmu_rpmh_init(gmu); | 782 | return ret; |
| 782 | rpmh_init = true; | ||
| 783 | } else { | ||
| 784 | ret = a6xx_rpmh_start(gmu); | ||
| 785 | if (ret) | ||
| 786 | return ret; | ||
| 787 | } | ||
| 788 | 783 | ||
| 789 | ret = a6xx_gmu_fw_load(gmu); | 784 | ret = a6xx_gmu_fw_load(gmu); |
| 790 | if (ret) | 785 | if (ret) |
| @@ -1482,6 +1477,12 @@ void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu) · 691 unmodified lines | |||
| 1482 | 1477 | ||
| 1483 | pm_runtime_force_suspend(gmu->dev); | 1478 | pm_runtime_force_suspend(gmu->dev); |
| 1484 | 1479 | ||
| 1480 | /* | ||
| 1481 | * Since cxpd is a virt device, the devlink with gmu-dev will be removed | ||
| 1482 | * automatically when we do detach | ||
| 1483 | */ | ||
| 1484 | dev_pm_domain_detach(gmu->cxpd, false); | ||
| 1485 | |||
| 1485 | if (!IS_ERR_OR_NULL(gmu->gxpd)) { | 1486 | if (!IS_ERR_OR_NULL(gmu->gxpd)) { |
| 1486 | pm_runtime_disable(gmu->gxpd); | 1487 | pm_runtime_disable(gmu->gxpd); |
| 1487 | dev_pm_domain_detach(gmu->gxpd, false); | 1488 | dev_pm_domain_detach(gmu->gxpd, false); |
| @@ -1504,6 +1505,17 @@ void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu) · 16 unmodified lines | |||
| 1504 | gmu->initialized = false; | 1505 | gmu->initialized = false; |
| 1505 | } | 1506 | } |
| 1506 | 1507 | ||
| 1508 | static int cxpd_notifier_cb(struct notifier_block *nb, | ||
| 1509 | unsigned long action, void *data) | ||
| 1510 | { | ||
| 1511 | struct a6xx_gmu *gmu = container_of(nb, struct a6xx_gmu, pd_nb); | ||
| 1512 | |||
| 1513 | if (action == GENPD_NOTIFY_OFF) | ||
| 1514 | complete_all(&gmu->pd_gate); | ||
| 1515 | |||
| 1516 | return 0; | ||
| 1517 | } | ||
| 1518 | |||
| 1507 | int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) | 1519 | int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) |
| 1508 | { | 1520 | { |
| 1509 | struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; | 1521 | struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; |
| @@ -1608,8 +1620,10 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) · 98 unmodified lines | |||
| 1608 | 1620 | ||
| 1609 | if (adreno_is_a650_family(adreno_gpu)) { | 1621 | if (adreno_is_a650_family(adreno_gpu)) { |
| 1610 | gmu->rscc = a6xx_gmu_get_mmio(pdev, "rscc"); | 1622 | gmu->rscc = a6xx_gmu_get_mmio(pdev, "rscc"); |
| 1611 | if (IS_ERR(gmu->rscc)) | 1623 | if (IS_ERR(gmu->rscc)) { |
| 1624 | ret = -ENODEV; | ||
| 1612 | goto err_mmio; | 1625 | goto err_mmio; |
| 1626 | } | ||
| 1613 | } else { | 1627 | } else { |
| 1614 | gmu->rscc = gmu->mmio + 0x23000; | 1628 | gmu->rscc = gmu->mmio + 0x23000; |
| 1615 | } | 1629 | } |
| @@ -1618,8 +1632,26 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) · 2 unmodified lines | |||
| 1618 | gmu->hfi_irq = a6xx_gmu_get_irq(gmu, pdev, "hfi", a6xx_hfi_irq); | 1632 | gmu->hfi_irq = a6xx_gmu_get_irq(gmu, pdev, "hfi", a6xx_hfi_irq); |
| 1619 | gmu->gmu_irq = a6xx_gmu_get_irq(gmu, pdev, "gmu", a6xx_gmu_irq); | 1633 | gmu->gmu_irq = a6xx_gmu_get_irq(gmu, pdev, "gmu", a6xx_gmu_irq); |
| 1620 | 1634 | ||
| 1621 | if (gmu->hfi_irq < 0 || gmu->gmu_irq < 0) | 1635 | if (gmu->hfi_irq < 0 || gmu->gmu_irq < 0) { |
| 1636 | ret = -ENODEV; | ||
| 1622 | goto err_mmio; | 1637 | goto err_mmio; |
| 1638 | } | ||
| 1639 | |||
| 1640 | gmu->cxpd = dev_pm_domain_attach_by_name(gmu->dev, "cx"); | ||
| 1641 | if (IS_ERR(gmu->cxpd)) { | ||
| 1642 | ret = PTR_ERR(gmu->cxpd); | ||
| 1643 | goto err_mmio; | ||
| 1644 | } | ||
| 1645 | |||
| 1646 | if (!device_link_add(gmu->dev, gmu->cxpd, | ||
| 1647 | DL_FLAG_PM_RUNTIME)) { | ||
| 1648 | ret = -ENODEV; | ||
| 1649 | goto detach_cxpd; | ||
| 1650 | } | ||
| 1651 | |||
| 1652 | init_completion(&gmu->pd_gate); | ||
| 1653 | complete_all(&gmu->pd_gate); | ||
| 1654 | gmu->pd_nb.notifier_call = cxpd_notifier_cb; | ||
| 1623 | 1655 | ||
| 1624 | /* | 1656 | /* |
| 1625 | * Get a link to the GX power domain to reset the GPU in case of GMU | 1657 | * Get a link to the GX power domain to reset the GPU in case of GMU |
| @@ -1633,10 +1665,16 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) · 7 unmodified lines | |||
| 1633 | /* Set up the HFI queues */ | 1665 | /* Set up the HFI queues */ |
| 1634 | a6xx_hfi_init(gmu); | 1666 | a6xx_hfi_init(gmu); |
| 1635 | 1667 | ||
| 1668 | /* Initialize RPMh */ | ||
| 1669 | a6xx_gmu_rpmh_init(gmu); | ||
| 1670 | |||
| 1636 | gmu->initialized = true; | 1671 | gmu->initialized = true; |
| 1637 | 1672 | ||
| 1638 | return 0; | 1673 | return 0; |
| 1639 | 1674 | ||
| 1675 | detach_cxpd: | ||
| 1676 | dev_pm_domain_detach(gmu->cxpd, false); | ||
| 1677 | |||
| 1640 | err_mmio: | 1678 | err_mmio: |
| 1641 | iounmap(gmu->mmio); | 1679 | iounmap(gmu->mmio); |
| 1642 | if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "rscc")) | 1680 | if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "rscc")) |
| @@ -1644,8 +1682,6 @@ err_mmio: · 1 unmodified line | |||
| 1644 | free_irq(gmu->gmu_irq, gmu); | 1682 | free_irq(gmu->gmu_irq, gmu); |
| 1645 | free_irq(gmu->hfi_irq, gmu); | 1683 | free_irq(gmu->hfi_irq, gmu); |
| 1646 | 1684 | ||
| 1647 | ret = -ENODEV; | ||
| 1648 | |||
| 1649 | err_memory: | 1685 | err_memory: |
| 1650 | a6xx_gmu_memory_free(gmu); | 1686 | a6xx_gmu_memory_free(gmu); |
| 1651 | err_put_device: | 1687 | err_put_device: |
| @@ -4,8 +4,10 @@ · 3 unmodified lines | |||
| 4 | #ifndef _A6XX_GMU_H_ | 4 | #ifndef _A6XX_GMU_H_ |
| 5 | #define _A6XX_GMU_H_ | 5 | #define _A6XX_GMU_H_ |
| 6 | 6 | ||
| 7 | #include <linux/completion.h> | ||
| 7 | #include <linux/iopoll.h> | 8 | #include <linux/iopoll.h> |
| 8 | #include <linux/interrupt.h> | 9 | #include <linux/interrupt.h> |
| 10 | #include <linux/notifier.h> | ||
| 9 | #include "msm_drv.h" | 11 | #include "msm_drv.h" |
| 10 | #include "a6xx_hfi.h" | 12 | #include "a6xx_hfi.h" |
| 11 | 13 | ||
| @@ -56,6 +58,7 @@ struct a6xx_gmu { · 44 unmodified lines | |||
| 56 | int gmu_irq; | 58 | int gmu_irq; |
| 57 | 59 | ||
| 58 | struct device *gxpd; | 60 | struct device *gxpd; |
| 61 | struct device *cxpd; | ||
| 59 | 62 | ||
| 60 | int idle_level; | 63 | int idle_level; |
| 61 | 64 | ||
| @@ -89,6 +92,10 @@ struct a6xx_gmu { · 27 unmodified lines | |||
| 89 | bool initialized; | 92 | bool initialized; |
| 90 | bool hung; | 93 | bool hung; |
| 91 | bool legacy; /* a618 or a630 */ | 94 | bool legacy; /* a618 or a630 */ |
| 95 | |||
| 96 | /* For power domain callback */ | ||
| 97 | struct notifier_block pd_nb; | ||
| 98 | struct completion pd_gate; | ||
| 92 | }; | 99 | }; |
| 93 | 100 | ||
| 94 | static inline u32 gmu_read(struct a6xx_gmu *gmu, u32 offset) | 101 | static inline u32 gmu_read(struct a6xx_gmu *gmu, u32 offset) |
| @@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2021-01-30 18:25:22) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 15434 bytes, from 2023-03-10 18:32:53) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11404 bytes, from 2023-03-10 18:32:53) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 9055 bytes, from 2023-03-10 18:32:52) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52) |
| 24 | 24 | ||
| 25 | Copyright (C) 2013-2021 by the following authors: | 25 | Copyright (C) 2013-2023 by the following authors: |
| 26 | - Rob Clark <robdclark@gmail.com> (robclark) | 26 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 28 | 28 | ||
| @@ -10,7 +10,7 @@ · 9 unmodified lines | |||
| 10 | 10 | ||
| 11 | #include <linux/bitfield.h> | 11 | #include <linux/bitfield.h> |
| 12 | #include <linux/devfreq.h> | 12 | #include <linux/devfreq.h> |
| 13 | #include <linux/reset.h> | 13 | #include <linux/pm_domain.h> |
| 14 | #include <linux/soc/qcom/llcc-qcom.h> | 14 | #include <linux/soc/qcom/llcc-qcom.h> |
| 15 | 15 | ||
| 16 | #define GPU_PAS_ID 13 | 16 | #define GPU_PAS_ID 13 |
| @@ -187,7 +187,7 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) · 170 unmodified lines | |||
| 187 | * GPU registers so we need to add 0x1a800 to the register value on A630 | 187 | * GPU registers so we need to add 0x1a800 to the register value on A630 |
| 188 | * to get the right value from PM4. | 188 | * to get the right value from PM4. |
| 189 | */ | 189 | */ |
| 190 | get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO, | 190 | get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER, |
| 191 | rbmemptr_stats(ring, index, alwayson_start)); | 191 | rbmemptr_stats(ring, index, alwayson_start)); |
| 192 | 192 | ||
| 193 | /* Invalidate CCU depth and color */ | 193 | /* Invalidate CCU depth and color */ |
| @@ -228,7 +228,7 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) · 34 unmodified lines | |||
| 228 | 228 | ||
| 229 | get_stats_counter(ring, REG_A6XX_RBBM_PERFCTR_CP(0), | 229 | get_stats_counter(ring, REG_A6XX_RBBM_PERFCTR_CP(0), |
| 230 | rbmemptr_stats(ring, index, cpcycles_end)); | 230 | rbmemptr_stats(ring, index, cpcycles_end)); |
| 231 | get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO, | 231 | get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER, |
| 232 | rbmemptr_stats(ring, index, alwayson_end)); | 232 | rbmemptr_stats(ring, index, alwayson_end)); |
| 233 | 233 | ||
| 234 | /* Write the fence to the scratch register */ | 234 | /* Write the fence to the scratch register */ |
| @@ -247,7 +247,7 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) · 12 unmodified lines | |||
| 247 | OUT_RING(ring, submit->seqno); | 247 | OUT_RING(ring, submit->seqno); |
| 248 | 248 | ||
| 249 | trace_msm_gpu_submit_flush(submit, | 249 | trace_msm_gpu_submit_flush(submit, |
| 250 | gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO)); | 250 | gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER)); |
| 251 | 251 | ||
| 252 | a6xx_flush(gpu, ring); | 252 | a6xx_flush(gpu, ring); |
| 253 | } | 253 | } |
| @@ -917,7 +917,7 @@ out: · 663 unmodified lines | |||
| 917 | return ret; | 917 | return ret; |
| 918 | } | 918 | } |
| 919 | 919 | ||
| 920 | static int a6xx_ucode_init(struct msm_gpu *gpu) | 920 | static int a6xx_ucode_load(struct msm_gpu *gpu) |
| 921 | { | 921 | { |
| 922 | struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); | 922 | struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); |
| 923 | struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu); | 923 | struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu); |
| @@ -946,7 +946,23 @@ static int a6xx_ucode_init(struct msm_gpu *gpu) · 22 unmodified lines | |||
| 946 | } | 946 | } |
| 947 | } | 947 | } |
| 948 | 948 | ||
| 949 | gpu_write64(gpu, REG_A6XX_CP_SQE_INSTR_BASE, a6xx_gpu->sqe_iova); | 949 | /* |
| 950 | * Expanded APRIV and targets that support WHERE_AM_I both need a | ||
| 951 | * privileged buffer to store the RPTR shadow | ||
| 952 | */ | ||
| 953 | if ((adreno_gpu->base.hw_apriv || a6xx_gpu->has_whereami) && | ||
| 954 | !a6xx_gpu->shadow_bo) { | ||
| 955 | a6xx_gpu->shadow = msm_gem_kernel_new(gpu->dev, | ||
| 956 | sizeof(u32) * gpu->nr_rings, | ||
| 957 | MSM_BO_WC | MSM_BO_MAP_PRIV, | ||
| 958 | gpu->aspace, &a6xx_gpu->shadow_bo, | ||
| 959 | &a6xx_gpu->shadow_iova); | ||
| 960 | |||
| 961 | if (IS_ERR(a6xx_gpu->shadow)) | ||
| 962 | return PTR_ERR(a6xx_gpu->shadow); | ||
| 963 | |||
| 964 | msm_gem_object_set_name(a6xx_gpu->shadow_bo, "shadow"); | ||
| 965 | } | ||
| 950 | 966 | ||
| 951 | return 0; | 967 | return 0; |
| 952 | } | 968 | } |
| @@ -997,7 +1013,7 @@ static int hw_init(struct msm_gpu *gpu) · 44 unmodified lines | |||
| 997 | * memory rendering at this point in time and we don't want to block off | 1013 | * memory rendering at this point in time and we don't want to block off |
| 998 | * part of the virtual memory space. | 1014 | * part of the virtual memory space. |
| 999 | */ | 1015 | */ |
| 1000 | gpu_write64(gpu, REG_A6XX_RBBM_SECVID_TSB_TRUSTED_BASE_LO, 0x00000000); | 1016 | gpu_write64(gpu, REG_A6XX_RBBM_SECVID_TSB_TRUSTED_BASE, 0x00000000); |
| 1001 | gpu_write(gpu, REG_A6XX_RBBM_SECVID_TSB_TRUSTED_SIZE, 0x00000000); | 1017 | gpu_write(gpu, REG_A6XX_RBBM_SECVID_TSB_TRUSTED_SIZE, 0x00000000); |
| 1002 | 1018 | ||
| 1003 | /* Turn on 64 bit addressing for all blocks */ | 1019 | /* Turn on 64 bit addressing for all blocks */ |
| @@ -1037,18 +1053,15 @@ static int hw_init(struct msm_gpu *gpu) · 33 unmodified lines | |||
| 1037 | gpu_write(gpu, REG_A6XX_RBBM_PERFCTR_GPU_BUSY_MASKED, 0xffffffff); | 1053 | gpu_write(gpu, REG_A6XX_RBBM_PERFCTR_GPU_BUSY_MASKED, 0xffffffff); |
| 1038 | 1054 | ||
| 1039 | /* Disable L2 bypass in the UCHE */ | 1055 | /* Disable L2 bypass in the UCHE */ |
| 1040 | gpu_write(gpu, REG_A6XX_UCHE_WRITE_RANGE_MAX_LO, 0xffffffc0); | 1056 | gpu_write64(gpu, REG_A6XX_UCHE_WRITE_RANGE_MAX, 0x0001ffffffffffc0llu); |
| 1041 | gpu_write(gpu, REG_A6XX_UCHE_WRITE_RANGE_MAX_HI, 0x0001ffff); | 1057 | gpu_write64(gpu, REG_A6XX_UCHE_TRAP_BASE, 0x0001fffffffff000llu); |
| 1042 | gpu_write(gpu, REG_A6XX_UCHE_TRAP_BASE_LO, 0xfffff000); | 1058 | gpu_write64(gpu, REG_A6XX_UCHE_WRITE_THRU_BASE, 0x0001fffffffff000llu); |
| 1043 | gpu_write(gpu, REG_A6XX_UCHE_TRAP_BASE_HI, 0x0001ffff); | ||
| 1044 | gpu_write(gpu, REG_A6XX_UCHE_WRITE_THRU_BASE_LO, 0xfffff000); | ||
| 1045 | gpu_write(gpu, REG_A6XX_UCHE_WRITE_THRU_BASE_HI, 0x0001ffff); | ||
| 1046 | 1059 | ||
| 1047 | if (!adreno_is_a650_family(adreno_gpu)) { | 1060 | if (!adreno_is_a650_family(adreno_gpu)) { |
| 1048 | /* Set the GMEM VA range [0x100000:0x100000 + gpu->gmem - 1] */ | 1061 | /* Set the GMEM VA range [0x100000:0x100000 + gpu->gmem - 1] */ |
| 1049 | gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MIN_LO, 0x00100000); | 1062 | gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MIN, 0x00100000); |
| 1050 | 1063 | ||
| 1051 | gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MAX_LO, | 1064 | gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MAX, |
| 1052 | 0x00100000 + adreno_gpu->gmem - 1); | 1065 | 0x00100000 + adreno_gpu->gmem - 1); |
| 1053 | } | 1066 | } |
| 1054 | 1067 | ||
| @@ -1135,9 +1148,7 @@ static int hw_init(struct msm_gpu *gpu) · 80 unmodified lines | |||
| 1135 | if (ret) | 1148 | if (ret) |
| 1136 | goto out; | 1149 | goto out; |
| 1137 | 1150 | ||
| 1138 | ret = a6xx_ucode_init(gpu); | 1151 | gpu_write64(gpu, REG_A6XX_CP_SQE_INSTR_BASE, a6xx_gpu->sqe_iova); |
| 1139 | if (ret) | ||
| 1140 | goto out; | ||
| 1141 | 1152 | ||
| 1142 | /* Set the ringbuffer address */ | 1153 | /* Set the ringbuffer address */ |
| 1143 | gpu_write64(gpu, REG_A6XX_CP_RB_BASE, gpu->rb[0]->iova); | 1154 | gpu_write64(gpu, REG_A6XX_CP_RB_BASE, gpu->rb[0]->iova); |
| @@ -1152,26 +1163,9 @@ static int hw_init(struct msm_gpu *gpu) · 8 unmodified lines | |||
| 1152 | gpu_write(gpu, REG_A6XX_CP_RB_CNTL, | 1163 | gpu_write(gpu, REG_A6XX_CP_RB_CNTL, |
| 1153 | MSM_GPU_RB_CNTL_DEFAULT | AXXX_CP_RB_CNTL_NO_UPDATE); | 1164 | MSM_GPU_RB_CNTL_DEFAULT | AXXX_CP_RB_CNTL_NO_UPDATE); |
| 1154 | 1165 | ||
| 1155 | /* | 1166 | /* Configure the RPTR shadow if needed: */ |
| 1156 | * Expanded APRIV and targets that support WHERE_AM_I both need a | 1167 | if (a6xx_gpu->shadow_bo) { |
| 1157 | * privileged buffer to store the RPTR shadow | 1168 | gpu_write64(gpu, REG_A6XX_CP_RB_RPTR_ADDR, |
| 1158 | */ | ||
| 1159 | |||
| 1160 | if (adreno_gpu->base.hw_apriv || a6xx_gpu->has_whereami) { | ||
| 1161 | if (!a6xx_gpu->shadow_bo) { | ||
| 1162 | a6xx_gpu->shadow = msm_gem_kernel_new(gpu->dev, | ||
| 1163 | sizeof(u32) * gpu->nr_rings, | ||
| 1164 | MSM_BO_WC | MSM_BO_MAP_PRIV, | ||
| 1165 | gpu->aspace, &a6xx_gpu->shadow_bo, | ||
| 1166 | &a6xx_gpu->shadow_iova); | ||
| 1167 | |||
| 1168 | if (IS_ERR(a6xx_gpu->shadow)) | ||
| 1169 | return PTR_ERR(a6xx_gpu->shadow); | ||
| 1170 | |||
| 1171 | msm_gem_object_set_name(a6xx_gpu->shadow_bo, "shadow"); | ||
| 1172 | } | ||
| 1173 | |||
| 1174 | gpu_write64(gpu, REG_A6XX_CP_RB_RPTR_ADDR_LO, | ||
| 1175 | shadowptr(a6xx_gpu, gpu->rb[0])); | 1169 | shadowptr(a6xx_gpu, gpu->rb[0])); |
| 1176 | } | 1170 | } |
| 1177 | 1171 | ||
| @@ -1259,6 +1253,7 @@ static void a6xx_recover(struct msm_gpu *gpu) · 81 unmodified lines | |||
| 1259 | { | 1253 | { |
| 1260 | struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); | 1254 | struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); |
| 1261 | struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu); | 1255 | struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu); |
| 1256 | struct a6xx_gmu *gmu = &a6xx_gpu->gmu; | ||
| 1262 | int i, active_submits; | 1257 | int i, active_submits; |
| 1263 | 1258 | ||
| 1264 | adreno_dump_info(gpu); | 1259 | adreno_dump_info(gpu); |
| @@ -1297,6 +1292,10 @@ static void a6xx_recover(struct msm_gpu *gpu) · 32 unmodified lines | |||
| 1297 | */ | 1292 | */ |
| 1298 | gpu->active_submits = 0; | 1293 | gpu->active_submits = 0; |
| 1299 | 1294 | ||
| 1295 | reinit_completion(&gmu->pd_gate); | ||
| 1296 | dev_pm_genpd_add_notifier(gmu->cxpd, &gmu->pd_nb); | ||
| 1297 | dev_pm_genpd_synced_poweroff(gmu->cxpd); | ||
| 1298 | |||
| 1300 | /* Drop the rpm refcount from active submits */ | 1299 | /* Drop the rpm refcount from active submits */ |
| 1301 | if (active_submits) | 1300 | if (active_submits) |
| 1302 | pm_runtime_put(&gpu->pdev->dev); | 1301 | pm_runtime_put(&gpu->pdev->dev); |
| @@ -1304,8 +1303,10 @@ static void a6xx_recover(struct msm_gpu *gpu) · 1 unmodified line | |||
| 1304 | /* And the final one from recover worker */ | 1303 | /* And the final one from recover worker */ |
| 1305 | pm_runtime_put_sync(&gpu->pdev->dev); | 1304 | pm_runtime_put_sync(&gpu->pdev->dev); |
| 1306 | 1305 | ||
| 1307 | /* Call into gpucc driver to poll for cx gdsc collapse */ | 1306 | if (!wait_for_completion_timeout(&gmu->pd_gate, msecs_to_jiffies(1000))) |
| 1308 | reset_control_reset(gpu->cx_collapse); | 1307 | DRM_DEV_ERROR(&gpu->pdev->dev, "cx gdsc didn't collapse\n"); |
| 1308 | |||
| 1309 | dev_pm_genpd_remove_notifier(gmu->cxpd); | ||
| 1309 | 1310 | ||
| 1310 | pm_runtime_use_autosuspend(&gpu->pdev->dev); | 1311 | pm_runtime_use_autosuspend(&gpu->pdev->dev); |
| 1311 | 1312 | ||
| @@ -1361,73 +1362,23 @@ static const char *a6xx_fault_block(struct msm_gpu *gpu, u32 id) · 49 unmodified lines | |||
| 1361 | return a6xx_uche_fault_block(gpu, id); | 1362 | return a6xx_uche_fault_block(gpu, id); |
| 1362 | } | 1363 | } |
| 1363 | 1364 | ||
| 1364 | #define ARM_SMMU_FSR_TF BIT(1) | ||
| 1365 | #define ARM_SMMU_FSR_PF BIT(3) | ||
| 1366 | #define ARM_SMMU_FSR_EF BIT(4) | ||
| 1367 | |||
| 1368 | static int a6xx_fault_handler(void *arg, unsigned long iova, int flags, void *data) | 1365 | static int a6xx_fault_handler(void *arg, unsigned long iova, int flags, void *data) |
| 1369 | { | 1366 | { |
| 1370 | struct msm_gpu *gpu = arg; | 1367 | struct msm_gpu *gpu = arg; |
| 1371 | struct adreno_smmu_fault_info *info = data; | 1368 | struct adreno_smmu_fault_info *info = data; |
| 1372 | const char *type = "UNKNOWN"; | 1369 | const char *block = "unknown"; |
| 1373 | const char *block; | ||
| 1374 | bool do_devcoredump = info && !READ_ONCE(gpu->crashstate); | ||
| 1375 | |||
| 1376 | /* | ||
| 1377 | * If we aren't going to be resuming later from fault_worker, then do | ||
| 1378 | * it now. | ||
| 1379 | */ | ||
| 1380 | if (!do_devcoredump) { | ||
| 1381 | gpu->aspace->mmu->funcs->resume_translation(gpu->aspace->mmu); | ||
| 1382 | } | ||
| 1383 | 1370 | ||
| 1384 | /* | 1371 | u32 scratch[] = { |
| 1385 | * Print a default message if we couldn't get the data from the | ||
| 1386 | * adreno-smmu-priv | ||
| 1387 | */ | ||
| 1388 | if (!info) { | ||
| 1389 | pr_warn_ratelimited("*** gpu fault: iova=%.16lx flags=%d (%u,%u,%u,%u)\n", | ||
| 1390 | iova, flags, | ||
| 1391 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(4)), | 1372 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(4)), |
| 1392 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(5)), | 1373 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(5)), |
| 1393 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(6)), | 1374 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(6)), |
| 1394 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(7))); | 1375 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(7)), |
| 1395 | 1376 | }; | |
| 1396 | return 0; | ||
| 1397 | } | ||
| 1398 | |||
| 1399 | if (info->fsr & ARM_SMMU_FSR_TF) | ||
| 1400 | type = "TRANSLATION"; | ||
| 1401 | else if (info->fsr & ARM_SMMU_FSR_PF) | ||
| 1402 | type = "PERMISSION"; | ||
| 1403 | else if (info->fsr & ARM_SMMU_FSR_EF) | ||
| 1404 | type = "EXTERNAL"; | ||
| 1405 | |||
| 1406 | block = a6xx_fault_block(gpu, info->fsynr1 & 0xff); | ||
| 1407 | |||
| 1408 | pr_warn_ratelimited("*** gpu fault: ttbr0=%.16llx iova=%.16lx dir=%s type=%s source=%s (%u,%u,%u,%u)\n", | ||
| 1409 | info->ttbr0, iova, | ||
| 1410 | flags & IOMMU_FAULT_WRITE ? "WRITE" : "READ", | ||
| 1411 | type, block, | ||
| 1412 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(4)), | ||
| 1413 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(5)), | ||
| 1414 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(6)), | ||
| 1415 | gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(7))); | ||
| 1416 | |||
| 1417 | if (do_devcoredump) { | ||
| 1418 | /* Turn off the hangcheck timer to keep it from bothering us */ | ||
| 1419 | del_timer(&gpu->hangcheck_timer); | ||
| 1420 | |||
| 1421 | gpu->fault_info.ttbr0 = info->ttbr0; | ||
| 1422 | gpu->fault_info.iova = iova; | ||
| 1423 | gpu->fault_info.flags = flags; | ||
| 1424 | gpu->fault_info.type = type; | ||
| 1425 | gpu->fault_info.block = block; | ||
| 1426 | 1377 | ||
| 1427 | kthread_queue_work(gpu->worker, &gpu->fault_work); | 1378 | if (info) |
| 1428 | } | 1379 | block = a6xx_fault_block(gpu, info->fsynr1 & 0xff); |
| 1429 | 1380 | ||
| 1430 | return 0; | 1381 | return adreno_fault_handler(gpu, iova, flags, info, block, scratch); |
| 1431 | } | 1382 | } |
| 1432 | 1383 | ||
| 1433 | static void a6xx_cp_hw_err_irq(struct msm_gpu *gpu) | 1384 | static void a6xx_cp_hw_err_irq(struct msm_gpu *gpu) |
| @@ -1712,7 +1663,7 @@ static int a6xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) · 278 unmodified lines | |||
| 1712 | /* Force the GPU power on so we can read this register */ | 1663 | /* Force the GPU power on so we can read this register */ |
| 1713 | a6xx_gmu_set_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); | 1664 | a6xx_gmu_set_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); |
| 1714 | 1665 | ||
| 1715 | *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO); | 1666 | *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER); |
| 1716 | 1667 | ||
| 1717 | a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); | 1668 | a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); |
| 1718 | 1669 | ||
| @@ -1848,8 +1799,8 @@ static bool a6xx_progress(struct msm_gpu *gpu, struct msm_ringbuffer *ring) · 129 unmodified lines | |||
| 1848 | * to prevent prefetching into an unrelated submit. (And | 1799 | * to prevent prefetching into an unrelated submit. (And |
| 1849 | * either way, at some point the ROQ will be full.) | 1800 | * either way, at some point the ROQ will be full.) |
| 1850 | */ | 1801 | */ |
| 1851 | cp_state.ib1_rem += gpu_read(gpu, REG_A6XX_CP_CSQ_IB1_STAT) >> 16; | 1802 | cp_state.ib1_rem += gpu_read(gpu, REG_A6XX_CP_ROQ_AVAIL_IB1) >> 16; |
| 1852 | cp_state.ib2_rem += gpu_read(gpu, REG_A6XX_CP_CSQ_IB2_STAT) >> 16; | 1803 | cp_state.ib2_rem += gpu_read(gpu, REG_A6XX_CP_ROQ_AVAIL_IB2) >> 16; |
| 1853 | 1804 | ||
| 1854 | progress = !!memcmp(&cp_state, &ring->last_cp_state, sizeof(cp_state)); | 1805 | progress = !!memcmp(&cp_state, &ring->last_cp_state, sizeof(cp_state)); |
| 1855 | 1806 | ||
| @@ -1886,6 +1837,31 @@ static u32 a619_get_speed_bin(u32 fuse) · 30 unmodified lines | |||
| 1886 | return UINT_MAX; | 1837 | return UINT_MAX; |
| 1887 | } | 1838 | } |
| 1888 | 1839 | ||
| 1840 | static u32 a640_get_speed_bin(u32 fuse) | ||
| 1841 | { | ||
| 1842 | if (fuse == 0) | ||
| 1843 | return 0; | ||
| 1844 | else if (fuse == 1) | ||
| 1845 | return 1; | ||
| 1846 | |||
| 1847 | return UINT_MAX; | ||
| 1848 | } | ||
| 1849 | |||
| 1850 | static u32 a650_get_speed_bin(u32 fuse) | ||
| 1851 | { | ||
| 1852 | if (fuse == 0) | ||
| 1853 | return 0; | ||
| 1854 | else if (fuse == 1) | ||
| 1855 | return 1; | ||
| 1856 | /* Yep, 2 and 3 are swapped! :/ */ | ||
| 1857 | else if (fuse == 2) | ||
| 1858 | return 3; | ||
| 1859 | else if (fuse == 3) | ||
| 1860 | return 2; | ||
| 1861 | |||
| 1862 | return UINT_MAX; | ||
| 1863 | } | ||
| 1864 | |||
| 1889 | static u32 adreno_7c3_get_speed_bin(u32 fuse) | 1865 | static u32 adreno_7c3_get_speed_bin(u32 fuse) |
| 1890 | { | 1866 | { |
| 1891 | if (fuse == 0) | 1867 | if (fuse == 0) |
| @@ -1911,6 +1887,12 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse) · 19 unmodified lines | |||
| 1911 | if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev)) | 1887 | if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev)) |
| 1912 | val = adreno_7c3_get_speed_bin(fuse); | 1888 | val = adreno_7c3_get_speed_bin(fuse); |
| 1913 | 1889 | ||
| 1890 | if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev)) | ||
| 1891 | val = a640_get_speed_bin(fuse); | ||
| 1892 | |||
| 1893 | if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev)) | ||
| 1894 | val = a650_get_speed_bin(fuse); | ||
| 1895 | |||
| 1914 | if (val == UINT_MAX) { | 1896 | if (val == UINT_MAX) { |
| 1915 | DRM_DEV_ERROR(dev, | 1897 | DRM_DEV_ERROR(dev, |
| 1916 | "missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n", | 1898 | "missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n", |
| @@ -1954,6 +1936,7 @@ static const struct adreno_gpu_funcs funcs = { · 37 unmodified lines | |||
| 1954 | .get_param = adreno_get_param, | 1936 | .get_param = adreno_get_param, |
| 1955 | .set_param = adreno_set_param, | 1937 | .set_param = adreno_set_param, |
| 1956 | .hw_init = a6xx_hw_init, | 1938 | .hw_init = a6xx_hw_init, |
| 1939 | .ucode_load = a6xx_ucode_load, | ||
| 1957 | .pm_suspend = a6xx_pm_suspend, | 1940 | .pm_suspend = a6xx_pm_suspend, |
| 1958 | .pm_resume = a6xx_pm_resume, | 1941 | .pm_resume = a6xx_pm_resume, |
| 1959 | .recover = a6xx_recover, | 1942 | .recover = a6xx_recover, |
| @@ -147,7 +147,7 @@ static int a6xx_crashdumper_run(struct msm_gpu *gpu, · 146 unmodified lines | |||
| 147 | /* Make sure all pending memory writes are posted */ | 147 | /* Make sure all pending memory writes are posted */ |
| 148 | wmb(); | 148 | wmb(); |
| 149 | 149 | ||
| 150 | gpu_write64(gpu, REG_A6XX_CP_CRASH_SCRIPT_BASE_LO, dumper->iova); | 150 | gpu_write64(gpu, REG_A6XX_CP_CRASH_SCRIPT_BASE, dumper->iova); |
| 151 | 151 | ||
| 152 | gpu_write(gpu, REG_A6XX_CP_CRASH_DUMP_CNTL, 1); | 152 | gpu_write(gpu, REG_A6XX_CP_CRASH_DUMP_CNTL, 1); |
| 153 | 153 | ||
| @@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2021-01-30 18:25:22) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 15434 bytes, from 2023-03-10 18:32:53) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11404 bytes, from 2023-03-10 18:32:53) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 9055 bytes, from 2023-03-10 18:32:52) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52) |
| 24 | 24 | ||
| 25 | Copyright (C) 2013-2021 by the following authors: | 25 | Copyright (C) 2013-2023 by the following authors: |
| 26 | - Rob Clark <robdclark@gmail.com> (robclark) | 26 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 28 | 28 | ||
| @@ -49,11 +49,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. · 20 unmodified lines | |||
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | enum chip { | 51 | enum chip { |
| 52 | A2XX = 0, | 52 | A2XX = 2, |
| 53 | A3XX = 0, | 53 | A3XX = 3, |
| 54 | A4XX = 0, | 54 | A4XX = 4, |
| 55 | A5XX = 0, | 55 | A5XX = 5, |
| 56 | A6XX = 0, | 56 | A6XX = 6, |
| 57 | A7XX = 7, | ||
| 57 | }; | 58 | }; |
| 58 | 59 | ||
| 59 | enum adreno_pa_su_sc_draw { | 60 | enum adreno_pa_su_sc_draw { |
| @@ -210,6 +211,17 @@ enum a5xx_line_mode { · 150 unmodified lines | |||
| 210 | RECTANGULAR = 1, | 211 | RECTANGULAR = 1, |
| 211 | }; | 212 | }; |
| 212 | 213 | ||
| 214 | enum a6xx_tex_prefetch_cmd { | ||
| 215 | TEX_PREFETCH_UNK0 = 0, | ||
| 216 | TEX_PREFETCH_SAM = 1, | ||
| 217 | TEX_PREFETCH_GATHER4R = 2, | ||
| 218 | TEX_PREFETCH_GATHER4G = 3, | ||
| 219 | TEX_PREFETCH_GATHER4B = 4, | ||
| 220 | TEX_PREFETCH_GATHER4A = 5, | ||
| 221 | TEX_PREFETCH_UNK6 = 6, | ||
| 222 | TEX_PREFETCH_UNK7 = 7, | ||
| 223 | }; | ||
| 224 | |||
| 213 | #define REG_AXXX_CP_RB_BASE 0x000001c0 | 225 | #define REG_AXXX_CP_RB_BASE 0x000001c0 |
| 214 | 226 | ||
| 215 | #define REG_AXXX_CP_RB_CNTL 0x000001c1 | 227 | #define REG_AXXX_CP_RB_CNTL 0x000001c1 |
| @@ -432,31 +432,35 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev) · 431 unmodified lines | |||
| 432 | if (ret) | 432 | if (ret) |
| 433 | return NULL; | 433 | return NULL; |
| 434 | 434 | ||
| 435 | if (gpu->funcs->ucode_load) { | ||
| 436 | ret = gpu->funcs->ucode_load(gpu); | ||
| 437 | if (ret) | ||
| 438 | return NULL; | ||
| 439 | } | ||
| 440 | |||
| 435 | /* | 441 | /* |
| 436 | * Now that we have firmware loaded, and are ready to begin | 442 | * Now that we have firmware loaded, and are ready to begin |
| 437 | * booting the gpu, go ahead and enable runpm: | 443 | * booting the gpu, go ahead and enable runpm: |
| 438 | */ | 444 | */ |
| 439 | pm_runtime_enable(&pdev->dev); | 445 | pm_runtime_enable(&pdev->dev); |
| 440 | 446 | ||
| 441 | /* Make sure pm runtime is active and reset any previous errors */ | ||
| 442 | pm_runtime_set_active(&pdev->dev); | ||
| 443 | |||
| 444 | ret = pm_runtime_get_sync(&pdev->dev); | 447 | ret = pm_runtime_get_sync(&pdev->dev); |
| 445 | if (ret < 0) { | 448 | if (ret < 0) { |
| 446 | pm_runtime_put_sync(&pdev->dev); | 449 | pm_runtime_put_noidle(&pdev->dev); |
| 447 | DRM_DEV_ERROR(dev->dev, "Couldn't power up the GPU: %d\n", ret); | 450 | DRM_DEV_ERROR(dev->dev, "Couldn't power up the GPU: %d\n", ret); |
| 448 | return NULL; | 451 | goto err_disable_rpm; |
| 449 | } | 452 | } |
| 450 | 453 | ||
| 451 | mutex_lock(&gpu->lock); | 454 | mutex_lock(&gpu->lock); |
| 452 | ret = msm_gpu_hw_init(gpu); | 455 | ret = msm_gpu_hw_init(gpu); |
| 453 | mutex_unlock(&gpu->lock); | 456 | mutex_unlock(&gpu->lock); |
| 454 | pm_runtime_put_autosuspend(&pdev->dev); | ||
| 455 | if (ret) { | 457 | if (ret) { |
| 456 | DRM_DEV_ERROR(dev->dev, "gpu hw init failed: %d\n", ret); | 458 | DRM_DEV_ERROR(dev->dev, "gpu hw init failed: %d\n", ret); |
| 457 | return NULL; | 459 | goto err_put_rpm; |
| 458 | } | 460 | } |
| 459 | 461 | ||
| 462 | pm_runtime_put_autosuspend(&pdev->dev); | ||
| 463 | |||
| 460 | #ifdef CONFIG_DEBUG_FS | 464 | #ifdef CONFIG_DEBUG_FS |
| 461 | if (gpu->funcs->debugfs_init) { | 465 | if (gpu->funcs->debugfs_init) { |
| 462 | gpu->funcs->debugfs_init(gpu, dev->primary); | 466 | gpu->funcs->debugfs_init(gpu, dev->primary); |
| @@ -465,6 +469,13 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev) · 2 unmodified lines | |||
| 465 | #endif | 469 | #endif |
| 466 | 470 | ||
| 467 | return gpu; | 471 | return gpu; |
| 472 | |||
| 473 | err_put_rpm: | ||
| 474 | pm_runtime_put_sync_suspend(&pdev->dev); | ||
| 475 | err_disable_rpm: | ||
| 476 | pm_runtime_disable(&pdev->dev); | ||
| 477 | |||
| 478 | return NULL; | ||
| 468 | } | 479 | } |
| 469 | 480 | ||
| 470 | static int find_chipid(struct device *dev, struct adreno_rev *rev) | 481 | static int find_chipid(struct device *dev, struct adreno_rev *rev) |
| @@ -548,6 +559,10 @@ static int adreno_bind(struct device *dev, struct device *master, void *data) · 77 unmodified lines | |||
| 548 | return PTR_ERR(gpu); | 559 | return PTR_ERR(gpu); |
| 549 | } | 560 | } |
| 550 | 561 | ||
| 562 | ret = dev_pm_opp_of_find_icc_paths(dev, NULL); | ||
| 563 | if (ret) | ||
| 564 | return ret; | ||
| 565 | |||
| 551 | return 0; | 566 | return 0; |
| 552 | } | 567 | } |
| 553 | 568 | ||
| @@ -566,8 +581,8 @@ static void adreno_unbind(struct device *dev, struct device *master, · 12 unmodified lines | |||
| 566 | } | 581 | } |
| 567 | 582 | ||
| 568 | static const struct component_ops a3xx_ops = { | 583 | static const struct component_ops a3xx_ops = { |
| 569 | .bind = adreno_bind, | 584 | .bind = adreno_bind, |
| 570 | .unbind = adreno_unbind, | 585 | .unbind = adreno_unbind, |
| 571 | }; | 586 | }; |
| 572 | 587 | ||
| 573 | static void adreno_device_register_headless(void) | 588 | static void adreno_device_register_headless(void) |
| @@ -208,7 +208,7 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, · 207 unmodified lines | |||
| 208 | struct msm_gem_address_space *aspace; | 208 | struct msm_gem_address_space *aspace; |
| 209 | u64 start, size; | 209 | u64 start, size; |
| 210 | 210 | ||
| 211 | mmu = msm_iommu_new(&pdev->dev, quirks); | 211 | mmu = msm_iommu_gpu_new(&pdev->dev, gpu, quirks); |
| 212 | if (IS_ERR_OR_NULL(mmu)) | 212 | if (IS_ERR_OR_NULL(mmu)) |
| 213 | return ERR_CAST(mmu); | 213 | return ERR_CAST(mmu); |
| 214 | 214 | ||
| @@ -246,6 +246,66 @@ u64 adreno_private_address_space_size(struct msm_gpu *gpu) · 31 unmodified lines | |||
| 246 | return SZ_4G; | 246 | return SZ_4G; |
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | #define ARM_SMMU_FSR_TF BIT(1) | ||
| 250 | #define ARM_SMMU_FSR_PF BIT(3) | ||
| 251 | #define ARM_SMMU_FSR_EF BIT(4) | ||
| 252 | |||
| 253 | int adreno_fault_handler(struct msm_gpu *gpu, unsigned long iova, int flags, | ||
| 254 | struct adreno_smmu_fault_info *info, const char *block, | ||
| 255 | u32 scratch[4]) | ||
| 256 | { | ||
| 257 | const char *type = "UNKNOWN"; | ||
| 258 | bool do_devcoredump = info && !READ_ONCE(gpu->crashstate); | ||
| 259 | |||
| 260 | /* | ||
| 261 | * If we aren't going to be resuming later from fault_worker, then do | ||
| 262 | * it now. | ||
| 263 | */ | ||
| 264 | if (!do_devcoredump) { | ||
| 265 | gpu->aspace->mmu->funcs->resume_translation(gpu->aspace->mmu); | ||
| 266 | } | ||
| 267 | |||
| 268 | /* | ||
| 269 | * Print a default message if we couldn't get the data from the | ||
| 270 | * adreno-smmu-priv | ||
| 271 | */ | ||
| 272 | if (!info) { | ||
| 273 | pr_warn_ratelimited("*** gpu fault: iova=%.16lx flags=%d (%u,%u,%u,%u)\n", | ||
| 274 | iova, flags, | ||
| 275 | scratch[0], scratch[1], scratch[2], scratch[3]); | ||
| 276 | |||
| 277 | return 0; | ||
| 278 | } | ||
| 279 | |||
| 280 | if (info->fsr & ARM_SMMU_FSR_TF) | ||
| 281 | type = "TRANSLATION"; | ||
| 282 | else if (info->fsr & ARM_SMMU_FSR_PF) | ||
| 283 | type = "PERMISSION"; | ||
| 284 | else if (info->fsr & ARM_SMMU_FSR_EF) | ||
| 285 | type = "EXTERNAL"; | ||
| 286 | |||
| 287 | pr_warn_ratelimited("*** gpu fault: ttbr0=%.16llx iova=%.16lx dir=%s type=%s source=%s (%u,%u,%u,%u)\n", | ||
| 288 | info->ttbr0, iova, | ||
| 289 | flags & IOMMU_FAULT_WRITE ? "WRITE" : "READ", | ||
| 290 | type, block, | ||
| 291 | scratch[0], scratch[1], scratch[2], scratch[3]); | ||
| 292 | |||
| 293 | if (do_devcoredump) { | ||
| 294 | /* Turn off the hangcheck timer to keep it from bothering us */ | ||
| 295 | del_timer(&gpu->hangcheck_timer); | ||
| 296 | |||
| 297 | gpu->fault_info.ttbr0 = info->ttbr0; | ||
| 298 | gpu->fault_info.iova = iova; | ||
| 299 | gpu->fault_info.flags = flags; | ||
| 300 | gpu->fault_info.type = type; | ||
| 301 | gpu->fault_info.block = block; | ||
| 302 | |||
| 303 | kthread_queue_work(gpu->worker, &gpu->fault_work); | ||
| 304 | } | ||
| 305 | |||
| 306 | return 0; | ||
| 307 | } | ||
| 308 | |||
| 249 | int adreno_get_param(struct msm_gpu *gpu, struct msm_file_private *ctx, | 309 | int adreno_get_param(struct msm_gpu *gpu, struct msm_file_private *ctx, |
| 250 | uint32_t param, uint64_t *value, uint32_t *len) | 310 | uint32_t param, uint64_t *value, uint32_t *len) |
| 251 | { | 311 | { |
| @@ -503,16 +563,9 @@ struct drm_gem_object *adreno_fw_create_bo(struct msm_gpu *gpu, · 251 unmodified lines | |||
| 503 | 563 | ||
| 504 | int adreno_hw_init(struct msm_gpu *gpu) | 564 | int adreno_hw_init(struct msm_gpu *gpu) |
| 505 | { | 565 | { |
| 506 | struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); | ||
| 507 | int ret, i; | ||
| 508 | |||
| 509 | VERB("%s", gpu->name); | 566 | VERB("%s", gpu->name); |
| 510 | 567 | ||
| 511 | ret = adreno_load_fw(adreno_gpu); | 568 | for (int i = 0; i < gpu->nr_rings; i++) { |
| 512 | if (ret) | ||
| 513 | return ret; | ||
| 514 | |||
| 515 | for (i = 0; i < gpu->nr_rings; i++) { | ||
| 516 | struct msm_ringbuffer *ring = gpu->rb[i]; | 569 | struct msm_ringbuffer *ring = gpu->rb[i]; |
| 517 | 570 | ||
| 518 | if (!ring) | 571 | if (!ring) |
| @@ -922,73 +975,46 @@ void adreno_wait_ring(struct msm_ringbuffer *ring, uint32_t ndwords) · 403 unmodified lines | |||
| 922 | ring->id); | 975 | ring->id); |
| 923 | } | 976 | } |
| 924 | 977 | ||
| 925 | /* Get legacy powerlevels from qcom,gpu-pwrlevels and populate the opp table */ | 978 | static int adreno_get_pwrlevels(struct device *dev, |
| 926 | static int adreno_get_legacy_pwrlevels(struct device *dev) | ||
| 927 | { | ||
| 928 | struct device_node *child, *node; | ||
| 929 | int ret; | ||
| 930 | |||
| 931 | node = of_get_compatible_child(dev->of_node, "qcom,gpu-pwrlevels"); | ||
| 932 | if (!node) { | ||
| 933 | DRM_DEV_DEBUG(dev, "Could not find the GPU powerlevels\n"); | ||
| 934 | return -ENXIO; | ||
| 935 | } | ||
| 936 | |||
| 937 | for_each_child_of_node(node, child) { | ||
| 938 | unsigned int val; | ||
| 939 | |||
| 940 | ret = of_property_read_u32(child, "qcom,gpu-freq", &val); | ||
| 941 | if (ret) | ||
| 942 | continue; | ||
| 943 | |||
| 944 | /* | ||
| 945 | * Skip the intentionally bogus clock value found at the bottom | ||
| 946 | * of most legacy frequency tables | ||
| 947 | */ | ||
| 948 | if (val != 27000000) | ||
| 949 | dev_pm_opp_add(dev, val, 0); | ||
| 950 | } | ||
| 951 | |||
| 952 | of_node_put(node); | ||
| 953 | |||
| 954 | return 0; | ||
| 955 | } | ||
| 956 | |||
| 957 | static void adreno_get_pwrlevels(struct device *dev, | ||
| 958 | struct msm_gpu *gpu) | 979 | struct msm_gpu *gpu) |
| 959 | { | 980 | { |
| 981 | struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); | ||
| 960 | unsigned long freq = ULONG_MAX; | 982 | unsigned long freq = ULONG_MAX; |
| 961 | struct dev_pm_opp *opp; | 983 | struct dev_pm_opp *opp; |
| 962 | int ret; | 984 | int ret; |
| 963 | 985 | ||
| 964 | gpu->fast_rate = 0; | 986 | gpu->fast_rate = 0; |
| 965 | 987 | ||
| 966 | /* You down with OPP? */ | 988 | /* devm_pm_opp_of_add_table may error out but will still create an OPP table */ |
| 967 | if (!of_property_present(dev->of_node, "operating-points-v2")) | 989 | ret = devm_pm_opp_of_add_table(dev); |
| 968 | ret = adreno_get_legacy_pwrlevels(dev); | 990 | if (ret == -ENODEV) { |
| 969 | else { | 991 | /* Special cases for ancient hw with ancient DT bindings */ |
| 970 | ret = devm_pm_opp_of_add_table(dev); | 992 | if (adreno_is_a2xx(adreno_gpu)) { |
| 971 | if (ret) | 993 | dev_warn(dev, "Unable to find the OPP table. Falling back to 200 MHz.\n"); |
| 972 | DRM_DEV_ERROR(dev, "Unable to set the OPP table\n"); | 994 | dev_pm_opp_add(dev, 200000000, 0); |
| 973 | } | 995 | } else if (adreno_is_a320(adreno_gpu)) { |
| 974 | 996 | dev_warn(dev, "Unable to find the OPP table. Falling back to 450 MHz.\n"); | |
| 975 | if (!ret) { | 997 | dev_pm_opp_add(dev, 450000000, 0); |
| 976 | /* Find the fastest defined rate */ | 998 | } else { |
| 977 | opp = dev_pm_opp_find_freq_floor(dev, &freq); | 999 | DRM_DEV_ERROR(dev, "Unable to find the OPP table\n"); |
| 978 | if (!IS_ERR(opp)) { | 1000 | return -ENODEV; |
| 979 | gpu->fast_rate = freq; | ||
| 980 | dev_pm_opp_put(opp); | ||
| 981 | } | 1001 | } |
| 1002 | } else if (ret) { | ||
| 1003 | DRM_DEV_ERROR(dev, "Unable to set the OPP table\n"); | ||
| 1004 | return ret; | ||
| 982 | } | 1005 | } |
| 983 | 1006 | ||
| 984 | if (!gpu->fast_rate) { | 1007 | /* Find the fastest defined rate */ |
| 985 | dev_warn(dev, | 1008 | opp = dev_pm_opp_find_freq_floor(dev, &freq); |
| 986 | "Could not find a clock rate. Using a reasonable default\n"); | 1009 | if (IS_ERR(opp)) |
| 987 | /* Pick a suitably safe clock speed for any target */ | 1010 | return PTR_ERR(opp); |
| 988 | gpu->fast_rate = 200000000; | 1011 | |
| 989 | } | 1012 | gpu->fast_rate = freq; |
| 1013 | dev_pm_opp_put(opp); | ||
| 990 | 1014 | ||
| 991 | DBG("fast_rate=%u, slow_rate=27000000", gpu->fast_rate); | 1015 | DBG("fast_rate=%u, slow_rate=27000000", gpu->fast_rate); |
| 1016 | |||
| 1017 | return 0; | ||
| 992 | } | 1018 | } |
| 993 | 1019 | ||
| 994 | int adreno_gpu_ocmem_init(struct device *dev, struct adreno_gpu *adreno_gpu, | 1020 | int adreno_gpu_ocmem_init(struct device *dev, struct adreno_gpu *adreno_gpu, |
| @@ -1046,6 +1072,24 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, · 51 unmodified lines | |||
| 1046 | struct adreno_rev *rev = &config->rev; | 1072 | struct adreno_rev *rev = &config->rev; |
| 1047 | const char *gpu_name; | 1073 | const char *gpu_name; |
| 1048 | u32 speedbin; | 1074 | u32 speedbin; |
| 1075 | int ret; | ||
| 1076 | |||
| 1077 | /* Only handle the core clock when GMU is not in use */ | ||
| 1078 | if (config->rev.core < 6) { | ||
| 1079 | /* | ||
| 1080 | * This can only be done before devm_pm_opp_of_add_table(), or | ||
| 1081 | * dev_pm_opp_set_config() will WARN_ON() | ||
| 1082 | */ | ||
| 1083 | if (IS_ERR(devm_clk_get(dev, "core"))) { | ||
| 1084 | /* | ||
| 1085 | * If "core" is absent, go for the legacy clock name. | ||
| 1086 | * If we got this far in probing, it's a given one of | ||
| 1087 | * them exists. | ||
| 1088 | */ | ||
| 1089 | devm_pm_opp_set_clkname(dev, "core_clk"); | ||
| 1090 | } else | ||
| 1091 | devm_pm_opp_set_clkname(dev, "core"); | ||
| 1092 | } | ||
| 1049 | 1093 | ||
| 1050 | adreno_gpu->funcs = funcs; | 1094 | adreno_gpu->funcs = funcs; |
| 1051 | adreno_gpu->info = adreno_info(config->rev); | 1095 | adreno_gpu->info = adreno_info(config->rev); |
| @@ -1070,7 +1114,9 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, · 18 unmodified lines | |||
| 1070 | 1114 | ||
| 1071 | adreno_gpu_config.nr_rings = nr_rings; | 1115 | adreno_gpu_config.nr_rings = nr_rings; |
| 1072 | 1116 | ||
| 1073 | adreno_get_pwrlevels(dev, gpu); | 1117 | ret = adreno_get_pwrlevels(dev, gpu); |
| 1118 | if (ret) | ||
| 1119 | return ret; | ||
| 1074 | 1120 | ||
| 1075 | pm_runtime_set_autosuspend_delay(dev, | 1121 | pm_runtime_set_autosuspend_delay(dev, |
| 1076 | adreno_gpu->info->inactive_period); | 1122 | adreno_gpu->info->inactive_period); |
| @@ -341,6 +341,10 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, · 340 unmodified lines | |||
| 341 | struct platform_device *pdev, | 341 | struct platform_device *pdev, |
| 342 | unsigned long quirks); | 342 | unsigned long quirks); |
| 343 | 343 | ||
| 344 | int adreno_fault_handler(struct msm_gpu *gpu, unsigned long iova, int flags, | ||
| 345 | struct adreno_smmu_fault_info *info, const char *block, | ||
| 346 | u32 scratch[4]); | ||
| 347 | |||
| 344 | int adreno_read_speedbin(struct device *dev, u32 *speedbin); | 348 | int adreno_read_speedbin(struct device *dev, u32 *speedbin); |
| 345 | 349 | ||
| 346 | /* | 350 | /* |
| @@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2021-01-30 18:25:22) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 15434 bytes, from 2023-03-10 18:32:53) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11404 bytes, from 2023-03-10 18:32:53) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 9055 bytes, from 2023-03-10 18:32:52) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52) |
| 24 | 24 | ||
| 25 | Copyright (C) 2013-2022 by the following authors: | 25 | Copyright (C) 2013-2023 by the following authors: |
| 26 | - Rob Clark <robdclark@gmail.com> (robclark) | 26 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 27 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 28 | 28 | ||
| @@ -76,6 +76,10 @@ enum vgt_event_type { · 47 unmodified lines | |||
| 76 | VS_FETCH_DONE = 27, | 76 | VS_FETCH_DONE = 27, |
| 77 | FACENESS_FLUSH = 28, | 77 | FACENESS_FLUSH = 28, |
| 78 | WT_DONE_TS = 8, | 78 | WT_DONE_TS = 8, |
| 79 | START_FRAGMENT_CTRS = 13, | ||
| 80 | STOP_FRAGMENT_CTRS = 14, | ||
| 81 | START_COMPUTE_CTRS = 15, | ||
| 82 | STOP_COMPUTE_CTRS = 16, | ||
| 79 | FLUSH_SO_0 = 17, | 83 | FLUSH_SO_0 = 17, |
| 80 | FLUSH_SO_1 = 18, | 84 | FLUSH_SO_1 = 18, |
| 81 | FLUSH_SO_2 = 19, | 85 | FLUSH_SO_2 = 19, |
| @@ -86,7 +90,7 @@ enum vgt_event_type { · 4 unmodified lines | |||
| 86 | PC_CCU_FLUSH_DEPTH_TS = 28, | 90 | PC_CCU_FLUSH_DEPTH_TS = 28, |
| 87 | PC_CCU_FLUSH_COLOR_TS = 29, | 91 | PC_CCU_FLUSH_COLOR_TS = 29, |
| 88 | BLIT = 30, | 92 | BLIT = 30, |
| 89 | UNK_25 = 37, | 93 | LRZ_CLEAR = 37, |
| 90 | LRZ_FLUSH = 38, | 94 | LRZ_FLUSH = 38, |
| 91 | BLIT_OP_FILL_2D = 39, | 95 | BLIT_OP_FILL_2D = 39, |
| 92 | BLIT_OP_COPY_2D = 40, | 96 | BLIT_OP_COPY_2D = 40, |
| @@ -95,6 +99,20 @@ enum vgt_event_type { · 2 unmodified lines | |||
| 95 | UNK_2C = 44, | 99 | UNK_2C = 44, |
| 96 | UNK_2D = 45, | 100 | UNK_2D = 45, |
| 97 | CACHE_INVALIDATE = 49, | 101 | CACHE_INVALIDATE = 49, |
| 102 | LABEL = 63, | ||
| 103 | CCU_INVALIDATE_DEPTH = 24, | ||
| 104 | CCU_INVALIDATE_COLOR = 25, | ||
| 105 | CCU_RESOLVE_CLEAN = 26, | ||
| 106 | CCU_FLUSH_DEPTH = 28, | ||
| 107 | CCU_FLUSH_COLOR = 29, | ||
| 108 | CCU_RESOLVE = 30, | ||
| 109 | CCU_END_RESOLVE_GROUP = 31, | ||
| 110 | CCU_CLEAN_DEPTH = 32, | ||
| 111 | CCU_CLEAN_COLOR = 33, | ||
| 112 | CACHE_RESET = 48, | ||
| 113 | CACHE_CLEAN = 49, | ||
| 114 | CACHE_FLUSH7 = 50, | ||
| 115 | CACHE_INVALIDATE7 = 51, | ||
| 98 | }; | 116 | }; |
| 99 | 117 | ||
| 100 | enum pc_di_primtype { | 118 | enum pc_di_primtype { |
| @@ -290,6 +308,9 @@ enum adreno_pm4_type3_packets { · 189 unmodified lines | |||
| 290 | IN_INCR_UPDT_CONST = 86, | 308 | IN_INCR_UPDT_CONST = 86, |
| 291 | IN_INCR_UPDT_INSTR = 87, | 309 | IN_INCR_UPDT_INSTR = 87, |
| 292 | PKT4 = 4, | 310 | PKT4 = 4, |
| 311 | IN_IB_END = 10, | ||
| 312 | IN_GMU_INTERRUPT = 11, | ||
| 313 | IN_PREEMPT = 15, | ||
| 293 | CP_SCRATCH_WRITE = 76, | 314 | CP_SCRATCH_WRITE = 76, |
| 294 | CP_REG_TO_MEM_OFFSET_MEM = 116, | 315 | CP_REG_TO_MEM_OFFSET_MEM = 116, |
| 295 | CP_REG_TO_MEM_OFFSET_REG = 114, | 316 | CP_REG_TO_MEM_OFFSET_REG = 114, |
| @@ -297,10 +318,20 @@ enum adreno_pm4_type3_packets { · 1 unmodified line | |||
| 297 | CP_WAIT_TWO_REGS = 112, | 318 | CP_WAIT_TWO_REGS = 112, |
| 298 | CP_MEMCPY = 117, | 319 | CP_MEMCPY = 117, |
| 299 | CP_SET_BIN_DATA5_OFFSET = 46, | 320 | CP_SET_BIN_DATA5_OFFSET = 46, |
| 321 | CP_CONTEXT_SWITCH = 84, | ||
| 300 | CP_SET_CTXSWITCH_IB = 85, | 322 | CP_SET_CTXSWITCH_IB = 85, |
| 301 | CP_REG_WRITE = 109, | 323 | CP_REG_WRITE = 109, |
| 302 | CP_START_BIN = 80, | 324 | CP_START_BIN = 80, |
| 303 | CP_END_BIN = 81, | 325 | CP_END_BIN = 81, |
| 326 | CP_PREEMPT_DISABLE = 108, | ||
| 327 | CP_WAIT_TIMESTAMP = 20, | ||
| 328 | CP_THREAD_CONTROL = 23, | ||
| 329 | CP_CONTEXT_REG_BUNCH2 = 93, | ||
| 330 | CP_UNK15 = 21, | ||
| 331 | CP_UNK16 = 22, | ||
| 332 | CP_UNK18 = 24, | ||
| 333 | CP_UNK1B = 27, | ||
| 334 | CP_UNK49 = 73, | ||
| 304 | }; | 335 | }; |
| 305 | 336 | ||
| 306 | enum adreno_state_block { | 337 | enum adreno_state_block { |
| @@ -480,6 +511,13 @@ enum reg_tracker { · 173 unmodified lines | |||
| 480 | TRACK_CNTL_REG = 1, | 511 | TRACK_CNTL_REG = 1, |
| 481 | TRACK_RENDER_CNTL = 2, | 512 | TRACK_RENDER_CNTL = 2, |
| 482 | UNK_EVENT_WRITE = 4, | 513 | UNK_EVENT_WRITE = 4, |
| 514 | TRACK_LRZ = 8, | ||
| 515 | }; | ||
| 516 | |||
| 517 | enum cp_thread { | ||
| 518 | CP_SET_THREAD_BR = 1, | ||
| 519 | CP_SET_THREAD_BV = 2, | ||
| 520 | CP_SET_THREAD_BOTH = 3, | ||
| 483 | }; | 521 | }; |
| 484 | 522 | ||
| 485 | #define REG_CP_LOAD_STATE_0 0x00000000 | 523 | #define REG_CP_LOAD_STATE_0 0x00000000 |
| @@ -1256,6 +1294,10 @@ static inline uint32_t CP_SET_BIN_DATA5_6_BIN_PRIM_STRM_HI(uint32_t val) · 770 unmodified lines | |||
| 1256 | return ((val) << CP_SET_BIN_DATA5_6_BIN_PRIM_STRM_HI__SHIFT) & CP_SET_BIN_DATA5_6_BIN_PRIM_STRM_HI__MASK; | 1294 | return ((val) << CP_SET_BIN_DATA5_6_BIN_PRIM_STRM_HI__SHIFT) & CP_SET_BIN_DATA5_6_BIN_PRIM_STRM_HI__MASK; |
| 1257 | } | 1295 | } |
| 1258 | 1296 | ||
| 1297 | #define REG_CP_SET_BIN_DATA5_7 0x00000007 | ||
| 1298 | |||
| 1299 | #define REG_CP_SET_BIN_DATA5_9 0x00000009 | ||
| 1300 | |||
| 1259 | #define REG_CP_SET_BIN_DATA5_OFFSET_0 0x00000000 | 1301 | #define REG_CP_SET_BIN_DATA5_OFFSET_0 0x00000000 |
| 1260 | #define CP_SET_BIN_DATA5_OFFSET_0_VSC_SIZE__MASK 0x003f0000 | 1302 | #define CP_SET_BIN_DATA5_OFFSET_0_VSC_SIZE__MASK 0x003f0000 |
| 1261 | #define CP_SET_BIN_DATA5_OFFSET_0_VSC_SIZE__SHIFT 16 | 1303 | #define CP_SET_BIN_DATA5_OFFSET_0_VSC_SIZE__SHIFT 16 |
| @@ -2202,7 +2244,18 @@ static inline uint32_t A6XX_CP_REG_TEST_0_BIT(uint32_t val) · 940 unmodified lines | |||
| 2202 | { | 2244 | { |
| 2203 | return ((val) << A6XX_CP_REG_TEST_0_BIT__SHIFT) & A6XX_CP_REG_TEST_0_BIT__MASK; | 2245 | return ((val) << A6XX_CP_REG_TEST_0_BIT__SHIFT) & A6XX_CP_REG_TEST_0_BIT__MASK; |
| 2204 | } | 2246 | } |
| 2205 | #define A6XX_CP_REG_TEST_0_WAIT_FOR_ME 0x02000000 | 2247 | #define A6XX_CP_REG_TEST_0_SKIP_WAIT_FOR_ME 0x02000000 |
| 2248 | #define A6XX_CP_REG_TEST_0_PRED_BIT__MASK 0x7c000000 | ||
| 2249 | #define A6XX_CP_REG_TEST_0_PRED_BIT__SHIFT 26 | ||
| 2250 | static inline uint32_t A6XX_CP_REG_TEST_0_PRED_BIT(uint32_t val) | ||
| 2251 | { | ||
| 2252 | return ((val) << A6XX_CP_REG_TEST_0_PRED_BIT__SHIFT) & A6XX_CP_REG_TEST_0_PRED_BIT__MASK; | ||
| 2253 | } | ||
| 2254 | #define A6XX_CP_REG_TEST_0_PRED_UPDATE 0x80000000 | ||
| 2255 | |||
| 2256 | #define REG_A6XX_CP_REG_TEST_PRED_MASK 0x00000001 | ||
| 2257 | |||
| 2258 | #define REG_A6XX_CP_REG_TEST_PRED_VAL 0x00000002 | ||
| 2206 | 2259 | ||
| 2207 | #define REG_CP_COND_REG_EXEC_0 0x00000000 | 2260 | #define REG_CP_COND_REG_EXEC_0 0x00000000 |
| 2208 | #define CP_COND_REG_EXEC_0_REG0__MASK 0x0003ffff | 2261 | #define CP_COND_REG_EXEC_0_REG0__MASK 0x0003ffff |
| @@ -2211,6 +2264,12 @@ static inline uint32_t CP_COND_REG_EXEC_0_REG0(uint32_t val) · 2 unmodified lines | |||
| 2211 | { | 2264 | { |
| 2212 | return ((val) << CP_COND_REG_EXEC_0_REG0__SHIFT) & CP_COND_REG_EXEC_0_REG0__MASK; | 2265 | return ((val) << CP_COND_REG_EXEC_0_REG0__SHIFT) & CP_COND_REG_EXEC_0_REG0__MASK; |
| 2213 | } | 2266 | } |
| 2267 | #define CP_COND_REG_EXEC_0_PRED_BIT__MASK 0x007c0000 | ||
| 2268 | #define CP_COND_REG_EXEC_0_PRED_BIT__SHIFT 18 | ||
| 2269 | static inline uint32_t CP_COND_REG_EXEC_0_PRED_BIT(uint32_t val) | ||
| 2270 | { | ||
| 2271 | return ((val) << CP_COND_REG_EXEC_0_PRED_BIT__SHIFT) & CP_COND_REG_EXEC_0_PRED_BIT__MASK; | ||
| 2272 | } | ||
| 2214 | #define CP_COND_REG_EXEC_0_BINNING 0x02000000 | 2273 | #define CP_COND_REG_EXEC_0_BINNING 0x02000000 |
| 2215 | #define CP_COND_REG_EXEC_0_GMEM 0x04000000 | 2274 | #define CP_COND_REG_EXEC_0_GMEM 0x04000000 |
| 2216 | #define CP_COND_REG_EXEC_0_SYSMEM 0x08000000 | 2275 | #define CP_COND_REG_EXEC_0_SYSMEM 0x08000000 |
| @@ -2308,13 +2367,17 @@ static inline uint32_t CP_SET_CTXSWITCH_IB_2_TYPE(enum ctxswitch_ib val) · 91 unmodified lines | |||
| 2308 | } | 2367 | } |
| 2309 | 2368 | ||
| 2310 | #define REG_CP_REG_WRITE_0 0x00000000 | 2369 | #define REG_CP_REG_WRITE_0 0x00000000 |
| 2311 | #define CP_REG_WRITE_0_TRACKER__MASK 0x00000007 | 2370 | #define CP_REG_WRITE_0_TRACKER__MASK 0x0000000f |
| 2312 | #define CP_REG_WRITE_0_TRACKER__SHIFT 0 | 2371 | #define CP_REG_WRITE_0_TRACKER__SHIFT 0 |
| 2313 | static inline uint32_t CP_REG_WRITE_0_TRACKER(enum reg_tracker val) | 2372 | static inline uint32_t CP_REG_WRITE_0_TRACKER(enum reg_tracker val) |
| 2314 | { | 2373 | { |
| 2315 | return ((val) << CP_REG_WRITE_0_TRACKER__SHIFT) & CP_REG_WRITE_0_TRACKER__MASK; | 2374 | return ((val) << CP_REG_WRITE_0_TRACKER__SHIFT) & CP_REG_WRITE_0_TRACKER__MASK; |
| 2316 | } | 2375 | } |
| 2317 | 2376 | ||
| 2377 | #define REG_CP_REG_WRITE_1 0x00000001 | ||
| 2378 | |||
| 2379 | #define REG_CP_REG_WRITE_2 0x00000002 | ||
| 2380 | |||
| 2318 | #define REG_CP_SMMU_TABLE_UPDATE_0 0x00000000 | 2381 | #define REG_CP_SMMU_TABLE_UPDATE_0 0x00000000 |
| 2319 | #define CP_SMMU_TABLE_UPDATE_0_TTBR0_LO__MASK 0xffffffff | 2382 | #define CP_SMMU_TABLE_UPDATE_0_TTBR0_LO__MASK 0xffffffff |
| 2320 | #define CP_SMMU_TABLE_UPDATE_0_TTBR0_LO__SHIFT 0 | 2383 | #define CP_SMMU_TABLE_UPDATE_0_TTBR0_LO__SHIFT 0 |
| @@ -2361,5 +2424,21 @@ static inline uint32_t CP_SMMU_TABLE_UPDATE_3_CONTEXTBANK(uint32_t val) · 40 unmodified lines | |||
| 2361 | 2424 | ||
| 2362 | #define REG_CP_START_BIN_BODY_DWORDS 0x00000004 | 2425 | #define REG_CP_START_BIN_BODY_DWORDS 0x00000004 |
| 2363 | 2426 | ||
| 2427 | #define REG_CP_WAIT_TIMESTAMP_0 0x00000000 | ||
| 2428 | |||
| 2429 | #define REG_CP_WAIT_TIMESTAMP_ADDR 0x00000001 | ||
| 2430 | |||
| 2431 | #define REG_CP_WAIT_TIMESTAMP_TIMESTAMP 0x00000003 | ||
| 2432 | |||
| 2433 | #define REG_CP_THREAD_CONTROL_0 0x00000000 | ||
| 2434 | #define CP_THREAD_CONTROL_0_THREAD__MASK 0x00000003 | ||
| 2435 | #define CP_THREAD_CONTROL_0_THREAD__SHIFT 0 | ||
| 2436 | static inline uint32_t CP_THREAD_CONTROL_0_THREAD(enum cp_thread val) | ||
| 2437 | { | ||
| 2438 | return ((val) << CP_THREAD_CONTROL_0_THREAD__SHIFT) & CP_THREAD_CONTROL_0_THREAD__MASK; | ||
| 2439 | } | ||
| 2440 | #define CP_THREAD_CONTROL_0_CONCURRENT_BIN_DISABLE 0x08000000 | ||
| 2441 | #define CP_THREAD_CONTROL_0_SYNC_THREADS 0x80000000 | ||
| 2442 | |||
| 2364 | 2443 | ||
| 2365 | #endif /* ADRENO_PM4_XML */ | 2444 | #endif /* ADRENO_PM4_XML */ |
| @@ -0,0 +1,210 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_3_0_MSM8998_H | ||
| 8 | #define _DPU_3_0_MSM8998_H | ||
| 9 | |||
| 10 | static const struct dpu_caps msm8998_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0x7, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED3, | ||
| 14 | .has_src_split = true, | ||
| 15 | .has_dim_layer = true, | ||
| 16 | .has_idle_pc = true, | ||
| 17 | .has_3d_merge = true, | ||
| 18 | .max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 19 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 20 | .max_hdeci_exp = MAX_HORZ_DECIMATION, | ||
| 21 | .max_vdeci_exp = MAX_VERT_DECIMATION, | ||
| 22 | }; | ||
| 23 | |||
| 24 | static const struct dpu_ubwc_cfg msm8998_ubwc_cfg = { | ||
| 25 | .ubwc_version = DPU_HW_UBWC_VER_10, | ||
| 26 | .highest_bank_bit = 0x2, | ||
| 27 | }; | ||
| 28 | |||
| 29 | static const struct dpu_mdp_cfg msm8998_mdp[] = { | ||
| 30 | { | ||
| 31 | .name = "top_0", .id = MDP_TOP, | ||
| 32 | .base = 0x0, .len = 0x458, | ||
| 33 | .features = 0, | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 35 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, | ||
| 36 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, | ||
| 37 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 }, | ||
| 38 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 39 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 40 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 41 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 12 }, | ||
| 42 | .clk_ctrls[DPU_CLK_CTRL_CURSOR0] = { .reg_off = 0x3a8, .bit_off = 15 }, | ||
| 43 | .clk_ctrls[DPU_CLK_CTRL_CURSOR1] = { .reg_off = 0x3b0, .bit_off = 15 }, | ||
| 44 | }, | ||
| 45 | }; | ||
| 46 | |||
| 47 | static const struct dpu_ctl_cfg msm8998_ctl[] = { | ||
| 48 | { | ||
| 49 | .name = "ctl_0", .id = CTL_0, | ||
| 50 | .base = 0x1000, .len = 0x94, | ||
| 51 | .features = BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 52 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 53 | }, | ||
| 54 | { | ||
| 55 | .name = "ctl_1", .id = CTL_1, | ||
| 56 | .base = 0x1200, .len = 0x94, | ||
| 57 | .features = 0, | ||
| 58 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 59 | }, | ||
| 60 | { | ||
| 61 | .name = "ctl_2", .id = CTL_2, | ||
| 62 | .base = 0x1400, .len = 0x94, | ||
| 63 | .features = BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 64 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 65 | }, | ||
| 66 | { | ||
| 67 | .name = "ctl_3", .id = CTL_3, | ||
| 68 | .base = 0x1600, .len = 0x94, | ||
| 69 | .features = 0, | ||
| 70 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 71 | }, | ||
| 72 | { | ||
| 73 | .name = "ctl_4", .id = CTL_4, | ||
| 74 | .base = 0x1800, .len = 0x94, | ||
| 75 | .features = 0, | ||
| 76 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 77 | }, | ||
| 78 | }; | ||
| 79 | |||
| 80 | static const struct dpu_sspp_cfg msm8998_sspp[] = { | ||
| 81 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1ac, VIG_MSM8998_MASK, | ||
| 82 | msm8998_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 83 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, 0x1ac, VIG_MSM8998_MASK, | ||
| 84 | msm8998_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 85 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, 0x1ac, VIG_MSM8998_MASK, | ||
| 86 | msm8998_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 87 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, 0x1ac, VIG_MSM8998_MASK, | ||
| 88 | msm8998_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 89 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1ac, DMA_MSM8998_MASK, | ||
| 90 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 91 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1ac, DMA_MSM8998_MASK, | ||
| 92 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 93 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1ac, DMA_CURSOR_MSM8998_MASK, | ||
| 94 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 95 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, 0x1ac, DMA_CURSOR_MSM8998_MASK, | ||
| 96 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 97 | }; | ||
| 98 | |||
| 99 | static const struct dpu_lm_cfg msm8998_lm[] = { | ||
| 100 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_MSM8998_MASK, | ||
| 101 | &msm8998_lm_sblk, PINGPONG_0, LM_2, DSPP_0), | ||
| 102 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_MSM8998_MASK, | ||
| 103 | &msm8998_lm_sblk, PINGPONG_1, LM_5, DSPP_1), | ||
| 104 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_MSM8998_MASK, | ||
| 105 | &msm8998_lm_sblk, PINGPONG_2, LM_0, 0), | ||
| 106 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_MSM8998_MASK, | ||
| 107 | &msm8998_lm_sblk, PINGPONG_MAX, 0, 0), | ||
| 108 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_MSM8998_MASK, | ||
| 109 | &msm8998_lm_sblk, PINGPONG_MAX, 0, 0), | ||
| 110 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_MSM8998_MASK, | ||
| 111 | &msm8998_lm_sblk, PINGPONG_3, LM_1, 0), | ||
| 112 | }; | ||
| 113 | |||
| 114 | static const struct dpu_pingpong_cfg msm8998_pp[] = { | ||
| 115 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk_te, | ||
| 116 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 117 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 118 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, 0, sdm845_pp_sblk_te, | ||
| 119 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 120 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 121 | PP_BLK("pingpong_2", PINGPONG_2, 0x71000, 0, sdm845_pp_sblk, | ||
| 122 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 123 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 124 | PP_BLK("pingpong_3", PINGPONG_3, 0x71800, 0, sdm845_pp_sblk, | ||
| 125 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 126 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 127 | }; | ||
| 128 | |||
| 129 | static const struct dpu_dspp_cfg msm8998_dspp[] = { | ||
| 130 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_MSM8998_MASK, | ||
| 131 | &msm8998_dspp_sblk), | ||
| 132 | DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_MSM8998_MASK, | ||
| 133 | &msm8998_dspp_sblk), | ||
| 134 | }; | ||
| 135 | |||
| 136 | static const struct dpu_intf_cfg msm8998_intf[] = { | ||
| 137 | INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 25, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 138 | INTF_BLK("intf_1", INTF_1, 0x6a800, 0x280, INTF_DSI, 0, 25, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 139 | INTF_BLK("intf_2", INTF_2, 0x6b000, 0x280, INTF_DSI, 1, 25, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 140 | INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_HDMI, 0, 25, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 141 | }; | ||
| 142 | |||
| 143 | static const struct dpu_perf_cfg msm8998_perf_data = { | ||
| 144 | .max_bw_low = 6700000, | ||
| 145 | .max_bw_high = 6700000, | ||
| 146 | .min_core_ib = 2400000, | ||
| 147 | .min_llcc_ib = 800000, | ||
| 148 | .min_dram_ib = 800000, | ||
| 149 | .undersized_prefill_lines = 2, | ||
| 150 | .xtra_prefill_lines = 2, | ||
| 151 | .dest_scale_prefill_lines = 3, | ||
| 152 | .macrotile_prefill_lines = 4, | ||
| 153 | .yuv_nv12_prefill_lines = 8, | ||
| 154 | .linear_prefill_lines = 1, | ||
| 155 | .downscaling_prefill_lines = 1, | ||
| 156 | .amortizable_threshold = 25, | ||
| 157 | .min_prefill_lines = 25, | ||
| 158 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 159 | .safe_lut_tbl = {0xfffc, 0xff00, 0xffff}, | ||
| 160 | .qos_lut_tbl = { | ||
| 161 | {.nentry = ARRAY_SIZE(msm8998_qos_linear), | ||
| 162 | .entries = msm8998_qos_linear | ||
| 163 | }, | ||
| 164 | {.nentry = ARRAY_SIZE(msm8998_qos_macrotile), | ||
| 165 | .entries = msm8998_qos_macrotile | ||
| 166 | }, | ||
| 167 | {.nentry = ARRAY_SIZE(msm8998_qos_nrt), | ||
| 168 | .entries = msm8998_qos_nrt | ||
| 169 | }, | ||
| 170 | }, | ||
| 171 | .cdp_cfg = { | ||
| 172 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 173 | {.rd_enable = 1, .wr_enable = 0} | ||
| 174 | }, | ||
| 175 | .clk_inefficiency_factor = 200, | ||
| 176 | .bw_inefficiency_factor = 120, | ||
| 177 | }; | ||
| 178 | |||
| 179 | const struct dpu_mdss_cfg dpu_msm8998_cfg = { | ||
| 180 | .caps = &msm8998_dpu_caps, | ||
| 181 | .ubwc = &msm8998_ubwc_cfg, | ||
| 182 | .mdp_count = ARRAY_SIZE(msm8998_mdp), | ||
| 183 | .mdp = msm8998_mdp, | ||
| 184 | .ctl_count = ARRAY_SIZE(msm8998_ctl), | ||
| 185 | .ctl = msm8998_ctl, | ||
| 186 | .sspp_count = ARRAY_SIZE(msm8998_sspp), | ||
| 187 | .sspp = msm8998_sspp, | ||
| 188 | .mixer_count = ARRAY_SIZE(msm8998_lm), | ||
| 189 | .mixer = msm8998_lm, | ||
| 190 | .dspp_count = ARRAY_SIZE(msm8998_dspp), | ||
| 191 | .dspp = msm8998_dspp, | ||
| 192 | .pingpong_count = ARRAY_SIZE(msm8998_pp), | ||
| 193 | .pingpong = msm8998_pp, | ||
| 194 | .intf_count = ARRAY_SIZE(msm8998_intf), | ||
| 195 | .intf = msm8998_intf, | ||
| 196 | .vbif_count = ARRAY_SIZE(msm8998_vbif), | ||
| 197 | .vbif = msm8998_vbif, | ||
| 198 | .reg_dma_count = 0, | ||
| 199 | .perf = &msm8998_perf_data, | ||
| 200 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 201 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 202 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 203 | BIT(MDP_INTF0_INTR) | \ | ||
| 204 | BIT(MDP_INTF1_INTR) | \ | ||
| 205 | BIT(MDP_INTF2_INTR) | \ | ||
| 206 | BIT(MDP_INTF3_INTR) | \ | ||
| 207 | BIT(MDP_INTF4_INTR), | ||
| 208 | }; | ||
| 209 | |||
| 210 | #endif | ||
| @@ -0,0 +1,210 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_4_0_SDM845_H | ||
| 8 | #define _DPU_4_0_SDM845_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sdm845_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0xb, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED3, | ||
| 14 | .has_src_split = true, | ||
| 15 | .has_dim_layer = true, | ||
| 16 | .has_idle_pc = true, | ||
| 17 | .has_3d_merge = true, | ||
| 18 | .max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 19 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 20 | .max_hdeci_exp = MAX_HORZ_DECIMATION, | ||
| 21 | .max_vdeci_exp = MAX_VERT_DECIMATION, | ||
| 22 | }; | ||
| 23 | |||
| 24 | static const struct dpu_ubwc_cfg sdm845_ubwc_cfg = { | ||
| 25 | .ubwc_version = DPU_HW_UBWC_VER_20, | ||
| 26 | .highest_bank_bit = 0x2, | ||
| 27 | }; | ||
| 28 | |||
| 29 | static const struct dpu_mdp_cfg sdm845_mdp[] = { | ||
| 30 | { | ||
| 31 | .name = "top_0", .id = MDP_TOP, | ||
| 32 | .base = 0x0, .len = 0x45c, | ||
| 33 | .features = BIT(DPU_MDP_AUDIO_SELECT), | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 35 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, | ||
| 36 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, | ||
| 37 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 }, | ||
| 38 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 39 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 40 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, | ||
| 41 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 42 | }, | ||
| 43 | }; | ||
| 44 | |||
| 45 | static const struct dpu_ctl_cfg sdm845_ctl[] = { | ||
| 46 | { | ||
| 47 | .name = "ctl_0", .id = CTL_0, | ||
| 48 | .base = 0x1000, .len = 0xe4, | ||
| 49 | .features = BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 50 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 51 | }, | ||
| 52 | { | ||
| 53 | .name = "ctl_1", .id = CTL_1, | ||
| 54 | .base = 0x1200, .len = 0xe4, | ||
| 55 | .features = BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 56 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 57 | }, | ||
| 58 | { | ||
| 59 | .name = "ctl_2", .id = CTL_2, | ||
| 60 | .base = 0x1400, .len = 0xe4, | ||
| 61 | .features = 0, | ||
| 62 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 63 | }, | ||
| 64 | { | ||
| 65 | .name = "ctl_3", .id = CTL_3, | ||
| 66 | .base = 0x1600, .len = 0xe4, | ||
| 67 | .features = 0, | ||
| 68 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 69 | }, | ||
| 70 | { | ||
| 71 | .name = "ctl_4", .id = CTL_4, | ||
| 72 | .base = 0x1800, .len = 0xe4, | ||
| 73 | .features = 0, | ||
| 74 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 75 | }, | ||
| 76 | }; | ||
| 77 | |||
| 78 | static const struct dpu_sspp_cfg sdm845_sspp[] = { | ||
| 79 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1c8, VIG_SDM845_MASK_SDMA, | ||
| 80 | sdm845_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 81 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, 0x1c8, VIG_SDM845_MASK_SDMA, | ||
| 82 | sdm845_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 83 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, 0x1c8, VIG_SDM845_MASK_SDMA, | ||
| 84 | sdm845_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 85 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, 0x1c8, VIG_SDM845_MASK_SDMA, | ||
| 86 | sdm845_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 87 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1c8, DMA_SDM845_MASK_SDMA, | ||
| 88 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 89 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1c8, DMA_SDM845_MASK_SDMA, | ||
| 90 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 91 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1c8, DMA_CURSOR_SDM845_MASK_SDMA, | ||
| 92 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 93 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, 0x1c8, DMA_CURSOR_SDM845_MASK_SDMA, | ||
| 94 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 95 | }; | ||
| 96 | |||
| 97 | static const struct dpu_lm_cfg sdm845_lm[] = { | ||
| 98 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 99 | &sdm845_lm_sblk, PINGPONG_0, LM_1, 0), | ||
| 100 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 101 | &sdm845_lm_sblk, PINGPONG_1, LM_0, 0), | ||
| 102 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 103 | &sdm845_lm_sblk, PINGPONG_2, LM_5, 0), | ||
| 104 | LM_BLK("lm_3", LM_3, 0x0, MIXER_SDM845_MASK, | ||
| 105 | &sdm845_lm_sblk, PINGPONG_MAX, 0, 0), | ||
| 106 | LM_BLK("lm_4", LM_4, 0x0, MIXER_SDM845_MASK, | ||
| 107 | &sdm845_lm_sblk, PINGPONG_MAX, 0, 0), | ||
| 108 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, | ||
| 109 | &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 110 | }; | ||
| 111 | |||
| 112 | static const struct dpu_pingpong_cfg sdm845_pp[] = { | ||
| 113 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk_te, | ||
| 114 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 115 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 116 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, 0, sdm845_pp_sblk_te, | ||
| 117 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 118 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 119 | PP_BLK("pingpong_2", PINGPONG_2, 0x71000, 0, sdm845_pp_sblk, | ||
| 120 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 121 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 122 | PP_BLK("pingpong_3", PINGPONG_3, 0x71800, 0, sdm845_pp_sblk, | ||
| 123 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 124 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 125 | }; | ||
| 126 | |||
| 127 | static const struct dpu_dsc_cfg sdm845_dsc[] = { | ||
| 128 | DSC_BLK("dsc_0", DSC_0, 0x80000, 0), | ||
| 129 | DSC_BLK("dsc_1", DSC_1, 0x80400, 0), | ||
| 130 | DSC_BLK("dsc_2", DSC_2, 0x80800, 0), | ||
| 131 | DSC_BLK("dsc_3", DSC_3, 0x80c00, 0), | ||
| 132 | }; | ||
| 133 | |||
| 134 | static const struct dpu_intf_cfg sdm845_intf[] = { | ||
| 135 | INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 136 | INTF_BLK("intf_1", INTF_1, 0x6a800, 0x280, INTF_DSI, 0, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 137 | INTF_BLK("intf_2", INTF_2, 0x6b000, 0x280, INTF_DSI, 1, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 138 | INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 1, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 139 | }; | ||
| 140 | |||
| 141 | static const struct dpu_perf_cfg sdm845_perf_data = { | ||
| 142 | .max_bw_low = 6800000, | ||
| 143 | .max_bw_high = 6800000, | ||
| 144 | .min_core_ib = 2400000, | ||
| 145 | .min_llcc_ib = 800000, | ||
| 146 | .min_dram_ib = 800000, | ||
| 147 | .undersized_prefill_lines = 2, | ||
| 148 | .xtra_prefill_lines = 2, | ||
| 149 | .dest_scale_prefill_lines = 3, | ||
| 150 | .macrotile_prefill_lines = 4, | ||
| 151 | .yuv_nv12_prefill_lines = 8, | ||
| 152 | .linear_prefill_lines = 1, | ||
| 153 | .downscaling_prefill_lines = 1, | ||
| 154 | .amortizable_threshold = 25, | ||
| 155 | .min_prefill_lines = 24, | ||
| 156 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 157 | .safe_lut_tbl = {0xfff0, 0xf000, 0xffff}, | ||
| 158 | .qos_lut_tbl = { | ||
| 159 | {.nentry = ARRAY_SIZE(sdm845_qos_linear), | ||
| 160 | .entries = sdm845_qos_linear | ||
| 161 | }, | ||
| 162 | {.nentry = ARRAY_SIZE(sdm845_qos_macrotile), | ||
| 163 | .entries = sdm845_qos_macrotile | ||
| 164 | }, | ||
| 165 | {.nentry = ARRAY_SIZE(sdm845_qos_nrt), | ||
| 166 | .entries = sdm845_qos_nrt | ||
| 167 | }, | ||
| 168 | }, | ||
| 169 | .cdp_cfg = { | ||
| 170 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 171 | {.rd_enable = 1, .wr_enable = 0} | ||
| 172 | }, | ||
| 173 | .clk_inefficiency_factor = 105, | ||
| 174 | .bw_inefficiency_factor = 120, | ||
| 175 | }; | ||
| 176 | |||
| 177 | const struct dpu_mdss_cfg dpu_sdm845_cfg = { | ||
| 178 | .caps = &sdm845_dpu_caps, | ||
| 179 | .ubwc = &sdm845_ubwc_cfg, | ||
| 180 | .mdp_count = ARRAY_SIZE(sdm845_mdp), | ||
| 181 | .mdp = sdm845_mdp, | ||
| 182 | .ctl_count = ARRAY_SIZE(sdm845_ctl), | ||
| 183 | .ctl = sdm845_ctl, | ||
| 184 | .sspp_count = ARRAY_SIZE(sdm845_sspp), | ||
| 185 | .sspp = sdm845_sspp, | ||
| 186 | .mixer_count = ARRAY_SIZE(sdm845_lm), | ||
| 187 | .mixer = sdm845_lm, | ||
| 188 | .pingpong_count = ARRAY_SIZE(sdm845_pp), | ||
| 189 | .pingpong = sdm845_pp, | ||
| 190 | .dsc_count = ARRAY_SIZE(sdm845_dsc), | ||
| 191 | .dsc = sdm845_dsc, | ||
| 192 | .intf_count = ARRAY_SIZE(sdm845_intf), | ||
| 193 | .intf = sdm845_intf, | ||
| 194 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 195 | .vbif = sdm845_vbif, | ||
| 196 | .reg_dma_count = 1, | ||
| 197 | .dma_cfg = &sdm845_regdma, | ||
| 198 | .perf = &sdm845_perf_data, | ||
| 199 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 200 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 201 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 202 | BIT(MDP_INTF0_INTR) | \ | ||
| 203 | BIT(MDP_INTF1_INTR) | \ | ||
| 204 | BIT(MDP_INTF2_INTR) | \ | ||
| 205 | BIT(MDP_INTF3_INTR) | \ | ||
| 206 | BIT(MDP_AD4_0_INTR) | \ | ||
| 207 | BIT(MDP_AD4_1_INTR), | ||
| 208 | }; | ||
| 209 | |||
| 210 | #endif | ||
| @@ -0,0 +1,237 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_5_0_SM8150_H | ||
| 8 | #define _DPU_5_0_SM8150_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sm8150_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0xb, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED3, | ||
| 14 | .has_src_split = true, | ||
| 15 | .has_dim_layer = true, | ||
| 16 | .has_idle_pc = true, | ||
| 17 | .has_3d_merge = true, | ||
| 18 | .max_linewidth = 4096, | ||
| 19 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 20 | .max_hdeci_exp = MAX_HORZ_DECIMATION, | ||
| 21 | .max_vdeci_exp = MAX_VERT_DECIMATION, | ||
| 22 | }; | ||
| 23 | |||
| 24 | static const struct dpu_ubwc_cfg sm8150_ubwc_cfg = { | ||
| 25 | .ubwc_version = DPU_HW_UBWC_VER_30, | ||
| 26 | .highest_bank_bit = 0x2, | ||
| 27 | }; | ||
| 28 | |||
| 29 | static const struct dpu_mdp_cfg sm8150_mdp[] = { | ||
| 30 | { | ||
| 31 | .name = "top_0", .id = MDP_TOP, | ||
| 32 | .base = 0x0, .len = 0x45c, | ||
| 33 | .features = BIT(DPU_MDP_AUDIO_SELECT), | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 35 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, | ||
| 36 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, | ||
| 37 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 }, | ||
| 38 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 39 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 40 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, | ||
| 41 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 42 | }, | ||
| 43 | }; | ||
| 44 | |||
| 45 | /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ | ||
| 46 | static const struct dpu_ctl_cfg sm8150_ctl[] = { | ||
| 47 | { | ||
| 48 | .name = "ctl_0", .id = CTL_0, | ||
| 49 | .base = 0x1000, .len = 0x1e0, | ||
| 50 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 51 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 52 | }, | ||
| 53 | { | ||
| 54 | .name = "ctl_1", .id = CTL_1, | ||
| 55 | .base = 0x1200, .len = 0x1e0, | ||
| 56 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 57 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 58 | }, | ||
| 59 | { | ||
| 60 | .name = "ctl_2", .id = CTL_2, | ||
| 61 | .base = 0x1400, .len = 0x1e0, | ||
| 62 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 63 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 64 | }, | ||
| 65 | { | ||
| 66 | .name = "ctl_3", .id = CTL_3, | ||
| 67 | .base = 0x1600, .len = 0x1e0, | ||
| 68 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 69 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 70 | }, | ||
| 71 | { | ||
| 72 | .name = "ctl_4", .id = CTL_4, | ||
| 73 | .base = 0x1800, .len = 0x1e0, | ||
| 74 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 75 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 76 | }, | ||
| 77 | { | ||
| 78 | .name = "ctl_5", .id = CTL_5, | ||
| 79 | .base = 0x1a00, .len = 0x1e0, | ||
| 80 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 81 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 82 | }, | ||
| 83 | }; | ||
| 84 | |||
| 85 | static const struct dpu_sspp_cfg sm8150_sspp[] = { | ||
| 86 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f0, VIG_SDM845_MASK, | ||
| 87 | sdm845_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 88 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, 0x1f0, VIG_SDM845_MASK, | ||
| 89 | sdm845_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 90 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, 0x1f0, VIG_SDM845_MASK, | ||
| 91 | sdm845_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 92 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, 0x1f0, VIG_SDM845_MASK, | ||
| 93 | sdm845_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 94 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f0, DMA_SDM845_MASK, | ||
| 95 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 96 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1f0, DMA_SDM845_MASK, | ||
| 97 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 98 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1f0, DMA_CURSOR_SDM845_MASK, | ||
| 99 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 100 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, 0x1f0, DMA_CURSOR_SDM845_MASK, | ||
| 101 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 102 | }; | ||
| 103 | |||
| 104 | static const struct dpu_lm_cfg sm8150_lm[] = { | ||
| 105 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 106 | &sdm845_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 107 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 108 | &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1), | ||
| 109 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 110 | &sdm845_lm_sblk, PINGPONG_2, LM_3, 0), | ||
| 111 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, | ||
| 112 | &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 113 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, | ||
| 114 | &sdm845_lm_sblk, PINGPONG_4, LM_5, 0), | ||
| 115 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, | ||
| 116 | &sdm845_lm_sblk, PINGPONG_5, LM_4, 0), | ||
| 117 | }; | ||
| 118 | |||
| 119 | static const struct dpu_dspp_cfg sm8150_dspp[] = { | ||
| 120 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 121 | &sm8150_dspp_sblk), | ||
| 122 | DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK, | ||
| 123 | &sm8150_dspp_sblk), | ||
| 124 | DSPP_BLK("dspp_2", DSPP_2, 0x58000, DSPP_SC7180_MASK, | ||
| 125 | &sm8150_dspp_sblk), | ||
| 126 | DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK, | ||
| 127 | &sm8150_dspp_sblk), | ||
| 128 | }; | ||
| 129 | |||
| 130 | static const struct dpu_pingpong_cfg sm8150_pp[] = { | ||
| 131 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 132 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 133 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 134 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 135 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 136 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 137 | PP_BLK("pingpong_2", PINGPONG_2, 0x71000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 138 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 139 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 140 | PP_BLK("pingpong_3", PINGPONG_3, 0x71800, MERGE_3D_1, sdm845_pp_sblk, | ||
| 141 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 142 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 143 | PP_BLK("pingpong_4", PINGPONG_4, 0x72000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 144 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 145 | -1), | ||
| 146 | PP_BLK("pingpong_5", PINGPONG_5, 0x72800, MERGE_3D_2, sdm845_pp_sblk, | ||
| 147 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 148 | -1), | ||
| 149 | }; | ||
| 150 | |||
| 151 | static const struct dpu_merge_3d_cfg sm8150_merge_3d[] = { | ||
| 152 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x83000), | ||
| 153 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x83100), | ||
| 154 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x83200), | ||
| 155 | }; | ||
| 156 | |||
| 157 | static const struct dpu_dsc_cfg sm8150_dsc[] = { | ||
| 158 | DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 159 | DSC_BLK("dsc_1", DSC_1, 0x80400, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 160 | DSC_BLK("dsc_2", DSC_2, 0x80800, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 161 | DSC_BLK("dsc_3", DSC_3, 0x80c00, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 162 | }; | ||
| 163 | |||
| 164 | static const struct dpu_intf_cfg sm8150_intf[] = { | ||
| 165 | INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 166 | INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2bc, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 167 | INTF_BLK("intf_2", INTF_2, 0x6b000, 0x2bc, INTF_DSI, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 168 | INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 169 | }; | ||
| 170 | |||
| 171 | static const struct dpu_perf_cfg sm8150_perf_data = { | ||
| 172 | .max_bw_low = 12800000, | ||
| 173 | .max_bw_high = 12800000, | ||
| 174 | .min_core_ib = 2400000, | ||
| 175 | .min_llcc_ib = 800000, | ||
| 176 | .min_dram_ib = 800000, | ||
| 177 | .min_prefill_lines = 24, | ||
| 178 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 179 | .safe_lut_tbl = {0xfff8, 0xf000, 0xffff}, | ||
| 180 | .qos_lut_tbl = { | ||
| 181 | {.nentry = ARRAY_SIZE(sm8150_qos_linear), | ||
| 182 | .entries = sm8150_qos_linear | ||
| 183 | }, | ||
| 184 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 185 | .entries = sc7180_qos_macrotile | ||
| 186 | }, | ||
| 187 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 188 | .entries = sc7180_qos_nrt | ||
| 189 | }, | ||
| 190 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 191 | }, | ||
| 192 | .cdp_cfg = { | ||
| 193 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 194 | {.rd_enable = 1, .wr_enable = 0} | ||
| 195 | }, | ||
| 196 | .clk_inefficiency_factor = 105, | ||
| 197 | .bw_inefficiency_factor = 120, | ||
| 198 | }; | ||
| 199 | |||
| 200 | const struct dpu_mdss_cfg dpu_sm8150_cfg = { | ||
| 201 | .caps = &sm8150_dpu_caps, | ||
| 202 | .ubwc = &sm8150_ubwc_cfg, | ||
| 203 | .mdp_count = ARRAY_SIZE(sm8150_mdp), | ||
| 204 | .mdp = sm8150_mdp, | ||
| 205 | .ctl_count = ARRAY_SIZE(sm8150_ctl), | ||
| 206 | .ctl = sm8150_ctl, | ||
| 207 | .sspp_count = ARRAY_SIZE(sm8150_sspp), | ||
| 208 | .sspp = sm8150_sspp, | ||
| 209 | .mixer_count = ARRAY_SIZE(sm8150_lm), | ||
| 210 | .mixer = sm8150_lm, | ||
| 211 | .dspp_count = ARRAY_SIZE(sm8150_dspp), | ||
| 212 | .dspp = sm8150_dspp, | ||
| 213 | .dsc_count = ARRAY_SIZE(sm8150_dsc), | ||
| 214 | .dsc = sm8150_dsc, | ||
| 215 | .pingpong_count = ARRAY_SIZE(sm8150_pp), | ||
| 216 | .pingpong = sm8150_pp, | ||
| 217 | .merge_3d_count = ARRAY_SIZE(sm8150_merge_3d), | ||
| 218 | .merge_3d = sm8150_merge_3d, | ||
| 219 | .intf_count = ARRAY_SIZE(sm8150_intf), | ||
| 220 | .intf = sm8150_intf, | ||
| 221 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 222 | .vbif = sdm845_vbif, | ||
| 223 | .reg_dma_count = 1, | ||
| 224 | .dma_cfg = &sm8150_regdma, | ||
| 225 | .perf = &sm8150_perf_data, | ||
| 226 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 227 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 228 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 229 | BIT(MDP_INTF0_INTR) | \ | ||
| 230 | BIT(MDP_INTF1_INTR) | \ | ||
| 231 | BIT(MDP_INTF2_INTR) | \ | ||
| 232 | BIT(MDP_INTF3_INTR) | \ | ||
| 233 | BIT(MDP_AD4_0_INTR) | \ | ||
| 234 | BIT(MDP_AD4_1_INTR), | ||
| 235 | }; | ||
| 236 | |||
| 237 | #endif | ||
| @@ -0,0 +1,217 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_5_1_SC8180X_H | ||
| 8 | #define _DPU_5_1_SC8180X_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sc8180x_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0xb, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED3, | ||
| 14 | .has_src_split = true, | ||
| 15 | .has_dim_layer = true, | ||
| 16 | .has_idle_pc = true, | ||
| 17 | .has_3d_merge = true, | ||
| 18 | .max_linewidth = 4096, | ||
| 19 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 20 | .max_hdeci_exp = MAX_HORZ_DECIMATION, | ||
| 21 | .max_vdeci_exp = MAX_VERT_DECIMATION, | ||
| 22 | }; | ||
| 23 | |||
| 24 | static const struct dpu_ubwc_cfg sc8180x_ubwc_cfg = { | ||
| 25 | .ubwc_version = DPU_HW_UBWC_VER_30, | ||
| 26 | .highest_bank_bit = 0x3, | ||
| 27 | }; | ||
| 28 | |||
| 29 | static const struct dpu_mdp_cfg sc8180x_mdp[] = { | ||
| 30 | { | ||
| 31 | .name = "top_0", .id = MDP_TOP, | ||
| 32 | .base = 0x0, .len = 0x45c, | ||
| 33 | .features = BIT(DPU_MDP_AUDIO_SELECT), | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 35 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, | ||
| 36 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, | ||
| 37 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 }, | ||
| 38 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 39 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 40 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, | ||
| 41 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 42 | }, | ||
| 43 | }; | ||
| 44 | |||
| 45 | static const struct dpu_ctl_cfg sc8180x_ctl[] = { | ||
| 46 | { | ||
| 47 | .name = "ctl_0", .id = CTL_0, | ||
| 48 | .base = 0x1000, .len = 0x1e0, | ||
| 49 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 50 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 51 | }, | ||
| 52 | { | ||
| 53 | .name = "ctl_1", .id = CTL_1, | ||
| 54 | .base = 0x1200, .len = 0x1e0, | ||
| 55 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 56 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 57 | }, | ||
| 58 | { | ||
| 59 | .name = "ctl_2", .id = CTL_2, | ||
| 60 | .base = 0x1400, .len = 0x1e0, | ||
| 61 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 62 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 63 | }, | ||
| 64 | { | ||
| 65 | .name = "ctl_3", .id = CTL_3, | ||
| 66 | .base = 0x1600, .len = 0x1e0, | ||
| 67 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 68 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 69 | }, | ||
| 70 | { | ||
| 71 | .name = "ctl_4", .id = CTL_4, | ||
| 72 | .base = 0x1800, .len = 0x1e0, | ||
| 73 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 74 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 75 | }, | ||
| 76 | { | ||
| 77 | .name = "ctl_5", .id = CTL_5, | ||
| 78 | .base = 0x1a00, .len = 0x1e0, | ||
| 79 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 80 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 81 | }, | ||
| 82 | }; | ||
| 83 | |||
| 84 | static const struct dpu_sspp_cfg sc8180x_sspp[] = { | ||
| 85 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f0, VIG_SDM845_MASK, | ||
| 86 | sdm845_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 87 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, 0x1f0, VIG_SDM845_MASK, | ||
| 88 | sdm845_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 89 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, 0x1f0, VIG_SDM845_MASK, | ||
| 90 | sdm845_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 91 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, 0x1f0, VIG_SDM845_MASK, | ||
| 92 | sdm845_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 93 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f0, DMA_SDM845_MASK, | ||
| 94 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 95 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1f0, DMA_SDM845_MASK, | ||
| 96 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 97 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1f0, DMA_CURSOR_SDM845_MASK, | ||
| 98 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 99 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, 0x1f0, DMA_CURSOR_SDM845_MASK, | ||
| 100 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 101 | }; | ||
| 102 | |||
| 103 | static const struct dpu_lm_cfg sc8180x_lm[] = { | ||
| 104 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 105 | &sdm845_lm_sblk, PINGPONG_0, LM_1, 0), | ||
| 106 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 107 | &sdm845_lm_sblk, PINGPONG_1, LM_0, 0), | ||
| 108 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 109 | &sdm845_lm_sblk, PINGPONG_2, LM_3, 0), | ||
| 110 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, | ||
| 111 | &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 112 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, | ||
| 113 | &sdm845_lm_sblk, PINGPONG_4, LM_5, 0), | ||
| 114 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, | ||
| 115 | &sdm845_lm_sblk, PINGPONG_5, LM_4, 0), | ||
| 116 | }; | ||
| 117 | |||
| 118 | static const struct dpu_pingpong_cfg sc8180x_pp[] = { | ||
| 119 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 120 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 121 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 122 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 123 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 124 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 125 | PP_BLK("pingpong_2", PINGPONG_2, 0x71000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 126 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 127 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 128 | PP_BLK("pingpong_3", PINGPONG_3, 0x71800, MERGE_3D_1, sdm845_pp_sblk, | ||
| 129 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 130 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 131 | PP_BLK("pingpong_4", PINGPONG_4, 0x72000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 132 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 133 | -1), | ||
| 134 | PP_BLK("pingpong_5", PINGPONG_5, 0x72800, MERGE_3D_2, sdm845_pp_sblk, | ||
| 135 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 136 | -1), | ||
| 137 | }; | ||
| 138 | |||
| 139 | static const struct dpu_merge_3d_cfg sc8180x_merge_3d[] = { | ||
| 140 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x83000), | ||
| 141 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x83100), | ||
| 142 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x83200), | ||
| 143 | }; | ||
| 144 | |||
| 145 | static const struct dpu_intf_cfg sc8180x_intf[] = { | ||
| 146 | INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 147 | INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2bc, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 148 | INTF_BLK("intf_2", INTF_2, 0x6b000, 0x2bc, INTF_DSI, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 149 | /* INTF_3 is for MST, wired to INTF_DP 0 and 1, use dummy index until this is supported */ | ||
| 150 | INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 999, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 151 | INTF_BLK("intf_4", INTF_4, 0x6c000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 20, 21), | ||
| 152 | INTF_BLK("intf_5", INTF_5, 0x6c800, 0x280, INTF_DP, MSM_DP_CONTROLLER_2, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 22, 23), | ||
| 153 | }; | ||
| 154 | |||
| 155 | static const struct dpu_perf_cfg sc8180x_perf_data = { | ||
| 156 | .max_bw_low = 9600000, | ||
| 157 | .max_bw_high = 9600000, | ||
| 158 | .min_core_ib = 2400000, | ||
| 159 | .min_llcc_ib = 800000, | ||
| 160 | .min_dram_ib = 800000, | ||
| 161 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 162 | .qos_lut_tbl = { | ||
| 163 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 164 | .entries = sc7180_qos_linear | ||
| 165 | }, | ||
| 166 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 167 | .entries = sc7180_qos_macrotile | ||
| 168 | }, | ||
| 169 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 170 | .entries = sc7180_qos_nrt | ||
| 171 | }, | ||
| 172 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 173 | }, | ||
| 174 | .cdp_cfg = { | ||
| 175 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 176 | {.rd_enable = 1, .wr_enable = 0} | ||
| 177 | }, | ||
| 178 | .clk_inefficiency_factor = 105, | ||
| 179 | .bw_inefficiency_factor = 120, | ||
| 180 | }; | ||
| 181 | |||
| 182 | const struct dpu_mdss_cfg dpu_sc8180x_cfg = { | ||
| 183 | .caps = &sc8180x_dpu_caps, | ||
| 184 | .ubwc = &sc8180x_ubwc_cfg, | ||
| 185 | .mdp_count = ARRAY_SIZE(sc8180x_mdp), | ||
| 186 | .mdp = sc8180x_mdp, | ||
| 187 | .ctl_count = ARRAY_SIZE(sc8180x_ctl), | ||
| 188 | .ctl = sc8180x_ctl, | ||
| 189 | .sspp_count = ARRAY_SIZE(sc8180x_sspp), | ||
| 190 | .sspp = sc8180x_sspp, | ||
| 191 | .mixer_count = ARRAY_SIZE(sc8180x_lm), | ||
| 192 | .mixer = sc8180x_lm, | ||
| 193 | .pingpong_count = ARRAY_SIZE(sc8180x_pp), | ||
| 194 | .pingpong = sc8180x_pp, | ||
| 195 | .merge_3d_count = ARRAY_SIZE(sc8180x_merge_3d), | ||
| 196 | .merge_3d = sc8180x_merge_3d, | ||
| 197 | .intf_count = ARRAY_SIZE(sc8180x_intf), | ||
| 198 | .intf = sc8180x_intf, | ||
| 199 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 200 | .vbif = sdm845_vbif, | ||
| 201 | .reg_dma_count = 1, | ||
| 202 | .dma_cfg = &sm8150_regdma, | ||
| 203 | .perf = &sc8180x_perf_data, | ||
| 204 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 205 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 206 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 207 | BIT(MDP_INTF0_INTR) | \ | ||
| 208 | BIT(MDP_INTF1_INTR) | \ | ||
| 209 | BIT(MDP_INTF2_INTR) | \ | ||
| 210 | BIT(MDP_INTF3_INTR) | \ | ||
| 211 | BIT(MDP_INTF4_INTR) | \ | ||
| 212 | BIT(MDP_INTF5_INTR) | \ | ||
| 213 | BIT(MDP_AD4_0_INTR) | \ | ||
| 214 | BIT(MDP_AD4_1_INTR), | ||
| 215 | }; | ||
| 216 | |||
| 217 | #endif | ||
| @@ -0,0 +1,244 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_6_0_SM8250_H | ||
| 8 | #define _DPU_6_0_SM8250_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sm8250_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0xb, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 14 | .has_src_split = true, | ||
| 15 | .has_dim_layer = true, | ||
| 16 | .has_idle_pc = true, | ||
| 17 | .has_3d_merge = true, | ||
| 18 | .max_linewidth = 4096, | ||
| 19 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 20 | }; | ||
| 21 | |||
| 22 | static const struct dpu_ubwc_cfg sm8250_ubwc_cfg = { | ||
| 23 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 24 | .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ | ||
| 25 | .ubwc_swizzle = 0x6, | ||
| 26 | }; | ||
| 27 | |||
| 28 | static const struct dpu_mdp_cfg sm8250_mdp[] = { | ||
| 29 | { | ||
| 30 | .name = "top_0", .id = MDP_TOP, | ||
| 31 | .base = 0x0, .len = 0x494, | ||
| 32 | .features = 0, | ||
| 33 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, | ||
| 35 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, | ||
| 36 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 }, | ||
| 37 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 38 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 39 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, | ||
| 40 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 41 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, | ||
| 42 | .clk_ctrls[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 }, | ||
| 43 | }, | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ | ||
| 47 | static const struct dpu_ctl_cfg sm8250_ctl[] = { | ||
| 48 | { | ||
| 49 | .name = "ctl_0", .id = CTL_0, | ||
| 50 | .base = 0x1000, .len = 0x1e0, | ||
| 51 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 52 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 53 | }, | ||
| 54 | { | ||
| 55 | .name = "ctl_1", .id = CTL_1, | ||
| 56 | .base = 0x1200, .len = 0x1e0, | ||
| 57 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 58 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 59 | }, | ||
| 60 | { | ||
| 61 | .name = "ctl_2", .id = CTL_2, | ||
| 62 | .base = 0x1400, .len = 0x1e0, | ||
| 63 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 64 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 65 | }, | ||
| 66 | { | ||
| 67 | .name = "ctl_3", .id = CTL_3, | ||
| 68 | .base = 0x1600, .len = 0x1e0, | ||
| 69 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 70 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 71 | }, | ||
| 72 | { | ||
| 73 | .name = "ctl_4", .id = CTL_4, | ||
| 74 | .base = 0x1800, .len = 0x1e0, | ||
| 75 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 76 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 77 | }, | ||
| 78 | { | ||
| 79 | .name = "ctl_5", .id = CTL_5, | ||
| 80 | .base = 0x1a00, .len = 0x1e0, | ||
| 81 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 82 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 83 | }, | ||
| 84 | }; | ||
| 85 | |||
| 86 | static const struct dpu_sspp_cfg sm8250_sspp[] = { | ||
| 87 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK_SDMA, | ||
| 88 | sm8250_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 89 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, 0x1f8, VIG_SC7180_MASK_SDMA, | ||
| 90 | sm8250_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 91 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, 0x1f8, VIG_SC7180_MASK_SDMA, | ||
| 92 | sm8250_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 93 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, 0x1f8, VIG_SC7180_MASK_SDMA, | ||
| 94 | sm8250_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 95 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK_SDMA, | ||
| 96 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 97 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1f8, DMA_SDM845_MASK_SDMA, | ||
| 98 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 99 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1f8, DMA_CURSOR_SDM845_MASK_SDMA, | ||
| 100 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 101 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, 0x1f8, DMA_CURSOR_SDM845_MASK_SDMA, | ||
| 102 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 103 | }; | ||
| 104 | |||
| 105 | static const struct dpu_lm_cfg sm8250_lm[] = { | ||
| 106 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 107 | &sdm845_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 108 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 109 | &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1), | ||
| 110 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 111 | &sdm845_lm_sblk, PINGPONG_2, LM_3, 0), | ||
| 112 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, | ||
| 113 | &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 114 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, | ||
| 115 | &sdm845_lm_sblk, PINGPONG_4, LM_5, 0), | ||
| 116 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, | ||
| 117 | &sdm845_lm_sblk, PINGPONG_5, LM_4, 0), | ||
| 118 | }; | ||
| 119 | |||
| 120 | static const struct dpu_dspp_cfg sm8250_dspp[] = { | ||
| 121 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 122 | &sm8150_dspp_sblk), | ||
| 123 | DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK, | ||
| 124 | &sm8150_dspp_sblk), | ||
| 125 | DSPP_BLK("dspp_2", DSPP_2, 0x58000, DSPP_SC7180_MASK, | ||
| 126 | &sm8150_dspp_sblk), | ||
| 127 | DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK, | ||
| 128 | &sm8150_dspp_sblk), | ||
| 129 | }; | ||
| 130 | |||
| 131 | static const struct dpu_pingpong_cfg sm8250_pp[] = { | ||
| 132 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 133 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 134 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 135 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 136 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 137 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 138 | PP_BLK("pingpong_2", PINGPONG_2, 0x71000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 139 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 140 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 141 | PP_BLK("pingpong_3", PINGPONG_3, 0x71800, MERGE_3D_1, sdm845_pp_sblk, | ||
| 142 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 143 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 144 | PP_BLK("pingpong_4", PINGPONG_4, 0x72000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 145 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 146 | -1), | ||
| 147 | PP_BLK("pingpong_5", PINGPONG_5, 0x72800, MERGE_3D_2, sdm845_pp_sblk, | ||
| 148 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 149 | -1), | ||
| 150 | }; | ||
| 151 | |||
| 152 | static const struct dpu_merge_3d_cfg sm8250_merge_3d[] = { | ||
| 153 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x83000), | ||
| 154 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x83100), | ||
| 155 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x83200), | ||
| 156 | }; | ||
| 157 | |||
| 158 | static const struct dpu_dsc_cfg sm8250_dsc[] = { | ||
| 159 | DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 160 | DSC_BLK("dsc_1", DSC_1, 0x80400, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 161 | DSC_BLK("dsc_2", DSC_2, 0x80800, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 162 | DSC_BLK("dsc_3", DSC_3, 0x80c00, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 163 | }; | ||
| 164 | |||
| 165 | static const struct dpu_intf_cfg sm8250_intf[] = { | ||
| 166 | INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 167 | INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 168 | INTF_BLK("intf_2", INTF_2, 0x6b000, 0x2c0, INTF_DSI, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 169 | INTF_BLK("intf_3", INTF_3, 0x6b800, 0x280, INTF_DP, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 170 | }; | ||
| 171 | |||
| 172 | static const struct dpu_wb_cfg sm8250_wb[] = { | ||
| 173 | WB_BLK("wb_2", WB_2, 0x65000, WB_SM8250_MASK, DPU_CLK_CTRL_WB2, 6, | ||
| 174 | VBIF_RT, MDP_SSPP_TOP0_INTR, 4096, 4), | ||
| 175 | }; | ||
| 176 | |||
| 177 | static const struct dpu_perf_cfg sm8250_perf_data = { | ||
| 178 | .max_bw_low = 13700000, | ||
| 179 | .max_bw_high = 16600000, | ||
| 180 | .min_core_ib = 4800000, | ||
| 181 | .min_llcc_ib = 0, | ||
| 182 | .min_dram_ib = 800000, | ||
| 183 | .min_prefill_lines = 35, | ||
| 184 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 185 | .safe_lut_tbl = {0xfff0, 0xff00, 0xffff}, | ||
| 186 | .qos_lut_tbl = { | ||
| 187 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 188 | .entries = sc7180_qos_linear | ||
| 189 | }, | ||
| 190 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 191 | .entries = sc7180_qos_macrotile | ||
| 192 | }, | ||
| 193 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 194 | .entries = sc7180_qos_nrt | ||
| 195 | }, | ||
| 196 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 197 | }, | ||
| 198 | .cdp_cfg = { | ||
| 199 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 200 | {.rd_enable = 1, .wr_enable = 0} | ||
| 201 | }, | ||
| 202 | .clk_inefficiency_factor = 105, | ||
| 203 | .bw_inefficiency_factor = 120, | ||
| 204 | }; | ||
| 205 | |||
| 206 | const struct dpu_mdss_cfg dpu_sm8250_cfg = { | ||
| 207 | .caps = &sm8250_dpu_caps, | ||
| 208 | .ubwc = &sm8250_ubwc_cfg, | ||
| 209 | .mdp_count = ARRAY_SIZE(sm8250_mdp), | ||
| 210 | .mdp = sm8250_mdp, | ||
| 211 | .ctl_count = ARRAY_SIZE(sm8250_ctl), | ||
| 212 | .ctl = sm8250_ctl, | ||
| 213 | .sspp_count = ARRAY_SIZE(sm8250_sspp), | ||
| 214 | .sspp = sm8250_sspp, | ||
| 215 | .mixer_count = ARRAY_SIZE(sm8250_lm), | ||
| 216 | .mixer = sm8250_lm, | ||
| 217 | .dspp_count = ARRAY_SIZE(sm8250_dspp), | ||
| 218 | .dspp = sm8250_dspp, | ||
| 219 | .dsc_count = ARRAY_SIZE(sm8250_dsc), | ||
| 220 | .dsc = sm8250_dsc, | ||
| 221 | .pingpong_count = ARRAY_SIZE(sm8250_pp), | ||
| 222 | .pingpong = sm8250_pp, | ||
| 223 | .merge_3d_count = ARRAY_SIZE(sm8250_merge_3d), | ||
| 224 | .merge_3d = sm8250_merge_3d, | ||
| 225 | .intf_count = ARRAY_SIZE(sm8250_intf), | ||
| 226 | .intf = sm8250_intf, | ||
| 227 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 228 | .vbif = sdm845_vbif, | ||
| 229 | .wb_count = ARRAY_SIZE(sm8250_wb), | ||
| 230 | .wb = sm8250_wb, | ||
| 231 | .reg_dma_count = 1, | ||
| 232 | .dma_cfg = &sm8250_regdma, | ||
| 233 | .perf = &sm8250_perf_data, | ||
| 234 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 235 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 236 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 237 | BIT(MDP_INTF0_INTR) | \ | ||
| 238 | BIT(MDP_INTF1_INTR) | \ | ||
| 239 | BIT(MDP_INTF2_INTR) | \ | ||
| 240 | BIT(MDP_INTF3_INTR) | \ | ||
| 241 | BIT(MDP_INTF4_INTR), | ||
| 242 | }; | ||
| 243 | |||
| 244 | #endif | ||
| @@ -0,0 +1,156 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_6_2_SC7180_H | ||
| 8 | #define _DPU_6_2_SC7180_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sc7180_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0x9, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 14 | .has_dim_layer = true, | ||
| 15 | .has_idle_pc = true, | ||
| 16 | .max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 17 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 18 | }; | ||
| 19 | |||
| 20 | static const struct dpu_ubwc_cfg sc7180_ubwc_cfg = { | ||
| 21 | .ubwc_version = DPU_HW_UBWC_VER_20, | ||
| 22 | .highest_bank_bit = 0x3, | ||
| 23 | }; | ||
| 24 | |||
| 25 | static const struct dpu_mdp_cfg sc7180_mdp[] = { | ||
| 26 | { | ||
| 27 | .name = "top_0", .id = MDP_TOP, | ||
| 28 | .base = 0x0, .len = 0x494, | ||
| 29 | .features = 0, | ||
| 30 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 31 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 32 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 33 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 }, | ||
| 35 | }, | ||
| 36 | }; | ||
| 37 | |||
| 38 | static const struct dpu_ctl_cfg sc7180_ctl[] = { | ||
| 39 | { | ||
| 40 | .name = "ctl_0", .id = CTL_0, | ||
| 41 | .base = 0x1000, .len = 0x1dc, | ||
| 42 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 43 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 44 | }, | ||
| 45 | { | ||
| 46 | .name = "ctl_1", .id = CTL_1, | ||
| 47 | .base = 0x1200, .len = 0x1dc, | ||
| 48 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 49 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 50 | }, | ||
| 51 | { | ||
| 52 | .name = "ctl_2", .id = CTL_2, | ||
| 53 | .base = 0x1400, .len = 0x1dc, | ||
| 54 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 55 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 56 | }, | ||
| 57 | }; | ||
| 58 | |||
| 59 | static const struct dpu_sspp_cfg sc7180_sspp[] = { | ||
| 60 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK, | ||
| 61 | sc7180_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 62 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK, | ||
| 63 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 64 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1f8, DMA_CURSOR_SDM845_MASK, | ||
| 65 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 66 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1f8, DMA_CURSOR_SDM845_MASK, | ||
| 67 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 68 | }; | ||
| 69 | |||
| 70 | static const struct dpu_lm_cfg sc7180_lm[] = { | ||
| 71 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 72 | &sc7180_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 73 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 74 | &sc7180_lm_sblk, PINGPONG_1, LM_0, 0), | ||
| 75 | }; | ||
| 76 | |||
| 77 | static const struct dpu_dspp_cfg sc7180_dspp[] = { | ||
| 78 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 79 | &sc7180_dspp_sblk), | ||
| 80 | }; | ||
| 81 | |||
| 82 | static const struct dpu_pingpong_cfg sc7180_pp[] = { | ||
| 83 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk_te, -1, -1), | ||
| 84 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, 0, sdm845_pp_sblk_te, -1, -1), | ||
| 85 | }; | ||
| 86 | |||
| 87 | static const struct dpu_intf_cfg sc7180_intf[] = { | ||
| 88 | INTF_BLK("intf_0", INTF_0, 0x6a000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 89 | INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 90 | }; | ||
| 91 | |||
| 92 | static const struct dpu_wb_cfg sc7180_wb[] = { | ||
| 93 | WB_BLK("wb_2", WB_2, 0x65000, WB_SM8250_MASK, DPU_CLK_CTRL_WB2, 6, | ||
| 94 | VBIF_RT, MDP_SSPP_TOP0_INTR, 4096, 4), | ||
| 95 | }; | ||
| 96 | |||
| 97 | static const struct dpu_perf_cfg sc7180_perf_data = { | ||
| 98 | .max_bw_low = 6800000, | ||
| 99 | .max_bw_high = 6800000, | ||
| 100 | .min_core_ib = 2400000, | ||
| 101 | .min_llcc_ib = 800000, | ||
| 102 | .min_dram_ib = 1600000, | ||
| 103 | .min_prefill_lines = 24, | ||
| 104 | .danger_lut_tbl = {0xff, 0xffff, 0x0}, | ||
| 105 | .safe_lut_tbl = {0xfff0, 0xff00, 0xffff}, | ||
| 106 | .qos_lut_tbl = { | ||
| 107 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 108 | .entries = sc7180_qos_linear | ||
| 109 | }, | ||
| 110 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 111 | .entries = sc7180_qos_macrotile | ||
| 112 | }, | ||
| 113 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 114 | .entries = sc7180_qos_nrt | ||
| 115 | }, | ||
| 116 | }, | ||
| 117 | .cdp_cfg = { | ||
| 118 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 119 | {.rd_enable = 1, .wr_enable = 0} | ||
| 120 | }, | ||
| 121 | .clk_inefficiency_factor = 105, | ||
| 122 | .bw_inefficiency_factor = 120, | ||
| 123 | }; | ||
| 124 | |||
| 125 | const struct dpu_mdss_cfg dpu_sc7180_cfg = { | ||
| 126 | .caps = &sc7180_dpu_caps, | ||
| 127 | .ubwc = &sc7180_ubwc_cfg, | ||
| 128 | .mdp_count = ARRAY_SIZE(sc7180_mdp), | ||
| 129 | .mdp = sc7180_mdp, | ||
| 130 | .ctl_count = ARRAY_SIZE(sc7180_ctl), | ||
| 131 | .ctl = sc7180_ctl, | ||
| 132 | .sspp_count = ARRAY_SIZE(sc7180_sspp), | ||
| 133 | .sspp = sc7180_sspp, | ||
| 134 | .mixer_count = ARRAY_SIZE(sc7180_lm), | ||
| 135 | .mixer = sc7180_lm, | ||
| 136 | .dspp_count = ARRAY_SIZE(sc7180_dspp), | ||
| 137 | .dspp = sc7180_dspp, | ||
| 138 | .pingpong_count = ARRAY_SIZE(sc7180_pp), | ||
| 139 | .pingpong = sc7180_pp, | ||
| 140 | .intf_count = ARRAY_SIZE(sc7180_intf), | ||
| 141 | .intf = sc7180_intf, | ||
| 142 | .wb_count = ARRAY_SIZE(sc7180_wb), | ||
| 143 | .wb = sc7180_wb, | ||
| 144 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 145 | .vbif = sdm845_vbif, | ||
| 146 | .reg_dma_count = 1, | ||
| 147 | .dma_cfg = &sdm845_regdma, | ||
| 148 | .perf = &sc7180_perf_data, | ||
| 149 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 150 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 151 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 152 | BIT(MDP_INTF0_INTR) | \ | ||
| 153 | BIT(MDP_INTF1_INTR), | ||
| 154 | }; | ||
| 155 | |||
| 156 | #endif | ||
| @@ -0,0 +1,129 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_6_3_SM6115_H | ||
| 8 | #define _DPU_6_3_SM6115_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sm6115_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0x4, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 14 | .has_dim_layer = true, | ||
| 15 | .has_idle_pc = true, | ||
| 16 | .max_linewidth = 2160, | ||
| 17 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 18 | }; | ||
| 19 | |||
| 20 | static const struct dpu_ubwc_cfg sm6115_ubwc_cfg = { | ||
| 21 | .ubwc_version = DPU_HW_UBWC_VER_10, | ||
| 22 | .highest_bank_bit = 0x1, | ||
| 23 | .ubwc_swizzle = 0x7, | ||
| 24 | }; | ||
| 25 | |||
| 26 | static const struct dpu_mdp_cfg sm6115_mdp[] = { | ||
| 27 | { | ||
| 28 | .name = "top_0", .id = MDP_TOP, | ||
| 29 | .base = 0x0, .len = 0x494, | ||
| 30 | .features = 0, | ||
| 31 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 32 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 33 | }, | ||
| 34 | }; | ||
| 35 | |||
| 36 | static const struct dpu_ctl_cfg sm6115_ctl[] = { | ||
| 37 | { | ||
| 38 | .name = "ctl_0", .id = CTL_0, | ||
| 39 | .base = 0x1000, .len = 0x1dc, | ||
| 40 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 41 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 42 | }, | ||
| 43 | }; | ||
| 44 | |||
| 45 | static const struct dpu_sspp_cfg sm6115_sspp[] = { | ||
| 46 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK, | ||
| 47 | sm6115_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 48 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK, | ||
| 49 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 50 | }; | ||
| 51 | |||
| 52 | static const struct dpu_lm_cfg sm6115_lm[] = { | ||
| 53 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_QCM2290_MASK, | ||
| 54 | &qcm2290_lm_sblk, PINGPONG_0, 0, DSPP_0), | ||
| 55 | }; | ||
| 56 | |||
| 57 | static const struct dpu_dspp_cfg sm6115_dspp[] = { | ||
| 58 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 59 | &sm8150_dspp_sblk), | ||
| 60 | }; | ||
| 61 | |||
| 62 | static const struct dpu_pingpong_cfg sm6115_pp[] = { | ||
| 63 | PP_BLK("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk, | ||
| 64 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 65 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 66 | }; | ||
| 67 | |||
| 68 | static const struct dpu_intf_cfg sm6115_intf[] = { | ||
| 69 | INTF_BLK("intf_0", INTF_0, 0x00000, 0x280, INTF_NONE, 0, 0, 0, 0, 0, 0), | ||
| 70 | INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 71 | }; | ||
| 72 | |||
| 73 | static const struct dpu_perf_cfg sm6115_perf_data = { | ||
| 74 | .max_bw_low = 3100000, | ||
| 75 | .max_bw_high = 4000000, | ||
| 76 | .min_core_ib = 2400000, | ||
| 77 | .min_llcc_ib = 800000, | ||
| 78 | .min_dram_ib = 800000, | ||
| 79 | .min_prefill_lines = 24, | ||
| 80 | .danger_lut_tbl = {0xff, 0xffff, 0x0}, | ||
| 81 | .safe_lut_tbl = {0xfff0, 0xff00, 0xffff}, | ||
| 82 | .qos_lut_tbl = { | ||
| 83 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 84 | .entries = sc7180_qos_linear | ||
| 85 | }, | ||
| 86 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 87 | .entries = sc7180_qos_macrotile | ||
| 88 | }, | ||
| 89 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 90 | .entries = sc7180_qos_nrt | ||
| 91 | }, | ||
| 92 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 93 | }, | ||
| 94 | .cdp_cfg = { | ||
| 95 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 96 | {.rd_enable = 1, .wr_enable = 0} | ||
| 97 | }, | ||
| 98 | .clk_inefficiency_factor = 105, | ||
| 99 | .bw_inefficiency_factor = 120, | ||
| 100 | }; | ||
| 101 | |||
| 102 | const struct dpu_mdss_cfg dpu_sm6115_cfg = { | ||
| 103 | .caps = &sm6115_dpu_caps, | ||
| 104 | .ubwc = &sm6115_ubwc_cfg, | ||
| 105 | .mdp_count = ARRAY_SIZE(sm6115_mdp), | ||
| 106 | .mdp = sm6115_mdp, | ||
| 107 | .ctl_count = ARRAY_SIZE(sm6115_ctl), | ||
| 108 | .ctl = sm6115_ctl, | ||
| 109 | .sspp_count = ARRAY_SIZE(sm6115_sspp), | ||
| 110 | .sspp = sm6115_sspp, | ||
| 111 | .mixer_count = ARRAY_SIZE(sm6115_lm), | ||
| 112 | .mixer = sm6115_lm, | ||
| 113 | .dspp_count = ARRAY_SIZE(sm6115_dspp), | ||
| 114 | .dspp = sm6115_dspp, | ||
| 115 | .pingpong_count = ARRAY_SIZE(sm6115_pp), | ||
| 116 | .pingpong = sm6115_pp, | ||
| 117 | .intf_count = ARRAY_SIZE(sm6115_intf), | ||
| 118 | .intf = sm6115_intf, | ||
| 119 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 120 | .vbif = sdm845_vbif, | ||
| 121 | .perf = &sm6115_perf_data, | ||
| 122 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 123 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 124 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 125 | BIT(MDP_INTF0_INTR) | \ | ||
| 126 | BIT(MDP_INTF1_INTR), | ||
| 127 | }; | ||
| 128 | |||
| 129 | #endif | ||
| @@ -0,0 +1,119 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_6_5_QCM2290_H | ||
| 8 | #define _DPU_6_5_QCM2290_H | ||
| 9 | |||
| 10 | static const struct dpu_caps qcm2290_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0x4, | ||
| 13 | .has_dim_layer = true, | ||
| 14 | .has_idle_pc = true, | ||
| 15 | .max_linewidth = 2160, | ||
| 16 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 17 | }; | ||
| 18 | |||
| 19 | static const struct dpu_ubwc_cfg qcm2290_ubwc_cfg = { | ||
| 20 | .highest_bank_bit = 0x2, | ||
| 21 | }; | ||
| 22 | |||
| 23 | static const struct dpu_mdp_cfg qcm2290_mdp[] = { | ||
| 24 | { | ||
| 25 | .name = "top_0", .id = MDP_TOP, | ||
| 26 | .base = 0x0, .len = 0x494, | ||
| 27 | .features = 0, | ||
| 28 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 29 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 30 | }, | ||
| 31 | }; | ||
| 32 | |||
| 33 | static const struct dpu_ctl_cfg qcm2290_ctl[] = { | ||
| 34 | { | ||
| 35 | .name = "ctl_0", .id = CTL_0, | ||
| 36 | .base = 0x1000, .len = 0x1dc, | ||
| 37 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 38 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 39 | }, | ||
| 40 | }; | ||
| 41 | |||
| 42 | static const struct dpu_sspp_cfg qcm2290_sspp[] = { | ||
| 43 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_QCM2290_MASK, | ||
| 44 | qcm2290_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 45 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK, | ||
| 46 | qcm2290_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 47 | }; | ||
| 48 | |||
| 49 | static const struct dpu_lm_cfg qcm2290_lm[] = { | ||
| 50 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_QCM2290_MASK, | ||
| 51 | &qcm2290_lm_sblk, PINGPONG_0, 0, DSPP_0), | ||
| 52 | }; | ||
| 53 | |||
| 54 | static const struct dpu_dspp_cfg qcm2290_dspp[] = { | ||
| 55 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 56 | &sm8150_dspp_sblk), | ||
| 57 | }; | ||
| 58 | |||
| 59 | static const struct dpu_pingpong_cfg qcm2290_pp[] = { | ||
| 60 | PP_BLK("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk, | ||
| 61 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 62 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 63 | }; | ||
| 64 | |||
| 65 | static const struct dpu_intf_cfg qcm2290_intf[] = { | ||
| 66 | INTF_BLK("intf_0", INTF_0, 0x00000, 0x280, INTF_NONE, 0, 0, 0, 0, 0, 0), | ||
| 67 | INTF_BLK("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 68 | }; | ||
| 69 | |||
| 70 | static const struct dpu_perf_cfg qcm2290_perf_data = { | ||
| 71 | .max_bw_low = 2700000, | ||
| 72 | .max_bw_high = 2700000, | ||
| 73 | .min_core_ib = 1300000, | ||
| 74 | .min_llcc_ib = 0, | ||
| 75 | .min_dram_ib = 1600000, | ||
| 76 | .min_prefill_lines = 24, | ||
| 77 | .danger_lut_tbl = {0xff, 0x0, 0x0}, | ||
| 78 | .safe_lut_tbl = {0xfff0, 0x0, 0x0}, | ||
| 79 | .qos_lut_tbl = { | ||
| 80 | {.nentry = ARRAY_SIZE(qcm2290_qos_linear), | ||
| 81 | .entries = qcm2290_qos_linear | ||
| 82 | }, | ||
| 83 | }, | ||
| 84 | .cdp_cfg = { | ||
| 85 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 86 | {.rd_enable = 1, .wr_enable = 0} | ||
| 87 | }, | ||
| 88 | .clk_inefficiency_factor = 105, | ||
| 89 | .bw_inefficiency_factor = 120, | ||
| 90 | }; | ||
| 91 | |||
| 92 | const struct dpu_mdss_cfg dpu_qcm2290_cfg = { | ||
| 93 | .caps = &qcm2290_dpu_caps, | ||
| 94 | .ubwc = &qcm2290_ubwc_cfg, | ||
| 95 | .mdp_count = ARRAY_SIZE(qcm2290_mdp), | ||
| 96 | .mdp = qcm2290_mdp, | ||
| 97 | .ctl_count = ARRAY_SIZE(qcm2290_ctl), | ||
| 98 | .ctl = qcm2290_ctl, | ||
| 99 | .sspp_count = ARRAY_SIZE(qcm2290_sspp), | ||
| 100 | .sspp = qcm2290_sspp, | ||
| 101 | .mixer_count = ARRAY_SIZE(qcm2290_lm), | ||
| 102 | .mixer = qcm2290_lm, | ||
| 103 | .dspp_count = ARRAY_SIZE(qcm2290_dspp), | ||
| 104 | .dspp = qcm2290_dspp, | ||
| 105 | .pingpong_count = ARRAY_SIZE(qcm2290_pp), | ||
| 106 | .pingpong = qcm2290_pp, | ||
| 107 | .intf_count = ARRAY_SIZE(qcm2290_intf), | ||
| 108 | .intf = qcm2290_intf, | ||
| 109 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 110 | .vbif = sdm845_vbif, | ||
| 111 | .perf = &qcm2290_perf_data, | ||
| 112 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 113 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 114 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 115 | BIT(MDP_INTF0_INTR) | \ | ||
| 116 | BIT(MDP_INTF1_INTR), | ||
| 117 | }; | ||
| 118 | |||
| 119 | #endif | ||
| @@ -0,0 +1,226 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_7_0_SM8350_H | ||
| 8 | #define _DPU_7_0_SM8350_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sm8350_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0xb, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 14 | .has_src_split = true, | ||
| 15 | .has_dim_layer = true, | ||
| 16 | .has_idle_pc = true, | ||
| 17 | .has_3d_merge = true, | ||
| 18 | .max_linewidth = 4096, | ||
| 19 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 20 | }; | ||
| 21 | |||
| 22 | static const struct dpu_ubwc_cfg sm8350_ubwc_cfg = { | ||
| 23 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 24 | .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ | ||
| 25 | }; | ||
| 26 | |||
| 27 | static const struct dpu_mdp_cfg sm8350_mdp[] = { | ||
| 28 | { | ||
| 29 | .name = "top_0", .id = MDP_TOP, | ||
| 30 | .base = 0x0, .len = 0x494, | ||
| 31 | .features = 0, | ||
| 32 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 33 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, | ||
| 35 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 }, | ||
| 36 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 37 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 38 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, | ||
| 39 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 40 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, | ||
| 41 | }, | ||
| 42 | }; | ||
| 43 | |||
| 44 | /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ | ||
| 45 | static const struct dpu_ctl_cfg sm8350_ctl[] = { | ||
| 46 | { | ||
| 47 | .name = "ctl_0", .id = CTL_0, | ||
| 48 | .base = 0x15000, .len = 0x1e8, | ||
| 49 | .features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK, | ||
| 50 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 51 | }, | ||
| 52 | { | ||
| 53 | .name = "ctl_1", .id = CTL_1, | ||
| 54 | .base = 0x16000, .len = 0x1e8, | ||
| 55 | .features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK, | ||
| 56 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 57 | }, | ||
| 58 | { | ||
| 59 | .name = "ctl_2", .id = CTL_2, | ||
| 60 | .base = 0x17000, .len = 0x1e8, | ||
| 61 | .features = CTL_SC7280_MASK, | ||
| 62 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 63 | }, | ||
| 64 | { | ||
| 65 | .name = "ctl_3", .id = CTL_3, | ||
| 66 | .base = 0x18000, .len = 0x1e8, | ||
| 67 | .features = CTL_SC7280_MASK, | ||
| 68 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 69 | }, | ||
| 70 | { | ||
| 71 | .name = "ctl_4", .id = CTL_4, | ||
| 72 | .base = 0x19000, .len = 0x1e8, | ||
| 73 | .features = CTL_SC7280_MASK, | ||
| 74 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 75 | }, | ||
| 76 | { | ||
| 77 | .name = "ctl_5", .id = CTL_5, | ||
| 78 | .base = 0x1a000, .len = 0x1e8, | ||
| 79 | .features = CTL_SC7280_MASK, | ||
| 80 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 81 | }, | ||
| 82 | }; | ||
| 83 | |||
| 84 | static const struct dpu_sspp_cfg sm8350_sspp[] = { | ||
| 85 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK, | ||
| 86 | sm8250_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 87 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, 0x1f8, VIG_SC7180_MASK, | ||
| 88 | sm8250_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 89 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, 0x1f8, VIG_SC7180_MASK, | ||
| 90 | sm8250_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 91 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, 0x1f8, VIG_SC7180_MASK, | ||
| 92 | sm8250_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 93 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK, | ||
| 94 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 95 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1f8, DMA_SDM845_MASK, | ||
| 96 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 97 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1f8, DMA_CURSOR_SDM845_MASK, | ||
| 98 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 99 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, 0x1f8, DMA_CURSOR_SDM845_MASK, | ||
| 100 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 101 | }; | ||
| 102 | |||
| 103 | static const struct dpu_lm_cfg sm8350_lm[] = { | ||
| 104 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 105 | &sdm845_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 106 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 107 | &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1), | ||
| 108 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 109 | &sdm845_lm_sblk, PINGPONG_2, LM_3, 0), | ||
| 110 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, | ||
| 111 | &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 112 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, | ||
| 113 | &sdm845_lm_sblk, PINGPONG_4, LM_5, 0), | ||
| 114 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, | ||
| 115 | &sdm845_lm_sblk, PINGPONG_5, LM_4, 0), | ||
| 116 | }; | ||
| 117 | |||
| 118 | static const struct dpu_dspp_cfg sm8350_dspp[] = { | ||
| 119 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 120 | &sm8150_dspp_sblk), | ||
| 121 | DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK, | ||
| 122 | &sm8150_dspp_sblk), | ||
| 123 | DSPP_BLK("dspp_2", DSPP_2, 0x58000, DSPP_SC7180_MASK, | ||
| 124 | &sm8150_dspp_sblk), | ||
| 125 | DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK, | ||
| 126 | &sm8150_dspp_sblk), | ||
| 127 | }; | ||
| 128 | |||
| 129 | static const struct dpu_pingpong_cfg sm8350_pp[] = { | ||
| 130 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 131 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 132 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 133 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 134 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 135 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 136 | PP_BLK("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 137 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 138 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 139 | PP_BLK("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 140 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 141 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 142 | PP_BLK("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 143 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 144 | -1), | ||
| 145 | PP_BLK("pingpong_5", PINGPONG_5, 0x6e000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 146 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 147 | -1), | ||
| 148 | }; | ||
| 149 | |||
| 150 | static const struct dpu_merge_3d_cfg sm8350_merge_3d[] = { | ||
| 151 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x4e000), | ||
| 152 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x4f000), | ||
| 153 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x50000), | ||
| 154 | }; | ||
| 155 | |||
| 156 | static const struct dpu_intf_cfg sm8350_intf[] = { | ||
| 157 | INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 158 | INTF_BLK("intf_1", INTF_1, 0x35000, 0x2c4, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 159 | INTF_BLK("intf_2", INTF_2, 0x36000, 0x2c4, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 160 | INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 161 | }; | ||
| 162 | |||
| 163 | static const struct dpu_perf_cfg sm8350_perf_data = { | ||
| 164 | .max_bw_low = 11800000, | ||
| 165 | .max_bw_high = 15500000, | ||
| 166 | .min_core_ib = 2500000, | ||
| 167 | .min_llcc_ib = 0, | ||
| 168 | .min_dram_ib = 800000, | ||
| 169 | .min_prefill_lines = 40, | ||
| 170 | /* FIXME: lut tables */ | ||
| 171 | .danger_lut_tbl = {0x3ffff, 0x3ffff, 0x0}, | ||
| 172 | .safe_lut_tbl = {0xfe00, 0xfe00, 0xffff}, | ||
| 173 | .qos_lut_tbl = { | ||
| 174 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 175 | .entries = sc7180_qos_linear | ||
| 176 | }, | ||
| 177 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 178 | .entries = sc7180_qos_macrotile | ||
| 179 | }, | ||
| 180 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 181 | .entries = sc7180_qos_nrt | ||
| 182 | }, | ||
| 183 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 184 | }, | ||
| 185 | .cdp_cfg = { | ||
| 186 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 187 | {.rd_enable = 1, .wr_enable = 0} | ||
| 188 | }, | ||
| 189 | .clk_inefficiency_factor = 105, | ||
| 190 | .bw_inefficiency_factor = 120, | ||
| 191 | }; | ||
| 192 | |||
| 193 | const struct dpu_mdss_cfg dpu_sm8350_cfg = { | ||
| 194 | .caps = &sm8350_dpu_caps, | ||
| 195 | .ubwc = &sm8350_ubwc_cfg, | ||
| 196 | .mdp_count = ARRAY_SIZE(sm8350_mdp), | ||
| 197 | .mdp = sm8350_mdp, | ||
| 198 | .ctl_count = ARRAY_SIZE(sm8350_ctl), | ||
| 199 | .ctl = sm8350_ctl, | ||
| 200 | .sspp_count = ARRAY_SIZE(sm8350_sspp), | ||
| 201 | .sspp = sm8350_sspp, | ||
| 202 | .mixer_count = ARRAY_SIZE(sm8350_lm), | ||
| 203 | .mixer = sm8350_lm, | ||
| 204 | .dspp_count = ARRAY_SIZE(sm8350_dspp), | ||
| 205 | .dspp = sm8350_dspp, | ||
| 206 | .pingpong_count = ARRAY_SIZE(sm8350_pp), | ||
| 207 | .pingpong = sm8350_pp, | ||
| 208 | .merge_3d_count = ARRAY_SIZE(sm8350_merge_3d), | ||
| 209 | .merge_3d = sm8350_merge_3d, | ||
| 210 | .intf_count = ARRAY_SIZE(sm8350_intf), | ||
| 211 | .intf = sm8350_intf, | ||
| 212 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 213 | .vbif = sdm845_vbif, | ||
| 214 | .reg_dma_count = 1, | ||
| 215 | .dma_cfg = &sm8350_regdma, | ||
| 216 | .perf = &sm8350_perf_data, | ||
| 217 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 218 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 219 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 220 | BIT(MDP_INTF0_7xxx_INTR) | \ | ||
| 221 | BIT(MDP_INTF1_7xxx_INTR) | \ | ||
| 222 | BIT(MDP_INTF2_7xxx_INTR) | \ | ||
| 223 | BIT(MDP_INTF3_7xxx_INTR), | ||
| 224 | }; | ||
| 225 | |||
| 226 | #endif | ||
| @@ -0,0 +1,158 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_7_2_SC7280_H | ||
| 8 | #define _DPU_7_2_SC7280_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sc7280_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0x7, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 14 | .has_dim_layer = true, | ||
| 15 | .has_idle_pc = true, | ||
| 16 | .max_linewidth = 2400, | ||
| 17 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 18 | }; | ||
| 19 | |||
| 20 | static const struct dpu_ubwc_cfg sc7280_ubwc_cfg = { | ||
| 21 | .ubwc_version = DPU_HW_UBWC_VER_30, | ||
| 22 | .highest_bank_bit = 0x1, | ||
| 23 | .ubwc_swizzle = 0x6, | ||
| 24 | }; | ||
| 25 | |||
| 26 | static const struct dpu_mdp_cfg sc7280_mdp[] = { | ||
| 27 | { | ||
| 28 | .name = "top_0", .id = MDP_TOP, | ||
| 29 | .base = 0x0, .len = 0x2014, | ||
| 30 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 31 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 32 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 33 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 34 | }, | ||
| 35 | }; | ||
| 36 | |||
| 37 | static const struct dpu_ctl_cfg sc7280_ctl[] = { | ||
| 38 | { | ||
| 39 | .name = "ctl_0", .id = CTL_0, | ||
| 40 | .base = 0x15000, .len = 0x1e8, | ||
| 41 | .features = CTL_SC7280_MASK, | ||
| 42 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 43 | }, | ||
| 44 | { | ||
| 45 | .name = "ctl_1", .id = CTL_1, | ||
| 46 | .base = 0x16000, .len = 0x1e8, | ||
| 47 | .features = CTL_SC7280_MASK, | ||
| 48 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 49 | }, | ||
| 50 | { | ||
| 51 | .name = "ctl_2", .id = CTL_2, | ||
| 52 | .base = 0x17000, .len = 0x1e8, | ||
| 53 | .features = CTL_SC7280_MASK, | ||
| 54 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 55 | }, | ||
| 56 | { | ||
| 57 | .name = "ctl_3", .id = CTL_3, | ||
| 58 | .base = 0x18000, .len = 0x1e8, | ||
| 59 | .features = CTL_SC7280_MASK, | ||
| 60 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 61 | }, | ||
| 62 | }; | ||
| 63 | |||
| 64 | static const struct dpu_sspp_cfg sc7280_sspp[] = { | ||
| 65 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7280_MASK_SDMA, | ||
| 66 | sc7280_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 67 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK_SDMA, | ||
| 68 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 69 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1f8, DMA_CURSOR_SDM845_MASK_SDMA, | ||
| 70 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 71 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1f8, DMA_CURSOR_SDM845_MASK_SDMA, | ||
| 72 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 73 | }; | ||
| 74 | |||
| 75 | static const struct dpu_lm_cfg sc7280_lm[] = { | ||
| 76 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 77 | &sc7180_lm_sblk, PINGPONG_0, 0, DSPP_0), | ||
| 78 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 79 | &sc7180_lm_sblk, PINGPONG_2, LM_3, 0), | ||
| 80 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, | ||
| 81 | &sc7180_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 82 | }; | ||
| 83 | |||
| 84 | static const struct dpu_dspp_cfg sc7280_dspp[] = { | ||
| 85 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 86 | &sc7180_dspp_sblk), | ||
| 87 | }; | ||
| 88 | |||
| 89 | static const struct dpu_pingpong_cfg sc7280_pp[] = { | ||
| 90 | PP_BLK("pingpong_0", PINGPONG_0, 0x69000, 0, sc7280_pp_sblk, -1, -1), | ||
| 91 | PP_BLK("pingpong_1", PINGPONG_1, 0x6a000, 0, sc7280_pp_sblk, -1, -1), | ||
| 92 | PP_BLK("pingpong_2", PINGPONG_2, 0x6b000, 0, sc7280_pp_sblk, -1, -1), | ||
| 93 | PP_BLK("pingpong_3", PINGPONG_3, 0x6c000, 0, sc7280_pp_sblk, -1, -1), | ||
| 94 | }; | ||
| 95 | |||
| 96 | static const struct dpu_intf_cfg sc7280_intf[] = { | ||
| 97 | INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 98 | INTF_BLK("intf_1", INTF_1, 0x35000, 0x2c4, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 99 | INTF_BLK("intf_5", INTF_5, 0x39000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 22, 23), | ||
| 100 | }; | ||
| 101 | |||
| 102 | static const struct dpu_perf_cfg sc7280_perf_data = { | ||
| 103 | .max_bw_low = 4700000, | ||
| 104 | .max_bw_high = 8800000, | ||
| 105 | .min_core_ib = 2500000, | ||
| 106 | .min_llcc_ib = 0, | ||
| 107 | .min_dram_ib = 1600000, | ||
| 108 | .min_prefill_lines = 24, | ||
| 109 | .danger_lut_tbl = {0xffff, 0xffff, 0x0}, | ||
| 110 | .safe_lut_tbl = {0xff00, 0xff00, 0xffff}, | ||
| 111 | .qos_lut_tbl = { | ||
| 112 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 113 | .entries = sc7180_qos_macrotile | ||
| 114 | }, | ||
| 115 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 116 | .entries = sc7180_qos_macrotile | ||
| 117 | }, | ||
| 118 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 119 | .entries = sc7180_qos_nrt | ||
| 120 | }, | ||
| 121 | }, | ||
| 122 | .cdp_cfg = { | ||
| 123 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 124 | {.rd_enable = 1, .wr_enable = 0} | ||
| 125 | }, | ||
| 126 | .clk_inefficiency_factor = 105, | ||
| 127 | .bw_inefficiency_factor = 120, | ||
| 128 | }; | ||
| 129 | |||
| 130 | const struct dpu_mdss_cfg dpu_sc7280_cfg = { | ||
| 131 | .caps = &sc7280_dpu_caps, | ||
| 132 | .ubwc = &sc7280_ubwc_cfg, | ||
| 133 | .mdp_count = ARRAY_SIZE(sc7280_mdp), | ||
| 134 | .mdp = sc7280_mdp, | ||
| 135 | .ctl_count = ARRAY_SIZE(sc7280_ctl), | ||
| 136 | .ctl = sc7280_ctl, | ||
| 137 | .sspp_count = ARRAY_SIZE(sc7280_sspp), | ||
| 138 | .sspp = sc7280_sspp, | ||
| 139 | .dspp_count = ARRAY_SIZE(sc7280_dspp), | ||
| 140 | .dspp = sc7280_dspp, | ||
| 141 | .mixer_count = ARRAY_SIZE(sc7280_lm), | ||
| 142 | .mixer = sc7280_lm, | ||
| 143 | .pingpong_count = ARRAY_SIZE(sc7280_pp), | ||
| 144 | .pingpong = sc7280_pp, | ||
| 145 | .intf_count = ARRAY_SIZE(sc7280_intf), | ||
| 146 | .intf = sc7280_intf, | ||
| 147 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 148 | .vbif = sdm845_vbif, | ||
| 149 | .perf = &sc7280_perf_data, | ||
| 150 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 151 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 152 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 153 | BIT(MDP_INTF0_7xxx_INTR) | \ | ||
| 154 | BIT(MDP_INTF1_7xxx_INTR) | \ | ||
| 155 | BIT(MDP_INTF5_7xxx_INTR), | ||
| 156 | }; | ||
| 157 | |||
| 158 | #endif | ||
| @@ -0,0 +1,222 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_8_0_SC8280XP_H | ||
| 8 | #define _DPU_8_0_SC8280XP_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sc8280xp_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 11, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 14 | .has_src_split = true, | ||
| 15 | .has_dim_layer = true, | ||
| 16 | .has_idle_pc = true, | ||
| 17 | .has_3d_merge = true, | ||
| 18 | .max_linewidth = 5120, | ||
| 19 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 20 | }; | ||
| 21 | |||
| 22 | static const struct dpu_ubwc_cfg sc8280xp_ubwc_cfg = { | ||
| 23 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 24 | .highest_bank_bit = 2, | ||
| 25 | .ubwc_swizzle = 6, | ||
| 26 | }; | ||
| 27 | |||
| 28 | static const struct dpu_mdp_cfg sc8280xp_mdp[] = { | ||
| 29 | { | ||
| 30 | .name = "top_0", .id = MDP_TOP, | ||
| 31 | .base = 0x0, .len = 0x494, | ||
| 32 | .features = BIT(DPU_MDP_PERIPH_0_REMOVED), | ||
| 33 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, | ||
| 35 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, | ||
| 36 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 }, | ||
| 37 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 38 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 39 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, | ||
| 40 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 41 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, | ||
| 42 | }, | ||
| 43 | }; | ||
| 44 | |||
| 45 | static const struct dpu_ctl_cfg sc8280xp_ctl[] = { | ||
| 46 | { | ||
| 47 | .name = "ctl_0", .id = CTL_0, | ||
| 48 | .base = 0x15000, .len = 0x204, | ||
| 49 | .features = CTL_SC7280_MASK, | ||
| 50 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 51 | }, | ||
| 52 | { | ||
| 53 | .name = "ctl_1", .id = CTL_1, | ||
| 54 | .base = 0x16000, .len = 0x204, | ||
| 55 | .features = CTL_SC7280_MASK, | ||
| 56 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 57 | }, | ||
| 58 | { | ||
| 59 | .name = "ctl_2", .id = CTL_2, | ||
| 60 | .base = 0x17000, .len = 0x204, | ||
| 61 | .features = CTL_SC7280_MASK, | ||
| 62 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 63 | }, | ||
| 64 | { | ||
| 65 | .name = "ctl_3", .id = CTL_3, | ||
| 66 | .base = 0x18000, .len = 0x204, | ||
| 67 | .features = CTL_SC7280_MASK, | ||
| 68 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 69 | }, | ||
| 70 | { | ||
| 71 | .name = "ctl_4", .id = CTL_4, | ||
| 72 | .base = 0x19000, .len = 0x204, | ||
| 73 | .features = CTL_SC7280_MASK, | ||
| 74 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 75 | }, | ||
| 76 | { | ||
| 77 | .name = "ctl_5", .id = CTL_5, | ||
| 78 | .base = 0x1a000, .len = 0x204, | ||
| 79 | .features = CTL_SC7280_MASK, | ||
| 80 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 81 | }, | ||
| 82 | }; | ||
| 83 | |||
| 84 | static const struct dpu_sspp_cfg sc8280xp_sspp[] = { | ||
| 85 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x2ac, VIG_SC7180_MASK, | ||
| 86 | sm8250_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 87 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, 0x2ac, VIG_SC7180_MASK, | ||
| 88 | sm8250_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 89 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, 0x2ac, VIG_SC7180_MASK, | ||
| 90 | sm8250_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 91 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, 0x2ac, VIG_SC7180_MASK, | ||
| 92 | sm8250_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 93 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x2ac, DMA_SDM845_MASK, | ||
| 94 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 95 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x2ac, DMA_SDM845_MASK, | ||
| 96 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 97 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x2ac, DMA_CURSOR_SDM845_MASK, | ||
| 98 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 99 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, 0x2ac, DMA_CURSOR_SDM845_MASK, | ||
| 100 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 101 | }; | ||
| 102 | |||
| 103 | static const struct dpu_lm_cfg sc8280xp_lm[] = { | ||
| 104 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 105 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1), | ||
| 106 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_2, LM_3, DSPP_2), | ||
| 107 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_3, LM_2, DSPP_3), | ||
| 108 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_4, LM_5, 0), | ||
| 109 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_5, LM_4, 0), | ||
| 110 | }; | ||
| 111 | |||
| 112 | static const struct dpu_dspp_cfg sc8280xp_dspp[] = { | ||
| 113 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 114 | &sm8150_dspp_sblk), | ||
| 115 | DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK, | ||
| 116 | &sm8150_dspp_sblk), | ||
| 117 | DSPP_BLK("dspp_2", DSPP_2, 0x58000, DSPP_SC7180_MASK, | ||
| 118 | &sm8150_dspp_sblk), | ||
| 119 | DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK, | ||
| 120 | &sm8150_dspp_sblk), | ||
| 121 | }; | ||
| 122 | |||
| 123 | static const struct dpu_pingpong_cfg sc8280xp_pp[] = { | ||
| 124 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 125 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), -1), | ||
| 126 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 127 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), -1), | ||
| 128 | PP_BLK_TE("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sdm845_pp_sblk_te, | ||
| 129 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), -1), | ||
| 130 | PP_BLK_TE("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sdm845_pp_sblk_te, | ||
| 131 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), -1), | ||
| 132 | PP_BLK_TE("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sdm845_pp_sblk_te, | ||
| 133 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), -1), | ||
| 134 | PP_BLK_TE("pingpong_5", PINGPONG_5, 0x6e000, MERGE_3D_2, sdm845_pp_sblk_te, | ||
| 135 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), -1), | ||
| 136 | }; | ||
| 137 | |||
| 138 | static const struct dpu_merge_3d_cfg sc8280xp_merge_3d[] = { | ||
| 139 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x4e000), | ||
| 140 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x4f000), | ||
| 141 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x50000), | ||
| 142 | }; | ||
| 143 | |||
| 144 | /* TODO: INTF 3, 8 and 7 are used for MST, marked as INTF_NONE for now */ | ||
| 145 | static const struct dpu_intf_cfg sc8280xp_intf[] = { | ||
| 146 | INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 147 | INTF_BLK("intf_1", INTF_1, 0x35000, 0x300, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 148 | INTF_BLK("intf_2", INTF_2, 0x36000, 0x300, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 149 | INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_NONE, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 150 | INTF_BLK("intf_4", INTF_4, 0x38000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 20, 21), | ||
| 151 | INTF_BLK("intf_5", INTF_5, 0x39000, 0x280, INTF_DP, MSM_DP_CONTROLLER_3, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 22, 23), | ||
| 152 | INTF_BLK("intf_6", INTF_6, 0x3a000, 0x280, INTF_DP, MSM_DP_CONTROLLER_2, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 16, 17), | ||
| 153 | INTF_BLK("intf_7", INTF_7, 0x3b000, 0x280, INTF_NONE, MSM_DP_CONTROLLER_2, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 18, 19), | ||
| 154 | INTF_BLK("intf_8", INTF_8, 0x3c000, 0x280, INTF_NONE, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 12, 13), | ||
| 155 | }; | ||
| 156 | |||
| 157 | static const struct dpu_perf_cfg sc8280xp_perf_data = { | ||
| 158 | .max_bw_low = 13600000, | ||
| 159 | .max_bw_high = 18200000, | ||
| 160 | .min_core_ib = 2500000, | ||
| 161 | .min_llcc_ib = 0, | ||
| 162 | .min_dram_ib = 800000, | ||
| 163 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 164 | .qos_lut_tbl = { | ||
| 165 | {.nentry = ARRAY_SIZE(sc8180x_qos_linear), | ||
| 166 | .entries = sc8180x_qos_linear | ||
| 167 | }, | ||
| 168 | {.nentry = ARRAY_SIZE(sc8180x_qos_macrotile), | ||
| 169 | .entries = sc8180x_qos_macrotile | ||
| 170 | }, | ||
| 171 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 172 | .entries = sc7180_qos_nrt | ||
| 173 | }, | ||
| 174 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 175 | }, | ||
| 176 | .cdp_cfg = { | ||
| 177 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 178 | {.rd_enable = 1, .wr_enable = 0} | ||
| 179 | }, | ||
| 180 | .clk_inefficiency_factor = 105, | ||
| 181 | .bw_inefficiency_factor = 120, | ||
| 182 | }; | ||
| 183 | |||
| 184 | const struct dpu_mdss_cfg dpu_sc8280xp_cfg = { | ||
| 185 | .caps = &sc8280xp_dpu_caps, | ||
| 186 | .ubwc = &sc8280xp_ubwc_cfg, | ||
| 187 | .mdp_count = ARRAY_SIZE(sc8280xp_mdp), | ||
| 188 | .mdp = sc8280xp_mdp, | ||
| 189 | .ctl_count = ARRAY_SIZE(sc8280xp_ctl), | ||
| 190 | .ctl = sc8280xp_ctl, | ||
| 191 | .sspp_count = ARRAY_SIZE(sc8280xp_sspp), | ||
| 192 | .sspp = sc8280xp_sspp, | ||
| 193 | .mixer_count = ARRAY_SIZE(sc8280xp_lm), | ||
| 194 | .mixer = sc8280xp_lm, | ||
| 195 | .dspp_count = ARRAY_SIZE(sc8280xp_dspp), | ||
| 196 | .dspp = sc8280xp_dspp, | ||
| 197 | .pingpong_count = ARRAY_SIZE(sc8280xp_pp), | ||
| 198 | .pingpong = sc8280xp_pp, | ||
| 199 | .merge_3d_count = ARRAY_SIZE(sc8280xp_merge_3d), | ||
| 200 | .merge_3d = sc8280xp_merge_3d, | ||
| 201 | .intf_count = ARRAY_SIZE(sc8280xp_intf), | ||
| 202 | .intf = sc8280xp_intf, | ||
| 203 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 204 | .vbif = sdm845_vbif, | ||
| 205 | .reg_dma_count = 1, | ||
| 206 | .dma_cfg = &sc8280xp_regdma, | ||
| 207 | .perf = &sc8280xp_perf_data, | ||
| 208 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 209 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 210 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 211 | BIT(MDP_INTF0_7xxx_INTR) | \ | ||
| 212 | BIT(MDP_INTF1_7xxx_INTR) | \ | ||
| 213 | BIT(MDP_INTF2_7xxx_INTR) | \ | ||
| 214 | BIT(MDP_INTF3_7xxx_INTR) | \ | ||
| 215 | BIT(MDP_INTF4_7xxx_INTR) | \ | ||
| 216 | BIT(MDP_INTF5_7xxx_INTR) | \ | ||
| 217 | BIT(MDP_INTF6_7xxx_INTR) | \ | ||
| 218 | BIT(MDP_INTF7_7xxx_INTR) | \ | ||
| 219 | BIT(MDP_INTF8_7xxx_INTR), | ||
| 220 | }; | ||
| 221 | |||
| 222 | #endif | ||
| @@ -0,0 +1,234 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_8_1_SM8450_H | ||
| 8 | #define _DPU_8_1_SM8450_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sm8450_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0xb, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 14 | .has_src_split = true, | ||
| 15 | .has_dim_layer = true, | ||
| 16 | .has_idle_pc = true, | ||
| 17 | .has_3d_merge = true, | ||
| 18 | .max_linewidth = 5120, | ||
| 19 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 20 | }; | ||
| 21 | |||
| 22 | static const struct dpu_ubwc_cfg sm8450_ubwc_cfg = { | ||
| 23 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 24 | .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ | ||
| 25 | .ubwc_swizzle = 0x6, | ||
| 26 | }; | ||
| 27 | |||
| 28 | static const struct dpu_mdp_cfg sm8450_mdp[] = { | ||
| 29 | { | ||
| 30 | .name = "top_0", .id = MDP_TOP, | ||
| 31 | .base = 0x0, .len = 0x494, | ||
| 32 | .features = BIT(DPU_MDP_PERIPH_0_REMOVED), | ||
| 33 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 }, | ||
| 35 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 }, | ||
| 36 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 }, | ||
| 37 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, | ||
| 38 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, | ||
| 39 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, | ||
| 40 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, | ||
| 41 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, | ||
| 42 | }, | ||
| 43 | }; | ||
| 44 | |||
| 45 | /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ | ||
| 46 | static const struct dpu_ctl_cfg sm8450_ctl[] = { | ||
| 47 | { | ||
| 48 | .name = "ctl_0", .id = CTL_0, | ||
| 49 | .base = 0x15000, .len = 0x204, | ||
| 50 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY) | BIT(DPU_CTL_FETCH_ACTIVE), | ||
| 51 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 52 | }, | ||
| 53 | { | ||
| 54 | .name = "ctl_1", .id = CTL_1, | ||
| 55 | .base = 0x16000, .len = 0x204, | ||
| 56 | .features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK, | ||
| 57 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 58 | }, | ||
| 59 | { | ||
| 60 | .name = "ctl_2", .id = CTL_2, | ||
| 61 | .base = 0x17000, .len = 0x204, | ||
| 62 | .features = CTL_SC7280_MASK, | ||
| 63 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 64 | }, | ||
| 65 | { | ||
| 66 | .name = "ctl_3", .id = CTL_3, | ||
| 67 | .base = 0x18000, .len = 0x204, | ||
| 68 | .features = CTL_SC7280_MASK, | ||
| 69 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 70 | }, | ||
| 71 | { | ||
| 72 | .name = "ctl_4", .id = CTL_4, | ||
| 73 | .base = 0x19000, .len = 0x204, | ||
| 74 | .features = CTL_SC7280_MASK, | ||
| 75 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 76 | }, | ||
| 77 | { | ||
| 78 | .name = "ctl_5", .id = CTL_5, | ||
| 79 | .base = 0x1a000, .len = 0x204, | ||
| 80 | .features = CTL_SC7280_MASK, | ||
| 81 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 82 | }, | ||
| 83 | }; | ||
| 84 | |||
| 85 | static const struct dpu_sspp_cfg sm8450_sspp[] = { | ||
| 86 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x32c, VIG_SC7180_MASK, | ||
| 87 | sm8250_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 88 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, 0x32c, VIG_SC7180_MASK, | ||
| 89 | sm8250_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 90 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, 0x32c, VIG_SC7180_MASK, | ||
| 91 | sm8250_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 92 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, 0x32c, VIG_SC7180_MASK, | ||
| 93 | sm8250_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 94 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x32c, DMA_SDM845_MASK, | ||
| 95 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 96 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x32c, DMA_SDM845_MASK, | ||
| 97 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 98 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x32c, DMA_CURSOR_SDM845_MASK, | ||
| 99 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 100 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, 0x32c, DMA_CURSOR_SDM845_MASK, | ||
| 101 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 102 | }; | ||
| 103 | |||
| 104 | static const struct dpu_lm_cfg sm8450_lm[] = { | ||
| 105 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 106 | &sdm845_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 107 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 108 | &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1), | ||
| 109 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 110 | &sdm845_lm_sblk, PINGPONG_2, LM_3, 0), | ||
| 111 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, | ||
| 112 | &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 113 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, | ||
| 114 | &sdm845_lm_sblk, PINGPONG_4, LM_5, 0), | ||
| 115 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, | ||
| 116 | &sdm845_lm_sblk, PINGPONG_5, LM_4, 0), | ||
| 117 | }; | ||
| 118 | |||
| 119 | static const struct dpu_dspp_cfg sm8450_dspp[] = { | ||
| 120 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 121 | &sm8150_dspp_sblk), | ||
| 122 | DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK, | ||
| 123 | &sm8150_dspp_sblk), | ||
| 124 | DSPP_BLK("dspp_2", DSPP_2, 0x58000, DSPP_SC7180_MASK, | ||
| 125 | &sm8150_dspp_sblk), | ||
| 126 | DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK, | ||
| 127 | &sm8150_dspp_sblk), | ||
| 128 | }; | ||
| 129 | /* FIXME: interrupts */ | ||
| 130 | static const struct dpu_pingpong_cfg sm8450_pp[] = { | ||
| 131 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 132 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 133 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 134 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 135 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 136 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 137 | PP_BLK("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 138 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 139 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 140 | PP_BLK("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 141 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 142 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 143 | PP_BLK("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 144 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 145 | -1), | ||
| 146 | PP_BLK("pingpong_5", PINGPONG_5, 0x6e000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 147 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 148 | -1), | ||
| 149 | PP_BLK("pingpong_6", PINGPONG_6, 0x65800, MERGE_3D_3, sdm845_pp_sblk, | ||
| 150 | -1, | ||
| 151 | -1), | ||
| 152 | PP_BLK("pingpong_7", PINGPONG_7, 0x65c00, MERGE_3D_3, sdm845_pp_sblk, | ||
| 153 | -1, | ||
| 154 | -1), | ||
| 155 | }; | ||
| 156 | |||
| 157 | static const struct dpu_merge_3d_cfg sm8450_merge_3d[] = { | ||
| 158 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x4e000), | ||
| 159 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x4f000), | ||
| 160 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x50000), | ||
| 161 | MERGE_3D_BLK("merge_3d_3", MERGE_3D_3, 0x65f00), | ||
| 162 | }; | ||
| 163 | |||
| 164 | static const struct dpu_intf_cfg sm8450_intf[] = { | ||
| 165 | INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 166 | INTF_BLK("intf_1", INTF_1, 0x35000, 0x300, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 167 | INTF_BLK("intf_2", INTF_2, 0x36000, 0x300, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 168 | INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 169 | }; | ||
| 170 | |||
| 171 | static const struct dpu_perf_cfg sm8450_perf_data = { | ||
| 172 | .max_bw_low = 13600000, | ||
| 173 | .max_bw_high = 18200000, | ||
| 174 | .min_core_ib = 2500000, | ||
| 175 | .min_llcc_ib = 0, | ||
| 176 | .min_dram_ib = 800000, | ||
| 177 | .min_prefill_lines = 35, | ||
| 178 | /* FIXME: lut tables */ | ||
| 179 | .danger_lut_tbl = {0x3ffff, 0x3ffff, 0x0}, | ||
| 180 | .safe_lut_tbl = {0xfe00, 0xfe00, 0xffff}, | ||
| 181 | .qos_lut_tbl = { | ||
| 182 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 183 | .entries = sc7180_qos_linear | ||
| 184 | }, | ||
| 185 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 186 | .entries = sc7180_qos_macrotile | ||
| 187 | }, | ||
| 188 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 189 | .entries = sc7180_qos_nrt | ||
| 190 | }, | ||
| 191 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 192 | }, | ||
| 193 | .cdp_cfg = { | ||
| 194 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 195 | {.rd_enable = 1, .wr_enable = 0} | ||
| 196 | }, | ||
| 197 | .clk_inefficiency_factor = 105, | ||
| 198 | .bw_inefficiency_factor = 120, | ||
| 199 | }; | ||
| 200 | |||
| 201 | const struct dpu_mdss_cfg dpu_sm8450_cfg = { | ||
| 202 | .caps = &sm8450_dpu_caps, | ||
| 203 | .ubwc = &sm8450_ubwc_cfg, | ||
| 204 | .mdp_count = ARRAY_SIZE(sm8450_mdp), | ||
| 205 | .mdp = sm8450_mdp, | ||
| 206 | .ctl_count = ARRAY_SIZE(sm8450_ctl), | ||
| 207 | .ctl = sm8450_ctl, | ||
| 208 | .sspp_count = ARRAY_SIZE(sm8450_sspp), | ||
| 209 | .sspp = sm8450_sspp, | ||
| 210 | .mixer_count = ARRAY_SIZE(sm8450_lm), | ||
| 211 | .mixer = sm8450_lm, | ||
| 212 | .dspp_count = ARRAY_SIZE(sm8450_dspp), | ||
| 213 | .dspp = sm8450_dspp, | ||
| 214 | .pingpong_count = ARRAY_SIZE(sm8450_pp), | ||
| 215 | .pingpong = sm8450_pp, | ||
| 216 | .merge_3d_count = ARRAY_SIZE(sm8450_merge_3d), | ||
| 217 | .merge_3d = sm8450_merge_3d, | ||
| 218 | .intf_count = ARRAY_SIZE(sm8450_intf), | ||
| 219 | .intf = sm8450_intf, | ||
| 220 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 221 | .vbif = sdm845_vbif, | ||
| 222 | .reg_dma_count = 1, | ||
| 223 | .dma_cfg = &sm8450_regdma, | ||
| 224 | .perf = &sm8450_perf_data, | ||
| 225 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 226 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 227 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 228 | BIT(MDP_INTF0_7xxx_INTR) | \ | ||
| 229 | BIT(MDP_INTF1_7xxx_INTR) | \ | ||
| 230 | BIT(MDP_INTF2_7xxx_INTR) | \ | ||
| 231 | BIT(MDP_INTF3_7xxx_INTR), | ||
| 232 | }; | ||
| 233 | |||
| 234 | #endif | ||
| @@ -0,0 +1,239 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. | ||
| 4 | * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _DPU_9_0_SM8550_H | ||
| 8 | #define _DPU_9_0_SM8550_H | ||
| 9 | |||
| 10 | static const struct dpu_caps sm8550_dpu_caps = { | ||
| 11 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 12 | .max_mixer_blendstages = 0xb, | ||
| 13 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 14 | .has_src_split = true, | ||
| 15 | .has_dim_layer = true, | ||
| 16 | .has_idle_pc = true, | ||
| 17 | .has_3d_merge = true, | ||
| 18 | .max_linewidth = 5120, | ||
| 19 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 20 | }; | ||
| 21 | |||
| 22 | static const struct dpu_ubwc_cfg sm8550_ubwc_cfg = { | ||
| 23 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 24 | .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ | ||
| 25 | }; | ||
| 26 | |||
| 27 | static const struct dpu_mdp_cfg sm8550_mdp[] = { | ||
| 28 | { | ||
| 29 | .name = "top_0", .id = MDP_TOP, | ||
| 30 | .base = 0, .len = 0x494, | ||
| 31 | .features = BIT(DPU_MDP_PERIPH_0_REMOVED), | ||
| 32 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x4330, .bit_off = 0 }, | ||
| 33 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x6330, .bit_off = 0 }, | ||
| 34 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x8330, .bit_off = 0 }, | ||
| 35 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0xa330, .bit_off = 0 }, | ||
| 36 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x24330, .bit_off = 0 }, | ||
| 37 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x26330, .bit_off = 0 }, | ||
| 38 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x28330, .bit_off = 0 }, | ||
| 39 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2a330, .bit_off = 0 }, | ||
| 40 | .clk_ctrls[DPU_CLK_CTRL_DMA4] = { .reg_off = 0x2c330, .bit_off = 0 }, | ||
| 41 | .clk_ctrls[DPU_CLK_CTRL_DMA5] = { .reg_off = 0x2e330, .bit_off = 0 }, | ||
| 42 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, | ||
| 43 | }, | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ | ||
| 47 | static const struct dpu_ctl_cfg sm8550_ctl[] = { | ||
| 48 | { | ||
| 49 | .name = "ctl_0", .id = CTL_0, | ||
| 50 | .base = 0x15000, .len = 0x290, | ||
| 51 | .features = CTL_SM8550_MASK | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 52 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 53 | }, | ||
| 54 | { | ||
| 55 | .name = "ctl_1", .id = CTL_1, | ||
| 56 | .base = 0x16000, .len = 0x290, | ||
| 57 | .features = CTL_SM8550_MASK | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 58 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 59 | }, | ||
| 60 | { | ||
| 61 | .name = "ctl_2", .id = CTL_2, | ||
| 62 | .base = 0x17000, .len = 0x290, | ||
| 63 | .features = CTL_SM8550_MASK, | ||
| 64 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 65 | }, | ||
| 66 | { | ||
| 67 | .name = "ctl_3", .id = CTL_3, | ||
| 68 | .base = 0x18000, .len = 0x290, | ||
| 69 | .features = CTL_SM8550_MASK, | ||
| 70 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 71 | }, | ||
| 72 | { | ||
| 73 | .name = "ctl_4", .id = CTL_4, | ||
| 74 | .base = 0x19000, .len = 0x290, | ||
| 75 | .features = CTL_SM8550_MASK, | ||
| 76 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 77 | }, | ||
| 78 | { | ||
| 79 | .name = "ctl_5", .id = CTL_5, | ||
| 80 | .base = 0x1a000, .len = 0x290, | ||
| 81 | .features = CTL_SM8550_MASK, | ||
| 82 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 83 | }, | ||
| 84 | }; | ||
| 85 | |||
| 86 | static const struct dpu_sspp_cfg sm8550_sspp[] = { | ||
| 87 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x344, VIG_SC7180_MASK, | ||
| 88 | sm8550_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 89 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, 0x344, VIG_SC7180_MASK, | ||
| 90 | sm8550_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 91 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, 0x344, VIG_SC7180_MASK, | ||
| 92 | sm8550_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 93 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, 0x344, VIG_SC7180_MASK, | ||
| 94 | sm8550_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 95 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x344, DMA_SDM845_MASK, | ||
| 96 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 97 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x344, DMA_SDM845_MASK, | ||
| 98 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 99 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x344, DMA_SDM845_MASK, | ||
| 100 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 101 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, 0x344, DMA_SDM845_MASK, | ||
| 102 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 103 | SSPP_BLK("sspp_12", SSPP_DMA4, 0x2c000, 0x344, DMA_CURSOR_SDM845_MASK, | ||
| 104 | sm8550_dma_sblk_4, 14, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA4), | ||
| 105 | SSPP_BLK("sspp_13", SSPP_DMA5, 0x2e000, 0x344, DMA_CURSOR_SDM845_MASK, | ||
| 106 | sm8550_dma_sblk_5, 15, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA5), | ||
| 107 | }; | ||
| 108 | |||
| 109 | static const struct dpu_lm_cfg sm8550_lm[] = { | ||
| 110 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 111 | &sdm845_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 112 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 113 | &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1), | ||
| 114 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 115 | &sdm845_lm_sblk, PINGPONG_2, LM_3, 0), | ||
| 116 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, | ||
| 117 | &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 118 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, | ||
| 119 | &sdm845_lm_sblk, PINGPONG_4, LM_5, 0), | ||
| 120 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, | ||
| 121 | &sdm845_lm_sblk, PINGPONG_5, LM_4, 0), | ||
| 122 | }; | ||
| 123 | |||
| 124 | static const struct dpu_dspp_cfg sm8550_dspp[] = { | ||
| 125 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 126 | &sm8150_dspp_sblk), | ||
| 127 | DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK, | ||
| 128 | &sm8150_dspp_sblk), | ||
| 129 | DSPP_BLK("dspp_2", DSPP_2, 0x58000, DSPP_SC7180_MASK, | ||
| 130 | &sm8150_dspp_sblk), | ||
| 131 | DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK, | ||
| 132 | &sm8150_dspp_sblk), | ||
| 133 | }; | ||
| 134 | static const struct dpu_pingpong_cfg sm8550_pp[] = { | ||
| 135 | PP_BLK_DIPHER("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sc7280_pp_sblk, | ||
| 136 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 137 | -1), | ||
| 138 | PP_BLK_DIPHER("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sc7280_pp_sblk, | ||
| 139 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 140 | -1), | ||
| 141 | PP_BLK_DIPHER("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sc7280_pp_sblk, | ||
| 142 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 143 | -1), | ||
| 144 | PP_BLK_DIPHER("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sc7280_pp_sblk, | ||
| 145 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 146 | -1), | ||
| 147 | PP_BLK_DIPHER("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sc7280_pp_sblk, | ||
| 148 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 149 | -1), | ||
| 150 | PP_BLK_DIPHER("pingpong_5", PINGPONG_5, 0x6e000, MERGE_3D_2, sc7280_pp_sblk, | ||
| 151 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 152 | -1), | ||
| 153 | PP_BLK_DIPHER("pingpong_6", PINGPONG_6, 0x66000, MERGE_3D_3, sc7280_pp_sblk, | ||
| 154 | -1, | ||
| 155 | -1), | ||
| 156 | PP_BLK_DIPHER("pingpong_7", PINGPONG_7, 0x66400, MERGE_3D_3, sc7280_pp_sblk, | ||
| 157 | -1, | ||
| 158 | -1), | ||
| 159 | }; | ||
| 160 | |||
| 161 | static const struct dpu_merge_3d_cfg sm8550_merge_3d[] = { | ||
| 162 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x4e000), | ||
| 163 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x4f000), | ||
| 164 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x50000), | ||
| 165 | MERGE_3D_BLK("merge_3d_3", MERGE_3D_3, 0x66700), | ||
| 166 | }; | ||
| 167 | |||
| 168 | static const struct dpu_intf_cfg sm8550_intf[] = { | ||
| 169 | INTF_BLK("intf_0", INTF_0, 0x34000, 0x280, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 170 | /* TODO TE sub-blocks for intf1 & intf2 */ | ||
| 171 | INTF_BLK("intf_1", INTF_1, 0x35000, 0x300, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 172 | INTF_BLK("intf_2", INTF_2, 0x36000, 0x300, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 173 | INTF_BLK("intf_3", INTF_3, 0x37000, 0x280, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 174 | }; | ||
| 175 | |||
| 176 | static const struct dpu_perf_cfg sm8550_perf_data = { | ||
| 177 | .max_bw_low = 13600000, | ||
| 178 | .max_bw_high = 18200000, | ||
| 179 | .min_core_ib = 2500000, | ||
| 180 | .min_llcc_ib = 0, | ||
| 181 | .min_dram_ib = 800000, | ||
| 182 | .min_prefill_lines = 35, | ||
| 183 | /* FIXME: lut tables */ | ||
| 184 | .danger_lut_tbl = {0x3ffff, 0x3ffff, 0x0}, | ||
| 185 | .safe_lut_tbl = {0xfe00, 0xfe00, 0xffff}, | ||
| 186 | .qos_lut_tbl = { | ||
| 187 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 188 | .entries = sc7180_qos_linear | ||
| 189 | }, | ||
| 190 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 191 | .entries = sc7180_qos_macrotile | ||
| 192 | }, | ||
| 193 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 194 | .entries = sc7180_qos_nrt | ||
| 195 | }, | ||
| 196 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 197 | }, | ||
| 198 | .cdp_cfg = { | ||
| 199 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 200 | {.rd_enable = 1, .wr_enable = 0} | ||
| 201 | }, | ||
| 202 | .clk_inefficiency_factor = 105, | ||
| 203 | .bw_inefficiency_factor = 120, | ||
| 204 | }; | ||
| 205 | |||
| 206 | const struct dpu_mdss_cfg dpu_sm8550_cfg = { | ||
| 207 | .caps = &sm8550_dpu_caps, | ||
| 208 | .ubwc = &sm8550_ubwc_cfg, | ||
| 209 | .mdp_count = ARRAY_SIZE(sm8550_mdp), | ||
| 210 | .mdp = sm8550_mdp, | ||
| 211 | .ctl_count = ARRAY_SIZE(sm8550_ctl), | ||
| 212 | .ctl = sm8550_ctl, | ||
| 213 | .sspp_count = ARRAY_SIZE(sm8550_sspp), | ||
| 214 | .sspp = sm8550_sspp, | ||
| 215 | .mixer_count = ARRAY_SIZE(sm8550_lm), | ||
| 216 | .mixer = sm8550_lm, | ||
| 217 | .dspp_count = ARRAY_SIZE(sm8550_dspp), | ||
| 218 | .dspp = sm8550_dspp, | ||
| 219 | .pingpong_count = ARRAY_SIZE(sm8550_pp), | ||
| 220 | .pingpong = sm8550_pp, | ||
| 221 | .merge_3d_count = ARRAY_SIZE(sm8550_merge_3d), | ||
| 222 | .merge_3d = sm8550_merge_3d, | ||
| 223 | .intf_count = ARRAY_SIZE(sm8550_intf), | ||
| 224 | .intf = sm8550_intf, | ||
| 225 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 226 | .vbif = sdm845_vbif, | ||
| 227 | .reg_dma_count = 1, | ||
| 228 | .dma_cfg = &sm8450_regdma, | ||
| 229 | .perf = &sm8550_perf_data, | ||
| 230 | .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 231 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 232 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 233 | BIT(MDP_INTF0_7xxx_INTR) | \ | ||
| 234 | BIT(MDP_INTF1_7xxx_INTR) | \ | ||
| 235 | BIT(MDP_INTF2_7xxx_INTR) | \ | ||
| 236 | BIT(MDP_INTF3_7xxx_INTR), | ||
| 237 | }; | ||
| 238 | |||
| 239 | #endif | ||
| @@ -21,6 +21,7 @@ · 20 unmodified lines | |||
| 21 | #include <drm/drm_probe_helper.h> | 21 | #include <drm/drm_probe_helper.h> |
| 22 | #include <drm/drm_rect.h> | 22 | #include <drm/drm_rect.h> |
| 23 | #include <drm/drm_vblank.h> | 23 | #include <drm/drm_vblank.h> |
| 24 | #include <drm/drm_self_refresh_helper.h> | ||
| 24 | 25 | ||
| 25 | #include "dpu_kms.h" | 26 | #include "dpu_kms.h" |
| 26 | #include "dpu_hw_lm.h" | 27 | #include "dpu_hw_lm.h" |
| @@ -400,6 +401,47 @@ static void _dpu_crtc_program_lm_output_roi(struct drm_crtc *crtc) · 373 unmodified lines | |||
| 400 | } | 401 | } |
| 401 | } | 402 | } |
| 402 | 403 | ||
| 404 | static void _dpu_crtc_blend_setup_pipe(struct drm_crtc *crtc, | ||
| 405 | struct drm_plane *plane, | ||
| 406 | struct dpu_crtc_mixer *mixer, | ||
| 407 | u32 num_mixers, | ||
| 408 | enum dpu_stage stage, | ||
| 409 | struct dpu_format *format, | ||
| 410 | uint64_t modifier, | ||
| 411 | struct dpu_sw_pipe *pipe, | ||
| 412 | unsigned int stage_idx, | ||
| 413 | struct dpu_hw_stage_cfg *stage_cfg | ||
| 414 | ) | ||
| 415 | { | ||
| 416 | uint32_t lm_idx; | ||
| 417 | enum dpu_sspp sspp_idx; | ||
| 418 | struct drm_plane_state *state; | ||
| 419 | |||
| 420 | sspp_idx = pipe->sspp->idx; | ||
| 421 | |||
| 422 | state = plane->state; | ||
| 423 | |||
| 424 | trace_dpu_crtc_setup_mixer(DRMID(crtc), DRMID(plane), | ||
| 425 | state, to_dpu_plane_state(state), stage_idx, | ||
| 426 | format->base.pixel_format, | ||
| 427 | modifier); | ||
| 428 | |||
| 429 | DRM_DEBUG_ATOMIC("crtc %d stage:%d - plane %d sspp %d fb %d multirect_idx %d\n", | ||
| 430 | crtc->base.id, | ||
| 431 | stage, | ||
| 432 | plane->base.id, | ||
| 433 | sspp_idx - SSPP_NONE, | ||
| 434 | state->fb ? state->fb->base.id : -1, | ||
| 435 | pipe->multirect_index); | ||
| 436 | |||
| 437 | stage_cfg->stage[stage][stage_idx] = sspp_idx; | ||
| 438 | stage_cfg->multirect_index[stage][stage_idx] = pipe->multirect_index; | ||
| 439 | |||
| 440 | /* blend config update */ | ||
| 441 | for (lm_idx = 0; lm_idx < num_mixers; lm_idx++) | ||
| 442 | mixer[lm_idx].lm_ctl->ops.update_pending_flush_sspp(mixer[lm_idx].lm_ctl, sspp_idx); | ||
| 443 | } | ||
| 444 | |||
| 403 | static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, | 445 | static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, |
| 404 | struct dpu_crtc *dpu_crtc, struct dpu_crtc_mixer *mixer, | 446 | struct dpu_crtc *dpu_crtc, struct dpu_crtc_mixer *mixer, |
| 405 | struct dpu_hw_stage_cfg *stage_cfg) | 447 | struct dpu_hw_stage_cfg *stage_cfg) |
| @@ -412,15 +454,12 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, · 6 unmodified lines | |||
| 412 | struct dpu_format *format; | 454 | struct dpu_format *format; |
| 413 | struct dpu_hw_ctl *ctl = mixer->lm_ctl; | 455 | struct dpu_hw_ctl *ctl = mixer->lm_ctl; |
| 414 | 456 | ||
| 415 | uint32_t stage_idx, lm_idx; | 457 | uint32_t lm_idx; |
| 416 | int zpos_cnt[DPU_STAGE_MAX + 1] = { 0 }; | ||
| 417 | bool bg_alpha_enable = false; | 458 | bool bg_alpha_enable = false; |
| 418 | DECLARE_BITMAP(fetch_active, SSPP_MAX); | 459 | DECLARE_BITMAP(fetch_active, SSPP_MAX); |
| 419 | 460 | ||
| 420 | memset(fetch_active, 0, sizeof(fetch_active)); | 461 | memset(fetch_active, 0, sizeof(fetch_active)); |
| 421 | drm_atomic_crtc_for_each_plane(plane, crtc) { | 462 | drm_atomic_crtc_for_each_plane(plane, crtc) { |
| 422 | enum dpu_sspp sspp_idx; | ||
| 423 | |||
| 424 | state = plane->state; | 463 | state = plane->state; |
| 425 | if (!state) | 464 | if (!state) |
| 426 | continue; | 465 | continue; |
| @@ -431,40 +470,30 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, · 4 unmodified lines | |||
| 431 | pstate = to_dpu_plane_state(state); | 470 | pstate = to_dpu_plane_state(state); |
| 432 | fb = state->fb; | 471 | fb = state->fb; |
| 433 | 472 | ||
| 434 | sspp_idx = dpu_plane_pipe(plane); | ||
| 435 | set_bit(sspp_idx, fetch_active); | ||
| 436 | |||
| 437 | DRM_DEBUG_ATOMIC("crtc %d stage:%d - plane %d sspp %d fb %d\n", | ||
| 438 | crtc->base.id, | ||
| 439 | pstate->stage, | ||
| 440 | plane->base.id, | ||
| 441 | sspp_idx - SSPP_VIG0, | ||
| 442 | state->fb ? state->fb->base.id : -1); | ||
| 443 | |||
| 444 | format = to_dpu_format(msm_framebuffer_format(pstate->base.fb)); | 473 | format = to_dpu_format(msm_framebuffer_format(pstate->base.fb)); |
| 445 | 474 | ||
| 446 | if (pstate->stage == DPU_STAGE_BASE && format->alpha_enable) | 475 | if (pstate->stage == DPU_STAGE_BASE && format->alpha_enable) |
| 447 | bg_alpha_enable = true; | 476 | bg_alpha_enable = true; |
| 448 | 477 | ||
| 449 | stage_idx = zpos_cnt[pstate->stage]++; | 478 | set_bit(pstate->pipe.sspp->idx, fetch_active); |
| 450 | stage_cfg->stage[pstate->stage][stage_idx] = | 479 | _dpu_crtc_blend_setup_pipe(crtc, plane, |
| 451 | sspp_idx; | 480 | mixer, cstate->num_mixers, |
| 452 | stage_cfg->multirect_index[pstate->stage][stage_idx] = | 481 | pstate->stage, |
| 453 | pstate->multirect_index; | 482 | format, fb ? fb->modifier : 0, |
| 454 | 483 | &pstate->pipe, 0, stage_cfg); | |
| 455 | trace_dpu_crtc_setup_mixer(DRMID(crtc), DRMID(plane), | 484 | |
| 456 | state, pstate, stage_idx, | 485 | if (pstate->r_pipe.sspp) { |
| 457 | sspp_idx - SSPP_VIG0, | 486 | set_bit(pstate->r_pipe.sspp->idx, fetch_active); |
| 458 | format->base.pixel_format, | 487 | _dpu_crtc_blend_setup_pipe(crtc, plane, |
| 459 | fb ? fb->modifier : 0); | 488 | mixer, cstate->num_mixers, |
| 489 | pstate->stage, | ||
| 490 | format, fb ? fb->modifier : 0, | ||
| 491 | &pstate->r_pipe, 1, stage_cfg); | ||
| 492 | } | ||
| 460 | 493 | ||
| 461 | /* blend config update */ | 494 | /* blend config update */ |
| 462 | for (lm_idx = 0; lm_idx < cstate->num_mixers; lm_idx++) { | 495 | for (lm_idx = 0; lm_idx < cstate->num_mixers; lm_idx++) { |
| 463 | _dpu_crtc_setup_blend_cfg(mixer + lm_idx, | 496 | _dpu_crtc_setup_blend_cfg(mixer + lm_idx, pstate, format); |
| 464 | pstate, format); | ||
| 465 | |||
| 466 | mixer[lm_idx].lm_ctl->ops.update_pending_flush_sspp(mixer[lm_idx].lm_ctl, | ||
| 467 | sspp_idx); | ||
| 468 | 497 | ||
| 469 | if (bg_alpha_enable && !format->alpha_enable) | 498 | if (bg_alpha_enable && !format->alpha_enable) |
| 470 | mixer[lm_idx].mixer_op_mode = 0; | 499 | mixer[lm_idx].mixer_op_mode = 0; |
| @@ -767,7 +796,7 @@ static void _dpu_crtc_setup_cp_blocks(struct drm_crtc *crtc) · 296 unmodified lines | |||
| 767 | 796 | ||
| 768 | /* stage config flush mask */ | 797 | /* stage config flush mask */ |
| 769 | ctl->ops.update_pending_flush_dspp(ctl, | 798 | ctl->ops.update_pending_flush_dspp(ctl, |
| 770 | mixer[i].hw_dspp->idx); | 799 | mixer[i].hw_dspp->idx, DPU_DSPP_PCC); |
| 771 | } | 800 | } |
| 772 | } | 801 | } |
| 773 | 802 | ||
| @@ -1021,6 +1050,18 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, · 247 unmodified lines | |||
| 1021 | 1050 | ||
| 1022 | DRM_DEBUG_KMS("crtc%d\n", crtc->base.id); | 1051 | DRM_DEBUG_KMS("crtc%d\n", crtc->base.id); |
| 1023 | 1052 | ||
| 1053 | /* If disable is triggered while in self refresh mode, | ||
| 1054 | * reset the encoder software state so that in enable | ||
| 1055 | * it won't trigger a warn while assigning crtc. | ||
| 1056 | */ | ||
| 1057 | if (old_crtc_state->self_refresh_active) { | ||
| 1058 | drm_for_each_encoder_mask(encoder, crtc->dev, | ||
| 1059 | old_crtc_state->encoder_mask) { | ||
| 1060 | dpu_encoder_assign_crtc(encoder, NULL); | ||
| 1061 | } | ||
| 1062 | return; | ||
| 1063 | } | ||
| 1064 | |||
| 1024 | /* Disable/save vblank irq handling */ | 1065 | /* Disable/save vblank irq handling */ |
| 1025 | drm_crtc_vblank_off(crtc); | 1066 | drm_crtc_vblank_off(crtc); |
| 1026 | 1067 | ||
| @@ -1032,7 +1073,14 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, · 5 unmodified lines | |||
| 1032 | */ | 1073 | */ |
| 1033 | if (dpu_encoder_get_intf_mode(encoder) == INTF_MODE_VIDEO) | 1074 | if (dpu_encoder_get_intf_mode(encoder) == INTF_MODE_VIDEO) |
| 1034 | release_bandwidth = true; | 1075 | release_bandwidth = true; |
| 1035 | dpu_encoder_assign_crtc(encoder, NULL); | 1076 | |
| 1077 | /* | ||
| 1078 | * If disable is triggered during psr active(e.g: screen dim in PSR), | ||
| 1079 | * we will need encoder->crtc connection to process the device sleep & | ||
| 1080 | * preserve it during psr sequence. | ||
| 1081 | */ | ||
| 1082 | if (!crtc->state->self_refresh_active) | ||
| 1083 | dpu_encoder_assign_crtc(encoder, NULL); | ||
| 1036 | } | 1084 | } |
| 1037 | 1085 | ||
| 1038 | /* wait for frame_event_done completion */ | 1086 | /* wait for frame_event_done completion */ |
| @@ -1080,6 +1128,9 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, · 41 unmodified lines | |||
| 1080 | struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); | 1128 | struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); |
| 1081 | struct drm_encoder *encoder; | 1129 | struct drm_encoder *encoder; |
| 1082 | bool request_bandwidth = false; | 1130 | bool request_bandwidth = false; |
| 1131 | struct drm_crtc_state *old_crtc_state; | ||
| 1132 | |||
| 1133 | old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); | ||
| 1083 | 1134 | ||
| 1084 | pm_runtime_get_sync(crtc->dev->dev); | 1135 | pm_runtime_get_sync(crtc->dev->dev); |
| 1085 | 1136 | ||
| @@ -1102,25 +1153,23 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, · 16 unmodified lines | |||
| 1102 | trace_dpu_crtc_enable(DRMID(crtc), true, dpu_crtc); | 1153 | trace_dpu_crtc_enable(DRMID(crtc), true, dpu_crtc); |
| 1103 | dpu_crtc->enabled = true; | 1154 | dpu_crtc->enabled = true; |
| 1104 | 1155 | ||
| 1105 | drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) | 1156 | if (!old_crtc_state->self_refresh_active) { |
| 1106 | dpu_encoder_assign_crtc(encoder, crtc); | 1157 | drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) |
| 1158 | dpu_encoder_assign_crtc(encoder, crtc); | ||
| 1159 | } | ||
| 1107 | 1160 | ||
| 1108 | /* Enable/restore vblank irq handling */ | 1161 | /* Enable/restore vblank irq handling */ |
| 1109 | drm_crtc_vblank_on(crtc); | 1162 | drm_crtc_vblank_on(crtc); |
| 1110 | } | 1163 | } |
| 1111 | 1164 | ||
| 1112 | struct plane_state { | ||
| 1113 | struct dpu_plane_state *dpu_pstate; | ||
| 1114 | const struct drm_plane_state *drm_pstate; | ||
| 1115 | int stage; | ||
| 1116 | u32 pipe_id; | ||
| 1117 | }; | ||
| 1118 | |||
| 1119 | static bool dpu_crtc_needs_dirtyfb(struct drm_crtc_state *cstate) | 1165 | static bool dpu_crtc_needs_dirtyfb(struct drm_crtc_state *cstate) |
| 1120 | { | 1166 | { |
| 1121 | struct drm_crtc *crtc = cstate->crtc; | 1167 | struct drm_crtc *crtc = cstate->crtc; |
| 1122 | struct drm_encoder *encoder; | 1168 | struct drm_encoder *encoder; |
| 1123 | 1169 | ||
| 1170 | if (cstate->self_refresh_active) | ||
| 1171 | return true; | ||
| 1172 | |||
| 1124 | drm_for_each_encoder_mask (encoder, crtc->dev, cstate->encoder_mask) { | 1173 | drm_for_each_encoder_mask (encoder, crtc->dev, cstate->encoder_mask) { |
| 1125 | if (dpu_encoder_get_intf_mode(encoder) == INTF_MODE_CMD) { | 1174 | if (dpu_encoder_get_intf_mode(encoder) == INTF_MODE_CMD) { |
| 1126 | return true; | 1175 | return true; |
| @@ -1137,151 +1186,46 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, · 10 unmodified lines | |||
| 1137 | crtc); | 1186 | crtc); |
| 1138 | struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); | 1187 | struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); |
| 1139 | struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc_state); | 1188 | struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc_state); |
| 1140 | struct plane_state *pstates; | ||
| 1141 | 1189 | ||
| 1142 | const struct drm_plane_state *pstate; | 1190 | const struct drm_plane_state *pstate; |
| 1143 | struct drm_plane *plane; | 1191 | struct drm_plane *plane; |
| 1144 | struct drm_display_mode *mode; | ||
| 1145 | 1192 | ||
| 1146 | int cnt = 0, rc = 0, mixer_width = 0, i, z_pos; | 1193 | int rc = 0; |
| 1147 | 1194 | ||
| 1148 | struct dpu_multirect_plane_states multirect_plane[DPU_STAGE_MAX * 2]; | ||
| 1149 | int multirect_count = 0; | ||
| 1150 | const struct drm_plane_state *pipe_staged[SSPP_MAX]; | ||
| 1151 | int left_zpos_cnt = 0, right_zpos_cnt = 0; | ||
| 1152 | struct drm_rect crtc_rect = { 0 }; | ||
| 1153 | bool needs_dirtyfb = dpu_crtc_needs_dirtyfb(crtc_state); | 1195 | bool needs_dirtyfb = dpu_crtc_needs_dirtyfb(crtc_state); |
| 1154 | 1196 | ||
| 1155 | pstates = kzalloc(sizeof(*pstates) * DPU_STAGE_MAX * 4, GFP_KERNEL); | 1197 | if (!crtc_state->enable || !drm_atomic_crtc_effectively_active(crtc_state)) { |
| 1156 | if (!pstates) | ||
| 1157 | return -ENOMEM; | ||
| 1158 | |||
| 1159 | if (!crtc_state->enable || !crtc_state->active) { | ||
| 1160 | DRM_DEBUG_ATOMIC("crtc%d -> enable %d, active %d, skip atomic_check\n", | 1198 | DRM_DEBUG_ATOMIC("crtc%d -> enable %d, active %d, skip atomic_check\n", |
| 1161 | crtc->base.id, crtc_state->enable, | 1199 | crtc->base.id, crtc_state->enable, |
| 1162 | crtc_state->active); | 1200 | crtc_state->active); |
| 1163 | memset(&cstate->new_perf, 0, sizeof(cstate->new_perf)); | 1201 | memset(&cstate->new_perf, 0, sizeof(cstate->new_perf)); |
| 1164 | goto end; | 1202 | return 0; |
| 1165 | } | 1203 | } |
| 1166 | 1204 | ||
| 1167 | mode = &crtc_state->adjusted_mode; | ||
| 1168 | DRM_DEBUG_ATOMIC("%s: check\n", dpu_crtc->name); | 1205 | DRM_DEBUG_ATOMIC("%s: check\n", dpu_crtc->name); |
| 1169 | 1206 | ||
| 1170 | /* force a full mode set if active state changed */ | 1207 | /* force a full mode set if active state changed */ |
| 1171 | if (crtc_state->active_changed) | 1208 | if (crtc_state->active_changed) |
| 1172 | crtc_state->mode_changed = true; | 1209 | crtc_state->mode_changed = true; |
| 1173 | 1210 | ||
| 1174 | memset(pipe_staged, 0, sizeof(pipe_staged)); | 1211 | if (cstate->num_mixers) |
| 1175 | |||
| 1176 | if (cstate->num_mixers) { | ||
| 1177 | mixer_width = mode->hdisplay / cstate->num_mixers; | ||
| 1178 | |||
| 1179 | _dpu_crtc_setup_lm_bounds(crtc, crtc_state); | 1212 | _dpu_crtc_setup_lm_bounds(crtc, crtc_state); |
| 1180 | } | ||
| 1181 | |||
| 1182 | crtc_rect.x2 = mode->hdisplay; | ||
| 1183 | crtc_rect.y2 = mode->vdisplay; | ||
| 1184 | 1213 | ||
| 1185 | /* get plane state for all drm planes associated with crtc state */ | 1214 | /* FIXME: move this to dpu_plane_atomic_check? */ |
| 1186 | drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) { | 1215 | drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) { |
| 1187 | struct dpu_plane_state *dpu_pstate = to_dpu_plane_state(pstate); | 1216 | struct dpu_plane_state *dpu_pstate = to_dpu_plane_state(pstate); |
| 1188 | struct drm_rect dst, clip = crtc_rect; | ||
| 1189 | 1217 | ||
| 1190 | if (IS_ERR_OR_NULL(pstate)) { | 1218 | if (IS_ERR_OR_NULL(pstate)) { |
| 1191 | rc = PTR_ERR(pstate); | 1219 | rc = PTR_ERR(pstate); |
| 1192 | DPU_ERROR("%s: failed to get plane%d state, %d\n", | 1220 | DPU_ERROR("%s: failed to get plane%d state, %d\n", |
| 1193 | dpu_crtc->name, plane->base.id, rc); | 1221 | dpu_crtc->name, plane->base.id, rc); |
| 1194 | goto end; | 1222 | return rc; |
| 1195 | } | 1223 | } |
| 1196 | if (cnt >= DPU_STAGE_MAX * 4) | ||
| 1197 | continue; | ||
| 1198 | 1224 | ||
| 1199 | if (!pstate->visible) | 1225 | if (!pstate->visible) |
| 1200 | continue; | 1226 | continue; |
| 1201 | 1227 | ||
| 1202 | pstates[cnt].dpu_pstate = dpu_pstate; | ||
| 1203 | pstates[cnt].drm_pstate = pstate; | ||
| 1204 | pstates[cnt].stage = pstate->normalized_zpos; | ||
| 1205 | pstates[cnt].pipe_id = dpu_plane_pipe(plane); | ||
| 1206 | |||
| 1207 | dpu_pstate->needs_dirtyfb = needs_dirtyfb; | 1228 | dpu_pstate->needs_dirtyfb = needs_dirtyfb; |
| 1208 | |||
| 1209 | if (pipe_staged[pstates[cnt].pipe_id]) { | ||
| 1210 | multirect_plane[multirect_count].r0 = | ||
| 1211 | pipe_staged[pstates[cnt].pipe_id]; | ||
| 1212 | multirect_plane[multirect_count].r1 = pstate; | ||
| 1213 | multirect_count++; | ||
| 1214 | |||
| 1215 | pipe_staged[pstates[cnt].pipe_id] = NULL; | ||
| 1216 | } else { | ||
| 1217 | pipe_staged[pstates[cnt].pipe_id] = pstate; | ||
| 1218 | } | ||
| 1219 | |||
| 1220 | cnt++; | ||
| 1221 | |||
| 1222 | dst = drm_plane_state_dest(pstate); | ||
| 1223 | if (!drm_rect_intersect(&clip, &dst)) { | ||
| 1224 | DPU_ERROR("invalid vertical/horizontal destination\n"); | ||
| 1225 | DPU_ERROR("display: " DRM_RECT_FMT " plane: " | ||
| 1226 | DRM_RECT_FMT "\n", DRM_RECT_ARG(&crtc_rect), | ||
| 1227 | DRM_RECT_ARG(&dst)); | ||
| 1228 | rc = -E2BIG; | ||
| 1229 | goto end; | ||
| 1230 | } | ||
| 1231 | } | ||
| 1232 | |||
| 1233 | for (i = 1; i < SSPP_MAX; i++) { | ||
| 1234 | if (pipe_staged[i]) | ||
| 1235 | dpu_plane_clear_multirect(pipe_staged[i]); | ||
| 1236 | } | ||
| 1237 | |||
| 1238 | z_pos = -1; | ||
| 1239 | for (i = 0; i < cnt; i++) { | ||
| 1240 | /* reset counts at every new blend stage */ | ||
| 1241 | if (pstates[i].stage != z_pos) { | ||
| 1242 | left_zpos_cnt = 0; | ||
| 1243 | right_zpos_cnt = 0; | ||
| 1244 | z_pos = pstates[i].stage; | ||
| 1245 | } | ||
| 1246 | |||
| 1247 | /* verify z_pos setting before using it */ | ||
| 1248 | if (z_pos >= DPU_STAGE_MAX - DPU_STAGE_0) { | ||
| 1249 | DPU_ERROR("> %d plane stages assigned\n", | ||
| 1250 | DPU_STAGE_MAX - DPU_STAGE_0); | ||
| 1251 | rc = -EINVAL; | ||
| 1252 | goto end; | ||
| 1253 | } else if (pstates[i].drm_pstate->crtc_x < mixer_width) { | ||
| 1254 | if (left_zpos_cnt == 2) { | ||
| 1255 | DPU_ERROR("> 2 planes @ stage %d on left\n", | ||
| 1256 | z_pos); | ||
| 1257 | rc = -EINVAL; | ||
| 1258 | goto end; | ||
| 1259 | } | ||
| 1260 | left_zpos_cnt++; | ||
| 1261 | |||
| 1262 | } else { | ||
| 1263 | if (right_zpos_cnt == 2) { | ||
| 1264 | DPU_ERROR("> 2 planes @ stage %d on right\n", | ||
| 1265 | z_pos); | ||
| 1266 | rc = -EINVAL; | ||
| 1267 | goto end; | ||
| 1268 | } | ||
| 1269 | right_zpos_cnt++; | ||
| 1270 | } | ||
| 1271 | |||
| 1272 | pstates[i].dpu_pstate->stage = z_pos + DPU_STAGE_0; | ||
| 1273 | DRM_DEBUG_ATOMIC("%s: zpos %d\n", dpu_crtc->name, z_pos); | ||
| 1274 | } | ||
| 1275 | |||
| 1276 | for (i = 0; i < multirect_count; i++) { | ||
| 1277 | if (dpu_plane_validate_multirect_v2(&multirect_plane[i])) { | ||
| 1278 | DPU_ERROR( | ||
| 1279 | "multirect validation failed for planes (%d - %d)\n", | ||
| 1280 | multirect_plane[i].r0->plane->base.id, | ||
| 1281 | multirect_plane[i].r1->plane->base.id); | ||
| 1282 | rc = -EINVAL; | ||
| 1283 | goto end; | ||
| 1284 | } | ||
| 1285 | } | 1229 | } |
| 1286 | 1230 | ||
| 1287 | atomic_inc(&_dpu_crtc_get_kms(crtc)->bandwidth_ref); | 1231 | atomic_inc(&_dpu_crtc_get_kms(crtc)->bandwidth_ref); |
| @@ -1290,74 +1234,10 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, · 2 unmodified lines | |||
| 1290 | if (rc) { | 1234 | if (rc) { |
| 1291 | DPU_ERROR("crtc%d failed performance check %d\n", | 1235 | DPU_ERROR("crtc%d failed performance check %d\n", |
| 1292 | crtc->base.id, rc); | 1236 | crtc->base.id, rc); |
| 1293 | goto end; | 1237 | return rc; |
| 1294 | } | 1238 | } |
| 1295 | 1239 | ||
| 1296 | /* validate source split: | 1240 | return 0; |
| 1297 | * use pstates sorted by stage to check planes on same stage | ||
| 1298 | * we assume that all pipes are in source split so its valid to compare | ||
| 1299 | * without taking into account left/right mixer placement | ||
| 1300 | */ | ||
| 1301 | for (i = 1; i < cnt; i++) { | ||
| 1302 | struct plane_state *prv_pstate, *cur_pstate; | ||
| 1303 | struct drm_rect left_rect, right_rect; | ||
| 1304 | int32_t left_pid, right_pid; | ||
| 1305 | int32_t stage; | ||
| 1306 | |||
| 1307 | prv_pstate = &pstates[i - 1]; | ||
| 1308 | cur_pstate = &pstates[i]; | ||
| 1309 | if (prv_pstate->stage != cur_pstate->stage) | ||
| 1310 | continue; | ||
| 1311 | |||
| 1312 | stage = cur_pstate->stage; | ||
| 1313 | |||
| 1314 | left_pid = prv_pstate->dpu_pstate->base.plane->base.id; | ||
| 1315 | left_rect = drm_plane_state_dest(prv_pstate->drm_pstate); | ||
| 1316 | |||
| 1317 | right_pid = cur_pstate->dpu_pstate->base.plane->base.id; | ||
| 1318 | right_rect = drm_plane_state_dest(cur_pstate->drm_pstate); | ||
| 1319 | |||
| 1320 | if (right_rect.x1 < left_rect.x1) { | ||
| 1321 | swap(left_pid, right_pid); | ||
| 1322 | swap(left_rect, right_rect); | ||
| 1323 | } | ||
| 1324 | |||
| 1325 | /** | ||
| 1326 | * - planes are enumerated in pipe-priority order such that | ||
| 1327 | * planes with lower drm_id must be left-most in a shared | ||
| 1328 | * blend-stage when using source split. | ||
| 1329 | * - planes in source split must be contiguous in width | ||
| 1330 | * - planes in source split must have same dest yoff and height | ||
| 1331 | */ | ||
| 1332 | if (right_pid < left_pid) { | ||
| 1333 | DPU_ERROR( | ||
| 1334 | "invalid src split cfg. priority mismatch. stage: %d left: %d right: %d\n", | ||
| 1335 | stage, left_pid, right_pid); | ||
| 1336 | rc = -EINVAL; | ||
| 1337 | goto end; | ||
| 1338 | } else if (right_rect.x1 != drm_rect_width(&left_rect)) { | ||
| 1339 | DPU_ERROR("non-contiguous coordinates for src split. " | ||
| 1340 | "stage: %d left: " DRM_RECT_FMT " right: " | ||
| 1341 | DRM_RECT_FMT "\n", stage, | ||
| 1342 | DRM_RECT_ARG(&left_rect), | ||
| 1343 | DRM_RECT_ARG(&right_rect)); | ||
| 1344 | rc = -EINVAL; | ||
| 1345 | goto end; | ||
| 1346 | } else if (left_rect.y1 != right_rect.y1 || | ||
| 1347 | drm_rect_height(&left_rect) != drm_rect_height(&right_rect)) { | ||
| 1348 | DPU_ERROR("source split at stage: %d. invalid " | ||
| 1349 | "yoff/height: left: " DRM_RECT_FMT " right: " | ||
| 1350 | DRM_RECT_FMT "\n", stage, | ||
| 1351 | DRM_RECT_ARG(&left_rect), | ||
| 1352 | DRM_RECT_ARG(&right_rect)); | ||
| 1353 | rc = -EINVAL; | ||
| 1354 | goto end; | ||
| 1355 | } | ||
| 1356 | } | ||
| 1357 | |||
| 1358 | end: | ||
| 1359 | kfree(pstates); | ||
| 1360 | return rc; | ||
| 1361 | } | 1241 | } |
| 1362 | 1242 | ||
| 1363 | int dpu_crtc_vblank(struct drm_crtc *crtc, bool en) | 1243 | int dpu_crtc_vblank(struct drm_crtc *crtc, bool en) |
| @@ -1474,8 +1354,16 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) · 110 unmodified lines | |||
| 1474 | seq_printf(s, "\tdst x:%4d dst_y:%4d dst_w:%4d dst_h:%4d\n", | 1354 | seq_printf(s, "\tdst x:%4d dst_y:%4d dst_w:%4d dst_h:%4d\n", |
| 1475 | state->crtc_x, state->crtc_y, state->crtc_w, | 1355 | state->crtc_x, state->crtc_y, state->crtc_w, |
| 1476 | state->crtc_h); | 1356 | state->crtc_h); |
| 1477 | seq_printf(s, "\tmultirect: mode: %d index: %d\n", | 1357 | seq_printf(s, "\tsspp[0]:%s\n", |
| 1478 | pstate->multirect_mode, pstate->multirect_index); | 1358 | pstate->pipe.sspp->cap->name); |
| 1359 | seq_printf(s, "\tmultirect[0]: mode: %d index: %d\n", | ||
| 1360 | pstate->pipe.multirect_mode, pstate->pipe.multirect_index); | ||
| 1361 | if (pstate->r_pipe.sspp) { | ||
| 1362 | seq_printf(s, "\tsspp[1]:%s\n", | ||
| 1363 | pstate->r_pipe.sspp->cap->name); | ||
| 1364 | seq_printf(s, "\tmultirect[1]: mode: %d index: %d\n", | ||
| 1365 | pstate->r_pipe.multirect_mode, pstate->r_pipe.multirect_index); | ||
| 1366 | } | ||
| 1479 | 1367 | ||
| 1480 | seq_puts(s, "\n"); | 1368 | seq_puts(s, "\n"); |
| 1481 | } | 1369 | } |
| @@ -1577,7 +1465,7 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane, · 95 unmodified lines | |||
| 1577 | { | 1465 | { |
| 1578 | struct drm_crtc *crtc = NULL; | 1466 | struct drm_crtc *crtc = NULL; |
| 1579 | struct dpu_crtc *dpu_crtc = NULL; | 1467 | struct dpu_crtc *dpu_crtc = NULL; |
| 1580 | int i; | 1468 | int i, ret; |
| 1581 | 1469 | ||
| 1582 | dpu_crtc = kzalloc(sizeof(*dpu_crtc), GFP_KERNEL); | 1470 | dpu_crtc = kzalloc(sizeof(*dpu_crtc), GFP_KERNEL); |
| 1583 | if (!dpu_crtc) | 1471 | if (!dpu_crtc) |
| @@ -1614,6 +1502,13 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane, · 30 unmodified lines | |||
| 1614 | /* initialize event handling */ | 1502 | /* initialize event handling */ |
| 1615 | spin_lock_init(&dpu_crtc->event_lock); | 1503 | spin_lock_init(&dpu_crtc->event_lock); |
| 1616 | 1504 | ||
| 1505 | ret = drm_self_refresh_helper_init(crtc); | ||
| 1506 | if (ret) { | ||
| 1507 | DPU_ERROR("Failed to initialize %s with self-refresh helpers %d\n", | ||
| 1508 | crtc->name, ret); | ||
| 1509 | return ERR_PTR(ret); | ||
| 1510 | } | ||
| 1511 | |||
| 1617 | DRM_DEBUG_KMS("%s: successfully initialized crtc\n", dpu_crtc->name); | 1512 | DRM_DEBUG_KMS("%s: successfully initialized crtc\n", dpu_crtc->name); |
| 1618 | return crtc; | 1513 | return crtc; |
| 1619 | } | 1514 | } |
| @@ -12,6 +12,7 @@ · 11 unmodified lines | |||
| 12 | #include <linux/kthread.h> | 12 | #include <linux/kthread.h> |
| 13 | #include <linux/seq_file.h> | 13 | #include <linux/seq_file.h> |
| 14 | 14 | ||
| 15 | #include <drm/drm_atomic.h> | ||
| 15 | #include <drm/drm_crtc.h> | 16 | #include <drm/drm_crtc.h> |
| 16 | #include <drm/drm_file.h> | 17 | #include <drm/drm_file.h> |
| 17 | #include <drm/drm_probe_helper.h> | 18 | #include <drm/drm_probe_helper.h> |
| @@ -544,7 +545,8 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc) · 526 unmodified lines | |||
| 544 | static struct msm_display_topology dpu_encoder_get_topology( | 545 | static struct msm_display_topology dpu_encoder_get_topology( |
| 545 | struct dpu_encoder_virt *dpu_enc, | 546 | struct dpu_encoder_virt *dpu_enc, |
| 546 | struct dpu_kms *dpu_kms, | 547 | struct dpu_kms *dpu_kms, |
| 547 | struct drm_display_mode *mode) | 548 | struct drm_display_mode *mode, |
| 549 | struct drm_crtc_state *crtc_state) | ||
| 548 | { | 550 | { |
| 549 | struct msm_display_topology topology = {0}; | 551 | struct msm_display_topology topology = {0}; |
| 550 | int i, intf_count = 0; | 552 | int i, intf_count = 0; |
| @@ -562,8 +564,7 @@ static struct msm_display_topology dpu_encoder_get_topology( · 11 unmodified lines | |||
| 562 | * 1 LM, 1 INTF | 564 | * 1 LM, 1 INTF |
| 563 | * 2 LM, 1 INTF (stream merge to support high resolution interfaces) | 565 | * 2 LM, 1 INTF (stream merge to support high resolution interfaces) |
| 564 | * | 566 | * |
| 565 | * Adding color blocks only to primary interface if available in | 567 | * Add dspps to the reservation requirements if ctm is requested |
| 566 | * sufficient number | ||
| 567 | */ | 568 | */ |
| 568 | if (intf_count == 2) | 569 | if (intf_count == 2) |
| 569 | topology.num_lm = 2; | 570 | topology.num_lm = 2; |
| @@ -572,11 +573,8 @@ static struct msm_display_topology dpu_encoder_get_topology( · 2 unmodified lines | |||
| 572 | else | 573 | else |
| 573 | topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1; | 574 | topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1; |
| 574 | 575 | ||
| 575 | if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) { | 576 | if (crtc_state->ctm) |
| 576 | if (dpu_kms->catalog->dspp && | 577 | topology.num_dspp = topology.num_lm; |
| 577 | (dpu_kms->catalog->dspp_count >= topology.num_lm)) | ||
| 578 | topology.num_dspp = topology.num_lm; | ||
| 579 | } | ||
| 580 | 578 | ||
| 581 | topology.num_intf = intf_count; | 579 | topology.num_intf = intf_count; |
| 582 | 580 | ||
| @@ -637,25 +635,22 @@ static int dpu_encoder_virt_atomic_check( · 54 unmodified lines | |||
| 637 | if (ret) { | 635 | if (ret) { |
| 638 | DPU_ERROR_ENC(dpu_enc, | 636 | DPU_ERROR_ENC(dpu_enc, |
| 639 | "mode unsupported, phys idx %d\n", i); | 637 | "mode unsupported, phys idx %d\n", i); |
| 640 | break; | 638 | return ret; |
| 641 | } | 639 | } |
| 642 | } | 640 | } |
| 643 | 641 | ||
| 644 | topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode); | 642 | topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state); |
| 645 | 643 | ||
| 646 | /* Reserve dynamic resources now. */ | 644 | /* |
| 647 | if (!ret) { | 645 | * Release and Allocate resources on every modeset |
| 648 | /* | 646 | * Dont allocate when active is false. |
| 649 | * Release and Allocate resources on every modeset | 647 | */ |
| 650 | * Dont allocate when active is false. | 648 | if (drm_atomic_crtc_needs_modeset(crtc_state)) { |
| 651 | */ | 649 | dpu_rm_release(global_state, drm_enc); |
| 652 | if (drm_atomic_crtc_needs_modeset(crtc_state)) { | ||
| 653 | dpu_rm_release(global_state, drm_enc); | ||
| 654 | 650 | ||
| 655 | if (!crtc_state->active_changed || crtc_state->active) | 651 | if (!crtc_state->active_changed || crtc_state->enable) |
| 656 | ret = dpu_rm_reserve(&dpu_kms->rm, global_state, | 652 | ret = dpu_rm_reserve(&dpu_kms->rm, global_state, |
| 657 | drm_enc, crtc_state, topology); | 653 | drm_enc, crtc_state, topology); |
| 658 | } | ||
| 659 | } | 654 | } |
| 660 | 655 | ||
| 661 | trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags); | 656 | trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags); |
| @@ -1171,7 +1166,8 @@ out: · 509 unmodified lines | |||
| 1171 | mutex_unlock(&dpu_enc->enc_lock); | 1166 | mutex_unlock(&dpu_enc->enc_lock); |
| 1172 | } | 1167 | } |
| 1173 | 1168 | ||
| 1174 | static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc) | 1169 | static void dpu_encoder_virt_atomic_enable(struct drm_encoder *drm_enc, |
| 1170 | struct drm_atomic_state *state) | ||
| 1175 | { | 1171 | { |
| 1176 | struct dpu_encoder_virt *dpu_enc = NULL; | 1172 | struct dpu_encoder_virt *dpu_enc = NULL; |
| 1177 | int ret = 0; | 1173 | int ret = 0; |
| @@ -1207,14 +1203,28 @@ out: · 29 unmodified lines | |||
| 1207 | mutex_unlock(&dpu_enc->enc_lock); | 1203 | mutex_unlock(&dpu_enc->enc_lock); |
| 1208 | } | 1204 | } |
| 1209 | 1205 | ||
| 1210 | static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) | 1206 | static void dpu_encoder_virt_atomic_disable(struct drm_encoder *drm_enc, |
| 1207 | struct drm_atomic_state *state) | ||
| 1211 | { | 1208 | { |
| 1212 | struct dpu_encoder_virt *dpu_enc = NULL; | 1209 | struct dpu_encoder_virt *dpu_enc = NULL; |
| 1210 | struct drm_crtc *crtc; | ||
| 1211 | struct drm_crtc_state *old_state = NULL; | ||
| 1213 | int i = 0; | 1212 | int i = 0; |
| 1214 | 1213 | ||
| 1215 | dpu_enc = to_dpu_encoder_virt(drm_enc); | 1214 | dpu_enc = to_dpu_encoder_virt(drm_enc); |
| 1216 | DPU_DEBUG_ENC(dpu_enc, "\n"); | 1215 | DPU_DEBUG_ENC(dpu_enc, "\n"); |
| 1217 | 1216 | ||
| 1217 | crtc = drm_atomic_get_old_crtc_for_encoder(state, drm_enc); | ||
| 1218 | if (crtc) | ||
| 1219 | old_state = drm_atomic_get_old_crtc_state(state, crtc); | ||
| 1220 | |||
| 1221 | /* | ||
| 1222 | * The encoder is already disabled if self refresh mode was set earlier, | ||
| 1223 | * in the old_state for the corresponding crtc. | ||
| 1224 | */ | ||
| 1225 | if (old_state && old_state->self_refresh_active) | ||
| 1226 | return; | ||
| 1227 | |||
| 1218 | mutex_lock(&dpu_enc->enc_lock); | 1228 | mutex_lock(&dpu_enc->enc_lock); |
| 1219 | dpu_enc->enabled = false; | 1229 | dpu_enc->enabled = false; |
| 1220 | 1230 | ||
| @@ -2078,25 +2088,6 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc) · 857 unmodified lines | |||
| 2078 | ctl->ops.clear_pending_flush(ctl); | 2088 | ctl->ops.clear_pending_flush(ctl); |
| 2079 | } | 2089 | } |
| 2080 | 2090 | ||
| 2081 | void dpu_encoder_prepare_commit(struct drm_encoder *drm_enc) | ||
| 2082 | { | ||
| 2083 | struct dpu_encoder_virt *dpu_enc; | ||
| 2084 | struct dpu_encoder_phys *phys; | ||
| 2085 | int i; | ||
| 2086 | |||
| 2087 | if (!drm_enc) { | ||
| 2088 | DPU_ERROR("invalid encoder\n"); | ||
| 2089 | return; | ||
| 2090 | } | ||
| 2091 | dpu_enc = to_dpu_encoder_virt(drm_enc); | ||
| 2092 | |||
| 2093 | for (i = 0; i < dpu_enc->num_phys_encs; i++) { | ||
| 2094 | phys = dpu_enc->phys_encs[i]; | ||
| 2095 | if (phys->ops.prepare_commit) | ||
| 2096 | phys->ops.prepare_commit(phys); | ||
| 2097 | } | ||
| 2098 | } | ||
| 2099 | |||
| 2100 | #ifdef CONFIG_DEBUG_FS | 2091 | #ifdef CONFIG_DEBUG_FS |
| 2101 | static int _dpu_encoder_status_show(struct seq_file *s, void *data) | 2092 | static int _dpu_encoder_status_show(struct seq_file *s, void *data) |
| 2102 | { | 2093 | { |
| @@ -2388,8 +2379,8 @@ static void dpu_encoder_frame_done_timeout(struct timer_list *t) · 285 unmodified lines | |||
| 2388 | 2379 | ||
| 2389 | static const struct drm_encoder_helper_funcs dpu_encoder_helper_funcs = { | 2380 | static const struct drm_encoder_helper_funcs dpu_encoder_helper_funcs = { |
| 2390 | .atomic_mode_set = dpu_encoder_virt_atomic_mode_set, | 2381 | .atomic_mode_set = dpu_encoder_virt_atomic_mode_set, |
| 2391 | .disable = dpu_encoder_virt_disable, | 2382 | .atomic_disable = dpu_encoder_virt_atomic_disable, |
| 2392 | .enable = dpu_encoder_virt_enable, | 2383 | .atomic_enable = dpu_encoder_virt_atomic_enable, |
| 2393 | .atomic_check = dpu_encoder_virt_atomic_check, | 2384 | .atomic_check = dpu_encoder_virt_atomic_check, |
| 2394 | }; | 2385 | }; |
| 2395 | 2386 | ||
| @@ -146,13 +146,6 @@ struct drm_encoder *dpu_encoder_init( · 145 unmodified lines | |||
| 146 | int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, | 146 | int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, |
| 147 | struct msm_display_info *disp_info); | 147 | struct msm_display_info *disp_info); |
| 148 | 148 | ||
| 149 | /** | ||
| 150 | * dpu_encoder_prepare_commit - prepare encoder at the very beginning of an | ||
| 151 | * atomic commit, before any registers are written | ||
| 152 | * @drm_enc: Pointer to previously created drm encoder structure | ||
| 153 | */ | ||
| 154 | void dpu_encoder_prepare_commit(struct drm_encoder *drm_enc); | ||
| 155 | |||
| 156 | /** | 149 | /** |
| 157 | * dpu_encoder_set_idle_timeout - set the idle timeout for video | 150 | * dpu_encoder_set_idle_timeout - set the idle timeout for video |
| 158 | * and command mode encoders. | 151 | * and command mode encoders. |
| @@ -40,6 +40,8 @@ · 39 unmodified lines | |||
| 40 | 40 | ||
| 41 | #define DPU_ENC_MAX_POLL_TIMEOUT_US 2000 | 41 | #define DPU_ENC_MAX_POLL_TIMEOUT_US 2000 |
| 42 | 42 | ||
| 43 | static void dpu_encoder_phys_cmd_enable_te(struct dpu_encoder_phys *phys_enc); | ||
| 44 | |||
| 43 | static bool dpu_encoder_phys_cmd_is_master(struct dpu_encoder_phys *phys_enc) | 45 | static bool dpu_encoder_phys_cmd_is_master(struct dpu_encoder_phys *phys_enc) |
| 44 | { | 46 | { |
| 45 | return (phys_enc->split_role != ENC_ROLE_SLAVE); | 47 | return (phys_enc->split_role != ENC_ROLE_SLAVE); |
| @@ -565,6 +567,8 @@ static void dpu_encoder_phys_cmd_prepare_for_kickoff( · 519 unmodified lines | |||
| 565 | phys_enc->hw_pp->idx - PINGPONG_0); | 567 | phys_enc->hw_pp->idx - PINGPONG_0); |
| 566 | } | 568 | } |
| 567 | 569 | ||
| 570 | dpu_encoder_phys_cmd_enable_te(phys_enc); | ||
| 571 | |||
| 568 | DPU_DEBUG_CMDENC(cmd_enc, "pp:%d pending_cnt %d\n", | 572 | DPU_DEBUG_CMDENC(cmd_enc, "pp:%d pending_cnt %d\n", |
| 569 | phys_enc->hw_pp->idx - PINGPONG_0, | 573 | phys_enc->hw_pp->idx - PINGPONG_0, |
| 570 | atomic_read(&phys_enc->pending_kickoff_cnt)); | 574 | atomic_read(&phys_enc->pending_kickoff_cnt)); |
| @@ -586,8 +590,7 @@ static bool dpu_encoder_phys_cmd_is_ongoing_pptx( · 15 unmodified lines | |||
| 586 | return false; | 590 | return false; |
| 587 | } | 591 | } |
| 588 | 592 | ||
| 589 | static void dpu_encoder_phys_cmd_prepare_commit( | 593 | static void dpu_encoder_phys_cmd_enable_te(struct dpu_encoder_phys *phys_enc) |
| 590 | struct dpu_encoder_phys *phys_enc) | ||
| 591 | { | 594 | { |
| 592 | struct dpu_encoder_phys_cmd *cmd_enc = | 595 | struct dpu_encoder_phys_cmd *cmd_enc = |
| 593 | to_dpu_encoder_phys_cmd(phys_enc); | 596 | to_dpu_encoder_phys_cmd(phys_enc); |
| @@ -732,7 +735,6 @@ static void dpu_encoder_phys_cmd_trigger_start( · 138 unmodified lines | |||
| 732 | static void dpu_encoder_phys_cmd_init_ops( | 735 | static void dpu_encoder_phys_cmd_init_ops( |
| 733 | struct dpu_encoder_phys_ops *ops) | 736 | struct dpu_encoder_phys_ops *ops) |
| 734 | { | 737 | { |
| 735 | ops->prepare_commit = dpu_encoder_phys_cmd_prepare_commit; | ||
| 736 | ops->is_master = dpu_encoder_phys_cmd_is_master; | 738 | ops->is_master = dpu_encoder_phys_cmd_is_master; |
| 737 | ops->atomic_mode_set = dpu_encoder_phys_cmd_atomic_mode_set; | 739 | ops->atomic_mode_set = dpu_encoder_phys_cmd_atomic_mode_set; |
| 738 | ops->enable = dpu_encoder_phys_cmd_enable; | 740 | ops->enable = dpu_encoder_phys_cmd_enable; |
| @@ -523,6 +523,7 @@ static void dpu_encoder_phys_vid_disable(struct dpu_encoder_phys *phys_enc) · 522 unmodified lines | |||
| 523 | { | 523 | { |
| 524 | unsigned long lock_flags; | 524 | unsigned long lock_flags; |
| 525 | int ret; | 525 | int ret; |
| 526 | struct intf_status intf_status = {0}; | ||
| 526 | 527 | ||
| 527 | if (!phys_enc->parent || !phys_enc->parent->dev) { | 528 | if (!phys_enc->parent || !phys_enc->parent->dev) { |
| 528 | DPU_ERROR("invalid encoder/device\n"); | 529 | DPU_ERROR("invalid encoder/device\n"); |
| @@ -567,6 +568,27 @@ static void dpu_encoder_phys_vid_disable(struct dpu_encoder_phys *phys_enc) · 38 unmodified lines | |||
| 567 | } | 568 | } |
| 568 | } | 569 | } |
| 569 | 570 | ||
| 571 | if (phys_enc->hw_intf && phys_enc->hw_intf->ops.get_status) | ||
| 572 | phys_enc->hw_intf->ops.get_status(phys_enc->hw_intf, &intf_status); | ||
| 573 | |||
| 574 | /* | ||
| 575 | * Wait for a vsync if timing en status is on after timing engine | ||
| 576 | * is disabled. | ||
| 577 | */ | ||
| 578 | if (intf_status.is_en && dpu_encoder_phys_vid_is_master(phys_enc)) { | ||
| 579 | spin_lock_irqsave(phys_enc->enc_spinlock, lock_flags); | ||
| 580 | dpu_encoder_phys_inc_pending(phys_enc); | ||
| 581 | spin_unlock_irqrestore(phys_enc->enc_spinlock, lock_flags); | ||
| 582 | ret = dpu_encoder_phys_vid_wait_for_vblank(phys_enc); | ||
| 583 | if (ret) { | ||
| 584 | atomic_set(&phys_enc->pending_kickoff_cnt, 0); | ||
| 585 | DRM_ERROR("wait disable failed: id:%u intf:%d ret:%d\n", | ||
| 586 | DRMID(phys_enc->parent), | ||
| 587 | phys_enc->hw_intf->idx - INTF_0, ret); | ||
| 588 | } | ||
| 589 | } | ||
| 590 | |||
| 591 | dpu_encoder_helper_phys_cleanup(phys_enc); | ||
| 570 | phys_enc->enable_state = DPU_ENC_DISABLED; | 592 | phys_enc->enable_state = DPU_ENC_DISABLED; |
| 571 | } | 593 | } |
| 572 | 594 | ||
| @@ -536,6 +536,16 @@ static const struct dpu_format dpu_format_map_ubwc[] = { · 535 unmodified lines | |||
| 536 | true, 4, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_COMPRESSED, | 536 | true, 4, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_COMPRESSED, |
| 537 | DPU_FETCH_UBWC, 2, DPU_TILE_HEIGHT_UBWC), | 537 | DPU_FETCH_UBWC, 2, DPU_TILE_HEIGHT_UBWC), |
| 538 | 538 | ||
| 539 | /* XRGB2101010 and ARGB2101010 purposely have the same color | ||
| 540 | * ordering. The hardware only supports ARGB2101010 UBWC | ||
| 541 | * natively. | ||
| 542 | */ | ||
| 543 | INTERLEAVED_RGB_FMT_TILED(ARGB2101010, | ||
| 544 | COLOR_8BIT, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT, | ||
| 545 | C2_R_Cr, C0_G_Y, C1_B_Cb, C3_ALPHA, 4, | ||
| 546 | true, 4, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_COMPRESSED, | ||
| 547 | DPU_FETCH_UBWC, 2, DPU_TILE_HEIGHT_UBWC), | ||
| 548 | |||
| 539 | PSEUDO_YUV_FMT_TILED(NV12, | 549 | PSEUDO_YUV_FMT_TILED(NV12, |
| 540 | 0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT, | 550 | 0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT, |
| 541 | C1_B_Cb, C2_R_Cr, | 551 | C1_B_Cb, C2_R_Cr, |
| @@ -591,6 +601,7 @@ static int _dpu_format_get_media_color_ubwc(const struct dpu_format *fmt) · 49 unmodified lines | |||
| 591 | {DRM_FORMAT_XBGR8888, COLOR_FMT_RGBA8888_UBWC}, | 601 | {DRM_FORMAT_XBGR8888, COLOR_FMT_RGBA8888_UBWC}, |
| 592 | {DRM_FORMAT_XRGB8888, COLOR_FMT_RGBA8888_UBWC}, | 602 | {DRM_FORMAT_XRGB8888, COLOR_FMT_RGBA8888_UBWC}, |
| 593 | {DRM_FORMAT_ABGR2101010, COLOR_FMT_RGBA1010102_UBWC}, | 603 | {DRM_FORMAT_ABGR2101010, COLOR_FMT_RGBA1010102_UBWC}, |
| 604 | {DRM_FORMAT_ARGB2101010, COLOR_FMT_RGBA1010102_UBWC}, | ||
| 594 | {DRM_FORMAT_XRGB2101010, COLOR_FMT_RGBA1010102_UBWC}, | 605 | {DRM_FORMAT_XRGB2101010, COLOR_FMT_RGBA1010102_UBWC}, |
| 595 | {DRM_FORMAT_XBGR2101010, COLOR_FMT_RGBA1010102_UBWC}, | 606 | {DRM_FORMAT_XBGR2101010, COLOR_FMT_RGBA1010102_UBWC}, |
| 596 | {DRM_FORMAT_BGR565, COLOR_FMT_RGB565_UBWC}, | 607 | {DRM_FORMAT_BGR565, COLOR_FMT_RGB565_UBWC}, |
| @@ -918,8 +929,7 @@ int dpu_format_populate_layout( · 321 unmodified lines | |||
| 918 | struct drm_framebuffer *fb, | 929 | struct drm_framebuffer *fb, |
| 919 | struct dpu_hw_fmt_layout *layout) | 930 | struct dpu_hw_fmt_layout *layout) |
| 920 | { | 931 | { |
| 921 | uint32_t plane_addr[DPU_MAX_PLANES]; | 932 | int ret; |
| 922 | int i, ret; | ||
| 923 | 933 | ||
| 924 | if (!fb || !layout) { | 934 | if (!fb || !layout) { |
| 925 | DRM_ERROR("invalid arguments\n"); | 935 | DRM_ERROR("invalid arguments\n"); |
| @@ -940,9 +950,6 @@ int dpu_format_populate_layout( · 14 unmodified lines | |||
| 940 | if (ret) | 950 | if (ret) |
| 941 | return ret; | 951 | return ret; |
| 942 | 952 | ||
| 943 | for (i = 0; i < DPU_MAX_PLANES; ++i) | ||
| 944 | plane_addr[i] = layout->plane_addr[i]; | ||
| 945 | |||
| 946 | /* Populate the addresses given the fb */ | 953 | /* Populate the addresses given the fb */ |
| 947 | if (DPU_FORMAT_IS_UBWC(layout->format) || | 954 | if (DPU_FORMAT_IS_UBWC(layout->format) || |
| 948 | DPU_FORMAT_IS_TILE(layout->format)) | 955 | DPU_FORMAT_IS_TILE(layout->format)) |
| @@ -950,10 +957,6 @@ int dpu_format_populate_layout( · 1 unmodified line | |||
| 950 | else | 957 | else |
| 951 | ret = _dpu_format_populate_addrs_linear(aspace, fb, layout); | 958 | ret = _dpu_format_populate_addrs_linear(aspace, fb, layout); |
| 952 | 959 | ||
| 953 | /* check if anything changed */ | ||
| 954 | if (!ret && !memcmp(plane_addr, layout->plane_addr, sizeof(plane_addr))) | ||
| 955 | ret = -EAGAIN; | ||
| 956 | |||
| 957 | return ret; | 960 | return ret; |
| 958 | } | 961 | } |
| 959 | 962 | ||
| @@ -27,9 +27,15 @@ · 26 unmodified lines | |||
| 27 | #define VIG_SDM845_MASK \ | 27 | #define VIG_SDM845_MASK \ |
| 28 | (VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED3)) | 28 | (VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED3)) |
| 29 | 29 | ||
| 30 | #define VIG_SDM845_MASK_SDMA \ | ||
| 31 | (VIG_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) | ||
| 32 | |||
| 30 | #define VIG_SC7180_MASK \ | 33 | #define VIG_SC7180_MASK \ |
| 31 | (VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED4)) | 34 | (VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED4)) |
| 32 | 35 | ||
| 36 | #define VIG_SC7180_MASK_SDMA \ | ||
| 37 | (VIG_SC7180_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) | ||
| 38 | |||
| 33 | #define VIG_QCM2290_MASK (VIG_BASE_MASK | BIT(DPU_SSPP_QOS_8LVL)) | 39 | #define VIG_QCM2290_MASK (VIG_BASE_MASK | BIT(DPU_SSPP_QOS_8LVL)) |
| 34 | 40 | ||
| 35 | #define DMA_MSM8998_MASK \ | 41 | #define DMA_MSM8998_MASK \ |
| @@ -40,6 +46,9 @@ · 4 unmodified lines | |||
| 40 | #define VIG_SC7280_MASK \ | 46 | #define VIG_SC7280_MASK \ |
| 41 | (VIG_SC7180_MASK | BIT(DPU_SSPP_INLINE_ROTATION)) | 47 | (VIG_SC7180_MASK | BIT(DPU_SSPP_INLINE_ROTATION)) |
| 42 | 48 | ||
| 49 | #define VIG_SC7280_MASK_SDMA \ | ||
| 50 | (VIG_SC7280_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) | ||
| 51 | |||
| 43 | #define DMA_SDM845_MASK \ | 52 | #define DMA_SDM845_MASK \ |
| 44 | (BIT(DPU_SSPP_SRC) | BIT(DPU_SSPP_QOS) | BIT(DPU_SSPP_QOS_8LVL) |\ | 53 | (BIT(DPU_SSPP_SRC) | BIT(DPU_SSPP_QOS) | BIT(DPU_SSPP_QOS_8LVL) |\ |
| 45 | BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\ | 54 | BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\ |
| @@ -48,6 +57,12 @@ · 2 unmodified lines | |||
| 48 | #define DMA_CURSOR_SDM845_MASK \ | 57 | #define DMA_CURSOR_SDM845_MASK \ |
| 49 | (DMA_SDM845_MASK | BIT(DPU_SSPP_CURSOR)) | 58 | (DMA_SDM845_MASK | BIT(DPU_SSPP_CURSOR)) |
| 50 | 59 | ||
| 60 | #define DMA_SDM845_MASK_SDMA \ | ||
| 61 | (DMA_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) | ||
| 62 | |||
| 63 | #define DMA_CURSOR_SDM845_MASK_SDMA \ | ||
| 64 | (DMA_CURSOR_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) | ||
| 65 | |||
| 51 | #define DMA_CURSOR_MSM8998_MASK \ | 66 | #define DMA_CURSOR_MSM8998_MASK \ |
| 52 | (DMA_MSM8998_MASK | BIT(DPU_SSPP_CURSOR)) | 67 | (DMA_MSM8998_MASK | BIT(DPU_SSPP_CURSOR)) |
| 53 | 68 | ||
| @@ -66,7 +81,10 @@ · 12 unmodified lines | |||
| 66 | (PINGPONG_SDM845_MASK | BIT(DPU_PINGPONG_TE2)) | 81 | (PINGPONG_SDM845_MASK | BIT(DPU_PINGPONG_TE2)) |
| 67 | 82 | ||
| 68 | #define CTL_SC7280_MASK \ | 83 | #define CTL_SC7280_MASK \ |
| 69 | (BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_FETCH_ACTIVE) | BIT(DPU_CTL_VM_CFG)) | 84 | (BIT(DPU_CTL_ACTIVE_CFG) | \ |
| 85 | BIT(DPU_CTL_FETCH_ACTIVE) | \ | ||
| 86 | BIT(DPU_CTL_VM_CFG) | \ | ||
| 87 | BIT(DPU_CTL_DSPP_SUB_BLOCK_FLUSH)) | ||
| 70 | 88 | ||
| 71 | #define CTL_SM8550_MASK \ | 89 | #define CTL_SM8550_MASK \ |
| 72 | (CTL_SC7280_MASK | BIT(DPU_CTL_HAS_LAYER_EXT4)) | 90 | (CTL_SC7280_MASK | BIT(DPU_CTL_HAS_LAYER_EXT4)) |
| @@ -79,83 +97,11 @@ · 6 unmodified lines | |||
| 79 | 97 | ||
| 80 | #define INTF_SDM845_MASK (0) | 98 | #define INTF_SDM845_MASK (0) |
| 81 | 99 | ||
| 82 | #define INTF_SC7180_MASK BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) | 100 | #define INTF_SC7180_MASK \ |
| 101 | (BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) | BIT(DPU_INTF_STATUS_SUPPORTED)) | ||
| 83 | 102 | ||
| 84 | #define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN) | 103 | #define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN) |
| 85 | 104 | ||
| 86 | #define IRQ_SDM845_MASK (BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 87 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 88 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 89 | BIT(MDP_INTF0_INTR) | \ | ||
| 90 | BIT(MDP_INTF1_INTR) | \ | ||
| 91 | BIT(MDP_INTF2_INTR) | \ | ||
| 92 | BIT(MDP_INTF3_INTR) | \ | ||
| 93 | BIT(MDP_AD4_0_INTR) | \ | ||
| 94 | BIT(MDP_AD4_1_INTR)) | ||
| 95 | |||
| 96 | #define IRQ_SC7180_MASK (BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 97 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 98 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 99 | BIT(MDP_INTF0_INTR) | \ | ||
| 100 | BIT(MDP_INTF1_INTR)) | ||
| 101 | |||
| 102 | #define IRQ_SC7280_MASK (BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 103 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 104 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 105 | BIT(MDP_INTF0_7xxx_INTR) | \ | ||
| 106 | BIT(MDP_INTF1_7xxx_INTR) | \ | ||
| 107 | BIT(MDP_INTF5_7xxx_INTR)) | ||
| 108 | |||
| 109 | #define IRQ_SM8250_MASK (BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 110 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 111 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 112 | BIT(MDP_INTF0_INTR) | \ | ||
| 113 | BIT(MDP_INTF1_INTR) | \ | ||
| 114 | BIT(MDP_INTF2_INTR) | \ | ||
| 115 | BIT(MDP_INTF3_INTR) | \ | ||
| 116 | BIT(MDP_INTF4_INTR)) | ||
| 117 | |||
| 118 | #define IRQ_SM8350_MASK (BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 119 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 120 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 121 | BIT(MDP_INTF0_7xxx_INTR) | \ | ||
| 122 | BIT(MDP_INTF1_7xxx_INTR) | \ | ||
| 123 | BIT(MDP_INTF2_7xxx_INTR) | \ | ||
| 124 | BIT(MDP_INTF3_7xxx_INTR)) | ||
| 125 | |||
| 126 | #define IRQ_SC8180X_MASK (BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 127 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 128 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 129 | BIT(MDP_INTF0_INTR) | \ | ||
| 130 | BIT(MDP_INTF1_INTR) | \ | ||
| 131 | BIT(MDP_INTF2_INTR) | \ | ||
| 132 | BIT(MDP_INTF3_INTR) | \ | ||
| 133 | BIT(MDP_INTF4_INTR) | \ | ||
| 134 | BIT(MDP_INTF5_INTR) | \ | ||
| 135 | BIT(MDP_AD4_0_INTR) | \ | ||
| 136 | BIT(MDP_AD4_1_INTR)) | ||
| 137 | |||
| 138 | #define IRQ_SC8280XP_MASK (BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 139 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 140 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 141 | BIT(MDP_INTF0_7xxx_INTR) | \ | ||
| 142 | BIT(MDP_INTF1_7xxx_INTR) | \ | ||
| 143 | BIT(MDP_INTF2_7xxx_INTR) | \ | ||
| 144 | BIT(MDP_INTF3_7xxx_INTR) | \ | ||
| 145 | BIT(MDP_INTF4_7xxx_INTR) | \ | ||
| 146 | BIT(MDP_INTF5_7xxx_INTR) | \ | ||
| 147 | BIT(MDP_INTF6_7xxx_INTR) | \ | ||
| 148 | BIT(MDP_INTF7_7xxx_INTR) | \ | ||
| 149 | BIT(MDP_INTF8_7xxx_INTR)) | ||
| 150 | |||
| 151 | #define IRQ_SM8450_MASK (BIT(MDP_SSPP_TOP0_INTR) | \ | ||
| 152 | BIT(MDP_SSPP_TOP0_INTR2) | \ | ||
| 153 | BIT(MDP_SSPP_TOP0_HIST_INTR) | \ | ||
| 154 | BIT(MDP_INTF0_7xxx_INTR) | \ | ||
| 155 | BIT(MDP_INTF1_7xxx_INTR) | \ | ||
| 156 | BIT(MDP_INTF2_7xxx_INTR) | \ | ||
| 157 | BIT(MDP_INTF3_7xxx_INTR)) | ||
| 158 | |||
| 159 | #define WB_SM8250_MASK (BIT(DPU_WB_LINE_MODE) | \ | 105 | #define WB_SM8250_MASK (BIT(DPU_WB_LINE_MODE) | \ |
| 160 | BIT(DPU_WB_UBWC) | \ | 106 | BIT(DPU_WB_UBWC) | \ |
| 161 | BIT(DPU_WB_YUV_CONFIG) | \ | 107 | BIT(DPU_WB_YUV_CONFIG) | \ |
| @@ -188,6 +134,7 @@ static const uint32_t plane_formats[] = { · 26 unmodified lines | |||
| 188 | DRM_FORMAT_RGBX8888, | 134 | DRM_FORMAT_RGBX8888, |
| 189 | DRM_FORMAT_BGRX8888, | 135 | DRM_FORMAT_BGRX8888, |
| 190 | DRM_FORMAT_XBGR8888, | 136 | DRM_FORMAT_XBGR8888, |
| 137 | DRM_FORMAT_ARGB2101010, | ||
| 191 | DRM_FORMAT_XRGB2101010, | 138 | DRM_FORMAT_XRGB2101010, |
| 192 | DRM_FORMAT_RGB888, | 139 | DRM_FORMAT_RGB888, |
| 193 | DRM_FORMAT_BGR888, | 140 | DRM_FORMAT_BGR888, |
| @@ -217,6 +164,7 @@ static const uint32_t plane_formats_yuv[] = { · 23 unmodified lines | |||
| 217 | DRM_FORMAT_RGBA8888, | 164 | DRM_FORMAT_RGBA8888, |
| 218 | DRM_FORMAT_BGRX8888, | 165 | DRM_FORMAT_BGRX8888, |
| 219 | DRM_FORMAT_BGRA8888, | 166 | DRM_FORMAT_BGRA8888, |
| 167 | DRM_FORMAT_ARGB2101010, | ||
| 220 | DRM_FORMAT_XRGB2101010, | 168 | DRM_FORMAT_XRGB2101010, |
| 221 | DRM_FORMAT_XRGB8888, | 169 | DRM_FORMAT_XRGB8888, |
| 222 | DRM_FORMAT_XBGR8888, | 170 | DRM_FORMAT_XBGR8888, |
| @@ -294,789 +242,6 @@ static const uint32_t wb2_formats[] = { · 71 unmodified lines | |||
| 294 | DRM_FORMAT_XBGR4444, | 242 | DRM_FORMAT_XBGR4444, |
| 295 | }; | 243 | }; |
| 296 | 244 | ||
| 297 | /************************************************************* | ||
| 298 | * DPU sub blocks config | ||
| 299 | *************************************************************/ | ||
| 300 | /* DPU top level caps */ | ||
| 301 | static const struct dpu_caps msm8998_dpu_caps = { | ||
| 302 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 303 | .max_mixer_blendstages = 0x7, | ||
| 304 | .qseed_type = DPU_SSPP_SCALER_QSEED3, | ||
| 305 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V1, | ||
| 306 | .ubwc_version = DPU_HW_UBWC_VER_10, | ||
| 307 | .has_src_split = true, | ||
| 308 | .has_dim_layer = true, | ||
| 309 | .has_idle_pc = true, | ||
| 310 | .has_3d_merge = true, | ||
| 311 | .max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 312 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 313 | .max_hdeci_exp = MAX_HORZ_DECIMATION, | ||
| 314 | .max_vdeci_exp = MAX_VERT_DECIMATION, | ||
| 315 | }; | ||
| 316 | |||
| 317 | static const struct dpu_caps qcm2290_dpu_caps = { | ||
| 318 | .max_mixer_width = DEFAULT_DPU_LINE_WIDTH, | ||
| 319 | .max_mixer_blendstages = 0x4, | ||
| 320 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, | ||
| 321 | .has_dim_layer = true, | ||
| 322 | .has_idle_pc = true, | ||
| 323 | .max_linewidth = 2160, | ||
| 324 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 325 | }; | ||
| 326 | |||
| 327 | static const struct dpu_caps sdm845_dpu_caps = { | ||
| 328 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 329 | .max_mixer_blendstages = 0xb, | ||
| 330 | .qseed_type = DPU_SSPP_SCALER_QSEED3, | ||
| 331 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, | ||
| 332 | .ubwc_version = DPU_HW_UBWC_VER_20, | ||
| 333 | .has_src_split = true, | ||
| 334 | .has_dim_layer = true, | ||
| 335 | .has_idle_pc = true, | ||
| 336 | .has_3d_merge = true, | ||
| 337 | .max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 338 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 339 | .max_hdeci_exp = MAX_HORZ_DECIMATION, | ||
| 340 | .max_vdeci_exp = MAX_VERT_DECIMATION, | ||
| 341 | }; | ||
| 342 | |||
| 343 | static const struct dpu_caps sc7180_dpu_caps = { | ||
| 344 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 345 | .max_mixer_blendstages = 0x9, | ||
| 346 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 347 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, | ||
| 348 | .ubwc_version = DPU_HW_UBWC_VER_20, | ||
| 349 | .has_dim_layer = true, | ||
| 350 | .has_idle_pc = true, | ||
| 351 | .max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 352 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 353 | }; | ||
| 354 | |||
| 355 | static const struct dpu_caps sm6115_dpu_caps = { | ||
| 356 | .max_mixer_width = DEFAULT_DPU_LINE_WIDTH, | ||
| 357 | .max_mixer_blendstages = 0x4, | ||
| 358 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 359 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ | ||
| 360 | .ubwc_version = DPU_HW_UBWC_VER_10, | ||
| 361 | .has_dim_layer = true, | ||
| 362 | .has_idle_pc = true, | ||
| 363 | .max_linewidth = 2160, | ||
| 364 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 365 | }; | ||
| 366 | |||
| 367 | static const struct dpu_caps sm8150_dpu_caps = { | ||
| 368 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 369 | .max_mixer_blendstages = 0xb, | ||
| 370 | .qseed_type = DPU_SSPP_SCALER_QSEED3, | ||
| 371 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ | ||
| 372 | .ubwc_version = DPU_HW_UBWC_VER_30, | ||
| 373 | .has_src_split = true, | ||
| 374 | .has_dim_layer = true, | ||
| 375 | .has_idle_pc = true, | ||
| 376 | .has_3d_merge = true, | ||
| 377 | .max_linewidth = 4096, | ||
| 378 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 379 | .max_hdeci_exp = MAX_HORZ_DECIMATION, | ||
| 380 | .max_vdeci_exp = MAX_VERT_DECIMATION, | ||
| 381 | }; | ||
| 382 | |||
| 383 | static const struct dpu_caps sc8180x_dpu_caps = { | ||
| 384 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 385 | .max_mixer_blendstages = 0xb, | ||
| 386 | .qseed_type = DPU_SSPP_SCALER_QSEED3, | ||
| 387 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ | ||
| 388 | .ubwc_version = DPU_HW_UBWC_VER_30, | ||
| 389 | .has_src_split = true, | ||
| 390 | .has_dim_layer = true, | ||
| 391 | .has_idle_pc = true, | ||
| 392 | .has_3d_merge = true, | ||
| 393 | .max_linewidth = 4096, | ||
| 394 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 395 | .max_hdeci_exp = MAX_HORZ_DECIMATION, | ||
| 396 | .max_vdeci_exp = MAX_VERT_DECIMATION, | ||
| 397 | }; | ||
| 398 | |||
| 399 | static const struct dpu_caps sc8280xp_dpu_caps = { | ||
| 400 | .max_mixer_width = 2560, | ||
| 401 | .max_mixer_blendstages = 11, | ||
| 402 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 403 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ | ||
| 404 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 405 | .has_src_split = true, | ||
| 406 | .has_dim_layer = true, | ||
| 407 | .has_idle_pc = true, | ||
| 408 | .has_3d_merge = true, | ||
| 409 | .max_linewidth = 5120, | ||
| 410 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 411 | }; | ||
| 412 | |||
| 413 | static const struct dpu_caps sm8250_dpu_caps = { | ||
| 414 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 415 | .max_mixer_blendstages = 0xb, | ||
| 416 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 417 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ | ||
| 418 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 419 | .has_src_split = true, | ||
| 420 | .has_dim_layer = true, | ||
| 421 | .has_idle_pc = true, | ||
| 422 | .has_3d_merge = true, | ||
| 423 | .max_linewidth = 4096, | ||
| 424 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 425 | }; | ||
| 426 | |||
| 427 | static const struct dpu_caps sm8350_dpu_caps = { | ||
| 428 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 429 | .max_mixer_blendstages = 0xb, | ||
| 430 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 431 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ | ||
| 432 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 433 | .has_src_split = true, | ||
| 434 | .has_dim_layer = true, | ||
| 435 | .has_idle_pc = true, | ||
| 436 | .has_3d_merge = true, | ||
| 437 | .max_linewidth = 4096, | ||
| 438 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 439 | }; | ||
| 440 | |||
| 441 | static const struct dpu_caps sm8450_dpu_caps = { | ||
| 442 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 443 | .max_mixer_blendstages = 0xb, | ||
| 444 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 445 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ | ||
| 446 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 447 | .has_src_split = true, | ||
| 448 | .has_dim_layer = true, | ||
| 449 | .has_idle_pc = true, | ||
| 450 | .has_3d_merge = true, | ||
| 451 | .max_linewidth = 5120, | ||
| 452 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 453 | }; | ||
| 454 | |||
| 455 | static const struct dpu_caps sm8550_dpu_caps = { | ||
| 456 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 457 | .max_mixer_blendstages = 0xb, | ||
| 458 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 459 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ | ||
| 460 | .ubwc_version = DPU_HW_UBWC_VER_40, | ||
| 461 | .has_src_split = true, | ||
| 462 | .has_dim_layer = true, | ||
| 463 | .has_idle_pc = true, | ||
| 464 | .has_3d_merge = true, | ||
| 465 | .max_linewidth = 5120, | ||
| 466 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 467 | }; | ||
| 468 | |||
| 469 | static const struct dpu_caps sc7280_dpu_caps = { | ||
| 470 | .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, | ||
| 471 | .max_mixer_blendstages = 0x7, | ||
| 472 | .qseed_type = DPU_SSPP_SCALER_QSEED4, | ||
| 473 | .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, | ||
| 474 | .ubwc_version = DPU_HW_UBWC_VER_30, | ||
| 475 | .has_dim_layer = true, | ||
| 476 | .has_idle_pc = true, | ||
| 477 | .max_linewidth = 2400, | ||
| 478 | .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, | ||
| 479 | }; | ||
| 480 | |||
| 481 | static const struct dpu_mdp_cfg msm8998_mdp[] = { | ||
| 482 | { | ||
| 483 | .name = "top_0", .id = MDP_TOP, | ||
| 484 | .base = 0x0, .len = 0x458, | ||
| 485 | .features = 0, | ||
| 486 | .highest_bank_bit = 0x2, | ||
| 487 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 488 | .reg_off = 0x2AC, .bit_off = 0}, | ||
| 489 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { | ||
| 490 | .reg_off = 0x2B4, .bit_off = 0}, | ||
| 491 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { | ||
| 492 | .reg_off = 0x2BC, .bit_off = 0}, | ||
| 493 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { | ||
| 494 | .reg_off = 0x2C4, .bit_off = 0}, | ||
| 495 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 496 | .reg_off = 0x2AC, .bit_off = 8}, | ||
| 497 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { | ||
| 498 | .reg_off = 0x2B4, .bit_off = 8}, | ||
| 499 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { | ||
| 500 | .reg_off = 0x2C4, .bit_off = 8}, | ||
| 501 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { | ||
| 502 | .reg_off = 0x2C4, .bit_off = 12}, | ||
| 503 | .clk_ctrls[DPU_CLK_CTRL_CURSOR0] = { | ||
| 504 | .reg_off = 0x3A8, .bit_off = 15}, | ||
| 505 | .clk_ctrls[DPU_CLK_CTRL_CURSOR1] = { | ||
| 506 | .reg_off = 0x3B0, .bit_off = 15}, | ||
| 507 | }, | ||
| 508 | }; | ||
| 509 | |||
| 510 | static const struct dpu_mdp_cfg sdm845_mdp[] = { | ||
| 511 | { | ||
| 512 | .name = "top_0", .id = MDP_TOP, | ||
| 513 | .base = 0x0, .len = 0x45C, | ||
| 514 | .features = BIT(DPU_MDP_AUDIO_SELECT), | ||
| 515 | .highest_bank_bit = 0x2, | ||
| 516 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 517 | .reg_off = 0x2AC, .bit_off = 0}, | ||
| 518 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { | ||
| 519 | .reg_off = 0x2B4, .bit_off = 0}, | ||
| 520 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { | ||
| 521 | .reg_off = 0x2BC, .bit_off = 0}, | ||
| 522 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { | ||
| 523 | .reg_off = 0x2C4, .bit_off = 0}, | ||
| 524 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 525 | .reg_off = 0x2AC, .bit_off = 8}, | ||
| 526 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { | ||
| 527 | .reg_off = 0x2B4, .bit_off = 8}, | ||
| 528 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { | ||
| 529 | .reg_off = 0x2BC, .bit_off = 8}, | ||
| 530 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { | ||
| 531 | .reg_off = 0x2C4, .bit_off = 8}, | ||
| 532 | }, | ||
| 533 | }; | ||
| 534 | |||
| 535 | static const struct dpu_mdp_cfg sc7180_mdp[] = { | ||
| 536 | { | ||
| 537 | .name = "top_0", .id = MDP_TOP, | ||
| 538 | .base = 0x0, .len = 0x494, | ||
| 539 | .features = 0, | ||
| 540 | .highest_bank_bit = 0x3, | ||
| 541 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 542 | .reg_off = 0x2AC, .bit_off = 0}, | ||
| 543 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 544 | .reg_off = 0x2AC, .bit_off = 8}, | ||
| 545 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { | ||
| 546 | .reg_off = 0x2B4, .bit_off = 8}, | ||
| 547 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { | ||
| 548 | .reg_off = 0x2C4, .bit_off = 8}, | ||
| 549 | .clk_ctrls[DPU_CLK_CTRL_WB2] = { | ||
| 550 | .reg_off = 0x3B8, .bit_off = 24}, | ||
| 551 | }, | ||
| 552 | }; | ||
| 553 | |||
| 554 | static const struct dpu_mdp_cfg sc8180x_mdp[] = { | ||
| 555 | { | ||
| 556 | .name = "top_0", .id = MDP_TOP, | ||
| 557 | .base = 0x0, .len = 0x45C, | ||
| 558 | .features = BIT(DPU_MDP_AUDIO_SELECT), | ||
| 559 | .highest_bank_bit = 0x3, | ||
| 560 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 561 | .reg_off = 0x2AC, .bit_off = 0}, | ||
| 562 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { | ||
| 563 | .reg_off = 0x2B4, .bit_off = 0}, | ||
| 564 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { | ||
| 565 | .reg_off = 0x2BC, .bit_off = 0}, | ||
| 566 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { | ||
| 567 | .reg_off = 0x2C4, .bit_off = 0}, | ||
| 568 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 569 | .reg_off = 0x2AC, .bit_off = 8}, | ||
| 570 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { | ||
| 571 | .reg_off = 0x2B4, .bit_off = 8}, | ||
| 572 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { | ||
| 573 | .reg_off = 0x2BC, .bit_off = 8}, | ||
| 574 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { | ||
| 575 | .reg_off = 0x2C4, .bit_off = 8}, | ||
| 576 | }, | ||
| 577 | }; | ||
| 578 | |||
| 579 | static const struct dpu_mdp_cfg sm6115_mdp[] = { | ||
| 580 | { | ||
| 581 | .name = "top_0", .id = MDP_TOP, | ||
| 582 | .base = 0x0, .len = 0x494, | ||
| 583 | .features = 0, | ||
| 584 | .highest_bank_bit = 0x1, | ||
| 585 | .ubwc_swizzle = 0x7, | ||
| 586 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 587 | .reg_off = 0x2ac, .bit_off = 0}, | ||
| 588 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 589 | .reg_off = 0x2ac, .bit_off = 8}, | ||
| 590 | }, | ||
| 591 | }; | ||
| 592 | |||
| 593 | static const struct dpu_mdp_cfg sm8250_mdp[] = { | ||
| 594 | { | ||
| 595 | .name = "top_0", .id = MDP_TOP, | ||
| 596 | .base = 0x0, .len = 0x494, | ||
| 597 | .features = 0, | ||
| 598 | .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ | ||
| 599 | .ubwc_swizzle = 0x6, | ||
| 600 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 601 | .reg_off = 0x2AC, .bit_off = 0}, | ||
| 602 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { | ||
| 603 | .reg_off = 0x2B4, .bit_off = 0}, | ||
| 604 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { | ||
| 605 | .reg_off = 0x2BC, .bit_off = 0}, | ||
| 606 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { | ||
| 607 | .reg_off = 0x2C4, .bit_off = 0}, | ||
| 608 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 609 | .reg_off = 0x2AC, .bit_off = 8}, | ||
| 610 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { | ||
| 611 | .reg_off = 0x2B4, .bit_off = 8}, | ||
| 612 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { | ||
| 613 | .reg_off = 0x2BC, .bit_off = 8}, | ||
| 614 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { | ||
| 615 | .reg_off = 0x2C4, .bit_off = 8}, | ||
| 616 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { | ||
| 617 | .reg_off = 0x2BC, .bit_off = 20}, | ||
| 618 | .clk_ctrls[DPU_CLK_CTRL_WB2] = { | ||
| 619 | .reg_off = 0x3B8, .bit_off = 24}, | ||
| 620 | }, | ||
| 621 | }; | ||
| 622 | |||
| 623 | static const struct dpu_mdp_cfg sm8350_mdp[] = { | ||
| 624 | { | ||
| 625 | .name = "top_0", .id = MDP_TOP, | ||
| 626 | .base = 0x0, .len = 0x494, | ||
| 627 | .features = 0, | ||
| 628 | .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ | ||
| 629 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 630 | .reg_off = 0x2ac, .bit_off = 0}, | ||
| 631 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { | ||
| 632 | .reg_off = 0x2b4, .bit_off = 0}, | ||
| 633 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { | ||
| 634 | .reg_off = 0x2bc, .bit_off = 0}, | ||
| 635 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { | ||
| 636 | .reg_off = 0x2c4, .bit_off = 0}, | ||
| 637 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 638 | .reg_off = 0x2ac, .bit_off = 8}, | ||
| 639 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { | ||
| 640 | .reg_off = 0x2b4, .bit_off = 8}, | ||
| 641 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { | ||
| 642 | .reg_off = 0x2bc, .bit_off = 8}, | ||
| 643 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { | ||
| 644 | .reg_off = 0x2c4, .bit_off = 8}, | ||
| 645 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { | ||
| 646 | .reg_off = 0x2bc, .bit_off = 20}, | ||
| 647 | }, | ||
| 648 | }; | ||
| 649 | |||
| 650 | static const struct dpu_mdp_cfg sm8450_mdp[] = { | ||
| 651 | { | ||
| 652 | .name = "top_0", .id = MDP_TOP, | ||
| 653 | .base = 0x0, .len = 0x494, | ||
| 654 | .features = BIT(DPU_MDP_PERIPH_0_REMOVED), | ||
| 655 | .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ | ||
| 656 | .ubwc_swizzle = 0x6, | ||
| 657 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 658 | .reg_off = 0x2AC, .bit_off = 0}, | ||
| 659 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { | ||
| 660 | .reg_off = 0x2B4, .bit_off = 0}, | ||
| 661 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { | ||
| 662 | .reg_off = 0x2BC, .bit_off = 0}, | ||
| 663 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { | ||
| 664 | .reg_off = 0x2C4, .bit_off = 0}, | ||
| 665 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 666 | .reg_off = 0x2AC, .bit_off = 8}, | ||
| 667 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { | ||
| 668 | .reg_off = 0x2B4, .bit_off = 8}, | ||
| 669 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { | ||
| 670 | .reg_off = 0x2BC, .bit_off = 8}, | ||
| 671 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { | ||
| 672 | .reg_off = 0x2C4, .bit_off = 8}, | ||
| 673 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { | ||
| 674 | .reg_off = 0x2BC, .bit_off = 20}, | ||
| 675 | }, | ||
| 676 | }; | ||
| 677 | |||
| 678 | static const struct dpu_mdp_cfg sc7280_mdp[] = { | ||
| 679 | { | ||
| 680 | .name = "top_0", .id = MDP_TOP, | ||
| 681 | .base = 0x0, .len = 0x2014, | ||
| 682 | .highest_bank_bit = 0x1, | ||
| 683 | .ubwc_swizzle = 0x6, | ||
| 684 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 685 | .reg_off = 0x2AC, .bit_off = 0}, | ||
| 686 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 687 | .reg_off = 0x2AC, .bit_off = 8}, | ||
| 688 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { | ||
| 689 | .reg_off = 0x2B4, .bit_off = 8}, | ||
| 690 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { | ||
| 691 | .reg_off = 0x2C4, .bit_off = 8}, | ||
| 692 | }, | ||
| 693 | }; | ||
| 694 | |||
| 695 | static const struct dpu_mdp_cfg sc8280xp_mdp[] = { | ||
| 696 | { | ||
| 697 | .name = "top_0", .id = MDP_TOP, | ||
| 698 | .base = 0x0, .len = 0x494, | ||
| 699 | .features = BIT(DPU_MDP_PERIPH_0_REMOVED), | ||
| 700 | .highest_bank_bit = 2, | ||
| 701 | .ubwc_swizzle = 6, | ||
| 702 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0}, | ||
| 703 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0}, | ||
| 704 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0}, | ||
| 705 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0}, | ||
| 706 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8}, | ||
| 707 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8}, | ||
| 708 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8}, | ||
| 709 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8}, | ||
| 710 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20}, | ||
| 711 | }, | ||
| 712 | }; | ||
| 713 | |||
| 714 | static const struct dpu_mdp_cfg sm8550_mdp[] = { | ||
| 715 | { | ||
| 716 | .name = "top_0", .id = MDP_TOP, | ||
| 717 | .base = 0, .len = 0x494, | ||
| 718 | .features = BIT(DPU_MDP_PERIPH_0_REMOVED), | ||
| 719 | .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ | ||
| 720 | .ubwc_swizzle = 0x6, | ||
| 721 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 722 | .reg_off = 0x4330, .bit_off = 0}, | ||
| 723 | .clk_ctrls[DPU_CLK_CTRL_VIG1] = { | ||
| 724 | .reg_off = 0x6330, .bit_off = 0}, | ||
| 725 | .clk_ctrls[DPU_CLK_CTRL_VIG2] = { | ||
| 726 | .reg_off = 0x8330, .bit_off = 0}, | ||
| 727 | .clk_ctrls[DPU_CLK_CTRL_VIG3] = { | ||
| 728 | .reg_off = 0xa330, .bit_off = 0}, | ||
| 729 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 730 | .reg_off = 0x24330, .bit_off = 0}, | ||
| 731 | .clk_ctrls[DPU_CLK_CTRL_DMA1] = { | ||
| 732 | .reg_off = 0x26330, .bit_off = 0}, | ||
| 733 | .clk_ctrls[DPU_CLK_CTRL_DMA2] = { | ||
| 734 | .reg_off = 0x28330, .bit_off = 0}, | ||
| 735 | .clk_ctrls[DPU_CLK_CTRL_DMA3] = { | ||
| 736 | .reg_off = 0x2a330, .bit_off = 0}, | ||
| 737 | .clk_ctrls[DPU_CLK_CTRL_DMA4] = { | ||
| 738 | .reg_off = 0x2c330, .bit_off = 0}, | ||
| 739 | .clk_ctrls[DPU_CLK_CTRL_DMA5] = { | ||
| 740 | .reg_off = 0x2e330, .bit_off = 0}, | ||
| 741 | .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { | ||
| 742 | .reg_off = 0x2bc, .bit_off = 20}, | ||
| 743 | }, | ||
| 744 | }; | ||
| 745 | |||
| 746 | static const struct dpu_mdp_cfg qcm2290_mdp[] = { | ||
| 747 | { | ||
| 748 | .name = "top_0", .id = MDP_TOP, | ||
| 749 | .base = 0x0, .len = 0x494, | ||
| 750 | .features = 0, | ||
| 751 | .highest_bank_bit = 0x2, | ||
| 752 | .clk_ctrls[DPU_CLK_CTRL_VIG0] = { | ||
| 753 | .reg_off = 0x2AC, .bit_off = 0}, | ||
| 754 | .clk_ctrls[DPU_CLK_CTRL_DMA0] = { | ||
| 755 | .reg_off = 0x2AC, .bit_off = 8}, | ||
| 756 | }, | ||
| 757 | }; | ||
| 758 | |||
| 759 | /************************************************************* | ||
| 760 | * CTL sub blocks config | ||
| 761 | *************************************************************/ | ||
| 762 | static const struct dpu_ctl_cfg msm8998_ctl[] = { | ||
| 763 | { | ||
| 764 | .name = "ctl_0", .id = CTL_0, | ||
| 765 | .base = 0x1000, .len = 0x94, | ||
| 766 | .features = BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 767 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 768 | }, | ||
| 769 | { | ||
| 770 | .name = "ctl_1", .id = CTL_1, | ||
| 771 | .base = 0x1200, .len = 0x94, | ||
| 772 | .features = 0, | ||
| 773 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 774 | }, | ||
| 775 | { | ||
| 776 | .name = "ctl_2", .id = CTL_2, | ||
| 777 | .base = 0x1400, .len = 0x94, | ||
| 778 | .features = BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 779 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 780 | }, | ||
| 781 | { | ||
| 782 | .name = "ctl_3", .id = CTL_3, | ||
| 783 | .base = 0x1600, .len = 0x94, | ||
| 784 | .features = 0, | ||
| 785 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 786 | }, | ||
| 787 | { | ||
| 788 | .name = "ctl_4", .id = CTL_4, | ||
| 789 | .base = 0x1800, .len = 0x94, | ||
| 790 | .features = 0, | ||
| 791 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 792 | }, | ||
| 793 | }; | ||
| 794 | |||
| 795 | static const struct dpu_ctl_cfg sdm845_ctl[] = { | ||
| 796 | { | ||
| 797 | .name = "ctl_0", .id = CTL_0, | ||
| 798 | .base = 0x1000, .len = 0xE4, | ||
| 799 | .features = BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 800 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 801 | }, | ||
| 802 | { | ||
| 803 | .name = "ctl_1", .id = CTL_1, | ||
| 804 | .base = 0x1200, .len = 0xE4, | ||
| 805 | .features = BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 806 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 807 | }, | ||
| 808 | { | ||
| 809 | .name = "ctl_2", .id = CTL_2, | ||
| 810 | .base = 0x1400, .len = 0xE4, | ||
| 811 | .features = 0, | ||
| 812 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 813 | }, | ||
| 814 | { | ||
| 815 | .name = "ctl_3", .id = CTL_3, | ||
| 816 | .base = 0x1600, .len = 0xE4, | ||
| 817 | .features = 0, | ||
| 818 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 819 | }, | ||
| 820 | { | ||
| 821 | .name = "ctl_4", .id = CTL_4, | ||
| 822 | .base = 0x1800, .len = 0xE4, | ||
| 823 | .features = 0, | ||
| 824 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 825 | }, | ||
| 826 | }; | ||
| 827 | |||
| 828 | static const struct dpu_ctl_cfg sc7180_ctl[] = { | ||
| 829 | { | ||
| 830 | .name = "ctl_0", .id = CTL_0, | ||
| 831 | .base = 0x1000, .len = 0x1dc, | ||
| 832 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 833 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 834 | }, | ||
| 835 | { | ||
| 836 | .name = "ctl_1", .id = CTL_1, | ||
| 837 | .base = 0x1200, .len = 0x1dc, | ||
| 838 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 839 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 840 | }, | ||
| 841 | { | ||
| 842 | .name = "ctl_2", .id = CTL_2, | ||
| 843 | .base = 0x1400, .len = 0x1dc, | ||
| 844 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 845 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 846 | }, | ||
| 847 | }; | ||
| 848 | |||
| 849 | static const struct dpu_ctl_cfg sc8280xp_ctl[] = { | ||
| 850 | { | ||
| 851 | .name = "ctl_0", .id = CTL_0, | ||
| 852 | .base = 0x15000, .len = 0x204, | ||
| 853 | .features = CTL_SC7280_MASK, | ||
| 854 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 855 | }, | ||
| 856 | { | ||
| 857 | .name = "ctl_1", .id = CTL_1, | ||
| 858 | .base = 0x16000, .len = 0x204, | ||
| 859 | .features = CTL_SC7280_MASK, | ||
| 860 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 861 | }, | ||
| 862 | { | ||
| 863 | .name = "ctl_2", .id = CTL_2, | ||
| 864 | .base = 0x17000, .len = 0x204, | ||
| 865 | .features = CTL_SC7280_MASK, | ||
| 866 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 867 | }, | ||
| 868 | { | ||
| 869 | .name = "ctl_3", .id = CTL_3, | ||
| 870 | .base = 0x18000, .len = 0x204, | ||
| 871 | .features = CTL_SC7280_MASK, | ||
| 872 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 873 | }, | ||
| 874 | { | ||
| 875 | .name = "ctl_4", .id = CTL_4, | ||
| 876 | .base = 0x19000, .len = 0x204, | ||
| 877 | .features = CTL_SC7280_MASK, | ||
| 878 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 879 | }, | ||
| 880 | { | ||
| 881 | .name = "ctl_5", .id = CTL_5, | ||
| 882 | .base = 0x1a000, .len = 0x204, | ||
| 883 | .features = CTL_SC7280_MASK, | ||
| 884 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 885 | }, | ||
| 886 | }; | ||
| 887 | |||
| 888 | static const struct dpu_ctl_cfg sm8150_ctl[] = { | ||
| 889 | { | ||
| 890 | .name = "ctl_0", .id = CTL_0, | ||
| 891 | .base = 0x1000, .len = 0x1e0, | ||
| 892 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 893 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 894 | }, | ||
| 895 | { | ||
| 896 | .name = "ctl_1", .id = CTL_1, | ||
| 897 | .base = 0x1200, .len = 0x1e0, | ||
| 898 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 899 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 900 | }, | ||
| 901 | { | ||
| 902 | .name = "ctl_2", .id = CTL_2, | ||
| 903 | .base = 0x1400, .len = 0x1e0, | ||
| 904 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 905 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 906 | }, | ||
| 907 | { | ||
| 908 | .name = "ctl_3", .id = CTL_3, | ||
| 909 | .base = 0x1600, .len = 0x1e0, | ||
| 910 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 911 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 912 | }, | ||
| 913 | { | ||
| 914 | .name = "ctl_4", .id = CTL_4, | ||
| 915 | .base = 0x1800, .len = 0x1e0, | ||
| 916 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 917 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 918 | }, | ||
| 919 | { | ||
| 920 | .name = "ctl_5", .id = CTL_5, | ||
| 921 | .base = 0x1a00, .len = 0x1e0, | ||
| 922 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 923 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 924 | }, | ||
| 925 | }; | ||
| 926 | |||
| 927 | static const struct dpu_ctl_cfg sm8350_ctl[] = { | ||
| 928 | { | ||
| 929 | .name = "ctl_0", .id = CTL_0, | ||
| 930 | .base = 0x15000, .len = 0x1e8, | ||
| 931 | .features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK, | ||
| 932 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 933 | }, | ||
| 934 | { | ||
| 935 | .name = "ctl_1", .id = CTL_1, | ||
| 936 | .base = 0x16000, .len = 0x1e8, | ||
| 937 | .features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK, | ||
| 938 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 939 | }, | ||
| 940 | { | ||
| 941 | .name = "ctl_2", .id = CTL_2, | ||
| 942 | .base = 0x17000, .len = 0x1e8, | ||
| 943 | .features = CTL_SC7280_MASK, | ||
| 944 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 945 | }, | ||
| 946 | { | ||
| 947 | .name = "ctl_3", .id = CTL_3, | ||
| 948 | .base = 0x18000, .len = 0x1e8, | ||
| 949 | .features = CTL_SC7280_MASK, | ||
| 950 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 951 | }, | ||
| 952 | { | ||
| 953 | .name = "ctl_4", .id = CTL_4, | ||
| 954 | .base = 0x19000, .len = 0x1e8, | ||
| 955 | .features = CTL_SC7280_MASK, | ||
| 956 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 957 | }, | ||
| 958 | { | ||
| 959 | .name = "ctl_5", .id = CTL_5, | ||
| 960 | .base = 0x1a000, .len = 0x1e8, | ||
| 961 | .features = CTL_SC7280_MASK, | ||
| 962 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 963 | }, | ||
| 964 | }; | ||
| 965 | |||
| 966 | static const struct dpu_ctl_cfg sm8450_ctl[] = { | ||
| 967 | { | ||
| 968 | .name = "ctl_0", .id = CTL_0, | ||
| 969 | .base = 0x15000, .len = 0x204, | ||
| 970 | .features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY) | BIT(DPU_CTL_FETCH_ACTIVE), | ||
| 971 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 972 | }, | ||
| 973 | { | ||
| 974 | .name = "ctl_1", .id = CTL_1, | ||
| 975 | .base = 0x16000, .len = 0x204, | ||
| 976 | .features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK, | ||
| 977 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 978 | }, | ||
| 979 | { | ||
| 980 | .name = "ctl_2", .id = CTL_2, | ||
| 981 | .base = 0x17000, .len = 0x204, | ||
| 982 | .features = CTL_SC7280_MASK, | ||
| 983 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 984 | }, | ||
| 985 | { | ||
| 986 | .name = "ctl_3", .id = CTL_3, | ||
| 987 | .base = 0x18000, .len = 0x204, | ||
| 988 | .features = CTL_SC7280_MASK, | ||
| 989 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 990 | }, | ||
| 991 | { | ||
| 992 | .name = "ctl_4", .id = CTL_4, | ||
| 993 | .base = 0x19000, .len = 0x204, | ||
| 994 | .features = CTL_SC7280_MASK, | ||
| 995 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 996 | }, | ||
| 997 | { | ||
| 998 | .name = "ctl_5", .id = CTL_5, | ||
| 999 | .base = 0x1a000, .len = 0x204, | ||
| 1000 | .features = CTL_SC7280_MASK, | ||
| 1001 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 1002 | }, | ||
| 1003 | }; | ||
| 1004 | |||
| 1005 | static const struct dpu_ctl_cfg sm8550_ctl[] = { | ||
| 1006 | { | ||
| 1007 | .name = "ctl_0", .id = CTL_0, | ||
| 1008 | .base = 0x15000, .len = 0x290, | ||
| 1009 | .features = CTL_SM8550_MASK | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 1010 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 1011 | }, | ||
| 1012 | { | ||
| 1013 | .name = "ctl_1", .id = CTL_1, | ||
| 1014 | .base = 0x16000, .len = 0x290, | ||
| 1015 | .features = CTL_SM8550_MASK | BIT(DPU_CTL_SPLIT_DISPLAY), | ||
| 1016 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 1017 | }, | ||
| 1018 | { | ||
| 1019 | .name = "ctl_2", .id = CTL_2, | ||
| 1020 | .base = 0x17000, .len = 0x290, | ||
| 1021 | .features = CTL_SM8550_MASK, | ||
| 1022 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 1023 | }, | ||
| 1024 | { | ||
| 1025 | .name = "ctl_3", .id = CTL_3, | ||
| 1026 | .base = 0x18000, .len = 0x290, | ||
| 1027 | .features = CTL_SM8550_MASK, | ||
| 1028 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 1029 | }, | ||
| 1030 | { | ||
| 1031 | .name = "ctl_4", .id = CTL_4, | ||
| 1032 | .base = 0x19000, .len = 0x290, | ||
| 1033 | .features = CTL_SM8550_MASK, | ||
| 1034 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13), | ||
| 1035 | }, | ||
| 1036 | { | ||
| 1037 | .name = "ctl_5", .id = CTL_5, | ||
| 1038 | .base = 0x1a000, .len = 0x290, | ||
| 1039 | .features = CTL_SM8550_MASK, | ||
| 1040 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23), | ||
| 1041 | }, | ||
| 1042 | }; | ||
| 1043 | |||
| 1044 | static const struct dpu_ctl_cfg sc7280_ctl[] = { | ||
| 1045 | { | ||
| 1046 | .name = "ctl_0", .id = CTL_0, | ||
| 1047 | .base = 0x15000, .len = 0x1E8, | ||
| 1048 | .features = CTL_SC7280_MASK, | ||
| 1049 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 1050 | }, | ||
| 1051 | { | ||
| 1052 | .name = "ctl_1", .id = CTL_1, | ||
| 1053 | .base = 0x16000, .len = 0x1E8, | ||
| 1054 | .features = CTL_SC7280_MASK, | ||
| 1055 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10), | ||
| 1056 | }, | ||
| 1057 | { | ||
| 1058 | .name = "ctl_2", .id = CTL_2, | ||
| 1059 | .base = 0x17000, .len = 0x1E8, | ||
| 1060 | .features = CTL_SC7280_MASK, | ||
| 1061 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11), | ||
| 1062 | }, | ||
| 1063 | { | ||
| 1064 | .name = "ctl_3", .id = CTL_3, | ||
| 1065 | .base = 0x18000, .len = 0x1E8, | ||
| 1066 | .features = CTL_SC7280_MASK, | ||
| 1067 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12), | ||
| 1068 | }, | ||
| 1069 | }; | ||
| 1070 | |||
| 1071 | static const struct dpu_ctl_cfg qcm2290_ctl[] = { | ||
| 1072 | { | ||
| 1073 | .name = "ctl_0", .id = CTL_0, | ||
| 1074 | .base = 0x1000, .len = 0x1dc, | ||
| 1075 | .features = BIT(DPU_CTL_ACTIVE_CFG), | ||
| 1076 | .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), | ||
| 1077 | }, | ||
| 1078 | }; | ||
| 1079 | |||
| 1080 | /************************************************************* | 245 | /************************************************************* |
| 1081 | * SSPP sub blocks config | 246 | * SSPP sub blocks config |
| 1082 | *************************************************************/ | 247 | *************************************************************/ |
| @@ -1164,11 +329,11 @@ static const struct dpu_sspp_sub_blks sdm845_dma_sblk_1 = _DMA_SBLK("9", 2); · 81 unmodified lines | |||
| 1164 | static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 = _DMA_SBLK("10", 3); | 329 | static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 = _DMA_SBLK("10", 3); |
| 1165 | static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = _DMA_SBLK("11", 4); | 330 | static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = _DMA_SBLK("11", 4); |
| 1166 | 331 | ||
| 1167 | #define SSPP_BLK(_name, _id, _base, _features, \ | 332 | #define SSPP_BLK(_name, _id, _base, _len, _features, \ |
| 1168 | _sblk, _xinid, _type, _clkctrl) \ | 333 | _sblk, _xinid, _type, _clkctrl) \ |
| 1169 | { \ | 334 | { \ |
| 1170 | .name = _name, .id = _id, \ | 335 | .name = _name, .id = _id, \ |
| 1171 | .base = _base, .len = 0x1c8, \ | 336 | .base = _base, .len = _len, \ |
| 1172 | .features = _features, \ | 337 | .features = _features, \ |
| 1173 | .sblk = &_sblk, \ | 338 | .sblk = &_sblk, \ |
| 1174 | .xin_id = _xinid, \ | 339 | .xin_id = _xinid, \ |
| @@ -1176,71 +341,15 @@ static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = _DMA_SBLK("11", 4); · 1 unmodified line | |||
| 1176 | .clk_ctrl = _clkctrl \ | 341 | .clk_ctrl = _clkctrl \ |
| 1177 | } | 342 | } |
| 1178 | 343 | ||
| 1179 | static const struct dpu_sspp_cfg msm8998_sspp[] = { | ||
| 1180 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_MSM8998_MASK, | ||
| 1181 | msm8998_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1182 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_MSM8998_MASK, | ||
| 1183 | msm8998_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 1184 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_MSM8998_MASK, | ||
| 1185 | msm8998_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 1186 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_MSM8998_MASK, | ||
| 1187 | msm8998_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 1188 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_MSM8998_MASK, | ||
| 1189 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1190 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_MSM8998_MASK, | ||
| 1191 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 1192 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_CURSOR_MSM8998_MASK, | ||
| 1193 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 1194 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, DMA_CURSOR_MSM8998_MASK, | ||
| 1195 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 1196 | }; | ||
| 1197 | |||
| 1198 | static const struct dpu_sspp_cfg sdm845_sspp[] = { | ||
| 1199 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SDM845_MASK, | ||
| 1200 | sdm845_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1201 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_SDM845_MASK, | ||
| 1202 | sdm845_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 1203 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_SDM845_MASK, | ||
| 1204 | sdm845_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 1205 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_SDM845_MASK, | ||
| 1206 | sdm845_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 1207 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, | ||
| 1208 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1209 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_SDM845_MASK, | ||
| 1210 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 1211 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_CURSOR_SDM845_MASK, | ||
| 1212 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 1213 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, DMA_CURSOR_SDM845_MASK, | ||
| 1214 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 1215 | }; | ||
| 1216 | |||
| 1217 | static const struct dpu_sspp_sub_blks sc7180_vig_sblk_0 = | 344 | static const struct dpu_sspp_sub_blks sc7180_vig_sblk_0 = |
| 1218 | _VIG_SBLK("0", 4, DPU_SSPP_SCALER_QSEED4); | 345 | _VIG_SBLK("0", 4, DPU_SSPP_SCALER_QSEED4); |
| 1219 | 346 | ||
| 1220 | static const struct dpu_sspp_sub_blks sc7280_vig_sblk_0 = | 347 | static const struct dpu_sspp_sub_blks sc7280_vig_sblk_0 = |
| 1221 | _VIG_SBLK_ROT("0", 4, DPU_SSPP_SCALER_QSEED4, &dpu_rot_sc7280_cfg_v2); | 348 | _VIG_SBLK_ROT("0", 4, DPU_SSPP_SCALER_QSEED4, &dpu_rot_sc7280_cfg_v2); |
| 1222 | 349 | ||
| 1223 | static const struct dpu_sspp_cfg sc7180_sspp[] = { | ||
| 1224 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SC7180_MASK, | ||
| 1225 | sc7180_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1226 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, | ||
| 1227 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1228 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_CURSOR_SDM845_MASK, | ||
| 1229 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 1230 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_CURSOR_SDM845_MASK, | ||
| 1231 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 1232 | }; | ||
| 1233 | |||
| 1234 | static const struct dpu_sspp_sub_blks sm6115_vig_sblk_0 = | 350 | static const struct dpu_sspp_sub_blks sm6115_vig_sblk_0 = |
| 1235 | _VIG_SBLK("0", 2, DPU_SSPP_SCALER_QSEED4); | 351 | _VIG_SBLK("0", 2, DPU_SSPP_SCALER_QSEED4); |
| 1236 | 352 | ||
| 1237 | static const struct dpu_sspp_cfg sm6115_sspp[] = { | ||
| 1238 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SC7180_MASK, | ||
| 1239 | sm6115_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1240 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, | ||
| 1241 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1242 | }; | ||
| 1243 | |||
| 1244 | static const struct dpu_sspp_sub_blks sm8250_vig_sblk_0 = | 353 | static const struct dpu_sspp_sub_blks sm8250_vig_sblk_0 = |
| 1245 | _VIG_SBLK("0", 5, DPU_SSPP_SCALER_QSEED4); | 354 | _VIG_SBLK("0", 5, DPU_SSPP_SCALER_QSEED4); |
| 1246 | static const struct dpu_sspp_sub_blks sm8250_vig_sblk_1 = | 355 | static const struct dpu_sspp_sub_blks sm8250_vig_sblk_1 = |
| @@ -1250,53 +359,6 @@ static const struct dpu_sspp_sub_blks sm8250_vig_sblk_2 = · 3 unmodified lines | |||
| 1250 | static const struct dpu_sspp_sub_blks sm8250_vig_sblk_3 = | 359 | static const struct dpu_sspp_sub_blks sm8250_vig_sblk_3 = |
| 1251 | _VIG_SBLK("3", 8, DPU_SSPP_SCALER_QSEED4); | 360 | _VIG_SBLK("3", 8, DPU_SSPP_SCALER_QSEED4); |
| 1252 | 361 | ||
| 1253 | static const struct dpu_sspp_cfg sm8250_sspp[] = { | ||
| 1254 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SC7180_MASK, | ||
| 1255 | sm8250_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1256 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_SC7180_MASK, | ||
| 1257 | sm8250_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 1258 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_SC7180_MASK, | ||
| 1259 | sm8250_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 1260 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_SC7180_MASK, | ||
| 1261 | sm8250_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 1262 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, | ||
| 1263 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1264 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_SDM845_MASK, | ||
| 1265 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 1266 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_CURSOR_SDM845_MASK, | ||
| 1267 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 1268 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, DMA_CURSOR_SDM845_MASK, | ||
| 1269 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 1270 | }; | ||
| 1271 | |||
| 1272 | static const struct dpu_sspp_sub_blks sm8450_vig_sblk_0 = | ||
| 1273 | _VIG_SBLK("0", 5, DPU_SSPP_SCALER_QSEED4); | ||
| 1274 | static const struct dpu_sspp_sub_blks sm8450_vig_sblk_1 = | ||
| 1275 | _VIG_SBLK("1", 6, DPU_SSPP_SCALER_QSEED4); | ||
| 1276 | static const struct dpu_sspp_sub_blks sm8450_vig_sblk_2 = | ||
| 1277 | _VIG_SBLK("2", 7, DPU_SSPP_SCALER_QSEED4); | ||
| 1278 | static const struct dpu_sspp_sub_blks sm8450_vig_sblk_3 = | ||
| 1279 | _VIG_SBLK("3", 8, DPU_SSPP_SCALER_QSEED4); | ||
| 1280 | |||
| 1281 | static const struct dpu_sspp_cfg sm8450_sspp[] = { | ||
| 1282 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SC7180_MASK, | ||
| 1283 | sm8450_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1284 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_SC7180_MASK, | ||
| 1285 | sm8450_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 1286 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_SC7180_MASK, | ||
| 1287 | sm8450_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 1288 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_SC7180_MASK, | ||
| 1289 | sm8450_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 1290 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, | ||
| 1291 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1292 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_SDM845_MASK, | ||
| 1293 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 1294 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_CURSOR_SDM845_MASK, | ||
| 1295 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 1296 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, DMA_CURSOR_SDM845_MASK, | ||
| 1297 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 1298 | }; | ||
| 1299 | |||
| 1300 | static const struct dpu_sspp_sub_blks sm8550_vig_sblk_0 = | 362 | static const struct dpu_sspp_sub_blks sm8550_vig_sblk_0 = |
| 1301 | _VIG_SBLK("0", 7, DPU_SSPP_SCALER_QSEED4); | 363 | _VIG_SBLK("0", 7, DPU_SSPP_SCALER_QSEED4); |
| 1302 | static const struct dpu_sspp_sub_blks sm8550_vig_sblk_1 = | 364 | static const struct dpu_sspp_sub_blks sm8550_vig_sblk_1 = |
| @@ -1308,68 +370,6 @@ static const struct dpu_sspp_sub_blks sm8550_vig_sblk_3 = · 5 unmodified lines | |||
| 1308 | static const struct dpu_sspp_sub_blks sm8550_dma_sblk_4 = _DMA_SBLK("12", 5); | 370 | static const struct dpu_sspp_sub_blks sm8550_dma_sblk_4 = _DMA_SBLK("12", 5); |
| 1309 | static const struct dpu_sspp_sub_blks sm8550_dma_sblk_5 = _DMA_SBLK("13", 6); | 371 | static const struct dpu_sspp_sub_blks sm8550_dma_sblk_5 = _DMA_SBLK("13", 6); |
| 1310 | 372 | ||
| 1311 | static const struct dpu_sspp_cfg sm8550_sspp[] = { | ||
| 1312 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SC7180_MASK, | ||
| 1313 | sm8550_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1314 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_SC7180_MASK, | ||
| 1315 | sm8550_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 1316 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_SC7180_MASK, | ||
| 1317 | sm8550_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 1318 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_SC7180_MASK, | ||
| 1319 | sm8550_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 1320 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, | ||
| 1321 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1322 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_SDM845_MASK, | ||
| 1323 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 1324 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_SDM845_MASK, | ||
| 1325 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 1326 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, DMA_SDM845_MASK, | ||
| 1327 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 1328 | SSPP_BLK("sspp_12", SSPP_DMA4, 0x2c000, DMA_CURSOR_SDM845_MASK, | ||
| 1329 | sm8550_dma_sblk_4, 14, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA4), | ||
| 1330 | SSPP_BLK("sspp_13", SSPP_DMA5, 0x2e000, DMA_CURSOR_SDM845_MASK, | ||
| 1331 | sm8550_dma_sblk_5, 15, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA5), | ||
| 1332 | }; | ||
| 1333 | |||
| 1334 | static const struct dpu_sspp_cfg sc7280_sspp[] = { | ||
| 1335 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SC7280_MASK, | ||
| 1336 | sc7280_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1337 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, | ||
| 1338 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1339 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_CURSOR_SDM845_MASK, | ||
| 1340 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 1341 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_CURSOR_SDM845_MASK, | ||
| 1342 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 1343 | }; | ||
| 1344 | |||
| 1345 | static const struct dpu_sspp_sub_blks sc8280xp_vig_sblk_0 = | ||
| 1346 | _VIG_SBLK("0", 5, DPU_SSPP_SCALER_QSEED4); | ||
| 1347 | static const struct dpu_sspp_sub_blks sc8280xp_vig_sblk_1 = | ||
| 1348 | _VIG_SBLK("1", 6, DPU_SSPP_SCALER_QSEED4); | ||
| 1349 | static const struct dpu_sspp_sub_blks sc8280xp_vig_sblk_2 = | ||
| 1350 | _VIG_SBLK("2", 7, DPU_SSPP_SCALER_QSEED4); | ||
| 1351 | static const struct dpu_sspp_sub_blks sc8280xp_vig_sblk_3 = | ||
| 1352 | _VIG_SBLK("3", 8, DPU_SSPP_SCALER_QSEED4); | ||
| 1353 | |||
| 1354 | static const struct dpu_sspp_cfg sc8280xp_sspp[] = { | ||
| 1355 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SC7180_MASK, | ||
| 1356 | sc8280xp_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1357 | SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_SC7180_MASK, | ||
| 1358 | sc8280xp_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), | ||
| 1359 | SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_SC7180_MASK, | ||
| 1360 | sc8280xp_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), | ||
| 1361 | SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_SC7180_MASK, | ||
| 1362 | sc8280xp_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), | ||
| 1363 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, | ||
| 1364 | sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1365 | SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_SDM845_MASK, | ||
| 1366 | sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), | ||
| 1367 | SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_CURSOR_SDM845_MASK, | ||
| 1368 | sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2), | ||
| 1369 | SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, DMA_CURSOR_SDM845_MASK, | ||
| 1370 | sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA3), | ||
| 1371 | }; | ||
| 1372 | |||
| 1373 | #define _VIG_SBLK_NOSCALE(num, sdma_pri) \ | 373 | #define _VIG_SBLK_NOSCALE(num, sdma_pri) \ |
| 1374 | { \ | 374 | { \ |
| 1375 | .maxdwnscale = SSPP_UNITY_SCALE, \ | 375 | .maxdwnscale = SSPP_UNITY_SCALE, \ |
| @@ -1386,13 +386,6 @@ static const struct dpu_sspp_cfg sc8280xp_sspp[] = { · 10 unmodified lines | |||
| 1386 | static const struct dpu_sspp_sub_blks qcm2290_vig_sblk_0 = _VIG_SBLK_NOSCALE("0", 2); | 386 | static const struct dpu_sspp_sub_blks qcm2290_vig_sblk_0 = _VIG_SBLK_NOSCALE("0", 2); |
| 1387 | static const struct dpu_sspp_sub_blks qcm2290_dma_sblk_0 = _DMA_SBLK("8", 1); | 387 | static const struct dpu_sspp_sub_blks qcm2290_dma_sblk_0 = _DMA_SBLK("8", 1); |
| 1388 | 388 | ||
| 1389 | static const struct dpu_sspp_cfg qcm2290_sspp[] = { | ||
| 1390 | SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_QCM2290_MASK, | ||
| 1391 | qcm2290_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), | ||
| 1392 | SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, | ||
| 1393 | qcm2290_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), | ||
| 1394 | }; | ||
| 1395 | |||
| 1396 | /************************************************************* | 389 | /************************************************************* |
| 1397 | * MIXER sub blocks config | 390 | * MIXER sub blocks config |
| 1398 | *************************************************************/ | 391 | *************************************************************/ |
| @@ -1419,21 +412,6 @@ static const struct dpu_lm_sub_blks msm8998_lm_sblk = { · 20 unmodified lines | |||
| 1419 | }, | 412 | }, |
| 1420 | }; | 413 | }; |
| 1421 | 414 | ||
| 1422 | static const struct dpu_lm_cfg msm8998_lm[] = { | ||
| 1423 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_MSM8998_MASK, | ||
| 1424 | &msm8998_lm_sblk, PINGPONG_0, LM_2, DSPP_0), | ||
| 1425 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_MSM8998_MASK, | ||
| 1426 | &msm8998_lm_sblk, PINGPONG_1, LM_5, DSPP_1), | ||
| 1427 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_MSM8998_MASK, | ||
| 1428 | &msm8998_lm_sblk, PINGPONG_2, LM_0, 0), | ||
| 1429 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_MSM8998_MASK, | ||
| 1430 | &msm8998_lm_sblk, PINGPONG_MAX, 0, 0), | ||
| 1431 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_MSM8998_MASK, | ||
| 1432 | &msm8998_lm_sblk, PINGPONG_MAX, 0, 0), | ||
| 1433 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_MSM8998_MASK, | ||
| 1434 | &msm8998_lm_sblk, PINGPONG_3, LM_1, 0), | ||
| 1435 | }; | ||
| 1436 | |||
| 1437 | /* SDM845 */ | 415 | /* SDM845 */ |
| 1438 | 416 | ||
| 1439 | static const struct dpu_lm_sub_blks sdm845_lm_sblk = { | 417 | static const struct dpu_lm_sub_blks sdm845_lm_sblk = { |
| @@ -1445,21 +423,6 @@ static const struct dpu_lm_sub_blks sdm845_lm_sblk = { · 5 unmodified lines | |||
| 1445 | }, | 423 | }, |
| 1446 | }; | 424 | }; |
| 1447 | 425 | ||
| 1448 | static const struct dpu_lm_cfg sdm845_lm[] = { | ||
| 1449 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 1450 | &sdm845_lm_sblk, PINGPONG_0, LM_1, 0), | ||
| 1451 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 1452 | &sdm845_lm_sblk, PINGPONG_1, LM_0, 0), | ||
| 1453 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 1454 | &sdm845_lm_sblk, PINGPONG_2, LM_5, 0), | ||
| 1455 | LM_BLK("lm_3", LM_3, 0x0, MIXER_SDM845_MASK, | ||
| 1456 | &sdm845_lm_sblk, PINGPONG_MAX, 0, 0), | ||
| 1457 | LM_BLK("lm_4", LM_4, 0x0, MIXER_SDM845_MASK, | ||
| 1458 | &sdm845_lm_sblk, PINGPONG_MAX, 0, 0), | ||
| 1459 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, | ||
| 1460 | &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 1461 | }; | ||
| 1462 | |||
| 1463 | /* SC7180 */ | 426 | /* SC7180 */ |
| 1464 | 427 | ||
| 1465 | static const struct dpu_lm_sub_blks sc7180_lm_sblk = { | 428 | static const struct dpu_lm_sub_blks sc7180_lm_sblk = { |
| @@ -1470,50 +433,6 @@ static const struct dpu_lm_sub_blks sc7180_lm_sblk = { · 4 unmodified lines | |||
| 1470 | }, | 433 | }, |
| 1471 | }; | 434 | }; |
| 1472 | 435 | ||
| 1473 | static const struct dpu_lm_cfg sc7180_lm[] = { | ||
| 1474 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 1475 | &sc7180_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 1476 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 1477 | &sc7180_lm_sblk, PINGPONG_1, LM_0, 0), | ||
| 1478 | }; | ||
| 1479 | |||
| 1480 | /* SC8280XP */ | ||
| 1481 | |||
| 1482 | static const struct dpu_lm_cfg sc8280xp_lm[] = { | ||
| 1483 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 1484 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1), | ||
| 1485 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_2, LM_3, DSPP_2), | ||
| 1486 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_3, LM_2, DSPP_3), | ||
| 1487 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_4, LM_5, 0), | ||
| 1488 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_5, LM_4, 0), | ||
| 1489 | }; | ||
| 1490 | |||
| 1491 | /* SM8150 */ | ||
| 1492 | |||
| 1493 | static const struct dpu_lm_cfg sm8150_lm[] = { | ||
| 1494 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 1495 | &sdm845_lm_sblk, PINGPONG_0, LM_1, DSPP_0), | ||
| 1496 | LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK, | ||
| 1497 | &sdm845_lm_sblk, PINGPONG_1, LM_0, DSPP_1), | ||
| 1498 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 1499 | &sdm845_lm_sblk, PINGPONG_2, LM_3, 0), | ||
| 1500 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, | ||
| 1501 | &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 1502 | LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK, | ||
| 1503 | &sdm845_lm_sblk, PINGPONG_4, LM_5, 0), | ||
| 1504 | LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, | ||
| 1505 | &sdm845_lm_sblk, PINGPONG_5, LM_4, 0), | ||
| 1506 | }; | ||
| 1507 | |||
| 1508 | static const struct dpu_lm_cfg sc7280_lm[] = { | ||
| 1509 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK, | ||
| 1510 | &sc7180_lm_sblk, PINGPONG_0, 0, DSPP_0), | ||
| 1511 | LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, | ||
| 1512 | &sc7180_lm_sblk, PINGPONG_2, LM_3, 0), | ||
| 1513 | LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK, | ||
| 1514 | &sc7180_lm_sblk, PINGPONG_3, LM_2, 0), | ||
| 1515 | }; | ||
| 1516 | |||
| 1517 | /* QCM2290 */ | 436 | /* QCM2290 */ |
| 1518 | 437 | ||
| 1519 | static const struct dpu_lm_sub_blks qcm2290_lm_sblk = { | 438 | static const struct dpu_lm_sub_blks qcm2290_lm_sblk = { |
| @@ -1524,11 +443,6 @@ static const struct dpu_lm_sub_blks qcm2290_lm_sblk = { · 4 unmodified lines | |||
| 1524 | }, | 443 | }, |
| 1525 | }; | 444 | }; |
| 1526 | 445 | ||
| 1527 | static const struct dpu_lm_cfg qcm2290_lm[] = { | ||
| 1528 | LM_BLK("lm_0", LM_0, 0x44000, MIXER_QCM2290_MASK, | ||
| 1529 | &qcm2290_lm_sblk, PINGPONG_0, 0, DSPP_0), | ||
| 1530 | }; | ||
| 1531 | |||
| 1532 | /************************************************************* | 446 | /************************************************************* |
| 1533 | * DSPP sub blocks config | 447 | * DSPP sub blocks config |
| 1534 | *************************************************************/ | 448 | *************************************************************/ |
| @@ -1557,34 +471,6 @@ static const struct dpu_dspp_sub_blks sm8150_dspp_sblk = { · 22 unmodified lines | |||
| 1557 | .sblk = _sblk \ | 471 | .sblk = _sblk \ |
| 1558 | } | 472 | } |
| 1559 | 473 | ||
| 1560 | static const struct dpu_dspp_cfg msm8998_dspp[] = { | ||
| 1561 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_MSM8998_MASK, | ||
| 1562 | &msm8998_dspp_sblk), | ||
| 1563 | DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_MSM8998_MASK, | ||
| 1564 | &msm8998_dspp_sblk), | ||
| 1565 | }; | ||
| 1566 | |||
| 1567 | static const struct dpu_dspp_cfg sc7180_dspp[] = { | ||
| 1568 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 1569 | &sc7180_dspp_sblk), | ||
| 1570 | }; | ||
| 1571 | |||
| 1572 | static const struct dpu_dspp_cfg sm8150_dspp[] = { | ||
| 1573 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 1574 | &sm8150_dspp_sblk), | ||
| 1575 | DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK, | ||
| 1576 | &sm8150_dspp_sblk), | ||
| 1577 | DSPP_BLK("dspp_2", DSPP_2, 0x58000, DSPP_SC7180_MASK, | ||
| 1578 | &sm8150_dspp_sblk), | ||
| 1579 | DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK, | ||
| 1580 | &sm8150_dspp_sblk), | ||
| 1581 | }; | ||
| 1582 | |||
| 1583 | static const struct dpu_dspp_cfg qcm2290_dspp[] = { | ||
| 1584 | DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, | ||
| 1585 | &sm8150_dspp_sblk), | ||
| 1586 | }; | ||
| 1587 | |||
| 1588 | /************************************************************* | 474 | /************************************************************* |
| 1589 | * PINGPONG sub blocks config | 475 | * PINGPONG sub blocks config |
| 1590 | *************************************************************/ | 476 | *************************************************************/ |
| @@ -1636,151 +522,6 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = { · 45 unmodified lines | |||
| 1636 | .intr_rdptr = _rdptr, \ | 522 | .intr_rdptr = _rdptr, \ |
| 1637 | } | 523 | } |
| 1638 | 524 | ||
| 1639 | static const struct dpu_pingpong_cfg sdm845_pp[] = { | ||
| 1640 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk_te, | ||
| 1641 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 1642 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 1643 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, 0, sdm845_pp_sblk_te, | ||
| 1644 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 1645 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 1646 | PP_BLK("pingpong_2", PINGPONG_2, 0x71000, 0, sdm845_pp_sblk, | ||
| 1647 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 1648 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 1649 | PP_BLK("pingpong_3", PINGPONG_3, 0x71800, 0, sdm845_pp_sblk, | ||
| 1650 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 1651 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 1652 | }; | ||
| 1653 | |||
| 1654 | static struct dpu_pingpong_cfg sc7180_pp[] = { | ||
| 1655 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk_te, -1, -1), | ||
| 1656 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, 0, sdm845_pp_sblk_te, -1, -1), | ||
| 1657 | }; | ||
| 1658 | |||
| 1659 | static struct dpu_pingpong_cfg sc8280xp_pp[] = { | ||
| 1660 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 1661 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), -1), | ||
| 1662 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 1663 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), -1), | ||
| 1664 | PP_BLK_TE("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sdm845_pp_sblk_te, | ||
| 1665 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), -1), | ||
| 1666 | PP_BLK_TE("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sdm845_pp_sblk_te, | ||
| 1667 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), -1), | ||
| 1668 | PP_BLK_TE("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sdm845_pp_sblk_te, | ||
| 1669 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), -1), | ||
| 1670 | PP_BLK_TE("pingpong_5", PINGPONG_5, 0x6e000, MERGE_3D_2, sdm845_pp_sblk_te, | ||
| 1671 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), -1), | ||
| 1672 | }; | ||
| 1673 | |||
| 1674 | static const struct dpu_pingpong_cfg sm8150_pp[] = { | ||
| 1675 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 1676 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 1677 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 1678 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 1679 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 1680 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 1681 | PP_BLK("pingpong_2", PINGPONG_2, 0x71000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 1682 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 1683 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 1684 | PP_BLK("pingpong_3", PINGPONG_3, 0x71800, MERGE_3D_1, sdm845_pp_sblk, | ||
| 1685 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 1686 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 1687 | PP_BLK("pingpong_4", PINGPONG_4, 0x72000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 1688 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 1689 | -1), | ||
| 1690 | PP_BLK("pingpong_5", PINGPONG_5, 0x72800, MERGE_3D_2, sdm845_pp_sblk, | ||
| 1691 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 1692 | -1), | ||
| 1693 | }; | ||
| 1694 | |||
| 1695 | static const struct dpu_pingpong_cfg sm8350_pp[] = { | ||
| 1696 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 1697 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 1698 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 1699 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 1700 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 1701 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 1702 | PP_BLK("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 1703 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 1704 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 1705 | PP_BLK("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 1706 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 1707 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 1708 | PP_BLK("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 1709 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 1710 | -1), | ||
| 1711 | PP_BLK("pingpong_5", PINGPONG_5, 0x6e000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 1712 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 1713 | -1), | ||
| 1714 | }; | ||
| 1715 | |||
| 1716 | static const struct dpu_pingpong_cfg sc7280_pp[] = { | ||
| 1717 | PP_BLK("pingpong_0", PINGPONG_0, 0x69000, 0, sc7280_pp_sblk, -1, -1), | ||
| 1718 | PP_BLK("pingpong_1", PINGPONG_1, 0x6a000, 0, sc7280_pp_sblk, -1, -1), | ||
| 1719 | PP_BLK("pingpong_2", PINGPONG_2, 0x6b000, 0, sc7280_pp_sblk, -1, -1), | ||
| 1720 | PP_BLK("pingpong_3", PINGPONG_3, 0x6c000, 0, sc7280_pp_sblk, -1, -1), | ||
| 1721 | }; | ||
| 1722 | |||
| 1723 | static struct dpu_pingpong_cfg qcm2290_pp[] = { | ||
| 1724 | PP_BLK("pingpong_0", PINGPONG_0, 0x70000, 0, sdm845_pp_sblk, | ||
| 1725 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 1726 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 1727 | }; | ||
| 1728 | |||
| 1729 | /* FIXME: interrupts */ | ||
| 1730 | static const struct dpu_pingpong_cfg sm8450_pp[] = { | ||
| 1731 | PP_BLK_TE("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 1732 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 1733 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 12)), | ||
| 1734 | PP_BLK_TE("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sdm845_pp_sblk_te, | ||
| 1735 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 1736 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 13)), | ||
| 1737 | PP_BLK("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 1738 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 1739 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 14)), | ||
| 1740 | PP_BLK("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sdm845_pp_sblk, | ||
| 1741 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 1742 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 15)), | ||
| 1743 | PP_BLK("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 1744 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 1745 | -1), | ||
| 1746 | PP_BLK("pingpong_5", PINGPONG_5, 0x6e000, MERGE_3D_2, sdm845_pp_sblk, | ||
| 1747 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 1748 | -1), | ||
| 1749 | PP_BLK("pingpong_6", PINGPONG_6, 0x65800, MERGE_3D_3, sdm845_pp_sblk, | ||
| 1750 | -1, | ||
| 1751 | -1), | ||
| 1752 | PP_BLK("pingpong_7", PINGPONG_7, 0x65c00, MERGE_3D_3, sdm845_pp_sblk, | ||
| 1753 | -1, | ||
| 1754 | -1), | ||
| 1755 | }; | ||
| 1756 | |||
| 1757 | static const struct dpu_pingpong_cfg sm8550_pp[] = { | ||
| 1758 | PP_BLK_DIPHER("pingpong_0", PINGPONG_0, 0x69000, MERGE_3D_0, sc7280_pp_sblk, | ||
| 1759 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), | ||
| 1760 | -1), | ||
| 1761 | PP_BLK_DIPHER("pingpong_1", PINGPONG_1, 0x6a000, MERGE_3D_0, sc7280_pp_sblk, | ||
| 1762 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9), | ||
| 1763 | -1), | ||
| 1764 | PP_BLK_DIPHER("pingpong_2", PINGPONG_2, 0x6b000, MERGE_3D_1, sc7280_pp_sblk, | ||
| 1765 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10), | ||
| 1766 | -1), | ||
| 1767 | PP_BLK_DIPHER("pingpong_3", PINGPONG_3, 0x6c000, MERGE_3D_1, sc7280_pp_sblk, | ||
| 1768 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11), | ||
| 1769 | -1), | ||
| 1770 | PP_BLK_DIPHER("pingpong_4", PINGPONG_4, 0x6d000, MERGE_3D_2, sc7280_pp_sblk, | ||
| 1771 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30), | ||
| 1772 | -1), | ||
| 1773 | PP_BLK_DIPHER("pingpong_5", PINGPONG_5, 0x6e000, MERGE_3D_2, sc7280_pp_sblk, | ||
| 1774 | DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31), | ||
| 1775 | -1), | ||
| 1776 | PP_BLK_DIPHER("pingpong_6", PINGPONG_6, 0x66000, MERGE_3D_3, sc7280_pp_sblk, | ||
| 1777 | -1, | ||
| 1778 | -1), | ||
| 1779 | PP_BLK_DIPHER("pingpong_7", PINGPONG_7, 0x66400, MERGE_3D_3, sc7280_pp_sblk, | ||
| 1780 | -1, | ||
| 1781 | -1), | ||
| 1782 | }; | ||
| 1783 | |||
| 1784 | /************************************************************* | 525 | /************************************************************* |
| 1785 | * MERGE_3D sub blocks config | 526 | * MERGE_3D sub blocks config |
| 1786 | *************************************************************/ | 527 | *************************************************************/ |
| @@ -1792,32 +533,6 @@ static const struct dpu_pingpong_cfg sm8550_pp[] = { · 5 unmodified lines | |||
| 1792 | .sblk = NULL \ | 533 | .sblk = NULL \ |
| 1793 | } | 534 | } |
| 1794 | 535 | ||
| 1795 | static const struct dpu_merge_3d_cfg sm8150_merge_3d[] = { | ||
| 1796 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x83000), | ||
| 1797 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x83100), | ||
| 1798 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x83200), | ||
| 1799 | }; | ||
| 1800 | |||
| 1801 | static const struct dpu_merge_3d_cfg sm8350_merge_3d[] = { | ||
| 1802 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x4e000), | ||
| 1803 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x4f000), | ||
| 1804 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x50000), | ||
| 1805 | }; | ||
| 1806 | |||
| 1807 | static const struct dpu_merge_3d_cfg sm8450_merge_3d[] = { | ||
| 1808 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x4e000), | ||
| 1809 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x4f000), | ||
| 1810 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x50000), | ||
| 1811 | MERGE_3D_BLK("merge_3d_3", MERGE_3D_3, 0x65f00), | ||
| 1812 | }; | ||
| 1813 | |||
| 1814 | static const struct dpu_merge_3d_cfg sm8550_merge_3d[] = { | ||
| 1815 | MERGE_3D_BLK("merge_3d_0", MERGE_3D_0, 0x4e000), | ||
| 1816 | MERGE_3D_BLK("merge_3d_1", MERGE_3D_1, 0x4f000), | ||
| 1817 | MERGE_3D_BLK("merge_3d_2", MERGE_3D_2, 0x50000), | ||
| 1818 | MERGE_3D_BLK("merge_3d_3", MERGE_3D_3, 0x66700), | ||
| 1819 | }; | ||
| 1820 | |||
| 1821 | /************************************************************* | 536 | /************************************************************* |
| 1822 | * DSC sub blocks config | 537 | * DSC sub blocks config |
| 1823 | *************************************************************/ | 538 | *************************************************************/ |
| @@ -1828,27 +543,13 @@ static const struct dpu_merge_3d_cfg sm8550_merge_3d[] = { · 4 unmodified lines | |||
| 1828 | .features = _features, \ | 543 | .features = _features, \ |
| 1829 | } | 544 | } |
| 1830 | 545 | ||
| 1831 | static struct dpu_dsc_cfg sdm845_dsc[] = { | ||
| 1832 | DSC_BLK("dsc_0", DSC_0, 0x80000, 0), | ||
| 1833 | DSC_BLK("dsc_1", DSC_1, 0x80400, 0), | ||
| 1834 | DSC_BLK("dsc_2", DSC_2, 0x80800, 0), | ||
| 1835 | DSC_BLK("dsc_3", DSC_3, 0x80c00, 0), | ||
| 1836 | }; | ||
| 1837 | |||
| 1838 | static struct dpu_dsc_cfg sm8150_dsc[] = { | ||
| 1839 | DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 1840 | DSC_BLK("dsc_1", DSC_1, 0x80400, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 1841 | DSC_BLK("dsc_2", DSC_2, 0x80800, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 1842 | DSC_BLK("dsc_3", DSC_3, 0x80c00, BIT(DPU_DSC_OUTPUT_CTRL)), | ||
| 1843 | }; | ||
| 1844 | |||
| 1845 | /************************************************************* | 546 | /************************************************************* |
| 1846 | * INTF sub blocks config | 547 | * INTF sub blocks config |
| 1847 | *************************************************************/ | 548 | *************************************************************/ |
| 1848 | #define INTF_BLK(_name, _id, _base, _type, _ctrl_id, _progfetch, _features, _reg, _underrun_bit, _vsync_bit) \ | 549 | #define INTF_BLK(_name, _id, _base, _len, _type, _ctrl_id, _progfetch, _features, _reg, _underrun_bit, _vsync_bit) \ |
| 1849 | {\ | 550 | {\ |
| 1850 | .name = _name, .id = _id, \ | 551 | .name = _name, .id = _id, \ |
| 1851 | .base = _base, .len = 0x280, \ | 552 | .base = _base, .len = _len, \ |
| 1852 | .features = _features, \ | 553 | .features = _features, \ |
| 1853 | .type = _type, \ | 554 | .type = _type, \ |
| 1854 | .controller_id = _ctrl_id, \ | 555 | .controller_id = _ctrl_id, \ |
| @@ -1857,88 +558,6 @@ static struct dpu_dsc_cfg sm8150_dsc[] = { · 2 unmodified lines | |||
| 1857 | .intr_vsync = DPU_IRQ_IDX(_reg, _vsync_bit), \ | 558 | .intr_vsync = DPU_IRQ_IDX(_reg, _vsync_bit), \ |
| 1858 | } | 559 | } |
| 1859 | 560 | ||
| 1860 | static const struct dpu_intf_cfg msm8998_intf[] = { | ||
| 1861 | INTF_BLK("intf_0", INTF_0, 0x6A000, INTF_DP, 0, 25, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1862 | INTF_BLK("intf_1", INTF_1, 0x6A800, INTF_DSI, 0, 25, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1863 | INTF_BLK("intf_2", INTF_2, 0x6B000, INTF_DSI, 1, 25, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 1864 | INTF_BLK("intf_3", INTF_3, 0x6B800, INTF_HDMI, 0, 25, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 1865 | }; | ||
| 1866 | |||
| 1867 | static const struct dpu_intf_cfg sdm845_intf[] = { | ||
| 1868 | INTF_BLK("intf_0", INTF_0, 0x6A000, INTF_DP, 0, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1869 | INTF_BLK("intf_1", INTF_1, 0x6A800, INTF_DSI, 0, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1870 | INTF_BLK("intf_2", INTF_2, 0x6B000, INTF_DSI, 1, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 1871 | INTF_BLK("intf_3", INTF_3, 0x6B800, INTF_DP, 1, 24, INTF_SDM845_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 1872 | }; | ||
| 1873 | |||
| 1874 | static const struct dpu_intf_cfg sc7180_intf[] = { | ||
| 1875 | INTF_BLK("intf_0", INTF_0, 0x6A000, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1876 | INTF_BLK("intf_1", INTF_1, 0x6A800, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1877 | }; | ||
| 1878 | |||
| 1879 | static const struct dpu_intf_cfg sm8150_intf[] = { | ||
| 1880 | INTF_BLK("intf_0", INTF_0, 0x6A000, INTF_DP, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1881 | INTF_BLK("intf_1", INTF_1, 0x6A800, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1882 | INTF_BLK("intf_2", INTF_2, 0x6B000, INTF_DSI, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 1883 | INTF_BLK("intf_3", INTF_3, 0x6B800, INTF_DP, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 1884 | }; | ||
| 1885 | |||
| 1886 | static const struct dpu_intf_cfg sc7280_intf[] = { | ||
| 1887 | INTF_BLK("intf_0", INTF_0, 0x34000, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1888 | INTF_BLK("intf_1", INTF_1, 0x35000, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1889 | INTF_BLK("intf_5", INTF_5, 0x39000, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 22, 23), | ||
| 1890 | }; | ||
| 1891 | |||
| 1892 | static const struct dpu_intf_cfg sm8350_intf[] = { | ||
| 1893 | INTF_BLK("intf_0", INTF_0, 0x34000, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1894 | INTF_BLK("intf_1", INTF_1, 0x35000, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1895 | INTF_BLK("intf_2", INTF_2, 0x36000, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 1896 | INTF_BLK("intf_3", INTF_3, 0x37000, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 1897 | }; | ||
| 1898 | |||
| 1899 | static const struct dpu_intf_cfg sc8180x_intf[] = { | ||
| 1900 | INTF_BLK("intf_0", INTF_0, 0x6A000, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1901 | INTF_BLK("intf_1", INTF_1, 0x6A800, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1902 | INTF_BLK("intf_2", INTF_2, 0x6B000, INTF_DSI, 1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 1903 | /* INTF_3 is for MST, wired to INTF_DP 0 and 1, use dummy index until this is supported */ | ||
| 1904 | INTF_BLK("intf_3", INTF_3, 0x6B800, INTF_DP, 999, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 1905 | INTF_BLK("intf_4", INTF_4, 0x6C000, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 20, 21), | ||
| 1906 | INTF_BLK("intf_5", INTF_5, 0x6C800, INTF_DP, MSM_DP_CONTROLLER_2, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 22, 23), | ||
| 1907 | }; | ||
| 1908 | |||
| 1909 | /* TODO: INTF 3, 8 and 7 are used for MST, marked as INTF_NONE for now */ | ||
| 1910 | static const struct dpu_intf_cfg sc8280xp_intf[] = { | ||
| 1911 | INTF_BLK("intf_0", INTF_0, 0x34000, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1912 | INTF_BLK("intf_1", INTF_1, 0x35000, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1913 | INTF_BLK("intf_2", INTF_2, 0x36000, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 1914 | INTF_BLK("intf_3", INTF_3, 0x37000, INTF_NONE, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 1915 | INTF_BLK("intf_4", INTF_4, 0x38000, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 20, 21), | ||
| 1916 | INTF_BLK("intf_5", INTF_5, 0x39000, INTF_DP, MSM_DP_CONTROLLER_3, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 22, 23), | ||
| 1917 | INTF_BLK("intf_6", INTF_6, 0x3a000, INTF_DP, MSM_DP_CONTROLLER_2, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 16, 17), | ||
| 1918 | INTF_BLK("intf_7", INTF_7, 0x3b000, INTF_NONE, MSM_DP_CONTROLLER_2, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 18, 19), | ||
| 1919 | INTF_BLK("intf_8", INTF_8, 0x3c000, INTF_NONE, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 12, 13), | ||
| 1920 | }; | ||
| 1921 | |||
| 1922 | static const struct dpu_intf_cfg qcm2290_intf[] = { | ||
| 1923 | INTF_BLK("intf_0", INTF_0, 0x00000, INTF_NONE, 0, 0, 0, 0, 0, 0), | ||
| 1924 | INTF_BLK("intf_1", INTF_1, 0x6A800, INTF_DSI, 0, 24, INTF_SC7180_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1925 | }; | ||
| 1926 | |||
| 1927 | static const struct dpu_intf_cfg sm8450_intf[] = { | ||
| 1928 | INTF_BLK("intf_0", INTF_0, 0x34000, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1929 | INTF_BLK("intf_1", INTF_1, 0x35000, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1930 | INTF_BLK("intf_2", INTF_2, 0x36000, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 1931 | INTF_BLK("intf_3", INTF_3, 0x37000, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 1932 | }; | ||
| 1933 | |||
| 1934 | static const struct dpu_intf_cfg sm8550_intf[] = { | ||
| 1935 | INTF_BLK("intf_0", INTF_0, 0x34000, INTF_DP, MSM_DP_CONTROLLER_0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 24, 25), | ||
| 1936 | /* TODO TE sub-blocks for intf1 & intf2 */ | ||
| 1937 | INTF_BLK("intf_1", INTF_1, 0x35000, INTF_DSI, 0, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 26, 27), | ||
| 1938 | INTF_BLK("intf_2", INTF_2, 0x36000, INTF_DSI, 1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 28, 29), | ||
| 1939 | INTF_BLK("intf_3", INTF_3, 0x37000, INTF_DP, MSM_DP_CONTROLLER_1, 24, INTF_SC7280_MASK, MDP_SSPP_TOP0_INTR, 30, 31), | ||
| 1940 | }; | ||
| 1941 | |||
| 1942 | /************************************************************* | 561 | /************************************************************* |
| 1943 | * Writeback blocks config | 562 | * Writeback blocks config |
| 1944 | *************************************************************/ | 563 | *************************************************************/ |
| @@ -1957,11 +576,6 @@ static const struct dpu_intf_cfg sm8550_intf[] = { · 12 unmodified lines | |||
| 1957 | .intr_wb_done = DPU_IRQ_IDX(_reg, _wb_done_bit) \ | 576 | .intr_wb_done = DPU_IRQ_IDX(_reg, _wb_done_bit) \ |
| 1958 | } | 577 | } |
| 1959 | 578 | ||
| 1960 | static const struct dpu_wb_cfg sm8250_wb[] = { | ||
| 1961 | WB_BLK("wb_2", WB_2, 0x65000, WB_SM8250_MASK, DPU_CLK_CTRL_WB2, 6, | ||
| 1962 | VBIF_RT, MDP_SSPP_TOP0_INTR, 4096, 4), | ||
| 1963 | }; | ||
| 1964 | |||
| 1965 | /************************************************************* | 579 | /************************************************************* |
| 1966 | * VBIF sub blocks config | 580 | * VBIF sub blocks config |
| 1967 | *************************************************************/ | 581 | *************************************************************/ |
| @@ -2166,715 +780,26 @@ static const struct dpu_qos_lut_entry sc7180_qos_nrt[] = { · 198 unmodified lines | |||
| 2166 | {.fl = 0, .lut = 0x0}, | 780 | {.fl = 0, .lut = 0x0}, |
| 2167 | }; | 781 | }; |
| 2168 | 782 | ||
| 2169 | static const struct dpu_perf_cfg msm8998_perf_data = { | ||
| 2170 | .max_bw_low = 6700000, | ||
| 2171 | .max_bw_high = 6700000, | ||
| 2172 | .min_core_ib = 2400000, | ||
| 2173 | .min_llcc_ib = 800000, | ||
| 2174 | .min_dram_ib = 800000, | ||
| 2175 | .undersized_prefill_lines = 2, | ||
| 2176 | .xtra_prefill_lines = 2, | ||
| 2177 | .dest_scale_prefill_lines = 3, | ||
| 2178 | .macrotile_prefill_lines = 4, | ||
| 2179 | .yuv_nv12_prefill_lines = 8, | ||
| 2180 | .linear_prefill_lines = 1, | ||
| 2181 | .downscaling_prefill_lines = 1, | ||
| 2182 | .amortizable_threshold = 25, | ||
| 2183 | .min_prefill_lines = 25, | ||
| 2184 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 2185 | .safe_lut_tbl = {0xfffc, 0xff00, 0xffff}, | ||
| 2186 | .qos_lut_tbl = { | ||
| 2187 | {.nentry = ARRAY_SIZE(msm8998_qos_linear), | ||
| 2188 | .entries = msm8998_qos_linear | ||
| 2189 | }, | ||
| 2190 | {.nentry = ARRAY_SIZE(msm8998_qos_macrotile), | ||
| 2191 | .entries = msm8998_qos_macrotile | ||
| 2192 | }, | ||
| 2193 | {.nentry = ARRAY_SIZE(msm8998_qos_nrt), | ||
| 2194 | .entries = msm8998_qos_nrt | ||
| 2195 | }, | ||
| 2196 | }, | ||
| 2197 | .cdp_cfg = { | ||
| 2198 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2199 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2200 | }, | ||
| 2201 | .clk_inefficiency_factor = 200, | ||
| 2202 | .bw_inefficiency_factor = 120, | ||
| 2203 | }; | ||
| 2204 | |||
| 2205 | static const struct dpu_perf_cfg sdm845_perf_data = { | ||
| 2206 | .max_bw_low = 6800000, | ||
| 2207 | .max_bw_high = 6800000, | ||
| 2208 | .min_core_ib = 2400000, | ||
| 2209 | .min_llcc_ib = 800000, | ||
| 2210 | .min_dram_ib = 800000, | ||
| 2211 | .undersized_prefill_lines = 2, | ||
| 2212 | .xtra_prefill_lines = 2, | ||
| 2213 | .dest_scale_prefill_lines = 3, | ||
| 2214 | .macrotile_prefill_lines = 4, | ||
| 2215 | .yuv_nv12_prefill_lines = 8, | ||
| 2216 | .linear_prefill_lines = 1, | ||
| 2217 | .downscaling_prefill_lines = 1, | ||
| 2218 | .amortizable_threshold = 25, | ||
| 2219 | .min_prefill_lines = 24, | ||
| 2220 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 2221 | .safe_lut_tbl = {0xfff0, 0xf000, 0xffff}, | ||
| 2222 | .qos_lut_tbl = { | ||
| 2223 | {.nentry = ARRAY_SIZE(sdm845_qos_linear), | ||
| 2224 | .entries = sdm845_qos_linear | ||
| 2225 | }, | ||
| 2226 | {.nentry = ARRAY_SIZE(sdm845_qos_macrotile), | ||
| 2227 | .entries = sdm845_qos_macrotile | ||
| 2228 | }, | ||
| 2229 | {.nentry = ARRAY_SIZE(sdm845_qos_nrt), | ||
| 2230 | .entries = sdm845_qos_nrt | ||
| 2231 | }, | ||
| 2232 | }, | ||
| 2233 | .cdp_cfg = { | ||
| 2234 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2235 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2236 | }, | ||
| 2237 | .clk_inefficiency_factor = 105, | ||
| 2238 | .bw_inefficiency_factor = 120, | ||
| 2239 | }; | ||
| 2240 | |||
| 2241 | static const struct dpu_perf_cfg sc7180_perf_data = { | ||
| 2242 | .max_bw_low = 6800000, | ||
| 2243 | .max_bw_high = 6800000, | ||
| 2244 | .min_core_ib = 2400000, | ||
| 2245 | .min_llcc_ib = 800000, | ||
| 2246 | .min_dram_ib = 1600000, | ||
| 2247 | .min_prefill_lines = 24, | ||
| 2248 | .danger_lut_tbl = {0xff, 0xffff, 0x0}, | ||
| 2249 | .safe_lut_tbl = {0xfff0, 0xff00, 0xffff}, | ||
| 2250 | .qos_lut_tbl = { | ||
| 2251 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 2252 | .entries = sc7180_qos_linear | ||
| 2253 | }, | ||
| 2254 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 2255 | .entries = sc7180_qos_macrotile | ||
| 2256 | }, | ||
| 2257 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 2258 | .entries = sc7180_qos_nrt | ||
| 2259 | }, | ||
| 2260 | }, | ||
| 2261 | .cdp_cfg = { | ||
| 2262 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2263 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2264 | }, | ||
| 2265 | .clk_inefficiency_factor = 105, | ||
| 2266 | .bw_inefficiency_factor = 120, | ||
| 2267 | }; | ||
| 2268 | |||
| 2269 | static const struct dpu_perf_cfg sm6115_perf_data = { | ||
| 2270 | .max_bw_low = 3100000, | ||
| 2271 | .max_bw_high = 4000000, | ||
| 2272 | .min_core_ib = 2400000, | ||
| 2273 | .min_llcc_ib = 800000, | ||
| 2274 | .min_dram_ib = 800000, | ||
| 2275 | .min_prefill_lines = 24, | ||
| 2276 | .danger_lut_tbl = {0xff, 0xffff, 0x0}, | ||
| 2277 | .safe_lut_tbl = {0xfff0, 0xff00, 0xffff}, | ||
| 2278 | .qos_lut_tbl = { | ||
| 2279 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 2280 | .entries = sc7180_qos_linear | ||
| 2281 | }, | ||
| 2282 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 2283 | .entries = sc7180_qos_macrotile | ||
| 2284 | }, | ||
| 2285 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 2286 | .entries = sc7180_qos_nrt | ||
| 2287 | }, | ||
| 2288 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 2289 | }, | ||
| 2290 | .cdp_cfg = { | ||
| 2291 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2292 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2293 | }, | ||
| 2294 | .clk_inefficiency_factor = 105, | ||
| 2295 | .bw_inefficiency_factor = 120, | ||
| 2296 | }; | ||
| 2297 | |||
| 2298 | static const struct dpu_perf_cfg sm8150_perf_data = { | ||
| 2299 | .max_bw_low = 12800000, | ||
| 2300 | .max_bw_high = 12800000, | ||
| 2301 | .min_core_ib = 2400000, | ||
| 2302 | .min_llcc_ib = 800000, | ||
| 2303 | .min_dram_ib = 800000, | ||
| 2304 | .min_prefill_lines = 24, | ||
| 2305 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 2306 | .safe_lut_tbl = {0xfff8, 0xf000, 0xffff}, | ||
| 2307 | .qos_lut_tbl = { | ||
| 2308 | {.nentry = ARRAY_SIZE(sm8150_qos_linear), | ||
| 2309 | .entries = sm8150_qos_linear | ||
| 2310 | }, | ||
| 2311 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 2312 | .entries = sc7180_qos_macrotile | ||
| 2313 | }, | ||
| 2314 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 2315 | .entries = sc7180_qos_nrt | ||
| 2316 | }, | ||
| 2317 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 2318 | }, | ||
| 2319 | .cdp_cfg = { | ||
| 2320 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2321 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2322 | }, | ||
| 2323 | .clk_inefficiency_factor = 105, | ||
| 2324 | .bw_inefficiency_factor = 120, | ||
| 2325 | }; | ||
| 2326 | |||
| 2327 | static const struct dpu_perf_cfg sc8180x_perf_data = { | ||
| 2328 | .max_bw_low = 9600000, | ||
| 2329 | .max_bw_high = 9600000, | ||
| 2330 | .min_core_ib = 2400000, | ||
| 2331 | .min_llcc_ib = 800000, | ||
| 2332 | .min_dram_ib = 800000, | ||
| 2333 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 2334 | .qos_lut_tbl = { | ||
| 2335 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 2336 | .entries = sc7180_qos_linear | ||
| 2337 | }, | ||
| 2338 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 2339 | .entries = sc7180_qos_macrotile | ||
| 2340 | }, | ||
| 2341 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 2342 | .entries = sc7180_qos_nrt | ||
| 2343 | }, | ||
| 2344 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 2345 | }, | ||
| 2346 | .cdp_cfg = { | ||
| 2347 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2348 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2349 | }, | ||
| 2350 | .clk_inefficiency_factor = 105, | ||
| 2351 | .bw_inefficiency_factor = 120, | ||
| 2352 | }; | ||
| 2353 | |||
| 2354 | static const struct dpu_perf_cfg sc8280xp_perf_data = { | ||
| 2355 | .max_bw_low = 13600000, | ||
| 2356 | .max_bw_high = 18200000, | ||
| 2357 | .min_core_ib = 2500000, | ||
| 2358 | .min_llcc_ib = 0, | ||
| 2359 | .min_dram_ib = 800000, | ||
| 2360 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 2361 | .qos_lut_tbl = { | ||
| 2362 | {.nentry = ARRAY_SIZE(sc8180x_qos_linear), | ||
| 2363 | .entries = sc8180x_qos_linear | ||
| 2364 | }, | ||
| 2365 | {.nentry = ARRAY_SIZE(sc8180x_qos_macrotile), | ||
| 2366 | .entries = sc8180x_qos_macrotile | ||
| 2367 | }, | ||
| 2368 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 2369 | .entries = sc7180_qos_nrt | ||
| 2370 | }, | ||
| 2371 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 2372 | }, | ||
| 2373 | .cdp_cfg = { | ||
| 2374 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2375 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2376 | }, | ||
| 2377 | .clk_inefficiency_factor = 105, | ||
| 2378 | .bw_inefficiency_factor = 120, | ||
| 2379 | }; | ||
| 2380 | |||
| 2381 | static const struct dpu_perf_cfg sm8250_perf_data = { | ||
| 2382 | .max_bw_low = 13700000, | ||
| 2383 | .max_bw_high = 16600000, | ||
| 2384 | .min_core_ib = 4800000, | ||
| 2385 | .min_llcc_ib = 0, | ||
| 2386 | .min_dram_ib = 800000, | ||
| 2387 | .min_prefill_lines = 35, | ||
| 2388 | .danger_lut_tbl = {0xf, 0xffff, 0x0}, | ||
| 2389 | .safe_lut_tbl = {0xfff0, 0xff00, 0xffff}, | ||
| 2390 | .qos_lut_tbl = { | ||
| 2391 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 2392 | .entries = sc7180_qos_linear | ||
| 2393 | }, | ||
| 2394 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 2395 | .entries = sc7180_qos_macrotile | ||
| 2396 | }, | ||
| 2397 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 2398 | .entries = sc7180_qos_nrt | ||
| 2399 | }, | ||
| 2400 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 2401 | }, | ||
| 2402 | .cdp_cfg = { | ||
| 2403 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2404 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2405 | }, | ||
| 2406 | .clk_inefficiency_factor = 105, | ||
| 2407 | .bw_inefficiency_factor = 120, | ||
| 2408 | }; | ||
| 2409 | |||
| 2410 | static const struct dpu_perf_cfg sm8450_perf_data = { | ||
| 2411 | .max_bw_low = 13600000, | ||
| 2412 | .max_bw_high = 18200000, | ||
| 2413 | .min_core_ib = 2500000, | ||
| 2414 | .min_llcc_ib = 0, | ||
| 2415 | .min_dram_ib = 800000, | ||
| 2416 | .min_prefill_lines = 35, | ||
| 2417 | /* FIXME: lut tables */ | ||
| 2418 | .danger_lut_tbl = {0x3ffff, 0x3ffff, 0x0}, | ||
| 2419 | .safe_lut_tbl = {0xfe00, 0xfe00, 0xffff}, | ||
| 2420 | .qos_lut_tbl = { | ||
| 2421 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 2422 | .entries = sc7180_qos_linear | ||
| 2423 | }, | ||
| 2424 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 2425 | .entries = sc7180_qos_macrotile | ||
| 2426 | }, | ||
| 2427 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 2428 | .entries = sc7180_qos_nrt | ||
| 2429 | }, | ||
| 2430 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 2431 | }, | ||
| 2432 | .cdp_cfg = { | ||
| 2433 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2434 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2435 | }, | ||
| 2436 | .clk_inefficiency_factor = 105, | ||
| 2437 | .bw_inefficiency_factor = 120, | ||
| 2438 | }; | ||
| 2439 | |||
| 2440 | static const struct dpu_perf_cfg sc7280_perf_data = { | ||
| 2441 | .max_bw_low = 4700000, | ||
| 2442 | .max_bw_high = 8800000, | ||
| 2443 | .min_core_ib = 2500000, | ||
| 2444 | .min_llcc_ib = 0, | ||
| 2445 | .min_dram_ib = 1600000, | ||
| 2446 | .min_prefill_lines = 24, | ||
| 2447 | .danger_lut_tbl = {0xffff, 0xffff, 0x0}, | ||
| 2448 | .safe_lut_tbl = {0xff00, 0xff00, 0xffff}, | ||
| 2449 | .qos_lut_tbl = { | ||
| 2450 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 2451 | .entries = sc7180_qos_macrotile | ||
| 2452 | }, | ||
| 2453 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 2454 | .entries = sc7180_qos_macrotile | ||
| 2455 | }, | ||
| 2456 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 2457 | .entries = sc7180_qos_nrt | ||
| 2458 | }, | ||
| 2459 | }, | ||
| 2460 | .cdp_cfg = { | ||
| 2461 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2462 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2463 | }, | ||
| 2464 | .clk_inefficiency_factor = 105, | ||
| 2465 | .bw_inefficiency_factor = 120, | ||
| 2466 | }; | ||
| 2467 | |||
| 2468 | static const struct dpu_perf_cfg sm8350_perf_data = { | ||
| 2469 | .max_bw_low = 11800000, | ||
| 2470 | .max_bw_high = 15500000, | ||
| 2471 | .min_core_ib = 2500000, | ||
| 2472 | .min_llcc_ib = 0, | ||
| 2473 | .min_dram_ib = 800000, | ||
| 2474 | .min_prefill_lines = 40, | ||
| 2475 | /* FIXME: lut tables */ | ||
| 2476 | .danger_lut_tbl = {0x3ffff, 0x3ffff, 0x0}, | ||
| 2477 | .safe_lut_tbl = {0xfe00, 0xfe00, 0xffff}, | ||
| 2478 | .qos_lut_tbl = { | ||
| 2479 | {.nentry = ARRAY_SIZE(sc7180_qos_linear), | ||
| 2480 | .entries = sc7180_qos_linear | ||
| 2481 | }, | ||
| 2482 | {.nentry = ARRAY_SIZE(sc7180_qos_macrotile), | ||
| 2483 | .entries = sc7180_qos_macrotile | ||
| 2484 | }, | ||
| 2485 | {.nentry = ARRAY_SIZE(sc7180_qos_nrt), | ||
| 2486 | .entries = sc7180_qos_nrt | ||
| 2487 | }, | ||
| 2488 | /* TODO: macrotile-qseed is different from macrotile */ | ||
| 2489 | }, | ||
| 2490 | .cdp_cfg = { | ||
| 2491 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2492 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2493 | }, | ||
| 2494 | .clk_inefficiency_factor = 105, | ||
| 2495 | .bw_inefficiency_factor = 120, | ||
| 2496 | }; | ||
| 2497 | |||
| 2498 | static const struct dpu_perf_cfg qcm2290_perf_data = { | ||
| 2499 | .max_bw_low = 2700000, | ||
| 2500 | .max_bw_high = 2700000, | ||
| 2501 | .min_core_ib = 1300000, | ||
| 2502 | .min_llcc_ib = 0, | ||
| 2503 | .min_dram_ib = 1600000, | ||
| 2504 | .min_prefill_lines = 24, | ||
| 2505 | .danger_lut_tbl = {0xff, 0x0, 0x0}, | ||
| 2506 | .safe_lut_tbl = {0xfff0, 0x0, 0x0}, | ||
| 2507 | .qos_lut_tbl = { | ||
| 2508 | {.nentry = ARRAY_SIZE(qcm2290_qos_linear), | ||
| 2509 | .entries = qcm2290_qos_linear | ||
| 2510 | }, | ||
| 2511 | }, | ||
| 2512 | .cdp_cfg = { | ||
| 2513 | {.rd_enable = 1, .wr_enable = 1}, | ||
| 2514 | {.rd_enable = 1, .wr_enable = 0} | ||
| 2515 | }, | ||
| 2516 | .clk_inefficiency_factor = 105, | ||
| 2517 | .bw_inefficiency_factor = 120, | ||
| 2518 | }; | ||
| 2519 | /************************************************************* | 783 | /************************************************************* |
| 2520 | * Hardware catalog | 784 | * Hardware catalog |
| 2521 | *************************************************************/ | 785 | *************************************************************/ |
| 2522 | 786 | ||
| 2523 | static const struct dpu_mdss_cfg msm8998_dpu_cfg = { | 787 | #include "catalog/dpu_3_0_msm8998.h" |
| 2524 | .caps = &msm8998_dpu_caps, | ||
| 2525 | .mdp_count = ARRAY_SIZE(msm8998_mdp), | ||
| 2526 | .mdp = msm8998_mdp, | ||
| 2527 | .ctl_count = ARRAY_SIZE(msm8998_ctl), | ||
| 2528 | .ctl = msm8998_ctl, | ||
| 2529 | .sspp_count = ARRAY_SIZE(msm8998_sspp), | ||
| 2530 | .sspp = msm8998_sspp, | ||
| 2531 | .mixer_count = ARRAY_SIZE(msm8998_lm), | ||
| 2532 | .mixer = msm8998_lm, | ||
| 2533 | .dspp_count = ARRAY_SIZE(msm8998_dspp), | ||
| 2534 | .dspp = msm8998_dspp, | ||
| 2535 | .pingpong_count = ARRAY_SIZE(sdm845_pp), | ||
| 2536 | .pingpong = sdm845_pp, | ||
| 2537 | .intf_count = ARRAY_SIZE(msm8998_intf), | ||
| 2538 | .intf = msm8998_intf, | ||
| 2539 | .vbif_count = ARRAY_SIZE(msm8998_vbif), | ||
| 2540 | .vbif = msm8998_vbif, | ||
| 2541 | .reg_dma_count = 0, | ||
| 2542 | .perf = &msm8998_perf_data, | ||
| 2543 | .mdss_irqs = IRQ_SM8250_MASK, | ||
| 2544 | }; | ||
| 2545 | 788 | ||
| 2546 | static const struct dpu_mdss_cfg sdm845_dpu_cfg = { | 789 | #include "catalog/dpu_4_0_sdm845.h" |
| 2547 | .caps = &sdm845_dpu_caps, | ||
| 2548 | .mdp_count = ARRAY_SIZE(sdm845_mdp), | ||
| 2549 | .mdp = sdm845_mdp, | ||
| 2550 | .ctl_count = ARRAY_SIZE(sdm845_ctl), | ||
| 2551 | .ctl = sdm845_ctl, | ||
| 2552 | .sspp_count = ARRAY_SIZE(sdm845_sspp), | ||
| 2553 | .sspp = sdm845_sspp, | ||
| 2554 | .mixer_count = ARRAY_SIZE(sdm845_lm), | ||
| 2555 | .mixer = sdm845_lm, | ||
| 2556 | .pingpong_count = ARRAY_SIZE(sdm845_pp), | ||
| 2557 | .pingpong = sdm845_pp, | ||
| 2558 | .dsc_count = ARRAY_SIZE(sdm845_dsc), | ||
| 2559 | .dsc = sdm845_dsc, | ||
| 2560 | .intf_count = ARRAY_SIZE(sdm845_intf), | ||
| 2561 | .intf = sdm845_intf, | ||
| 2562 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2563 | .vbif = sdm845_vbif, | ||
| 2564 | .reg_dma_count = 1, | ||
| 2565 | .dma_cfg = &sdm845_regdma, | ||
| 2566 | .perf = &sdm845_perf_data, | ||
| 2567 | .mdss_irqs = IRQ_SDM845_MASK, | ||
| 2568 | }; | ||
| 2569 | 790 | ||
| 2570 | static const struct dpu_mdss_cfg sc7180_dpu_cfg = { | 791 | #include "catalog/dpu_5_0_sm8150.h" |
| 2571 | .caps = &sc7180_dpu_caps, | 792 | #include "catalog/dpu_5_1_sc8180x.h" |
| 2572 | .mdp_count = ARRAY_SIZE(sc7180_mdp), | ||
| 2573 | .mdp = sc7180_mdp, | ||
| 2574 | .ctl_count = ARRAY_SIZE(sc7180_ctl), | ||
| 2575 | .ctl = sc7180_ctl, | ||
| 2576 | .sspp_count = ARRAY_SIZE(sc7180_sspp), | ||
| 2577 | .sspp = sc7180_sspp, | ||
| 2578 | .mixer_count = ARRAY_SIZE(sc7180_lm), | ||
| 2579 | .mixer = sc7180_lm, | ||
| 2580 | .dspp_count = ARRAY_SIZE(sc7180_dspp), | ||
| 2581 | .dspp = sc7180_dspp, | ||
| 2582 | .pingpong_count = ARRAY_SIZE(sc7180_pp), | ||
| 2583 | .pingpong = sc7180_pp, | ||
| 2584 | .intf_count = ARRAY_SIZE(sc7180_intf), | ||
| 2585 | .intf = sc7180_intf, | ||
| 2586 | .wb_count = ARRAY_SIZE(sm8250_wb), | ||
| 2587 | .wb = sm8250_wb, | ||
| 2588 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2589 | .vbif = sdm845_vbif, | ||
| 2590 | .reg_dma_count = 1, | ||
| 2591 | .dma_cfg = &sdm845_regdma, | ||
| 2592 | .perf = &sc7180_perf_data, | ||
| 2593 | .mdss_irqs = IRQ_SC7180_MASK, | ||
| 2594 | }; | ||
| 2595 | |||
| 2596 | static const struct dpu_mdss_cfg sm6115_dpu_cfg = { | ||
| 2597 | .caps = &sm6115_dpu_caps, | ||
| 2598 | .mdp_count = ARRAY_SIZE(sm6115_mdp), | ||
| 2599 | .mdp = sm6115_mdp, | ||
| 2600 | .ctl_count = ARRAY_SIZE(qcm2290_ctl), | ||
| 2601 | .ctl = qcm2290_ctl, | ||
| 2602 | .sspp_count = ARRAY_SIZE(sm6115_sspp), | ||
| 2603 | .sspp = sm6115_sspp, | ||
| 2604 | .mixer_count = ARRAY_SIZE(qcm2290_lm), | ||
| 2605 | .mixer = qcm2290_lm, | ||
| 2606 | .dspp_count = ARRAY_SIZE(qcm2290_dspp), | ||
| 2607 | .dspp = qcm2290_dspp, | ||
| 2608 | .pingpong_count = ARRAY_SIZE(qcm2290_pp), | ||
| 2609 | .pingpong = qcm2290_pp, | ||
| 2610 | .intf_count = ARRAY_SIZE(qcm2290_intf), | ||
| 2611 | .intf = qcm2290_intf, | ||
| 2612 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2613 | .vbif = sdm845_vbif, | ||
| 2614 | .perf = &sm6115_perf_data, | ||
| 2615 | .mdss_irqs = IRQ_SC7180_MASK, | ||
| 2616 | }; | ||
| 2617 | |||
| 2618 | static const struct dpu_mdss_cfg sm8150_dpu_cfg = { | ||
| 2619 | .caps = &sm8150_dpu_caps, | ||
| 2620 | .mdp_count = ARRAY_SIZE(sdm845_mdp), | ||
| 2621 | .mdp = sdm845_mdp, | ||
| 2622 | .ctl_count = ARRAY_SIZE(sm8150_ctl), | ||
| 2623 | .ctl = sm8150_ctl, | ||
| 2624 | .sspp_count = ARRAY_SIZE(sdm845_sspp), | ||
| 2625 | .sspp = sdm845_sspp, | ||
| 2626 | .mixer_count = ARRAY_SIZE(sm8150_lm), | ||
| 2627 | .mixer = sm8150_lm, | ||
| 2628 | .dspp_count = ARRAY_SIZE(sm8150_dspp), | ||
| 2629 | .dspp = sm8150_dspp, | ||
| 2630 | .dsc_count = ARRAY_SIZE(sm8150_dsc), | ||
| 2631 | .dsc = sm8150_dsc, | ||
| 2632 | .pingpong_count = ARRAY_SIZE(sm8150_pp), | ||
| 2633 | .pingpong = sm8150_pp, | ||
| 2634 | .merge_3d_count = ARRAY_SIZE(sm8150_merge_3d), | ||
| 2635 | .merge_3d = sm8150_merge_3d, | ||
| 2636 | .intf_count = ARRAY_SIZE(sm8150_intf), | ||
| 2637 | .intf = sm8150_intf, | ||
| 2638 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2639 | .vbif = sdm845_vbif, | ||
| 2640 | .reg_dma_count = 1, | ||
| 2641 | .dma_cfg = &sm8150_regdma, | ||
| 2642 | .perf = &sm8150_perf_data, | ||
| 2643 | .mdss_irqs = IRQ_SDM845_MASK, | ||
| 2644 | }; | ||
| 2645 | |||
| 2646 | static const struct dpu_mdss_cfg sc8180x_dpu_cfg = { | ||
| 2647 | .caps = &sc8180x_dpu_caps, | ||
| 2648 | .mdp_count = ARRAY_SIZE(sc8180x_mdp), | ||
| 2649 | .mdp = sc8180x_mdp, | ||
| 2650 | .ctl_count = ARRAY_SIZE(sm8150_ctl), | ||
| 2651 | .ctl = sm8150_ctl, | ||
| 2652 | .sspp_count = ARRAY_SIZE(sdm845_sspp), | ||
| 2653 | .sspp = sdm845_sspp, | ||
| 2654 | .mixer_count = ARRAY_SIZE(sm8150_lm), | ||
| 2655 | .mixer = sm8150_lm, | ||
| 2656 | .pingpong_count = ARRAY_SIZE(sm8150_pp), | ||
| 2657 | .pingpong = sm8150_pp, | ||
| 2658 | .merge_3d_count = ARRAY_SIZE(sm8150_merge_3d), | ||
| 2659 | .merge_3d = sm8150_merge_3d, | ||
| 2660 | .intf_count = ARRAY_SIZE(sc8180x_intf), | ||
| 2661 | .intf = sc8180x_intf, | ||
| 2662 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2663 | .vbif = sdm845_vbif, | ||
| 2664 | .reg_dma_count = 1, | ||
| 2665 | .dma_cfg = &sm8150_regdma, | ||
| 2666 | .perf = &sc8180x_perf_data, | ||
| 2667 | .mdss_irqs = IRQ_SC8180X_MASK, | ||
| 2668 | }; | ||
| 2669 | |||
| 2670 | static const struct dpu_mdss_cfg sc8280xp_dpu_cfg = { | ||
| 2671 | .caps = &sc8280xp_dpu_caps, | ||
| 2672 | .mdp_count = ARRAY_SIZE(sc8280xp_mdp), | ||
| 2673 | .mdp = sc8280xp_mdp, | ||
| 2674 | .ctl_count = ARRAY_SIZE(sc8280xp_ctl), | ||
| 2675 | .ctl = sc8280xp_ctl, | ||
| 2676 | .sspp_count = ARRAY_SIZE(sc8280xp_sspp), | ||
| 2677 | .sspp = sc8280xp_sspp, | ||
| 2678 | .mixer_count = ARRAY_SIZE(sc8280xp_lm), | ||
| 2679 | .mixer = sc8280xp_lm, | ||
| 2680 | .dspp_count = ARRAY_SIZE(sm8150_dspp), | ||
| 2681 | .dspp = sm8150_dspp, | ||
| 2682 | .pingpong_count = ARRAY_SIZE(sc8280xp_pp), | ||
| 2683 | .pingpong = sc8280xp_pp, | ||
| 2684 | .merge_3d_count = ARRAY_SIZE(sm8350_merge_3d), | ||
| 2685 | .merge_3d = sm8350_merge_3d, | ||
| 2686 | .intf_count = ARRAY_SIZE(sc8280xp_intf), | ||
| 2687 | .intf = sc8280xp_intf, | ||
| 2688 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2689 | .vbif = sdm845_vbif, | ||
| 2690 | .reg_dma_count = 1, | ||
| 2691 | .dma_cfg = &sc8280xp_regdma, | ||
| 2692 | .perf = &sc8280xp_perf_data, | ||
| 2693 | .mdss_irqs = IRQ_SC8280XP_MASK, | ||
| 2694 | }; | ||
| 2695 | |||
| 2696 | static const struct dpu_mdss_cfg sm8250_dpu_cfg = { | ||
| 2697 | .caps = &sm8250_dpu_caps, | ||
| 2698 | .mdp_count = ARRAY_SIZE(sm8250_mdp), | ||
| 2699 | .mdp = sm8250_mdp, | ||
| 2700 | .ctl_count = ARRAY_SIZE(sm8150_ctl), | ||
| 2701 | .ctl = sm8150_ctl, | ||
| 2702 | .sspp_count = ARRAY_SIZE(sm8250_sspp), | ||
| 2703 | .sspp = sm8250_sspp, | ||
| 2704 | .mixer_count = ARRAY_SIZE(sm8150_lm), | ||
| 2705 | .mixer = sm8150_lm, | ||
| 2706 | .dspp_count = ARRAY_SIZE(sm8150_dspp), | ||
| 2707 | .dspp = sm8150_dspp, | ||
| 2708 | .dsc_count = ARRAY_SIZE(sm8150_dsc), | ||
| 2709 | .dsc = sm8150_dsc, | ||
| 2710 | .pingpong_count = ARRAY_SIZE(sm8150_pp), | ||
| 2711 | .pingpong = sm8150_pp, | ||
| 2712 | .merge_3d_count = ARRAY_SIZE(sm8150_merge_3d), | ||
| 2713 | .merge_3d = sm8150_merge_3d, | ||
| 2714 | .intf_count = ARRAY_SIZE(sm8150_intf), | ||
| 2715 | .intf = sm8150_intf, | ||
| 2716 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2717 | .vbif = sdm845_vbif, | ||
| 2718 | .wb_count = ARRAY_SIZE(sm8250_wb), | ||
| 2719 | .wb = sm8250_wb, | ||
| 2720 | .reg_dma_count = 1, | ||
| 2721 | .dma_cfg = &sm8250_regdma, | ||
| 2722 | .perf = &sm8250_perf_data, | ||
| 2723 | .mdss_irqs = IRQ_SM8250_MASK, | ||
| 2724 | }; | ||
| 2725 | |||
| 2726 | static const struct dpu_mdss_cfg sm8350_dpu_cfg = { | ||
| 2727 | .caps = &sm8350_dpu_caps, | ||
| 2728 | .mdp_count = ARRAY_SIZE(sm8350_mdp), | ||
| 2729 | .mdp = sm8350_mdp, | ||
| 2730 | .ctl_count = ARRAY_SIZE(sm8350_ctl), | ||
| 2731 | .ctl = sm8350_ctl, | ||
| 2732 | .sspp_count = ARRAY_SIZE(sm8250_sspp), | ||
| 2733 | .sspp = sm8250_sspp, | ||
| 2734 | .mixer_count = ARRAY_SIZE(sm8150_lm), | ||
| 2735 | .mixer = sm8150_lm, | ||
| 2736 | .dspp_count = ARRAY_SIZE(sm8150_dspp), | ||
| 2737 | .dspp = sm8150_dspp, | ||
| 2738 | .pingpong_count = ARRAY_SIZE(sm8350_pp), | ||
| 2739 | .pingpong = sm8350_pp, | ||
| 2740 | .merge_3d_count = ARRAY_SIZE(sm8350_merge_3d), | ||
| 2741 | .merge_3d = sm8350_merge_3d, | ||
| 2742 | .intf_count = ARRAY_SIZE(sm8350_intf), | ||
| 2743 | .intf = sm8350_intf, | ||
| 2744 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2745 | .vbif = sdm845_vbif, | ||
| 2746 | .reg_dma_count = 1, | ||
| 2747 | .dma_cfg = &sm8350_regdma, | ||
| 2748 | .perf = &sm8350_perf_data, | ||
| 2749 | .mdss_irqs = IRQ_SM8350_MASK, | ||
| 2750 | }; | ||
| 2751 | 793 | ||
| 2752 | static const struct dpu_mdss_cfg sm8450_dpu_cfg = { | 794 | #include "catalog/dpu_6_0_sm8250.h" |
| 2753 | .caps = &sm8450_dpu_caps, | 795 | #include "catalog/dpu_6_2_sc7180.h" |
| 2754 | .mdp_count = ARRAY_SIZE(sm8450_mdp), | 796 | #include "catalog/dpu_6_3_sm6115.h" |
| 2755 | .mdp = sm8450_mdp, | 797 | #include "catalog/dpu_6_5_qcm2290.h" |
| 2756 | .ctl_count = ARRAY_SIZE(sm8450_ctl), | ||
| 2757 | .ctl = sm8450_ctl, | ||
| 2758 | .sspp_count = ARRAY_SIZE(sm8450_sspp), | ||
| 2759 | .sspp = sm8450_sspp, | ||
| 2760 | .mixer_count = ARRAY_SIZE(sm8150_lm), | ||
| 2761 | .mixer = sm8150_lm, | ||
| 2762 | .dspp_count = ARRAY_SIZE(sm8150_dspp), | ||
| 2763 | .dspp = sm8150_dspp, | ||
| 2764 | .pingpong_count = ARRAY_SIZE(sm8450_pp), | ||
| 2765 | .pingpong = sm8450_pp, | ||
| 2766 | .merge_3d_count = ARRAY_SIZE(sm8450_merge_3d), | ||
| 2767 | .merge_3d = sm8450_merge_3d, | ||
| 2768 | .intf_count = ARRAY_SIZE(sm8450_intf), | ||
| 2769 | .intf = sm8450_intf, | ||
| 2770 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2771 | .vbif = sdm845_vbif, | ||
| 2772 | .reg_dma_count = 1, | ||
| 2773 | .dma_cfg = &sm8450_regdma, | ||
| 2774 | .perf = &sm8450_perf_data, | ||
| 2775 | .mdss_irqs = IRQ_SM8450_MASK, | ||
| 2776 | }; | ||
| 2777 | |||
| 2778 | static const struct dpu_mdss_cfg sm8550_dpu_cfg = { | ||
| 2779 | .caps = &sm8550_dpu_caps, | ||
| 2780 | .mdp_count = ARRAY_SIZE(sm8550_mdp), | ||
| 2781 | .mdp = sm8550_mdp, | ||
| 2782 | .ctl_count = ARRAY_SIZE(sm8550_ctl), | ||
| 2783 | .ctl = sm8550_ctl, | ||
| 2784 | .sspp_count = ARRAY_SIZE(sm8550_sspp), | ||
| 2785 | .sspp = sm8550_sspp, | ||
| 2786 | .mixer_count = ARRAY_SIZE(sm8150_lm), | ||
| 2787 | .mixer = sm8150_lm, | ||
| 2788 | .dspp_count = ARRAY_SIZE(sm8150_dspp), | ||
| 2789 | .dspp = sm8150_dspp, | ||
| 2790 | .pingpong_count = ARRAY_SIZE(sm8550_pp), | ||
| 2791 | .pingpong = sm8550_pp, | ||
| 2792 | .merge_3d_count = ARRAY_SIZE(sm8550_merge_3d), | ||
| 2793 | .merge_3d = sm8550_merge_3d, | ||
| 2794 | .intf_count = ARRAY_SIZE(sm8550_intf), | ||
| 2795 | .intf = sm8550_intf, | ||
| 2796 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2797 | .vbif = sdm845_vbif, | ||
| 2798 | .reg_dma_count = 1, | ||
| 2799 | .dma_cfg = &sm8450_regdma, | ||
| 2800 | .perf = &sm8450_perf_data, | ||
| 2801 | .mdss_irqs = IRQ_SM8450_MASK, | ||
| 2802 | }; | ||
| 2803 | |||
| 2804 | static const struct dpu_mdss_cfg sc7280_dpu_cfg = { | ||
| 2805 | .caps = &sc7280_dpu_caps, | ||
| 2806 | .mdp_count = ARRAY_SIZE(sc7280_mdp), | ||
| 2807 | .mdp = sc7280_mdp, | ||
| 2808 | .ctl_count = ARRAY_SIZE(sc7280_ctl), | ||
| 2809 | .ctl = sc7280_ctl, | ||
| 2810 | .sspp_count = ARRAY_SIZE(sc7280_sspp), | ||
| 2811 | .sspp = sc7280_sspp, | ||
| 2812 | .dspp_count = ARRAY_SIZE(sc7180_dspp), | ||
| 2813 | .dspp = sc7180_dspp, | ||
| 2814 | .mixer_count = ARRAY_SIZE(sc7280_lm), | ||
| 2815 | .mixer = sc7280_lm, | ||
| 2816 | .pingpong_count = ARRAY_SIZE(sc7280_pp), | ||
| 2817 | .pingpong = sc7280_pp, | ||
| 2818 | .intf_count = ARRAY_SIZE(sc7280_intf), | ||
| 2819 | .intf = sc7280_intf, | ||
| 2820 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2821 | .vbif = sdm845_vbif, | ||
| 2822 | .perf = &sc7280_perf_data, | ||
| 2823 | .mdss_irqs = IRQ_SC7280_MASK, | ||
| 2824 | }; | ||
| 2825 | |||
| 2826 | static const struct dpu_mdss_cfg qcm2290_dpu_cfg = { | ||
| 2827 | .caps = &qcm2290_dpu_caps, | ||
| 2828 | .mdp_count = ARRAY_SIZE(qcm2290_mdp), | ||
| 2829 | .mdp = qcm2290_mdp, | ||
| 2830 | .ctl_count = ARRAY_SIZE(qcm2290_ctl), | ||
| 2831 | .ctl = qcm2290_ctl, | ||
| 2832 | .sspp_count = ARRAY_SIZE(qcm2290_sspp), | ||
| 2833 | .sspp = qcm2290_sspp, | ||
| 2834 | .mixer_count = ARRAY_SIZE(qcm2290_lm), | ||
| 2835 | .mixer = qcm2290_lm, | ||
| 2836 | .dspp_count = ARRAY_SIZE(qcm2290_dspp), | ||
| 2837 | .dspp = qcm2290_dspp, | ||
| 2838 | .pingpong_count = ARRAY_SIZE(qcm2290_pp), | ||
| 2839 | .pingpong = qcm2290_pp, | ||
| 2840 | .intf_count = ARRAY_SIZE(qcm2290_intf), | ||
| 2841 | .intf = qcm2290_intf, | ||
| 2842 | .vbif_count = ARRAY_SIZE(sdm845_vbif), | ||
| 2843 | .vbif = sdm845_vbif, | ||
| 2844 | .perf = &qcm2290_perf_data, | ||
| 2845 | .mdss_irqs = IRQ_SC7180_MASK, | ||
| 2846 | }; | ||
| 2847 | |||
| 2848 | static const struct dpu_mdss_hw_cfg_handler cfg_handler[] = { | ||
| 2849 | { .hw_rev = DPU_HW_VER_300, .dpu_cfg = &msm8998_dpu_cfg}, | ||
| 2850 | { .hw_rev = DPU_HW_VER_301, .dpu_cfg = &msm8998_dpu_cfg}, | ||
| 2851 | { .hw_rev = DPU_HW_VER_400, .dpu_cfg = &sdm845_dpu_cfg}, | ||
| 2852 | { .hw_rev = DPU_HW_VER_401, .dpu_cfg = &sdm845_dpu_cfg}, | ||
| 2853 | { .hw_rev = DPU_HW_VER_500, .dpu_cfg = &sm8150_dpu_cfg}, | ||
| 2854 | { .hw_rev = DPU_HW_VER_501, .dpu_cfg = &sm8150_dpu_cfg}, | ||
| 2855 | { .hw_rev = DPU_HW_VER_510, .dpu_cfg = &sc8180x_dpu_cfg}, | ||
| 2856 | { .hw_rev = DPU_HW_VER_600, .dpu_cfg = &sm8250_dpu_cfg}, | ||
| 2857 | { .hw_rev = DPU_HW_VER_620, .dpu_cfg = &sc7180_dpu_cfg}, | ||
| 2858 | { .hw_rev = DPU_HW_VER_630, .dpu_cfg = &sm6115_dpu_cfg}, | ||
| 2859 | { .hw_rev = DPU_HW_VER_650, .dpu_cfg = &qcm2290_dpu_cfg}, | ||
| 2860 | { .hw_rev = DPU_HW_VER_700, .dpu_cfg = &sm8350_dpu_cfg}, | ||
| 2861 | { .hw_rev = DPU_HW_VER_720, .dpu_cfg = &sc7280_dpu_cfg}, | ||
| 2862 | { .hw_rev = DPU_HW_VER_800, .dpu_cfg = &sc8280xp_dpu_cfg}, | ||
| 2863 | { .hw_rev = DPU_HW_VER_810, .dpu_cfg = &sm8450_dpu_cfg}, | ||
| 2864 | { .hw_rev = DPU_HW_VER_900, .dpu_cfg = &sm8550_dpu_cfg}, | ||
| 2865 | }; | ||
| 2866 | |||
| 2867 | const struct dpu_mdss_cfg *dpu_hw_catalog_init(u32 hw_rev) | ||
| 2868 | { | ||
| 2869 | int i; | ||
| 2870 | |||
| 2871 | for (i = 0; i < ARRAY_SIZE(cfg_handler); i++) { | ||
| 2872 | if (cfg_handler[i].hw_rev == hw_rev) | ||
| 2873 | return cfg_handler[i].dpu_cfg; | ||
| 2874 | } | ||
| 2875 | 798 | ||
| 2876 | DPU_ERROR("unsupported chipset id:%X\n", hw_rev); | 799 | #include "catalog/dpu_7_0_sm8350.h" |
| 800 | #include "catalog/dpu_7_2_sc7280.h" | ||
| 2877 | 801 | ||
| 2878 | return ERR_PTR(-ENODEV); | 802 | #include "catalog/dpu_8_0_sc8280xp.h" |
| 2879 | } | 803 | #include "catalog/dpu_8_1_sm8450.h" |
| 2880 | 804 | ||
| 805 | #include "catalog/dpu_9_0_sm8550.h" | ||
| @@ -19,47 +19,6 @@ · 18 unmodified lines | |||
| 19 | */ | 19 | */ |
| 20 | #define MAX_BLOCKS 12 | 20 | #define MAX_BLOCKS 12 |
| 21 | 21 | ||
| 22 | #define DPU_HW_VER(MAJOR, MINOR, STEP) (((MAJOR & 0xF) << 28) |\ | ||
| 23 | ((MINOR & 0xFFF) << 16) |\ | ||
| 24 | (STEP & 0xFFFF)) | ||
| 25 | |||
| 26 | #define DPU_HW_MAJOR(rev) ((rev) >> 28) | ||
| 27 | #define DPU_HW_MINOR(rev) (((rev) >> 16) & 0xFFF) | ||
| 28 | #define DPU_HW_STEP(rev) ((rev) & 0xFFFF) | ||
| 29 | #define DPU_HW_MAJOR_MINOR(rev) ((rev) >> 16) | ||
| 30 | |||
| 31 | #define IS_DPU_MAJOR_MINOR_SAME(rev1, rev2) \ | ||
| 32 | (DPU_HW_MAJOR_MINOR((rev1)) == DPU_HW_MAJOR_MINOR((rev2))) | ||
| 33 | |||
| 34 | #define DPU_HW_VER_170 DPU_HW_VER(1, 7, 0) /* 8996 v1.0 */ | ||
| 35 | #define DPU_HW_VER_171 DPU_HW_VER(1, 7, 1) /* 8996 v2.0 */ | ||
| 36 | #define DPU_HW_VER_172 DPU_HW_VER(1, 7, 2) /* 8996 v3.0 */ | ||
| 37 | #define DPU_HW_VER_300 DPU_HW_VER(3, 0, 0) /* 8998 v1.0 */ | ||
| 38 | #define DPU_HW_VER_301 DPU_HW_VER(3, 0, 1) /* 8998 v1.1 */ | ||
| 39 | #define DPU_HW_VER_400 DPU_HW_VER(4, 0, 0) /* sdm845 v1.0 */ | ||
| 40 | #define DPU_HW_VER_401 DPU_HW_VER(4, 0, 1) /* sdm845 v2.0 */ | ||
| 41 | #define DPU_HW_VER_410 DPU_HW_VER(4, 1, 0) /* sdm670 v1.0 */ | ||
| 42 | #define DPU_HW_VER_500 DPU_HW_VER(5, 0, 0) /* sm8150 v1.0 */ | ||
| 43 | #define DPU_HW_VER_501 DPU_HW_VER(5, 0, 1) /* sm8150 v2.0 */ | ||
| 44 | #define DPU_HW_VER_510 DPU_HW_VER(5, 1, 1) /* sc8180 */ | ||
| 45 | #define DPU_HW_VER_600 DPU_HW_VER(6, 0, 0) /* sm8250 */ | ||
| 46 | #define DPU_HW_VER_620 DPU_HW_VER(6, 2, 0) /* sc7180 v1.0 */ | ||
| 47 | #define DPU_HW_VER_630 DPU_HW_VER(6, 3, 0) /* sm6115|sm4250 */ | ||
| 48 | #define DPU_HW_VER_650 DPU_HW_VER(6, 5, 0) /* qcm2290|sm4125 */ | ||
| 49 | #define DPU_HW_VER_700 DPU_HW_VER(7, 0, 0) /* sm8350 */ | ||
| 50 | #define DPU_HW_VER_720 DPU_HW_VER(7, 2, 0) /* sc7280 */ | ||
| 51 | #define DPU_HW_VER_800 DPU_HW_VER(8, 0, 0) /* sc8280xp */ | ||
| 52 | #define DPU_HW_VER_810 DPU_HW_VER(8, 1, 0) /* sm8450 */ | ||
| 53 | #define DPU_HW_VER_900 DPU_HW_VER(9, 0, 0) /* sm8550 */ | ||
| 54 | |||
| 55 | #define IS_MSM8996_TARGET(rev) IS_DPU_MAJOR_MINOR_SAME((rev), DPU_HW_VER_170) | ||
| 56 | #define IS_MSM8998_TARGET(rev) IS_DPU_MAJOR_MINOR_SAME((rev), DPU_HW_VER_300) | ||
| 57 | #define IS_SDM845_TARGET(rev) IS_DPU_MAJOR_MINOR_SAME((rev), DPU_HW_VER_400) | ||
| 58 | #define IS_SDM670_TARGET(rev) IS_DPU_MAJOR_MINOR_SAME((rev), DPU_HW_VER_410) | ||
| 59 | #define IS_SDM855_TARGET(rev) IS_DPU_MAJOR_MINOR_SAME((rev), DPU_HW_VER_500) | ||
| 60 | #define IS_SC7180_TARGET(rev) IS_DPU_MAJOR_MINOR_SAME((rev), DPU_HW_VER_620) | ||
| 61 | #define IS_SC7280_TARGET(rev) IS_DPU_MAJOR_MINOR_SAME((rev), DPU_HW_VER_720) | ||
| 62 | |||
| 63 | #define DPU_HW_BLK_NAME_LEN 16 | 22 | #define DPU_HW_BLK_NAME_LEN 16 |
| 64 | 23 | ||
| 65 | #define MAX_IMG_WIDTH 0x3fff | 24 | #define MAX_IMG_WIDTH 0x3fff |
| @@ -169,10 +128,12 @@ enum { · 103 unmodified lines | |||
| 169 | * DSPP sub-blocks | 128 | * DSPP sub-blocks |
| 170 | * @DPU_DSPP_PCC Panel color correction block | 129 | * @DPU_DSPP_PCC Panel color correction block |
| 171 | * @DPU_DSPP_GC Gamma correction block | 130 | * @DPU_DSPP_GC Gamma correction block |
| 131 | * @DPU_DSPP_IGC Inverse gamma correction block | ||
| 172 | */ | 132 | */ |
| 173 | enum { | 133 | enum { |
| 174 | DPU_DSPP_PCC = 0x1, | 134 | DPU_DSPP_PCC = 0x1, |
| 175 | DPU_DSPP_GC, | 135 | DPU_DSPP_GC, |
| 136 | DPU_DSPP_IGC, | ||
| 176 | DPU_DSPP_MAX | 137 | DPU_DSPP_MAX |
| 177 | }; | 138 | }; |
| 178 | 139 | ||
| @@ -200,6 +161,7 @@ enum { · 21 unmodified lines | |||
| 200 | * @DPU_CTL_FETCH_ACTIVE: Active CTL for fetch HW (SSPPs) | 161 | * @DPU_CTL_FETCH_ACTIVE: Active CTL for fetch HW (SSPPs) |
| 201 | * @DPU_CTL_VM_CFG: CTL config to support multiple VMs | 162 | * @DPU_CTL_VM_CFG: CTL config to support multiple VMs |
| 202 | * @DPU_CTL_HAS_LAYER_EXT4: CTL has the CTL_LAYER_EXT4 register | 163 | * @DPU_CTL_HAS_LAYER_EXT4: CTL has the CTL_LAYER_EXT4 register |
| 164 | * @DPU_CTL_DSPP_BLOCK_FLUSH: CTL config to support dspp sub-block flush | ||
| 203 | * @DPU_CTL_MAX | 165 | * @DPU_CTL_MAX |
| 204 | */ | 166 | */ |
| 205 | enum { | 167 | enum { |
| @@ -208,22 +170,25 @@ enum { · 2 unmodified lines | |||
| 208 | DPU_CTL_FETCH_ACTIVE, | 170 | DPU_CTL_FETCH_ACTIVE, |
| 209 | DPU_CTL_VM_CFG, | 171 | DPU_CTL_VM_CFG, |
| 210 | DPU_CTL_HAS_LAYER_EXT4, | 172 | DPU_CTL_HAS_LAYER_EXT4, |
| 173 | DPU_CTL_DSPP_SUB_BLOCK_FLUSH, | ||
| 211 | DPU_CTL_MAX | 174 | DPU_CTL_MAX |
| 212 | }; | 175 | }; |
| 213 | 176 | ||
| 214 | /** | 177 | /** |
| 215 | * INTF sub-blocks | 178 | * INTF sub-blocks |
| 216 | * @DPU_INTF_INPUT_CTRL Supports the setting of pp block from which | 179 | * @DPU_INTF_INPUT_CTRL Supports the setting of pp block from which |
| 217 | * pixel data arrives to this INTF | 180 | * pixel data arrives to this INTF |
| 218 | * @DPU_INTF_TE INTF block has TE configuration support | 181 | * @DPU_INTF_TE INTF block has TE configuration support |
| 219 | * @DPU_DATA_HCTL_EN Allows data to be transferred at different rate | 182 | * @DPU_DATA_HCTL_EN Allows data to be transferred at different rate |
| 220 | than video timing | 183 | * than video timing |
| 184 | * @DPU_INTF_STATUS_SUPPORTED INTF block has INTF_STATUS register | ||
| 221 | * @DPU_INTF_MAX | 185 | * @DPU_INTF_MAX |
| 222 | */ | 186 | */ |
| 223 | enum { | 187 | enum { |
| 224 | DPU_INTF_INPUT_CTRL = 0x1, | 188 | DPU_INTF_INPUT_CTRL = 0x1, |
| 225 | DPU_INTF_TE, | 189 | DPU_INTF_TE, |
| 226 | DPU_DATA_HCTL_EN, | 190 | DPU_DATA_HCTL_EN, |
| 191 | DPU_INTF_STATUS_SUPPORTED, | ||
| 227 | DPU_INTF_MAX | 192 | DPU_INTF_MAX |
| 228 | }; | 193 | }; |
| 229 | 194 | ||
| @@ -393,8 +358,6 @@ struct dpu_rotation_cfg { · 163 unmodified lines | |||
| 393 | * @max_mixer_blendstages max layer mixer blend stages or | 358 | * @max_mixer_blendstages max layer mixer blend stages or |
| 394 | * supported z order | 359 | * supported z order |
| 395 | * @qseed_type qseed2 or qseed3 support. | 360 | * @qseed_type qseed2 or qseed3 support. |
| 396 | * @smart_dma_rev Supported version of SmartDMA feature. | ||
| 397 | * @ubwc_version UBWC feature version (0x0 for not supported) | ||
| 398 | * @has_src_split source split feature status | 361 | * @has_src_split source split feature status |
| 399 | * @has_dim_layer dim layer feature status | 362 | * @has_dim_layer dim layer feature status |
| 400 | * @has_idle_pc indicate if idle power collapse feature is supported | 363 | * @has_idle_pc indicate if idle power collapse feature is supported |
| @@ -408,8 +371,6 @@ struct dpu_caps { · 7 unmodified lines | |||
| 408 | u32 max_mixer_width; | 371 | u32 max_mixer_width; |
| 409 | u32 max_mixer_blendstages; | 372 | u32 max_mixer_blendstages; |
| 410 | u32 qseed_type; | 373 | u32 qseed_type; |
| 411 | u32 smart_dma_rev; | ||
| 412 | u32 ubwc_version; | ||
| 413 | bool has_src_split; | 374 | bool has_src_split; |
| 414 | bool has_dim_layer; | 375 | bool has_dim_layer; |
| 415 | bool has_idle_pc; | 376 | bool has_idle_pc; |
| @@ -538,15 +499,24 @@ struct dpu_clk_ctrl_reg { · 122 unmodified lines | |||
| 538 | * @id: index identifying this block | 499 | * @id: index identifying this block |
| 539 | * @base: register base offset to mdss | 500 | * @base: register base offset to mdss |
| 540 | * @features bit mask identifying sub-blocks/features | 501 | * @features bit mask identifying sub-blocks/features |
| 541 | * @highest_bank_bit: UBWC parameter | ||
| 542 | * @ubwc_swizzle: ubwc default swizzle setting | ||
| 543 | * @clk_ctrls clock control register definition | 502 | * @clk_ctrls clock control register definition |
| 544 | */ | 503 | */ |
| 545 | struct dpu_mdp_cfg { | 504 | struct dpu_mdp_cfg { |
| 546 | DPU_HW_BLK_INFO; | 505 | DPU_HW_BLK_INFO; |
| 506 | struct dpu_clk_ctrl_reg clk_ctrls[DPU_CLK_CTRL_MAX]; | ||
| 507 | }; | ||
| 508 | |||
| 509 | /** | ||
| 510 | * struct dpu_ubwc_cfg - UBWC and memory configuration | ||
| 511 | * | ||
| 512 | * @ubwc_version UBWC feature version (0x0 for not supported) | ||
| 513 | * @highest_bank_bit: UBWC parameter | ||
| 514 | * @ubwc_swizzle: ubwc default swizzle setting | ||
| 515 | */ | ||
| 516 | struct dpu_ubwc_cfg { | ||
| 517 | u32 ubwc_version; | ||
| 547 | u32 highest_bank_bit; | 518 | u32 highest_bank_bit; |
| 548 | u32 ubwc_swizzle; | 519 | u32 ubwc_swizzle; |
| 549 | struct dpu_clk_ctrl_reg clk_ctrls[DPU_CLK_CTRL_MAX]; | ||
| 550 | }; | 520 | }; |
| 551 | 521 | ||
| 552 | /* struct dpu_ctl_cfg : MDP CTL instance info | 522 | /* struct dpu_ctl_cfg : MDP CTL instance info |
| @@ -848,6 +818,8 @@ struct dpu_perf_cfg { · 295 unmodified lines | |||
| 848 | struct dpu_mdss_cfg { | 818 | struct dpu_mdss_cfg { |
| 849 | const struct dpu_caps *caps; | 819 | const struct dpu_caps *caps; |
| 850 | 820 | ||
| 821 | const struct dpu_ubwc_cfg *ubwc; | ||
| 822 | |||
| 851 | u32 mdp_count; | 823 | u32 mdp_count; |
| 852 | const struct dpu_mdp_cfg *mdp; | 824 | const struct dpu_mdp_cfg *mdp; |
| 853 | 825 | ||
| @@ -867,7 +839,7 @@ struct dpu_mdss_cfg { · 13 unmodified lines | |||
| 867 | const struct dpu_merge_3d_cfg *merge_3d; | 839 | const struct dpu_merge_3d_cfg *merge_3d; |
| 868 | 840 | ||
| 869 | u32 dsc_count; | 841 | u32 dsc_count; |
| 870 | struct dpu_dsc_cfg *dsc; | 842 | const struct dpu_dsc_cfg *dsc; |
| 871 | 843 | ||
| 872 | u32 intf_count; | 844 | u32 intf_count; |
| 873 | const struct dpu_intf_cfg *intf; | 845 | const struct dpu_intf_cfg *intf; |
| @@ -896,18 +868,18 @@ struct dpu_mdss_cfg { · 22 unmodified lines | |||
| 896 | unsigned long mdss_irqs; | 868 | unsigned long mdss_irqs; |
| 897 | }; | 869 | }; |
| 898 | 870 | ||
| 899 | struct dpu_mdss_hw_cfg_handler { | 871 | extern const struct dpu_mdss_cfg dpu_msm8998_cfg; |
| 900 | u32 hw_rev; | 872 | extern const struct dpu_mdss_cfg dpu_sdm845_cfg; |
| 901 | const struct dpu_mdss_cfg *dpu_cfg; | 873 | extern const struct dpu_mdss_cfg dpu_sm8150_cfg; |
| 902 | }; | 874 | extern const struct dpu_mdss_cfg dpu_sc8180x_cfg; |
| 903 | 875 | extern const struct dpu_mdss_cfg dpu_sm8250_cfg; | |
| 904 | /** | 876 | extern const struct dpu_mdss_cfg dpu_sc7180_cfg; |
| 905 | * dpu_hw_catalog_init - dpu hardware catalog init API retrieves | 877 | extern const struct dpu_mdss_cfg dpu_sm6115_cfg; |
| 906 | * hardcoded target specific catalog information in config structure | 878 | extern const struct dpu_mdss_cfg dpu_qcm2290_cfg; |
| 907 | * @hw_rev: caller needs provide the hardware revision. | 879 | extern const struct dpu_mdss_cfg dpu_sm8350_cfg; |
| 908 | * | 880 | extern const struct dpu_mdss_cfg dpu_sc7280_cfg; |
| 909 | * Return: dpu config structure | 881 | extern const struct dpu_mdss_cfg dpu_sc8280xp_cfg; |
| 910 | */ | 882 | extern const struct dpu_mdss_cfg dpu_sm8450_cfg; |
| 911 | const struct dpu_mdss_cfg *dpu_hw_catalog_init(u32 hw_rev); | 883 | extern const struct dpu_mdss_cfg dpu_sm8550_cfg; |
| 912 | 884 | ||
| 913 | #endif /* _DPU_HW_CATALOG_H */ | 885 | #endif /* _DPU_HW_CATALOG_H */ |
| @@ -26,15 +26,16 @@ · 25 unmodified lines | |||
| 26 | #define CTL_SW_RESET 0x030 | 26 | #define CTL_SW_RESET 0x030 |
| 27 | #define CTL_LAYER_EXTN_OFFSET 0x40 | 27 | #define CTL_LAYER_EXTN_OFFSET 0x40 |
| 28 | #define CTL_MERGE_3D_ACTIVE 0x0E4 | 28 | #define CTL_MERGE_3D_ACTIVE 0x0E4 |
| 29 | #define CTL_DSC_ACTIVE 0x0E8 | ||
| 29 | #define CTL_WB_ACTIVE 0x0EC | 30 | #define CTL_WB_ACTIVE 0x0EC |
| 30 | #define CTL_INTF_ACTIVE 0x0F4 | 31 | #define CTL_INTF_ACTIVE 0x0F4 |
| 32 | #define CTL_FETCH_PIPE_ACTIVE 0x0FC | ||
| 31 | #define CTL_MERGE_3D_FLUSH 0x100 | 33 | #define CTL_MERGE_3D_FLUSH 0x100 |
| 32 | #define CTL_DSC_ACTIVE 0x0E8 | ||
| 33 | #define CTL_DSC_FLUSH 0x104 | 34 | #define CTL_DSC_FLUSH 0x104 |
| 34 | #define CTL_WB_FLUSH 0x108 | 35 | #define CTL_WB_FLUSH 0x108 |
| 35 | #define CTL_INTF_FLUSH 0x110 | 36 | #define CTL_INTF_FLUSH 0x110 |
| 36 | #define CTL_INTF_MASTER 0x134 | 37 | #define CTL_INTF_MASTER 0x134 |
| 37 | #define CTL_FETCH_PIPE_ACTIVE 0x0FC | 38 | #define CTL_DSPP_n_FLUSH(n) ((0x13C) + ((n) * 4)) |
| 38 | 39 | ||
| 39 | #define CTL_MIXER_BORDER_OUT BIT(24) | 40 | #define CTL_MIXER_BORDER_OUT BIT(24) |
| 40 | #define CTL_FLUSH_MASK_CTL BIT(17) | 41 | #define CTL_FLUSH_MASK_CTL BIT(17) |
| @@ -44,6 +45,7 @@ · 3 unmodified lines | |||
| 44 | #define DSC_IDX 22 | 45 | #define DSC_IDX 22 |
| 45 | #define INTF_IDX 31 | 46 | #define INTF_IDX 31 |
| 46 | #define WB_IDX 16 | 47 | #define WB_IDX 16 |
| 48 | #define DSPP_IDX 29 /* From DPU hw rev 7.x.x */ | ||
| 47 | #define CTL_INVALID_BIT 0xffff | 49 | #define CTL_INVALID_BIT 0xffff |
| 48 | #define CTL_DEFAULT_GROUP_ID 0xf | 50 | #define CTL_DEFAULT_GROUP_ID 0xf |
| 49 | 51 | ||
| @@ -115,6 +117,9 @@ static inline void dpu_hw_ctl_clear_pending_flush(struct dpu_hw_ctl *ctx) · 65 unmodified lines | |||
| 115 | trace_dpu_hw_ctl_clear_pending_flush(ctx->pending_flush_mask, | 117 | trace_dpu_hw_ctl_clear_pending_flush(ctx->pending_flush_mask, |
| 116 | dpu_hw_ctl_get_flush_register(ctx)); | 118 | dpu_hw_ctl_get_flush_register(ctx)); |
| 117 | ctx->pending_flush_mask = 0x0; | 119 | ctx->pending_flush_mask = 0x0; |
| 120 | |||
| 121 | memset(ctx->pending_dspp_flush_mask, 0, | ||
| 122 | sizeof(ctx->pending_dspp_flush_mask)); | ||
| 118 | } | 123 | } |
| 119 | 124 | ||
| 120 | static inline void dpu_hw_ctl_update_pending_flush(struct dpu_hw_ctl *ctx, | 125 | static inline void dpu_hw_ctl_update_pending_flush(struct dpu_hw_ctl *ctx, |
| @@ -132,6 +137,8 @@ static u32 dpu_hw_ctl_get_pending_flush(struct dpu_hw_ctl *ctx) · 11 unmodified lines | |||
| 132 | 137 | ||
| 133 | static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx) | 138 | static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx) |
| 134 | { | 139 | { |
| 140 | int dspp; | ||
| 141 | |||
| 135 | if (ctx->pending_flush_mask & BIT(MERGE_3D_IDX)) | 142 | if (ctx->pending_flush_mask & BIT(MERGE_3D_IDX)) |
| 136 | DPU_REG_WRITE(&ctx->hw, CTL_MERGE_3D_FLUSH, | 143 | DPU_REG_WRITE(&ctx->hw, CTL_MERGE_3D_FLUSH, |
| 137 | ctx->pending_merge_3d_flush_mask); | 144 | ctx->pending_merge_3d_flush_mask); |
| @@ -142,6 +149,13 @@ static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx) · 4 unmodified lines | |||
| 142 | DPU_REG_WRITE(&ctx->hw, CTL_WB_FLUSH, | 149 | DPU_REG_WRITE(&ctx->hw, CTL_WB_FLUSH, |
| 143 | ctx->pending_wb_flush_mask); | 150 | ctx->pending_wb_flush_mask); |
| 144 | 151 | ||
| 152 | if (ctx->pending_flush_mask & BIT(DSPP_IDX)) | ||
| 153 | for (dspp = DSPP_0; dspp < DSPP_MAX; dspp++) { | ||
| 154 | if (ctx->pending_dspp_flush_mask[dspp - DSPP_0]) | ||
| 155 | DPU_REG_WRITE(&ctx->hw, | ||
| 156 | CTL_DSPP_n_FLUSH(dspp - DSPP_0), | ||
| 157 | ctx->pending_dspp_flush_mask[dspp - DSPP_0]); | ||
| 158 | } | ||
| 145 | DPU_REG_WRITE(&ctx->hw, CTL_FLUSH, ctx->pending_flush_mask); | 159 | DPU_REG_WRITE(&ctx->hw, CTL_FLUSH, ctx->pending_flush_mask); |
| 146 | } | 160 | } |
| 147 | 161 | ||
| @@ -289,7 +303,7 @@ static void dpu_hw_ctl_update_pending_flush_merge_3d_v1(struct dpu_hw_ctl *ctx, · 141 unmodified lines | |||
| 289 | } | 303 | } |
| 290 | 304 | ||
| 291 | static void dpu_hw_ctl_update_pending_flush_dspp(struct dpu_hw_ctl *ctx, | 305 | static void dpu_hw_ctl_update_pending_flush_dspp(struct dpu_hw_ctl *ctx, |
| 292 | enum dpu_dspp dspp) | 306 | enum dpu_dspp dspp, u32 dspp_sub_blk) |
| 293 | { | 307 | { |
| 294 | switch (dspp) { | 308 | switch (dspp) { |
| 295 | case DSPP_0: | 309 | case DSPP_0: |
| @@ -309,6 +323,29 @@ static void dpu_hw_ctl_update_pending_flush_dspp(struct dpu_hw_ctl *ctx, · 13 unmodified lines | |||
| 309 | } | 323 | } |
| 310 | } | 324 | } |
| 311 | 325 | ||
| 326 | static void dpu_hw_ctl_update_pending_flush_dspp_sub_blocks( | ||
| 327 | struct dpu_hw_ctl *ctx, enum dpu_dspp dspp, u32 dspp_sub_blk) | ||
| 328 | { | ||
| 329 | if (dspp >= DSPP_MAX) | ||
| 330 | return; | ||
| 331 | |||
| 332 | switch (dspp_sub_blk) { | ||
| 333 | case DPU_DSPP_IGC: | ||
| 334 | ctx->pending_dspp_flush_mask[dspp - DSPP_0] |= BIT(2); | ||
| 335 | break; | ||
| 336 | case DPU_DSPP_PCC: | ||
| 337 | ctx->pending_dspp_flush_mask[dspp - DSPP_0] |= BIT(4); | ||
| 338 | break; | ||
| 339 | case DPU_DSPP_GC: | ||
| 340 | ctx->pending_dspp_flush_mask[dspp - DSPP_0] |= BIT(5); | ||
| 341 | break; | ||
| 342 | default: | ||
| 343 | return; | ||
| 344 | } | ||
| 345 | |||
| 346 | ctx->pending_flush_mask |= BIT(DSPP_IDX); | ||
| 347 | } | ||
| 348 | |||
| 312 | static u32 dpu_hw_ctl_poll_reset_status(struct dpu_hw_ctl *ctx, u32 timeout_us) | 349 | static u32 dpu_hw_ctl_poll_reset_status(struct dpu_hw_ctl *ctx, u32 timeout_us) |
| 313 | { | 350 | { |
| 314 | struct dpu_hw_blk_reg_map *c = &ctx->hw; | 351 | struct dpu_hw_blk_reg_map *c = &ctx->hw; |
| @@ -630,7 +667,11 @@ static void _setup_ctl_ops(struct dpu_hw_ctl_ops *ops, · 315 unmodified lines | |||
| 630 | ops->setup_blendstage = dpu_hw_ctl_setup_blendstage; | 667 | ops->setup_blendstage = dpu_hw_ctl_setup_blendstage; |
| 631 | ops->update_pending_flush_sspp = dpu_hw_ctl_update_pending_flush_sspp; | 668 | ops->update_pending_flush_sspp = dpu_hw_ctl_update_pending_flush_sspp; |
| 632 | ops->update_pending_flush_mixer = dpu_hw_ctl_update_pending_flush_mixer; | 669 | ops->update_pending_flush_mixer = dpu_hw_ctl_update_pending_flush_mixer; |
| 633 | ops->update_pending_flush_dspp = dpu_hw_ctl_update_pending_flush_dspp; | 670 | if (cap & BIT(DPU_CTL_DSPP_SUB_BLOCK_FLUSH)) |
| 671 | ops->update_pending_flush_dspp = dpu_hw_ctl_update_pending_flush_dspp_sub_blocks; | ||
| 672 | else | ||
| 673 | ops->update_pending_flush_dspp = dpu_hw_ctl_update_pending_flush_dspp; | ||
| 674 | |||
| 634 | if (cap & BIT(DPU_CTL_FETCH_ACTIVE)) | 675 | if (cap & BIT(DPU_CTL_FETCH_ACTIVE)) |
| 635 | ops->set_active_pipes = dpu_hw_ctl_set_fetch_pipe_active; | 676 | ops->set_active_pipes = dpu_hw_ctl_set_fetch_pipe_active; |
| 636 | }; | 677 | }; |
| @@ -152,9 +152,11 @@ struct dpu_hw_ctl_ops { · 151 unmodified lines | |||
| 152 | * No effect on hardware | 152 | * No effect on hardware |
| 153 | * @ctx : ctl path ctx pointer | 153 | * @ctx : ctl path ctx pointer |
| 154 | * @blk : DSPP block index | 154 | * @blk : DSPP block index |
| 155 | * @dspp_sub_blk : DSPP sub-block index | ||
| 155 | */ | 156 | */ |
| 156 | void (*update_pending_flush_dspp)(struct dpu_hw_ctl *ctx, | 157 | void (*update_pending_flush_dspp)(struct dpu_hw_ctl *ctx, |
| 157 | enum dpu_dspp blk); | 158 | enum dpu_dspp blk, u32 dspp_sub_blk); |
| 159 | |||
| 158 | /** | 160 | /** |
| 159 | * Write the value of the pending_flush_mask to hardware | 161 | * Write the value of the pending_flush_mask to hardware |
| 160 | * @ctx : ctl path ctx pointer | 162 | * @ctx : ctl path ctx pointer |
| @@ -242,6 +244,7 @@ struct dpu_hw_ctl { · 81 unmodified lines | |||
| 242 | u32 pending_intf_flush_mask; | 244 | u32 pending_intf_flush_mask; |
| 243 | u32 pending_wb_flush_mask; | 245 | u32 pending_wb_flush_mask; |
| 244 | u32 pending_merge_3d_flush_mask; | 246 | u32 pending_merge_3d_flush_mask; |
| 247 | u32 pending_dspp_flush_mask[DSPP_MAX - DSPP_0]; | ||
| 245 | 248 | ||
| 246 | /* ops */ | 249 | /* ops */ |
| 247 | struct dpu_hw_ctl_ops ops; | 250 | struct dpu_hw_ctl_ops ops; |
| @@ -175,7 +175,7 @@ static void dpu_hw_dsc_bind_pingpong_blk( · 174 unmodified lines | |||
| 175 | DPU_REG_WRITE(c, dsc_ctl_offset, mux_cfg); | 175 | DPU_REG_WRITE(c, dsc_ctl_offset, mux_cfg); |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | static struct dpu_dsc_cfg *_dsc_offset(enum dpu_dsc dsc, | 178 | static const struct dpu_dsc_cfg *_dsc_offset(enum dpu_dsc dsc, |
| 179 | const struct dpu_mdss_cfg *m, | 179 | const struct dpu_mdss_cfg *m, |
| 180 | void __iomem *addr, | 180 | void __iomem *addr, |
| 181 | struct dpu_hw_blk_reg_map *b) | 181 | struct dpu_hw_blk_reg_map *b) |
| @@ -207,7 +207,7 @@ struct dpu_hw_dsc *dpu_hw_dsc_init(enum dpu_dsc idx, void __iomem *addr, · 25 unmodified lines | |||
| 207 | const struct dpu_mdss_cfg *m) | 207 | const struct dpu_mdss_cfg *m) |
| 208 | { | 208 | { |
| 209 | struct dpu_hw_dsc *c; | 209 | struct dpu_hw_dsc *c; |
| 210 | struct dpu_dsc_cfg *cfg; | 210 | const struct dpu_dsc_cfg *cfg; |
| 211 | 211 | ||
| 212 | c = kzalloc(sizeof(*c), GFP_KERNEL); | 212 | c = kzalloc(sizeof(*c), GFP_KERNEL); |
| 213 | if (!c) | 213 | if (!c) |
| @@ -62,6 +62,7 @@ · 61 unmodified lines | |||
| 62 | #define INTF_LINE_COUNT 0x0B0 | 62 | #define INTF_LINE_COUNT 0x0B0 |
| 63 | 63 | ||
| 64 | #define INTF_MUX 0x25C | 64 | #define INTF_MUX 0x25C |
| 65 | #define INTF_STATUS 0x26C | ||
| 65 | 66 | ||
| 66 | #define INTF_CFG_ACTIVE_H_EN BIT(29) | 67 | #define INTF_CFG_ACTIVE_H_EN BIT(29) |
| 67 | #define INTF_CFG_ACTIVE_V_EN BIT(30) | 68 | #define INTF_CFG_ACTIVE_V_EN BIT(30) |
| @@ -297,8 +298,13 @@ static void dpu_hw_intf_get_status( · 229 unmodified lines | |||
| 297 | struct intf_status *s) | 298 | struct intf_status *s) |
| 298 | { | 299 | { |
| 299 | struct dpu_hw_blk_reg_map *c = &intf->hw; | 300 | struct dpu_hw_blk_reg_map *c = &intf->hw; |
| 301 | unsigned long cap = intf->cap->features; | ||
| 302 | |||
| 303 | if (cap & BIT(DPU_INTF_STATUS_SUPPORTED)) | ||
| 304 | s->is_en = DPU_REG_READ(c, INTF_STATUS) & BIT(0); | ||
| 305 | else | ||
| 306 | s->is_en = DPU_REG_READ(c, INTF_TIMING_ENGINE_EN); | ||
| 300 | 307 | ||
| 301 | s->is_en = DPU_REG_READ(c, INTF_TIMING_ENGINE_EN); | ||
| 302 | s->is_prog_fetch_en = !!(DPU_REG_READ(c, INTF_CONFIG) & BIT(31)); | 308 | s->is_prog_fetch_en = !!(DPU_REG_READ(c, INTF_CONFIG) & BIT(31)); |
| 303 | if (s->is_en) { | 309 | if (s->is_en) { |
| 304 | s->frame_count = DPU_REG_READ(c, INTF_FRAME_COUNT); | 310 | s->frame_count = DPU_REG_READ(c, INTF_FRAME_COUNT); |
| @@ -136,7 +136,7 @@ · 135 unmodified lines | |||
| 136 | #define TS_CLK 19200000 | 136 | #define TS_CLK 19200000 |
| 137 | 137 | ||
| 138 | 138 | ||
| 139 | static int _sspp_subblk_offset(struct dpu_hw_pipe *ctx, | 139 | static int _sspp_subblk_offset(struct dpu_hw_sspp *ctx, |
| 140 | int s_id, | 140 | int s_id, |
| 141 | u32 *idx) | 141 | u32 *idx) |
| 142 | { | 142 | { |
| @@ -168,17 +168,16 @@ static int _sspp_subblk_offset(struct dpu_hw_pipe *ctx, · 25 unmodified lines | |||
| 168 | return rc; | 168 | return rc; |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | static void dpu_hw_sspp_setup_multirect(struct dpu_hw_pipe *ctx, | 171 | static void dpu_hw_sspp_setup_multirect(struct dpu_sw_pipe *pipe) |
| 172 | enum dpu_sspp_multirect_index index, | ||
| 173 | enum dpu_sspp_multirect_mode mode) | ||
| 174 | { | 172 | { |
| 173 | struct dpu_hw_sspp *ctx = pipe->sspp; | ||
| 175 | u32 mode_mask; | 174 | u32 mode_mask; |
| 176 | u32 idx; | 175 | u32 idx; |
| 177 | 176 | ||
| 178 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) | 177 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) |
| 179 | return; | 178 | return; |
| 180 | 179 | ||
| 181 | if (index == DPU_SSPP_RECT_SOLO) { | 180 | if (pipe->multirect_index == DPU_SSPP_RECT_SOLO) { |
| 182 | /** | 181 | /** |
| 183 | * if rect index is RECT_SOLO, we cannot expect a | 182 | * if rect index is RECT_SOLO, we cannot expect a |
| 184 | * virtual plane sharing the same SSPP id. So we go | 183 | * virtual plane sharing the same SSPP id. So we go |
| @@ -187,8 +186,8 @@ static void dpu_hw_sspp_setup_multirect(struct dpu_hw_pipe *ctx, · 2 unmodified lines | |||
| 187 | mode_mask = 0; | 186 | mode_mask = 0; |
| 188 | } else { | 187 | } else { |
| 189 | mode_mask = DPU_REG_READ(&ctx->hw, SSPP_MULTIRECT_OPMODE + idx); | 188 | mode_mask = DPU_REG_READ(&ctx->hw, SSPP_MULTIRECT_OPMODE + idx); |
| 190 | mode_mask |= index; | 189 | mode_mask |= pipe->multirect_index; |
| 191 | if (mode == DPU_SSPP_MULTIRECT_TIME_MX) | 190 | if (pipe->multirect_mode == DPU_SSPP_MULTIRECT_TIME_MX) |
| 192 | mode_mask |= BIT(2); | 191 | mode_mask |= BIT(2); |
| 193 | else | 192 | else |
| 194 | mode_mask &= ~BIT(2); | 193 | mode_mask &= ~BIT(2); |
| @@ -197,7 +196,7 @@ static void dpu_hw_sspp_setup_multirect(struct dpu_hw_pipe *ctx, · 2 unmodified lines | |||
| 197 | DPU_REG_WRITE(&ctx->hw, SSPP_MULTIRECT_OPMODE + idx, mode_mask); | 196 | DPU_REG_WRITE(&ctx->hw, SSPP_MULTIRECT_OPMODE + idx, mode_mask); |
| 198 | } | 197 | } |
| 199 | 198 | ||
| 200 | static void _sspp_setup_opmode(struct dpu_hw_pipe *ctx, | 199 | static void _sspp_setup_opmode(struct dpu_hw_sspp *ctx, |
| 201 | u32 mask, u8 en) | 200 | u32 mask, u8 en) |
| 202 | { | 201 | { |
| 203 | u32 idx; | 202 | u32 idx; |
| @@ -218,7 +217,7 @@ static void _sspp_setup_opmode(struct dpu_hw_pipe *ctx, · 14 unmodified lines | |||
| 218 | DPU_REG_WRITE(&ctx->hw, SSPP_VIG_OP_MODE + idx, opmode); | 217 | DPU_REG_WRITE(&ctx->hw, SSPP_VIG_OP_MODE + idx, opmode); |
| 219 | } | 218 | } |
| 220 | 219 | ||
| 221 | static void _sspp_setup_csc10_opmode(struct dpu_hw_pipe *ctx, | 220 | static void _sspp_setup_csc10_opmode(struct dpu_hw_sspp *ctx, |
| 222 | u32 mask, u8 en) | 221 | u32 mask, u8 en) |
| 223 | { | 222 | { |
| 224 | u32 idx; | 223 | u32 idx; |
| @@ -239,10 +238,10 @@ static void _sspp_setup_csc10_opmode(struct dpu_hw_pipe *ctx, · 14 unmodified lines | |||
| 239 | /* | 238 | /* |
| 240 | * Setup source pixel format, flip, | 239 | * Setup source pixel format, flip, |
| 241 | */ | 240 | */ |
| 242 | static void dpu_hw_sspp_setup_format(struct dpu_hw_pipe *ctx, | 241 | static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe, |
| 243 | const struct dpu_format *fmt, u32 flags, | 242 | const struct dpu_format *fmt, u32 flags) |
| 244 | enum dpu_sspp_multirect_index rect_mode) | ||
| 245 | { | 243 | { |
| 244 | struct dpu_hw_sspp *ctx = pipe->sspp; | ||
| 246 | struct dpu_hw_blk_reg_map *c; | 245 | struct dpu_hw_blk_reg_map *c; |
| 247 | u32 chroma_samp, unpack, src_format; | 246 | u32 chroma_samp, unpack, src_format; |
| 248 | u32 opmode = 0; | 247 | u32 opmode = 0; |
| @@ -253,7 +252,8 @@ static void dpu_hw_sspp_setup_format(struct dpu_hw_pipe *ctx, · 4 unmodified lines | |||
| 253 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx) || !fmt) | 252 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx) || !fmt) |
| 254 | return; | 253 | return; |
| 255 | 254 | ||
| 256 | if (rect_mode == DPU_SSPP_RECT_SOLO || rect_mode == DPU_SSPP_RECT_0) { | 255 | if (pipe->multirect_index == DPU_SSPP_RECT_SOLO || |
| 256 | pipe->multirect_index == DPU_SSPP_RECT_0) { | ||
| 257 | op_mode_off = SSPP_SRC_OP_MODE; | 257 | op_mode_off = SSPP_SRC_OP_MODE; |
| 258 | unpack_pat_off = SSPP_SRC_UNPACK_PATTERN; | 258 | unpack_pat_off = SSPP_SRC_UNPACK_PATTERN; |
| 259 | format_off = SSPP_SRC_FORMAT; | 259 | format_off = SSPP_SRC_FORMAT; |
| @@ -307,25 +307,25 @@ static void dpu_hw_sspp_setup_format(struct dpu_hw_pipe *ctx, · 47 unmodified lines | |||
| 307 | src_format |= (fmt->fetch_mode & 3) << 30; /*FRAME_FORMAT */ | 307 | src_format |= (fmt->fetch_mode & 3) << 30; /*FRAME_FORMAT */ |
| 308 | DPU_REG_WRITE(c, SSPP_FETCH_CONFIG, | 308 | DPU_REG_WRITE(c, SSPP_FETCH_CONFIG, |
| 309 | DPU_FETCH_CONFIG_RESET_VALUE | | 309 | DPU_FETCH_CONFIG_RESET_VALUE | |
| 310 | ctx->mdp->highest_bank_bit << 18); | 310 | ctx->ubwc->highest_bank_bit << 18); |
| 311 | switch (ctx->catalog->caps->ubwc_version) { | 311 | switch (ctx->ubwc->ubwc_version) { |
| 312 | case DPU_HW_UBWC_VER_10: | 312 | case DPU_HW_UBWC_VER_10: |
| 313 | fast_clear = fmt->alpha_enable ? BIT(31) : 0; | 313 | fast_clear = fmt->alpha_enable ? BIT(31) : 0; |
| 314 | DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, | 314 | DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, |
| 315 | fast_clear | (ctx->mdp->ubwc_swizzle & 0x1) | | 315 | fast_clear | (ctx->ubwc->ubwc_swizzle & 0x1) | |
| 316 | BIT(8) | | 316 | BIT(8) | |
| 317 | (ctx->mdp->highest_bank_bit << 4)); | 317 | (ctx->ubwc->highest_bank_bit << 4)); |
| 318 | break; | 318 | break; |
| 319 | case DPU_HW_UBWC_VER_20: | 319 | case DPU_HW_UBWC_VER_20: |
| 320 | fast_clear = fmt->alpha_enable ? BIT(31) : 0; | 320 | fast_clear = fmt->alpha_enable ? BIT(31) : 0; |
| 321 | DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, | 321 | DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, |
| 322 | fast_clear | (ctx->mdp->ubwc_swizzle) | | 322 | fast_clear | (ctx->ubwc->ubwc_swizzle) | |
| 323 | (ctx->mdp->highest_bank_bit << 4)); | 323 | (ctx->ubwc->highest_bank_bit << 4)); |
| 324 | break; | 324 | break; |
| 325 | case DPU_HW_UBWC_VER_30: | 325 | case DPU_HW_UBWC_VER_30: |
| 326 | DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, | 326 | DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, |
| 327 | BIT(30) | (ctx->mdp->ubwc_swizzle) | | 327 | BIT(30) | (ctx->ubwc->ubwc_swizzle) | |
| 328 | (ctx->mdp->highest_bank_bit << 4)); | 328 | (ctx->ubwc->highest_bank_bit << 4)); |
| 329 | break; | 329 | break; |
| 330 | case DPU_HW_UBWC_VER_40: | 330 | case DPU_HW_UBWC_VER_40: |
| 331 | DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, | 331 | DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, |
| @@ -360,7 +360,7 @@ static void dpu_hw_sspp_setup_format(struct dpu_hw_pipe *ctx, · 28 unmodified lines | |||
| 360 | DPU_REG_WRITE(c, SSPP_UBWC_ERROR_STATUS + idx, BIT(31)); | 360 | DPU_REG_WRITE(c, SSPP_UBWC_ERROR_STATUS + idx, BIT(31)); |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | static void dpu_hw_sspp_setup_pe_config(struct dpu_hw_pipe *ctx, | 363 | static void dpu_hw_sspp_setup_pe_config(struct dpu_hw_sspp *ctx, |
| 364 | struct dpu_hw_pixel_ext *pe_ext) | 364 | struct dpu_hw_pixel_ext *pe_ext) |
| 365 | { | 365 | { |
| 366 | struct dpu_hw_blk_reg_map *c; | 366 | struct dpu_hw_blk_reg_map *c; |
| @@ -418,23 +418,22 @@ static void dpu_hw_sspp_setup_pe_config(struct dpu_hw_pipe *ctx, · 51 unmodified lines | |||
| 418 | tot_req_pixels[3]); | 418 | tot_req_pixels[3]); |
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | static void _dpu_hw_sspp_setup_scaler3(struct dpu_hw_pipe *ctx, | 421 | static void _dpu_hw_sspp_setup_scaler3(struct dpu_hw_sspp *ctx, |
| 422 | struct dpu_hw_pipe_cfg *sspp, | 422 | struct dpu_hw_scaler3_cfg *scaler3_cfg, |
| 423 | void *scaler_cfg) | 423 | const struct dpu_format *format) |
| 424 | { | 424 | { |
| 425 | u32 idx; | 425 | u32 idx; |
| 426 | struct dpu_hw_scaler3_cfg *scaler3_cfg = scaler_cfg; | ||
| 427 | 426 | ||
| 428 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SCALER_QSEED3, &idx) || !sspp | 427 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SCALER_QSEED3, &idx) |
| 429 | || !scaler3_cfg) | 428 | || !scaler3_cfg) |
| 430 | return; | 429 | return; |
| 431 | 430 | ||
| 432 | dpu_hw_setup_scaler3(&ctx->hw, scaler3_cfg, idx, | 431 | dpu_hw_setup_scaler3(&ctx->hw, scaler3_cfg, idx, |
| 433 | ctx->cap->sblk->scaler_blk.version, | 432 | ctx->cap->sblk->scaler_blk.version, |
| 434 | sspp->layout.format); | 433 | format); |
| 435 | } | 434 | } |
| 436 | 435 | ||
| 437 | static u32 _dpu_hw_sspp_get_scaler3_ver(struct dpu_hw_pipe *ctx) | 436 | static u32 _dpu_hw_sspp_get_scaler3_ver(struct dpu_hw_sspp *ctx) |
| 438 | { | 437 | { |
| 439 | u32 idx; | 438 | u32 idx; |
| 440 | 439 | ||
| @@ -447,12 +446,12 @@ static u32 _dpu_hw_sspp_get_scaler3_ver(struct dpu_hw_pipe *ctx) · 6 unmodified lines | |||
| 447 | /* | 446 | /* |
| 448 | * dpu_hw_sspp_setup_rects() | 447 | * dpu_hw_sspp_setup_rects() |
| 449 | */ | 448 | */ |
| 450 | static void dpu_hw_sspp_setup_rects(struct dpu_hw_pipe *ctx, | 449 | static void dpu_hw_sspp_setup_rects(struct dpu_sw_pipe *pipe, |
| 451 | struct dpu_hw_pipe_cfg *cfg, | 450 | struct dpu_sw_pipe_cfg *cfg) |
| 452 | enum dpu_sspp_multirect_index rect_index) | ||
| 453 | { | 451 | { |
| 452 | struct dpu_hw_sspp *ctx = pipe->sspp; | ||
| 454 | struct dpu_hw_blk_reg_map *c; | 453 | struct dpu_hw_blk_reg_map *c; |
| 455 | u32 src_size, src_xy, dst_size, dst_xy, ystride0, ystride1; | 454 | u32 src_size, src_xy, dst_size, dst_xy; |
| 456 | u32 src_size_off, src_xy_off, out_size_off, out_xy_off; | 455 | u32 src_size_off, src_xy_off, out_size_off, out_xy_off; |
| 457 | u32 idx; | 456 | u32 idx; |
| 458 | 457 | ||
| @@ -461,7 +460,8 @@ static void dpu_hw_sspp_setup_rects(struct dpu_hw_pipe *ctx, · 2 unmodified lines | |||
| 461 | 460 | ||
| 462 | c = &ctx->hw; | 461 | c = &ctx->hw; |
| 463 | 462 | ||
| 464 | if (rect_index == DPU_SSPP_RECT_SOLO || rect_index == DPU_SSPP_RECT_0) { | 463 | if (pipe->multirect_index == DPU_SSPP_RECT_SOLO || |
| 464 | pipe->multirect_index == DPU_SSPP_RECT_0) { | ||
| 465 | src_size_off = SSPP_SRC_SIZE; | 465 | src_size_off = SSPP_SRC_SIZE; |
| 466 | src_xy_off = SSPP_SRC_XY; | 466 | src_xy_off = SSPP_SRC_XY; |
| 467 | out_size_off = SSPP_OUT_SIZE; | 467 | out_size_off = SSPP_OUT_SIZE; |
| @@ -482,68 +482,69 @@ static void dpu_hw_sspp_setup_rects(struct dpu_hw_pipe *ctx, · 14 unmodified lines | |||
| 482 | dst_size = (drm_rect_height(&cfg->dst_rect) << 16) | | 482 | dst_size = (drm_rect_height(&cfg->dst_rect) << 16) | |
| 483 | drm_rect_width(&cfg->dst_rect); | 483 | drm_rect_width(&cfg->dst_rect); |
| 484 | 484 | ||
| 485 | if (rect_index == DPU_SSPP_RECT_SOLO) { | ||
| 486 | ystride0 = (cfg->layout.plane_pitch[0]) | | ||
| 487 | (cfg->layout.plane_pitch[1] << 16); | ||
| 488 | ystride1 = (cfg->layout.plane_pitch[2]) | | ||
| 489 | (cfg->layout.plane_pitch[3] << 16); | ||
| 490 | } else { | ||
| 491 | ystride0 = DPU_REG_READ(c, SSPP_SRC_YSTRIDE0 + idx); | ||
| 492 | ystride1 = DPU_REG_READ(c, SSPP_SRC_YSTRIDE1 + idx); | ||
| 493 | |||
| 494 | if (rect_index == DPU_SSPP_RECT_0) { | ||
| 495 | ystride0 = (ystride0 & 0xFFFF0000) | | ||
| 496 | (cfg->layout.plane_pitch[0] & 0x0000FFFF); | ||
| 497 | ystride1 = (ystride1 & 0xFFFF0000)| | ||
| 498 | (cfg->layout.plane_pitch[2] & 0x0000FFFF); | ||
| 499 | } else { | ||
| 500 | ystride0 = (ystride0 & 0x0000FFFF) | | ||
| 501 | ((cfg->layout.plane_pitch[0] << 16) & | ||
| 502 | 0xFFFF0000); | ||
| 503 | ystride1 = (ystride1 & 0x0000FFFF) | | ||
| 504 | ((cfg->layout.plane_pitch[2] << 16) & | ||
| 505 | 0xFFFF0000); | ||
| 506 | } | ||
| 507 | } | ||
| 508 | |||
| 509 | /* rectangle register programming */ | 485 | /* rectangle register programming */ |
| 510 | DPU_REG_WRITE(c, src_size_off + idx, src_size); | 486 | DPU_REG_WRITE(c, src_size_off + idx, src_size); |
| 511 | DPU_REG_WRITE(c, src_xy_off + idx, src_xy); | 487 | DPU_REG_WRITE(c, src_xy_off + idx, src_xy); |
| 512 | DPU_REG_WRITE(c, out_size_off + idx, dst_size); | 488 | DPU_REG_WRITE(c, out_size_off + idx, dst_size); |
| 513 | DPU_REG_WRITE(c, out_xy_off + idx, dst_xy); | 489 | DPU_REG_WRITE(c, out_xy_off + idx, dst_xy); |
| 514 | |||
| 515 | DPU_REG_WRITE(c, SSPP_SRC_YSTRIDE0 + idx, ystride0); | ||
| 516 | DPU_REG_WRITE(c, SSPP_SRC_YSTRIDE1 + idx, ystride1); | ||
| 517 | } | 490 | } |
| 518 | 491 | ||
| 519 | static void dpu_hw_sspp_setup_sourceaddress(struct dpu_hw_pipe *ctx, | 492 | static void dpu_hw_sspp_setup_sourceaddress(struct dpu_sw_pipe *pipe, |
| 520 | struct dpu_hw_pipe_cfg *cfg, | 493 | struct dpu_hw_fmt_layout *layout) |
| 521 | enum dpu_sspp_multirect_index rect_mode) | ||
| 522 | { | 494 | { |
| 495 | struct dpu_hw_sspp *ctx = pipe->sspp; | ||
| 496 | u32 ystride0, ystride1; | ||
| 523 | int i; | 497 | int i; |
| 524 | u32 idx; | 498 | u32 idx; |
| 525 | 499 | ||
| 526 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) | 500 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) |
| 527 | return; | 501 | return; |
| 528 | 502 | ||
| 529 | if (rect_mode == DPU_SSPP_RECT_SOLO) { | 503 | if (pipe->multirect_index == DPU_SSPP_RECT_SOLO) { |
| 530 | for (i = 0; i < ARRAY_SIZE(cfg->layout.plane_addr); i++) | 504 | for (i = 0; i < ARRAY_SIZE(layout->plane_addr); i++) |
| 531 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC0_ADDR + idx + i * 0x4, | 505 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC0_ADDR + idx + i * 0x4, |
| 532 | cfg->layout.plane_addr[i]); | 506 | layout->plane_addr[i]); |
| 533 | } else if (rect_mode == DPU_SSPP_RECT_0) { | 507 | } else if (pipe->multirect_index == DPU_SSPP_RECT_0) { |
| 534 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC0_ADDR + idx, | 508 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC0_ADDR + idx, |
| 535 | cfg->layout.plane_addr[0]); | 509 | layout->plane_addr[0]); |
| 536 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC2_ADDR + idx, | 510 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC2_ADDR + idx, |
| 537 | cfg->layout.plane_addr[2]); | 511 | layout->plane_addr[2]); |
| 538 | } else { | 512 | } else { |
| 539 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC1_ADDR + idx, | 513 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC1_ADDR + idx, |
| 540 | cfg->layout.plane_addr[0]); | 514 | layout->plane_addr[0]); |
| 541 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC3_ADDR + idx, | 515 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC3_ADDR + idx, |
| 542 | cfg->layout.plane_addr[2]); | 516 | layout->plane_addr[2]); |
| 543 | } | 517 | } |
| 518 | |||
| 519 | if (pipe->multirect_index == DPU_SSPP_RECT_SOLO) { | ||
| 520 | ystride0 = (layout->plane_pitch[0]) | | ||
| 521 | (layout->plane_pitch[1] << 16); | ||
| 522 | ystride1 = (layout->plane_pitch[2]) | | ||
| 523 | (layout->plane_pitch[3] << 16); | ||
| 524 | } else { | ||
| 525 | ystride0 = DPU_REG_READ(&ctx->hw, SSPP_SRC_YSTRIDE0 + idx); | ||
| 526 | ystride1 = DPU_REG_READ(&ctx->hw, SSPP_SRC_YSTRIDE1 + idx); | ||
| 527 | |||
| 528 | if (pipe->multirect_index == DPU_SSPP_RECT_0) { | ||
| 529 | ystride0 = (ystride0 & 0xFFFF0000) | | ||
| 530 | (layout->plane_pitch[0] & 0x0000FFFF); | ||
| 531 | ystride1 = (ystride1 & 0xFFFF0000)| | ||
| 532 | (layout->plane_pitch[2] & 0x0000FFFF); | ||
| 533 | } else { | ||
| 534 | ystride0 = (ystride0 & 0x0000FFFF) | | ||
| 535 | ((layout->plane_pitch[0] << 16) & | ||
| 536 | 0xFFFF0000); | ||
| 537 | ystride1 = (ystride1 & 0x0000FFFF) | | ||
| 538 | ((layout->plane_pitch[2] << 16) & | ||
| 539 | 0xFFFF0000); | ||
| 540 | } | ||
| 541 | } | ||
| 542 | |||
| 543 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC_YSTRIDE0 + idx, ystride0); | ||
| 544 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC_YSTRIDE1 + idx, ystride1); | ||
| 544 | } | 545 | } |
| 545 | 546 | ||
| 546 | static void dpu_hw_sspp_setup_csc(struct dpu_hw_pipe *ctx, | 547 | static void dpu_hw_sspp_setup_csc(struct dpu_hw_sspp *ctx, |
| 547 | const struct dpu_csc_cfg *data) | 548 | const struct dpu_csc_cfg *data) |
| 548 | { | 549 | { |
| 549 | u32 idx; | 550 | u32 idx; |
| @@ -560,22 +561,28 @@ static void dpu_hw_sspp_setup_csc(struct dpu_hw_pipe *ctx, · 10 unmodified lines | |||
| 560 | dpu_hw_csc_setup(&ctx->hw, idx, data, csc10); | 561 | dpu_hw_csc_setup(&ctx->hw, idx, data, csc10); |
| 561 | } | 562 | } |
| 562 | 563 | ||
| 563 | static void dpu_hw_sspp_setup_solidfill(struct dpu_hw_pipe *ctx, u32 color, enum | 564 | static void dpu_hw_sspp_setup_solidfill(struct dpu_sw_pipe *pipe, u32 color) |
| 564 | dpu_sspp_multirect_index rect_index) | ||
| 565 | { | 565 | { |
| 566 | struct dpu_hw_sspp *ctx = pipe->sspp; | ||
| 567 | struct dpu_hw_fmt_layout cfg; | ||
| 566 | u32 idx; | 568 | u32 idx; |
| 567 | 569 | ||
| 568 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) | 570 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) |
| 569 | return; | 571 | return; |
| 570 | 572 | ||
| 571 | if (rect_index == DPU_SSPP_RECT_SOLO || rect_index == DPU_SSPP_RECT_0) | 573 | /* cleanup source addresses */ |
| 574 | memset(&cfg, 0, sizeof(cfg)); | ||
| 575 | ctx->ops.setup_sourceaddress(pipe, &cfg); | ||
| 576 | |||
| 577 | if (pipe->multirect_index == DPU_SSPP_RECT_SOLO || | ||
| 578 | pipe->multirect_index == DPU_SSPP_RECT_0) | ||
| 572 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC_CONSTANT_COLOR + idx, color); | 579 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC_CONSTANT_COLOR + idx, color); |
| 573 | else | 580 | else |
| 574 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC_CONSTANT_COLOR_REC1 + idx, | 581 | DPU_REG_WRITE(&ctx->hw, SSPP_SRC_CONSTANT_COLOR_REC1 + idx, |
| 575 | color); | 582 | color); |
| 576 | } | 583 | } |
| 577 | 584 | ||
| 578 | static void dpu_hw_sspp_setup_danger_safe_lut(struct dpu_hw_pipe *ctx, | 585 | static void dpu_hw_sspp_setup_danger_safe_lut(struct dpu_hw_sspp *ctx, |
| 579 | u32 danger_lut, | 586 | u32 danger_lut, |
| 580 | u32 safe_lut) | 587 | u32 safe_lut) |
| 581 | { | 588 | { |
| @@ -588,7 +595,7 @@ static void dpu_hw_sspp_setup_danger_safe_lut(struct dpu_hw_pipe *ctx, · 6 unmodified lines | |||
| 588 | DPU_REG_WRITE(&ctx->hw, SSPP_SAFE_LUT + idx, safe_lut); | 595 | DPU_REG_WRITE(&ctx->hw, SSPP_SAFE_LUT + idx, safe_lut); |
| 589 | } | 596 | } |
| 590 | 597 | ||
| 591 | static void dpu_hw_sspp_setup_creq_lut(struct dpu_hw_pipe *ctx, | 598 | static void dpu_hw_sspp_setup_creq_lut(struct dpu_hw_sspp *ctx, |
| 592 | u64 creq_lut) | 599 | u64 creq_lut) |
| 593 | { | 600 | { |
| 594 | u32 idx; | 601 | u32 idx; |
| @@ -605,7 +612,7 @@ static void dpu_hw_sspp_setup_creq_lut(struct dpu_hw_pipe *ctx, · 10 unmodified lines | |||
| 605 | } | 612 | } |
| 606 | } | 613 | } |
| 607 | 614 | ||
| 608 | static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_pipe *ctx, | 615 | static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_sspp *ctx, |
| 609 | struct dpu_hw_pipe_qos_cfg *cfg) | 616 | struct dpu_hw_pipe_qos_cfg *cfg) |
| 610 | { | 617 | { |
| 611 | u32 idx; | 618 | u32 idx; |
| @@ -630,10 +637,10 @@ static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_pipe *ctx, · 18 unmodified lines | |||
| 630 | DPU_REG_WRITE(&ctx->hw, SSPP_QOS_CTRL + idx, qos_ctrl); | 637 | DPU_REG_WRITE(&ctx->hw, SSPP_QOS_CTRL + idx, qos_ctrl); |
| 631 | } | 638 | } |
| 632 | 639 | ||
| 633 | static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx, | 640 | static void dpu_hw_sspp_setup_cdp(struct dpu_sw_pipe *pipe, |
| 634 | struct dpu_hw_cdp_cfg *cfg, | 641 | struct dpu_hw_cdp_cfg *cfg) |
| 635 | enum dpu_sspp_multirect_index index) | ||
| 636 | { | 642 | { |
| 643 | struct dpu_hw_sspp *ctx = pipe->sspp; | ||
| 637 | u32 idx; | 644 | u32 idx; |
| 638 | u32 cdp_cntl = 0; | 645 | u32 cdp_cntl = 0; |
| 639 | u32 cdp_cntl_offset = 0; | 646 | u32 cdp_cntl_offset = 0; |
| @@ -644,7 +651,8 @@ static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx, · 4 unmodified lines | |||
| 644 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) | 651 | if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) |
| 645 | return; | 652 | return; |
| 646 | 653 | ||
| 647 | if (index == DPU_SSPP_RECT_SOLO || index == DPU_SSPP_RECT_0) | 654 | if (pipe->multirect_index == DPU_SSPP_RECT_SOLO || |
| 655 | pipe->multirect_index == DPU_SSPP_RECT_0) | ||
| 648 | cdp_cntl_offset = SSPP_CDP_CNTL; | 656 | cdp_cntl_offset = SSPP_CDP_CNTL; |
| 649 | else | 657 | else |
| 650 | cdp_cntl_offset = SSPP_CDP_CNTL_REC1; | 658 | cdp_cntl_offset = SSPP_CDP_CNTL_REC1; |
| @@ -661,7 +669,7 @@ static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx, · 10 unmodified lines | |||
| 661 | DPU_REG_WRITE(&ctx->hw, cdp_cntl_offset, cdp_cntl); | 669 | DPU_REG_WRITE(&ctx->hw, cdp_cntl_offset, cdp_cntl); |
| 662 | } | 670 | } |
| 663 | 671 | ||
| 664 | static void _setup_layer_ops(struct dpu_hw_pipe *c, | 672 | static void _setup_layer_ops(struct dpu_hw_sspp *c, |
| 665 | unsigned long features) | 673 | unsigned long features) |
| 666 | { | 674 | { |
| 667 | if (test_bit(DPU_SSPP_SRC, &features)) { | 675 | if (test_bit(DPU_SSPP_SRC, &features)) { |
| @@ -699,7 +707,8 @@ static void _setup_layer_ops(struct dpu_hw_pipe *c, · 31 unmodified lines | |||
| 699 | } | 707 | } |
| 700 | 708 | ||
| 701 | #ifdef CONFIG_DEBUG_FS | 709 | #ifdef CONFIG_DEBUG_FS |
| 702 | int _dpu_hw_sspp_init_debugfs(struct dpu_hw_pipe *hw_pipe, struct dpu_kms *kms, struct dentry *entry) | 710 | int _dpu_hw_sspp_init_debugfs(struct dpu_hw_sspp *hw_pipe, struct dpu_kms *kms, |
| 711 | struct dentry *entry) | ||
| 703 | { | 712 | { |
| 704 | const struct dpu_sspp_cfg *cfg = hw_pipe->cap; | 713 | const struct dpu_sspp_cfg *cfg = hw_pipe->cap; |
| 705 | const struct dpu_sspp_sub_blks *sblk = cfg->sblk; | 714 | const struct dpu_sspp_sub_blks *sblk = cfg->sblk; |
| @@ -783,10 +792,10 @@ static const struct dpu_sspp_cfg *_sspp_offset(enum dpu_sspp sspp, · 77 unmodified lines | |||
| 783 | return ERR_PTR(-ENOMEM); | 792 | return ERR_PTR(-ENOMEM); |
| 784 | } | 793 | } |
| 785 | 794 | ||
| 786 | struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx, | 795 | struct dpu_hw_sspp *dpu_hw_sspp_init(enum dpu_sspp idx, |
| 787 | void __iomem *addr, const struct dpu_mdss_cfg *catalog) | 796 | void __iomem *addr, const struct dpu_mdss_cfg *catalog) |
| 788 | { | 797 | { |
| 789 | struct dpu_hw_pipe *hw_pipe; | 798 | struct dpu_hw_sspp *hw_pipe; |
| 790 | const struct dpu_sspp_cfg *cfg; | 799 | const struct dpu_sspp_cfg *cfg; |
| 791 | 800 | ||
| 792 | if (!addr || !catalog) | 801 | if (!addr || !catalog) |
| @@ -804,7 +813,7 @@ struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx, · 11 unmodified lines | |||
| 804 | 813 | ||
| 805 | /* Assign ops */ | 814 | /* Assign ops */ |
| 806 | hw_pipe->catalog = catalog; | 815 | hw_pipe->catalog = catalog; |
| 807 | hw_pipe->mdp = &catalog->mdp[0]; | 816 | hw_pipe->ubwc = catalog->ubwc; |
| 808 | hw_pipe->idx = idx; | 817 | hw_pipe->idx = idx; |
| 809 | hw_pipe->cap = cfg; | 818 | hw_pipe->cap = cfg; |
| 810 | _setup_layer_ops(hw_pipe, hw_pipe->cap->features); | 819 | _setup_layer_ops(hw_pipe, hw_pipe->cap->features); |
| @@ -812,7 +821,7 @@ struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx, · 1 unmodified line | |||
| 812 | return hw_pipe; | 821 | return hw_pipe; |
| 813 | } | 822 | } |
| 814 | 823 | ||
| 815 | void dpu_hw_sspp_destroy(struct dpu_hw_pipe *ctx) | 824 | void dpu_hw_sspp_destroy(struct dpu_hw_sspp *ctx) |
| 816 | { | 825 | { |
| 817 | kfree(ctx); | 826 | kfree(ctx); |
| 818 | } | 827 | } |
| @@ -10,7 +10,7 @@ · 9 unmodified lines | |||
| 10 | #include "dpu_hw_util.h" | 10 | #include "dpu_hw_util.h" |
| 11 | #include "dpu_formats.h" | 11 | #include "dpu_formats.h" |
| 12 | 12 | ||
| 13 | struct dpu_hw_pipe; | 13 | struct dpu_hw_sspp; |
| 14 | 14 | ||
| 15 | /** | 15 | /** |
| 16 | * Flags | 16 | * Flags |
| @@ -153,20 +153,14 @@ struct dpu_hw_pixel_ext { · 136 unmodified lines | |||
| 153 | }; | 153 | }; |
| 154 | 154 | ||
| 155 | /** | 155 | /** |
| 156 | * struct dpu_hw_pipe_cfg : Pipe description | 156 | * struct dpu_sw_pipe_cfg : software pipe configuration |
| 157 | * @layout: format layout information for programming buffer to hardware | ||
| 158 | * @src_rect: src ROI, caller takes into account the different operations | 157 | * @src_rect: src ROI, caller takes into account the different operations |
| 159 | * such as decimation, flip etc to program this field | 158 | * such as decimation, flip etc to program this field |
| 160 | * @dest_rect: destination ROI. | 159 | * @dest_rect: destination ROI. |
| 161 | * @index: index of the rectangle of SSPP | ||
| 162 | * @mode: parallel or time multiplex multirect mode | ||
| 163 | */ | 160 | */ |
| 164 | struct dpu_hw_pipe_cfg { | 161 | struct dpu_sw_pipe_cfg { |
| 165 | struct dpu_hw_fmt_layout layout; | ||
| 166 | struct drm_rect src_rect; | 162 | struct drm_rect src_rect; |
| 167 | struct drm_rect dst_rect; | 163 | struct drm_rect dst_rect; |
| 168 | enum dpu_sspp_multirect_index index; | ||
| 169 | enum dpu_sspp_multirect_mode mode; | ||
| 170 | }; | 164 | }; |
| 171 | 165 | ||
| 172 | /** | 166 | /** |
| @@ -201,6 +195,18 @@ struct dpu_hw_pipe_ts_cfg { · 28 unmodified lines | |||
| 201 | u64 time; | 195 | u64 time; |
| 202 | }; | 196 | }; |
| 203 | 197 | ||
| 198 | /** | ||
| 199 | * struct dpu_sw_pipe - software pipe description | ||
| 200 | * @sspp: backing SSPP pipe | ||
| 201 | * @index: index of the rectangle of SSPP | ||
| 202 | * @mode: parallel or time multiplex multirect mode | ||
| 203 | */ | ||
| 204 | struct dpu_sw_pipe { | ||
| 205 | struct dpu_hw_sspp *sspp; | ||
| 206 | enum dpu_sspp_multirect_index multirect_index; | ||
| 207 | enum dpu_sspp_multirect_mode multirect_mode; | ||
| 208 | }; | ||
| 209 | |||
| 204 | /** | 210 | /** |
| 205 | * struct dpu_hw_sspp_ops - interface to the SSPP Hw driver functions | 211 | * struct dpu_hw_sspp_ops - interface to the SSPP Hw driver functions |
| 206 | * Caller must call the init function to get the pipe context for each pipe | 212 | * Caller must call the init function to get the pipe context for each pipe |
| @@ -209,77 +215,65 @@ struct dpu_hw_pipe_ts_cfg { · 2 unmodified lines | |||
| 209 | struct dpu_hw_sspp_ops { | 215 | struct dpu_hw_sspp_ops { |
| 210 | /** | 216 | /** |
| 211 | * setup_format - setup pixel format cropping rectangle, flip | 217 | * setup_format - setup pixel format cropping rectangle, flip |
| 212 | * @ctx: Pointer to pipe context | 218 | * @pipe: Pointer to software pipe context |
| 213 | * @cfg: Pointer to pipe config structure | 219 | * @cfg: Pointer to pipe config structure |
| 214 | * @flags: Extra flags for format config | 220 | * @flags: Extra flags for format config |
| 215 | * @index: rectangle index in multirect | ||
| 216 | */ | 221 | */ |
| 217 | void (*setup_format)(struct dpu_hw_pipe *ctx, | 222 | void (*setup_format)(struct dpu_sw_pipe *pipe, |
| 218 | const struct dpu_format *fmt, u32 flags, | 223 | const struct dpu_format *fmt, u32 flags); |
| 219 | enum dpu_sspp_multirect_index index); | ||
| 220 | 224 | ||
| 221 | /** | 225 | /** |
| 222 | * setup_rects - setup pipe ROI rectangles | 226 | * setup_rects - setup pipe ROI rectangles |
| 223 | * @ctx: Pointer to pipe context | 227 | * @pipe: Pointer to software pipe context |
| 224 | * @cfg: Pointer to pipe config structure | 228 | * @cfg: Pointer to pipe config structure |
| 225 | * @index: rectangle index in multirect | ||
| 226 | */ | 229 | */ |
| 227 | void (*setup_rects)(struct dpu_hw_pipe *ctx, | 230 | void (*setup_rects)(struct dpu_sw_pipe *pipe, |
| 228 | struct dpu_hw_pipe_cfg *cfg, | 231 | struct dpu_sw_pipe_cfg *cfg); |
| 229 | enum dpu_sspp_multirect_index index); | ||
| 230 | 232 | ||
| 231 | /** | 233 | /** |
| 232 | * setup_pe - setup pipe pixel extension | 234 | * setup_pe - setup pipe pixel extension |
| 233 | * @ctx: Pointer to pipe context | 235 | * @ctx: Pointer to pipe context |
| 234 | * @pe_ext: Pointer to pixel ext settings | 236 | * @pe_ext: Pointer to pixel ext settings |
| 235 | */ | 237 | */ |
| 236 | void (*setup_pe)(struct dpu_hw_pipe *ctx, | 238 | void (*setup_pe)(struct dpu_hw_sspp *ctx, |
| 237 | struct dpu_hw_pixel_ext *pe_ext); | 239 | struct dpu_hw_pixel_ext *pe_ext); |
| 238 | 240 | ||
| 239 | /** | 241 | /** |
| 240 | * setup_sourceaddress - setup pipe source addresses | 242 | * setup_sourceaddress - setup pipe source addresses |
| 241 | * @ctx: Pointer to pipe context | 243 | * @pipe: Pointer to software pipe context |
| 242 | * @cfg: Pointer to pipe config structure | 244 | * @layout: format layout information for programming buffer to hardware |
| 243 | * @index: rectangle index in multirect | ||
| 244 | */ | 245 | */ |
| 245 | void (*setup_sourceaddress)(struct dpu_hw_pipe *ctx, | 246 | void (*setup_sourceaddress)(struct dpu_sw_pipe *ctx, |
| 246 | struct dpu_hw_pipe_cfg *cfg, | 247 | struct dpu_hw_fmt_layout *layout); |
| 247 | enum dpu_sspp_multirect_index index); | ||
| 248 | 248 | ||
| 249 | /** | 249 | /** |
| 250 | * setup_csc - setup color space coversion | 250 | * setup_csc - setup color space coversion |
| 251 | * @ctx: Pointer to pipe context | 251 | * @ctx: Pointer to pipe context |
| 252 | * @data: Pointer to config structure | 252 | * @data: Pointer to config structure |
| 253 | */ | 253 | */ |
| 254 | void (*setup_csc)(struct dpu_hw_pipe *ctx, const struct dpu_csc_cfg *data); | 254 | void (*setup_csc)(struct dpu_hw_sspp *ctx, const struct dpu_csc_cfg *data); |
| 255 | 255 | ||
| 256 | /** | 256 | /** |
| 257 | * setup_solidfill - enable/disable colorfill | 257 | * setup_solidfill - enable/disable colorfill |
| 258 | * @ctx: Pointer to pipe context | 258 | * @pipe: Pointer to software pipe context |
| 259 | * @const_color: Fill color value | 259 | * @const_color: Fill color value |
| 260 | * @flags: Pipe flags | 260 | * @flags: Pipe flags |
| 261 | * @index: rectangle index in multirect | ||
| 262 | */ | 261 | */ |
| 263 | void (*setup_solidfill)(struct dpu_hw_pipe *ctx, u32 color, | 262 | void (*setup_solidfill)(struct dpu_sw_pipe *pipe, u32 color); |
| 264 | enum dpu_sspp_multirect_index index); | ||
| 265 | 263 | ||
| 266 | /** | 264 | /** |
| 267 | * setup_multirect - setup multirect configuration | 265 | * setup_multirect - setup multirect configuration |
| 268 | * @ctx: Pointer to pipe context | 266 | * @pipe: Pointer to software pipe context |
| 269 | * @index: rectangle index in multirect | ||
| 270 | * @mode: parallel fetch / time multiplex multirect mode | ||
| 271 | */ | 267 | */ |
| 272 | 268 | ||
| 273 | void (*setup_multirect)(struct dpu_hw_pipe *ctx, | 269 | void (*setup_multirect)(struct dpu_sw_pipe *pipe); |
| 274 | enum dpu_sspp_multirect_index index, | ||
| 275 | enum dpu_sspp_multirect_mode mode); | ||
| 276 | 270 | ||
| 277 | /** | 271 | /** |
| 278 | * setup_sharpening - setup sharpening | 272 | * setup_sharpening - setup sharpening |
| 279 | * @ctx: Pointer to pipe context | 273 | * @ctx: Pointer to pipe context |
| 280 | * @cfg: Pointer to config structure | 274 | * @cfg: Pointer to config structure |
| 281 | */ | 275 | */ |
| 282 | void (*setup_sharpening)(struct dpu_hw_pipe *ctx, | 276 | void (*setup_sharpening)(struct dpu_hw_sspp *ctx, |
| 283 | struct dpu_hw_sharp_cfg *cfg); | 277 | struct dpu_hw_sharp_cfg *cfg); |
| 284 | 278 | ||
| 285 | /** | 279 | /** |
| @@ -289,7 +283,7 @@ struct dpu_hw_sspp_ops { · 3 unmodified lines | |||
| 289 | * @safe_lut: LUT for generate safe level based on fill level | 283 | * @safe_lut: LUT for generate safe level based on fill level |
| 290 | * | 284 | * |
| 291 | */ | 285 | */ |
| 292 | void (*setup_danger_safe_lut)(struct dpu_hw_pipe *ctx, | 286 | void (*setup_danger_safe_lut)(struct dpu_hw_sspp *ctx, |
| 293 | u32 danger_lut, | 287 | u32 danger_lut, |
| 294 | u32 safe_lut); | 288 | u32 safe_lut); |
| 295 | 289 | ||
| @@ -299,7 +293,7 @@ struct dpu_hw_sspp_ops { · 3 unmodified lines | |||
| 299 | * @creq_lut: LUT for generate creq level based on fill level | 293 | * @creq_lut: LUT for generate creq level based on fill level |
| 300 | * | 294 | * |
| 301 | */ | 295 | */ |
| 302 | void (*setup_creq_lut)(struct dpu_hw_pipe *ctx, | 296 | void (*setup_creq_lut)(struct dpu_hw_sspp *ctx, |
| 303 | u64 creq_lut); | 297 | u64 creq_lut); |
| 304 | 298 | ||
| 305 | /** | 299 | /** |
| @@ -308,7 +302,7 @@ struct dpu_hw_sspp_ops { · 2 unmodified lines | |||
| 308 | * @cfg: Pointer to pipe QoS configuration | 302 | * @cfg: Pointer to pipe QoS configuration |
| 309 | * | 303 | * |
| 310 | */ | 304 | */ |
| 311 | void (*setup_qos_ctrl)(struct dpu_hw_pipe *ctx, | 305 | void (*setup_qos_ctrl)(struct dpu_hw_sspp *ctx, |
| 312 | struct dpu_hw_pipe_qos_cfg *cfg); | 306 | struct dpu_hw_pipe_qos_cfg *cfg); |
| 313 | 307 | ||
| 314 | /** | 308 | /** |
| @@ -316,51 +310,48 @@ struct dpu_hw_sspp_ops { · 1 unmodified line | |||
| 316 | * @ctx: Pointer to pipe context | 310 | * @ctx: Pointer to pipe context |
| 317 | * @cfg: Pointer to histogram configuration | 311 | * @cfg: Pointer to histogram configuration |
| 318 | */ | 312 | */ |
| 319 | void (*setup_histogram)(struct dpu_hw_pipe *ctx, | 313 | void (*setup_histogram)(struct dpu_hw_sspp *ctx, |
| 320 | void *cfg); | 314 | void *cfg); |
| 321 | 315 | ||
| 322 | /** | 316 | /** |
| 323 | * setup_scaler - setup scaler | 317 | * setup_scaler - setup scaler |
| 324 | * @ctx: Pointer to pipe context | 318 | * @scaler3_cfg: Pointer to scaler configuration |
| 325 | * @pipe_cfg: Pointer to pipe configuration | 319 | * @format: pixel format parameters |
| 326 | * @scaler_cfg: Pointer to scaler configuration | ||
| 327 | */ | 320 | */ |
| 328 | void (*setup_scaler)(struct dpu_hw_pipe *ctx, | 321 | void (*setup_scaler)(struct dpu_hw_sspp *ctx, |
| 329 | struct dpu_hw_pipe_cfg *pipe_cfg, | 322 | struct dpu_hw_scaler3_cfg *scaler3_cfg, |
| 330 | void *scaler_cfg); | 323 | const struct dpu_format *format); |
| 331 | 324 | ||
| 332 | /** | 325 | /** |
| 333 | * get_scaler_ver - get scaler h/w version | 326 | * get_scaler_ver - get scaler h/w version |
| 334 | * @ctx: Pointer to pipe context | 327 | * @ctx: Pointer to pipe context |
| 335 | */ | 328 | */ |
| 336 | u32 (*get_scaler_ver)(struct dpu_hw_pipe *ctx); | 329 | u32 (*get_scaler_ver)(struct dpu_hw_sspp *ctx); |
| 337 | 330 | ||
| 338 | /** | 331 | /** |
| 339 | * setup_cdp - setup client driven prefetch | 332 | * setup_cdp - setup client driven prefetch |
| 340 | * @ctx: Pointer to pipe context | 333 | * @pipe: Pointer to software pipe context |
| 341 | * @cfg: Pointer to cdp configuration | 334 | * @cfg: Pointer to cdp configuration |
| 342 | * @index: rectangle index in multirect | ||
| 343 | */ | 335 | */ |
| 344 | void (*setup_cdp)(struct dpu_hw_pipe *ctx, | 336 | void (*setup_cdp)(struct dpu_sw_pipe *pipe, |
| 345 | struct dpu_hw_cdp_cfg *cfg, | 337 | struct dpu_hw_cdp_cfg *cfg); |
| 346 | enum dpu_sspp_multirect_index index); | ||
| 347 | }; | 338 | }; |
| 348 | 339 | ||
| 349 | /** | 340 | /** |
| 350 | * struct dpu_hw_pipe - pipe description | 341 | * struct dpu_hw_sspp - pipe description |
| 351 | * @base: hardware block base structure | 342 | * @base: hardware block base structure |
| 352 | * @hw: block hardware details | 343 | * @hw: block hardware details |
| 353 | * @catalog: back pointer to catalog | 344 | * @catalog: back pointer to catalog |
| 354 | * @mdp: pointer to associated mdp portion of the catalog | 345 | * @ubwc: ubwc configuration data |
| 355 | * @idx: pipe index | 346 | * @idx: pipe index |
| 356 | * @cap: pointer to layer_cfg | 347 | * @cap: pointer to layer_cfg |
| 357 | * @ops: pointer to operations possible for this pipe | 348 | * @ops: pointer to operations possible for this pipe |
| 358 | */ | 349 | */ |
| 359 | struct dpu_hw_pipe { | 350 | struct dpu_hw_sspp { |
| 360 | struct dpu_hw_blk base; | 351 | struct dpu_hw_blk base; |
| 361 | struct dpu_hw_blk_reg_map hw; | 352 | struct dpu_hw_blk_reg_map hw; |
| 362 | const struct dpu_mdss_cfg *catalog; | 353 | const struct dpu_mdss_cfg *catalog; |
| 363 | const struct dpu_mdp_cfg *mdp; | 354 | const struct dpu_ubwc_cfg *ubwc; |
| 364 | 355 | ||
| 365 | /* Pipe */ | 356 | /* Pipe */ |
| 366 | enum dpu_sspp idx; | 357 | enum dpu_sspp idx; |
| @@ -378,7 +369,7 @@ struct dpu_kms; · 11 unmodified lines | |||
| 378 | * @addr: Mapped register io address of MDP | 369 | * @addr: Mapped register io address of MDP |
| 379 | * @catalog : Pointer to mdss catalog data | 370 | * @catalog : Pointer to mdss catalog data |
| 380 | */ | 371 | */ |
| 381 | struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx, | 372 | struct dpu_hw_sspp *dpu_hw_sspp_init(enum dpu_sspp idx, |
| 382 | void __iomem *addr, const struct dpu_mdss_cfg *catalog); | 373 | void __iomem *addr, const struct dpu_mdss_cfg *catalog); |
| 383 | 374 | ||
| 384 | /** | 375 | /** |
| @@ -386,10 +377,10 @@ struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx, · 1 unmodified line | |||
| 386 | * should be called during Hw pipe cleanup. | 377 | * should be called during Hw pipe cleanup. |
| 387 | * @ctx: Pointer to SSPP driver context returned by dpu_hw_sspp_init | 378 | * @ctx: Pointer to SSPP driver context returned by dpu_hw_sspp_init |
| 388 | */ | 379 | */ |
| 389 | void dpu_hw_sspp_destroy(struct dpu_hw_pipe *ctx); | 380 | void dpu_hw_sspp_destroy(struct dpu_hw_sspp *ctx); |
| 390 | 381 | ||
| 391 | void dpu_debugfs_sspp_init(struct dpu_kms *dpu_kms, struct dentry *debugfs_root); | 382 | int _dpu_hw_sspp_init_debugfs(struct dpu_hw_sspp *hw_pipe, struct dpu_kms *kms, |
| 392 | int _dpu_hw_sspp_init_debugfs(struct dpu_hw_pipe *hw_pipe, struct dpu_kms *kms, struct dentry *entry); | 383 | struct dentry *entry); |
| 393 | 384 | ||
| 394 | #endif /*_DPU_HW_SSPP_H */ | 385 | #endif /*_DPU_HW_SSPP_H */ |
| 395 | 386 | ||
| @@ -250,6 +250,24 @@ void dpu_debugfs_create_regset32(const char *name, umode_t mode, · 249 unmodified lines | |||
| 250 | debugfs_create_file(name, mode, parent, regset, &dpu_regset32_fops); | 250 | debugfs_create_file(name, mode, parent, regset, &dpu_regset32_fops); |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | static void dpu_debugfs_sspp_init(struct dpu_kms *dpu_kms, struct dentry *debugfs_root) | ||
| 254 | { | ||
| 255 | struct dentry *entry = debugfs_create_dir("sspp", debugfs_root); | ||
| 256 | int i; | ||
| 257 | |||
| 258 | if (IS_ERR(entry)) | ||
| 259 | return; | ||
| 260 | |||
| 261 | for (i = SSPP_NONE; i < SSPP_MAX; i++) { | ||
| 262 | struct dpu_hw_sspp *hw = dpu_rm_get_sspp(&dpu_kms->rm, i); | ||
| 263 | |||
| 264 | if (!hw) | ||
| 265 | continue; | ||
| 266 | |||
| 267 | _dpu_hw_sspp_init_debugfs(hw, dpu_kms, entry); | ||
| 268 | } | ||
| 269 | } | ||
| 270 | |||
| 253 | static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor) | 271 | static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor) |
| 254 | { | 272 | { |
| 255 | struct dpu_kms *dpu_kms = to_dpu_kms(kms); | 273 | struct dpu_kms *dpu_kms = to_dpu_kms(kms); |
| @@ -411,40 +429,6 @@ static void dpu_kms_disable_commit(struct msm_kms *kms) · 155 unmodified lines | |||
| 411 | pm_runtime_put_sync(&dpu_kms->pdev->dev); | 429 | pm_runtime_put_sync(&dpu_kms->pdev->dev); |
| 412 | } | 430 | } |
| 413 | 431 | ||
| 414 | static ktime_t dpu_kms_vsync_time(struct msm_kms *kms, struct drm_crtc *crtc) | ||
| 415 | { | ||
| 416 | struct drm_encoder *encoder; | ||
| 417 | |||
| 418 | drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) { | ||
| 419 | ktime_t vsync_time; | ||
| 420 | |||
| 421 | if (dpu_encoder_vsync_time(encoder, &vsync_time) == 0) | ||
| 422 | return vsync_time; | ||
| 423 | } | ||
| 424 | |||
| 425 | return ktime_get(); | ||
| 426 | } | ||
| 427 | |||
| 428 | static void dpu_kms_prepare_commit(struct msm_kms *kms, | ||
| 429 | struct drm_atomic_state *state) | ||
| 430 | { | ||
| 431 | struct drm_crtc *crtc; | ||
| 432 | struct drm_crtc_state *crtc_state; | ||
| 433 | struct drm_encoder *encoder; | ||
| 434 | int i; | ||
| 435 | |||
| 436 | if (!kms) | ||
| 437 | return; | ||
| 438 | |||
| 439 | /* Call prepare_commit for all affected encoders */ | ||
| 440 | for_each_new_crtc_in_state(state, crtc, crtc_state, i) { | ||
| 441 | drm_for_each_encoder_mask(encoder, crtc->dev, | ||
| 442 | crtc_state->encoder_mask) { | ||
| 443 | dpu_encoder_prepare_commit(encoder); | ||
| 444 | } | ||
| 445 | } | ||
| 446 | } | ||
| 447 | |||
| 448 | static void dpu_kms_flush_commit(struct msm_kms *kms, unsigned crtc_mask) | 432 | static void dpu_kms_flush_commit(struct msm_kms *kms, unsigned crtc_mask) |
| 449 | { | 433 | { |
| 450 | struct dpu_kms *dpu_kms = to_dpu_kms(kms); | 434 | struct dpu_kms *dpu_kms = to_dpu_kms(kms); |
| @@ -491,7 +475,7 @@ static void dpu_kms_wait_for_commit_done(struct msm_kms *kms, · 40 unmodified lines | |||
| 491 | return; | 475 | return; |
| 492 | } | 476 | } |
| 493 | 477 | ||
| 494 | if (!crtc->state->active) { | 478 | if (!drm_atomic_crtc_effectively_active(crtc->state)) { |
| 495 | DPU_DEBUG("[crtc:%d] not active\n", crtc->base.id); | 479 | DPU_DEBUG("[crtc:%d] not active\n", crtc->base.id); |
| 496 | return; | 480 | return; |
| 497 | } | 481 | } |
| @@ -953,8 +937,6 @@ static const struct msm_kms_funcs kms_funcs = { · 455 unmodified lines | |||
| 953 | .irq = dpu_core_irq, | 937 | .irq = dpu_core_irq, |
| 954 | .enable_commit = dpu_kms_enable_commit, | 938 | .enable_commit = dpu_kms_enable_commit, |
| 955 | .disable_commit = dpu_kms_disable_commit, | 939 | .disable_commit = dpu_kms_disable_commit, |
| 956 | .vsync_time = dpu_kms_vsync_time, | ||
| 957 | .prepare_commit = dpu_kms_prepare_commit, | ||
| 958 | .flush_commit = dpu_kms_flush_commit, | 940 | .flush_commit = dpu_kms_flush_commit, |
| 959 | .wait_flush = dpu_kms_wait_flush, | 941 | .wait_flush = dpu_kms_wait_flush, |
| 960 | .complete_commit = dpu_kms_complete_commit, | 942 | .complete_commit = dpu_kms_complete_commit, |
| @@ -1013,6 +995,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms) · 52 unmodified lines | |||
| 1013 | struct dpu_kms *dpu_kms; | 995 | struct dpu_kms *dpu_kms; |
| 1014 | struct drm_device *dev; | 996 | struct drm_device *dev; |
| 1015 | int i, rc = -EINVAL; | 997 | int i, rc = -EINVAL; |
| 998 | u32 core_rev; | ||
| 1016 | 999 | ||
| 1017 | if (!kms) { | 1000 | if (!kms) { |
| 1018 | DPU_ERROR("invalid kms\n"); | 1001 | DPU_ERROR("invalid kms\n"); |
| @@ -1062,17 +1045,14 @@ static int dpu_kms_hw_init(struct msm_kms *kms) · 43 unmodified lines | |||
| 1062 | if (rc < 0) | 1045 | if (rc < 0) |
| 1063 | goto error; | 1046 | goto error; |
| 1064 | 1047 | ||
| 1065 | dpu_kms->core_rev = readl_relaxed(dpu_kms->mmio + 0x0); | 1048 | core_rev = readl_relaxed(dpu_kms->mmio + 0x0); |
| 1066 | 1049 | ||
| 1067 | pr_info("dpu hardware revision:0x%x\n", dpu_kms->core_rev); | 1050 | pr_info("dpu hardware revision:0x%x\n", core_rev); |
| 1068 | 1051 | ||
| 1069 | dpu_kms->catalog = dpu_hw_catalog_init(dpu_kms->core_rev); | 1052 | dpu_kms->catalog = of_device_get_match_data(dev->dev); |
| 1070 | if (IS_ERR_OR_NULL(dpu_kms->catalog)) { | 1053 | if (!dpu_kms->catalog) { |
| 1071 | rc = PTR_ERR(dpu_kms->catalog); | 1054 | DPU_ERROR("device config not known!\n"); |
| 1072 | if (!dpu_kms->catalog) | 1055 | rc = -EINVAL; |
| 1073 | rc = -EINVAL; | ||
| 1074 | DPU_ERROR("catalog init failed: %d\n", rc); | ||
| 1075 | dpu_kms->catalog = NULL; | ||
| 1076 | goto power_error; | 1056 | goto power_error; |
| 1077 | } | 1057 | } |
| 1078 | 1058 | ||
| @@ -1298,19 +1278,19 @@ static const struct dev_pm_ops dpu_pm_ops = { · 219 unmodified lines | |||
| 1298 | }; | 1278 | }; |
| 1299 | 1279 | ||
| 1300 | static const struct of_device_id dpu_dt_match[] = { | 1280 | static const struct of_device_id dpu_dt_match[] = { |
| 1301 | { .compatible = "qcom,msm8998-dpu", }, | 1281 | { .compatible = "qcom,msm8998-dpu", .data = &dpu_msm8998_cfg, }, |
| 1302 | { .compatible = "qcom,qcm2290-dpu", }, | 1282 | { .compatible = "qcom,qcm2290-dpu", .data = &dpu_qcm2290_cfg, }, |
| 1303 | { .compatible = "qcom,sdm845-dpu", }, | 1283 | { .compatible = "qcom,sdm845-dpu", .data = &dpu_sdm845_cfg, }, |
| 1304 | { .compatible = "qcom,sc7180-dpu", }, | 1284 | { .compatible = "qcom,sc7180-dpu", .data = &dpu_sc7180_cfg, }, |
| 1305 | { .compatible = "qcom,sc7280-dpu", }, | 1285 | { .compatible = "qcom,sc7280-dpu", .data = &dpu_sc7280_cfg, }, |
| 1306 | { .compatible = "qcom,sc8180x-dpu", }, | 1286 | { .compatible = "qcom,sc8180x-dpu", .data = &dpu_sc8180x_cfg, }, |
| 1307 | { .compatible = "qcom,sc8280xp-dpu", }, | 1287 | { .compatible = "qcom,sc8280xp-dpu", .data = &dpu_sc8280xp_cfg, }, |
| 1308 | { .compatible = "qcom,sm6115-dpu", }, | 1288 | { .compatible = "qcom,sm6115-dpu", .data = &dpu_sm6115_cfg, }, |
| 1309 | { .compatible = "qcom,sm8150-dpu", }, | 1289 | { .compatible = "qcom,sm8150-dpu", .data = &dpu_sm8150_cfg, }, |
| 1310 | { .compatible = "qcom,sm8250-dpu", }, | 1290 | { .compatible = "qcom,sm8250-dpu", .data = &dpu_sm8250_cfg, }, |
| 1311 | { .compatible = "qcom,sm8350-dpu", }, | 1291 | { .compatible = "qcom,sm8350-dpu", .data = &dpu_sm8350_cfg, }, |
| 1312 | { .compatible = "qcom,sm8450-dpu", }, | 1292 | { .compatible = "qcom,sm8450-dpu", .data = &dpu_sm8450_cfg, }, |
| 1313 | { .compatible = "qcom,sm8550-dpu", }, | 1293 | { .compatible = "qcom,sm8550-dpu", .data = &dpu_sm8550_cfg, }, |
| 1314 | {} | 1294 | {} |
| 1315 | }; | 1295 | }; |
| 1316 | MODULE_DEVICE_TABLE(of, dpu_dt_match); | 1296 | MODULE_DEVICE_TABLE(of, dpu_dt_match); |
| @@ -68,7 +68,6 @@ · 67 unmodified lines | |||
| 68 | struct dpu_kms { | 68 | struct dpu_kms { |
| 69 | struct msm_kms base; | 69 | struct msm_kms base; |
| 70 | struct drm_device *dev; | 70 | struct drm_device *dev; |
| 71 | int core_rev; | ||
| 72 | const struct dpu_mdss_cfg *catalog; | 71 | const struct dpu_mdss_cfg *catalog; |
| 73 | 72 | ||
| 74 | /* io/register spaces: */ | 73 | /* io/register spaces: */ |
| @@ -47,13 +47,6 @@ · 46 unmodified lines | |||
| 47 | #define DPU_PLANE_COLOR_FILL_FLAG BIT(31) | 47 | #define DPU_PLANE_COLOR_FILL_FLAG BIT(31) |
| 48 | #define DPU_ZPOS_MAX 255 | 48 | #define DPU_ZPOS_MAX 255 |
| 49 | 49 | ||
| 50 | /* multirect rect index */ | ||
| 51 | enum { | ||
| 52 | R0, | ||
| 53 | R1, | ||
| 54 | R_MAX | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* | 50 | /* |
| 58 | * Default Preload Values | 51 | * Default Preload Values |
| 59 | */ | 52 | */ |
| @@ -69,6 +62,7 @@ static const uint32_t qcom_compressed_supported_formats[] = { · 9 unmodified lines | |||
| 69 | DRM_FORMAT_ARGB8888, | 62 | DRM_FORMAT_ARGB8888, |
| 70 | DRM_FORMAT_XBGR8888, | 63 | DRM_FORMAT_XBGR8888, |
| 71 | DRM_FORMAT_XRGB8888, | 64 | DRM_FORMAT_XRGB8888, |
| 65 | DRM_FORMAT_ARGB2101010, | ||
| 72 | DRM_FORMAT_XRGB2101010, | 66 | DRM_FORMAT_XRGB2101010, |
| 73 | DRM_FORMAT_BGR565, | 67 | DRM_FORMAT_BGR565, |
| 74 | 68 | ||
| @@ -104,7 +98,6 @@ struct dpu_plane { · 29 unmodified lines | |||
| 104 | 98 | ||
| 105 | enum dpu_sspp pipe; | 99 | enum dpu_sspp pipe; |
| 106 | 100 | ||
| 107 | struct dpu_hw_pipe *pipe_hw; | ||
| 108 | uint32_t color_fill; | 101 | uint32_t color_fill; |
| 109 | bool is_error; | 102 | bool is_error; |
| 110 | bool is_rt_pipe; | 103 | bool is_rt_pipe; |
| @@ -128,21 +121,19 @@ static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane) · 17 unmodified lines | |||
| 128 | 121 | ||
| 129 | /** | 122 | /** |
| 130 | * _dpu_plane_calc_bw - calculate bandwidth required for a plane | 123 | * _dpu_plane_calc_bw - calculate bandwidth required for a plane |
| 131 | * @plane: Pointer to drm plane. | 124 | * @catalog: Points to dpu catalog structure |
| 132 | * @fb: Pointer to framebuffer associated with the given plane | 125 | * @fmt: Pointer to source buffer format |
| 126 | * @mode: Pointer to drm display mode | ||
| 133 | * @pipe_cfg: Pointer to pipe configuration | 127 | * @pipe_cfg: Pointer to pipe configuration |
| 134 | * Result: Updates calculated bandwidth in the plane state. | 128 | * Result: Updates calculated bandwidth in the plane state. |
| 135 | * BW Equation: src_w * src_h * bpp * fps * (v_total / v_dest) | 129 | * BW Equation: src_w * src_h * bpp * fps * (v_total / v_dest) |
| 136 | * Prefill BW Equation: line src bytes * line_time | 130 | * Prefill BW Equation: line src bytes * line_time |
| 137 | */ | 131 | */ |
| 138 | static void _dpu_plane_calc_bw(struct drm_plane *plane, | 132 | static u64 _dpu_plane_calc_bw(const struct dpu_mdss_cfg *catalog, |
| 139 | struct drm_framebuffer *fb, | 133 | const struct dpu_format *fmt, |
| 140 | struct dpu_hw_pipe_cfg *pipe_cfg) | 134 | const struct drm_display_mode *mode, |
| 135 | struct dpu_sw_pipe_cfg *pipe_cfg) | ||
| 141 | { | 136 | { |
| 142 | struct dpu_plane_state *pstate; | ||
| 143 | struct drm_display_mode *mode; | ||
| 144 | const struct dpu_format *fmt = NULL; | ||
| 145 | struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); | ||
| 146 | int src_width, src_height, dst_height, fps; | 137 | int src_width, src_height, dst_height, fps; |
| 147 | u64 plane_prefill_bw; | 138 | u64 plane_prefill_bw; |
| 148 | u64 plane_bw; | 139 | u64 plane_bw; |
| @@ -150,11 +141,6 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane, · 1 unmodified line | |||
| 150 | u64 scale_factor; | 141 | u64 scale_factor; |
| 151 | int vbp, vpw, vfp; | 142 | int vbp, vpw, vfp; |
| 152 | 143 | ||
| 153 | pstate = to_dpu_plane_state(plane->state); | ||
| 154 | mode = &plane->state->crtc->mode; | ||
| 155 | |||
| 156 | fmt = dpu_get_dpu_format_ext(fb->format->format, fb->modifier); | ||
| 157 | |||
| 158 | src_width = drm_rect_width(&pipe_cfg->src_rect); | 144 | src_width = drm_rect_width(&pipe_cfg->src_rect); |
| 159 | src_height = drm_rect_height(&pipe_cfg->src_rect); | 145 | src_height = drm_rect_height(&pipe_cfg->src_rect); |
| 160 | dst_height = drm_rect_height(&pipe_cfg->dst_rect); | 146 | dst_height = drm_rect_height(&pipe_cfg->dst_rect); |
| @@ -162,7 +148,7 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane, · 1 unmodified line | |||
| 162 | vbp = mode->vtotal - mode->vsync_end; | 148 | vbp = mode->vtotal - mode->vsync_end; |
| 163 | vpw = mode->vsync_end - mode->vsync_start; | 149 | vpw = mode->vsync_end - mode->vsync_start; |
| 164 | vfp = mode->vsync_start - mode->vdisplay; | 150 | vfp = mode->vsync_start - mode->vdisplay; |
| 165 | hw_latency_lines = dpu_kms->catalog->perf->min_prefill_lines; | 151 | hw_latency_lines = catalog->perf->min_prefill_lines; |
| 166 | scale_factor = src_height > dst_height ? | 152 | scale_factor = src_height > dst_height ? |
| 167 | mult_frac(src_height, 1, dst_height) : 1; | 153 | mult_frac(src_height, 1, dst_height) : 1; |
| 168 | 154 | ||
| @@ -182,61 +168,60 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane, · 13 unmodified lines | |||
| 182 | do_div(plane_prefill_bw, hw_latency_lines); | 168 | do_div(plane_prefill_bw, hw_latency_lines); |
| 183 | 169 | ||
| 184 | 170 | ||
| 185 | pstate->plane_fetch_bw = max(plane_bw, plane_prefill_bw); | 171 | return max(plane_bw, plane_prefill_bw); |
| 186 | } | 172 | } |
| 187 | 173 | ||
| 188 | /** | 174 | /** |
| 189 | * _dpu_plane_calc_clk - calculate clock required for a plane | 175 | * _dpu_plane_calc_clk - calculate clock required for a plane |
| 190 | * @plane: Pointer to drm plane. | 176 | * @mode: Pointer to drm display mode |
| 191 | * @pipe_cfg: Pointer to pipe configuration | 177 | * @pipe_cfg: Pointer to pipe configuration |
| 192 | * Result: Updates calculated clock in the plane state. | 178 | * Result: Updates calculated clock in the plane state. |
| 193 | * Clock equation: dst_w * v_total * fps * (src_h / dst_h) | 179 | * Clock equation: dst_w * v_total * fps * (src_h / dst_h) |
| 194 | */ | 180 | */ |
| 195 | static void _dpu_plane_calc_clk(struct drm_plane *plane, struct dpu_hw_pipe_cfg *pipe_cfg) | 181 | static u64 _dpu_plane_calc_clk(const struct drm_display_mode *mode, |
| 182 | struct dpu_sw_pipe_cfg *pipe_cfg) | ||
| 196 | { | 183 | { |
| 197 | struct dpu_plane_state *pstate; | ||
| 198 | struct drm_display_mode *mode; | ||
| 199 | int dst_width, src_height, dst_height, fps; | 184 | int dst_width, src_height, dst_height, fps; |
| 200 | 185 | u64 plane_clk; | |
| 201 | pstate = to_dpu_plane_state(plane->state); | ||
| 202 | mode = &plane->state->crtc->mode; | ||
| 203 | 186 | ||
| 204 | src_height = drm_rect_height(&pipe_cfg->src_rect); | 187 | src_height = drm_rect_height(&pipe_cfg->src_rect); |
| 205 | dst_width = drm_rect_width(&pipe_cfg->dst_rect); | 188 | dst_width = drm_rect_width(&pipe_cfg->dst_rect); |
| 206 | dst_height = drm_rect_height(&pipe_cfg->dst_rect); | 189 | dst_height = drm_rect_height(&pipe_cfg->dst_rect); |
| 207 | fps = drm_mode_vrefresh(mode); | 190 | fps = drm_mode_vrefresh(mode); |
| 208 | 191 | ||
| 209 | pstate->plane_clk = | 192 | plane_clk = |
| 210 | dst_width * mode->vtotal * fps; | 193 | dst_width * mode->vtotal * fps; |
| 211 | 194 | ||
| 212 | if (src_height > dst_height) { | 195 | if (src_height > dst_height) { |
| 213 | pstate->plane_clk *= src_height; | 196 | plane_clk *= src_height; |
| 214 | do_div(pstate->plane_clk, dst_height); | 197 | do_div(plane_clk, dst_height); |
| 215 | } | 198 | } |
| 199 | |||
| 200 | return plane_clk; | ||
| 216 | } | 201 | } |
| 217 | 202 | ||
| 218 | /** | 203 | /** |
| 219 | * _dpu_plane_calc_fill_level - calculate fill level of the given source format | 204 | * _dpu_plane_calc_fill_level - calculate fill level of the given source format |
| 220 | * @plane: Pointer to drm plane | 205 | * @plane: Pointer to drm plane |
| 206 | * @pipe: Pointer to software pipe | ||
| 221 | * @fmt: Pointer to source buffer format | 207 | * @fmt: Pointer to source buffer format |
| 222 | * @src_width: width of source buffer | 208 | * @src_width: width of source buffer |
| 223 | * Return: fill level corresponding to the source buffer/format or 0 if error | 209 | * Return: fill level corresponding to the source buffer/format or 0 if error |
| 224 | */ | 210 | */ |
| 225 | static int _dpu_plane_calc_fill_level(struct drm_plane *plane, | 211 | static int _dpu_plane_calc_fill_level(struct drm_plane *plane, |
| 212 | struct dpu_sw_pipe *pipe, | ||
| 226 | const struct dpu_format *fmt, u32 src_width) | 213 | const struct dpu_format *fmt, u32 src_width) |
| 227 | { | 214 | { |
| 228 | struct dpu_plane *pdpu; | 215 | struct dpu_plane *pdpu; |
| 229 | struct dpu_plane_state *pstate; | ||
| 230 | u32 fixed_buff_size; | 216 | u32 fixed_buff_size; |
| 231 | u32 total_fl; | 217 | u32 total_fl; |
| 232 | 218 | ||
| 233 | if (!fmt || !plane->state || !src_width || !fmt->bpp) { | 219 | if (!fmt || !pipe || !src_width || !fmt->bpp) { |
| 234 | DPU_ERROR("invalid arguments\n"); | 220 | DPU_ERROR("invalid arguments\n"); |
| 235 | return 0; | 221 | return 0; |
| 236 | } | 222 | } |
| 237 | 223 | ||
| 238 | pdpu = to_dpu_plane(plane); | 224 | pdpu = to_dpu_plane(plane); |
| 239 | pstate = to_dpu_plane_state(plane->state); | ||
| 240 | fixed_buff_size = pdpu->catalog->caps->pixel_ram_size; | 225 | fixed_buff_size = pdpu->catalog->caps->pixel_ram_size; |
| 241 | 226 | ||
| 242 | /* FIXME: in multirect case account for the src_width of all the planes */ | 227 | /* FIXME: in multirect case account for the src_width of all the planes */ |
| @@ -252,7 +237,7 @@ static int _dpu_plane_calc_fill_level(struct drm_plane *plane, · 9 unmodified lines | |||
| 252 | ((src_width + 32) * fmt->bpp); | 237 | ((src_width + 32) * fmt->bpp); |
| 253 | } | 238 | } |
| 254 | } else { | 239 | } else { |
| 255 | if (pstate->multirect_mode == DPU_SSPP_MULTIRECT_PARALLEL) { | 240 | if (pipe->multirect_mode == DPU_SSPP_MULTIRECT_PARALLEL) { |
| 256 | total_fl = (fixed_buff_size / 2) * 2 / | 241 | total_fl = (fixed_buff_size / 2) * 2 / |
| 257 | ((src_width + 32) * fmt->bpp); | 242 | ((src_width + 32) * fmt->bpp); |
| 258 | } else { | 243 | } else { |
| @@ -262,7 +247,7 @@ static int _dpu_plane_calc_fill_level(struct drm_plane *plane, · 3 unmodified lines | |||
| 262 | } | 247 | } |
| 263 | 248 | ||
| 264 | DPU_DEBUG_PLANE(pdpu, "pnum:%d fmt: %4.4s w:%u fl:%u\n", | 249 | DPU_DEBUG_PLANE(pdpu, "pnum:%d fmt: %4.4s w:%u fl:%u\n", |
| 265 | pdpu->pipe - SSPP_VIG0, | 250 | pipe->sspp->idx - SSPP_VIG0, |
| 266 | (char *)&fmt->base.pixel_format, | 251 | (char *)&fmt->base.pixel_format, |
| 267 | src_width, total_fl); | 252 | src_width, total_fl); |
| 268 | 253 | ||
| @@ -272,24 +257,22 @@ static int _dpu_plane_calc_fill_level(struct drm_plane *plane, · 3 unmodified lines | |||
| 272 | /** | 257 | /** |
| 273 | * _dpu_plane_set_qos_lut - set QoS LUT of the given plane | 258 | * _dpu_plane_set_qos_lut - set QoS LUT of the given plane |
| 274 | * @plane: Pointer to drm plane | 259 | * @plane: Pointer to drm plane |
| 275 | * @fb: Pointer to framebuffer associated with the given plane | 260 | * @pipe: Pointer to software pipe |
| 261 | * @fmt: Pointer to source buffer format | ||
| 276 | * @pipe_cfg: Pointer to pipe configuration | 262 | * @pipe_cfg: Pointer to pipe configuration |
| 277 | */ | 263 | */ |
| 278 | static void _dpu_plane_set_qos_lut(struct drm_plane *plane, | 264 | static void _dpu_plane_set_qos_lut(struct drm_plane *plane, |
| 279 | struct drm_framebuffer *fb, struct dpu_hw_pipe_cfg *pipe_cfg) | 265 | struct dpu_sw_pipe *pipe, |
| 266 | const struct dpu_format *fmt, struct dpu_sw_pipe_cfg *pipe_cfg) | ||
| 280 | { | 267 | { |
| 281 | struct dpu_plane *pdpu = to_dpu_plane(plane); | 268 | struct dpu_plane *pdpu = to_dpu_plane(plane); |
| 282 | const struct dpu_format *fmt = NULL; | ||
| 283 | u64 qos_lut; | 269 | u64 qos_lut; |
| 284 | u32 total_fl = 0, lut_usage; | 270 | u32 total_fl = 0, lut_usage; |
| 285 | 271 | ||
| 286 | if (!pdpu->is_rt_pipe) { | 272 | if (!pdpu->is_rt_pipe) { |
| 287 | lut_usage = DPU_QOS_LUT_USAGE_NRT; | 273 | lut_usage = DPU_QOS_LUT_USAGE_NRT; |
| 288 | } else { | 274 | } else { |
| 289 | fmt = dpu_get_dpu_format_ext( | 275 | total_fl = _dpu_plane_calc_fill_level(plane, pipe, fmt, |
| 290 | fb->format->format, | ||
| 291 | fb->modifier); | ||
| 292 | total_fl = _dpu_plane_calc_fill_level(plane, fmt, | ||
| 293 | drm_rect_width(&pipe_cfg->src_rect)); | 276 | drm_rect_width(&pipe_cfg->src_rect)); |
| 294 | 277 | ||
| 295 | if (fmt && DPU_FORMAT_IS_LINEAR(fmt)) | 278 | if (fmt && DPU_FORMAT_IS_LINEAR(fmt)) |
| @@ -301,7 +284,7 @@ static void _dpu_plane_set_qos_lut(struct drm_plane *plane, · 5 unmodified lines | |||
| 301 | qos_lut = _dpu_hw_get_qos_lut( | 284 | qos_lut = _dpu_hw_get_qos_lut( |
| 302 | &pdpu->catalog->perf->qos_lut_tbl[lut_usage], total_fl); | 285 | &pdpu->catalog->perf->qos_lut_tbl[lut_usage], total_fl); |
| 303 | 286 | ||
| 304 | trace_dpu_perf_set_qos_luts(pdpu->pipe - SSPP_VIG0, | 287 | trace_dpu_perf_set_qos_luts(pipe->sspp->idx - SSPP_VIG0, |
| 305 | (fmt) ? fmt->base.pixel_format : 0, | 288 | (fmt) ? fmt->base.pixel_format : 0, |
| 306 | pdpu->is_rt_pipe, total_fl, qos_lut, lut_usage); | 289 | pdpu->is_rt_pipe, total_fl, qos_lut, lut_usage); |
| 307 | 290 | ||
| @@ -310,19 +293,20 @@ static void _dpu_plane_set_qos_lut(struct drm_plane *plane, · 2 unmodified lines | |||
| 310 | fmt ? (char *)&fmt->base.pixel_format : NULL, | 293 | fmt ? (char *)&fmt->base.pixel_format : NULL, |
| 311 | pdpu->is_rt_pipe, total_fl, qos_lut); | 294 | pdpu->is_rt_pipe, total_fl, qos_lut); |
| 312 | 295 | ||
| 313 | pdpu->pipe_hw->ops.setup_creq_lut(pdpu->pipe_hw, qos_lut); | 296 | pipe->sspp->ops.setup_creq_lut(pipe->sspp, qos_lut); |
| 314 | } | 297 | } |
| 315 | 298 | ||
| 316 | /** | 299 | /** |
| 317 | * _dpu_plane_set_danger_lut - set danger/safe LUT of the given plane | 300 | * _dpu_plane_set_danger_lut - set danger/safe LUT of the given plane |
| 318 | * @plane: Pointer to drm plane | 301 | * @plane: Pointer to drm plane |
| 319 | * @fb: Pointer to framebuffer associated with the given plane | 302 | * @pipe: Pointer to software pipe |
| 303 | * @fmt: Pointer to source buffer format | ||
| 320 | */ | 304 | */ |
| 321 | static void _dpu_plane_set_danger_lut(struct drm_plane *plane, | 305 | static void _dpu_plane_set_danger_lut(struct drm_plane *plane, |
| 322 | struct drm_framebuffer *fb) | 306 | struct dpu_sw_pipe *pipe, |
| 307 | const struct dpu_format *fmt) | ||
| 323 | { | 308 | { |
| 324 | struct dpu_plane *pdpu = to_dpu_plane(plane); | 309 | struct dpu_plane *pdpu = to_dpu_plane(plane); |
| 325 | const struct dpu_format *fmt = NULL; | ||
| 326 | u32 danger_lut, safe_lut; | 310 | u32 danger_lut, safe_lut; |
| 327 | 311 | ||
| 328 | if (!pdpu->is_rt_pipe) { | 312 | if (!pdpu->is_rt_pipe) { |
| @@ -331,10 +315,6 @@ static void _dpu_plane_set_danger_lut(struct drm_plane *plane, · 2 unmodified lines | |||
| 331 | safe_lut = pdpu->catalog->perf->safe_lut_tbl | 315 | safe_lut = pdpu->catalog->perf->safe_lut_tbl |
| 332 | [DPU_QOS_LUT_USAGE_NRT]; | 316 | [DPU_QOS_LUT_USAGE_NRT]; |
| 333 | } else { | 317 | } else { |
| 334 | fmt = dpu_get_dpu_format_ext( | ||
| 335 | fb->format->format, | ||
| 336 | fb->modifier); | ||
| 337 | |||
| 338 | if (fmt && DPU_FORMAT_IS_LINEAR(fmt)) { | 318 | if (fmt && DPU_FORMAT_IS_LINEAR(fmt)) { |
| 339 | danger_lut = pdpu->catalog->perf->danger_lut_tbl | 319 | danger_lut = pdpu->catalog->perf->danger_lut_tbl |
| 340 | [DPU_QOS_LUT_USAGE_LINEAR]; | 320 | [DPU_QOS_LUT_USAGE_LINEAR]; |
| @@ -361,17 +341,19 @@ static void _dpu_plane_set_danger_lut(struct drm_plane *plane, · 20 unmodified lines | |||
| 361 | danger_lut, | 341 | danger_lut, |
| 362 | safe_lut); | 342 | safe_lut); |
| 363 | 343 | ||
| 364 | pdpu->pipe_hw->ops.setup_danger_safe_lut(pdpu->pipe_hw, | 344 | pipe->sspp->ops.setup_danger_safe_lut(pipe->sspp, |
| 365 | danger_lut, safe_lut); | 345 | danger_lut, safe_lut); |
| 366 | } | 346 | } |
| 367 | 347 | ||
| 368 | /** | 348 | /** |
| 369 | * _dpu_plane_set_qos_ctrl - set QoS control of the given plane | 349 | * _dpu_plane_set_qos_ctrl - set QoS control of the given plane |
| 370 | * @plane: Pointer to drm plane | 350 | * @plane: Pointer to drm plane |
| 351 | * @pipe: Pointer to software pipe | ||
| 371 | * @enable: true to enable QoS control | 352 | * @enable: true to enable QoS control |
| 372 | * @flags: QoS control mode (enum dpu_plane_qos) | 353 | * @flags: QoS control mode (enum dpu_plane_qos) |
| 373 | */ | 354 | */ |
| 374 | static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, | 355 | static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, |
| 356 | struct dpu_sw_pipe *pipe, | ||
| 375 | bool enable, u32 flags) | 357 | bool enable, u32 flags) |
| 376 | { | 358 | { |
| 377 | struct dpu_plane *pdpu = to_dpu_plane(plane); | 359 | struct dpu_plane *pdpu = to_dpu_plane(plane); |
| @@ -380,9 +362,9 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, · 2 unmodified lines | |||
| 380 | memset(&pipe_qos_cfg, 0, sizeof(pipe_qos_cfg)); | 362 | memset(&pipe_qos_cfg, 0, sizeof(pipe_qos_cfg)); |
| 381 | 363 | ||
| 382 | if (flags & DPU_PLANE_QOS_VBLANK_CTRL) { | 364 | if (flags & DPU_PLANE_QOS_VBLANK_CTRL) { |
| 383 | pipe_qos_cfg.creq_vblank = pdpu->pipe_hw->cap->sblk->creq_vblank; | 365 | pipe_qos_cfg.creq_vblank = pipe->sspp->cap->sblk->creq_vblank; |
| 384 | pipe_qos_cfg.danger_vblank = | 366 | pipe_qos_cfg.danger_vblank = |
| 385 | pdpu->pipe_hw->cap->sblk->danger_vblank; | 367 | pipe->sspp->cap->sblk->danger_vblank; |
| 386 | pipe_qos_cfg.vblank_en = enable; | 368 | pipe_qos_cfg.vblank_en = enable; |
| 387 | } | 369 | } |
| 388 | 370 | ||
| @@ -408,32 +390,35 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, · 19 unmodified lines | |||
| 408 | pipe_qos_cfg.danger_vblank, | 390 | pipe_qos_cfg.danger_vblank, |
| 409 | pdpu->is_rt_pipe); | 391 | pdpu->is_rt_pipe); |
| 410 | 392 | ||
| 411 | pdpu->pipe_hw->ops.setup_qos_ctrl(pdpu->pipe_hw, | 393 | pipe->sspp->ops.setup_qos_ctrl(pipe->sspp, |
| 412 | &pipe_qos_cfg); | 394 | &pipe_qos_cfg); |
| 413 | } | 395 | } |
| 414 | 396 | ||
| 415 | /** | 397 | /** |
| 416 | * _dpu_plane_set_ot_limit - set OT limit for the given plane | 398 | * _dpu_plane_set_ot_limit - set OT limit for the given plane |
| 417 | * @plane: Pointer to drm plane | 399 | * @plane: Pointer to drm plane |
| 418 | * @crtc: Pointer to drm crtc | 400 | * @pipe: Pointer to software pipe |
| 419 | * @pipe_cfg: Pointer to pipe configuration | 401 | * @pipe_cfg: Pointer to pipe configuration |
| 402 | * @frame_rate: CRTC's frame rate | ||
| 420 | */ | 403 | */ |
| 421 | static void _dpu_plane_set_ot_limit(struct drm_plane *plane, | 404 | static void _dpu_plane_set_ot_limit(struct drm_plane *plane, |
| 422 | struct drm_crtc *crtc, struct dpu_hw_pipe_cfg *pipe_cfg) | 405 | struct dpu_sw_pipe *pipe, |
| 406 | struct dpu_sw_pipe_cfg *pipe_cfg, | ||
| 407 | int frame_rate) | ||
| 423 | { | 408 | { |
| 424 | struct dpu_plane *pdpu = to_dpu_plane(plane); | 409 | struct dpu_plane *pdpu = to_dpu_plane(plane); |
| 425 | struct dpu_vbif_set_ot_params ot_params; | 410 | struct dpu_vbif_set_ot_params ot_params; |
| 426 | struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); | 411 | struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); |
| 427 | 412 | ||
| 428 | memset(&ot_params, 0, sizeof(ot_params)); | 413 | memset(&ot_params, 0, sizeof(ot_params)); |
| 429 | ot_params.xin_id = pdpu->pipe_hw->cap->xin_id; | 414 | ot_params.xin_id = pipe->sspp->cap->xin_id; |
| 430 | ot_params.num = pdpu->pipe_hw->idx - SSPP_NONE; | 415 | ot_params.num = pipe->sspp->idx - SSPP_NONE; |
| 431 | ot_params.width = drm_rect_width(&pipe_cfg->src_rect); | 416 | ot_params.width = drm_rect_width(&pipe_cfg->src_rect); |
| 432 | ot_params.height = drm_rect_height(&pipe_cfg->src_rect); | 417 | ot_params.height = drm_rect_height(&pipe_cfg->src_rect); |
| 433 | ot_params.is_wfd = !pdpu->is_rt_pipe; | 418 | ot_params.is_wfd = !pdpu->is_rt_pipe; |
| 434 | ot_params.frame_rate = drm_mode_vrefresh(&crtc->mode); | 419 | ot_params.frame_rate = frame_rate; |
| 435 | ot_params.vbif_idx = VBIF_RT; | 420 | ot_params.vbif_idx = VBIF_RT; |
| 436 | ot_params.clk_ctrl = pdpu->pipe_hw->cap->clk_ctrl; | 421 | ot_params.clk_ctrl = pipe->sspp->cap->clk_ctrl; |
| 437 | ot_params.rd = true; | 422 | ot_params.rd = true; |
| 438 | 423 | ||
| 439 | dpu_vbif_set_ot_limit(dpu_kms, &ot_params); | 424 | dpu_vbif_set_ot_limit(dpu_kms, &ot_params); |
| @@ -442,8 +427,10 @@ static void _dpu_plane_set_ot_limit(struct drm_plane *plane, · 2 unmodified lines | |||
| 442 | /** | 427 | /** |
| 443 | * _dpu_plane_set_qos_remap - set vbif QoS for the given plane | 428 | * _dpu_plane_set_qos_remap - set vbif QoS for the given plane |
| 444 | * @plane: Pointer to drm plane | 429 | * @plane: Pointer to drm plane |
| 430 | * @pipe: Pointer to software pipe | ||
| 445 | */ | 431 | */ |
| 446 | static void _dpu_plane_set_qos_remap(struct drm_plane *plane) | 432 | static void _dpu_plane_set_qos_remap(struct drm_plane *plane, |
| 433 | struct dpu_sw_pipe *pipe) | ||
| 447 | { | 434 | { |
| 448 | struct dpu_plane *pdpu = to_dpu_plane(plane); | 435 | struct dpu_plane *pdpu = to_dpu_plane(plane); |
| 449 | struct dpu_vbif_set_qos_params qos_params; | 436 | struct dpu_vbif_set_qos_params qos_params; |
| @@ -451,9 +438,9 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane) · 1 unmodified line | |||
| 451 | 438 | ||
| 452 | memset(&qos_params, 0, sizeof(qos_params)); | 439 | memset(&qos_params, 0, sizeof(qos_params)); |
| 453 | qos_params.vbif_idx = VBIF_RT; | 440 | qos_params.vbif_idx = VBIF_RT; |
| 454 | qos_params.clk_ctrl = pdpu->pipe_hw->cap->clk_ctrl; | 441 | qos_params.clk_ctrl = pipe->sspp->cap->clk_ctrl; |
| 455 | qos_params.xin_id = pdpu->pipe_hw->cap->xin_id; | 442 | qos_params.xin_id = pipe->sspp->cap->xin_id; |
| 456 | qos_params.num = pdpu->pipe_hw->idx - SSPP_VIG0; | 443 | qos_params.num = pipe->sspp->idx - SSPP_VIG0; |
| 457 | qos_params.is_rt = pdpu->is_rt_pipe; | 444 | qos_params.is_rt = pdpu->is_rt_pipe; |
| 458 | 445 | ||
| 459 | DPU_DEBUG_PLANE(pdpu, "pipe:%d vbif:%d xin:%d rt:%d, clk_ctrl:%d\n", | 446 | DPU_DEBUG_PLANE(pdpu, "pipe:%d vbif:%d xin:%d rt:%d, clk_ctrl:%d\n", |
| @@ -465,39 +452,15 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane) · 5 unmodified lines | |||
| 465 | dpu_vbif_set_qos_remap(dpu_kms, &qos_params); | 452 | dpu_vbif_set_qos_remap(dpu_kms, &qos_params); |
| 466 | } | 453 | } |
| 467 | 454 | ||
| 468 | static void _dpu_plane_set_scanout(struct drm_plane *plane, | 455 | static void _dpu_plane_setup_scaler3(struct dpu_hw_sspp *pipe_hw, |
| 469 | struct dpu_plane_state *pstate, | ||
| 470 | struct dpu_hw_pipe_cfg *pipe_cfg, | ||
| 471 | struct drm_framebuffer *fb) | ||
| 472 | { | ||
| 473 | struct dpu_plane *pdpu = to_dpu_plane(plane); | ||
| 474 | struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base); | ||
| 475 | struct msm_gem_address_space *aspace = kms->base.aspace; | ||
| 476 | int ret; | ||
| 477 | |||
| 478 | ret = dpu_format_populate_layout(aspace, fb, &pipe_cfg->layout); | ||
| 479 | if (ret == -EAGAIN) | ||
| 480 | DPU_DEBUG_PLANE(pdpu, "not updating same src addrs\n"); | ||
| 481 | else if (ret) | ||
| 482 | DPU_ERROR_PLANE(pdpu, "failed to get format layout, %d\n", ret); | ||
| 483 | else if (pdpu->pipe_hw->ops.setup_sourceaddress) { | ||
| 484 | trace_dpu_plane_set_scanout(pdpu->pipe_hw->idx, | ||
| 485 | &pipe_cfg->layout, | ||
| 486 | pstate->multirect_index); | ||
| 487 | pdpu->pipe_hw->ops.setup_sourceaddress(pdpu->pipe_hw, pipe_cfg, | ||
| 488 | pstate->multirect_index); | ||
| 489 | } | ||
| 490 | } | ||
| 491 | |||
| 492 | static void _dpu_plane_setup_scaler3(struct dpu_plane *pdpu, | ||
| 493 | struct dpu_plane_state *pstate, | ||
| 494 | uint32_t src_w, uint32_t src_h, uint32_t dst_w, uint32_t dst_h, | 456 | uint32_t src_w, uint32_t src_h, uint32_t dst_w, uint32_t dst_h, |
| 495 | struct dpu_hw_scaler3_cfg *scale_cfg, | 457 | struct dpu_hw_scaler3_cfg *scale_cfg, |
| 496 | const struct dpu_format *fmt, | 458 | const struct dpu_format *fmt, |
| 497 | uint32_t chroma_subsmpl_h, uint32_t chroma_subsmpl_v) | 459 | uint32_t chroma_subsmpl_h, uint32_t chroma_subsmpl_v, |
| 460 | unsigned int rotation) | ||
| 498 | { | 461 | { |
| 499 | uint32_t i; | 462 | uint32_t i; |
| 500 | bool inline_rotation = pstate->rotation & DRM_MODE_ROTATE_90; | 463 | bool inline_rotation = rotation & DRM_MODE_ROTATE_90; |
| 501 | 464 | ||
| 502 | /* | 465 | /* |
| 503 | * For inline rotation cases, scaler config is post-rotation, | 466 | * For inline rotation cases, scaler config is post-rotation, |
| @@ -536,7 +499,7 @@ static void _dpu_plane_setup_scaler3(struct dpu_plane *pdpu, · 32 unmodified lines | |||
| 536 | scale_cfg->src_height[i] /= chroma_subsmpl_v; | 499 | scale_cfg->src_height[i] /= chroma_subsmpl_v; |
| 537 | } | 500 | } |
| 538 | 501 | ||
| 539 | if (pdpu->pipe_hw->cap->features & | 502 | if (pipe_hw->cap->features & |
| 540 | BIT(DPU_SSPP_SCALER_QSEED4)) { | 503 | BIT(DPU_SSPP_SCALER_QSEED4)) { |
| 541 | scale_cfg->preload_x[i] = DPU_QSEED4_DEFAULT_PRELOAD_H; | 504 | scale_cfg->preload_x[i] = DPU_QSEED4_DEFAULT_PRELOAD_H; |
| 542 | scale_cfg->preload_y[i] = DPU_QSEED4_DEFAULT_PRELOAD_V; | 505 | scale_cfg->preload_y[i] = DPU_QSEED4_DEFAULT_PRELOAD_V; |
| @@ -607,36 +570,28 @@ static const struct dpu_csc_cfg dpu_csc10_YUV2RGB_601L = { · 64 unmodified lines | |||
| 607 | { 0x00, 0x3ff, 0x00, 0x3ff, 0x00, 0x3ff,}, | 570 | { 0x00, 0x3ff, 0x00, 0x3ff, 0x00, 0x3ff,}, |
| 608 | }; | 571 | }; |
| 609 | 572 | ||
| 610 | static const struct dpu_csc_cfg *_dpu_plane_get_csc(struct dpu_plane *pdpu, const struct dpu_format *fmt) | 573 | static const struct dpu_csc_cfg *_dpu_plane_get_csc(struct dpu_sw_pipe *pipe, |
| 574 | const struct dpu_format *fmt) | ||
| 611 | { | 575 | { |
| 612 | const struct dpu_csc_cfg *csc_ptr; | 576 | const struct dpu_csc_cfg *csc_ptr; |
| 613 | 577 | ||
| 614 | if (!pdpu) { | ||
| 615 | DPU_ERROR("invalid plane\n"); | ||
| 616 | return NULL; | ||
| 617 | } | ||
| 618 | |||
| 619 | if (!DPU_FORMAT_IS_YUV(fmt)) | 578 | if (!DPU_FORMAT_IS_YUV(fmt)) |
| 620 | return NULL; | 579 | return NULL; |
| 621 | 580 | ||
| 622 | if (BIT(DPU_SSPP_CSC_10BIT) & pdpu->pipe_hw->cap->features) | 581 | if (BIT(DPU_SSPP_CSC_10BIT) & pipe->sspp->cap->features) |
| 623 | csc_ptr = &dpu_csc10_YUV2RGB_601L; | 582 | csc_ptr = &dpu_csc10_YUV2RGB_601L; |
| 624 | else | 583 | else |
| 625 | csc_ptr = &dpu_csc_YUV2RGB_601L; | 584 | csc_ptr = &dpu_csc_YUV2RGB_601L; |
| 626 | 585 | ||
| 627 | DPU_DEBUG_PLANE(pdpu, "using 0x%X 0x%X 0x%X...\n", | ||
| 628 | csc_ptr->csc_mv[0], | ||
| 629 | csc_ptr->csc_mv[1], | ||
| 630 | csc_ptr->csc_mv[2]); | ||
| 631 | |||
| 632 | return csc_ptr; | 586 | return csc_ptr; |
| 633 | } | 587 | } |
| 634 | 588 | ||
| 635 | static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu, | 589 | static void _dpu_plane_setup_scaler(struct dpu_sw_pipe *pipe, |
| 636 | struct dpu_plane_state *pstate, | ||
| 637 | const struct dpu_format *fmt, bool color_fill, | 590 | const struct dpu_format *fmt, bool color_fill, |
| 638 | struct dpu_hw_pipe_cfg *pipe_cfg) | 591 | struct dpu_sw_pipe_cfg *pipe_cfg, |
| 592 | unsigned int rotation) | ||
| 639 | { | 593 | { |
| 594 | struct dpu_hw_sspp *pipe_hw = pipe->sspp; | ||
| 640 | const struct drm_format_info *info = drm_format_info(fmt->base.pixel_format); | 595 | const struct drm_format_info *info = drm_format_info(fmt->base.pixel_format); |
| 641 | struct dpu_hw_scaler3_cfg scaler3_cfg; | 596 | struct dpu_hw_scaler3_cfg scaler3_cfg; |
| 642 | struct dpu_hw_pixel_ext pixel_ext; | 597 | struct dpu_hw_pixel_ext pixel_ext; |
| @@ -650,20 +605,21 @@ static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu, · 7 unmodified lines | |||
| 650 | 605 | ||
| 651 | /* don't chroma subsample if decimating */ | 606 | /* don't chroma subsample if decimating */ |
| 652 | /* update scaler. calculate default config for QSEED3 */ | 607 | /* update scaler. calculate default config for QSEED3 */ |
| 653 | _dpu_plane_setup_scaler3(pdpu, pstate, | 608 | _dpu_plane_setup_scaler3(pipe_hw, |
| 654 | src_width, | 609 | src_width, |
| 655 | src_height, | 610 | src_height, |
| 656 | dst_width, | 611 | dst_width, |
| 657 | dst_height, | 612 | dst_height, |
| 658 | &scaler3_cfg, fmt, | 613 | &scaler3_cfg, fmt, |
| 659 | info->hsub, info->vsub); | 614 | info->hsub, info->vsub, |
| 615 | rotation); | ||
| 660 | 616 | ||
| 661 | /* configure pixel extension based on scalar config */ | 617 | /* configure pixel extension based on scalar config */ |
| 662 | _dpu_plane_setup_pixel_ext(&scaler3_cfg, &pixel_ext, | 618 | _dpu_plane_setup_pixel_ext(&scaler3_cfg, &pixel_ext, |
| 663 | src_width, src_height, info->hsub, info->vsub); | 619 | src_width, src_height, info->hsub, info->vsub); |
| 664 | 620 | ||
| 665 | if (pdpu->pipe_hw->ops.setup_pe) | 621 | if (pipe_hw->ops.setup_pe) |
| 666 | pdpu->pipe_hw->ops.setup_pe(pdpu->pipe_hw, | 622 | pipe_hw->ops.setup_pe(pipe_hw, |
| 667 | &pixel_ext); | 623 | &pixel_ext); |
| 668 | 624 | ||
| 669 | /** | 625 | /** |
| @@ -671,11 +627,44 @@ static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu, · 1 unmodified line | |||
| 671 | * bypassed. Still we need to update alpha and bitwidth | 627 | * bypassed. Still we need to update alpha and bitwidth |
| 672 | * ONLY for RECT0 | 628 | * ONLY for RECT0 |
| 673 | */ | 629 | */ |
| 674 | if (pdpu->pipe_hw->ops.setup_scaler && | 630 | if (pipe_hw->ops.setup_scaler && |
| 675 | pstate->multirect_index != DPU_SSPP_RECT_1) | 631 | pipe->multirect_index != DPU_SSPP_RECT_1) |
| 676 | pdpu->pipe_hw->ops.setup_scaler(pdpu->pipe_hw, | 632 | pipe_hw->ops.setup_scaler(pipe_hw, |
| 677 | pipe_cfg, | 633 | &scaler3_cfg, |
| 678 | &scaler3_cfg); | 634 | fmt); |
| 635 | } | ||
| 636 | |||
| 637 | static void _dpu_plane_color_fill_pipe(struct dpu_plane_state *pstate, | ||
| 638 | struct dpu_sw_pipe *pipe, | ||
| 639 | struct drm_rect *dst_rect, | ||
| 640 | u32 fill_color, | ||
| 641 | const struct dpu_format *fmt) | ||
| 642 | { | ||
| 643 | struct dpu_sw_pipe_cfg pipe_cfg; | ||
| 644 | |||
| 645 | /* update sspp */ | ||
| 646 | if (!pipe->sspp->ops.setup_solidfill) | ||
| 647 | return; | ||
| 648 | |||
| 649 | pipe->sspp->ops.setup_solidfill(pipe, fill_color); | ||
| 650 | |||
| 651 | /* override scaler/decimation if solid fill */ | ||
| 652 | pipe_cfg.dst_rect = *dst_rect; | ||
| 653 | |||
| 654 | pipe_cfg.src_rect.x1 = 0; | ||
| 655 | pipe_cfg.src_rect.y1 = 0; | ||
| 656 | pipe_cfg.src_rect.x2 = | ||
| 657 | drm_rect_width(&pipe_cfg.dst_rect); | ||
| 658 | pipe_cfg.src_rect.y2 = | ||
| 659 | drm_rect_height(&pipe_cfg.dst_rect); | ||
| 660 | |||
| 661 | if (pipe->sspp->ops.setup_format) | ||
| 662 | pipe->sspp->ops.setup_format(pipe, fmt, DPU_SSPP_SOLID_FILL); | ||
| 663 | |||
| 664 | if (pipe->sspp->ops.setup_rects) | ||
| 665 | pipe->sspp->ops.setup_rects(pipe, &pipe_cfg); | ||
| 666 | |||
| 667 | _dpu_plane_setup_scaler(pipe, fmt, true, &pipe_cfg, pstate->rotation); | ||
| 679 | } | 668 | } |
| 680 | 669 | ||
| 681 | /** | 670 | /** |
| @@ -683,15 +672,14 @@ static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu, · 1 unmodified line | |||
| 683 | * @pdpu: Pointer to DPU plane object | 672 | * @pdpu: Pointer to DPU plane object |
| 684 | * @color: RGB fill color value, [23..16] Blue, [15..8] Green, [7..0] Red | 673 | * @color: RGB fill color value, [23..16] Blue, [15..8] Green, [7..0] Red |
| 685 | * @alpha: 8-bit fill alpha value, 255 selects 100% alpha | 674 | * @alpha: 8-bit fill alpha value, 255 selects 100% alpha |
| 686 | * Returns: 0 on success | ||
| 687 | */ | 675 | */ |
| 688 | static int _dpu_plane_color_fill(struct dpu_plane *pdpu, | 676 | static void _dpu_plane_color_fill(struct dpu_plane *pdpu, |
| 689 | uint32_t color, uint32_t alpha) | 677 | uint32_t color, uint32_t alpha) |
| 690 | { | 678 | { |
| 691 | const struct dpu_format *fmt; | 679 | const struct dpu_format *fmt; |
| 692 | const struct drm_plane *plane = &pdpu->base; | 680 | const struct drm_plane *plane = &pdpu->base; |
| 693 | struct dpu_plane_state *pstate = to_dpu_plane_state(plane->state); | 681 | struct dpu_plane_state *pstate = to_dpu_plane_state(plane->state); |
| 694 | struct dpu_hw_pipe_cfg pipe_cfg; | 682 | u32 fill_color = (color & 0xFFFFFF) | ((alpha & 0xFF) << 24); |
| 695 | 683 | ||
| 696 | DPU_DEBUG_PLANE(pdpu, "\n"); | 684 | DPU_DEBUG_PLANE(pdpu, "\n"); |
| 697 | 685 | ||
| @@ -700,156 +688,17 @@ static int _dpu_plane_color_fill(struct dpu_plane *pdpu, · 2 unmodified lines | |||
| 700 | * h/w only supports RGB variants | 688 | * h/w only supports RGB variants |
| 701 | */ | 689 | */ |
| 702 | fmt = dpu_get_dpu_format(DRM_FORMAT_ABGR8888); | 690 | fmt = dpu_get_dpu_format(DRM_FORMAT_ABGR8888); |
| 691 | /* should not happen ever */ | ||
| 692 | if (!fmt) | ||
| 693 | return; | ||
| 703 | 694 | ||
| 704 | /* update sspp */ | 695 | /* update sspp */ |
| 705 | if (fmt && pdpu->pipe_hw->ops.setup_solidfill) { | 696 | _dpu_plane_color_fill_pipe(pstate, &pstate->pipe, &pstate->pipe_cfg.dst_rect, |
| 706 | pdpu->pipe_hw->ops.setup_solidfill(pdpu->pipe_hw, | 697 | fill_color, fmt); |
| 707 | (color & 0xFFFFFF) | ((alpha & 0xFF) << 24), | ||
| 708 | pstate->multirect_index); | ||
| 709 | |||
| 710 | /* override scaler/decimation if solid fill */ | ||
| 711 | pipe_cfg.dst_rect = pstate->base.dst; | ||
| 712 | |||
| 713 | pipe_cfg.src_rect.x1 = 0; | ||
| 714 | pipe_cfg.src_rect.y1 = 0; | ||
| 715 | pipe_cfg.src_rect.x2 = | ||
| 716 | drm_rect_width(&pipe_cfg.dst_rect); | ||
| 717 | pipe_cfg.src_rect.y2 = | ||
| 718 | drm_rect_height(&pipe_cfg.dst_rect); | ||
| 719 | |||
| 720 | if (pdpu->pipe_hw->ops.setup_format) | ||
| 721 | pdpu->pipe_hw->ops.setup_format(pdpu->pipe_hw, | ||
| 722 | fmt, DPU_SSPP_SOLID_FILL, | ||
| 723 | pstate->multirect_index); | ||
| 724 | |||
| 725 | if (pdpu->pipe_hw->ops.setup_rects) | ||
| 726 | pdpu->pipe_hw->ops.setup_rects(pdpu->pipe_hw, | ||
| 727 | &pipe_cfg, | ||
| 728 | pstate->multirect_index); | ||
| 729 | |||
| 730 | _dpu_plane_setup_scaler(pdpu, pstate, fmt, true, &pipe_cfg); | ||
| 731 | } | ||
| 732 | |||
| 733 | return 0; | ||
| 734 | } | ||
| 735 | |||
| 736 | void dpu_plane_clear_multirect(const struct drm_plane_state *drm_state) | ||
| 737 | { | ||
| 738 | struct dpu_plane_state *pstate = to_dpu_plane_state(drm_state); | ||
| 739 | |||
| 740 | pstate->multirect_index = DPU_SSPP_RECT_SOLO; | ||
| 741 | pstate->multirect_mode = DPU_SSPP_MULTIRECT_NONE; | ||
| 742 | } | ||
| 743 | |||
| 744 | int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane) | ||
| 745 | { | ||
| 746 | struct dpu_plane_state *pstate[R_MAX]; | ||
| 747 | const struct drm_plane_state *drm_state[R_MAX]; | ||
| 748 | struct drm_rect src[R_MAX], dst[R_MAX]; | ||
| 749 | struct dpu_plane *dpu_plane[R_MAX]; | ||
| 750 | const struct dpu_format *fmt[R_MAX]; | ||
| 751 | int i, buffer_lines; | ||
| 752 | unsigned int max_tile_height = 1; | ||
| 753 | bool parallel_fetch_qualified = true; | ||
| 754 | bool has_tiled_rect = false; | ||
| 755 | |||
| 756 | for (i = 0; i < R_MAX; i++) { | ||
| 757 | const struct msm_format *msm_fmt; | ||
| 758 | |||
| 759 | drm_state[i] = i ? plane->r1 : plane->r0; | ||
| 760 | msm_fmt = msm_framebuffer_format(drm_state[i]->fb); | ||
| 761 | fmt[i] = to_dpu_format(msm_fmt); | ||
| 762 | |||
| 763 | if (DPU_FORMAT_IS_UBWC(fmt[i])) { | ||
| 764 | has_tiled_rect = true; | ||
| 765 | if (fmt[i]->tile_height > max_tile_height) | ||
| 766 | max_tile_height = fmt[i]->tile_height; | ||
| 767 | } | ||
| 768 | } | ||
| 769 | |||
| 770 | for (i = 0; i < R_MAX; i++) { | ||
| 771 | int width_threshold; | ||
| 772 | |||
| 773 | pstate[i] = to_dpu_plane_state(drm_state[i]); | ||
| 774 | dpu_plane[i] = to_dpu_plane(drm_state[i]->plane); | ||
| 775 | |||
| 776 | if (pstate[i] == NULL) { | ||
| 777 | DPU_ERROR("DPU plane state of plane id %d is NULL\n", | ||
| 778 | drm_state[i]->plane->base.id); | ||
| 779 | return -EINVAL; | ||
| 780 | } | ||
| 781 | |||
| 782 | src[i].x1 = drm_state[i]->src_x >> 16; | ||
| 783 | src[i].y1 = drm_state[i]->src_y >> 16; | ||
| 784 | src[i].x2 = src[i].x1 + (drm_state[i]->src_w >> 16); | ||
| 785 | src[i].y2 = src[i].y1 + (drm_state[i]->src_h >> 16); | ||
| 786 | |||
| 787 | dst[i] = drm_plane_state_dest(drm_state[i]); | ||
| 788 | |||
| 789 | if (drm_rect_calc_hscale(&src[i], &dst[i], 1, 1) != 1 || | ||
| 790 | drm_rect_calc_vscale(&src[i], &dst[i], 1, 1) != 1) { | ||
| 791 | DPU_ERROR_PLANE(dpu_plane[i], | ||
| 792 | "scaling is not supported in multirect mode\n"); | ||
| 793 | return -EINVAL; | ||
| 794 | } | ||
| 795 | |||
| 796 | if (DPU_FORMAT_IS_YUV(fmt[i])) { | ||
| 797 | DPU_ERROR_PLANE(dpu_plane[i], | ||
| 798 | "Unsupported format for multirect mode\n"); | ||
| 799 | return -EINVAL; | ||
| 800 | } | ||
| 801 | |||
| 802 | /** | ||
| 803 | * SSPP PD_MEM is split half - one for each RECT. | ||
| 804 | * Tiled formats need 5 lines of buffering while fetching | ||
| 805 | * whereas linear formats need only 2 lines. | ||
| 806 | * So we cannot support more than half of the supported SSPP | ||
| 807 | * width for tiled formats. | ||
| 808 | */ | ||
| 809 | width_threshold = dpu_plane[i]->catalog->caps->max_linewidth; | ||
| 810 | if (has_tiled_rect) | ||
| 811 | width_threshold /= 2; | ||
| 812 | |||
| 813 | if (parallel_fetch_qualified && | ||
| 814 | drm_rect_width(&src[i]) > width_threshold) | ||
| 815 | parallel_fetch_qualified = false; | ||
| 816 | |||
| 817 | } | ||
| 818 | |||
| 819 | /* Validate RECT's and set the mode */ | ||
| 820 | |||
| 821 | /* Prefer PARALLEL FETCH Mode over TIME_MX Mode */ | ||
| 822 | if (parallel_fetch_qualified) { | ||
| 823 | pstate[R0]->multirect_mode = DPU_SSPP_MULTIRECT_PARALLEL; | ||
| 824 | pstate[R1]->multirect_mode = DPU_SSPP_MULTIRECT_PARALLEL; | ||
| 825 | |||
| 826 | goto done; | ||
| 827 | } | ||
| 828 | |||
| 829 | /* TIME_MX Mode */ | ||
| 830 | buffer_lines = 2 * max_tile_height; | ||
| 831 | 698 | ||
| 832 | if (dst[R1].y1 >= dst[R0].y2 + buffer_lines || | 699 | if (pstate->r_pipe.sspp) |
| 833 | dst[R0].y1 >= dst[R1].y2 + buffer_lines) { | 700 | _dpu_plane_color_fill_pipe(pstate, &pstate->r_pipe, &pstate->r_pipe_cfg.dst_rect, |
| 834 | pstate[R0]->multirect_mode = DPU_SSPP_MULTIRECT_TIME_MX; | 701 | fill_color, fmt); |
| 835 | pstate[R1]->multirect_mode = DPU_SSPP_MULTIRECT_TIME_MX; | ||
| 836 | } else { | ||
| 837 | DPU_ERROR( | ||
| 838 | "No multirect mode possible for the planes (%d - %d)\n", | ||
| 839 | drm_state[R0]->plane->base.id, | ||
| 840 | drm_state[R1]->plane->base.id); | ||
| 841 | return -EINVAL; | ||
| 842 | } | ||
| 843 | |||
| 844 | done: | ||
| 845 | pstate[R0]->multirect_index = DPU_SSPP_RECT_0; | ||
| 846 | pstate[R1]->multirect_index = DPU_SSPP_RECT_1; | ||
| 847 | |||
| 848 | DPU_DEBUG_PLANE(dpu_plane[R0], "R0: %d - %d\n", | ||
| 849 | pstate[R0]->multirect_mode, pstate[R0]->multirect_index); | ||
| 850 | DPU_DEBUG_PLANE(dpu_plane[R1], "R1: %d - %d\n", | ||
| 851 | pstate[R1]->multirect_mode, pstate[R1]->multirect_index); | ||
| 852 | return 0; | ||
| 853 | } | 702 | } |
| 854 | 703 | ||
| 855 | static int dpu_plane_prepare_fb(struct drm_plane *plane, | 704 | static int dpu_plane_prepare_fb(struct drm_plane *plane, |
| @@ -914,25 +763,6 @@ static void dpu_plane_cleanup_fb(struct drm_plane *plane, · 58 unmodified lines | |||
| 914 | old_pstate->needs_dirtyfb); | 763 | old_pstate->needs_dirtyfb); |
| 915 | } | 764 | } |
| 916 | 765 | ||
| 917 | static bool dpu_plane_validate_src(struct drm_rect *src, | ||
| 918 | struct drm_rect *fb_rect, | ||
| 919 | uint32_t min_src_size) | ||
| 920 | { | ||
| 921 | /* Ensure fb size is supported */ | ||
| 922 | if (drm_rect_width(fb_rect) > MAX_IMG_WIDTH || | ||
| 923 | drm_rect_height(fb_rect) > MAX_IMG_HEIGHT) | ||
| 924 | return false; | ||
| 925 | |||
| 926 | /* Ensure src rect is above the minimum size */ | ||
| 927 | if (drm_rect_width(src) < min_src_size || | ||
| 928 | drm_rect_height(src) < min_src_size) | ||
| 929 | return false; | ||
| 930 | |||
| 931 | /* Ensure src is fully encapsulated in fb */ | ||
| 932 | return drm_rect_intersect(fb_rect, src) && | ||
| 933 | drm_rect_equals(fb_rect, src); | ||
| 934 | } | ||
| 935 | |||
| 936 | static int dpu_plane_check_inline_rotation(struct dpu_plane *pdpu, | 766 | static int dpu_plane_check_inline_rotation(struct dpu_plane *pdpu, |
| 937 | const struct dpu_sspp_sub_blks *sblk, | 767 | const struct dpu_sspp_sub_blks *sblk, |
| 938 | struct drm_rect src, const struct dpu_format *fmt) | 768 | struct drm_rect src, const struct dpu_format *fmt) |
| @@ -961,6 +791,53 @@ static int dpu_plane_check_inline_rotation(struct dpu_plane *pdpu, · 22 unmodified lines | |||
| 961 | return 0; | 791 | return 0; |
| 962 | } | 792 | } |
| 963 | 793 | ||
| 794 | static int dpu_plane_atomic_check_pipe(struct dpu_plane *pdpu, | ||
| 795 | struct dpu_sw_pipe *pipe, | ||
| 796 | struct dpu_sw_pipe_cfg *pipe_cfg, | ||
| 797 | const struct dpu_format *fmt) | ||
| 798 | { | ||
| 799 | uint32_t min_src_size; | ||
| 800 | |||
| 801 | min_src_size = DPU_FORMAT_IS_YUV(fmt) ? 2 : 1; | ||
| 802 | |||
| 803 | if (DPU_FORMAT_IS_YUV(fmt) && | ||
| 804 | (!(pipe->sspp->cap->features & DPU_SSPP_SCALER) || | ||
| 805 | !(pipe->sspp->cap->features & DPU_SSPP_CSC_ANY))) { | ||
| 806 | DPU_DEBUG_PLANE(pdpu, | ||
| 807 | "plane doesn't have scaler/csc for yuv\n"); | ||
| 808 | return -EINVAL; | ||
| 809 | } | ||
| 810 | |||
| 811 | /* check src bounds */ | ||
| 812 | if (drm_rect_width(&pipe_cfg->src_rect) < min_src_size || | ||
| 813 | drm_rect_height(&pipe_cfg->src_rect) < min_src_size) { | ||
| 814 | DPU_DEBUG_PLANE(pdpu, "invalid source " DRM_RECT_FMT "\n", | ||
| 815 | DRM_RECT_ARG(&pipe_cfg->src_rect)); | ||
| 816 | return -E2BIG; | ||
| 817 | } | ||
| 818 | |||
| 819 | /* valid yuv image */ | ||
| 820 | if (DPU_FORMAT_IS_YUV(fmt) && | ||
| 821 | (pipe_cfg->src_rect.x1 & 0x1 || | ||
| 822 | pipe_cfg->src_rect.y1 & 0x1 || | ||
| 823 | drm_rect_width(&pipe_cfg->src_rect) & 0x1 || | ||
| 824 | drm_rect_height(&pipe_cfg->src_rect) & 0x1)) { | ||
| 825 | DPU_DEBUG_PLANE(pdpu, "invalid yuv source " DRM_RECT_FMT "\n", | ||
| 826 | DRM_RECT_ARG(&pipe_cfg->src_rect)); | ||
| 827 | return -EINVAL; | ||
| 828 | } | ||
| 829 | |||
| 830 | /* min dst support */ | ||
| 831 | if (drm_rect_width(&pipe_cfg->dst_rect) < 0x1 || | ||
| 832 | drm_rect_height(&pipe_cfg->dst_rect) < 0x1) { | ||
| 833 | DPU_DEBUG_PLANE(pdpu, "invalid dest rect " DRM_RECT_FMT "\n", | ||
| 834 | DRM_RECT_ARG(&pipe_cfg->dst_rect)); | ||
| 835 | return -EINVAL; | ||
| 836 | } | ||
| 837 | |||
| 838 | return 0; | ||
| 839 | } | ||
| 840 | |||
| 964 | static int dpu_plane_atomic_check(struct drm_plane *plane, | 841 | static int dpu_plane_atomic_check(struct drm_plane *plane, |
| 965 | struct drm_atomic_state *state) | 842 | struct drm_atomic_state *state) |
| 966 | { | 843 | { |
| @@ -969,14 +846,18 @@ static int dpu_plane_atomic_check(struct drm_plane *plane, · 2 unmodified lines | |||
| 969 | int ret = 0, min_scale; | 846 | int ret = 0, min_scale; |
| 970 | struct dpu_plane *pdpu = to_dpu_plane(plane); | 847 | struct dpu_plane *pdpu = to_dpu_plane(plane); |
| 971 | struct dpu_plane_state *pstate = to_dpu_plane_state(new_plane_state); | 848 | struct dpu_plane_state *pstate = to_dpu_plane_state(new_plane_state); |
| 849 | struct dpu_sw_pipe *pipe = &pstate->pipe; | ||
| 850 | struct dpu_sw_pipe *r_pipe = &pstate->r_pipe; | ||
| 972 | const struct drm_crtc_state *crtc_state = NULL; | 851 | const struct drm_crtc_state *crtc_state = NULL; |
| 973 | const struct dpu_format *fmt; | 852 | const struct dpu_format *fmt; |
| 974 | struct drm_rect src, dst, fb_rect = { 0 }; | 853 | struct dpu_sw_pipe_cfg *pipe_cfg = &pstate->pipe_cfg; |
| 975 | uint32_t min_src_size, max_linewidth; | 854 | struct dpu_sw_pipe_cfg *r_pipe_cfg = &pstate->r_pipe_cfg; |
| 855 | struct drm_rect fb_rect = { 0 }; | ||
| 856 | uint32_t max_linewidth; | ||
| 976 | unsigned int rotation; | 857 | unsigned int rotation; |
| 977 | uint32_t supported_rotations; | 858 | uint32_t supported_rotations; |
| 978 | const struct dpu_sspp_cfg *pipe_hw_caps = pdpu->pipe_hw->cap; | 859 | const struct dpu_sspp_cfg *pipe_hw_caps = pstate->pipe.sspp->cap; |
| 979 | const struct dpu_sspp_sub_blks *sblk = pdpu->pipe_hw->cap->sblk; | 860 | const struct dpu_sspp_sub_blks *sblk = pstate->pipe.sspp->cap->sblk; |
| 980 | 861 | ||
| 981 | if (new_plane_state->crtc) | 862 | if (new_plane_state->crtc) |
| 982 | crtc_state = drm_atomic_get_new_crtc_state(state, | 863 | crtc_state = drm_atomic_get_new_crtc_state(state, |
| @@ -994,55 +875,99 @@ static int dpu_plane_atomic_check(struct drm_plane *plane, · 11 unmodified lines | |||
| 994 | if (!new_plane_state->visible) | 875 | if (!new_plane_state->visible) |
| 995 | return 0; | 876 | return 0; |
| 996 | 877 | ||
| 997 | src.x1 = new_plane_state->src_x >> 16; | 878 | pipe->multirect_index = DPU_SSPP_RECT_SOLO; |
| 998 | src.y1 = new_plane_state->src_y >> 16; | 879 | pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE; |
| 999 | src.x2 = src.x1 + (new_plane_state->src_w >> 16); | 880 | r_pipe->multirect_index = DPU_SSPP_RECT_SOLO; |
| 1000 | src.y2 = src.y1 + (new_plane_state->src_h >> 16); | 881 | r_pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE; |
| 882 | r_pipe->sspp = NULL; | ||
| 883 | |||
| 884 | pstate->stage = DPU_STAGE_0 + pstate->base.normalized_zpos; | ||
| 885 | if (pstate->stage >= pdpu->catalog->caps->max_mixer_blendstages) { | ||
| 886 | DPU_ERROR("> %d plane stages assigned\n", | ||
| 887 | pdpu->catalog->caps->max_mixer_blendstages - DPU_STAGE_0); | ||
| 888 | return -EINVAL; | ||
| 889 | } | ||
| 890 | |||
| 891 | pipe_cfg->src_rect = new_plane_state->src; | ||
| 892 | |||
| 893 | /* state->src is 16.16, src_rect is not */ | ||
| 894 | pipe_cfg->src_rect.x1 >>= 16; | ||
| 895 | pipe_cfg->src_rect.x2 >>= 16; | ||
| 896 | pipe_cfg->src_rect.y1 >>= 16; | ||
| 897 | pipe_cfg->src_rect.y2 >>= 16; | ||
| 1001 | 898 | ||
| 1002 | dst = drm_plane_state_dest(new_plane_state); | 899 | pipe_cfg->dst_rect = new_plane_state->dst; |
| 1003 | 900 | ||
| 1004 | fb_rect.x2 = new_plane_state->fb->width; | 901 | fb_rect.x2 = new_plane_state->fb->width; |
| 1005 | fb_rect.y2 = new_plane_state->fb->height; | 902 | fb_rect.y2 = new_plane_state->fb->height; |
| 1006 | 903 | ||
| 1007 | max_linewidth = pdpu->catalog->caps->max_linewidth; | 904 | /* Ensure fb size is supported */ |
| 905 | if (drm_rect_width(&fb_rect) > MAX_IMG_WIDTH || | ||
| 906 | drm_rect_height(&fb_rect) > MAX_IMG_HEIGHT) { | ||
| 907 | DPU_DEBUG_PLANE(pdpu, "invalid framebuffer " DRM_RECT_FMT "\n", | ||
| 908 | DRM_RECT_ARG(&fb_rect)); | ||
| 909 | return -E2BIG; | ||
| 910 | } | ||
| 1008 | 911 | ||
| 1009 | fmt = to_dpu_format(msm_framebuffer_format(new_plane_state->fb)); | 912 | fmt = to_dpu_format(msm_framebuffer_format(new_plane_state->fb)); |
| 1010 | 913 | ||
| 1011 | min_src_size = DPU_FORMAT_IS_YUV(fmt) ? 2 : 1; | 914 | max_linewidth = pdpu->catalog->caps->max_linewidth; |
| 1012 | 915 | ||
| 1013 | if (DPU_FORMAT_IS_YUV(fmt) && | 916 | if (drm_rect_width(&pipe_cfg->src_rect) > max_linewidth) { |
| 1014 | (!(pipe_hw_caps->features & DPU_SSPP_SCALER) || | 917 | /* |
| 1015 | !(pipe_hw_caps->features & DPU_SSPP_CSC_ANY))) { | 918 | * In parallel multirect case only the half of the usual width |
| 1016 | DPU_DEBUG_PLANE(pdpu, | 919 | * is supported for tiled formats. If we are here, we know that |
| 1017 | "plane doesn't have scaler/csc for yuv\n"); | 920 | * full width is more than max_linewidth, thus each rect is |
| 1018 | return -EINVAL; | 921 | * wider than allowed. |
| 922 | */ | ||
| 923 | if (DPU_FORMAT_IS_UBWC(fmt)) { | ||
| 924 | DPU_DEBUG_PLANE(pdpu, "invalid src " DRM_RECT_FMT " line:%u, tiled format\n", | ||
| 925 | DRM_RECT_ARG(&pipe_cfg->src_rect), max_linewidth); | ||
| 926 | return -E2BIG; | ||
| 927 | } | ||
| 1019 | 928 | ||
| 1020 | /* check src bounds */ | 929 | if (drm_rect_width(&pipe_cfg->src_rect) > 2 * max_linewidth) { |
| 1021 | } else if (!dpu_plane_validate_src(&src, &fb_rect, min_src_size)) { | 930 | DPU_DEBUG_PLANE(pdpu, "invalid src " DRM_RECT_FMT " line:%u\n", |
| 1022 | DPU_DEBUG_PLANE(pdpu, "invalid source " DRM_RECT_FMT "\n", | 931 | DRM_RECT_ARG(&pipe_cfg->src_rect), max_linewidth); |
| 1023 | DRM_RECT_ARG(&src)); | 932 | return -E2BIG; |
| 1024 | return -E2BIG; | 933 | } |
| 1025 | 934 | ||
| 1026 | /* valid yuv image */ | 935 | if (drm_rect_width(&pipe_cfg->src_rect) != drm_rect_width(&pipe_cfg->dst_rect) || |
| 1027 | } else if (DPU_FORMAT_IS_YUV(fmt) && | 936 | drm_rect_height(&pipe_cfg->src_rect) != drm_rect_height(&pipe_cfg->dst_rect) || |
| 1028 | (src.x1 & 0x1 || src.y1 & 0x1 || | 937 | (!test_bit(DPU_SSPP_SMART_DMA_V1, &pipe->sspp->cap->features) && |
| 1029 | drm_rect_width(&src) & 0x1 || | 938 | !test_bit(DPU_SSPP_SMART_DMA_V2, &pipe->sspp->cap->features)) || |
| 1030 | drm_rect_height(&src) & 0x1)) { | 939 | DPU_FORMAT_IS_YUV(fmt)) { |
| 1031 | DPU_DEBUG_PLANE(pdpu, "invalid yuv source " DRM_RECT_FMT "\n", | 940 | DPU_DEBUG_PLANE(pdpu, "invalid src " DRM_RECT_FMT " line:%u, can't use split source\n", |
| 1032 | DRM_RECT_ARG(&src)); | 941 | DRM_RECT_ARG(&pipe_cfg->src_rect), max_linewidth); |
| 1033 | return -EINVAL; | 942 | return -E2BIG; |
| 943 | } | ||
| 1034 | 944 | ||
| 1035 | /* min dst support */ | 945 | /* |
| 1036 | } else if (drm_rect_width(&dst) < 0x1 || drm_rect_height(&dst) < 0x1) { | 946 | * Use multirect for wide plane. We do not support dynamic |
| 1037 | DPU_DEBUG_PLANE(pdpu, "invalid dest rect " DRM_RECT_FMT "\n", | 947 | * assignment of SSPPs, so we know the configuration. |
| 1038 | DRM_RECT_ARG(&dst)); | 948 | */ |
| 1039 | return -EINVAL; | 949 | pipe->multirect_index = DPU_SSPP_RECT_0; |
| 950 | pipe->multirect_mode = DPU_SSPP_MULTIRECT_PARALLEL; | ||
| 951 | |||
| 952 | r_pipe->sspp = pipe->sspp; | ||
| 953 | r_pipe->multirect_index = DPU_SSPP_RECT_1; | ||
| 954 | r_pipe->multirect_mode = DPU_SSPP_MULTIRECT_PARALLEL; | ||
| 955 | |||
| 956 | *r_pipe_cfg = *pipe_cfg; | ||
| 957 | pipe_cfg->src_rect.x2 = (pipe_cfg->src_rect.x1 + pipe_cfg->src_rect.x2) >> 1; | ||
| 958 | pipe_cfg->dst_rect.x2 = (pipe_cfg->dst_rect.x1 + pipe_cfg->dst_rect.x2) >> 1; | ||
| 959 | r_pipe_cfg->src_rect.x1 = pipe_cfg->src_rect.x2; | ||
| 960 | r_pipe_cfg->dst_rect.x1 = pipe_cfg->dst_rect.x2; | ||
| 961 | } | ||
| 1040 | 962 | ||
| 1041 | /* check decimated source width */ | 963 | ret = dpu_plane_atomic_check_pipe(pdpu, pipe, pipe_cfg, fmt); |
| 1042 | } else if (drm_rect_width(&src) > max_linewidth) { | 964 | if (ret) |
| 1043 | DPU_DEBUG_PLANE(pdpu, "invalid src " DRM_RECT_FMT " line:%u\n", | 965 | return ret; |
| 1044 | DRM_RECT_ARG(&src), max_linewidth); | 966 | |
| 1045 | return -E2BIG; | 967 | if (r_pipe->sspp) { |
| 968 | ret = dpu_plane_atomic_check_pipe(pdpu, r_pipe, r_pipe_cfg, fmt); | ||
| 969 | if (ret) | ||
| 970 | return ret; | ||
| 1046 | } | 971 | } |
| 1047 | 972 | ||
| 1048 | supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0; | 973 | supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0; |
| @@ -1055,7 +980,7 @@ static int dpu_plane_atomic_check(struct drm_plane *plane, · 6 unmodified lines | |||
| 1055 | 980 | ||
| 1056 | if ((pipe_hw_caps->features & BIT(DPU_SSPP_INLINE_ROTATION)) && | 981 | if ((pipe_hw_caps->features & BIT(DPU_SSPP_INLINE_ROTATION)) && |
| 1057 | (rotation & DRM_MODE_ROTATE_90)) { | 982 | (rotation & DRM_MODE_ROTATE_90)) { |
| 1058 | ret = dpu_plane_check_inline_rotation(pdpu, sblk, src, fmt); | 983 | ret = dpu_plane_check_inline_rotation(pdpu, sblk, pipe_cfg->src_rect, fmt); |
| 1059 | if (ret) | 984 | if (ret) |
| 1060 | return ret; | 985 | return ret; |
| 1061 | } | 986 | } |
| @@ -1066,6 +991,28 @@ static int dpu_plane_atomic_check(struct drm_plane *plane, · 4 unmodified lines | |||
| 1066 | return 0; | 991 | return 0; |
| 1067 | } | 992 | } |
| 1068 | 993 | ||
| 994 | static void dpu_plane_flush_csc(struct dpu_plane *pdpu, struct dpu_sw_pipe *pipe) | ||
| 995 | { | ||
| 996 | const struct dpu_format *format = | ||
| 997 | to_dpu_format(msm_framebuffer_format(pdpu->base.state->fb)); | ||
| 998 | const struct dpu_csc_cfg *csc_ptr; | ||
| 999 | |||
| 1000 | if (!pipe->sspp || !pipe->sspp->ops.setup_csc) | ||
| 1001 | return; | ||
| 1002 | |||
| 1003 | csc_ptr = _dpu_plane_get_csc(pipe, format); | ||
| 1004 | if (!csc_ptr) | ||
| 1005 | return; | ||
| 1006 | |||
| 1007 | DPU_DEBUG_PLANE(pdpu, "using 0x%X 0x%X 0x%X...\n", | ||
| 1008 | csc_ptr->csc_mv[0], | ||
| 1009 | csc_ptr->csc_mv[1], | ||
| 1010 | csc_ptr->csc_mv[2]); | ||
| 1011 | |||
| 1012 | pipe->sspp->ops.setup_csc(pipe->sspp, csc_ptr); | ||
| 1013 | |||
| 1014 | } | ||
| 1015 | |||
| 1069 | void dpu_plane_flush(struct drm_plane *plane) | 1016 | void dpu_plane_flush(struct drm_plane *plane) |
| 1070 | { | 1017 | { |
| 1071 | struct dpu_plane *pdpu; | 1018 | struct dpu_plane *pdpu; |
| @@ -1089,12 +1036,9 @@ void dpu_plane_flush(struct drm_plane *plane) · 17 unmodified lines | |||
| 1089 | else if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) | 1036 | else if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) |
| 1090 | /* force 100% alpha */ | 1037 | /* force 100% alpha */ |
| 1091 | _dpu_plane_color_fill(pdpu, pdpu->color_fill, 0xFF); | 1038 | _dpu_plane_color_fill(pdpu, pdpu->color_fill, 0xFF); |
| 1092 | else if (pdpu->pipe_hw && pdpu->pipe_hw->ops.setup_csc) { | 1039 | else { |
| 1093 | const struct dpu_format *fmt = to_dpu_format(msm_framebuffer_format(plane->state->fb)); | 1040 | dpu_plane_flush_csc(pdpu, &pstate->pipe); |
| 1094 | const struct dpu_csc_cfg *csc_ptr = _dpu_plane_get_csc(pdpu, fmt); | 1041 | dpu_plane_flush_csc(pdpu, &pstate->r_pipe); |
| 1095 | |||
| 1096 | if (csc_ptr) | ||
| 1097 | pdpu->pipe_hw->ops.setup_csc(pdpu->pipe_hw, csc_ptr); | ||
| 1098 | } | 1042 | } |
| 1099 | 1043 | ||
| 1100 | /* flag h/w flush complete */ | 1044 | /* flag h/w flush complete */ |
| @@ -1118,45 +1062,24 @@ void dpu_plane_set_error(struct drm_plane *plane, bool error) · 17 unmodified lines | |||
| 1118 | pdpu->is_error = error; | 1062 | pdpu->is_error = error; |
| 1119 | } | 1063 | } |
| 1120 | 1064 | ||
| 1121 | static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) | 1065 | static void dpu_plane_sspp_update_pipe(struct drm_plane *plane, |
| 1066 | struct dpu_sw_pipe *pipe, | ||
| 1067 | struct dpu_sw_pipe_cfg *pipe_cfg, | ||
| 1068 | const struct dpu_format *fmt, | ||
| 1069 | int frame_rate, | ||
| 1070 | struct dpu_hw_fmt_layout *layout) | ||
| 1122 | { | 1071 | { |
| 1123 | uint32_t src_flags; | 1072 | uint32_t src_flags; |
| 1124 | struct dpu_plane *pdpu = to_dpu_plane(plane); | 1073 | struct dpu_plane *pdpu = to_dpu_plane(plane); |
| 1125 | struct drm_plane_state *state = plane->state; | 1074 | struct drm_plane_state *state = plane->state; |
| 1126 | struct dpu_plane_state *pstate = to_dpu_plane_state(state); | 1075 | struct dpu_plane_state *pstate = to_dpu_plane_state(state); |
| 1127 | struct drm_crtc *crtc = state->crtc; | ||
| 1128 | struct drm_framebuffer *fb = state->fb; | ||
| 1129 | bool is_rt_pipe; | ||
| 1130 | const struct dpu_format *fmt = | ||
| 1131 | to_dpu_format(msm_framebuffer_format(fb)); | ||
| 1132 | struct dpu_hw_pipe_cfg pipe_cfg; | ||
| 1133 | |||
| 1134 | memset(&pipe_cfg, 0, sizeof(struct dpu_hw_pipe_cfg)); | ||
| 1135 | 1076 | ||
| 1136 | _dpu_plane_set_scanout(plane, pstate, &pipe_cfg, fb); | 1077 | if (layout && pipe->sspp->ops.setup_sourceaddress) { |
| 1137 | 1078 | trace_dpu_plane_set_scanout(pipe, layout); | |
| 1138 | pstate->pending = true; | 1079 | pipe->sspp->ops.setup_sourceaddress(pipe, layout); |
| 1139 | 1080 | } | |
| 1140 | is_rt_pipe = (dpu_crtc_get_client_type(crtc) != NRT_CLIENT); | ||
| 1141 | pstate->needs_qos_remap |= (is_rt_pipe != pdpu->is_rt_pipe); | ||
| 1142 | pdpu->is_rt_pipe = is_rt_pipe; | ||
| 1143 | |||
| 1144 | _dpu_plane_set_qos_ctrl(plane, false, DPU_PLANE_QOS_PANIC_CTRL); | ||
| 1145 | |||
| 1146 | DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FP_FMT "->crtc%u " DRM_RECT_FMT | ||
| 1147 | ", %4.4s ubwc %d\n", fb->base.id, DRM_RECT_FP_ARG(&state->src), | ||
| 1148 | crtc->base.id, DRM_RECT_ARG(&state->dst), | ||
| 1149 | (char *)&fmt->base.pixel_format, DPU_FORMAT_IS_UBWC(fmt)); | ||
| 1150 | |||
| 1151 | pipe_cfg.src_rect = state->src; | ||
| 1152 | |||
| 1153 | /* state->src is 16.16, src_rect is not */ | ||
| 1154 | pipe_cfg.src_rect.x1 >>= 16; | ||
| 1155 | pipe_cfg.src_rect.x2 >>= 16; | ||
| 1156 | pipe_cfg.src_rect.y1 >>= 16; | ||
| 1157 | pipe_cfg.src_rect.y2 >>= 16; | ||
| 1158 | 1081 | ||
| 1159 | pipe_cfg.dst_rect = state->dst; | 1082 | _dpu_plane_set_qos_ctrl(plane, pipe, false, DPU_PLANE_QOS_PANIC_CTRL); |
| 1160 | 1083 | ||
| 1161 | /* override for color fill */ | 1084 | /* override for color fill */ |
| 1162 | if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) { | 1085 | if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) { |
| @@ -1164,21 +1087,18 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) · 1 unmodified line | |||
| 1164 | return; | 1087 | return; |
| 1165 | } | 1088 | } |
| 1166 | 1089 | ||
| 1167 | if (pdpu->pipe_hw->ops.setup_rects) { | 1090 | if (pipe->sspp->ops.setup_rects) { |
| 1168 | pdpu->pipe_hw->ops.setup_rects(pdpu->pipe_hw, | 1091 | pipe->sspp->ops.setup_rects(pipe, |
| 1169 | &pipe_cfg, | 1092 | pipe_cfg); |
| 1170 | pstate->multirect_index); | ||
| 1171 | } | 1093 | } |
| 1172 | 1094 | ||
| 1173 | _dpu_plane_setup_scaler(pdpu, pstate, fmt, false, &pipe_cfg); | 1095 | _dpu_plane_setup_scaler(pipe, fmt, false, pipe_cfg, pstate->rotation); |
| 1174 | 1096 | ||
| 1175 | if (pdpu->pipe_hw->ops.setup_multirect) | 1097 | if (pipe->sspp->ops.setup_multirect) |
| 1176 | pdpu->pipe_hw->ops.setup_multirect( | 1098 | pipe->sspp->ops.setup_multirect( |
| 1177 | pdpu->pipe_hw, | 1099 | pipe); |
| 1178 | pstate->multirect_index, | ||
| 1179 | pstate->multirect_mode); | ||
| 1180 | 1100 | ||
| 1181 | if (pdpu->pipe_hw->ops.setup_format) { | 1101 | if (pipe->sspp->ops.setup_format) { |
| 1182 | unsigned int rotation = pstate->rotation; | 1102 | unsigned int rotation = pstate->rotation; |
| 1183 | 1103 | ||
| 1184 | src_flags = 0x0; | 1104 | src_flags = 0x0; |
| @@ -1193,10 +1113,9 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) · 8 unmodified lines | |||
| 1193 | src_flags |= DPU_SSPP_ROT_90; | 1113 | src_flags |= DPU_SSPP_ROT_90; |
| 1194 | 1114 | ||
| 1195 | /* update format */ | 1115 | /* update format */ |
| 1196 | pdpu->pipe_hw->ops.setup_format(pdpu->pipe_hw, fmt, src_flags, | 1116 | pipe->sspp->ops.setup_format(pipe, fmt, src_flags); |
| 1197 | pstate->multirect_index); | ||
| 1198 | 1117 | ||
| 1199 | if (pdpu->pipe_hw->ops.setup_cdp) { | 1118 | if (pipe->sspp->ops.setup_cdp) { |
| 1200 | struct dpu_hw_cdp_cfg cdp_cfg; | 1119 | struct dpu_hw_cdp_cfg cdp_cfg; |
| 1201 | 1120 | ||
| 1202 | memset(&cdp_cfg, 0, sizeof(struct dpu_hw_cdp_cfg)); | 1121 | memset(&cdp_cfg, 0, sizeof(struct dpu_hw_cdp_cfg)); |
| @@ -1210,35 +1129,100 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) · 7 unmodified lines | |||
| 1210 | DPU_FORMAT_IS_TILE(fmt); | 1129 | DPU_FORMAT_IS_TILE(fmt); |
| 1211 | cdp_cfg.preload_ahead = DPU_SSPP_CDP_PRELOAD_AHEAD_64; | 1130 | cdp_cfg.preload_ahead = DPU_SSPP_CDP_PRELOAD_AHEAD_64; |
| 1212 | 1131 | ||
| 1213 | pdpu->pipe_hw->ops.setup_cdp(pdpu->pipe_hw, &cdp_cfg, pstate->multirect_index); | 1132 | pipe->sspp->ops.setup_cdp(pipe, &cdp_cfg); |
| 1214 | } | 1133 | } |
| 1215 | } | 1134 | } |
| 1216 | 1135 | ||
| 1217 | _dpu_plane_set_qos_lut(plane, fb, &pipe_cfg); | 1136 | _dpu_plane_set_qos_lut(plane, pipe, fmt, pipe_cfg); |
| 1218 | _dpu_plane_set_danger_lut(plane, fb); | 1137 | _dpu_plane_set_danger_lut(plane, pipe, fmt); |
| 1219 | 1138 | ||
| 1220 | if (plane->type != DRM_PLANE_TYPE_CURSOR) { | 1139 | if (plane->type != DRM_PLANE_TYPE_CURSOR) { |
| 1221 | _dpu_plane_set_qos_ctrl(plane, true, DPU_PLANE_QOS_PANIC_CTRL); | 1140 | _dpu_plane_set_qos_ctrl(plane, pipe, true, DPU_PLANE_QOS_PANIC_CTRL); |
| 1222 | _dpu_plane_set_ot_limit(plane, crtc, &pipe_cfg); | 1141 | _dpu_plane_set_ot_limit(plane, pipe, pipe_cfg, frame_rate); |
| 1223 | } | 1142 | } |
| 1224 | 1143 | ||
| 1225 | if (pstate->needs_qos_remap) { | 1144 | if (pstate->needs_qos_remap) |
| 1226 | pstate->needs_qos_remap = false; | 1145 | _dpu_plane_set_qos_remap(plane, pipe); |
| 1227 | _dpu_plane_set_qos_remap(plane); | 1146 | } |
| 1147 | |||
| 1148 | static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) | ||
| 1149 | { | ||
| 1150 | struct dpu_plane *pdpu = to_dpu_plane(plane); | ||
| 1151 | struct drm_plane_state *state = plane->state; | ||
| 1152 | struct dpu_plane_state *pstate = to_dpu_plane_state(state); | ||
| 1153 | struct dpu_sw_pipe *pipe = &pstate->pipe; | ||
| 1154 | struct dpu_sw_pipe *r_pipe = &pstate->r_pipe; | ||
| 1155 | struct drm_crtc *crtc = state->crtc; | ||
| 1156 | struct drm_framebuffer *fb = state->fb; | ||
| 1157 | bool is_rt_pipe; | ||
| 1158 | const struct dpu_format *fmt = | ||
| 1159 | to_dpu_format(msm_framebuffer_format(fb)); | ||
| 1160 | struct dpu_sw_pipe_cfg *pipe_cfg = &pstate->pipe_cfg; | ||
| 1161 | struct dpu_sw_pipe_cfg *r_pipe_cfg = &pstate->r_pipe_cfg; | ||
| 1162 | struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base); | ||
| 1163 | struct msm_gem_address_space *aspace = kms->base.aspace; | ||
| 1164 | struct dpu_hw_fmt_layout layout; | ||
| 1165 | bool layout_valid = false; | ||
| 1166 | int ret; | ||
| 1167 | |||
| 1168 | ret = dpu_format_populate_layout(aspace, fb, &layout); | ||
| 1169 | if (ret) | ||
| 1170 | DPU_ERROR_PLANE(pdpu, "failed to get format layout, %d\n", ret); | ||
| 1171 | else | ||
| 1172 | layout_valid = true; | ||
| 1173 | |||
| 1174 | pstate->pending = true; | ||
| 1175 | |||
| 1176 | is_rt_pipe = (dpu_crtc_get_client_type(crtc) != NRT_CLIENT); | ||
| 1177 | pstate->needs_qos_remap |= (is_rt_pipe != pdpu->is_rt_pipe); | ||
| 1178 | pdpu->is_rt_pipe = is_rt_pipe; | ||
| 1179 | |||
| 1180 | DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FP_FMT "->crtc%u " DRM_RECT_FMT | ||
| 1181 | ", %4.4s ubwc %d\n", fb->base.id, DRM_RECT_FP_ARG(&state->src), | ||
| 1182 | crtc->base.id, DRM_RECT_ARG(&state->dst), | ||
| 1183 | (char *)&fmt->base.pixel_format, DPU_FORMAT_IS_UBWC(fmt)); | ||
| 1184 | |||
| 1185 | dpu_plane_sspp_update_pipe(plane, pipe, pipe_cfg, fmt, | ||
| 1186 | drm_mode_vrefresh(&crtc->mode), | ||
| 1187 | layout_valid ? &layout : NULL); | ||
| 1188 | |||
| 1189 | if (r_pipe->sspp) { | ||
| 1190 | dpu_plane_sspp_update_pipe(plane, r_pipe, r_pipe_cfg, fmt, | ||
| 1191 | drm_mode_vrefresh(&crtc->mode), | ||
| 1192 | layout_valid ? &layout : NULL); | ||
| 1228 | } | 1193 | } |
| 1229 | 1194 | ||
| 1230 | _dpu_plane_calc_bw(plane, fb, &pipe_cfg); | 1195 | if (pstate->needs_qos_remap) |
| 1196 | pstate->needs_qos_remap = false; | ||
| 1197 | |||
| 1198 | pstate->plane_fetch_bw = _dpu_plane_calc_bw(pdpu->catalog, fmt, | ||
| 1199 | &crtc->mode, pipe_cfg); | ||
| 1200 | |||
| 1201 | pstate->plane_clk = _dpu_plane_calc_clk(&crtc->mode, pipe_cfg); | ||
| 1231 | 1202 | ||
| 1232 | _dpu_plane_calc_clk(plane, &pipe_cfg); | 1203 | if (r_pipe->sspp) { |
| 1204 | pstate->plane_fetch_bw += _dpu_plane_calc_bw(pdpu->catalog, fmt, &crtc->mode, r_pipe_cfg); | ||
| 1205 | |||
| 1206 | pstate->plane_clk = max(pstate->plane_clk, _dpu_plane_calc_clk(&crtc->mode, r_pipe_cfg)); | ||
| 1207 | } | ||
| 1233 | } | 1208 | } |
| 1234 | 1209 | ||
| 1235 | static void _dpu_plane_atomic_disable(struct drm_plane *plane) | 1210 | static void _dpu_plane_atomic_disable(struct drm_plane *plane) |
| 1236 | { | 1211 | { |
| 1237 | struct drm_plane_state *state = plane->state; | 1212 | struct drm_plane_state *state = plane->state; |
| 1238 | struct dpu_plane_state *pstate = to_dpu_plane_state(state); | 1213 | struct dpu_plane_state *pstate = to_dpu_plane_state(state); |
| 1214 | struct dpu_sw_pipe *r_pipe = &pstate->r_pipe; | ||
| 1239 | 1215 | ||
| 1240 | trace_dpu_plane_disable(DRMID(plane), false, | 1216 | trace_dpu_plane_disable(DRMID(plane), false, |
| 1241 | pstate->multirect_mode); | 1217 | pstate->pipe.multirect_mode); |
| 1218 | |||
| 1219 | if (r_pipe->sspp) { | ||
| 1220 | r_pipe->multirect_index = DPU_SSPP_RECT_SOLO; | ||
| 1221 | r_pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE; | ||
| 1222 | |||
| 1223 | if (r_pipe->sspp->ops.setup_multirect) | ||
| 1224 | r_pipe->sspp->ops.setup_multirect(r_pipe); | ||
| 1225 | } | ||
| 1242 | 1226 | ||
| 1243 | pstate->pending = true; | 1227 | pstate->pending = true; |
| 1244 | } | 1228 | } |
| @@ -1264,19 +1248,22 @@ static void dpu_plane_atomic_update(struct drm_plane *plane, · 19 unmodified lines | |||
| 1264 | static void dpu_plane_destroy(struct drm_plane *plane) | 1248 | static void dpu_plane_destroy(struct drm_plane *plane) |
| 1265 | { | 1249 | { |
| 1266 | struct dpu_plane *pdpu = plane ? to_dpu_plane(plane) : NULL; | 1250 | struct dpu_plane *pdpu = plane ? to_dpu_plane(plane) : NULL; |
| 1251 | struct dpu_plane_state *pstate; | ||
| 1267 | 1252 | ||
| 1268 | DPU_DEBUG_PLANE(pdpu, "\n"); | 1253 | DPU_DEBUG_PLANE(pdpu, "\n"); |
| 1269 | 1254 | ||
| 1270 | if (pdpu) { | 1255 | if (pdpu) { |
| 1271 | _dpu_plane_set_qos_ctrl(plane, false, DPU_PLANE_QOS_PANIC_CTRL); | 1256 | pstate = to_dpu_plane_state(plane->state); |
| 1257 | _dpu_plane_set_qos_ctrl(plane, &pstate->pipe, false, DPU_PLANE_QOS_PANIC_CTRL); | ||
| 1258 | |||
| 1259 | if (pstate->r_pipe.sspp) | ||
| 1260 | _dpu_plane_set_qos_ctrl(plane, &pstate->r_pipe, false, DPU_PLANE_QOS_PANIC_CTRL); | ||
| 1272 | 1261 | ||
| 1273 | mutex_destroy(&pdpu->lock); | 1262 | mutex_destroy(&pdpu->lock); |
| 1274 | 1263 | ||
| 1275 | /* this will destroy the states as well */ | 1264 | /* this will destroy the states as well */ |
| 1276 | drm_plane_cleanup(plane); | 1265 | drm_plane_cleanup(plane); |
| 1277 | 1266 | ||
| 1278 | dpu_hw_sspp_destroy(pdpu->pipe_hw); | ||
| 1279 | |||
| 1280 | kfree(pdpu); | 1267 | kfree(pdpu); |
| 1281 | } | 1268 | } |
| 1282 | } | 1269 | } |
| @@ -1352,18 +1339,36 @@ static void dpu_plane_atomic_print_state(struct drm_printer *p, · 69 unmodified lines | |||
| 1352 | const struct drm_plane_state *state) | 1339 | const struct drm_plane_state *state) |
| 1353 | { | 1340 | { |
| 1354 | const struct dpu_plane_state *pstate = to_dpu_plane_state(state); | 1341 | const struct dpu_plane_state *pstate = to_dpu_plane_state(state); |
| 1355 | const struct dpu_plane *pdpu = to_dpu_plane(state->plane); | 1342 | const struct dpu_sw_pipe *pipe = &pstate->pipe; |
| 1343 | const struct dpu_sw_pipe_cfg *pipe_cfg = &pstate->pipe_cfg; | ||
| 1344 | const struct dpu_sw_pipe *r_pipe = &pstate->r_pipe; | ||
| 1345 | const struct dpu_sw_pipe_cfg *r_pipe_cfg = &pstate->r_pipe_cfg; | ||
| 1356 | 1346 | ||
| 1357 | drm_printf(p, "\tstage=%d\n", pstate->stage); | 1347 | drm_printf(p, "\tstage=%d\n", pstate->stage); |
| 1358 | drm_printf(p, "\tsspp=%s\n", pdpu->pipe_hw->cap->name); | 1348 | |
| 1359 | drm_printf(p, "\tmultirect_mode=%s\n", dpu_get_multirect_mode(pstate->multirect_mode)); | 1349 | drm_printf(p, "\tsspp[0]=%s\n", pipe->sspp->cap->name); |
| 1360 | drm_printf(p, "\tmultirect_index=%s\n", dpu_get_multirect_index(pstate->multirect_index)); | 1350 | drm_printf(p, "\tmultirect_mode[0]=%s\n", dpu_get_multirect_mode(pipe->multirect_mode)); |
| 1351 | drm_printf(p, "\tmultirect_index[0]=%s\n", | ||
| 1352 | dpu_get_multirect_index(pipe->multirect_index)); | ||
| 1353 | drm_printf(p, "\tsrc[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->src_rect)); | ||
| 1354 | drm_printf(p, "\tdst[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->dst_rect)); | ||
| 1355 | |||
| 1356 | if (r_pipe->sspp) { | ||
| 1357 | drm_printf(p, "\tsspp[1]=%s\n", r_pipe->sspp->cap->name); | ||
| 1358 | drm_printf(p, "\tmultirect_mode[1]=%s\n", | ||
| 1359 | dpu_get_multirect_mode(r_pipe->multirect_mode)); | ||
| 1360 | drm_printf(p, "\tmultirect_index[1]=%s\n", | ||
| 1361 | dpu_get_multirect_index(r_pipe->multirect_index)); | ||
| 1362 | drm_printf(p, "\tsrc[1]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&r_pipe_cfg->src_rect)); | ||
| 1363 | drm_printf(p, "\tdst[1]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&r_pipe_cfg->dst_rect)); | ||
| 1364 | } | ||
| 1361 | } | 1365 | } |
| 1362 | 1366 | ||
| 1363 | static void dpu_plane_reset(struct drm_plane *plane) | 1367 | static void dpu_plane_reset(struct drm_plane *plane) |
| 1364 | { | 1368 | { |
| 1365 | struct dpu_plane *pdpu; | 1369 | struct dpu_plane *pdpu; |
| 1366 | struct dpu_plane_state *pstate; | 1370 | struct dpu_plane_state *pstate; |
| 1371 | struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); | ||
| 1367 | 1372 | ||
| 1368 | if (!plane) { | 1373 | if (!plane) { |
| 1369 | DPU_ERROR("invalid plane\n"); | 1374 | DPU_ERROR("invalid plane\n"); |
| @@ -1385,6 +1390,16 @@ static void dpu_plane_reset(struct drm_plane *plane) · 15 unmodified lines | |||
| 1385 | return; | 1390 | return; |
| 1386 | } | 1391 | } |
| 1387 | 1392 | ||
| 1393 | /* | ||
| 1394 | * Set the SSPP here until we have proper virtualized DPU planes. | ||
| 1395 | * This is the place where the state is allocated, so fill it fully. | ||
| 1396 | */ | ||
| 1397 | pstate->pipe.sspp = dpu_rm_get_sspp(&dpu_kms->rm, pdpu->pipe); | ||
| 1398 | pstate->pipe.multirect_index = DPU_SSPP_RECT_SOLO; | ||
| 1399 | pstate->pipe.multirect_mode = DPU_SSPP_MULTIRECT_NONE; | ||
| 1400 | |||
| 1401 | pstate->r_pipe.sspp = NULL; | ||
| 1402 | |||
| 1388 | __drm_atomic_helper_plane_reset(plane, &pstate->base); | 1403 | __drm_atomic_helper_plane_reset(plane, &pstate->base); |
| 1389 | } | 1404 | } |
| 1390 | 1405 | ||
| @@ -1392,31 +1407,18 @@ static void dpu_plane_reset(struct drm_plane *plane) · 1 unmodified line | |||
| 1392 | void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable) | 1407 | void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable) |
| 1393 | { | 1408 | { |
| 1394 | struct dpu_plane *pdpu = to_dpu_plane(plane); | 1409 | struct dpu_plane *pdpu = to_dpu_plane(plane); |
| 1410 | struct dpu_plane_state *pstate = to_dpu_plane_state(plane->state); | ||
| 1395 | struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); | 1411 | struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); |
| 1396 | 1412 | ||
| 1397 | if (!pdpu->is_rt_pipe) | 1413 | if (!pdpu->is_rt_pipe) |
| 1398 | return; | 1414 | return; |
| 1399 | 1415 | ||
| 1400 | pm_runtime_get_sync(&dpu_kms->pdev->dev); | 1416 | pm_runtime_get_sync(&dpu_kms->pdev->dev); |
| 1401 | _dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL); | 1417 | _dpu_plane_set_qos_ctrl(plane, &pstate->pipe, enable, DPU_PLANE_QOS_PANIC_CTRL); |
| 1418 | if (pstate->r_pipe.sspp) | ||
| 1419 | _dpu_plane_set_qos_ctrl(plane, &pstate->r_pipe, enable, DPU_PLANE_QOS_PANIC_CTRL); | ||
| 1402 | pm_runtime_put_sync(&dpu_kms->pdev->dev); | 1420 | pm_runtime_put_sync(&dpu_kms->pdev->dev); |
| 1403 | } | 1421 | } |
| 1404 | |||
| 1405 | /* SSPP live inside dpu_plane private data only. Enumerate them here. */ | ||
| 1406 | void dpu_debugfs_sspp_init(struct dpu_kms *dpu_kms, struct dentry *debugfs_root) | ||
| 1407 | { | ||
| 1408 | struct drm_plane *plane; | ||
| 1409 | struct dentry *entry = debugfs_create_dir("sspp", debugfs_root); | ||
| 1410 | |||
| 1411 | if (IS_ERR(entry)) | ||
| 1412 | return; | ||
| 1413 | |||
| 1414 | drm_for_each_plane(plane, dpu_kms->dev) { | ||
| 1415 | struct dpu_plane *pdpu = to_dpu_plane(plane); | ||
| 1416 | |||
| 1417 | _dpu_hw_sspp_init_debugfs(pdpu->pipe_hw, dpu_kms, entry); | ||
| 1418 | } | ||
| 1419 | } | ||
| 1420 | #endif | 1422 | #endif |
| 1421 | 1423 | ||
| 1422 | static bool dpu_plane_format_mod_supported(struct drm_plane *plane, | 1424 | static bool dpu_plane_format_mod_supported(struct drm_plane *plane, |
| @@ -1450,11 +1452,6 @@ static const struct drm_plane_helper_funcs dpu_plane_helper_funcs = { · 27 unmodified lines | |||
| 1450 | .atomic_update = dpu_plane_atomic_update, | 1452 | .atomic_update = dpu_plane_atomic_update, |
| 1451 | }; | 1453 | }; |
| 1452 | 1454 | ||
| 1453 | enum dpu_sspp dpu_plane_pipe(struct drm_plane *plane) | ||
| 1454 | { | ||
| 1455 | return plane ? to_dpu_plane(plane)->pipe : SSPP_NONE; | ||
| 1456 | } | ||
| 1457 | |||
| 1458 | /* initialize plane */ | 1455 | /* initialize plane */ |
| 1459 | struct drm_plane *dpu_plane_init(struct drm_device *dev, | 1456 | struct drm_plane *dpu_plane_init(struct drm_device *dev, |
| 1460 | uint32_t pipe, enum drm_plane_type type, | 1457 | uint32_t pipe, enum drm_plane_type type, |
| @@ -1465,6 +1462,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, · 4 unmodified lines | |||
| 1465 | struct dpu_plane *pdpu; | 1462 | struct dpu_plane *pdpu; |
| 1466 | struct msm_drm_private *priv = dev->dev_private; | 1463 | struct msm_drm_private *priv = dev->dev_private; |
| 1467 | struct dpu_kms *kms = to_dpu_kms(priv->kms); | 1464 | struct dpu_kms *kms = to_dpu_kms(priv->kms); |
| 1465 | struct dpu_hw_sspp *pipe_hw; | ||
| 1468 | uint32_t num_formats; | 1466 | uint32_t num_formats; |
| 1469 | uint32_t supported_rotations; | 1467 | uint32_t supported_rotations; |
| 1470 | int ret = -EINVAL; | 1468 | int ret = -EINVAL; |
| @@ -1482,24 +1480,20 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, · 11 unmodified lines | |||
| 1482 | pdpu->pipe = pipe; | 1480 | pdpu->pipe = pipe; |
| 1483 | 1481 | ||
| 1484 | /* initialize underlying h/w driver */ | 1482 | /* initialize underlying h/w driver */ |
| 1485 | pdpu->pipe_hw = dpu_hw_sspp_init(pipe, kms->mmio, kms->catalog); | 1483 | pipe_hw = dpu_rm_get_sspp(&kms->rm, pipe); |
| 1486 | if (IS_ERR(pdpu->pipe_hw)) { | 1484 | if (!pipe_hw || !pipe_hw->cap || !pipe_hw->cap->sblk) { |
| 1487 | DPU_ERROR("[%u]SSPP init failed\n", pipe); | 1485 | DPU_ERROR("[%u]SSPP is invalid\n", pipe); |
| 1488 | ret = PTR_ERR(pdpu->pipe_hw); | ||
| 1489 | goto clean_plane; | 1486 | goto clean_plane; |
| 1490 | } else if (!pdpu->pipe_hw->cap || !pdpu->pipe_hw->cap->sblk) { | ||
| 1491 | DPU_ERROR("[%u]SSPP init returned invalid cfg\n", pipe); | ||
| 1492 | goto clean_sspp; | ||
| 1493 | } | 1487 | } |
| 1494 | 1488 | ||
| 1495 | format_list = pdpu->pipe_hw->cap->sblk->format_list; | 1489 | format_list = pipe_hw->cap->sblk->format_list; |
| 1496 | num_formats = pdpu->pipe_hw->cap->sblk->num_formats; | 1490 | num_formats = pipe_hw->cap->sblk->num_formats; |
| 1497 | 1491 | ||
| 1498 | ret = drm_universal_plane_init(dev, plane, 0xff, &dpu_plane_funcs, | 1492 | ret = drm_universal_plane_init(dev, plane, 0xff, &dpu_plane_funcs, |
| 1499 | format_list, num_formats, | 1493 | format_list, num_formats, |
| 1500 | supported_format_modifiers, type, NULL); | 1494 | supported_format_modifiers, type, NULL); |
| 1501 | if (ret) | 1495 | if (ret) |
| 1502 | goto clean_sspp; | 1496 | goto clean_plane; |
| 1503 | 1497 | ||
| 1504 | pdpu->catalog = kms->catalog; | 1498 | pdpu->catalog = kms->catalog; |
| 1505 | 1499 | ||
| @@ -1515,7 +1509,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, · 9 unmodified lines | |||
| 1515 | 1509 | ||
| 1516 | supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180; | 1510 | supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180; |
| 1517 | 1511 | ||
| 1518 | if (pdpu->pipe_hw->cap->features & BIT(DPU_SSPP_INLINE_ROTATION)) | 1512 | if (pipe_hw->cap->features & BIT(DPU_SSPP_INLINE_ROTATION)) |
| 1519 | supported_rotations |= DRM_MODE_ROTATE_MASK; | 1513 | supported_rotations |= DRM_MODE_ROTATE_MASK; |
| 1520 | 1514 | ||
| 1521 | drm_plane_create_rotation_property(plane, | 1515 | drm_plane_create_rotation_property(plane, |
| @@ -1532,9 +1526,6 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, · 10 unmodified lines | |||
| 1532 | pipe, plane->base.id); | 1526 | pipe, plane->base.id); |
| 1533 | return plane; | 1527 | return plane; |
| 1534 | 1528 | ||
| 1535 | clean_sspp: | ||
| 1536 | if (pdpu && pdpu->pipe_hw) | ||
| 1537 | dpu_hw_sspp_destroy(pdpu->pipe_hw); | ||
| 1538 | clean_plane: | 1529 | clean_plane: |
| 1539 | kfree(pdpu); | 1530 | kfree(pdpu); |
| 1540 | return ERR_PTR(ret); | 1531 | return ERR_PTR(ret); |
| @@ -18,6 +18,10 @@ · 17 unmodified lines | |||
| 18 | * struct dpu_plane_state: Define dpu extension of drm plane state object | 18 | * struct dpu_plane_state: Define dpu extension of drm plane state object |
| 19 | * @base: base drm plane state object | 19 | * @base: base drm plane state object |
| 20 | * @aspace: pointer to address space for input/output buffers | 20 | * @aspace: pointer to address space for input/output buffers |
| 21 | * @pipe: software pipe description | ||
| 22 | * @r_pipe: software pipe description of the second pipe | ||
| 23 | * @pipe_cfg: software pipe configuration | ||
| 24 | * @r_pipe_cfg: software pipe configuration for the second pipe | ||
| 21 | * @stage: assigned by crtc blender | 25 | * @stage: assigned by crtc blender |
| 22 | * @needs_qos_remap: qos remap settings need to be updated | 26 | * @needs_qos_remap: qos remap settings need to be updated |
| 23 | * @multirect_index: index of the rectangle of SSPP | 27 | * @multirect_index: index of the rectangle of SSPP |
| @@ -31,10 +35,12 @@ · 7 unmodified lines | |||
| 31 | struct dpu_plane_state { | 35 | struct dpu_plane_state { |
| 32 | struct drm_plane_state base; | 36 | struct drm_plane_state base; |
| 33 | struct msm_gem_address_space *aspace; | 37 | struct msm_gem_address_space *aspace; |
| 38 | struct dpu_sw_pipe pipe; | ||
| 39 | struct dpu_sw_pipe r_pipe; | ||
| 40 | struct dpu_sw_pipe_cfg pipe_cfg; | ||
| 41 | struct dpu_sw_pipe_cfg r_pipe_cfg; | ||
| 34 | enum dpu_stage stage; | 42 | enum dpu_stage stage; |
| 35 | bool needs_qos_remap; | 43 | bool needs_qos_remap; |
| 36 | uint32_t multirect_index; | ||
| 37 | uint32_t multirect_mode; | ||
| 38 | bool pending; | 44 | bool pending; |
| 39 | 45 | ||
| 40 | u64 plane_fetch_bw; | 46 | u64 plane_fetch_bw; |
| @@ -44,26 +50,9 @@ struct dpu_plane_state { · 3 unmodified lines | |||
| 44 | unsigned int rotation; | 50 | unsigned int rotation; |
| 45 | }; | 51 | }; |
| 46 | 52 | ||
| 47 | /** | ||
| 48 | * struct dpu_multirect_plane_states: Defines multirect pair of drm plane states | ||
| 49 | * @r0: drm plane configured on rect 0 | ||
| 50 | * @r1: drm plane configured on rect 1 | ||
| 51 | */ | ||
| 52 | struct dpu_multirect_plane_states { | ||
| 53 | const struct drm_plane_state *r0; | ||
| 54 | const struct drm_plane_state *r1; | ||
| 55 | }; | ||
| 56 | |||
| 57 | #define to_dpu_plane_state(x) \ | 53 | #define to_dpu_plane_state(x) \ |
| 58 | container_of(x, struct dpu_plane_state, base) | 54 | container_of(x, struct dpu_plane_state, base) |
| 59 | 55 | ||
| 60 | /** | ||
| 61 | * dpu_plane_pipe - return sspp identifier for the given plane | ||
| 62 | * @plane: Pointer to DRM plane object | ||
| 63 | * Returns: sspp identifier of the given plane | ||
| 64 | */ | ||
| 65 | enum dpu_sspp dpu_plane_pipe(struct drm_plane *plane); | ||
| 66 | |||
| 67 | /** | 56 | /** |
| 68 | * dpu_plane_flush - final plane operations before commit flush | 57 | * dpu_plane_flush - final plane operations before commit flush |
| 69 | * @plane: Pointer to drm plane structure | 58 | * @plane: Pointer to drm plane structure |
| @@ -88,19 +77,6 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, · 18 unmodified lines | |||
| 88 | uint32_t pipe, enum drm_plane_type type, | 77 | uint32_t pipe, enum drm_plane_type type, |
| 89 | unsigned long possible_crtcs); | 78 | unsigned long possible_crtcs); |
| 90 | 79 | ||
| 91 | /** | ||
| 92 | * dpu_plane_validate_multirecti_v2 - validate the multirect planes | ||
| 93 | * against hw limitations | ||
| 94 | * @plane: drm plate states of the multirect pair | ||
| 95 | */ | ||
| 96 | int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane); | ||
| 97 | |||
| 98 | /** | ||
| 99 | * dpu_plane_clear_multirect - clear multirect bits for the given pipe | ||
| 100 | * @drm_state: Pointer to DRM plane state | ||
| 101 | */ | ||
| 102 | void dpu_plane_clear_multirect(const struct drm_plane_state *drm_state); | ||
| 103 | |||
| 104 | /** | 80 | /** |
| 105 | * dpu_plane_color_fill - enables color fill on plane | 81 | * dpu_plane_color_fill - enables color fill on plane |
| 106 | * @plane: Pointer to DRM plane object | 82 | * @plane: Pointer to DRM plane object |
| @@ -8,6 +8,7 @@ · 7 unmodified lines | |||
| 8 | #include "dpu_hw_lm.h" | 8 | #include "dpu_hw_lm.h" |
| 9 | #include "dpu_hw_ctl.h" | 9 | #include "dpu_hw_ctl.h" |
| 10 | #include "dpu_hw_pingpong.h" | 10 | #include "dpu_hw_pingpong.h" |
| 11 | #include "dpu_hw_sspp.h" | ||
| 11 | #include "dpu_hw_intf.h" | 12 | #include "dpu_hw_intf.h" |
| 12 | #include "dpu_hw_wb.h" | 13 | #include "dpu_hw_wb.h" |
| 13 | #include "dpu_hw_dspp.h" | 14 | #include "dpu_hw_dspp.h" |
| @@ -91,6 +92,9 @@ int dpu_rm_destroy(struct dpu_rm *rm) · 77 unmodified lines | |||
| 91 | for (i = 0; i < ARRAY_SIZE(rm->hw_wb); i++) | 92 | for (i = 0; i < ARRAY_SIZE(rm->hw_wb); i++) |
| 92 | dpu_hw_wb_destroy(rm->hw_wb[i]); | 93 | dpu_hw_wb_destroy(rm->hw_wb[i]); |
| 93 | 94 | ||
| 95 | for (i = 0; i < ARRAY_SIZE(rm->hw_sspp); i++) | ||
| 96 | dpu_hw_sspp_destroy(rm->hw_sspp[i]); | ||
| 97 | |||
| 94 | return 0; | 98 | return 0; |
| 95 | } | 99 | } |
| 96 | 100 | ||
| @@ -255,6 +259,24 @@ int dpu_rm_init(struct dpu_rm *rm, · 158 unmodified lines | |||
| 255 | rm->dsc_blks[dsc->id - DSC_0] = &hw->base; | 259 | rm->dsc_blks[dsc->id - DSC_0] = &hw->base; |
| 256 | } | 260 | } |
| 257 | 261 | ||
| 262 | for (i = 0; i < cat->sspp_count; i++) { | ||
| 263 | struct dpu_hw_sspp *hw; | ||
| 264 | const struct dpu_sspp_cfg *sspp = &cat->sspp[i]; | ||
| 265 | |||
| 266 | if (sspp->id < SSPP_NONE || sspp->id >= SSPP_MAX) { | ||
| 267 | DPU_ERROR("skip intf %d with invalid id\n", sspp->id); | ||
| 268 | continue; | ||
| 269 | } | ||
| 270 | |||
| 271 | hw = dpu_hw_sspp_init(sspp->id, mmio, cat); | ||
| 272 | if (IS_ERR(hw)) { | ||
| 273 | rc = PTR_ERR(hw); | ||
| 274 | DPU_ERROR("failed sspp object creation: err %d\n", rc); | ||
| 275 | goto fail; | ||
| 276 | } | ||
| 277 | rm->hw_sspp[sspp->id - SSPP_NONE] = hw; | ||
| 278 | } | ||
| 279 | |||
| 258 | return 0; | 280 | return 0; |
| 259 | 281 | ||
| 260 | fail: | 282 | fail: |
| @@ -21,6 +21,7 @@ struct dpu_global_state; · 20 unmodified lines | |||
| 21 | * @hw_intf: array of intf hardware resources | 21 | * @hw_intf: array of intf hardware resources |
| 22 | * @hw_wb: array of wb hardware resources | 22 | * @hw_wb: array of wb hardware resources |
| 23 | * @dspp_blks: array of dspp hardware resources | 23 | * @dspp_blks: array of dspp hardware resources |
| 24 | * @hw_sspp: array of sspp hardware resources | ||
| 24 | */ | 25 | */ |
| 25 | struct dpu_rm { | 26 | struct dpu_rm { |
| 26 | struct dpu_hw_blk *pingpong_blks[PINGPONG_MAX - PINGPONG_0]; | 27 | struct dpu_hw_blk *pingpong_blks[PINGPONG_MAX - PINGPONG_0]; |
| @@ -31,6 +32,7 @@ struct dpu_rm { · 4 unmodified lines | |||
| 31 | struct dpu_hw_blk *dspp_blks[DSPP_MAX - DSPP_0]; | 32 | struct dpu_hw_blk *dspp_blks[DSPP_MAX - DSPP_0]; |
| 32 | struct dpu_hw_blk *merge_3d_blks[MERGE_3D_MAX - MERGE_3D_0]; | 33 | struct dpu_hw_blk *merge_3d_blks[MERGE_3D_MAX - MERGE_3D_0]; |
| 33 | struct dpu_hw_blk *dsc_blks[DSC_MAX - DSC_0]; | 34 | struct dpu_hw_blk *dsc_blks[DSC_MAX - DSC_0]; |
| 35 | struct dpu_hw_sspp *hw_sspp[SSPP_MAX - SSPP_NONE]; | ||
| 34 | }; | 36 | }; |
| 35 | 37 | ||
| 36 | /** | 38 | /** |
| @@ -108,5 +110,15 @@ static inline struct dpu_hw_wb *dpu_rm_get_wb(struct dpu_rm *rm, enum dpu_wb wb_ · 71 unmodified lines | |||
| 108 | return rm->hw_wb[wb_idx - WB_0]; | 110 | return rm->hw_wb[wb_idx - WB_0]; |
| 109 | } | 111 | } |
| 110 | 112 | ||
| 113 | /** | ||
| 114 | * dpu_rm_get_sspp - Return a struct dpu_hw_sspp instance given it's index. | ||
| 115 | * @rm: DPU Resource Manager handle | ||
| 116 | * @sspp_idx: SSPP index | ||
| 117 | */ | ||
| 118 | static inline struct dpu_hw_sspp *dpu_rm_get_sspp(struct dpu_rm *rm, enum dpu_sspp sspp_idx) | ||
| 119 | { | ||
| 120 | return rm->hw_sspp[sspp_idx - SSPP_NONE]; | ||
| 121 | } | ||
| 122 | |||
| 111 | #endif /* __DPU_RM_H__ */ | 123 | #endif /* __DPU_RM_H__ */ |
| 112 | 124 | ||
| @@ -633,9 +633,9 @@ TRACE_EVENT(dpu_enc_phys_vid_irq_ctrl, · 632 unmodified lines | |||
| 633 | TRACE_EVENT(dpu_crtc_setup_mixer, | 633 | TRACE_EVENT(dpu_crtc_setup_mixer, |
| 634 | TP_PROTO(uint32_t crtc_id, uint32_t plane_id, | 634 | TP_PROTO(uint32_t crtc_id, uint32_t plane_id, |
| 635 | struct drm_plane_state *state, struct dpu_plane_state *pstate, | 635 | struct drm_plane_state *state, struct dpu_plane_state *pstate, |
| 636 | uint32_t stage_idx, enum dpu_sspp sspp, uint32_t pixel_format, | 636 | uint32_t stage_idx, uint32_t pixel_format, |
| 637 | uint64_t modifier), | 637 | uint64_t modifier), |
| 638 | TP_ARGS(crtc_id, plane_id, state, pstate, stage_idx, sspp, | 638 | TP_ARGS(crtc_id, plane_id, state, pstate, stage_idx, |
| 639 | pixel_format, modifier), | 639 | pixel_format, modifier), |
| 640 | TP_STRUCT__entry( | 640 | TP_STRUCT__entry( |
| 641 | __field( uint32_t, crtc_id ) | 641 | __field( uint32_t, crtc_id ) |
| @@ -659,9 +659,9 @@ TRACE_EVENT(dpu_crtc_setup_mixer, · 17 unmodified lines | |||
| 659 | __entry->dst_rect = drm_plane_state_dest(state); | 659 | __entry->dst_rect = drm_plane_state_dest(state); |
| 660 | __entry->stage_idx = stage_idx; | 660 | __entry->stage_idx = stage_idx; |
| 661 | __entry->stage = pstate->stage; | 661 | __entry->stage = pstate->stage; |
| 662 | __entry->sspp = sspp; | 662 | __entry->sspp = pstate->pipe.sspp->idx; |
| 663 | __entry->multirect_idx = pstate->multirect_index; | 663 | __entry->multirect_idx = pstate->pipe.multirect_index; |
| 664 | __entry->multirect_mode = pstate->multirect_mode; | 664 | __entry->multirect_mode = pstate->pipe.multirect_mode; |
| 665 | __entry->pixel_format = pixel_format; | 665 | __entry->pixel_format = pixel_format; |
| 666 | __entry->modifier = modifier; | 666 | __entry->modifier = modifier; |
| 667 | ), | 667 | ), |
| @@ -762,18 +762,17 @@ TRACE_EVENT(dpu_crtc_disable_frame_pending, · 94 unmodified lines | |||
| 762 | ); | 762 | ); |
| 763 | 763 | ||
| 764 | TRACE_EVENT(dpu_plane_set_scanout, | 764 | TRACE_EVENT(dpu_plane_set_scanout, |
| 765 | TP_PROTO(enum dpu_sspp index, struct dpu_hw_fmt_layout *layout, | 765 | TP_PROTO(struct dpu_sw_pipe *pipe, struct dpu_hw_fmt_layout *layout), |
| 766 | enum dpu_sspp_multirect_index multirect_index), | 766 | TP_ARGS(pipe, layout), |
| 767 | TP_ARGS(index, layout, multirect_index), | ||
| 768 | TP_STRUCT__entry( | 767 | TP_STRUCT__entry( |
| 769 | __field( enum dpu_sspp, index ) | 768 | __field( enum dpu_sspp, index ) |
| 770 | __field_struct( struct dpu_hw_fmt_layout, layout ) | 769 | __field_struct( struct dpu_hw_fmt_layout, layout ) |
| 771 | __field( enum dpu_sspp_multirect_index, multirect_index) | 770 | __field( enum dpu_sspp_multirect_index, multirect_index) |
| 772 | ), | 771 | ), |
| 773 | TP_fast_assign( | 772 | TP_fast_assign( |
| 774 | __entry->index = index; | 773 | __entry->index = pipe->sspp->idx; |
| 775 | __entry->layout = *layout; | 774 | __entry->layout = *layout; |
| 776 | __entry->multirect_index = multirect_index; | 775 | __entry->multirect_index = pipe->multirect_index; |
| 777 | ), | 776 | ), |
| 778 | TP_printk("index:%d layout:{%ux%u @ [%u/%u, %u/%u, %u/%u, %u/%u]} " | 777 | TP_printk("index:%d layout:{%ux%u @ [%u/%u, %u/%u, %u/%u, %u/%u]} " |
| 779 | "multirect_index:%d", __entry->index, __entry->layout.width, | 778 | "multirect_index:%d", __entry->index, __entry->layout.width, |
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -84,10 +84,6 @@ static void mdp4_disable_commit(struct msm_kms *kms) · 83 unmodified lines | |||
| 84 | mdp4_disable(mdp4_kms); | 84 | mdp4_disable(mdp4_kms); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *state) | ||
| 88 | { | ||
| 89 | } | ||
| 90 | |||
| 91 | static void mdp4_flush_commit(struct msm_kms *kms, unsigned crtc_mask) | 87 | static void mdp4_flush_commit(struct msm_kms *kms, unsigned crtc_mask) |
| 92 | { | 88 | { |
| 93 | /* TODO */ | 89 | /* TODO */ |
| @@ -154,7 +150,6 @@ static const struct mdp_kms_funcs kms_funcs = { · 60 unmodified lines | |||
| 154 | .disable_vblank = mdp4_disable_vblank, | 150 | .disable_vblank = mdp4_disable_vblank, |
| 155 | .enable_commit = mdp4_enable_commit, | 151 | .enable_commit = mdp4_enable_commit, |
| 156 | .disable_commit = mdp4_disable_commit, | 152 | .disable_commit = mdp4_disable_commit, |
| 157 | .prepare_commit = mdp4_prepare_commit, | ||
| 158 | .flush_commit = mdp4_flush_commit, | 153 | .flush_commit = mdp4_flush_commit, |
| 159 | .wait_flush = mdp4_wait_flush, | 154 | .wait_flush = mdp4_wait_flush, |
| 160 | .complete_commit = mdp4_complete_commit, | 155 | .complete_commit = mdp4_complete_commit, |
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -655,7 +655,7 @@ static const struct mdp5_cfg_hw msm8x96_config = { · 654 unmodified lines | |||
| 655 | .max_clk = 412500000, | 655 | .max_clk = 412500000, |
| 656 | }; | 656 | }; |
| 657 | 657 | ||
| 658 | const struct mdp5_cfg_hw msm8x76_config = { | 658 | static const struct mdp5_cfg_hw msm8x76_config = { |
| 659 | .name = "msm8x76", | 659 | .name = "msm8x76", |
| 660 | .mdp = { | 660 | .mdp = { |
| 661 | .count = 1, | 661 | .count = 1, |
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -129,9 +129,6 @@ void msm_disp_snapshot_destroy(struct drm_device *drm_dev) · 128 unmodified lines | |||
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | priv = drm_dev->dev_private; | 131 | priv = drm_dev->dev_private; |
| 132 | if (!priv->kms) | ||
| 133 | return; | ||
| 134 | |||
| 135 | kms = priv->kms; | 132 | kms = priv->kms; |
| 136 | 133 | ||
| 137 | if (kms->dump_worker) | 134 | if (kms->dump_worker) |
| @@ -162,47 +162,6 @@ static ssize_t dp_aux_cmd_fifo_rx(struct dp_aux_private *aux, · 161 unmodified lines | |||
| 162 | return i; | 162 | return i; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | static void dp_aux_native_handler(struct dp_aux_private *aux, u32 isr) | ||
| 166 | { | ||
| 167 | if (isr & DP_INTR_AUX_I2C_DONE) | ||
| 168 | aux->aux_error_num = DP_AUX_ERR_NONE; | ||
| 169 | else if (isr & DP_INTR_WRONG_ADDR) | ||
| 170 | aux->aux_error_num = DP_AUX_ERR_ADDR; | ||
| 171 | else if (isr & DP_INTR_TIMEOUT) | ||
| 172 | aux->aux_error_num = DP_AUX_ERR_TOUT; | ||
| 173 | if (isr & DP_INTR_NACK_DEFER) | ||
| 174 | aux->aux_error_num = DP_AUX_ERR_NACK; | ||
| 175 | if (isr & DP_INTR_AUX_ERROR) { | ||
| 176 | aux->aux_error_num = DP_AUX_ERR_PHY; | ||
| 177 | dp_catalog_aux_clear_hw_interrupts(aux->catalog); | ||
| 178 | } | ||
| 179 | } | ||
| 180 | |||
| 181 | static void dp_aux_i2c_handler(struct dp_aux_private *aux, u32 isr) | ||
| 182 | { | ||
| 183 | if (isr & DP_INTR_AUX_I2C_DONE) { | ||
| 184 | if (isr & (DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER)) | ||
| 185 | aux->aux_error_num = DP_AUX_ERR_NACK; | ||
| 186 | else | ||
| 187 | aux->aux_error_num = DP_AUX_ERR_NONE; | ||
| 188 | } else { | ||
| 189 | if (isr & DP_INTR_WRONG_ADDR) | ||
| 190 | aux->aux_error_num = DP_AUX_ERR_ADDR; | ||
| 191 | else if (isr & DP_INTR_TIMEOUT) | ||
| 192 | aux->aux_error_num = DP_AUX_ERR_TOUT; | ||
| 193 | if (isr & DP_INTR_NACK_DEFER) | ||
| 194 | aux->aux_error_num = DP_AUX_ERR_NACK_DEFER; | ||
| 195 | if (isr & DP_INTR_I2C_NACK) | ||
| 196 | aux->aux_error_num = DP_AUX_ERR_NACK; | ||
| 197 | if (isr & DP_INTR_I2C_DEFER) | ||
| 198 | aux->aux_error_num = DP_AUX_ERR_DEFER; | ||
| 199 | if (isr & DP_INTR_AUX_ERROR) { | ||
| 200 | aux->aux_error_num = DP_AUX_ERR_PHY; | ||
| 201 | dp_catalog_aux_clear_hw_interrupts(aux->catalog); | ||
| 202 | } | ||
| 203 | } | ||
| 204 | } | ||
| 205 | |||
| 206 | static void dp_aux_update_offset_and_segment(struct dp_aux_private *aux, | 165 | static void dp_aux_update_offset_and_segment(struct dp_aux_private *aux, |
| 207 | struct drm_dp_aux_msg *input_msg) | 166 | struct drm_dp_aux_msg *input_msg) |
| 208 | { | 167 | { |
| @@ -409,14 +368,14 @@ exit: · 200 unmodified lines | |||
| 409 | return ret; | 368 | return ret; |
| 410 | } | 369 | } |
| 411 | 370 | ||
| 412 | void dp_aux_isr(struct drm_dp_aux *dp_aux) | 371 | irqreturn_t dp_aux_isr(struct drm_dp_aux *dp_aux) |
| 413 | { | 372 | { |
| 414 | u32 isr; | 373 | u32 isr; |
| 415 | struct dp_aux_private *aux; | 374 | struct dp_aux_private *aux; |
| 416 | 375 | ||
| 417 | if (!dp_aux) { | 376 | if (!dp_aux) { |
| 418 | DRM_ERROR("invalid input\n"); | 377 | DRM_ERROR("invalid input\n"); |
| 419 | return; | 378 | return IRQ_NONE; |
| 420 | } | 379 | } |
| 421 | 380 | ||
| 422 | aux = container_of(dp_aux, struct dp_aux_private, dp_aux); | 381 | aux = container_of(dp_aux, struct dp_aux_private, dp_aux); |
| @@ -425,17 +384,48 @@ void dp_aux_isr(struct drm_dp_aux *dp_aux) · 2 unmodified lines | |||
| 425 | 384 | ||
| 426 | /* no interrupts pending, return immediately */ | 385 | /* no interrupts pending, return immediately */ |
| 427 | if (!isr) | 386 | if (!isr) |
| 428 | return; | 387 | return IRQ_NONE; |
| 429 | 388 | ||
| 430 | if (!aux->cmd_busy) | 389 | if (!aux->cmd_busy) { |
| 431 | return; | 390 | DRM_ERROR("Unexpected DP AUX IRQ %#010x when not busy\n", isr); |
| 391 | return IRQ_NONE; | ||
| 392 | } | ||
| 432 | 393 | ||
| 433 | if (aux->native) | 394 | /* |
| 434 | dp_aux_native_handler(aux, isr); | 395 | * The logic below assumes only one error bit is set (other than "done" |
| 435 | else | 396 | * which can apparently be set at the same time as some of the other |
| 436 | dp_aux_i2c_handler(aux, isr); | 397 | * bits). Warn if more than one get set so we know we need to improve |
| 398 | * the logic. | ||
| 399 | */ | ||
| 400 | if (hweight32(isr & ~DP_INTR_AUX_XFER_DONE) > 1) | ||
| 401 | DRM_WARN("Some DP AUX interrupts unhandled: %#010x\n", isr); | ||
| 402 | |||
| 403 | if (isr & DP_INTR_AUX_ERROR) { | ||
| 404 | aux->aux_error_num = DP_AUX_ERR_PHY; | ||
| 405 | dp_catalog_aux_clear_hw_interrupts(aux->catalog); | ||
| 406 | } else if (isr & DP_INTR_NACK_DEFER) { | ||
| 407 | aux->aux_error_num = DP_AUX_ERR_NACK_DEFER; | ||
| 408 | } else if (isr & DP_INTR_WRONG_ADDR) { | ||
| 409 | aux->aux_error_num = DP_AUX_ERR_ADDR; | ||
| 410 | } else if (isr & DP_INTR_TIMEOUT) { | ||
| 411 | aux->aux_error_num = DP_AUX_ERR_TOUT; | ||
| 412 | } else if (!aux->native && (isr & DP_INTR_I2C_NACK)) { | ||
| 413 | aux->aux_error_num = DP_AUX_ERR_NACK; | ||
| 414 | } else if (!aux->native && (isr & DP_INTR_I2C_DEFER)) { | ||
| 415 | if (isr & DP_INTR_AUX_XFER_DONE) | ||
| 416 | aux->aux_error_num = DP_AUX_ERR_NACK; | ||
| 417 | else | ||
| 418 | aux->aux_error_num = DP_AUX_ERR_DEFER; | ||
| 419 | } else if (isr & DP_INTR_AUX_XFER_DONE) { | ||
| 420 | aux->aux_error_num = DP_AUX_ERR_NONE; | ||
| 421 | } else { | ||
| 422 | DRM_WARN("Unexpected interrupt: %#010x\n", isr); | ||
| 423 | return IRQ_NONE; | ||
| 424 | } | ||
| 437 | 425 | ||
| 438 | complete(&aux->comp); | 426 | complete(&aux->comp); |
| 427 | |||
| 428 | return IRQ_HANDLED; | ||
| 439 | } | 429 | } |
| 440 | 430 | ||
| 441 | void dp_aux_reconfig(struct drm_dp_aux *dp_aux) | 431 | void dp_aux_reconfig(struct drm_dp_aux *dp_aux) |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | |||
| 11 | 11 | ||
| 12 | int dp_aux_register(struct drm_dp_aux *dp_aux); | 12 | int dp_aux_register(struct drm_dp_aux *dp_aux); |
| 13 | void dp_aux_unregister(struct drm_dp_aux *dp_aux); | 13 | void dp_aux_unregister(struct drm_dp_aux *dp_aux); |
| 14 | void dp_aux_isr(struct drm_dp_aux *dp_aux); | 14 | irqreturn_t dp_aux_isr(struct drm_dp_aux *dp_aux); |
| 15 | void dp_aux_init(struct drm_dp_aux *dp_aux); | 15 | void dp_aux_init(struct drm_dp_aux *dp_aux); |
| 16 | void dp_aux_deinit(struct drm_dp_aux *dp_aux); | 16 | void dp_aux_deinit(struct drm_dp_aux *dp_aux); |
| 17 | void dp_aux_reconfig(struct drm_dp_aux *dp_aux); | 17 | void dp_aux_reconfig(struct drm_dp_aux *dp_aux); |
| @@ -27,7 +27,7 @@ · 26 unmodified lines | |||
| 27 | #define DP_INTF_CONFIG_DATABUS_WIDEN BIT(4) | 27 | #define DP_INTF_CONFIG_DATABUS_WIDEN BIT(4) |
| 28 | 28 | ||
| 29 | #define DP_INTERRUPT_STATUS1 \ | 29 | #define DP_INTERRUPT_STATUS1 \ |
| 30 | (DP_INTR_AUX_I2C_DONE| \ | 30 | (DP_INTR_AUX_XFER_DONE| \ |
| 31 | DP_INTR_WRONG_ADDR | DP_INTR_TIMEOUT | \ | 31 | DP_INTR_WRONG_ADDR | DP_INTR_TIMEOUT | \ |
| 32 | DP_INTR_NACK_DEFER | DP_INTR_WRONG_DATA_CNT | \ | 32 | DP_INTR_NACK_DEFER | DP_INTR_WRONG_DATA_CNT | \ |
| 33 | DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER | \ | 33 | DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER | \ |
| @@ -47,6 +47,14 @@ · 13 unmodified lines | |||
| 47 | #define DP_INTERRUPT_STATUS2_MASK \ | 47 | #define DP_INTERRUPT_STATUS2_MASK \ |
| 48 | (DP_INTERRUPT_STATUS2 << DP_INTERRUPT_STATUS_MASK_SHIFT) | 48 | (DP_INTERRUPT_STATUS2 << DP_INTERRUPT_STATUS_MASK_SHIFT) |
| 49 | 49 | ||
| 50 | #define DP_INTERRUPT_STATUS4 \ | ||
| 51 | (PSR_UPDATE_INT | PSR_CAPTURE_INT | PSR_EXIT_INT | \ | ||
| 52 | PSR_UPDATE_ERROR_INT | PSR_WAKE_ERROR_INT) | ||
| 53 | |||
| 54 | #define DP_INTERRUPT_MASK4 \ | ||
| 55 | (PSR_UPDATE_MASK | PSR_CAPTURE_MASK | PSR_EXIT_MASK | \ | ||
| 56 | PSR_UPDATE_ERROR_MASK | PSR_WAKE_ERROR_MASK) | ||
| 57 | |||
| 50 | struct dp_catalog_private { | 58 | struct dp_catalog_private { |
| 51 | struct device *dev; | 59 | struct device *dev; |
| 52 | struct drm_device *drm_dev; | 60 | struct drm_device *drm_dev; |
| @@ -359,6 +367,23 @@ void dp_catalog_ctrl_lane_mapping(struct dp_catalog *dp_catalog) · 306 unmodified lines | |||
| 359 | ln_mapping); | 367 | ln_mapping); |
| 360 | } | 368 | } |
| 361 | 369 | ||
| 370 | void dp_catalog_ctrl_psr_mainlink_enable(struct dp_catalog *dp_catalog, | ||
| 371 | bool enable) | ||
| 372 | { | ||
| 373 | u32 val; | ||
| 374 | struct dp_catalog_private *catalog = container_of(dp_catalog, | ||
| 375 | struct dp_catalog_private, dp_catalog); | ||
| 376 | |||
| 377 | val = dp_read_link(catalog, REG_DP_MAINLINK_CTRL); | ||
| 378 | |||
| 379 | if (enable) | ||
| 380 | val |= DP_MAINLINK_CTRL_ENABLE; | ||
| 381 | else | ||
| 382 | val &= ~DP_MAINLINK_CTRL_ENABLE; | ||
| 383 | |||
| 384 | dp_write_link(catalog, REG_DP_MAINLINK_CTRL, val); | ||
| 385 | } | ||
| 386 | |||
| 362 | void dp_catalog_ctrl_mainlink_ctrl(struct dp_catalog *dp_catalog, | 387 | void dp_catalog_ctrl_mainlink_ctrl(struct dp_catalog *dp_catalog, |
| 363 | bool enable) | 388 | bool enable) |
| 364 | { | 389 | { |
| @@ -610,6 +635,47 @@ void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog) · 245 unmodified lines | |||
| 610 | dp_write_aux(catalog, REG_DP_DP_HPD_CTRL, DP_DP_HPD_CTRL_HPD_EN); | 635 | dp_write_aux(catalog, REG_DP_DP_HPD_CTRL, DP_DP_HPD_CTRL_HPD_EN); |
| 611 | } | 636 | } |
| 612 | 637 | ||
| 638 | static void dp_catalog_enable_sdp(struct dp_catalog_private *catalog) | ||
| 639 | { | ||
| 640 | /* trigger sdp */ | ||
| 641 | dp_write_link(catalog, MMSS_DP_SDP_CFG3, UPDATE_SDP); | ||
| 642 | dp_write_link(catalog, MMSS_DP_SDP_CFG3, 0x0); | ||
| 643 | } | ||
| 644 | |||
| 645 | void dp_catalog_ctrl_config_psr(struct dp_catalog *dp_catalog) | ||
| 646 | { | ||
| 647 | struct dp_catalog_private *catalog = container_of(dp_catalog, | ||
| 648 | struct dp_catalog_private, dp_catalog); | ||
| 649 | u32 config; | ||
| 650 | |||
| 651 | /* enable PSR1 function */ | ||
| 652 | config = dp_read_link(catalog, REG_PSR_CONFIG); | ||
| 653 | config |= PSR1_SUPPORTED; | ||
| 654 | dp_write_link(catalog, REG_PSR_CONFIG, config); | ||
| 655 | |||
| 656 | dp_write_ahb(catalog, REG_DP_INTR_MASK4, DP_INTERRUPT_MASK4); | ||
| 657 | dp_catalog_enable_sdp(catalog); | ||
| 658 | } | ||
| 659 | |||
| 660 | void dp_catalog_ctrl_set_psr(struct dp_catalog *dp_catalog, bool enter) | ||
| 661 | { | ||
| 662 | struct dp_catalog_private *catalog = container_of(dp_catalog, | ||
| 663 | struct dp_catalog_private, dp_catalog); | ||
| 664 | u32 cmd; | ||
| 665 | |||
| 666 | cmd = dp_read_link(catalog, REG_PSR_CMD); | ||
| 667 | |||
| 668 | cmd &= ~(PSR_ENTER | PSR_EXIT); | ||
| 669 | |||
| 670 | if (enter) | ||
| 671 | cmd |= PSR_ENTER; | ||
| 672 | else | ||
| 673 | cmd |= PSR_EXIT; | ||
| 674 | |||
| 675 | dp_catalog_enable_sdp(catalog); | ||
| 676 | dp_write_link(catalog, REG_PSR_CMD, cmd); | ||
| 677 | } | ||
| 678 | |||
| 613 | u32 dp_catalog_link_is_connected(struct dp_catalog *dp_catalog) | 679 | u32 dp_catalog_link_is_connected(struct dp_catalog *dp_catalog) |
| 614 | { | 680 | { |
| 615 | struct dp_catalog_private *catalog = container_of(dp_catalog, | 681 | struct dp_catalog_private *catalog = container_of(dp_catalog, |
| @@ -645,6 +711,20 @@ u32 dp_catalog_hpd_get_intr_status(struct dp_catalog *dp_catalog) · 29 unmodified lines | |||
| 645 | return isr & (mask | ~DP_DP_HPD_INT_MASK); | 711 | return isr & (mask | ~DP_DP_HPD_INT_MASK); |
| 646 | } | 712 | } |
| 647 | 713 | ||
| 714 | u32 dp_catalog_ctrl_read_psr_interrupt_status(struct dp_catalog *dp_catalog) | ||
| 715 | { | ||
| 716 | struct dp_catalog_private *catalog = container_of(dp_catalog, | ||
| 717 | struct dp_catalog_private, dp_catalog); | ||
| 718 | u32 intr, intr_ack; | ||
| 719 | |||
| 720 | intr = dp_read_ahb(catalog, REG_DP_INTR_STATUS4); | ||
| 721 | intr_ack = (intr & DP_INTERRUPT_STATUS4) | ||
| 722 | << DP_INTERRUPT_STATUS_ACK_SHIFT; | ||
| 723 | dp_write_ahb(catalog, REG_DP_INTR_STATUS4, intr_ack); | ||
| 724 | |||
| 725 | return intr; | ||
| 726 | } | ||
| 727 | |||
| 648 | int dp_catalog_ctrl_get_interrupt(struct dp_catalog *dp_catalog) | 728 | int dp_catalog_ctrl_get_interrupt(struct dp_catalog *dp_catalog) |
| 649 | { | 729 | { |
| 650 | struct dp_catalog_private *catalog = container_of(dp_catalog, | 730 | struct dp_catalog_private *catalog = container_of(dp_catalog, |
| @@ -13,7 +13,7 @@ · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | /* interrupts */ | 14 | /* interrupts */ |
| 15 | #define DP_INTR_HPD BIT(0) | 15 | #define DP_INTR_HPD BIT(0) |
| 16 | #define DP_INTR_AUX_I2C_DONE BIT(3) | 16 | #define DP_INTR_AUX_XFER_DONE BIT(3) |
| 17 | #define DP_INTR_WRONG_ADDR BIT(6) | 17 | #define DP_INTR_WRONG_ADDR BIT(6) |
| 18 | #define DP_INTR_TIMEOUT BIT(9) | 18 | #define DP_INTR_TIMEOUT BIT(9) |
| 19 | #define DP_INTR_NACK_DEFER BIT(12) | 19 | #define DP_INTR_NACK_DEFER BIT(12) |
| @@ -93,6 +93,7 @@ void dp_catalog_ctrl_state_ctrl(struct dp_catalog *dp_catalog, u32 state); · 73 unmodified lines | |||
| 93 | void dp_catalog_ctrl_config_ctrl(struct dp_catalog *dp_catalog, u32 config); | 93 | void dp_catalog_ctrl_config_ctrl(struct dp_catalog *dp_catalog, u32 config); |
| 94 | void dp_catalog_ctrl_lane_mapping(struct dp_catalog *dp_catalog); | 94 | void dp_catalog_ctrl_lane_mapping(struct dp_catalog *dp_catalog); |
| 95 | void dp_catalog_ctrl_mainlink_ctrl(struct dp_catalog *dp_catalog, bool enable); | 95 | void dp_catalog_ctrl_mainlink_ctrl(struct dp_catalog *dp_catalog, bool enable); |
| 96 | void dp_catalog_ctrl_psr_mainlink_enable(struct dp_catalog *dp_catalog, bool enable); | ||
| 96 | void dp_catalog_ctrl_config_misc(struct dp_catalog *dp_catalog, u32 cc, u32 tb); | 97 | void dp_catalog_ctrl_config_misc(struct dp_catalog *dp_catalog, u32 cc, u32 tb); |
| 97 | void dp_catalog_ctrl_config_msa(struct dp_catalog *dp_catalog, u32 rate, | 98 | void dp_catalog_ctrl_config_msa(struct dp_catalog *dp_catalog, u32 rate, |
| 98 | u32 stream_rate_khz, bool fixed_nvid); | 99 | u32 stream_rate_khz, bool fixed_nvid); |
| @@ -104,12 +105,15 @@ void dp_catalog_ctrl_enable_irq(struct dp_catalog *dp_catalog, bool enable); · 5 unmodified lines | |||
| 104 | void dp_catalog_hpd_config_intr(struct dp_catalog *dp_catalog, | 105 | void dp_catalog_hpd_config_intr(struct dp_catalog *dp_catalog, |
| 105 | u32 intr_mask, bool en); | 106 | u32 intr_mask, bool en); |
| 106 | void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog); | 107 | void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog); |
| 108 | void dp_catalog_ctrl_config_psr(struct dp_catalog *dp_catalog); | ||
| 109 | void dp_catalog_ctrl_set_psr(struct dp_catalog *dp_catalog, bool enter); | ||
| 107 | u32 dp_catalog_link_is_connected(struct dp_catalog *dp_catalog); | 110 | u32 dp_catalog_link_is_connected(struct dp_catalog *dp_catalog); |
| 108 | u32 dp_catalog_hpd_get_intr_status(struct dp_catalog *dp_catalog); | 111 | u32 dp_catalog_hpd_get_intr_status(struct dp_catalog *dp_catalog); |
| 109 | void dp_catalog_ctrl_phy_reset(struct dp_catalog *dp_catalog); | 112 | void dp_catalog_ctrl_phy_reset(struct dp_catalog *dp_catalog); |
| 110 | int dp_catalog_ctrl_update_vx_px(struct dp_catalog *dp_catalog, u8 v_level, | 113 | int dp_catalog_ctrl_update_vx_px(struct dp_catalog *dp_catalog, u8 v_level, |
| 111 | u8 p_level); | 114 | u8 p_level); |
| 112 | int dp_catalog_ctrl_get_interrupt(struct dp_catalog *dp_catalog); | 115 | int dp_catalog_ctrl_get_interrupt(struct dp_catalog *dp_catalog); |
| 116 | u32 dp_catalog_ctrl_read_psr_interrupt_status(struct dp_catalog *dp_catalog); | ||
| 113 | void dp_catalog_ctrl_update_transfer_unit(struct dp_catalog *dp_catalog, | 117 | void dp_catalog_ctrl_update_transfer_unit(struct dp_catalog *dp_catalog, |
| 114 | u32 dp_tu, u32 valid_boundary, | 118 | u32 dp_tu, u32 valid_boundary, |
| 115 | u32 valid_boundary2); | 119 | u32 valid_boundary2); |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | 22 | ||
| 23 | #define DP_KHZ_TO_HZ 1000 | 23 | #define DP_KHZ_TO_HZ 1000 |
| 24 | #define IDLE_PATTERN_COMPLETION_TIMEOUT_JIFFIES (30 * HZ / 1000) /* 30 ms */ | 24 | #define IDLE_PATTERN_COMPLETION_TIMEOUT_JIFFIES (30 * HZ / 1000) /* 30 ms */ |
| 25 | #define PSR_OPERATION_COMPLETION_TIMEOUT_JIFFIES (300 * HZ / 1000) /* 300 ms */ | ||
| 25 | #define WAIT_FOR_VIDEO_READY_TIMEOUT_JIFFIES (HZ / 2) | 26 | #define WAIT_FOR_VIDEO_READY_TIMEOUT_JIFFIES (HZ / 2) |
| 26 | 27 | ||
| 27 | #define DP_CTRL_INTR_READY_FOR_VIDEO BIT(0) | 28 | #define DP_CTRL_INTR_READY_FOR_VIDEO BIT(0) |
| @@ -80,6 +81,7 @@ struct dp_ctrl_private { · 52 unmodified lines | |||
| 80 | struct dp_catalog *catalog; | 81 | struct dp_catalog *catalog; |
| 81 | 82 | ||
| 82 | struct completion idle_comp; | 83 | struct completion idle_comp; |
| 84 | struct completion psr_op_comp; | ||
| 83 | struct completion video_comp; | 85 | struct completion video_comp; |
| 84 | }; | 86 | }; |
| 85 | 87 | ||
| @@ -153,6 +155,9 @@ static void dp_ctrl_config_ctrl(struct dp_ctrl_private *ctrl) · 67 unmodified lines | |||
| 153 | config |= DP_CONFIGURATION_CTRL_STATIC_DYNAMIC_CN; | 155 | config |= DP_CONFIGURATION_CTRL_STATIC_DYNAMIC_CN; |
| 154 | config |= DP_CONFIGURATION_CTRL_SYNC_ASYNC_CLK; | 156 | config |= DP_CONFIGURATION_CTRL_SYNC_ASYNC_CLK; |
| 155 | 157 | ||
| 158 | if (ctrl->panel->psr_cap.version) | ||
| 159 | config |= DP_CONFIGURATION_CTRL_SEND_VSC; | ||
| 160 | |||
| 156 | dp_catalog_ctrl_config_ctrl(ctrl->catalog, config); | 161 | dp_catalog_ctrl_config_ctrl(ctrl->catalog, config); |
| 157 | } | 162 | } |
| 158 | 163 | ||
| @@ -1375,6 +1380,64 @@ void dp_ctrl_reset_irq_ctrl(struct dp_ctrl *dp_ctrl, bool enable) · 1216 unmodified lines | |||
| 1375 | dp_catalog_ctrl_enable_irq(ctrl->catalog, enable); | 1380 | dp_catalog_ctrl_enable_irq(ctrl->catalog, enable); |
| 1376 | } | 1381 | } |
| 1377 | 1382 | ||
| 1383 | void dp_ctrl_config_psr(struct dp_ctrl *dp_ctrl) | ||
| 1384 | { | ||
| 1385 | u8 cfg; | ||
| 1386 | struct dp_ctrl_private *ctrl = container_of(dp_ctrl, | ||
| 1387 | struct dp_ctrl_private, dp_ctrl); | ||
| 1388 | |||
| 1389 | if (!ctrl->panel->psr_cap.version) | ||
| 1390 | return; | ||
| 1391 | |||
| 1392 | dp_catalog_ctrl_config_psr(ctrl->catalog); | ||
| 1393 | |||
| 1394 | cfg = DP_PSR_ENABLE; | ||
| 1395 | drm_dp_dpcd_write(ctrl->aux, DP_PSR_EN_CFG, &cfg, 1); | ||
| 1396 | } | ||
| 1397 | |||
| 1398 | void dp_ctrl_set_psr(struct dp_ctrl *dp_ctrl, bool enter) | ||
| 1399 | { | ||
| 1400 | struct dp_ctrl_private *ctrl = container_of(dp_ctrl, | ||
| 1401 | struct dp_ctrl_private, dp_ctrl); | ||
| 1402 | |||
| 1403 | if (!ctrl->panel->psr_cap.version) | ||
| 1404 | return; | ||
| 1405 | |||
| 1406 | /* | ||
| 1407 | * When entering PSR, | ||
| 1408 | * 1. Send PSR enter SDP and wait for the PSR_UPDATE_INT | ||
| 1409 | * 2. Turn off video | ||
| 1410 | * 3. Disable the mainlink | ||
| 1411 | * | ||
| 1412 | * When exiting PSR, | ||
| 1413 | * 1. Enable the mainlink | ||
| 1414 | * 2. Send the PSR exit SDP | ||
| 1415 | */ | ||
| 1416 | if (enter) { | ||
| 1417 | reinit_completion(&ctrl->psr_op_comp); | ||
| 1418 | dp_catalog_ctrl_set_psr(ctrl->catalog, true); | ||
| 1419 | |||
| 1420 | if (!wait_for_completion_timeout(&ctrl->psr_op_comp, | ||
| 1421 | PSR_OPERATION_COMPLETION_TIMEOUT_JIFFIES)) { | ||
| 1422 | DRM_ERROR("PSR_ENTRY timedout\n"); | ||
| 1423 | dp_catalog_ctrl_set_psr(ctrl->catalog, false); | ||
| 1424 | return; | ||
| 1425 | } | ||
| 1426 | |||
| 1427 | dp_ctrl_push_idle(dp_ctrl); | ||
| 1428 | dp_catalog_ctrl_state_ctrl(ctrl->catalog, 0); | ||
| 1429 | |||
| 1430 | dp_catalog_ctrl_psr_mainlink_enable(ctrl->catalog, false); | ||
| 1431 | } else { | ||
| 1432 | dp_catalog_ctrl_psr_mainlink_enable(ctrl->catalog, true); | ||
| 1433 | |||
| 1434 | dp_catalog_ctrl_set_psr(ctrl->catalog, false); | ||
| 1435 | dp_catalog_ctrl_state_ctrl(ctrl->catalog, DP_STATE_CTRL_SEND_VIDEO); | ||
| 1436 | dp_ctrl_wait4video_ready(ctrl); | ||
| 1437 | dp_catalog_ctrl_state_ctrl(ctrl->catalog, 0); | ||
| 1438 | } | ||
| 1439 | } | ||
| 1440 | |||
| 1378 | void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl) | 1441 | void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl) |
| 1379 | { | 1442 | { |
| 1380 | struct dp_ctrl_private *ctrl; | 1443 | struct dp_ctrl_private *ctrl; |
| @@ -1979,27 +2042,49 @@ int dp_ctrl_off(struct dp_ctrl *dp_ctrl) · 598 unmodified lines | |||
| 1979 | return ret; | 2042 | return ret; |
| 1980 | } | 2043 | } |
| 1981 | 2044 | ||
| 1982 | void dp_ctrl_isr(struct dp_ctrl *dp_ctrl) | 2045 | irqreturn_t dp_ctrl_isr(struct dp_ctrl *dp_ctrl) |
| 1983 | { | 2046 | { |
| 1984 | struct dp_ctrl_private *ctrl; | 2047 | struct dp_ctrl_private *ctrl; |
| 1985 | u32 isr; | 2048 | u32 isr; |
| 2049 | irqreturn_t ret = IRQ_NONE; | ||
| 1986 | 2050 | ||
| 1987 | if (!dp_ctrl) | 2051 | if (!dp_ctrl) |
| 1988 | return; | 2052 | return IRQ_NONE; |
| 1989 | 2053 | ||
| 1990 | ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); | 2054 | ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); |
| 1991 | 2055 | ||
| 2056 | if (ctrl->panel->psr_cap.version) { | ||
| 2057 | isr = dp_catalog_ctrl_read_psr_interrupt_status(ctrl->catalog); | ||
| 2058 | |||
| 2059 | if (isr) | ||
| 2060 | complete(&ctrl->psr_op_comp); | ||
| 2061 | |||
| 2062 | if (isr & PSR_EXIT_INT) | ||
| 2063 | drm_dbg_dp(ctrl->drm_dev, "PSR exit done\n"); | ||
| 2064 | |||
| 2065 | if (isr & PSR_UPDATE_INT) | ||
| 2066 | drm_dbg_dp(ctrl->drm_dev, "PSR frame update done\n"); | ||
| 2067 | |||
| 2068 | if (isr & PSR_CAPTURE_INT) | ||
| 2069 | drm_dbg_dp(ctrl->drm_dev, "PSR frame capture done\n"); | ||
| 2070 | } | ||
| 2071 | |||
| 1992 | isr = dp_catalog_ctrl_get_interrupt(ctrl->catalog); | 2072 | isr = dp_catalog_ctrl_get_interrupt(ctrl->catalog); |
| 1993 | 2073 | ||
| 2074 | |||
| 1994 | if (isr & DP_CTRL_INTR_READY_FOR_VIDEO) { | 2075 | if (isr & DP_CTRL_INTR_READY_FOR_VIDEO) { |
| 1995 | drm_dbg_dp(ctrl->drm_dev, "dp_video_ready\n"); | 2076 | drm_dbg_dp(ctrl->drm_dev, "dp_video_ready\n"); |
| 1996 | complete(&ctrl->video_comp); | 2077 | complete(&ctrl->video_comp); |
| 2078 | ret = IRQ_HANDLED; | ||
| 1997 | } | 2079 | } |
| 1998 | 2080 | ||
| 1999 | if (isr & DP_CTRL_INTR_IDLE_PATTERN_SENT) { | 2081 | if (isr & DP_CTRL_INTR_IDLE_PATTERN_SENT) { |
| 2000 | drm_dbg_dp(ctrl->drm_dev, "idle_patterns_sent\n"); | 2082 | drm_dbg_dp(ctrl->drm_dev, "idle_patterns_sent\n"); |
| 2001 | complete(&ctrl->idle_comp); | 2083 | complete(&ctrl->idle_comp); |
| 2084 | ret = IRQ_HANDLED; | ||
| 2002 | } | 2085 | } |
| 2086 | |||
| 2087 | return ret; | ||
| 2003 | } | 2088 | } |
| 2004 | 2089 | ||
| 2005 | struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link, | 2090 | struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link, |
| @@ -2035,6 +2120,7 @@ struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link, · 29 unmodified lines | |||
| 2035 | dev_err(dev, "failed to add DP OPP table\n"); | 2120 | dev_err(dev, "failed to add DP OPP table\n"); |
| 2036 | 2121 | ||
| 2037 | init_completion(&ctrl->idle_comp); | 2122 | init_completion(&ctrl->idle_comp); |
| 2123 | init_completion(&ctrl->psr_op_comp); | ||
| 2038 | init_completion(&ctrl->video_comp); | 2124 | init_completion(&ctrl->video_comp); |
| 2039 | 2125 | ||
| 2040 | /* in parameters */ | 2126 | /* in parameters */ |
| @@ -25,7 +25,7 @@ int dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl); · 24 unmodified lines | |||
| 25 | int dp_ctrl_off_link(struct dp_ctrl *dp_ctrl); | 25 | int dp_ctrl_off_link(struct dp_ctrl *dp_ctrl); |
| 26 | int dp_ctrl_off(struct dp_ctrl *dp_ctrl); | 26 | int dp_ctrl_off(struct dp_ctrl *dp_ctrl); |
| 27 | void dp_ctrl_push_idle(struct dp_ctrl *dp_ctrl); | 27 | void dp_ctrl_push_idle(struct dp_ctrl *dp_ctrl); |
| 28 | void dp_ctrl_isr(struct dp_ctrl *dp_ctrl); | 28 | irqreturn_t dp_ctrl_isr(struct dp_ctrl *dp_ctrl); |
| 29 | void dp_ctrl_handle_sink_request(struct dp_ctrl *dp_ctrl); | 29 | void dp_ctrl_handle_sink_request(struct dp_ctrl *dp_ctrl); |
| 30 | struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link, | 30 | struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link, |
| 31 | struct dp_panel *panel, struct drm_dp_aux *aux, | 31 | struct dp_panel *panel, struct drm_dp_aux *aux, |
| @@ -37,4 +37,7 @@ void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl); · 5 unmodified lines | |||
| 37 | void dp_ctrl_phy_exit(struct dp_ctrl *dp_ctrl); | 37 | void dp_ctrl_phy_exit(struct dp_ctrl *dp_ctrl); |
| 38 | void dp_ctrl_irq_phy_exit(struct dp_ctrl *dp_ctrl); | 38 | void dp_ctrl_irq_phy_exit(struct dp_ctrl *dp_ctrl); |
| 39 | 39 | ||
| 40 | void dp_ctrl_set_psr(struct dp_ctrl *dp_ctrl, bool enable); | ||
| 41 | void dp_ctrl_config_psr(struct dp_ctrl *dp_ctrl); | ||
| 42 | |||
| 40 | #endif /* _DP_CTRL_H_ */ | 43 | #endif /* _DP_CTRL_H_ */ |
| @@ -406,6 +406,8 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp) · 405 unmodified lines | |||
| 406 | 406 | ||
| 407 | edid = dp->panel->edid; | 407 | edid = dp->panel->edid; |
| 408 | 408 | ||
| 409 | dp->dp_display.psr_supported = dp->panel->psr_cap.version; | ||
| 410 | |||
| 409 | dp->audio_supported = drm_detect_monitor_audio(edid); | 411 | dp->audio_supported = drm_detect_monitor_audio(edid); |
| 410 | dp_panel_handle_sink_request(dp->panel); | 412 | dp_panel_handle_sink_request(dp->panel); |
| 411 | 413 | ||
| @@ -910,6 +912,10 @@ static int dp_display_post_enable(struct msm_dp *dp_display) · 498 unmodified lines | |||
| 910 | 912 | ||
| 911 | /* signal the connect event late to synchronize video and display */ | 913 | /* signal the connect event late to synchronize video and display */ |
| 912 | dp_display_handle_plugged_change(dp_display, true); | 914 | dp_display_handle_plugged_change(dp_display, true); |
| 915 | |||
| 916 | if (dp_display->psr_supported) | ||
| 917 | dp_ctrl_config_psr(dp->ctrl); | ||
| 918 | |||
| 913 | return 0; | 919 | return 0; |
| 914 | } | 920 | } |
| 915 | 921 | ||
| @@ -990,14 +996,6 @@ enum drm_mode_status dp_bridge_mode_valid(struct drm_bridge *bridge, · 74 unmodified lines | |||
| 990 | return -EINVAL; | 996 | return -EINVAL; |
| 991 | } | 997 | } |
| 992 | 998 | ||
| 993 | /* | ||
| 994 | * The eDP controller currently does not have a reliable way of | ||
| 995 | * enabling panel power to read sink capabilities. So, we rely | ||
| 996 | * on the panel driver to populate only supported modes for now. | ||
| 997 | */ | ||
| 998 | if (dp->is_edp) | ||
| 999 | return MODE_OK; | ||
| 1000 | |||
| 1001 | if (mode->clock > DP_MAX_PIXEL_CLK_KHZ) | 999 | if (mode->clock > DP_MAX_PIXEL_CLK_KHZ) |
| 1002 | return MODE_CLOCK_HIGH; | 1000 | return MODE_CLOCK_HIGH; |
| 1003 | 1001 | ||
| @@ -1104,6 +1102,19 @@ static void dp_display_config_hpd(struct dp_display_private *dp) · 100 unmodified lines | |||
| 1104 | enable_irq(dp->irq); | 1102 | enable_irq(dp->irq); |
| 1105 | } | 1103 | } |
| 1106 | 1104 | ||
| 1105 | void dp_display_set_psr(struct msm_dp *dp_display, bool enter) | ||
| 1106 | { | ||
| 1107 | struct dp_display_private *dp; | ||
| 1108 | |||
| 1109 | if (!dp_display) { | ||
| 1110 | DRM_ERROR("invalid params\n"); | ||
| 1111 | return; | ||
| 1112 | } | ||
| 1113 | |||
| 1114 | dp = container_of(dp_display, struct dp_display_private, dp_display); | ||
| 1115 | dp_ctrl_set_psr(dp->ctrl, enter); | ||
| 1116 | } | ||
| 1117 | |||
| 1107 | static int hpd_event_thread(void *data) | 1118 | static int hpd_event_thread(void *data) |
| 1108 | { | 1119 | { |
| 1109 | struct dp_display_private *dp_priv; | 1120 | struct dp_display_private *dp_priv; |
| @@ -1204,7 +1215,7 @@ static int dp_hpd_event_thread_start(struct dp_display_private *dp_priv) · 94 unmodified lines | |||
| 1204 | static irqreturn_t dp_display_irq_handler(int irq, void *dev_id) | 1215 | static irqreturn_t dp_display_irq_handler(int irq, void *dev_id) |
| 1205 | { | 1216 | { |
| 1206 | struct dp_display_private *dp = dev_id; | 1217 | struct dp_display_private *dp = dev_id; |
| 1207 | irqreturn_t ret = IRQ_HANDLED; | 1218 | irqreturn_t ret = IRQ_NONE; |
| 1208 | u32 hpd_isr_status; | 1219 | u32 hpd_isr_status; |
| 1209 | 1220 | ||
| 1210 | if (!dp) { | 1221 | if (!dp) { |
| @@ -1232,13 +1243,15 @@ static irqreturn_t dp_display_irq_handler(int irq, void *dev_id) · 21 unmodified lines | |||
| 1232 | 1243 | ||
| 1233 | if (hpd_isr_status & DP_DP_HPD_UNPLUG_INT_MASK) | 1244 | if (hpd_isr_status & DP_DP_HPD_UNPLUG_INT_MASK) |
| 1234 | dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0); | 1245 | dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0); |
| 1246 | |||
| 1247 | ret = IRQ_HANDLED; | ||
| 1235 | } | 1248 | } |
| 1236 | 1249 | ||
| 1237 | /* DP controller isr */ | 1250 | /* DP controller isr */ |
| 1238 | dp_ctrl_isr(dp->ctrl); | 1251 | ret |= dp_ctrl_isr(dp->ctrl); |
| 1239 | 1252 | ||
| 1240 | /* DP aux isr */ | 1253 | /* DP aux isr */ |
| 1241 | dp_aux_isr(dp->aux); | 1254 | ret |= dp_aux_isr(dp->aux); |
| 1242 | 1255 | ||
| 1243 | return ret; | 1256 | return ret; |
| 1244 | } | 1257 | } |
| @@ -1652,7 +1665,8 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, · 407 unmodified lines | |||
| 1652 | return 0; | 1665 | return 0; |
| 1653 | } | 1666 | } |
| 1654 | 1667 | ||
| 1655 | void dp_bridge_enable(struct drm_bridge *drm_bridge) | 1668 | void dp_bridge_atomic_enable(struct drm_bridge *drm_bridge, |
| 1669 | struct drm_bridge_state *old_bridge_state) | ||
| 1656 | { | 1670 | { |
| 1657 | struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); | 1671 | struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); |
| 1658 | struct msm_dp *dp = dp_bridge->dp_display; | 1672 | struct msm_dp *dp = dp_bridge->dp_display; |
| @@ -1707,7 +1721,8 @@ void dp_bridge_enable(struct drm_bridge *drm_bridge) · 48 unmodified lines | |||
| 1707 | mutex_unlock(&dp_display->event_mutex); | 1721 | mutex_unlock(&dp_display->event_mutex); |
| 1708 | } | 1722 | } |
| 1709 | 1723 | ||
| 1710 | void dp_bridge_disable(struct drm_bridge *drm_bridge) | 1724 | void dp_bridge_atomic_disable(struct drm_bridge *drm_bridge, |
| 1725 | struct drm_bridge_state *old_bridge_state) | ||
| 1711 | { | 1726 | { |
| 1712 | struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); | 1727 | struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); |
| 1713 | struct msm_dp *dp = dp_bridge->dp_display; | 1728 | struct msm_dp *dp = dp_bridge->dp_display; |
| @@ -1718,7 +1733,8 @@ void dp_bridge_disable(struct drm_bridge *drm_bridge) · 4 unmodified lines | |||
| 1718 | dp_ctrl_push_idle(dp_display->ctrl); | 1733 | dp_ctrl_push_idle(dp_display->ctrl); |
| 1719 | } | 1734 | } |
| 1720 | 1735 | ||
| 1721 | void dp_bridge_post_disable(struct drm_bridge *drm_bridge) | 1736 | void dp_bridge_atomic_post_disable(struct drm_bridge *drm_bridge, |
| 1737 | struct drm_bridge_state *old_bridge_state) | ||
| 1722 | { | 1738 | { |
| 1723 | struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); | 1739 | struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); |
| 1724 | struct msm_dp *dp = dp_bridge->dp_display; | 1740 | struct msm_dp *dp = dp_bridge->dp_display; |
| @@ -29,6 +29,7 @@ struct msm_dp { · 28 unmodified lines | |||
| 29 | 29 | ||
| 30 | u32 max_dp_lanes; | 30 | u32 max_dp_lanes; |
| 31 | struct dp_audio *dp_audio; | 31 | struct dp_audio *dp_audio; |
| 32 | bool psr_supported; | ||
| 32 | }; | 33 | }; |
| 33 | 34 | ||
| 34 | int dp_display_set_plugged_cb(struct msm_dp *dp_display, | 35 | int dp_display_set_plugged_cb(struct msm_dp *dp_display, |
| @@ -39,5 +40,6 @@ bool dp_display_check_video_test(struct msm_dp *dp_display); · 4 unmodified lines | |||
| 39 | int dp_display_get_test_bpp(struct msm_dp *dp_display); | 40 | int dp_display_get_test_bpp(struct msm_dp *dp_display); |
| 40 | void dp_display_signal_audio_start(struct msm_dp *dp_display); | 41 | void dp_display_signal_audio_start(struct msm_dp *dp_display); |
| 41 | void dp_display_signal_audio_complete(struct msm_dp *dp_display); | 42 | void dp_display_signal_audio_complete(struct msm_dp *dp_display); |
| 43 | void dp_display_set_psr(struct msm_dp *dp, bool enter); | ||
| 42 | 44 | ||
| 43 | #endif /* _DP_DISPLAY_H_ */ | 45 | #endif /* _DP_DISPLAY_H_ */ |
| @@ -94,9 +94,9 @@ static const struct drm_bridge_funcs dp_bridge_ops = { · 93 unmodified lines | |||
| 94 | .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, | 94 | .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, |
| 95 | .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, | 95 | .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, |
| 96 | .atomic_reset = drm_atomic_helper_bridge_reset, | 96 | .atomic_reset = drm_atomic_helper_bridge_reset, |
| 97 | .enable = dp_bridge_enable, | 97 | .atomic_enable = dp_bridge_atomic_enable, |
| 98 | .disable = dp_bridge_disable, | 98 | .atomic_disable = dp_bridge_atomic_disable, |
| 99 | .post_disable = dp_bridge_post_disable, | 99 | .atomic_post_disable = dp_bridge_atomic_post_disable, |
| 100 | .mode_set = dp_bridge_mode_set, | 100 | .mode_set = dp_bridge_mode_set, |
| 101 | .mode_valid = dp_bridge_mode_valid, | 101 | .mode_valid = dp_bridge_mode_valid, |
| 102 | .get_modes = dp_bridge_get_modes, | 102 | .get_modes = dp_bridge_get_modes, |
| @@ -107,6 +107,171 @@ static const struct drm_bridge_funcs dp_bridge_ops = { · 4 unmodified lines | |||
| 107 | .hpd_notify = dp_bridge_hpd_notify, | 107 | .hpd_notify = dp_bridge_hpd_notify, |
| 108 | }; | 108 | }; |
| 109 | 109 | ||
| 110 | static int edp_bridge_atomic_check(struct drm_bridge *drm_bridge, | ||
| 111 | struct drm_bridge_state *bridge_state, | ||
| 112 | struct drm_crtc_state *crtc_state, | ||
| 113 | struct drm_connector_state *conn_state) | ||
| 114 | { | ||
| 115 | struct msm_dp *dp = to_dp_bridge(drm_bridge)->dp_display; | ||
| 116 | |||
| 117 | if (WARN_ON(!conn_state)) | ||
| 118 | return -ENODEV; | ||
| 119 | |||
| 120 | conn_state->self_refresh_aware = dp->psr_supported; | ||
| 121 | |||
| 122 | if (!conn_state->crtc || !crtc_state) | ||
| 123 | return 0; | ||
| 124 | |||
| 125 | if (crtc_state->self_refresh_active && !dp->psr_supported) | ||
| 126 | return -EINVAL; | ||
| 127 | |||
| 128 | return 0; | ||
| 129 | } | ||
| 130 | |||
| 131 | static void edp_bridge_atomic_enable(struct drm_bridge *drm_bridge, | ||
| 132 | struct drm_bridge_state *old_bridge_state) | ||
| 133 | { | ||
| 134 | struct drm_atomic_state *atomic_state = old_bridge_state->base.state; | ||
| 135 | struct drm_crtc *crtc; | ||
| 136 | struct drm_crtc_state *old_crtc_state; | ||
| 137 | struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); | ||
| 138 | struct msm_dp *dp = dp_bridge->dp_display; | ||
| 139 | |||
| 140 | /* | ||
| 141 | * Check the old state of the crtc to determine if the panel | ||
| 142 | * was put into psr state previously by the edp_bridge_atomic_disable. | ||
| 143 | * If the panel is in psr, just exit psr state and skip the full | ||
| 144 | * bridge enable sequence. | ||
| 145 | */ | ||
| 146 | crtc = drm_atomic_get_new_crtc_for_encoder(atomic_state, | ||
| 147 | drm_bridge->encoder); | ||
| 148 | if (!crtc) | ||
| 149 | return; | ||
| 150 | |||
| 151 | old_crtc_state = drm_atomic_get_old_crtc_state(atomic_state, crtc); | ||
| 152 | |||
| 153 | if (old_crtc_state && old_crtc_state->self_refresh_active) { | ||
| 154 | dp_display_set_psr(dp, false); | ||
| 155 | return; | ||
| 156 | } | ||
| 157 | |||
| 158 | dp_bridge_atomic_enable(drm_bridge, old_bridge_state); | ||
| 159 | } | ||
| 160 | |||
| 161 | static void edp_bridge_atomic_disable(struct drm_bridge *drm_bridge, | ||
| 162 | struct drm_bridge_state *old_bridge_state) | ||
| 163 | { | ||
| 164 | struct drm_atomic_state *atomic_state = old_bridge_state->base.state; | ||
| 165 | struct drm_crtc *crtc; | ||
| 166 | struct drm_crtc_state *new_crtc_state = NULL, *old_crtc_state = NULL; | ||
| 167 | struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); | ||
| 168 | struct msm_dp *dp = dp_bridge->dp_display; | ||
| 169 | |||
| 170 | crtc = drm_atomic_get_old_crtc_for_encoder(atomic_state, | ||
| 171 | drm_bridge->encoder); | ||
| 172 | if (!crtc) | ||
| 173 | goto out; | ||
| 174 | |||
| 175 | new_crtc_state = drm_atomic_get_new_crtc_state(atomic_state, crtc); | ||
| 176 | if (!new_crtc_state) | ||
| 177 | goto out; | ||
| 178 | |||
| 179 | old_crtc_state = drm_atomic_get_old_crtc_state(atomic_state, crtc); | ||
| 180 | if (!old_crtc_state) | ||
| 181 | goto out; | ||
| 182 | |||
| 183 | /* | ||
| 184 | * Set self refresh mode if current crtc state is active. | ||
| 185 | * | ||
| 186 | * If old crtc state is active, then this is a display disable | ||
| 187 | * call while the sink is in psr state. So, exit psr here. | ||
| 188 | * The eDP controller will be disabled in the | ||
| 189 | * edp_bridge_atomic_post_disable function. | ||
| 190 | * | ||
| 191 | * We observed sink is stuck in self refresh if psr exit is skipped | ||
| 192 | * when display disable occurs while the sink is in psr state. | ||
| 193 | */ | ||
| 194 | if (new_crtc_state->self_refresh_active) { | ||
| 195 | dp_display_set_psr(dp, true); | ||
| 196 | return; | ||
| 197 | } else if (old_crtc_state->self_refresh_active) { | ||
| 198 | dp_display_set_psr(dp, false); | ||
| 199 | return; | ||
| 200 | } | ||
| 201 | |||
| 202 | out: | ||
| 203 | dp_bridge_atomic_disable(drm_bridge, old_bridge_state); | ||
| 204 | } | ||
| 205 | |||
| 206 | static void edp_bridge_atomic_post_disable(struct drm_bridge *drm_bridge, | ||
| 207 | struct drm_bridge_state *old_bridge_state) | ||
| 208 | { | ||
| 209 | struct drm_atomic_state *atomic_state = old_bridge_state->base.state; | ||
| 210 | struct drm_crtc *crtc; | ||
| 211 | struct drm_crtc_state *new_crtc_state = NULL; | ||
| 212 | |||
| 213 | crtc = drm_atomic_get_old_crtc_for_encoder(atomic_state, | ||
| 214 | drm_bridge->encoder); | ||
| 215 | if (!crtc) | ||
| 216 | return; | ||
| 217 | |||
| 218 | new_crtc_state = drm_atomic_get_new_crtc_state(atomic_state, crtc); | ||
| 219 | if (!new_crtc_state) | ||
| 220 | return; | ||
| 221 | |||
| 222 | /* | ||
| 223 | * Self refresh mode is already set in edp_bridge_atomic_disable. | ||
| 224 | */ | ||
| 225 | if (new_crtc_state->self_refresh_active) | ||
| 226 | return; | ||
| 227 | |||
| 228 | dp_bridge_atomic_post_disable(drm_bridge, old_bridge_state); | ||
| 229 | } | ||
| 230 | |||
| 231 | /** | ||
| 232 | * edp_bridge_mode_valid - callback to determine if specified mode is valid | ||
| 233 | * @bridge: Pointer to drm bridge structure | ||
| 234 | * @info: display info | ||
| 235 | * @mode: Pointer to drm mode structure | ||
| 236 | * Returns: Validity status for specified mode | ||
| 237 | */ | ||
| 238 | static enum drm_mode_status edp_bridge_mode_valid(struct drm_bridge *bridge, | ||
| 239 | const struct drm_display_info *info, | ||
| 240 | const struct drm_display_mode *mode) | ||
| 241 | { | ||
| 242 | struct msm_dp *dp; | ||
| 243 | int mode_pclk_khz = mode->clock; | ||
| 244 | |||
| 245 | dp = to_dp_bridge(bridge)->dp_display; | ||
| 246 | |||
| 247 | if (!dp || !mode_pclk_khz || !dp->connector) { | ||
| 248 | DRM_ERROR("invalid params\n"); | ||
| 249 | return -EINVAL; | ||
| 250 | } | ||
| 251 | |||
| 252 | if (mode->clock > DP_MAX_PIXEL_CLK_KHZ) | ||
| 253 | return MODE_CLOCK_HIGH; | ||
| 254 | |||
| 255 | /* | ||
| 256 | * The eDP controller currently does not have a reliable way of | ||
| 257 | * enabling panel power to read sink capabilities. So, we rely | ||
| 258 | * on the panel driver to populate only supported modes for now. | ||
| 259 | */ | ||
| 260 | return MODE_OK; | ||
| 261 | } | ||
| 262 | |||
| 263 | static const struct drm_bridge_funcs edp_bridge_ops = { | ||
| 264 | .atomic_enable = edp_bridge_atomic_enable, | ||
| 265 | .atomic_disable = edp_bridge_atomic_disable, | ||
| 266 | .atomic_post_disable = edp_bridge_atomic_post_disable, | ||
| 267 | .mode_set = dp_bridge_mode_set, | ||
| 268 | .mode_valid = edp_bridge_mode_valid, | ||
| 269 | .atomic_reset = drm_atomic_helper_bridge_reset, | ||
| 270 | .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, | ||
| 271 | .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, | ||
| 272 | .atomic_check = edp_bridge_atomic_check, | ||
| 273 | }; | ||
| 274 | |||
| 110 | struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, | 275 | struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, |
| 111 | struct drm_encoder *encoder) | 276 | struct drm_encoder *encoder) |
| 112 | { | 277 | { |
| @@ -121,7 +286,7 @@ struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device * · 8 unmodified lines | |||
| 121 | dp_bridge->dp_display = dp_display; | 286 | dp_bridge->dp_display = dp_display; |
| 122 | 287 | ||
| 123 | bridge = &dp_bridge->bridge; | 288 | bridge = &dp_bridge->bridge; |
| 124 | bridge->funcs = &dp_bridge_ops; | 289 | bridge->funcs = dp_display->is_edp ? &edp_bridge_ops : &dp_bridge_ops; |
| 125 | bridge->type = dp_display->connector_type; | 290 | bridge->type = dp_display->connector_type; |
| 126 | 291 | ||
| 127 | /* | 292 | /* |
| @@ -23,9 +23,12 @@ struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct dr · 22 unmodified lines | |||
| 23 | struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, | 23 | struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, |
| 24 | struct drm_encoder *encoder); | 24 | struct drm_encoder *encoder); |
| 25 | 25 | ||
| 26 | void dp_bridge_enable(struct drm_bridge *drm_bridge); | 26 | void dp_bridge_atomic_enable(struct drm_bridge *drm_bridge, |
| 27 | void dp_bridge_disable(struct drm_bridge *drm_bridge); | 27 | struct drm_bridge_state *old_bridge_state); |
| 28 | void dp_bridge_post_disable(struct drm_bridge *drm_bridge); | 28 | void dp_bridge_atomic_disable(struct drm_bridge *drm_bridge, |
| 29 | struct drm_bridge_state *old_bridge_state); | ||
| 30 | void dp_bridge_atomic_post_disable(struct drm_bridge *drm_bridge, | ||
| 31 | struct drm_bridge_state *old_bridge_state); | ||
| 29 | enum drm_mode_status dp_bridge_mode_valid(struct drm_bridge *bridge, | 32 | enum drm_mode_status dp_bridge_mode_valid(struct drm_bridge *bridge, |
| 30 | const struct drm_display_info *info, | 33 | const struct drm_display_info *info, |
| 31 | const struct drm_display_mode *mode); | 34 | const struct drm_display_mode *mode); |
| @@ -937,6 +937,38 @@ static int dp_link_process_phy_test_pattern_request( · 936 unmodified lines | |||
| 937 | return 0; | 937 | return 0; |
| 938 | } | 938 | } |
| 939 | 939 | ||
| 940 | static bool dp_link_read_psr_error_status(struct dp_link_private *link) | ||
| 941 | { | ||
| 942 | u8 status; | ||
| 943 | |||
| 944 | drm_dp_dpcd_read(link->aux, DP_PSR_ERROR_STATUS, &status, 1); | ||
| 945 | |||
| 946 | if (status & DP_PSR_LINK_CRC_ERROR) | ||
| 947 | DRM_ERROR("PSR LINK CRC ERROR\n"); | ||
| 948 | else if (status & DP_PSR_RFB_STORAGE_ERROR) | ||
| 949 | DRM_ERROR("PSR RFB STORAGE ERROR\n"); | ||
| 950 | else if (status & DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR) | ||
| 951 | DRM_ERROR("PSR VSC SDP UNCORRECTABLE ERROR\n"); | ||
| 952 | else | ||
| 953 | return false; | ||
| 954 | |||
| 955 | return true; | ||
| 956 | } | ||
| 957 | |||
| 958 | static bool dp_link_psr_capability_changed(struct dp_link_private *link) | ||
| 959 | { | ||
| 960 | u8 status; | ||
| 961 | |||
| 962 | drm_dp_dpcd_read(link->aux, DP_PSR_ESI, &status, 1); | ||
| 963 | |||
| 964 | if (status & DP_PSR_CAPS_CHANGE) { | ||
| 965 | drm_dbg_dp(link->drm_dev, "PSR Capability Change\n"); | ||
| 966 | return true; | ||
| 967 | } | ||
| 968 | |||
| 969 | return false; | ||
| 970 | } | ||
| 971 | |||
| 940 | static u8 get_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r) | 972 | static u8 get_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r) |
| 941 | { | 973 | { |
| 942 | return link_status[r - DP_LANE0_1_STATUS]; | 974 | return link_status[r - DP_LANE0_1_STATUS]; |
| @@ -1055,6 +1087,10 @@ int dp_link_process_request(struct dp_link *dp_link) · 112 unmodified lines | |||
| 1055 | dp_link->sink_request |= DP_TEST_LINK_TRAINING; | 1087 | dp_link->sink_request |= DP_TEST_LINK_TRAINING; |
| 1056 | } else if (!dp_link_process_phy_test_pattern_request(link)) { | 1088 | } else if (!dp_link_process_phy_test_pattern_request(link)) { |
| 1057 | dp_link->sink_request |= DP_TEST_LINK_PHY_TEST_PATTERN; | 1089 | dp_link->sink_request |= DP_TEST_LINK_PHY_TEST_PATTERN; |
| 1090 | } else if (dp_link_read_psr_error_status(link)) { | ||
| 1091 | DRM_ERROR("PSR IRQ_HPD received\n"); | ||
| 1092 | } else if (dp_link_psr_capability_changed(link)) { | ||
| 1093 | drm_dbg_dp(link->drm_dev, "PSR Capability changed"); | ||
| 1058 | } else { | 1094 | } else { |
| 1059 | ret = dp_link_process_link_status_update(link); | 1095 | ret = dp_link_process_link_status_update(link); |
| 1060 | if (!ret) { | 1096 | if (!ret) { |
| @@ -20,6 +20,27 @@ struct dp_panel_private { · 19 unmodified lines | |||
| 20 | bool aux_cfg_update_done; | 20 | bool aux_cfg_update_done; |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | static void dp_panel_read_psr_cap(struct dp_panel_private *panel) | ||
| 24 | { | ||
| 25 | ssize_t rlen; | ||
| 26 | struct dp_panel *dp_panel; | ||
| 27 | |||
| 28 | dp_panel = &panel->dp_panel; | ||
| 29 | |||
| 30 | /* edp sink */ | ||
| 31 | if (dp_panel->dpcd[DP_EDP_CONFIGURATION_CAP]) { | ||
| 32 | rlen = drm_dp_dpcd_read(panel->aux, DP_PSR_SUPPORT, | ||
| 33 | &dp_panel->psr_cap, sizeof(dp_panel->psr_cap)); | ||
| 34 | if (rlen == sizeof(dp_panel->psr_cap)) { | ||
| 35 | drm_dbg_dp(panel->drm_dev, | ||
| 36 | "psr version: 0x%x, psr_cap: 0x%x\n", | ||
| 37 | dp_panel->psr_cap.version, | ||
| 38 | dp_panel->psr_cap.capabilities); | ||
| 39 | } else | ||
| 40 | DRM_ERROR("failed to read psr info, rlen=%zd\n", rlen); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 23 | static int dp_panel_read_dpcd(struct dp_panel *dp_panel) | 44 | static int dp_panel_read_dpcd(struct dp_panel *dp_panel) |
| 24 | { | 45 | { |
| 25 | int rc = 0; | 46 | int rc = 0; |
| @@ -107,6 +128,7 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel) · 81 unmodified lines | |||
| 107 | } | 128 | } |
| 108 | } | 129 | } |
| 109 | 130 | ||
| 131 | dp_panel_read_psr_cap(panel); | ||
| 110 | end: | 132 | end: |
| 111 | return rc; | 133 | return rc; |
| 112 | } | 134 | } |
| @@ -34,6 +34,11 @@ struct dp_panel_in { · 33 unmodified lines | |||
| 34 | struct dp_catalog *catalog; | 34 | struct dp_catalog *catalog; |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | struct dp_panel_psr { | ||
| 38 | u8 version; | ||
| 39 | u8 capabilities; | ||
| 40 | }; | ||
| 41 | |||
| 37 | struct dp_panel { | 42 | struct dp_panel { |
| 38 | /* dpcd raw data */ | 43 | /* dpcd raw data */ |
| 39 | u8 dpcd[DP_RECEIVER_CAP_SIZE + 1]; | 44 | u8 dpcd[DP_RECEIVER_CAP_SIZE + 1]; |
| @@ -46,6 +51,7 @@ struct dp_panel { · 6 unmodified lines | |||
| 46 | struct edid *edid; | 51 | struct edid *edid; |
| 47 | struct drm_connector *connector; | 52 | struct drm_connector *connector; |
| 48 | struct dp_display_mode dp_mode; | 53 | struct dp_display_mode dp_mode; |
| 54 | struct dp_panel_psr psr_cap; | ||
| 49 | bool video_test; | 55 | bool video_test; |
| 50 | 56 | ||
| 51 | u32 vic; | 57 | u32 vic; |
| @@ -22,6 +22,20 @@ · 21 unmodified lines | |||
| 22 | #define REG_DP_INTR_STATUS2 (0x00000024) | 22 | #define REG_DP_INTR_STATUS2 (0x00000024) |
| 23 | #define REG_DP_INTR_STATUS3 (0x00000028) | 23 | #define REG_DP_INTR_STATUS3 (0x00000028) |
| 24 | 24 | ||
| 25 | #define REG_DP_INTR_STATUS4 (0x0000002C) | ||
| 26 | #define PSR_UPDATE_INT (0x00000001) | ||
| 27 | #define PSR_CAPTURE_INT (0x00000004) | ||
| 28 | #define PSR_EXIT_INT (0x00000010) | ||
| 29 | #define PSR_UPDATE_ERROR_INT (0x00000040) | ||
| 30 | #define PSR_WAKE_ERROR_INT (0x00000100) | ||
| 31 | |||
| 32 | #define REG_DP_INTR_MASK4 (0x00000030) | ||
| 33 | #define PSR_UPDATE_MASK (0x00000001) | ||
| 34 | #define PSR_CAPTURE_MASK (0x00000002) | ||
| 35 | #define PSR_EXIT_MASK (0x00000004) | ||
| 36 | #define PSR_UPDATE_ERROR_MASK (0x00000008) | ||
| 37 | #define PSR_WAKE_ERROR_MASK (0x00000010) | ||
| 38 | |||
| 25 | #define REG_DP_DP_HPD_CTRL (0x00000000) | 39 | #define REG_DP_DP_HPD_CTRL (0x00000000) |
| 26 | #define DP_DP_HPD_CTRL_HPD_EN (0x00000001) | 40 | #define DP_DP_HPD_CTRL_HPD_EN (0x00000001) |
| 27 | 41 | ||
| @@ -164,6 +178,16 @@ · 136 unmodified lines | |||
| 164 | #define MMSS_DP_AUDIO_TIMING_RBR_48 (0x00000094) | 178 | #define MMSS_DP_AUDIO_TIMING_RBR_48 (0x00000094) |
| 165 | #define MMSS_DP_AUDIO_TIMING_HBR_48 (0x00000098) | 179 | #define MMSS_DP_AUDIO_TIMING_HBR_48 (0x00000098) |
| 166 | 180 | ||
| 181 | #define REG_PSR_CONFIG (0x00000100) | ||
| 182 | #define DISABLE_PSR (0x00000000) | ||
| 183 | #define PSR1_SUPPORTED (0x00000001) | ||
| 184 | #define PSR2_WITHOUT_FRAMESYNC (0x00000002) | ||
| 185 | #define PSR2_WITH_FRAMESYNC (0x00000003) | ||
| 186 | |||
| 187 | #define REG_PSR_CMD (0x00000110) | ||
| 188 | #define PSR_ENTER (0x00000001) | ||
| 189 | #define PSR_EXIT (0x00000002) | ||
| 190 | |||
| 167 | #define MMSS_DP_PSR_CRC_RG (0x00000154) | 191 | #define MMSS_DP_PSR_CRC_RG (0x00000154) |
| 168 | #define MMSS_DP_PSR_CRC_B (0x00000158) | 192 | #define MMSS_DP_PSR_CRC_B (0x00000158) |
| 169 | 193 | ||
| @@ -184,6 +208,9 @@ · 14 unmodified lines | |||
| 184 | #define MMSS_DP_AUDIO_STREAM_0 (0x00000240) | 208 | #define MMSS_DP_AUDIO_STREAM_0 (0x00000240) |
| 185 | #define MMSS_DP_AUDIO_STREAM_1 (0x00000244) | 209 | #define MMSS_DP_AUDIO_STREAM_1 (0x00000244) |
| 186 | 210 | ||
| 211 | #define MMSS_DP_SDP_CFG3 (0x0000024c) | ||
| 212 | #define UPDATE_SDP (0x00000001) | ||
| 213 | |||
| 187 | #define MMSS_DP_EXTENSION_0 (0x00000250) | 214 | #define MMSS_DP_EXTENSION_0 (0x00000250) |
| 188 | #define MMSS_DP_EXTENSION_1 (0x00000254) | 215 | #define MMSS_DP_EXTENSION_1 (0x00000254) |
| 189 | #define MMSS_DP_EXTENSION_2 (0x00000258) | 216 | #define MMSS_DP_EXTENSION_2 (0x00000258) |
| @@ -4,7 +4,6 @@ · 3 unmodified lines | |||
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | #include "dsi.h" | 6 | #include "dsi.h" |
| 7 | #include "dsi_cfg.h" | ||
| 8 | 7 | ||
| 9 | bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi) | 8 | bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi) |
| 10 | { | 9 | { |
| @@ -173,8 +172,10 @@ static int dsi_dev_remove(struct platform_device *pdev) · 162 unmodified lines | |||
| 173 | } | 172 | } |
| 174 | 173 | ||
| 175 | static const struct of_device_id dt_match[] = { | 174 | static const struct of_device_id dt_match[] = { |
| 176 | { .compatible = "qcom,mdss-dsi-ctrl", .data = NULL /* autodetect cfg */ }, | 175 | { .compatible = "qcom,mdss-dsi-ctrl" }, |
| 177 | { .compatible = "qcom,dsi-ctrl-6g-qcm2290", .data = &qcm2290_dsi_cfg_handler }, | 176 | |
| 177 | /* Deprecated, don't use */ | ||
| 178 | { .compatible = "qcom,dsi-ctrl-6g-qcm2290" }, | ||
| 178 | {} | 179 | {} |
| 179 | }; | 180 | }; |
| 180 | 181 | ||
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -785,4 +785,5 @@ static inline uint32_t DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH(ui · 751 unmodified lines | |||
| 785 | return ((val) << DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH__SHIFT) & DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH__MASK; | 785 | return ((val) << DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH__SHIFT) & DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH__MASK; |
| 786 | } | 786 | } |
| 787 | 787 | ||
| 788 | |||
| 788 | #endif /* DSI_XML */ | 789 | #endif /* DSI_XML */ |
| @@ -21,8 +21,9 @@ static const struct msm_dsi_config apq8064_dsi_cfg = { · 20 unmodified lines | |||
| 21 | .num_regulators = ARRAY_SIZE(apq8064_dsi_regulators), | 21 | .num_regulators = ARRAY_SIZE(apq8064_dsi_regulators), |
| 22 | .bus_clk_names = dsi_v2_bus_clk_names, | 22 | .bus_clk_names = dsi_v2_bus_clk_names, |
| 23 | .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names), | 23 | .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names), |
| 24 | .io_start = { 0x4700000, 0x5800000 }, | 24 | .io_start = { |
| 25 | .num_dsi = 2, | 25 | { 0x4700000, 0x5800000 }, |
| 26 | }, | ||
| 26 | }; | 27 | }; |
| 27 | 28 | ||
| 28 | static const char * const dsi_6g_bus_clk_names[] = { | 29 | static const char * const dsi_6g_bus_clk_names[] = { |
| @@ -41,46 +42,40 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = { · 12 unmodified lines | |||
| 41 | .num_regulators = ARRAY_SIZE(msm8974_apq8084_regulators), | 42 | .num_regulators = ARRAY_SIZE(msm8974_apq8084_regulators), |
| 42 | .bus_clk_names = dsi_6g_bus_clk_names, | 43 | .bus_clk_names = dsi_6g_bus_clk_names, |
| 43 | .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), | 44 | .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), |
| 44 | .io_start = { 0xfd922800, 0xfd922b00 }, | 45 | .io_start = { |
| 45 | .num_dsi = 2, | 46 | { 0xfd922800, 0xfd922b00 }, |
| 47 | }, | ||
| 46 | }; | 48 | }; |
| 47 | 49 | ||
| 48 | static const char * const dsi_8916_bus_clk_names[] = { | 50 | static const char * const dsi_v1_3_1_clk_names[] = { |
| 49 | "mdp_core", "iface", "bus", | 51 | "mdp_core", "iface", "bus", |
| 50 | }; | 52 | }; |
| 51 | 53 | ||
| 52 | static const struct regulator_bulk_data msm8916_dsi_regulators[] = { | 54 | static const struct regulator_bulk_data dsi_v1_3_1_regulators[] = { |
| 53 | { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */ | 55 | { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */ |
| 54 | { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */ | 56 | { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */ |
| 55 | }; | 57 | }; |
| 56 | 58 | ||
| 57 | static const struct msm_dsi_config msm8916_dsi_cfg = { | 59 | static const struct msm_dsi_config msm8916_dsi_cfg = { |
| 58 | .io_offset = DSI_6G_REG_SHIFT, | 60 | .io_offset = DSI_6G_REG_SHIFT, |
| 59 | .regulator_data = msm8916_dsi_regulators, | 61 | .regulator_data = dsi_v1_3_1_regulators, |
| 60 | .num_regulators = ARRAY_SIZE(msm8916_dsi_regulators), | 62 | .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators), |
| 61 | .bus_clk_names = dsi_8916_bus_clk_names, | 63 | .bus_clk_names = dsi_v1_3_1_clk_names, |
| 62 | .num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names), | 64 | .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names), |
| 63 | .io_start = { 0x1a98000 }, | 65 | .io_start = { |
| 64 | .num_dsi = 1, | 66 | { 0x1a98000 }, |
| 65 | }; | 67 | }, |
| 66 | |||
| 67 | static const char * const dsi_8976_bus_clk_names[] = { | ||
| 68 | "mdp_core", "iface", "bus", | ||
| 69 | }; | ||
| 70 | |||
| 71 | static const struct regulator_bulk_data msm8976_dsi_regulators[] = { | ||
| 72 | { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */ | ||
| 73 | { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */ | ||
| 74 | }; | 68 | }; |
| 75 | 69 | ||
| 76 | static const struct msm_dsi_config msm8976_dsi_cfg = { | 70 | static const struct msm_dsi_config msm8976_dsi_cfg = { |
| 77 | .io_offset = DSI_6G_REG_SHIFT, | 71 | .io_offset = DSI_6G_REG_SHIFT, |
| 78 | .regulator_data = msm8976_dsi_regulators, | 72 | .regulator_data = dsi_v1_3_1_regulators, |
| 79 | .num_regulators = ARRAY_SIZE(msm8976_dsi_regulators), | 73 | .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators), |
| 80 | .bus_clk_names = dsi_8976_bus_clk_names, | 74 | .bus_clk_names = dsi_v1_3_1_clk_names, |
| 81 | .num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names), | 75 | .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names), |
| 82 | .io_start = { 0x1a94000, 0x1a96000 }, | 76 | .io_start = { |
| 83 | .num_dsi = 2, | 77 | { 0x1a94000, 0x1a96000 }, |
| 78 | }, | ||
| 84 | }; | 79 | }; |
| 85 | 80 | ||
| 86 | static const struct regulator_bulk_data msm8994_dsi_regulators[] = { | 81 | static const struct regulator_bulk_data msm8994_dsi_regulators[] = { |
| @@ -98,12 +93,9 @@ static const struct msm_dsi_config msm8994_dsi_cfg = { · 11 unmodified lines | |||
| 98 | .num_regulators = ARRAY_SIZE(msm8994_dsi_regulators), | 93 | .num_regulators = ARRAY_SIZE(msm8994_dsi_regulators), |
| 99 | .bus_clk_names = dsi_6g_bus_clk_names, | 94 | .bus_clk_names = dsi_6g_bus_clk_names, |
| 100 | .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), | 95 | .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), |
| 101 | .io_start = { 0xfd998000, 0xfd9a0000 }, | 96 | .io_start = { |
| 102 | .num_dsi = 2, | 97 | { 0xfd998000, 0xfd9a0000 }, |
| 103 | }; | 98 | }, |
| 104 | |||
| 105 | static const char * const dsi_8996_bus_clk_names[] = { | ||
| 106 | "mdp_core", "iface", "bus", "core_mmss", | ||
| 107 | }; | 99 | }; |
| 108 | 100 | ||
| 109 | static const struct regulator_bulk_data msm8996_dsi_regulators[] = { | 101 | static const struct regulator_bulk_data msm8996_dsi_regulators[] = { |
| @@ -116,10 +108,11 @@ static const struct msm_dsi_config msm8996_dsi_cfg = { · 6 unmodified lines | |||
| 116 | .io_offset = DSI_6G_REG_SHIFT, | 108 | .io_offset = DSI_6G_REG_SHIFT, |
| 117 | .regulator_data = msm8996_dsi_regulators, | 109 | .regulator_data = msm8996_dsi_regulators, |
| 118 | .num_regulators = ARRAY_SIZE(msm8996_dsi_regulators), | 110 | .num_regulators = ARRAY_SIZE(msm8996_dsi_regulators), |
| 119 | .bus_clk_names = dsi_8996_bus_clk_names, | 111 | .bus_clk_names = dsi_6g_bus_clk_names, |
| 120 | .num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names), | 112 | .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), |
| 121 | .io_start = { 0x994000, 0x996000 }, | 113 | .io_start = { |
| 122 | .num_dsi = 2, | 114 | { 0x994000, 0x996000 }, |
| 115 | }, | ||
| 123 | }; | 116 | }; |
| 124 | 117 | ||
| 125 | static const char * const dsi_msm8998_bus_clk_names[] = { | 118 | static const char * const dsi_msm8998_bus_clk_names[] = { |
| @@ -137,8 +130,9 @@ static const struct msm_dsi_config msm8998_dsi_cfg = { · 11 unmodified lines | |||
| 137 | .num_regulators = ARRAY_SIZE(msm8998_dsi_regulators), | 130 | .num_regulators = ARRAY_SIZE(msm8998_dsi_regulators), |
| 138 | .bus_clk_names = dsi_msm8998_bus_clk_names, | 131 | .bus_clk_names = dsi_msm8998_bus_clk_names, |
| 139 | .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names), | 132 | .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names), |
| 140 | .io_start = { 0xc994000, 0xc996000 }, | 133 | .io_start = { |
| 141 | .num_dsi = 2, | 134 | { 0xc994000, 0xc996000 }, |
| 135 | }, | ||
| 142 | }; | 136 | }; |
| 143 | 137 | ||
| 144 | static const char * const dsi_sdm660_bus_clk_names[] = { | 138 | static const char * const dsi_sdm660_bus_clk_names[] = { |
| @@ -155,30 +149,29 @@ static const struct msm_dsi_config sdm660_dsi_cfg = { · 10 unmodified lines | |||
| 155 | .num_regulators = ARRAY_SIZE(sdm660_dsi_regulators), | 149 | .num_regulators = ARRAY_SIZE(sdm660_dsi_regulators), |
| 156 | .bus_clk_names = dsi_sdm660_bus_clk_names, | 150 | .bus_clk_names = dsi_sdm660_bus_clk_names, |
| 157 | .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names), | 151 | .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names), |
| 158 | .io_start = { 0xc994000, 0xc996000 }, | 152 | .io_start = { |
| 159 | .num_dsi = 2, | 153 | { 0xc994000, 0xc996000 }, |
| 154 | }, | ||
| 160 | }; | 155 | }; |
| 161 | 156 | ||
| 162 | static const char * const dsi_sdm845_bus_clk_names[] = { | 157 | static const char * const dsi_v2_4_clk_names[] = { |
| 163 | "iface", "bus", | 158 | "iface", "bus", |
| 164 | }; | 159 | }; |
| 165 | 160 | ||
| 166 | static const char * const dsi_sc7180_bus_clk_names[] = { | 161 | static const struct regulator_bulk_data dsi_v2_4_regulators[] = { |
| 167 | "iface", "bus", | ||
| 168 | }; | ||
| 169 | |||
| 170 | static const struct regulator_bulk_data sdm845_dsi_regulators[] = { | ||
| 171 | { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */ | 162 | { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */ |
| 172 | }; | 163 | }; |
| 173 | 164 | ||
| 174 | static const struct msm_dsi_config sdm845_dsi_cfg = { | 165 | static const struct msm_dsi_config sdm845_dsi_cfg = { |
| 175 | .io_offset = DSI_6G_REG_SHIFT, | 166 | .io_offset = DSI_6G_REG_SHIFT, |
| 176 | .regulator_data = sdm845_dsi_regulators, | 167 | .regulator_data = dsi_v2_4_regulators, |
| 177 | .num_regulators = ARRAY_SIZE(sdm845_dsi_regulators), | 168 | .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators), |
| 178 | .bus_clk_names = dsi_sdm845_bus_clk_names, | 169 | .bus_clk_names = dsi_v2_4_clk_names, |
| 179 | .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), | 170 | .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), |
| 180 | .io_start = { 0xae94000, 0xae96000 }, | 171 | .io_start = { |
| 181 | .num_dsi = 2, | 172 | { 0xae94000, 0xae96000 }, /* SDM845 / SDM670 */ |
| 173 | { 0x5e94000 }, /* QCM2290 / SM6115 / SM6125 / SM6375 */ | ||
| 174 | }, | ||
| 182 | }; | 175 | }; |
| 183 | 176 | ||
| 184 | static const struct regulator_bulk_data sm8550_dsi_regulators[] = { | 177 | static const struct regulator_bulk_data sm8550_dsi_regulators[] = { |
| @@ -189,28 +182,11 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { · 4 unmodified lines | |||
| 189 | .io_offset = DSI_6G_REG_SHIFT, | 182 | .io_offset = DSI_6G_REG_SHIFT, |
| 190 | .regulator_data = sm8550_dsi_regulators, | 183 | .regulator_data = sm8550_dsi_regulators, |
| 191 | .num_regulators = ARRAY_SIZE(sm8550_dsi_regulators), | 184 | .num_regulators = ARRAY_SIZE(sm8550_dsi_regulators), |
| 192 | .bus_clk_names = dsi_sdm845_bus_clk_names, | 185 | .bus_clk_names = dsi_v2_4_clk_names, |
| 193 | .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), | 186 | .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), |
| 194 | .io_start = { 0xae94000, 0xae96000 }, | 187 | .io_start = { |
| 195 | .num_dsi = 2, | 188 | { 0xae94000, 0xae96000 }, |
| 196 | }; | 189 | }, |
| 197 | |||
| 198 | static const struct regulator_bulk_data sc7180_dsi_regulators[] = { | ||
| 199 | { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */ | ||
| 200 | }; | ||
| 201 | |||
| 202 | static const struct msm_dsi_config sc7180_dsi_cfg = { | ||
| 203 | .io_offset = DSI_6G_REG_SHIFT, | ||
| 204 | .regulator_data = sc7180_dsi_regulators, | ||
| 205 | .num_regulators = ARRAY_SIZE(sc7180_dsi_regulators), | ||
| 206 | .bus_clk_names = dsi_sc7180_bus_clk_names, | ||
| 207 | .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names), | ||
| 208 | .io_start = { 0xae94000 }, | ||
| 209 | .num_dsi = 1, | ||
| 210 | }; | ||
| 211 | |||
| 212 | static const char * const dsi_sc7280_bus_clk_names[] = { | ||
| 213 | "iface", "bus", | ||
| 214 | }; | 190 | }; |
| 215 | 191 | ||
| 216 | static const struct regulator_bulk_data sc7280_dsi_regulators[] = { | 192 | static const struct regulator_bulk_data sc7280_dsi_regulators[] = { |
| @@ -221,28 +197,11 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { · 4 unmodified lines | |||
| 221 | .io_offset = DSI_6G_REG_SHIFT, | 197 | .io_offset = DSI_6G_REG_SHIFT, |
| 222 | .regulator_data = sc7280_dsi_regulators, | 198 | .regulator_data = sc7280_dsi_regulators, |
| 223 | .num_regulators = ARRAY_SIZE(sc7280_dsi_regulators), | 199 | .num_regulators = ARRAY_SIZE(sc7280_dsi_regulators), |
| 224 | .bus_clk_names = dsi_sc7280_bus_clk_names, | 200 | .bus_clk_names = dsi_v2_4_clk_names, |
| 225 | .num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names), | 201 | .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), |
| 226 | .io_start = { 0xae94000, 0xae96000 }, | 202 | .io_start = { |
| 227 | .num_dsi = 2, | 203 | { 0xae94000, 0xae96000 }, |
| 228 | }; | 204 | }, |
| 229 | |||
| 230 | static const char * const dsi_qcm2290_bus_clk_names[] = { | ||
| 231 | "iface", "bus", | ||
| 232 | }; | ||
| 233 | |||
| 234 | static const struct regulator_bulk_data qcm2290_dsi_cfg_regulators[] = { | ||
| 235 | { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */ | ||
| 236 | }; | ||
| 237 | |||
| 238 | static const struct msm_dsi_config qcm2290_dsi_cfg = { | ||
| 239 | .io_offset = DSI_6G_REG_SHIFT, | ||
| 240 | .regulator_data = qcm2290_dsi_cfg_regulators, | ||
| 241 | .num_regulators = ARRAY_SIZE(qcm2290_dsi_cfg_regulators), | ||
| 242 | .bus_clk_names = dsi_qcm2290_bus_clk_names, | ||
| 243 | .num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names), | ||
| 244 | .io_start = { 0x5e94000 }, | ||
| 245 | .num_dsi = 1, | ||
| 246 | }; | 205 | }; |
| 247 | 206 | ||
| 248 | static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = { | 207 | static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = { |
| @@ -311,7 +270,7 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = { · 62 unmodified lines | |||
| 311 | {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_0, | 270 | {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_0, |
| 312 | &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops}, | 271 | &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops}, |
| 313 | {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1, | 272 | {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1, |
| 314 | &sc7180_dsi_cfg, &msm_dsi_6g_v2_host_ops}, | 273 | &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops}, |
| 315 | {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_5_0, | 274 | {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_5_0, |
| 316 | &sc7280_dsi_cfg, &msm_dsi_6g_v2_host_ops}, | 275 | &sc7280_dsi_cfg, &msm_dsi_6g_v2_host_ops}, |
| 317 | {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_6_0, | 276 | {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_6_0, |
| @@ -335,9 +294,3 @@ const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor) · 17 unmodified lines | |||
| 335 | 294 | ||
| 336 | return cfg_hnd; | 295 | return cfg_hnd; |
| 337 | } | 296 | } |
| 338 | |||
| 339 | /* Non autodetect configs */ | ||
| 340 | const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler = { | ||
| 341 | .cfg = &qcm2290_dsi_cfg, | ||
| 342 | .ops = &msm_dsi_6g_v2_host_ops, | ||
| 343 | }; | ||
| @@ -32,14 +32,16 @@ · 31 unmodified lines | |||
| 32 | 32 | ||
| 33 | #define DSI_6G_REG_SHIFT 4 | 33 | #define DSI_6G_REG_SHIFT 4 |
| 34 | 34 | ||
| 35 | /* Maximum number of configurations matched against the same hw revision */ | ||
| 36 | #define VARIANTS_MAX 2 | ||
| 37 | |||
| 35 | struct msm_dsi_config { | 38 | struct msm_dsi_config { |
| 36 | u32 io_offset; | 39 | u32 io_offset; |
| 37 | const struct regulator_bulk_data *regulator_data; | 40 | const struct regulator_bulk_data *regulator_data; |
| 38 | int num_regulators; | 41 | int num_regulators; |
| 39 | const char * const *bus_clk_names; | 42 | const char * const *bus_clk_names; |
| 40 | const int num_bus_clks; | 43 | const int num_bus_clks; |
| 41 | const resource_size_t io_start[DSI_MAX]; | 44 | const resource_size_t io_start[VARIANTS_MAX][DSI_MAX]; |
| 42 | const int num_dsi; | ||
| 43 | }; | 45 | }; |
| 44 | 46 | ||
| 45 | struct msm_dsi_host_cfg_ops { | 47 | struct msm_dsi_host_cfg_ops { |
| @@ -63,8 +65,5 @@ struct msm_dsi_cfg_handler { · 17 unmodified lines | |||
| 63 | 65 | ||
| 64 | const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor); | 66 | const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor); |
| 65 | 67 | ||
| 66 | /* Non autodetect configs */ | ||
| 67 | extern const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler; | ||
| 68 | |||
| 69 | #endif /* __MSM_DSI_CFG_H__ */ | 68 | #endif /* __MSM_DSI_CFG_H__ */ |
| 70 | 69 | ||
| @@ -214,10 +214,6 @@ static const struct msm_dsi_cfg_handler *dsi_get_config( · 213 unmodified lines | |||
| 214 | int ret; | 214 | int ret; |
| 215 | u32 major = 0, minor = 0; | 215 | u32 major = 0, minor = 0; |
| 216 | 216 | ||
| 217 | cfg_hnd = device_get_match_data(dev); | ||
| 218 | if (cfg_hnd) | ||
| 219 | return cfg_hnd; | ||
| 220 | |||
| 221 | ahb_clk = msm_clk_get(msm_host->pdev, "iface"); | 217 | ahb_clk = msm_clk_get(msm_host->pdev, "iface"); |
| 222 | if (IS_ERR(ahb_clk)) { | 218 | if (IS_ERR(ahb_clk)) { |
| 223 | pr_err("%s: cannot get interface clock\n", __func__); | 219 | pr_err("%s: cannot get interface clock\n", __func__); |
| @@ -1862,16 +1858,16 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host) · 1638 unmodified lines | |||
| 1862 | struct platform_device *pdev = msm_host->pdev; | 1858 | struct platform_device *pdev = msm_host->pdev; |
| 1863 | const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg; | 1859 | const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg; |
| 1864 | struct resource *res; | 1860 | struct resource *res; |
| 1865 | int i; | 1861 | int i, j; |
| 1866 | 1862 | ||
| 1867 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dsi_ctrl"); | 1863 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dsi_ctrl"); |
| 1868 | if (!res) | 1864 | if (!res) |
| 1869 | return -EINVAL; | 1865 | return -EINVAL; |
| 1870 | 1866 | ||
| 1871 | for (i = 0; i < cfg->num_dsi; i++) { | 1867 | for (i = 0; i < VARIANTS_MAX; i++) |
| 1872 | if (cfg->io_start[i] == res->start) | 1868 | for (j = 0; j < DSI_MAX; j++) |
| 1873 | return i; | 1869 | if (cfg->io_start[i][j] == res->start) |
| 1874 | } | 1870 | return j; |
| 1875 | 1871 | ||
| 1876 | return -EINVAL; | 1872 | return -EINVAL; |
| 1877 | } | 1873 | } |
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -8,24 +8,24 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2022 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -776,10 +776,28 @@ static inline uint32_t HDMI_8x60_PHY_REG1_OUTVOL_SWING_CTRL(uint32_t val) · 742 unmodified lines | |||
| 776 | 776 | ||
| 777 | #define REG_HDMI_8x74_ANA_CFG1 0x00000004 | 777 | #define REG_HDMI_8x74_ANA_CFG1 0x00000004 |
| 778 | 778 | ||
| 779 | #define REG_HDMI_8x74_ANA_CFG2 0x00000008 | ||
| 780 | |||
| 781 | #define REG_HDMI_8x74_ANA_CFG3 0x0000000c | ||
| 782 | |||
| 779 | #define REG_HDMI_8x74_PD_CTRL0 0x00000010 | 783 | #define REG_HDMI_8x74_PD_CTRL0 0x00000010 |
| 780 | 784 | ||
| 781 | #define REG_HDMI_8x74_PD_CTRL1 0x00000014 | 785 | #define REG_HDMI_8x74_PD_CTRL1 0x00000014 |
| 782 | 786 | ||
| 787 | #define REG_HDMI_8x74_GLB_CFG 0x00000018 | ||
| 788 | |||
| 789 | #define REG_HDMI_8x74_DCC_CFG0 0x0000001c | ||
| 790 | |||
| 791 | #define REG_HDMI_8x74_DCC_CFG1 0x00000020 | ||
| 792 | |||
| 793 | #define REG_HDMI_8x74_TXCAL_CFG0 0x00000024 | ||
| 794 | |||
| 795 | #define REG_HDMI_8x74_TXCAL_CFG1 0x00000028 | ||
| 796 | |||
| 797 | #define REG_HDMI_8x74_TXCAL_CFG2 0x0000002c | ||
| 798 | |||
| 799 | #define REG_HDMI_8x74_TXCAL_CFG3 0x00000030 | ||
| 800 | |||
| 783 | #define REG_HDMI_8x74_BIST_CFG0 0x00000034 | 801 | #define REG_HDMI_8x74_BIST_CFG0 0x00000034 |
| 784 | 802 | ||
| 785 | #define REG_HDMI_8x74_BIST_PATN0 0x0000003c | 803 | #define REG_HDMI_8x74_BIST_PATN0 0x0000003c |
| @@ -790,6 +808,8 @@ static inline uint32_t HDMI_8x60_PHY_REG1_OUTVOL_SWING_CTRL(uint32_t val) · 4 unmodified lines | |||
| 790 | 808 | ||
| 791 | #define REG_HDMI_8x74_BIST_PATN3 0x00000048 | 809 | #define REG_HDMI_8x74_BIST_PATN3 0x00000048 |
| 792 | 810 | ||
| 811 | #define REG_HDMI_8x74_STATUS 0x0000005c | ||
| 812 | |||
| 793 | #define REG_HDMI_28nm_PHY_PLL_REFCLK_CFG 0x00000000 | 813 | #define REG_HDMI_28nm_PHY_PLL_REFCLK_CFG 0x00000000 |
| 794 | 814 | ||
| 795 | #define REG_HDMI_28nm_PHY_PLL_POSTDIV1_CFG 0x00000004 | 815 | #define REG_HDMI_28nm_PHY_PLL_POSTDIV1_CFG 0x00000004 |
| @@ -877,6 +897,8 @@ static inline uint32_t HDMI_8x60_PHY_REG1_OUTVOL_SWING_CTRL(uint32_t val) · 81 unmodified lines | |||
| 877 | 897 | ||
| 878 | #define REG_HDMI_28nm_PHY_PLL_DEBUG_BUS_SEL 0x000000a0 | 898 | #define REG_HDMI_28nm_PHY_PLL_DEBUG_BUS_SEL 0x000000a0 |
| 879 | 899 | ||
| 900 | #define REG_HDMI_28nm_PHY_PLL_STATUS 0x000000c0 | ||
| 901 | |||
| 880 | #define REG_HDMI_8996_PHY_CFG 0x00000000 | 902 | #define REG_HDMI_8996_PHY_CFG 0x00000000 |
| 881 | 903 | ||
| 882 | #define REG_HDMI_8996_PHY_PD_CTL 0x00000004 | 904 | #define REG_HDMI_8996_PHY_PD_CTL 0x00000004 |
| @@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines | |||
| 8 | git clone https://github.com/freedreno/envytools.git | 8 | git clone https://github.com/freedreno/envytools.git |
| 9 | 9 | ||
| 10 | The rules-ng-ng source files this header was generated from are: | 10 | The rules-ng-ng source files this header was generated from are: |
| 11 | - /home/robclark/tmp/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-03-03 01:18:13) | 11 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46) |
| 12 | - /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32) | 12 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46) |
| 13 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22) | 13 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42) |
| 14 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22) | 14 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2022-03-08 17:40:42) |
| 15 | - /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22) | 15 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42) |
| 16 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02) | 16 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36) |
| 17 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56) | 17 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2022-03-08 17:40:42) |
| 18 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56) | 18 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42) |
| 19 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56) | 19 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2022-03-08 17:40:42) |
| 20 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56) | 20 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42) |
| 21 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56) | 21 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2022-03-08 17:40:42) |
| 22 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56) | 22 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42) |
| 23 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13) | 23 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-08 17:40:42) |
| 24 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22) | 24 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42) |
| 25 | - /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22) | 25 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2022-03-08 17:40:42) |
| 26 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22) | 26 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42) |
| 27 | - /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22) | 27 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56) |
| 28 | - /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22) | 28 | - /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42) |
| 29 | 29 | ||
| 30 | Copyright (C) 2013-2021 by the following authors: | 30 | Copyright (C) 2013-2022 by the following authors: |
| 31 | - Rob Clark <robdclark@gmail.com> (robclark) | 31 | - Rob Clark <robdclark@gmail.com> (robclark) |
| 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) | 32 | - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin) |
| 33 | 33 | ||
| @@ -179,6 +179,24 @@ static unsigned get_crtc_mask(struct drm_atomic_state *state) · 178 unmodified lines | |||
| 179 | return mask; | 179 | return mask; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | int msm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) | ||
| 183 | { | ||
| 184 | struct drm_crtc_state *old_crtc_state, *new_crtc_state; | ||
| 185 | struct drm_crtc *crtc; | ||
| 186 | int i; | ||
| 187 | |||
| 188 | for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, | ||
| 189 | new_crtc_state, i) { | ||
| 190 | if ((old_crtc_state->ctm && !new_crtc_state->ctm) || | ||
| 191 | (!old_crtc_state->ctm && new_crtc_state->ctm)) { | ||
| 192 | new_crtc_state->mode_changed = true; | ||
| 193 | state->allow_modeset = true; | ||
| 194 | } | ||
| 195 | } | ||
| 196 | |||
| 197 | return drm_atomic_helper_check(dev, state); | ||
| 198 | } | ||
| 199 | |||
| 182 | void msm_atomic_commit_tail(struct drm_atomic_state *state) | 200 | void msm_atomic_commit_tail(struct drm_atomic_state *state) |
| 183 | { | 201 | { |
| 184 | struct drm_device *dev = state->dev; | 202 | struct drm_device *dev = state->dev; |
| @@ -186,8 +204,7 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) · 1 unmodified line | |||
| 186 | struct msm_kms *kms = priv->kms; | 204 | struct msm_kms *kms = priv->kms; |
| 187 | struct drm_crtc *async_crtc = NULL; | 205 | struct drm_crtc *async_crtc = NULL; |
| 188 | unsigned crtc_mask = get_crtc_mask(state); | 206 | unsigned crtc_mask = get_crtc_mask(state); |
| 189 | bool async = kms->funcs->vsync_time && | 207 | bool async = can_do_async(state, &async_crtc); |
| 190 | can_do_async(state, &async_crtc); | ||
| 191 | 208 | ||
| 192 | trace_msm_atomic_commit_tail_start(async, crtc_mask); | 209 | trace_msm_atomic_commit_tail_start(async, crtc_mask); |
| 193 | 210 | ||
| @@ -206,7 +223,8 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) · 12 unmodified lines | |||
| 206 | * Now that there is no in-progress flush, prepare the | 223 | * Now that there is no in-progress flush, prepare the |
| 207 | * current update: | 224 | * current update: |
| 208 | */ | 225 | */ |
| 209 | kms->funcs->prepare_commit(kms, state); | 226 | if (kms->funcs->prepare_commit) |
| 227 | kms->funcs->prepare_commit(kms, state); | ||
| 210 | 228 | ||
| 211 | /* | 229 | /* |
| 212 | * Push atomic updates down to hardware: | 230 | * Push atomic updates down to hardware: |
| @@ -231,7 +249,9 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) · 18 unmodified lines | |||
| 231 | 249 | ||
| 232 | kms->pending_crtc_mask |= crtc_mask; | 250 | kms->pending_crtc_mask |= crtc_mask; |
| 233 | 251 | ||
| 234 | vsync_time = kms->funcs->vsync_time(kms, async_crtc); | 252 | if (drm_crtc_next_vblank_start(async_crtc, &vsync_time)) |
| 253 | goto fallback; | ||
| 254 | |||
| 235 | wakeup_time = ktime_sub(vsync_time, ms_to_ktime(1)); | 255 | wakeup_time = ktime_sub(vsync_time, ms_to_ktime(1)); |
| 236 | 256 | ||
| 237 | msm_hrtimer_queue_work(&timer->work, wakeup_time, | 257 | msm_hrtimer_queue_work(&timer->work, wakeup_time, |
| @@ -253,6 +273,7 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) · 15 unmodified lines | |||
| 253 | return; | 273 | return; |
| 254 | } | 274 | } |
| 255 | 275 | ||
| 276 | fallback: | ||
| 256 | /* | 277 | /* |
| 257 | * If there is any async flush pending on updated crtcs, fold | 278 | * If there is any async flush pending on updated crtcs, fold |
| 258 | * them into the current flush. | 279 | * them into the current flush. |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | #include <linux/fault-inject.h> | 10 | #include <linux/fault-inject.h> |
| 11 | 11 | ||
| 12 | #include <drm/drm_debugfs.h> | 12 | #include <drm/drm_debugfs.h> |
| 13 | #include <drm/drm_fb_helper.h> | ||
| 13 | #include <drm/drm_file.h> | 14 | #include <drm/drm_file.h> |
| 14 | #include <drm/drm_framebuffer.h> | 15 | #include <drm/drm_framebuffer.h> |
| 15 | 16 | ||
| @@ -241,12 +242,11 @@ static int msm_fb_show(struct seq_file *m, void *arg) · 225 unmodified lines | |||
| 241 | { | 242 | { |
| 242 | struct drm_info_node *node = (struct drm_info_node *) m->private; | 243 | struct drm_info_node *node = (struct drm_info_node *) m->private; |
| 243 | struct drm_device *dev = node->minor->dev; | 244 | struct drm_device *dev = node->minor->dev; |
| 244 | struct msm_drm_private *priv = dev->dev_private; | ||
| 245 | struct drm_framebuffer *fb, *fbdev_fb = NULL; | 245 | struct drm_framebuffer *fb, *fbdev_fb = NULL; |
| 246 | 246 | ||
| 247 | if (priv->fbdev) { | 247 | if (dev->fb_helper && dev->fb_helper->fb) { |
| 248 | seq_printf(m, "fbcon "); | 248 | seq_printf(m, "fbcon "); |
| 249 | fbdev_fb = priv->fbdev->fb; | 249 | fbdev_fb = dev->fb_helper->fb; |
| 250 | msm_framebuffer_describe(fbdev_fb, m); | 250 | msm_framebuffer_describe(fbdev_fb, m); |
| 251 | } | 251 | } |
| 252 | 252 | ||
| @@ -8,10 +8,12 @@ · 7 unmodified lines | |||
| 8 | #include <linux/dma-mapping.h> | 8 | #include <linux/dma-mapping.h> |
| 9 | #include <linux/fault-inject.h> | 9 | #include <linux/fault-inject.h> |
| 10 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
| 11 | #include <linux/of_address.h> | ||
| 11 | #include <linux/sched/mm.h> | 12 | #include <linux/sched/mm.h> |
| 12 | #include <linux/uaccess.h> | 13 | #include <linux/uaccess.h> |
| 13 | #include <uapi/linux/sched/types.h> | 14 | #include <uapi/linux/sched/types.h> |
| 14 | 15 | ||
| 16 | #include <drm/drm_aperture.h> | ||
| 15 | #include <drm/drm_bridge.h> | 17 | #include <drm/drm_bridge.h> |
| 16 | #include <drm/drm_drv.h> | 18 | #include <drm/drm_drv.h> |
| 17 | #include <drm/drm_file.h> | 19 | #include <drm/drm_file.h> |
| @@ -46,15 +48,17 @@ · 28 unmodified lines | |||
| 46 | * - 1.8.0 - Add MSM_BO_CACHED_COHERENT for supported GPUs (a6xx) | 48 | * - 1.8.0 - Add MSM_BO_CACHED_COHERENT for supported GPUs (a6xx) |
| 47 | * - 1.9.0 - Add MSM_SUBMIT_FENCE_SN_IN | 49 | * - 1.9.0 - Add MSM_SUBMIT_FENCE_SN_IN |
| 48 | * - 1.10.0 - Add MSM_SUBMIT_BO_NO_IMPLICIT | 50 | * - 1.10.0 - Add MSM_SUBMIT_BO_NO_IMPLICIT |
| 51 | * - 1.11.0 - Add wait boost (MSM_WAIT_FENCE_BOOST, MSM_PREP_BOOST) | ||
| 49 | */ | 52 | */ |
| 50 | #define MSM_VERSION_MAJOR 1 | 53 | #define MSM_VERSION_MAJOR 1 |
| 51 | #define MSM_VERSION_MINOR 10 | 54 | #define MSM_VERSION_MINOR 10 |
| 52 | #define MSM_VERSION_PATCHLEVEL 0 | 55 | #define MSM_VERSION_PATCHLEVEL 0 |
| 53 | 56 | ||
| 57 | static void msm_deinit_vram(struct drm_device *ddev); | ||
| 58 | |||
| 54 | static const struct drm_mode_config_funcs mode_config_funcs = { | 59 | static const struct drm_mode_config_funcs mode_config_funcs = { |
| 55 | .fb_create = msm_framebuffer_create, | 60 | .fb_create = msm_framebuffer_create, |
| 56 | .output_poll_changed = drm_fb_helper_output_poll_changed, | 61 | .atomic_check = msm_atomic_check, |
| 57 | .atomic_check = drm_atomic_helper_check, | ||
| 58 | .atomic_commit = drm_atomic_helper_commit, | 62 | .atomic_commit = drm_atomic_helper_commit, |
| 59 | }; | 63 | }; |
| 60 | 64 | ||
| @@ -62,12 +66,6 @@ static const struct drm_mode_config_helper_funcs mode_config_helper_funcs = { · 1 unmodified line | |||
| 62 | .atomic_commit_tail = msm_atomic_commit_tail, | 66 | .atomic_commit_tail = msm_atomic_commit_tail, |
| 63 | }; | 67 | }; |
| 64 | 68 | ||
| 65 | #ifdef CONFIG_DRM_FBDEV_EMULATION | ||
| 66 | static bool fbdev = true; | ||
| 67 | MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer"); | ||
| 68 | module_param(fbdev, bool, 0600); | ||
| 69 | #endif | ||
| 70 | |||
| 71 | static char *vram = "16m"; | 69 | static char *vram = "16m"; |
| 72 | MODULE_PARM_DESC(vram, "Configure VRAM size (for devices without IOMMU/GPUMMU)"); | 70 | MODULE_PARM_DESC(vram, "Configure VRAM size (for devices without IOMMU/GPUMMU)"); |
| 73 | module_param(vram, charp, 0); | 71 | module_param(vram, charp, 0); |
| @@ -150,9 +148,6 @@ static void msm_irq_uninstall(struct drm_device *dev) · 76 unmodified lines | |||
| 150 | struct msm_drm_private *priv = dev->dev_private; | 148 | struct msm_drm_private *priv = dev->dev_private; |
| 151 | struct msm_kms *kms = priv->kms; | 149 | struct msm_kms *kms = priv->kms; |
| 152 | 150 | ||
| 153 | if (!priv->kms) | ||
| 154 | return; | ||
| 155 | |||
| 156 | kms->funcs->irq_uninstall(kms); | 151 | kms->funcs->irq_uninstall(kms); |
| 157 | if (kms->irq_requested) | 152 | if (kms->irq_requested) |
| 158 | free_irq(kms->irq, dev); | 153 | free_irq(kms->irq, dev); |
| @@ -240,12 +235,8 @@ static int msm_drm_uninit(struct device *dev) · 81 unmodified lines | |||
| 240 | msm_perf_debugfs_cleanup(priv); | 235 | msm_perf_debugfs_cleanup(priv); |
| 241 | msm_rd_debugfs_cleanup(priv); | 236 | msm_rd_debugfs_cleanup(priv); |
| 242 | 237 | ||
| 243 | #ifdef CONFIG_DRM_FBDEV_EMULATION | 238 | if (kms) |
| 244 | if (fbdev && priv->fbdev) | 239 | msm_disp_snapshot_destroy(ddev); |
| 245 | msm_fbdev_free(ddev); | ||
| 246 | #endif | ||
| 247 | |||
| 248 | msm_disp_snapshot_destroy(ddev); | ||
| 249 | 240 | ||
| 250 | drm_mode_config_cleanup(ddev); | 241 | drm_mode_config_cleanup(ddev); |
| 251 | 242 | ||
| @@ -253,30 +244,27 @@ static int msm_drm_uninit(struct device *dev) · 1 unmodified line | |||
| 253 | drm_bridge_remove(priv->bridges[i]); | 244 | drm_bridge_remove(priv->bridges[i]); |
| 254 | priv->num_bridges = 0; | 245 | priv->num_bridges = 0; |
| 255 | 246 | ||
| 256 | pm_runtime_get_sync(dev); | 247 | if (kms) { |
| 257 | msm_irq_uninstall(ddev); | 248 | pm_runtime_get_sync(dev); |
| 258 | pm_runtime_put_sync(dev); | 249 | msm_irq_uninstall(ddev); |
| 250 | pm_runtime_put_sync(dev); | ||
| 251 | } | ||
| 259 | 252 | ||
| 260 | if (kms && kms->funcs) | 253 | if (kms && kms->funcs) |
| 261 | kms->funcs->destroy(kms); | 254 | kms->funcs->destroy(kms); |
| 262 | 255 | ||
| 263 | if (priv->vram.paddr) { | 256 | msm_deinit_vram(ddev); |
| 264 | unsigned long attrs = DMA_ATTR_NO_KERNEL_MAPPING; | ||
| 265 | drm_mm_takedown(&priv->vram.mm); | ||
| 266 | dma_free_attrs(dev, priv->vram.size, NULL, | ||
| 267 | priv->vram.paddr, attrs); | ||
| 268 | } | ||
| 269 | 257 | ||
| 270 | component_unbind_all(dev, ddev); | 258 | component_unbind_all(dev, ddev); |
| 271 | 259 | ||
| 272 | ddev->dev_private = NULL; | 260 | ddev->dev_private = NULL; |
| 261 | drm_dev_put(ddev); | ||
| 262 | |||
| 273 | destroy_workqueue(priv->wq); | 263 | destroy_workqueue(priv->wq); |
| 274 | 264 | ||
| 275 | return 0; | 265 | return 0; |
| 276 | } | 266 | } |
| 277 | 267 | ||
| 278 | #include <linux/of_address.h> | ||
| 279 | |||
| 280 | struct msm_gem_address_space *msm_kms_init_aspace(struct drm_device *dev) | 268 | struct msm_gem_address_space *msm_kms_init_aspace(struct drm_device *dev) |
| 281 | { | 269 | { |
| 282 | struct msm_gem_address_space *aspace; | 270 | struct msm_gem_address_space *aspace; |
| @@ -401,6 +389,19 @@ static int msm_init_vram(struct drm_device *dev) · 118 unmodified lines | |||
| 401 | return ret; | 389 | return ret; |
| 402 | } | 390 | } |
| 403 | 391 | ||
| 392 | static void msm_deinit_vram(struct drm_device *ddev) | ||
| 393 | { | ||
| 394 | struct msm_drm_private *priv = ddev->dev_private; | ||
| 395 | unsigned long attrs = DMA_ATTR_NO_KERNEL_MAPPING; | ||
| 396 | |||
| 397 | if (!priv->vram.paddr) | ||
| 398 | return; | ||
| 399 | |||
| 400 | drm_mm_takedown(&priv->vram.mm); | ||
| 401 | dma_free_attrs(ddev->dev, priv->vram.size, NULL, priv->vram.paddr, | ||
| 402 | attrs); | ||
| 403 | } | ||
| 404 | |||
| 404 | static int msm_drm_init(struct device *dev, const struct drm_driver *drv) | 405 | static int msm_drm_init(struct device *dev, const struct drm_driver *drv) |
| 405 | { | 406 | { |
| 406 | struct msm_drm_private *priv = dev_get_drvdata(dev); | 407 | struct msm_drm_private *priv = dev_get_drvdata(dev); |
| @@ -420,8 +421,10 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) · 13 unmodified lines | |||
| 420 | priv->dev = ddev; | 421 | priv->dev = ddev; |
| 421 | 422 | ||
| 422 | priv->wq = alloc_ordered_workqueue("msm", 0); | 423 | priv->wq = alloc_ordered_workqueue("msm", 0); |
| 423 | if (!priv->wq) | 424 | if (!priv->wq) { |
| 424 | return -ENOMEM; | 425 | ret = -ENOMEM; |
| 426 | goto err_put_dev; | ||
| 427 | } | ||
| 425 | 428 | ||
| 426 | INIT_LIST_HEAD(&priv->objects); | 429 | INIT_LIST_HEAD(&priv->objects); |
| 427 | mutex_init(&priv->obj_lock); | 430 | mutex_init(&priv->obj_lock); |
| @@ -444,12 +447,17 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) · 16 unmodified lines | |||
| 444 | 447 | ||
| 445 | ret = msm_init_vram(ddev); | 448 | ret = msm_init_vram(ddev); |
| 446 | if (ret) | 449 | if (ret) |
| 447 | goto err_drm_dev_put; | 450 | goto err_cleanup_mode_config; |
| 448 | 451 | ||
| 449 | /* Bind all our sub-components: */ | 452 | /* Bind all our sub-components: */ |
| 450 | ret = component_bind_all(dev, ddev); | 453 | ret = component_bind_all(dev, ddev); |
| 451 | if (ret) | 454 | if (ret) |
| 452 | goto err_drm_dev_put; | 455 | goto err_deinit_vram; |
| 456 | |||
| 457 | /* the fw fb could be anywhere in memory */ | ||
| 458 | ret = drm_aperture_remove_framebuffers(false, drv); | ||
| 459 | if (ret) | ||
| 460 | goto err_msm_uninit; | ||
| 453 | 461 | ||
| 454 | dma_set_max_seg_size(dev, UINT_MAX); | 462 | dma_set_max_seg_size(dev, UINT_MAX); |
| 455 | 463 | ||
| @@ -529,23 +537,30 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) · 73 unmodified lines | |||
| 529 | } | 537 | } |
| 530 | drm_mode_config_reset(ddev); | 538 | drm_mode_config_reset(ddev); |
| 531 | 539 | ||
| 532 | #ifdef CONFIG_DRM_FBDEV_EMULATION | ||
| 533 | if (kms && fbdev) | ||
| 534 | priv->fbdev = msm_fbdev_init(ddev); | ||
| 535 | #endif | ||
| 536 | |||
| 537 | ret = msm_debugfs_late_init(ddev); | 540 | ret = msm_debugfs_late_init(ddev); |
| 538 | if (ret) | 541 | if (ret) |
| 539 | goto err_msm_uninit; | 542 | goto err_msm_uninit; |
| 540 | 543 | ||
| 541 | drm_kms_helper_poll_init(ddev); | 544 | drm_kms_helper_poll_init(ddev); |
| 542 | 545 | ||
| 546 | if (kms) | ||
| 547 | msm_fbdev_setup(ddev); | ||
| 548 | |||
| 543 | return 0; | 549 | return 0; |
| 544 | 550 | ||
| 545 | err_msm_uninit: | 551 | err_msm_uninit: |
| 546 | msm_drm_uninit(dev); | 552 | msm_drm_uninit(dev); |
| 547 | err_drm_dev_put: | 553 | |
| 554 | return ret; | ||
| 555 | |||
| 556 | err_deinit_vram: | ||
| 557 | msm_deinit_vram(ddev); | ||
| 558 | err_cleanup_mode_config: | ||
| 559 | drm_mode_config_cleanup(ddev); | ||
| 560 | destroy_workqueue(priv->wq); | ||
| 561 | err_put_dev: | ||
| 548 | drm_dev_put(ddev); | 562 | drm_dev_put(ddev); |
| 563 | |||
| 549 | return ret; | 564 | return ret; |
| 550 | } | 565 | } |
| 551 | 566 | ||
| @@ -899,7 +914,7 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data, · 347 unmodified lines | |||
| 899 | } | 914 | } |
| 900 | 915 | ||
| 901 | static int wait_fence(struct msm_gpu_submitqueue *queue, uint32_t fence_id, | 916 | static int wait_fence(struct msm_gpu_submitqueue *queue, uint32_t fence_id, |
| 902 | ktime_t timeout) | 917 | ktime_t timeout, uint32_t flags) |
| 903 | { | 918 | { |
| 904 | struct dma_fence *fence; | 919 | struct dma_fence *fence; |
| 905 | int ret; | 920 | int ret; |
| @@ -918,17 +933,18 @@ static int wait_fence(struct msm_gpu_submitqueue *queue, uint32_t fence_id, · 12 unmodified lines | |||
| 918 | * retired, so if the fence is not found it means there is nothing | 933 | * retired, so if the fence is not found it means there is nothing |
| 919 | * to wait for | 934 | * to wait for |
| 920 | */ | 935 | */ |
| 921 | ret = mutex_lock_interruptible(&queue->idr_lock); | 936 | spin_lock(&queue->idr_lock); |
| 922 | if (ret) | ||
| 923 | return ret; | ||
| 924 | fence = idr_find(&queue->fence_idr, fence_id); | 937 | fence = idr_find(&queue->fence_idr, fence_id); |
| 925 | if (fence) | 938 | if (fence) |
| 926 | fence = dma_fence_get_rcu(fence); | 939 | fence = dma_fence_get_rcu(fence); |
| 927 | mutex_unlock(&queue->idr_lock); | 940 | spin_unlock(&queue->idr_lock); |
| 928 | 941 | ||
| 929 | if (!fence) | 942 | if (!fence) |
| 930 | return 0; | 943 | return 0; |
| 931 | 944 | ||
| 945 | if (flags & MSM_WAIT_FENCE_BOOST) | ||
| 946 | dma_fence_set_deadline(fence, ktime_get()); | ||
| 947 | |||
| 932 | ret = dma_fence_wait_timeout(fence, true, timeout_to_jiffies(&timeout)); | 948 | ret = dma_fence_wait_timeout(fence, true, timeout_to_jiffies(&timeout)); |
| 933 | if (ret == 0) { | 949 | if (ret == 0) { |
| 934 | ret = -ETIMEDOUT; | 950 | ret = -ETIMEDOUT; |
| @@ -949,8 +965,8 @@ static int msm_ioctl_wait_fence(struct drm_device *dev, void *data, · 14 unmodified lines | |||
| 949 | struct msm_gpu_submitqueue *queue; | 965 | struct msm_gpu_submitqueue *queue; |
| 950 | int ret; | 966 | int ret; |
| 951 | 967 | ||
| 952 | if (args->pad) { | 968 | if (args->flags & ~MSM_WAIT_FENCE_FLAGS) { |
| 953 | DRM_ERROR("invalid pad: %08x\n", args->pad); | 969 | DRM_ERROR("invalid flags: %08x\n", args->flags); |
| 954 | return -EINVAL; | 970 | return -EINVAL; |
| 955 | } | 971 | } |
| 956 | 972 | ||
| @@ -961,7 +977,7 @@ static int msm_ioctl_wait_fence(struct drm_device *dev, void *data, · 4 unmodified lines | |||
| 961 | if (!queue) | 977 | if (!queue) |
| 962 | return -ENOENT; | 978 | return -ENOENT; |
| 963 | 979 | ||
| 964 | ret = wait_fence(queue, args->fence, to_ktime(args->timeout)); | 980 | ret = wait_fence(queue, args->fence, to_ktime(args->timeout), args->flags); |
| 965 | 981 | ||
| 966 | msm_submitqueue_put(queue); | 982 | msm_submitqueue_put(queue); |
| 967 | 983 | ||
| @@ -1068,7 +1084,6 @@ static const struct drm_driver msm_driver = { · 100 unmodified lines | |||
| 1068 | DRIVER_SYNCOBJ, | 1084 | DRIVER_SYNCOBJ, |
| 1069 | .open = msm_open, | 1085 | .open = msm_open, |
| 1070 | .postclose = msm_postclose, | 1086 | .postclose = msm_postclose, |
| 1071 | .lastclose = drm_fb_helper_lastclose, | ||
| 1072 | .dumb_create = msm_gem_dumb_create, | 1087 | .dumb_create = msm_gem_dumb_create, |
| 1073 | .dumb_map_offset = msm_gem_dumb_map_offset, | 1088 | .dumb_map_offset = msm_gem_dumb_map_offset, |
| 1074 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, | 1089 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, |
| @@ -29,7 +29,6 @@ · 28 unmodified lines | |||
| 29 | #include <drm/drm_atomic.h> | 29 | #include <drm/drm_atomic.h> |
| 30 | #include <drm/drm_atomic_helper.h> | 30 | #include <drm/drm_atomic_helper.h> |
| 31 | #include <drm/drm_probe_helper.h> | 31 | #include <drm/drm_probe_helper.h> |
| 32 | #include <drm/drm_fb_helper.h> | ||
| 33 | #include <drm/display/drm_dsc.h> | 32 | #include <drm/display/drm_dsc.h> |
| 34 | #include <drm/msm_drm.h> | 33 | #include <drm/msm_drm.h> |
| 35 | #include <drm/drm_gem.h> | 34 | #include <drm/drm_gem.h> |
| @@ -129,8 +128,6 @@ struct msm_drm_private { · 93 unmodified lines | |||
| 129 | bool is_a2xx; | 128 | bool is_a2xx; |
| 130 | bool has_cached_coherent; | 129 | bool has_cached_coherent; |
| 131 | 130 | ||
| 132 | struct drm_fb_helper *fbdev; | ||
| 133 | |||
| 134 | struct msm_rd_state *rd; /* debugfs to dump all submits */ | 131 | struct msm_rd_state *rd; /* debugfs to dump all submits */ |
| 135 | struct msm_rd_state *hangrd; /* debugfs to dump hanging submits */ | 132 | struct msm_rd_state *hangrd; /* debugfs to dump hanging submits */ |
| 136 | struct msm_perf_state *perf; | 133 | struct msm_perf_state *perf; |
| @@ -261,6 +258,7 @@ int msm_atomic_init_pending_timer(struct msm_pending_timer *timer, · 124 unmodified lines | |||
| 261 | struct msm_kms *kms, int crtc_idx); | 258 | struct msm_kms *kms, int crtc_idx); |
| 262 | void msm_atomic_destroy_pending_timer(struct msm_pending_timer *timer); | 259 | void msm_atomic_destroy_pending_timer(struct msm_pending_timer *timer); |
| 263 | void msm_atomic_commit_tail(struct drm_atomic_state *state); | 260 | void msm_atomic_commit_tail(struct drm_atomic_state *state); |
| 261 | int msm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state); | ||
| 264 | struct drm_atomic_state *msm_atomic_state_alloc(struct drm_device *dev); | 262 | struct drm_atomic_state *msm_atomic_state_alloc(struct drm_device *dev); |
| 265 | void msm_atomic_state_clear(struct drm_atomic_state *state); | 263 | void msm_atomic_state_clear(struct drm_atomic_state *state); |
| 266 | void msm_atomic_state_free(struct drm_atomic_state *state); | 264 | void msm_atomic_state_free(struct drm_atomic_state *state); |
| @@ -306,8 +304,13 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev, · 39 unmodified lines | |||
| 306 | struct drm_framebuffer * msm_alloc_stolen_fb(struct drm_device *dev, | 304 | struct drm_framebuffer * msm_alloc_stolen_fb(struct drm_device *dev, |
| 307 | int w, int h, int p, uint32_t format); | 305 | int w, int h, int p, uint32_t format); |
| 308 | 306 | ||
| 309 | struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev); | 307 | #ifdef CONFIG_DRM_FBDEV_EMULATION |
| 310 | void msm_fbdev_free(struct drm_device *dev); | 308 | void msm_fbdev_setup(struct drm_device *dev); |
| 309 | #else | ||
| 310 | static inline void msm_fbdev_setup(struct drm_device *dev) | ||
| 311 | { | ||
| 312 | } | ||
| 313 | #endif | ||
| 311 | 314 | ||
| 312 | struct hdmi; | 315 | struct hdmi; |
| 313 | #ifdef CONFIG_DRM_MSM_HDMI | 316 | #ifdef CONFIG_DRM_MSM_HDMI |
| @@ -548,7 +551,7 @@ static inline unsigned long timeout_to_jiffies(const ktime_t *timeout) · 234 unmodified lines | |||
| 548 | remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ); | 551 | remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ); |
| 549 | } | 552 | } |
| 550 | 553 | ||
| 551 | return clamp(remaining_jiffies, 0LL, (s64)INT_MAX); | 554 | return clamp(remaining_jiffies, 1LL, (s64)INT_MAX); |
| 552 | } | 555 | } |
| 553 | 556 | ||
| 554 | /* Driver helpers */ | 557 | /* Driver helpers */ |
| @@ -4,8 +4,8 @@ · 3 unmodified lines | |||
| 4 | * Author: Rob Clark <robdclark@gmail.com> | 4 | * Author: Rob Clark <robdclark@gmail.com> |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <drm/drm_aperture.h> | 7 | #include <drm/drm_drv.h> |
| 8 | #include <drm/drm_crtc.h> | 8 | #include <drm/drm_crtc_helper.h> |
| 9 | #include <drm/drm_fb_helper.h> | 9 | #include <drm/drm_fb_helper.h> |
| 10 | #include <drm/drm_fourcc.h> | 10 | #include <drm/drm_fourcc.h> |
| 11 | #include <drm/drm_framebuffer.h> | 11 | #include <drm/drm_framebuffer.h> |
| @@ -15,18 +15,40 @@ · 3 unmodified lines | |||
| 15 | #include "msm_gem.h" | 15 | #include "msm_gem.h" |
| 16 | #include "msm_kms.h" | 16 | #include "msm_kms.h" |
| 17 | 17 | ||
| 18 | static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma); | 18 | static bool fbdev = true; |
| 19 | MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer"); | ||
| 20 | module_param(fbdev, bool, 0600); | ||
| 19 | 21 | ||
| 20 | /* | 22 | /* |
| 21 | * fbdev funcs, to implement legacy fbdev interface on top of drm driver | 23 | * fbdev funcs, to implement legacy fbdev interface on top of drm driver |
| 22 | */ | 24 | */ |
| 23 | 25 | ||
| 24 | #define to_msm_fbdev(x) container_of(x, struct msm_fbdev, base) | 26 | static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma) |
| 27 | { | ||
| 28 | struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par; | ||
| 29 | struct drm_gem_object *bo = msm_framebuffer_bo(helper->fb, 0); | ||
| 25 | 30 | ||
| 26 | struct msm_fbdev { | 31 | return drm_gem_prime_mmap(bo, vma); |
| 27 | struct drm_fb_helper base; | 32 | } |
| 28 | struct drm_framebuffer *fb; | 33 | |
| 29 | }; | 34 | static void msm_fbdev_fb_destroy(struct fb_info *info) |
| 35 | { | ||
| 36 | struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par; | ||
| 37 | struct drm_framebuffer *fb = helper->fb; | ||
| 38 | struct drm_gem_object *bo = msm_framebuffer_bo(fb, 0); | ||
| 39 | |||
| 40 | DBG(); | ||
| 41 | |||
| 42 | drm_fb_helper_fini(helper); | ||
| 43 | |||
| 44 | /* this will free the backing object */ | ||
| 45 | msm_gem_put_vaddr(bo); | ||
| 46 | drm_framebuffer_remove(fb); | ||
| 47 | |||
| 48 | drm_client_release(&helper->client); | ||
| 49 | drm_fb_helper_unprepare(helper); | ||
| 50 | kfree(helper); | ||
| 51 | } | ||
| 30 | 52 | ||
| 31 | static const struct fb_ops msm_fb_ops = { | 53 | static const struct fb_ops msm_fb_ops = { |
| 32 | .owner = THIS_MODULE, | 54 | .owner = THIS_MODULE, |
| @@ -41,21 +63,12 @@ static const struct fb_ops msm_fb_ops = { · 8 unmodified lines | |||
| 41 | .fb_copyarea = drm_fb_helper_sys_copyarea, | 63 | .fb_copyarea = drm_fb_helper_sys_copyarea, |
| 42 | .fb_imageblit = drm_fb_helper_sys_imageblit, | 64 | .fb_imageblit = drm_fb_helper_sys_imageblit, |
| 43 | .fb_mmap = msm_fbdev_mmap, | 65 | .fb_mmap = msm_fbdev_mmap, |
| 66 | .fb_destroy = msm_fbdev_fb_destroy, | ||
| 44 | }; | 67 | }; |
| 45 | 68 | ||
| 46 | static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma) | ||
| 47 | { | ||
| 48 | struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par; | ||
| 49 | struct msm_fbdev *fbdev = to_msm_fbdev(helper); | ||
| 50 | struct drm_gem_object *bo = msm_framebuffer_bo(fbdev->fb, 0); | ||
| 51 | |||
| 52 | return drm_gem_prime_mmap(bo, vma); | ||
| 53 | } | ||
| 54 | |||
| 55 | static int msm_fbdev_create(struct drm_fb_helper *helper, | 69 | static int msm_fbdev_create(struct drm_fb_helper *helper, |
| 56 | struct drm_fb_helper_surface_size *sizes) | 70 | struct drm_fb_helper_surface_size *sizes) |
| 57 | { | 71 | { |
| 58 | struct msm_fbdev *fbdev = to_msm_fbdev(helper); | ||
| 59 | struct drm_device *dev = helper->dev; | 72 | struct drm_device *dev = helper->dev; |
| 60 | struct msm_drm_private *priv = dev->dev_private; | 73 | struct msm_drm_private *priv = dev->dev_private; |
| 61 | struct drm_framebuffer *fb = NULL; | 74 | struct drm_framebuffer *fb = NULL; |
| @@ -102,7 +115,6 @@ static int msm_fbdev_create(struct drm_fb_helper *helper, · 40 unmodified lines | |||
| 102 | 115 | ||
| 103 | DBG("fbi=%p, dev=%p", fbi, dev); | 116 | DBG("fbi=%p, dev=%p", fbi, dev); |
| 104 | 117 | ||
| 105 | fbdev->fb = fb; | ||
| 106 | helper->fb = fb; | 118 | helper->fb = fb; |
| 107 | 119 | ||
| 108 | fbi->fbops = &msm_fb_ops; | 120 | fbi->fbops = &msm_fb_ops; |
| @@ -119,7 +131,7 @@ static int msm_fbdev_create(struct drm_fb_helper *helper, · 10 unmodified lines | |||
| 119 | fbi->fix.smem_len = bo->size; | 131 | fbi->fix.smem_len = bo->size; |
| 120 | 132 | ||
| 121 | DBG("par=%p, %dx%d", fbi->par, fbi->var.xres, fbi->var.yres); | 133 | DBG("par=%p, %dx%d", fbi->par, fbi->var.xres, fbi->var.yres); |
| 122 | DBG("allocated %dx%d fb", fbdev->fb->width, fbdev->fb->height); | 134 | DBG("allocated %dx%d fb", fb->width, fb->height); |
| 123 | 135 | ||
| 124 | return 0; | 136 | return 0; |
| 125 | 137 | ||
| @@ -132,73 +144,98 @@ static const struct drm_fb_helper_funcs msm_fb_helper_funcs = { · 6 unmodified lines | |||
| 132 | .fb_probe = msm_fbdev_create, | 144 | .fb_probe = msm_fbdev_create, |
| 133 | }; | 145 | }; |
| 134 | 146 | ||
| 135 | /* initialize fbdev helper */ | 147 | /* |
| 136 | struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev) | 148 | * struct drm_client |
| 149 | */ | ||
| 150 | |||
| 151 | static void msm_fbdev_client_unregister(struct drm_client_dev *client) | ||
| 137 | { | 152 | { |
| 138 | struct msm_drm_private *priv = dev->dev_private; | 153 | struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); |
| 139 | struct msm_fbdev *fbdev; | 154 | |
| 140 | struct drm_fb_helper *helper; | 155 | if (fb_helper->info) { |
| 141 | int ret; | 156 | drm_fb_helper_unregister_info(fb_helper); |
| 157 | } else { | ||
| 158 | drm_client_release(&fb_helper->client); | ||
| 159 | drm_fb_helper_unprepare(fb_helper); | ||
| 160 | kfree(fb_helper); | ||
| 161 | } | ||
| 162 | } | ||
| 142 | 163 | ||
| 143 | fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); | 164 | static int msm_fbdev_client_restore(struct drm_client_dev *client) |
| 144 | if (!fbdev) | 165 | { |
| 145 | return NULL; | 166 | drm_fb_helper_lastclose(client->dev); |
| 146 | 167 | ||
| 147 | helper = &fbdev->base; | 168 | return 0; |
| 169 | } | ||
| 148 | 170 | ||
| 149 | drm_fb_helper_prepare(dev, helper, 32, &msm_fb_helper_funcs); | 171 | static int msm_fbdev_client_hotplug(struct drm_client_dev *client) |
| 172 | { | ||
| 173 | struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); | ||
| 174 | struct drm_device *dev = client->dev; | ||
| 175 | int ret; | ||
| 150 | 176 | ||
| 151 | ret = drm_fb_helper_init(dev, helper); | 177 | if (dev->fb_helper) |
| 152 | if (ret) { | 178 | return drm_fb_helper_hotplug_event(dev->fb_helper); |
| 153 | DRM_DEV_ERROR(dev->dev, "could not init fbdev: ret=%d\n", ret); | ||
| 154 | goto fail; | ||
| 155 | } | ||
| 156 | 179 | ||
| 157 | /* the fw fb could be anywhere in memory */ | 180 | ret = drm_fb_helper_init(dev, fb_helper); |
| 158 | ret = drm_aperture_remove_framebuffers(false, dev->driver); | ||
| 159 | if (ret) | 181 | if (ret) |
| 160 | goto fini; | 182 | goto err_drm_err; |
| 161 | 183 | ||
| 162 | ret = drm_fb_helper_initial_config(helper); | 184 | if (!drm_drv_uses_atomic_modeset(dev)) |
| 163 | if (ret) | 185 | drm_helper_disable_unused_functions(dev); |
| 164 | goto fini; | ||
| 165 | 186 | ||
| 166 | priv->fbdev = helper; | 187 | ret = drm_fb_helper_initial_config(fb_helper); |
| 188 | if (ret) | ||
| 189 | goto err_drm_fb_helper_fini; | ||
| 167 | 190 | ||
| 168 | return helper; | 191 | return 0; |
| 169 | 192 | ||
| 170 | fini: | 193 | err_drm_fb_helper_fini: |
| 171 | drm_fb_helper_fini(helper); | 194 | drm_fb_helper_fini(fb_helper); |
| 172 | fail: | 195 | err_drm_err: |
| 173 | drm_fb_helper_unprepare(helper); | 196 | drm_err(dev, "Failed to setup fbdev emulation (ret=%d)\n", ret); |
| 174 | kfree(fbdev); | 197 | return ret; |
| 175 | return NULL; | ||
| 176 | } | 198 | } |
| 177 | 199 | ||
| 178 | void msm_fbdev_free(struct drm_device *dev) | 200 | static const struct drm_client_funcs msm_fbdev_client_funcs = { |
| 179 | { | 201 | .owner = THIS_MODULE, |
| 180 | struct msm_drm_private *priv = dev->dev_private; | 202 | .unregister = msm_fbdev_client_unregister, |
| 181 | struct drm_fb_helper *helper = priv->fbdev; | 203 | .restore = msm_fbdev_client_restore, |
| 182 | struct msm_fbdev *fbdev; | 204 | .hotplug = msm_fbdev_client_hotplug, |
| 205 | }; | ||
| 183 | 206 | ||
| 184 | DBG(); | 207 | /* initialize fbdev helper */ |
| 208 | void msm_fbdev_setup(struct drm_device *dev) | ||
| 209 | { | ||
| 210 | struct drm_fb_helper *helper; | ||
| 211 | int ret; | ||
| 185 | 212 | ||
| 186 | drm_fb_helper_unregister_info(helper); | 213 | if (!fbdev) |
| 214 | return; | ||
| 187 | 215 | ||
| 188 | drm_fb_helper_fini(helper); | 216 | drm_WARN(dev, !dev->registered, "Device has not been registered.\n"); |
| 217 | drm_WARN(dev, dev->fb_helper, "fb_helper is already set!\n"); | ||
| 189 | 218 | ||
| 190 | fbdev = to_msm_fbdev(priv->fbdev); | 219 | helper = kzalloc(sizeof(*helper), GFP_KERNEL); |
| 220 | if (!helper) | ||
| 221 | return; | ||
| 222 | drm_fb_helper_prepare(dev, helper, 32, &msm_fb_helper_funcs); | ||
| 191 | 223 | ||
| 192 | /* this will free the backing object */ | 224 | ret = drm_client_init(dev, &helper->client, "fbdev", &msm_fbdev_client_funcs); |
| 193 | if (fbdev->fb) { | 225 | if (ret) { |
| 194 | struct drm_gem_object *bo = | 226 | drm_err(dev, "Failed to register client: %d\n", ret); |
| 195 | msm_framebuffer_bo(fbdev->fb, 0); | 227 | goto err_drm_fb_helper_unprepare; |
| 196 | msm_gem_put_vaddr(bo); | ||
| 197 | drm_framebuffer_remove(fbdev->fb); | ||
| 198 | } | 228 | } |
| 199 | 229 | ||
| 200 | drm_fb_helper_unprepare(helper); | 230 | ret = msm_fbdev_client_hotplug(&helper->client); |
| 201 | kfree(fbdev); | 231 | if (ret) |
| 232 | drm_dbg_kms(dev, "client hotplug ret=%d\n", ret); | ||
| 233 | |||
| 234 | drm_client_register(&helper->client); | ||
| 202 | 235 | ||
| 203 | priv->fbdev = NULL; | 236 | return; |
| 237 | |||
| 238 | err_drm_fb_helper_unprepare: | ||
| 239 | drm_fb_helper_unprepare(helper); | ||
| 240 | kfree(helper); | ||
| 204 | } | 241 | } |
| @@ -8,6 +8,35 @@ · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | #include "msm_drv.h" | 9 | #include "msm_drv.h" |
| 10 | #include "msm_fence.h" | 10 | #include "msm_fence.h" |
| 11 | #include "msm_gpu.h" | ||
| 12 | |||
| 13 | static struct msm_gpu *fctx2gpu(struct msm_fence_context *fctx) | ||
| 14 | { | ||
| 15 | struct msm_drm_private *priv = fctx->dev->dev_private; | ||
| 16 | return priv->gpu; | ||
| 17 | } | ||
| 18 | |||
| 19 | static enum hrtimer_restart deadline_timer(struct hrtimer *t) | ||
| 20 | { | ||
| 21 | struct msm_fence_context *fctx = container_of(t, | ||
| 22 | struct msm_fence_context, deadline_timer); | ||
| 23 | |||
| 24 | kthread_queue_work(fctx2gpu(fctx)->worker, &fctx->deadline_work); | ||
| 25 | |||
| 26 | return HRTIMER_NORESTART; | ||
| 27 | } | ||
| 28 | |||
| 29 | static void deadline_work(struct kthread_work *work) | ||
| 30 | { | ||
| 31 | struct msm_fence_context *fctx = container_of(work, | ||
| 32 | struct msm_fence_context, deadline_work); | ||
| 33 | |||
| 34 | /* If deadline fence has already passed, nothing to do: */ | ||
| 35 | if (msm_fence_completed(fctx, fctx->next_deadline_fence)) | ||
| 36 | return; | ||
| 37 | |||
| 38 | msm_devfreq_boost(fctx2gpu(fctx), 2); | ||
| 39 | } | ||
| 11 | 40 | ||
| 12 | 41 | ||
| 13 | struct msm_fence_context * | 42 | struct msm_fence_context * |
| @@ -36,6 +65,13 @@ msm_fence_context_alloc(struct drm_device *dev, volatile uint32_t *fenceptr, · 22 unmodified lines | |||
| 36 | fctx->completed_fence = fctx->last_fence; | 65 | fctx->completed_fence = fctx->last_fence; |
| 37 | *fctx->fenceptr = fctx->last_fence; | 66 | *fctx->fenceptr = fctx->last_fence; |
| 38 | 67 | ||
| 68 | hrtimer_init(&fctx->deadline_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); | ||
| 69 | fctx->deadline_timer.function = deadline_timer; | ||
| 70 | |||
| 71 | kthread_init_work(&fctx->deadline_work, deadline_work); | ||
| 72 | |||
| 73 | fctx->next_deadline = ktime_get(); | ||
| 74 | |||
| 39 | return fctx; | 75 | return fctx; |
| 40 | } | 76 | } |
| 41 | 77 | ||
| @@ -62,6 +98,8 @@ void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence) · 20 unmodified lines | |||
| 62 | spin_lock_irqsave(&fctx->spinlock, flags); | 98 | spin_lock_irqsave(&fctx->spinlock, flags); |
| 63 | if (fence_after(fence, fctx->completed_fence)) | 99 | if (fence_after(fence, fctx->completed_fence)) |
| 64 | fctx->completed_fence = fence; | 100 | fctx->completed_fence = fence; |
| 101 | if (msm_fence_completed(fctx, fctx->next_deadline_fence)) | ||
| 102 | hrtimer_cancel(&fctx->deadline_timer); | ||
| 65 | spin_unlock_irqrestore(&fctx->spinlock, flags); | 103 | spin_unlock_irqrestore(&fctx->spinlock, flags); |
| 66 | } | 104 | } |
| 67 | 105 | ||
| @@ -92,14 +130,50 @@ static bool msm_fence_signaled(struct dma_fence *fence) · 24 unmodified lines | |||
| 92 | return msm_fence_completed(f->fctx, f->base.seqno); | 130 | return msm_fence_completed(f->fctx, f->base.seqno); |
| 93 | } | 131 | } |
| 94 | 132 | ||
| 133 | static void msm_fence_set_deadline(struct dma_fence *fence, ktime_t deadline) | ||
| 134 | { | ||
| 135 | struct msm_fence *f = to_msm_fence(fence); | ||
| 136 | struct msm_fence_context *fctx = f->fctx; | ||
| 137 | unsigned long flags; | ||
| 138 | ktime_t now; | ||
| 139 | |||
| 140 | spin_lock_irqsave(&fctx->spinlock, flags); | ||
| 141 | now = ktime_get(); | ||
| 142 | |||
| 143 | if (ktime_after(now, fctx->next_deadline) || | ||
| 144 | ktime_before(deadline, fctx->next_deadline)) { | ||
| 145 | fctx->next_deadline = deadline; | ||
| 146 | fctx->next_deadline_fence = | ||
| 147 | max(fctx->next_deadline_fence, (uint32_t)fence->seqno); | ||
| 148 | |||
| 149 | /* | ||
| 150 | * Set timer to trigger boost 3ms before deadline, or | ||
| 151 | * if we are already less than 3ms before the deadline | ||
| 152 | * schedule boost work immediately. | ||
| 153 | */ | ||
| 154 | deadline = ktime_sub(deadline, ms_to_ktime(3)); | ||
| 155 | |||
| 156 | if (ktime_after(now, deadline)) { | ||
| 157 | kthread_queue_work(fctx2gpu(fctx)->worker, | ||
| 158 | &fctx->deadline_work); | ||
| 159 | } else { | ||
| 160 | hrtimer_start(&fctx->deadline_timer, deadline, | ||
| 161 | HRTIMER_MODE_ABS); | ||
| 162 | } | ||
| 163 | } | ||
| 164 | |||
| 165 | spin_unlock_irqrestore(&fctx->spinlock, flags); | ||
| 166 | } | ||
| 167 | |||
| 95 | static const struct dma_fence_ops msm_fence_ops = { | 168 | static const struct dma_fence_ops msm_fence_ops = { |
| 96 | .get_driver_name = msm_fence_get_driver_name, | 169 | .get_driver_name = msm_fence_get_driver_name, |
| 97 | .get_timeline_name = msm_fence_get_timeline_name, | 170 | .get_timeline_name = msm_fence_get_timeline_name, |
| 98 | .signaled = msm_fence_signaled, | 171 | .signaled = msm_fence_signaled, |
| 172 | .set_deadline = msm_fence_set_deadline, | ||
| 99 | }; | 173 | }; |
| 100 | 174 | ||
| 101 | struct dma_fence * | 175 | struct dma_fence * |
| 102 | msm_fence_alloc(struct msm_fence_context *fctx) | 176 | msm_fence_alloc(void) |
| 103 | { | 177 | { |
| 104 | struct msm_fence *f; | 178 | struct msm_fence *f; |
| 105 | 179 | ||
| @@ -107,10 +181,16 @@ msm_fence_alloc(struct msm_fence_context *fctx) · 1 unmodified line | |||
| 107 | if (!f) | 181 | if (!f) |
| 108 | return ERR_PTR(-ENOMEM); | 182 | return ERR_PTR(-ENOMEM); |
| 109 | 183 | ||
| 184 | return &f->base; | ||
| 185 | } | ||
| 186 | |||
| 187 | void | ||
| 188 | msm_fence_init(struct dma_fence *fence, struct msm_fence_context *fctx) | ||
| 189 | { | ||
| 190 | struct msm_fence *f = to_msm_fence(fence); | ||
| 191 | |||
| 110 | f->fctx = fctx; | 192 | f->fctx = fctx; |
| 111 | 193 | ||
| 112 | dma_fence_init(&f->base, &msm_fence_ops, &fctx->spinlock, | 194 | dma_fence_init(&f->base, &msm_fence_ops, &fctx->spinlock, |
| 113 | fctx->context, ++fctx->last_fence); | 195 | fctx->context, ++fctx->last_fence); |
| 114 | |||
| 115 | return &f->base; | ||
| 116 | } | 196 | } |
| @@ -52,6 +52,26 @@ struct msm_fence_context { · 51 unmodified lines | |||
| 52 | volatile uint32_t *fenceptr; | 52 | volatile uint32_t *fenceptr; |
| 53 | 53 | ||
| 54 | spinlock_t spinlock; | 54 | spinlock_t spinlock; |
| 55 | |||
| 56 | /* | ||
| 57 | * TODO this doesn't really deal with multiple deadlines, like | ||
| 58 | * if userspace got multiple frames ahead.. OTOH atomic updates | ||
| 59 | * don't queue, so maybe that is ok | ||
| 60 | */ | ||
| 61 | |||
| 62 | /** next_deadline: Time of next deadline */ | ||
| 63 | ktime_t next_deadline; | ||
| 64 | |||
| 65 | /** | ||
| 66 | * next_deadline_fence: | ||
| 67 | * | ||
| 68 | * Fence value for next pending deadline. The deadline timer is | ||
| 69 | * canceled when this fence is signaled. | ||
| 70 | */ | ||
| 71 | uint32_t next_deadline_fence; | ||
| 72 | |||
| 73 | struct hrtimer deadline_timer; | ||
| 74 | struct kthread_work deadline_work; | ||
| 55 | }; | 75 | }; |
| 56 | 76 | ||
| 57 | struct msm_fence_context * msm_fence_context_alloc(struct drm_device *dev, | 77 | struct msm_fence_context * msm_fence_context_alloc(struct drm_device *dev, |
| @@ -61,7 +81,8 @@ void msm_fence_context_free(struct msm_fence_context *fctx); · 3 unmodified lines | |||
| 61 | bool msm_fence_completed(struct msm_fence_context *fctx, uint32_t fence); | 81 | bool msm_fence_completed(struct msm_fence_context *fctx, uint32_t fence); |
| 62 | void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence); | 82 | void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence); |
| 63 | 83 | ||
| 64 | struct dma_fence * msm_fence_alloc(struct msm_fence_context *fctx); | 84 | struct dma_fence * msm_fence_alloc(void); |
| 85 | void msm_fence_init(struct dma_fence *fence, struct msm_fence_context *fctx); | ||
| 65 | 86 | ||
| 66 | static inline bool | 87 | static inline bool |
| 67 | fence_before(uint32_t a, uint32_t b) | 88 | fence_before(uint32_t a, uint32_t b) |
| @@ -19,8 +19,6 @@ · 18 unmodified lines | |||
| 19 | #include "msm_gpu.h" | 19 | #include "msm_gpu.h" |
| 20 | #include "msm_mmu.h" | 20 | #include "msm_mmu.h" |
| 21 | 21 | ||
| 22 | static void update_lru(struct drm_gem_object *obj); | ||
| 23 | |||
| 24 | static dma_addr_t physaddr(struct drm_gem_object *obj) | 22 | static dma_addr_t physaddr(struct drm_gem_object *obj) |
| 25 | { | 23 | { |
| 26 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | 24 | struct msm_gem_object *msm_obj = to_msm_bo(obj); |
| @@ -63,6 +61,49 @@ static void sync_for_cpu(struct msm_gem_object *msm_obj) · 36 unmodified lines | |||
| 63 | dma_unmap_sgtable(dev, msm_obj->sgt, DMA_BIDIRECTIONAL, 0); | 61 | dma_unmap_sgtable(dev, msm_obj->sgt, DMA_BIDIRECTIONAL, 0); |
| 64 | } | 62 | } |
| 65 | 63 | ||
| 64 | static void update_lru_active(struct drm_gem_object *obj) | ||
| 65 | { | ||
| 66 | struct msm_drm_private *priv = obj->dev->dev_private; | ||
| 67 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | ||
| 68 | |||
| 69 | GEM_WARN_ON(!msm_obj->pages); | ||
| 70 | |||
| 71 | if (msm_obj->pin_count) { | ||
| 72 | drm_gem_lru_move_tail_locked(&priv->lru.pinned, obj); | ||
| 73 | } else if (msm_obj->madv == MSM_MADV_WILLNEED) { | ||
| 74 | drm_gem_lru_move_tail_locked(&priv->lru.willneed, obj); | ||
| 75 | } else { | ||
| 76 | GEM_WARN_ON(msm_obj->madv != MSM_MADV_DONTNEED); | ||
| 77 | |||
| 78 | drm_gem_lru_move_tail_locked(&priv->lru.dontneed, obj); | ||
| 79 | } | ||
| 80 | } | ||
| 81 | |||
| 82 | static void update_lru_locked(struct drm_gem_object *obj) | ||
| 83 | { | ||
| 84 | struct msm_drm_private *priv = obj->dev->dev_private; | ||
| 85 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | ||
| 86 | |||
| 87 | msm_gem_assert_locked(&msm_obj->base); | ||
| 88 | |||
| 89 | if (!msm_obj->pages) { | ||
| 90 | GEM_WARN_ON(msm_obj->pin_count); | ||
| 91 | |||
| 92 | drm_gem_lru_move_tail_locked(&priv->lru.unbacked, obj); | ||
| 93 | } else { | ||
| 94 | update_lru_active(obj); | ||
| 95 | } | ||
| 96 | } | ||
| 97 | |||
| 98 | static void update_lru(struct drm_gem_object *obj) | ||
| 99 | { | ||
| 100 | struct msm_drm_private *priv = obj->dev->dev_private; | ||
| 101 | |||
| 102 | mutex_lock(&priv->lru.lock); | ||
| 103 | update_lru_locked(obj); | ||
| 104 | mutex_unlock(&priv->lru.lock); | ||
| 105 | } | ||
| 106 | |||
| 66 | /* allocate pages from VRAM carveout, used when no IOMMU: */ | 107 | /* allocate pages from VRAM carveout, used when no IOMMU: */ |
| 67 | static struct page **get_pages_vram(struct drm_gem_object *obj, int npages) | 108 | static struct page **get_pages_vram(struct drm_gem_object *obj, int npages) |
| 68 | { | 109 | { |
| @@ -180,6 +221,7 @@ static void put_pages(struct drm_gem_object *obj) · 111 unmodified lines | |||
| 180 | 221 | ||
| 181 | static struct page **msm_gem_pin_pages_locked(struct drm_gem_object *obj) | 222 | static struct page **msm_gem_pin_pages_locked(struct drm_gem_object *obj) |
| 182 | { | 223 | { |
| 224 | struct msm_drm_private *priv = obj->dev->dev_private; | ||
| 183 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | 225 | struct msm_gem_object *msm_obj = to_msm_bo(obj); |
| 184 | struct page **p; | 226 | struct page **p; |
| 185 | 227 | ||
| @@ -190,10 +232,13 @@ static struct page **msm_gem_pin_pages_locked(struct drm_gem_object *obj) · 4 unmodified lines | |||
| 190 | } | 232 | } |
| 191 | 233 | ||
| 192 | p = get_pages(obj); | 234 | p = get_pages(obj); |
| 193 | if (!IS_ERR(p)) { | 235 | if (IS_ERR(p)) |
| 194 | to_msm_bo(obj)->pin_count++; | 236 | return p; |
| 195 | update_lru(obj); | 237 | |
| 196 | } | 238 | mutex_lock(&priv->lru.lock); |
| 239 | msm_obj->pin_count++; | ||
| 240 | update_lru_locked(obj); | ||
| 241 | mutex_unlock(&priv->lru.lock); | ||
| 197 | 242 | ||
| 198 | return p; | 243 | return p; |
| 199 | } | 244 | } |
| @@ -309,12 +354,10 @@ static struct msm_gem_vma *add_vma(struct drm_gem_object *obj, · 109 unmodified lines | |||
| 309 | 354 | ||
| 310 | msm_gem_assert_locked(obj); | 355 | msm_gem_assert_locked(obj); |
| 311 | 356 | ||
| 312 | vma = kzalloc(sizeof(*vma), GFP_KERNEL); | 357 | vma = msm_gem_vma_new(aspace); |
| 313 | if (!vma) | 358 | if (!vma) |
| 314 | return ERR_PTR(-ENOMEM); | 359 | return ERR_PTR(-ENOMEM); |
| 315 | 360 | ||
| 316 | vma->aspace = aspace; | ||
| 317 | |||
| 318 | list_add_tail(&vma->list, &msm_obj->vmas); | 361 | list_add_tail(&vma->list, &msm_obj->vmas); |
| 319 | 362 | ||
| 320 | return vma; | 363 | return vma; |
| @@ -361,9 +404,9 @@ put_iova_spaces(struct drm_gem_object *obj, bool close) · 40 unmodified lines | |||
| 361 | 404 | ||
| 362 | list_for_each_entry(vma, &msm_obj->vmas, list) { | 405 | list_for_each_entry(vma, &msm_obj->vmas, list) { |
| 363 | if (vma->aspace) { | 406 | if (vma->aspace) { |
| 364 | msm_gem_purge_vma(vma->aspace, vma); | 407 | msm_gem_vma_purge(vma); |
| 365 | if (close) | 408 | if (close) |
| 366 | msm_gem_close_vma(vma->aspace, vma); | 409 | msm_gem_vma_close(vma); |
| 367 | } | 410 | } |
| 368 | } | 411 | } |
| 369 | } | 412 | } |
| @@ -399,7 +442,7 @@ static struct msm_gem_vma *get_vma_locked(struct drm_gem_object *obj, · 29 unmodified lines | |||
| 399 | if (IS_ERR(vma)) | 442 | if (IS_ERR(vma)) |
| 400 | return vma; | 443 | return vma; |
| 401 | 444 | ||
| 402 | ret = msm_gem_init_vma(aspace, vma, obj->size, | 445 | ret = msm_gem_vma_init(vma, obj->size, |
| 403 | range_start, range_end); | 446 | range_start, range_end); |
| 404 | if (ret) { | 447 | if (ret) { |
| 405 | del_vma(vma); | 448 | del_vma(vma); |
| @@ -437,7 +480,7 @@ int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma) · 31 unmodified lines | |||
| 437 | if (IS_ERR(pages)) | 480 | if (IS_ERR(pages)) |
| 438 | return PTR_ERR(pages); | 481 | return PTR_ERR(pages); |
| 439 | 482 | ||
| 440 | ret = msm_gem_map_vma(vma->aspace, vma, prot, msm_obj->sgt, obj->size); | 483 | ret = msm_gem_vma_map(vma, prot, msm_obj->sgt, obj->size); |
| 441 | if (ret) | 484 | if (ret) |
| 442 | msm_gem_unpin_locked(obj); | 485 | msm_gem_unpin_locked(obj); |
| 443 | 486 | ||
| @@ -446,14 +489,34 @@ int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma) · 2 unmodified lines | |||
| 446 | 489 | ||
| 447 | void msm_gem_unpin_locked(struct drm_gem_object *obj) | 490 | void msm_gem_unpin_locked(struct drm_gem_object *obj) |
| 448 | { | 491 | { |
| 492 | struct msm_drm_private *priv = obj->dev->dev_private; | ||
| 449 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | 493 | struct msm_gem_object *msm_obj = to_msm_bo(obj); |
| 450 | 494 | ||
| 451 | msm_gem_assert_locked(obj); | 495 | msm_gem_assert_locked(obj); |
| 452 | 496 | ||
| 497 | mutex_lock(&priv->lru.lock); | ||
| 453 | msm_obj->pin_count--; | 498 | msm_obj->pin_count--; |
| 454 | GEM_WARN_ON(msm_obj->pin_count < 0); | 499 | GEM_WARN_ON(msm_obj->pin_count < 0); |
| 500 | update_lru_locked(obj); | ||
| 501 | mutex_unlock(&priv->lru.lock); | ||
| 502 | } | ||
| 455 | 503 | ||
| 456 | update_lru(obj); | 504 | /* Special unpin path for use in fence-signaling path, avoiding the need |
| 505 | * to hold the obj lock by only depending on things that a protected by | ||
| 506 | * the LRU lock. In particular we know that that we already have backing | ||
| 507 | * and and that the object's dma_resv has the fence for the current | ||
| 508 | * submit/job which will prevent us racing against page eviction. | ||
| 509 | */ | ||
| 510 | void msm_gem_unpin_active(struct drm_gem_object *obj) | ||
| 511 | { | ||
| 512 | struct msm_drm_private *priv = obj->dev->dev_private; | ||
| 513 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | ||
| 514 | |||
| 515 | mutex_lock(&priv->lru.lock); | ||
| 516 | msm_obj->pin_count--; | ||
| 517 | GEM_WARN_ON(msm_obj->pin_count < 0); | ||
| 518 | update_lru_active(obj); | ||
| 519 | mutex_unlock(&priv->lru.lock); | ||
| 457 | } | 520 | } |
| 458 | 521 | ||
| 459 | struct msm_gem_vma *msm_gem_get_vma_locked(struct drm_gem_object *obj, | 522 | struct msm_gem_vma *msm_gem_get_vma_locked(struct drm_gem_object *obj, |
| @@ -539,8 +602,8 @@ static int clear_iova(struct drm_gem_object *obj, · 79 unmodified lines | |||
| 539 | if (msm_gem_vma_inuse(vma)) | 602 | if (msm_gem_vma_inuse(vma)) |
| 540 | return -EBUSY; | 603 | return -EBUSY; |
| 541 | 604 | ||
| 542 | msm_gem_purge_vma(vma->aspace, vma); | 605 | msm_gem_vma_purge(vma); |
| 543 | msm_gem_close_vma(vma->aspace, vma); | 606 | msm_gem_vma_close(vma); |
| 544 | del_vma(vma); | 607 | del_vma(vma); |
| 545 | 608 | ||
| 546 | return 0; | 609 | return 0; |
| @@ -589,7 +652,7 @@ void msm_gem_unpin_iova(struct drm_gem_object *obj, · 42 unmodified lines | |||
| 589 | msm_gem_lock(obj); | 652 | msm_gem_lock(obj); |
| 590 | vma = lookup_vma(obj, aspace); | 653 | vma = lookup_vma(obj, aspace); |
| 591 | if (!GEM_WARN_ON(!vma)) { | 654 | if (!GEM_WARN_ON(!vma)) { |
| 592 | msm_gem_unpin_vma(vma); | 655 | msm_gem_vma_unpin(vma); |
| 593 | msm_gem_unpin_locked(obj); | 656 | msm_gem_unpin_locked(obj); |
| 594 | } | 657 | } |
| 595 | msm_gem_unlock(obj); | 658 | msm_gem_unlock(obj); |
| @@ -628,6 +691,7 @@ fail: · 32 unmodified lines | |||
| 628 | static void *get_vaddr(struct drm_gem_object *obj, unsigned madv) | 691 | static void *get_vaddr(struct drm_gem_object *obj, unsigned madv) |
| 629 | { | 692 | { |
| 630 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | 693 | struct msm_gem_object *msm_obj = to_msm_bo(obj); |
| 694 | struct page **pages; | ||
| 631 | int ret = 0; | 695 | int ret = 0; |
| 632 | 696 | ||
| 633 | msm_gem_assert_locked(obj); | 697 | msm_gem_assert_locked(obj); |
| @@ -641,6 +705,10 @@ static void *get_vaddr(struct drm_gem_object *obj, unsigned madv) · 7 unmodified lines | |||
| 641 | return ERR_PTR(-EBUSY); | 705 | return ERR_PTR(-EBUSY); |
| 642 | } | 706 | } |
| 643 | 707 | ||
| 708 | pages = msm_gem_pin_pages_locked(obj); | ||
| 709 | if (IS_ERR(pages)) | ||
| 710 | return ERR_CAST(pages); | ||
| 711 | |||
| 644 | /* increment vmap_count *before* vmap() call, so shrinker can | 712 | /* increment vmap_count *before* vmap() call, so shrinker can |
| 645 | * check vmap_count (is_vunmapable()) outside of msm_obj lock. | 713 | * check vmap_count (is_vunmapable()) outside of msm_obj lock. |
| 646 | * This guarantees that we won't try to msm_gem_vunmap() this | 714 | * This guarantees that we won't try to msm_gem_vunmap() this |
| @@ -650,25 +718,19 @@ static void *get_vaddr(struct drm_gem_object *obj, unsigned madv) · 3 unmodified lines | |||
| 650 | msm_obj->vmap_count++; | 718 | msm_obj->vmap_count++; |
| 651 | 719 | ||
| 652 | if (!msm_obj->vaddr) { | 720 | if (!msm_obj->vaddr) { |
| 653 | struct page **pages = get_pages(obj); | ||
| 654 | if (IS_ERR(pages)) { | ||
| 655 | ret = PTR_ERR(pages); | ||
| 656 | goto fail; | ||
| 657 | } | ||
| 658 | msm_obj->vaddr = vmap(pages, obj->size >> PAGE_SHIFT, | 721 | msm_obj->vaddr = vmap(pages, obj->size >> PAGE_SHIFT, |
| 659 | VM_MAP, msm_gem_pgprot(msm_obj, PAGE_KERNEL)); | 722 | VM_MAP, msm_gem_pgprot(msm_obj, PAGE_KERNEL)); |
| 660 | if (msm_obj->vaddr == NULL) { | 723 | if (msm_obj->vaddr == NULL) { |
| 661 | ret = -ENOMEM; | 724 | ret = -ENOMEM; |
| 662 | goto fail; | 725 | goto fail; |
| 663 | } | 726 | } |
| 664 | |||
| 665 | update_lru(obj); | ||
| 666 | } | 727 | } |
| 667 | 728 | ||
| 668 | return msm_obj->vaddr; | 729 | return msm_obj->vaddr; |
| 669 | 730 | ||
| 670 | fail: | 731 | fail: |
| 671 | msm_obj->vmap_count--; | 732 | msm_obj->vmap_count--; |
| 733 | msm_gem_unpin_locked(obj); | ||
| 672 | return ERR_PTR(ret); | 734 | return ERR_PTR(ret); |
| 673 | } | 735 | } |
| 674 | 736 | ||
| @@ -707,6 +769,7 @@ void msm_gem_put_vaddr_locked(struct drm_gem_object *obj) · 32 unmodified lines | |||
| 707 | GEM_WARN_ON(msm_obj->vmap_count < 1); | 769 | GEM_WARN_ON(msm_obj->vmap_count < 1); |
| 708 | 770 | ||
| 709 | msm_obj->vmap_count--; | 771 | msm_obj->vmap_count--; |
| 772 | msm_gem_unpin_locked(obj); | ||
| 710 | } | 773 | } |
| 711 | 774 | ||
| 712 | void msm_gem_put_vaddr(struct drm_gem_object *obj) | 775 | void msm_gem_put_vaddr(struct drm_gem_object *obj) |
| @@ -721,10 +784,13 @@ void msm_gem_put_vaddr(struct drm_gem_object *obj) · 8 unmodified lines | |||
| 721 | */ | 784 | */ |
| 722 | int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) | 785 | int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) |
| 723 | { | 786 | { |
| 787 | struct msm_drm_private *priv = obj->dev->dev_private; | ||
| 724 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | 788 | struct msm_gem_object *msm_obj = to_msm_bo(obj); |
| 725 | 789 | ||
| 726 | msm_gem_lock(obj); | 790 | msm_gem_lock(obj); |
| 727 | 791 | ||
| 792 | mutex_lock(&priv->lru.lock); | ||
| 793 | |||
| 728 | if (msm_obj->madv != __MSM_MADV_PURGED) | 794 | if (msm_obj->madv != __MSM_MADV_PURGED) |
| 729 | msm_obj->madv = madv; | 795 | msm_obj->madv = madv; |
| 730 | 796 | ||
| @@ -733,7 +799,9 @@ int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) · 2 unmodified lines | |||
| 733 | /* If the obj is inactive, we might need to move it | 799 | /* If the obj is inactive, we might need to move it |
| 734 | * between inactive lists | 800 | * between inactive lists |
| 735 | */ | 801 | */ |
| 736 | update_lru(obj); | 802 | update_lru_locked(obj); |
| 803 | |||
| 804 | mutex_unlock(&priv->lru.lock); | ||
| 737 | 805 | ||
| 738 | msm_gem_unlock(obj); | 806 | msm_gem_unlock(obj); |
| 739 | 807 | ||
| @@ -743,6 +811,7 @@ int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) · 3 unmodified lines | |||
| 743 | void msm_gem_purge(struct drm_gem_object *obj) | 811 | void msm_gem_purge(struct drm_gem_object *obj) |
| 744 | { | 812 | { |
| 745 | struct drm_device *dev = obj->dev; | 813 | struct drm_device *dev = obj->dev; |
| 814 | struct msm_drm_private *priv = obj->dev->dev_private; | ||
| 746 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | 815 | struct msm_gem_object *msm_obj = to_msm_bo(obj); |
| 747 | 816 | ||
| 748 | msm_gem_assert_locked(obj); | 817 | msm_gem_assert_locked(obj); |
| @@ -759,7 +828,10 @@ void msm_gem_purge(struct drm_gem_object *obj) · 10 unmodified lines | |||
| 759 | 828 | ||
| 760 | put_iova_vmas(obj); | 829 | put_iova_vmas(obj); |
| 761 | 830 | ||
| 831 | mutex_lock(&priv->lru.lock); | ||
| 832 | /* A one-way transition: */ | ||
| 762 | msm_obj->madv = __MSM_MADV_PURGED; | 833 | msm_obj->madv = __MSM_MADV_PURGED; |
| 834 | mutex_unlock(&priv->lru.lock); | ||
| 763 | 835 | ||
| 764 | drm_gem_free_mmap_offset(obj); | 836 | drm_gem_free_mmap_offset(obj); |
| 765 | 837 | ||
| @@ -806,29 +878,6 @@ void msm_gem_vunmap(struct drm_gem_object *obj) · 40 unmodified lines | |||
| 806 | msm_obj->vaddr = NULL; | 878 | msm_obj->vaddr = NULL; |
| 807 | } | 879 | } |
| 808 | 880 | ||
| 809 | static void update_lru(struct drm_gem_object *obj) | ||
| 810 | { | ||
| 811 | struct msm_drm_private *priv = obj->dev->dev_private; | ||
| 812 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | ||
| 813 | |||
| 814 | msm_gem_assert_locked(&msm_obj->base); | ||
| 815 | |||
| 816 | if (!msm_obj->pages) { | ||
| 817 | GEM_WARN_ON(msm_obj->pin_count); | ||
| 818 | GEM_WARN_ON(msm_obj->vmap_count); | ||
| 819 | |||
| 820 | drm_gem_lru_move_tail(&priv->lru.unbacked, obj); | ||
| 821 | } else if (msm_obj->pin_count || msm_obj->vmap_count) { | ||
| 822 | drm_gem_lru_move_tail(&priv->lru.pinned, obj); | ||
| 823 | } else if (msm_obj->madv == MSM_MADV_WILLNEED) { | ||
| 824 | drm_gem_lru_move_tail(&priv->lru.willneed, obj); | ||
| 825 | } else { | ||
| 826 | GEM_WARN_ON(msm_obj->madv != MSM_MADV_DONTNEED); | ||
| 827 | |||
| 828 | drm_gem_lru_move_tail(&priv->lru.dontneed, obj); | ||
| 829 | } | ||
| 830 | } | ||
| 831 | |||
| 832 | bool msm_gem_active(struct drm_gem_object *obj) | 881 | bool msm_gem_active(struct drm_gem_object *obj) |
| 833 | { | 882 | { |
| 834 | msm_gem_assert_locked(obj); | 883 | msm_gem_assert_locked(obj); |
| @@ -846,6 +895,11 @@ int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout) · 11 unmodified lines | |||
| 846 | op & MSM_PREP_NOSYNC ? 0 : timeout_to_jiffies(timeout); | 895 | op & MSM_PREP_NOSYNC ? 0 : timeout_to_jiffies(timeout); |
| 847 | long ret; | 896 | long ret; |
| 848 | 897 | ||
| 898 | if (op & MSM_PREP_BOOST) { | ||
| 899 | dma_resv_set_deadline(obj->resv, dma_resv_usage_rw(write), | ||
| 900 | ktime_get()); | ||
| 901 | } | ||
| 902 | |||
| 849 | ret = dma_resv_wait_timeout(obj->resv, dma_resv_usage_rw(write), | 903 | ret = dma_resv_wait_timeout(obj->resv, dma_resv_usage_rw(write), |
| 850 | true, remain); | 904 | true, remain); |
| 851 | if (ret == 0) | 905 | if (ret == 0) |
| @@ -59,6 +59,7 @@ struct msm_fence_context; · 58 unmodified lines | |||
| 59 | 59 | ||
| 60 | struct msm_gem_vma { | 60 | struct msm_gem_vma { |
| 61 | struct drm_mm_node node; | 61 | struct drm_mm_node node; |
| 62 | spinlock_t lock; | ||
| 62 | uint64_t iova; | 63 | uint64_t iova; |
| 63 | struct msm_gem_address_space *aspace; | 64 | struct msm_gem_address_space *aspace; |
| 64 | struct list_head list; /* node in msm_gem_object::vmas */ | 65 | struct list_head list; /* node in msm_gem_object::vmas */ |
| @@ -69,19 +70,15 @@ struct msm_gem_vma { · 4 unmodified lines | |||
| 69 | struct msm_fence_context *fctx[MSM_GPU_MAX_RINGS]; | 70 | struct msm_fence_context *fctx[MSM_GPU_MAX_RINGS]; |
| 70 | }; | 71 | }; |
| 71 | 72 | ||
| 72 | int msm_gem_init_vma(struct msm_gem_address_space *aspace, | 73 | struct msm_gem_vma *msm_gem_vma_new(struct msm_gem_address_space *aspace); |
| 73 | struct msm_gem_vma *vma, int size, | 74 | int msm_gem_vma_init(struct msm_gem_vma *vma, int size, |
| 74 | u64 range_start, u64 range_end); | 75 | u64 range_start, u64 range_end); |
| 75 | bool msm_gem_vma_inuse(struct msm_gem_vma *vma); | 76 | bool msm_gem_vma_inuse(struct msm_gem_vma *vma); |
| 76 | void msm_gem_purge_vma(struct msm_gem_address_space *aspace, | 77 | void msm_gem_vma_purge(struct msm_gem_vma *vma); |
| 77 | struct msm_gem_vma *vma); | 78 | void msm_gem_vma_unpin(struct msm_gem_vma *vma); |
| 78 | void msm_gem_unpin_vma(struct msm_gem_vma *vma); | 79 | void msm_gem_vma_unpin_fenced(struct msm_gem_vma *vma, struct msm_fence_context *fctx); |
| 79 | void msm_gem_unpin_vma_fenced(struct msm_gem_vma *vma, struct msm_fence_context *fctx); | 80 | int msm_gem_vma_map(struct msm_gem_vma *vma, int prot, struct sg_table *sgt, int size); |
| 80 | int msm_gem_map_vma(struct msm_gem_address_space *aspace, | 81 | void msm_gem_vma_close(struct msm_gem_vma *vma); |
| 81 | struct msm_gem_vma *vma, int prot, | ||
| 82 | struct sg_table *sgt, int size); | ||
| 83 | void msm_gem_close_vma(struct msm_gem_address_space *aspace, | ||
| 84 | struct msm_gem_vma *vma); | ||
| 85 | 82 | ||
| 86 | struct msm_gem_object { | 83 | struct msm_gem_object { |
| 87 | struct drm_gem_object base; | 84 | struct drm_gem_object base; |
| @@ -89,7 +86,9 @@ struct msm_gem_object { · 1 unmodified line | |||
| 89 | uint32_t flags; | 86 | uint32_t flags; |
| 90 | 87 | ||
| 91 | /** | 88 | /** |
| 92 | * Advice: are the backing pages purgeable? | 89 | * madv: are the backing pages purgeable? |
| 90 | * | ||
| 91 | * Protected by obj lock and LRU lock | ||
| 93 | */ | 92 | */ |
| 94 | uint8_t madv; | 93 | uint8_t madv; |
| 95 | 94 | ||
| @@ -117,6 +116,11 @@ struct msm_gem_object { · 21 unmodified lines | |||
| 117 | 116 | ||
| 118 | char name[32]; /* Identifier to print for the debugfs files */ | 117 | char name[32]; /* Identifier to print for the debugfs files */ |
| 119 | 118 | ||
| 119 | /** | ||
| 120 | * pin_count: Number of times the pages are pinned | ||
| 121 | * | ||
| 122 | * Protected by LRU lock. | ||
| 123 | */ | ||
| 120 | int pin_count; | 124 | int pin_count; |
| 121 | }; | 125 | }; |
| 122 | #define to_msm_bo(x) container_of(x, struct msm_gem_object, base) | 126 | #define to_msm_bo(x) container_of(x, struct msm_gem_object, base) |
| @@ -124,6 +128,7 @@ struct msm_gem_object { · 1 unmodified line | |||
| 124 | uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj); | 128 | uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj); |
| 125 | int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma); | 129 | int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma); |
| 126 | void msm_gem_unpin_locked(struct drm_gem_object *obj); | 130 | void msm_gem_unpin_locked(struct drm_gem_object *obj); |
| 131 | void msm_gem_unpin_active(struct drm_gem_object *obj); | ||
| 127 | struct msm_gem_vma *msm_gem_get_vma_locked(struct drm_gem_object *obj, | 132 | struct msm_gem_vma *msm_gem_get_vma_locked(struct drm_gem_object *obj, |
| 128 | struct msm_gem_address_space *aspace); | 133 | struct msm_gem_address_space *aspace); |
| 129 | int msm_gem_get_iova(struct drm_gem_object *obj, | 134 | int msm_gem_get_iova(struct drm_gem_object *obj, |
| @@ -41,8 +41,16 @@ static struct msm_gem_submit *submit_create(struct drm_device *dev, · 40 unmodified lines | |||
| 41 | if (!submit) | 41 | if (!submit) |
| 42 | return ERR_PTR(-ENOMEM); | 42 | return ERR_PTR(-ENOMEM); |
| 43 | 43 | ||
| 44 | submit->hw_fence = msm_fence_alloc(); | ||
| 45 | if (IS_ERR(submit->hw_fence)) { | ||
| 46 | ret = PTR_ERR(submit->hw_fence); | ||
| 47 | kfree(submit); | ||
| 48 | return ERR_PTR(ret); | ||
| 49 | } | ||
| 50 | |||
| 44 | ret = drm_sched_job_init(&submit->base, queue->entity, queue); | 51 | ret = drm_sched_job_init(&submit->base, queue->entity, queue); |
| 45 | if (ret) { | 52 | if (ret) { |
| 53 | kfree(submit->hw_fence); | ||
| 46 | kfree(submit); | 54 | kfree(submit); |
| 47 | return ERR_PTR(ret); | 55 | return ERR_PTR(ret); |
| 48 | } | 56 | } |
| @@ -72,9 +80,9 @@ void __msm_gem_submit_destroy(struct kref *kref) · 23 unmodified lines | |||
| 72 | unsigned i; | 80 | unsigned i; |
| 73 | 81 | ||
| 74 | if (submit->fence_id) { | 82 | if (submit->fence_id) { |
| 75 | mutex_lock(&submit->queue->idr_lock); | 83 | spin_lock(&submit->queue->idr_lock); |
| 76 | idr_remove(&submit->queue->fence_idr, submit->fence_id); | 84 | idr_remove(&submit->queue->fence_idr, submit->fence_id); |
| 77 | mutex_unlock(&submit->queue->idr_lock); | 85 | spin_unlock(&submit->queue->idr_lock); |
| 78 | } | 86 | } |
| 79 | 87 | ||
| 80 | dma_fence_put(submit->user_fence); | 88 | dma_fence_put(submit->user_fence); |
| @@ -242,7 +250,7 @@ static void submit_cleanup_bo(struct msm_gem_submit *submit, int i, · 161 unmodified lines | |||
| 242 | submit->bos[i].flags &= ~cleanup_flags; | 250 | submit->bos[i].flags &= ~cleanup_flags; |
| 243 | 251 | ||
| 244 | if (flags & BO_VMA_PINNED) | 252 | if (flags & BO_VMA_PINNED) |
| 245 | msm_gem_unpin_vma(submit->bos[i].vma); | 253 | msm_gem_vma_unpin(submit->bos[i].vma); |
| 246 | 254 | ||
| 247 | if (flags & BO_OBJ_PINNED) | 255 | if (flags & BO_OBJ_PINNED) |
| 248 | msm_gem_unpin_locked(obj); | 256 | msm_gem_unpin_locked(obj); |
| @@ -565,7 +573,6 @@ static struct drm_syncobj **msm_parse_deps(struct msm_gem_submit *submit, · 316 unmodified lines | |||
| 565 | 573 | ||
| 566 | for (i = 0; i < nr_in_syncobjs; ++i) { | 574 | for (i = 0; i < nr_in_syncobjs; ++i) { |
| 567 | uint64_t address = in_syncobjs_addr + i * syncobj_stride; | 575 | uint64_t address = in_syncobjs_addr + i * syncobj_stride; |
| 568 | struct dma_fence *fence; | ||
| 569 | 576 | ||
| 570 | if (copy_from_user(&syncobj_desc, | 577 | if (copy_from_user(&syncobj_desc, |
| 571 | u64_to_user_ptr(address), | 578 | u64_to_user_ptr(address), |
| @@ -585,12 +592,8 @@ static struct drm_syncobj **msm_parse_deps(struct msm_gem_submit *submit, · 13 unmodified lines | |||
| 585 | break; | 592 | break; |
| 586 | } | 593 | } |
| 587 | 594 | ||
| 588 | ret = drm_syncobj_find_fence(file, syncobj_desc.handle, | 595 | ret = drm_sched_job_add_syncobj_dependency(&submit->base, file, |
| 589 | syncobj_desc.point, 0, &fence); | 596 | syncobj_desc.handle, syncobj_desc.point); |
| 590 | if (ret) | ||
| 591 | break; | ||
| 592 | |||
| 593 | ret = drm_sched_job_add_dependency(&submit->base, fence); | ||
| 594 | if (ret) | 597 | if (ret) |
| 595 | break; | 598 | break; |
| 596 | 599 | ||
| @@ -874,7 +877,9 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 277 unmodified lines | |||
| 874 | 877 | ||
| 875 | submit->nr_cmds = i; | 878 | submit->nr_cmds = i; |
| 876 | 879 | ||
| 877 | mutex_lock(&queue->idr_lock); | 880 | idr_preload(GFP_KERNEL); |
| 881 | |||
| 882 | spin_lock(&queue->idr_lock); | ||
| 878 | 883 | ||
| 879 | /* | 884 | /* |
| 880 | * If using userspace provided seqno fence, validate that the id | 885 | * If using userspace provided seqno fence, validate that the id |
| @@ -884,7 +889,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 3 unmodified lines | |||
| 884 | */ | 889 | */ |
| 885 | if ((args->flags & MSM_SUBMIT_FENCE_SN_IN) && | 890 | if ((args->flags & MSM_SUBMIT_FENCE_SN_IN) && |
| 886 | idr_find(&queue->fence_idr, args->fence)) { | 891 | idr_find(&queue->fence_idr, args->fence)) { |
| 887 | mutex_unlock(&queue->idr_lock); | 892 | spin_unlock(&queue->idr_lock); |
| 893 | idr_preload_end(); | ||
| 888 | ret = -EINVAL; | 894 | ret = -EINVAL; |
| 889 | goto out; | 895 | goto out; |
| 890 | } | 896 | } |
| @@ -902,7 +908,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 11 unmodified lines | |||
| 902 | submit->fence_id = args->fence; | 908 | submit->fence_id = args->fence; |
| 903 | ret = idr_alloc_u32(&queue->fence_idr, submit->user_fence, | 909 | ret = idr_alloc_u32(&queue->fence_idr, submit->user_fence, |
| 904 | &submit->fence_id, submit->fence_id, | 910 | &submit->fence_id, submit->fence_id, |
| 905 | GFP_KERNEL); | 911 | GFP_NOWAIT); |
| 906 | /* | 912 | /* |
| 907 | * We've already validated that the fence_id slot is valid, | 913 | * We've already validated that the fence_id slot is valid, |
| 908 | * so if idr_alloc_u32 failed, it is a kernel bug | 914 | * so if idr_alloc_u32 failed, it is a kernel bug |
| @@ -915,10 +921,11 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 6 unmodified lines | |||
| 915 | */ | 921 | */ |
| 916 | submit->fence_id = idr_alloc_cyclic(&queue->fence_idr, | 922 | submit->fence_id = idr_alloc_cyclic(&queue->fence_idr, |
| 917 | submit->user_fence, 1, | 923 | submit->user_fence, 1, |
| 918 | INT_MAX, GFP_KERNEL); | 924 | INT_MAX, GFP_NOWAIT); |
| 919 | } | 925 | } |
| 920 | 926 | ||
| 921 | mutex_unlock(&queue->idr_lock); | 927 | spin_unlock(&queue->idr_lock); |
| 928 | idr_preload_end(); | ||
| 922 | 929 | ||
| 923 | if (submit->fence_id < 0) { | 930 | if (submit->fence_id < 0) { |
| 924 | ret = submit->fence_id; | 931 | ret = submit->fence_id; |
| @@ -40,25 +40,34 @@ msm_gem_address_space_get(struct msm_gem_address_space *aspace) · 39 unmodified lines | |||
| 40 | 40 | ||
| 41 | bool msm_gem_vma_inuse(struct msm_gem_vma *vma) | 41 | bool msm_gem_vma_inuse(struct msm_gem_vma *vma) |
| 42 | { | 42 | { |
| 43 | bool ret = true; | ||
| 44 | |||
| 45 | spin_lock(&vma->lock); | ||
| 46 | |||
| 43 | if (vma->inuse > 0) | 47 | if (vma->inuse > 0) |
| 44 | return true; | 48 | goto out; |
| 45 | 49 | ||
| 46 | while (vma->fence_mask) { | 50 | while (vma->fence_mask) { |
| 47 | unsigned idx = ffs(vma->fence_mask) - 1; | 51 | unsigned idx = ffs(vma->fence_mask) - 1; |
| 48 | 52 | ||
| 49 | if (!msm_fence_completed(vma->fctx[idx], vma->fence[idx])) | 53 | if (!msm_fence_completed(vma->fctx[idx], vma->fence[idx])) |
| 50 | return true; | 54 | goto out; |
| 51 | 55 | ||
| 52 | vma->fence_mask &= ~BIT(idx); | 56 | vma->fence_mask &= ~BIT(idx); |
| 53 | } | 57 | } |
| 54 | 58 | ||
| 55 | return false; | 59 | ret = false; |
| 60 | |||
| 61 | out: | ||
| 62 | spin_unlock(&vma->lock); | ||
| 63 | |||
| 64 | return ret; | ||
| 56 | } | 65 | } |
| 57 | 66 | ||
| 58 | /* Actually unmap memory for the vma */ | 67 | /* Actually unmap memory for the vma */ |
| 59 | void msm_gem_purge_vma(struct msm_gem_address_space *aspace, | 68 | void msm_gem_vma_purge(struct msm_gem_vma *vma) |
| 60 | struct msm_gem_vma *vma) | ||
| 61 | { | 69 | { |
| 70 | struct msm_gem_address_space *aspace = vma->aspace; | ||
| 62 | unsigned size = vma->node.size; | 71 | unsigned size = vma->node.size; |
| 63 | 72 | ||
| 64 | /* Print a message if we try to purge a vma in use */ | 73 | /* Print a message if we try to purge a vma in use */ |
| @@ -68,14 +77,12 @@ void msm_gem_purge_vma(struct msm_gem_address_space *aspace, · 3 unmodified lines | |||
| 68 | if (!vma->mapped) | 77 | if (!vma->mapped) |
| 69 | return; | 78 | return; |
| 70 | 79 | ||
| 71 | if (aspace->mmu) | 80 | aspace->mmu->funcs->unmap(aspace->mmu, vma->iova, size); |
| 72 | aspace->mmu->funcs->unmap(aspace->mmu, vma->iova, size); | ||
| 73 | 81 | ||
| 74 | vma->mapped = false; | 82 | vma->mapped = false; |
| 75 | } | 83 | } |
| 76 | 84 | ||
| 77 | /* Remove reference counts for the mapping */ | 85 | static void vma_unpin_locked(struct msm_gem_vma *vma) |
| 78 | void msm_gem_unpin_vma(struct msm_gem_vma *vma) | ||
| 79 | { | 86 | { |
| 80 | if (GEM_WARN_ON(!vma->inuse)) | 87 | if (GEM_WARN_ON(!vma->inuse)) |
| 81 | return; | 88 | return; |
| @@ -83,50 +90,75 @@ void msm_gem_unpin_vma(struct msm_gem_vma *vma) · 1 unmodified line | |||
| 83 | vma->inuse--; | 90 | vma->inuse--; |
| 84 | } | 91 | } |
| 85 | 92 | ||
| 93 | /* Remove reference counts for the mapping */ | ||
| 94 | void msm_gem_vma_unpin(struct msm_gem_vma *vma) | ||
| 95 | { | ||
| 96 | spin_lock(&vma->lock); | ||
| 97 | vma_unpin_locked(vma); | ||
| 98 | spin_unlock(&vma->lock); | ||
| 99 | } | ||
| 100 | |||
| 86 | /* Replace pin reference with fence: */ | 101 | /* Replace pin reference with fence: */ |
| 87 | void msm_gem_unpin_vma_fenced(struct msm_gem_vma *vma, struct msm_fence_context *fctx) | 102 | void msm_gem_vma_unpin_fenced(struct msm_gem_vma *vma, struct msm_fence_context *fctx) |
| 88 | { | 103 | { |
| 104 | spin_lock(&vma->lock); | ||
| 89 | vma->fctx[fctx->index] = fctx; | 105 | vma->fctx[fctx->index] = fctx; |
| 90 | vma->fence[fctx->index] = fctx->last_fence; | 106 | vma->fence[fctx->index] = fctx->last_fence; |
| 91 | vma->fence_mask |= BIT(fctx->index); | 107 | vma->fence_mask |= BIT(fctx->index); |
| 92 | msm_gem_unpin_vma(vma); | 108 | vma_unpin_locked(vma); |
| 109 | spin_unlock(&vma->lock); | ||
| 93 | } | 110 | } |
| 94 | 111 | ||
| 95 | /* Map and pin vma: */ | 112 | /* Map and pin vma: */ |
| 96 | int | 113 | int |
| 97 | msm_gem_map_vma(struct msm_gem_address_space *aspace, | 114 | msm_gem_vma_map(struct msm_gem_vma *vma, int prot, |
| 98 | struct msm_gem_vma *vma, int prot, | ||
| 99 | struct sg_table *sgt, int size) | 115 | struct sg_table *sgt, int size) |
| 100 | { | 116 | { |
| 101 | int ret = 0; | 117 | struct msm_gem_address_space *aspace = vma->aspace; |
| 118 | int ret; | ||
| 102 | 119 | ||
| 103 | if (GEM_WARN_ON(!vma->iova)) | 120 | if (GEM_WARN_ON(!vma->iova)) |
| 104 | return -EINVAL; | 121 | return -EINVAL; |
| 105 | 122 | ||
| 106 | /* Increase the usage counter */ | 123 | /* Increase the usage counter */ |
| 124 | spin_lock(&vma->lock); | ||
| 107 | vma->inuse++; | 125 | vma->inuse++; |
| 126 | spin_unlock(&vma->lock); | ||
| 108 | 127 | ||
| 109 | if (vma->mapped) | 128 | if (vma->mapped) |
| 110 | return 0; | 129 | return 0; |
| 111 | 130 | ||
| 112 | vma->mapped = true; | 131 | vma->mapped = true; |
| 113 | 132 | ||
| 114 | if (aspace && aspace->mmu) | 133 | if (!aspace) |
| 115 | ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt, | 134 | return 0; |
| 116 | size, prot); | 135 | |
| 136 | /* | ||
| 137 | * NOTE: iommu/io-pgtable can allocate pages, so we cannot hold | ||
| 138 | * a lock across map/unmap which is also used in the job_run() | ||
| 139 | * path, as this can cause deadlock in job_run() vs shrinker/ | ||
| 140 | * reclaim. | ||
| 141 | * | ||
| 142 | * Revisit this if we can come up with a scheme to pre-alloc pages | ||
| 143 | * for the pgtable in map/unmap ops. | ||
| 144 | */ | ||
| 145 | ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt, size, prot); | ||
| 117 | 146 | ||
| 118 | if (ret) { | 147 | if (ret) { |
| 119 | vma->mapped = false; | 148 | vma->mapped = false; |
| 149 | spin_lock(&vma->lock); | ||
| 120 | vma->inuse--; | 150 | vma->inuse--; |
| 151 | spin_unlock(&vma->lock); | ||
| 121 | } | 152 | } |
| 122 | 153 | ||
| 123 | return ret; | 154 | return ret; |
| 124 | } | 155 | } |
| 125 | 156 | ||
| 126 | /* Close an iova. Warn if it is still in use */ | 157 | /* Close an iova. Warn if it is still in use */ |
| 127 | void msm_gem_close_vma(struct msm_gem_address_space *aspace, | 158 | void msm_gem_vma_close(struct msm_gem_vma *vma) |
| 128 | struct msm_gem_vma *vma) | ||
| 129 | { | 159 | { |
| 160 | struct msm_gem_address_space *aspace = vma->aspace; | ||
| 161 | |||
| 130 | GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped); | 162 | GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped); |
| 131 | 163 | ||
| 132 | spin_lock(&aspace->lock); | 164 | spin_lock(&aspace->lock); |
| @@ -139,13 +171,30 @@ void msm_gem_close_vma(struct msm_gem_address_space *aspace, · 6 unmodified lines | |||
| 139 | msm_gem_address_space_put(aspace); | 171 | msm_gem_address_space_put(aspace); |
| 140 | } | 172 | } |
| 141 | 173 | ||
| 174 | struct msm_gem_vma *msm_gem_vma_new(struct msm_gem_address_space *aspace) | ||
| 175 | { | ||
| 176 | struct msm_gem_vma *vma; | ||
| 177 | |||
| 178 | vma = kzalloc(sizeof(*vma), GFP_KERNEL); | ||
| 179 | if (!vma) | ||
| 180 | return NULL; | ||
| 181 | |||
| 182 | spin_lock_init(&vma->lock); | ||
| 183 | vma->aspace = aspace; | ||
| 184 | |||
| 185 | return vma; | ||
| 186 | } | ||
| 187 | |||
| 142 | /* Initialize a new vma and allocate an iova for it */ | 188 | /* Initialize a new vma and allocate an iova for it */ |
| 143 | int msm_gem_init_vma(struct msm_gem_address_space *aspace, | 189 | int msm_gem_vma_init(struct msm_gem_vma *vma, int size, |
| 144 | struct msm_gem_vma *vma, int size, | ||
| 145 | u64 range_start, u64 range_end) | 190 | u64 range_start, u64 range_end) |
| 146 | { | 191 | { |
| 192 | struct msm_gem_address_space *aspace = vma->aspace; | ||
| 147 | int ret; | 193 | int ret; |
| 148 | 194 | ||
| 195 | if (GEM_WARN_ON(!aspace)) | ||
| 196 | return -EINVAL; | ||
| 197 | |||
| 149 | if (GEM_WARN_ON(vma->iova)) | 198 | if (GEM_WARN_ON(vma->iova)) |
| 150 | return -EBUSY; | 199 | return -EBUSY; |
| 151 | 200 | ||
| @@ -16,7 +16,6 @@ · 15 unmodified lines | |||
| 16 | #include <generated/utsrelease.h> | 16 | #include <generated/utsrelease.h> |
| 17 | #include <linux/string_helpers.h> | 17 | #include <linux/string_helpers.h> |
| 18 | #include <linux/devcoredump.h> | 18 | #include <linux/devcoredump.h> |
| 19 | #include <linux/reset.h> | ||
| 20 | #include <linux/sched/task.h> | 19 | #include <linux/sched/task.h> |
| 21 | 20 | ||
| 22 | /* | 21 | /* |
| @@ -59,7 +58,7 @@ static int disable_pwrrail(struct msm_gpu *gpu) · 36 unmodified lines | |||
| 59 | static int enable_clk(struct msm_gpu *gpu) | 58 | static int enable_clk(struct msm_gpu *gpu) |
| 60 | { | 59 | { |
| 61 | if (gpu->core_clk && gpu->fast_rate) | 60 | if (gpu->core_clk && gpu->fast_rate) |
| 62 | clk_set_rate(gpu->core_clk, gpu->fast_rate); | 61 | dev_pm_opp_set_rate(&gpu->pdev->dev, gpu->fast_rate); |
| 63 | 62 | ||
| 64 | /* Set the RBBM timer rate to 19.2Mhz */ | 63 | /* Set the RBBM timer rate to 19.2Mhz */ |
| 65 | if (gpu->rbbmtimer_clk) | 64 | if (gpu->rbbmtimer_clk) |
| @@ -78,7 +77,7 @@ static int disable_clk(struct msm_gpu *gpu) · 12 unmodified lines | |||
| 78 | * will be rounded down to zero anyway so it all works out. | 77 | * will be rounded down to zero anyway so it all works out. |
| 79 | */ | 78 | */ |
| 80 | if (gpu->core_clk) | 79 | if (gpu->core_clk) |
| 81 | clk_set_rate(gpu->core_clk, 27000000); | 80 | dev_pm_opp_set_rate(&gpu->pdev->dev, 27000000); |
| 82 | 81 | ||
| 83 | if (gpu->rbbmtimer_clk) | 82 | if (gpu->rbbmtimer_clk) |
| 84 | clk_set_rate(gpu->rbbmtimer_clk, 0); | 83 | clk_set_rate(gpu->rbbmtimer_clk, 0); |
| @@ -935,9 +934,6 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, · 850 unmodified lines | |||
| 935 | if (IS_ERR(gpu->gpu_cx)) | 934 | if (IS_ERR(gpu->gpu_cx)) |
| 936 | gpu->gpu_cx = NULL; | 935 | gpu->gpu_cx = NULL; |
| 937 | 936 | ||
| 938 | gpu->cx_collapse = devm_reset_control_get_optional_exclusive(&pdev->dev, | ||
| 939 | "cx_collapse"); | ||
| 940 | |||
| 941 | gpu->pdev = pdev; | 937 | gpu->pdev = pdev; |
| 942 | platform_set_drvdata(pdev, &gpu->adreno_smmu); | 938 | platform_set_drvdata(pdev, &gpu->adreno_smmu); |
| 943 | 939 | ||
| @@ -13,7 +13,6 @@ · 12 unmodified lines | |||
| 13 | #include <linux/interconnect.h> | 13 | #include <linux/interconnect.h> |
| 14 | #include <linux/pm_opp.h> | 14 | #include <linux/pm_opp.h> |
| 15 | #include <linux/regulator/consumer.h> | 15 | #include <linux/regulator/consumer.h> |
| 16 | #include <linux/reset.h> | ||
| 17 | 16 | ||
| 18 | #include "msm_drv.h" | 17 | #include "msm_drv.h" |
| 19 | #include "msm_fence.h" | 18 | #include "msm_fence.h" |
| @@ -50,6 +49,12 @@ struct msm_gpu_funcs { · 30 unmodified lines | |||
| 50 | int (*set_param)(struct msm_gpu *gpu, struct msm_file_private *ctx, | 49 | int (*set_param)(struct msm_gpu *gpu, struct msm_file_private *ctx, |
| 51 | uint32_t param, uint64_t value, uint32_t len); | 50 | uint32_t param, uint64_t value, uint32_t len); |
| 52 | int (*hw_init)(struct msm_gpu *gpu); | 51 | int (*hw_init)(struct msm_gpu *gpu); |
| 52 | |||
| 53 | /** | ||
| 54 | * @ucode_load: Optional hook to upload fw to GEM objs | ||
| 55 | */ | ||
| 56 | int (*ucode_load)(struct msm_gpu *gpu); | ||
| 57 | |||
| 53 | int (*pm_suspend)(struct msm_gpu *gpu); | 58 | int (*pm_suspend)(struct msm_gpu *gpu); |
| 54 | int (*pm_resume)(struct msm_gpu *gpu); | 59 | int (*pm_resume)(struct msm_gpu *gpu); |
| 55 | void (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit); | 60 | void (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit); |
| @@ -281,9 +286,6 @@ struct msm_gpu { · 225 unmodified lines | |||
| 281 | bool hw_apriv; | 286 | bool hw_apriv; |
| 282 | 287 | ||
| 283 | struct thermal_cooling_device *cooling; | 288 | struct thermal_cooling_device *cooling; |
| 284 | |||
| 285 | /* To poll for cx gdsc collapse during gpu recovery */ | ||
| 286 | struct reset_control *cx_collapse; | ||
| 287 | }; | 289 | }; |
| 288 | 290 | ||
| 289 | static inline struct msm_gpu *dev_to_gpu(struct device *dev) | 291 | static inline struct msm_gpu *dev_to_gpu(struct device *dev) |
| @@ -499,7 +501,7 @@ struct msm_gpu_submitqueue { · 209 unmodified lines | |||
| 499 | struct msm_file_private *ctx; | 501 | struct msm_file_private *ctx; |
| 500 | struct list_head node; | 502 | struct list_head node; |
| 501 | struct idr fence_idr; | 503 | struct idr fence_idr; |
| 502 | struct mutex idr_lock; | 504 | struct spinlock idr_lock; |
| 503 | struct mutex lock; | 505 | struct mutex lock; |
| 504 | struct kref ref; | 506 | struct kref ref; |
| 505 | struct drm_sched_entity *entity; | 507 | struct drm_sched_entity *entity; |
| @@ -48,7 +48,7 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, · 47 unmodified lines | |||
| 48 | gpu->funcs->gpu_set_freq(gpu, opp, df->suspended); | 48 | gpu->funcs->gpu_set_freq(gpu, opp, df->suspended); |
| 49 | mutex_unlock(&df->lock); | 49 | mutex_unlock(&df->lock); |
| 50 | } else { | 50 | } else { |
| 51 | clk_set_rate(gpu->core_clk, *freq); | 51 | dev_pm_opp_set_rate(dev, *freq); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | dev_pm_opp_put(opp); | 54 | dev_pm_opp_put(opp); |
| @@ -6,6 +6,7 @@ · 5 unmodified lines | |||
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <linux/interconnect.h> | 8 | #include <linux/interconnect.h> |
| 9 | #include <linux/io.h> | ||
| 9 | 10 | ||
| 10 | #include "msm_drv.h" | 11 | #include "msm_drv.h" |
| 11 | 12 | ||
| @@ -237,13 +237,6 @@ struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent) · 236 unmodified lines | |||
| 237 | if (!ttbr1_cfg) | 237 | if (!ttbr1_cfg) |
| 238 | return ERR_PTR(-ENODEV); | 238 | return ERR_PTR(-ENODEV); |
| 239 | 239 | ||
| 240 | /* | ||
| 241 | * Defer setting the fault handler until we have a valid adreno_smmu | ||
| 242 | * to avoid accidentially installing a GPU specific fault handler for | ||
| 243 | * the display's iommu | ||
| 244 | */ | ||
| 245 | iommu_set_fault_handler(iommu->domain, msm_fault_handler, iommu); | ||
| 246 | |||
| 247 | pagetable = kzalloc(sizeof(*pagetable), GFP_KERNEL); | 240 | pagetable = kzalloc(sizeof(*pagetable), GFP_KERNEL); |
| 248 | if (!pagetable) | 241 | if (!pagetable) |
| 249 | return ERR_PTR(-ENOMEM); | 242 | return ERR_PTR(-ENOMEM); |
| @@ -271,9 +264,6 @@ struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent) · 21 unmodified lines | |||
| 271 | * the arm-smmu driver as a trigger to set up TTBR0 | 264 | * the arm-smmu driver as a trigger to set up TTBR0 |
| 272 | */ | 265 | */ |
| 273 | if (atomic_inc_return(&iommu->pagetables) == 1) { | 266 | if (atomic_inc_return(&iommu->pagetables) == 1) { |
| 274 | /* Enable stall on iommu fault: */ | ||
| 275 | adreno_smmu->set_stall(adreno_smmu->cookie, true); | ||
| 276 | |||
| 277 | ret = adreno_smmu->set_ttbr0_cfg(adreno_smmu->cookie, &ttbr0_cfg); | 267 | ret = adreno_smmu->set_ttbr0_cfg(adreno_smmu->cookie, &ttbr0_cfg); |
| 278 | if (ret) { | 268 | if (ret) { |
| 279 | free_io_pgtable_ops(pagetable->pgtbl_ops); | 269 | free_io_pgtable_ops(pagetable->pgtbl_ops); |
| @@ -302,6 +292,7 @@ static int msm_fault_handler(struct iommu_domain *domain, struct device *dev, · 22 unmodified lines | |||
| 302 | unsigned long iova, int flags, void *arg) | 292 | unsigned long iova, int flags, void *arg) |
| 303 | { | 293 | { |
| 304 | struct msm_iommu *iommu = arg; | 294 | struct msm_iommu *iommu = arg; |
| 295 | struct msm_mmu *mmu = &iommu->base; | ||
| 305 | struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(iommu->base.dev); | 296 | struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(iommu->base.dev); |
| 306 | struct adreno_smmu_fault_info info, *ptr = NULL; | 297 | struct adreno_smmu_fault_info info, *ptr = NULL; |
| 307 | 298 | ||
| @@ -314,6 +305,10 @@ static int msm_fault_handler(struct iommu_domain *domain, struct device *dev, · 6 unmodified lines | |||
| 314 | return iommu->base.handler(iommu->base.arg, iova, flags, ptr); | 305 | return iommu->base.handler(iommu->base.arg, iova, flags, ptr); |
| 315 | 306 | ||
| 316 | pr_warn_ratelimited("*** fault: iova=%16lx, flags=%d\n", iova, flags); | 307 | pr_warn_ratelimited("*** fault: iova=%16lx, flags=%d\n", iova, flags); |
| 308 | |||
| 309 | if (mmu->funcs->resume_translation) | ||
| 310 | mmu->funcs->resume_translation(mmu); | ||
| 311 | |||
| 317 | return 0; | 312 | return 0; |
| 318 | } | 313 | } |
| 319 | 314 | ||
| @@ -321,7 +316,8 @@ static void msm_iommu_resume_translation(struct msm_mmu *mmu) · 1 unmodified line | |||
| 321 | { | 316 | { |
| 322 | struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(mmu->dev); | 317 | struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(mmu->dev); |
| 323 | 318 | ||
| 324 | adreno_smmu->resume_translation(adreno_smmu->cookie, true); | 319 | if (adreno_smmu->resume_translation) |
| 320 | adreno_smmu->resume_translation(adreno_smmu->cookie, true); | ||
| 325 | } | 321 | } |
| 326 | 322 | ||
| 327 | static void msm_iommu_detach(struct msm_mmu *mmu) | 323 | static void msm_iommu_detach(struct msm_mmu *mmu) |
| @@ -406,3 +402,23 @@ struct msm_mmu *msm_iommu_new(struct device *dev, unsigned long quirks) · 78 unmodified lines | |||
| 406 | 402 | ||
| 407 | return &iommu->base; | 403 | return &iommu->base; |
| 408 | } | 404 | } |
| 405 | |||
| 406 | struct msm_mmu *msm_iommu_gpu_new(struct device *dev, struct msm_gpu *gpu, unsigned long quirks) | ||
| 407 | { | ||
| 408 | struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(dev); | ||
| 409 | struct msm_iommu *iommu; | ||
| 410 | struct msm_mmu *mmu; | ||
| 411 | |||
| 412 | mmu = msm_iommu_new(dev, quirks); | ||
| 413 | if (IS_ERR(mmu)) | ||
| 414 | return mmu; | ||
| 415 | |||
| 416 | iommu = to_msm_iommu(mmu); | ||
| 417 | iommu_set_fault_handler(iommu->domain, msm_fault_handler, iommu); | ||
| 418 | |||
| 419 | /* Enable stall on iommu fault: */ | ||
| 420 | if (adreno_smmu->set_stall) | ||
| 421 | adreno_smmu->set_stall(adreno_smmu->cookie, true); | ||
| 422 | |||
| 423 | return mmu; | ||
| 424 | } | ||
| @@ -59,14 +59,6 @@ struct msm_kms_funcs { · 58 unmodified lines | |||
| 59 | void (*enable_commit)(struct msm_kms *kms); | 59 | void (*enable_commit)(struct msm_kms *kms); |
| 60 | void (*disable_commit)(struct msm_kms *kms); | 60 | void (*disable_commit)(struct msm_kms *kms); |
| 61 | 61 | ||
| 62 | /** | ||
| 63 | * If the kms backend supports async commit, it should implement | ||
| 64 | * this method to return the time of the next vsync. This is | ||
| 65 | * used to determine a time slightly before vsync, for the async | ||
| 66 | * commit timer to run and complete an async commit. | ||
| 67 | */ | ||
| 68 | ktime_t (*vsync_time)(struct msm_kms *kms, struct drm_crtc *crtc); | ||
| 69 | |||
| 70 | /** | 62 | /** |
| 71 | * Prepare for atomic commit. This is called after any previous | 63 | * Prepare for atomic commit. This is called after any previous |
| 72 | * (async or otherwise) commit has completed. | 64 | * (async or otherwise) commit has completed. |
| @@ -16,9 +16,6 @@ · 15 unmodified lines | |||
| 16 | #include "msm_drv.h" | 16 | #include "msm_drv.h" |
| 17 | #include "msm_kms.h" | 17 | #include "msm_kms.h" |
| 18 | 18 | ||
| 19 | /* for DPU_HW_* defines */ | ||
| 20 | #include "disp/dpu1/dpu_hw_catalog.h" | ||
| 21 | |||
| 22 | #define HW_REV 0x0 | 19 | #define HW_REV 0x0 |
| 23 | #define HW_INTR_STATUS 0x0010 | 20 | #define HW_INTR_STATUS 0x0010 |
| 24 | 21 | ||
| @@ -29,6 +26,16 @@ · 4 unmodified lines | |||
| 29 | 26 | ||
| 30 | #define MIN_IB_BW 400000000UL /* Min ib vote 400MB */ | 27 | #define MIN_IB_BW 400000000UL /* Min ib vote 400MB */ |
| 31 | 28 | ||
| 29 | struct msm_mdss_data { | ||
| 30 | u32 ubwc_version; | ||
| 31 | /* can be read from register 0x58 */ | ||
| 32 | u32 ubwc_dec_version; | ||
| 33 | u32 ubwc_swizzle; | ||
| 34 | u32 ubwc_static; | ||
| 35 | u32 highest_bank_bit; | ||
| 36 | u32 macrotile_mode; | ||
| 37 | }; | ||
| 38 | |||
| 32 | struct msm_mdss { | 39 | struct msm_mdss { |
| 33 | struct device *dev; | 40 | struct device *dev; |
| 34 | 41 | ||
| @@ -40,6 +47,7 @@ struct msm_mdss { · 5 unmodified lines | |||
| 40 | unsigned long enabled_mask; | 47 | unsigned long enabled_mask; |
| 41 | struct irq_domain *domain; | 48 | struct irq_domain *domain; |
| 42 | } irq_controller; | 49 | } irq_controller; |
| 50 | const struct msm_mdss_data *mdss_data; | ||
| 43 | struct icc_path *path[2]; | 51 | struct icc_path *path[2]; |
| 44 | u32 num_paths; | 52 | u32 num_paths; |
| 45 | }; | 53 | }; |
| @@ -182,46 +190,40 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss) · 136 unmodified lines | |||
| 182 | #define UBWC_3_0 0x30000000 | 190 | #define UBWC_3_0 0x30000000 |
| 183 | #define UBWC_4_0 0x40000000 | 191 | #define UBWC_4_0 0x40000000 |
| 184 | 192 | ||
| 185 | static void msm_mdss_setup_ubwc_dec_20(struct msm_mdss *msm_mdss, | 193 | static void msm_mdss_setup_ubwc_dec_20(struct msm_mdss *msm_mdss) |
| 186 | u32 ubwc_static) | ||
| 187 | { | 194 | { |
| 188 | writel_relaxed(ubwc_static, msm_mdss->mmio + UBWC_STATIC); | 195 | const struct msm_mdss_data *data = msm_mdss->mdss_data; |
| 196 | |||
| 197 | writel_relaxed(data->ubwc_static, msm_mdss->mmio + UBWC_STATIC); | ||
| 189 | } | 198 | } |
| 190 | 199 | ||
| 191 | static void msm_mdss_setup_ubwc_dec_30(struct msm_mdss *msm_mdss, | 200 | static void msm_mdss_setup_ubwc_dec_30(struct msm_mdss *msm_mdss) |
| 192 | unsigned int ubwc_version, | ||
| 193 | u32 ubwc_swizzle, | ||
| 194 | u32 highest_bank_bit, | ||
| 195 | u32 macrotile_mode) | ||
| 196 | { | 201 | { |
| 197 | u32 value = (ubwc_swizzle & 0x1) | | 202 | const struct msm_mdss_data *data = msm_mdss->mdss_data; |
| 198 | (highest_bank_bit & 0x3) << 4 | | 203 | u32 value = (data->ubwc_swizzle & 0x1) | |
| 199 | (macrotile_mode & 0x1) << 12; | 204 | (data->highest_bank_bit & 0x3) << 4 | |
| 205 | (data->macrotile_mode & 0x1) << 12; | ||
| 200 | 206 | ||
| 201 | if (ubwc_version == UBWC_3_0) | 207 | if (data->ubwc_version == UBWC_3_0) |
| 202 | value |= BIT(10); | 208 | value |= BIT(10); |
| 203 | 209 | ||
| 204 | if (ubwc_version == UBWC_1_0) | 210 | if (data->ubwc_version == UBWC_1_0) |
| 205 | value |= BIT(8); | 211 | value |= BIT(8); |
| 206 | 212 | ||
| 207 | writel_relaxed(value, msm_mdss->mmio + UBWC_STATIC); | 213 | writel_relaxed(value, msm_mdss->mmio + UBWC_STATIC); |
| 208 | } | 214 | } |
| 209 | 215 | ||
| 210 | static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss, | 216 | static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss) |
| 211 | unsigned int ubwc_version, | ||
| 212 | u32 ubwc_swizzle, | ||
| 213 | u32 ubwc_static, | ||
| 214 | u32 highest_bank_bit, | ||
| 215 | u32 macrotile_mode) | ||
| 216 | { | 217 | { |
| 217 | u32 value = (ubwc_swizzle & 0x7) | | 218 | const struct msm_mdss_data *data = msm_mdss->mdss_data; |
| 218 | (ubwc_static & 0x1) << 3 | | 219 | u32 value = (data->ubwc_swizzle & 0x7) | |
| 219 | (highest_bank_bit & 0x7) << 4 | | 220 | (data->ubwc_static & 0x1) << 3 | |
| 220 | (macrotile_mode & 0x1) << 12; | 221 | (data->highest_bank_bit & 0x7) << 4 | |
| 222 | (data->macrotile_mode & 0x1) << 12; | ||
| 221 | 223 | ||
| 222 | writel_relaxed(value, msm_mdss->mmio + UBWC_STATIC); | 224 | writel_relaxed(value, msm_mdss->mmio + UBWC_STATIC); |
| 223 | 225 | ||
| 224 | if (ubwc_version == UBWC_3_0) { | 226 | if (data->ubwc_version == UBWC_3_0) { |
| 225 | writel_relaxed(1, msm_mdss->mmio + UBWC_CTRL_2); | 227 | writel_relaxed(1, msm_mdss->mmio + UBWC_CTRL_2); |
| 226 | writel_relaxed(0, msm_mdss->mmio + UBWC_PREDICTION_MODE); | 228 | writel_relaxed(0, msm_mdss->mmio + UBWC_PREDICTION_MODE); |
| 227 | } else { | 229 | } else { |
| @@ -233,7 +235,6 @@ static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss, · 5 unmodified lines | |||
| 233 | static int msm_mdss_enable(struct msm_mdss *msm_mdss) | 235 | static int msm_mdss_enable(struct msm_mdss *msm_mdss) |
| 234 | { | 236 | { |
| 235 | int ret; | 237 | int ret; |
| 236 | u32 hw_rev; | ||
| 237 | 238 | ||
| 238 | /* | 239 | /* |
| 239 | * Several components have AXI clocks that can only be turned on if | 240 | * Several components have AXI clocks that can only be turned on if |
| @@ -249,57 +250,36 @@ static int msm_mdss_enable(struct msm_mdss *msm_mdss) · 9 unmodified lines | |||
| 249 | } | 250 | } |
| 250 | 251 | ||
| 251 | /* | 252 | /* |
| 252 | * HW_REV requires MDSS_MDP_CLK, which is not enabled by the mdss on | 253 | * Register access requires MDSS_MDP_CLK, which is not enabled by the |
| 253 | * mdp5 hardware. Skip reading it for now. | 254 | * mdss on mdp5 hardware. Skip it for now. |
| 254 | */ | 255 | */ |
| 255 | if (msm_mdss->is_mdp5) | 256 | if (msm_mdss->is_mdp5 || !msm_mdss->mdss_data) |
| 256 | return 0; | 257 | return 0; |
| 257 | 258 | ||
| 258 | hw_rev = readl_relaxed(msm_mdss->mmio + HW_REV); | ||
| 259 | dev_dbg(msm_mdss->dev, "HW_REV: 0x%x\n", hw_rev); | ||
| 260 | dev_dbg(msm_mdss->dev, "UBWC_DEC_HW_VERSION: 0x%x\n", | ||
| 261 | readl_relaxed(msm_mdss->mmio + UBWC_DEC_HW_VERSION)); | ||
| 262 | |||
| 263 | /* | 259 | /* |
| 264 | * ubwc config is part of the "mdss" region which is not accessible | 260 | * ubwc config is part of the "mdss" region which is not accessible |
| 265 | * from the rest of the driver. hardcode known configurations here | 261 | * from the rest of the driver. hardcode known configurations here |
| 266 | * | 262 | * |
| 267 | * Decoder version can be read from the UBWC_DEC_HW_VERSION reg, | 263 | * Decoder version can be read from the UBWC_DEC_HW_VERSION reg, |
| 268 | * UBWC_n and the rest of params comes from hw_catalog. | 264 | * UBWC_n and the rest of params comes from hw data. |
| 269 | * Unforunately this driver can not access hw catalog, so we have to | ||
| 270 | * hardcode them here. | ||
| 271 | */ | 265 | */ |
| 272 | switch (hw_rev) { | 266 | switch (msm_mdss->mdss_data->ubwc_dec_version) { |
| 273 | case DPU_HW_VER_500: | 267 | case UBWC_2_0: |
| 274 | case DPU_HW_VER_501: | 268 | msm_mdss_setup_ubwc_dec_20(msm_mdss); |
| 275 | msm_mdss_setup_ubwc_dec_30(msm_mdss, UBWC_3_0, 0, 2, 0); | ||
| 276 | break; | ||
| 277 | case DPU_HW_VER_600: | ||
| 278 | /* TODO: highest_bank_bit = 2 for LP_DDR4 */ | ||
| 279 | msm_mdss_setup_ubwc_dec_40(msm_mdss, UBWC_4_0, 6, 1, 3, 1); | ||
| 280 | break; | ||
| 281 | case DPU_HW_VER_620: | ||
| 282 | /* UBWC_2_0 */ | ||
| 283 | msm_mdss_setup_ubwc_dec_20(msm_mdss, 0x1e); | ||
| 284 | break; | 269 | break; |
| 285 | case DPU_HW_VER_630: | 270 | case UBWC_3_0: |
| 286 | /* UBWC_2_0 */ | 271 | msm_mdss_setup_ubwc_dec_30(msm_mdss); |
| 287 | msm_mdss_setup_ubwc_dec_20(msm_mdss, 0x11f); | ||
| 288 | break; | 272 | break; |
| 289 | case DPU_HW_VER_700: | 273 | case UBWC_4_0: |
| 290 | /* TODO: highest_bank_bit = 2 for LP_DDR4 */ | 274 | msm_mdss_setup_ubwc_dec_40(msm_mdss); |
| 291 | msm_mdss_setup_ubwc_dec_40(msm_mdss, UBWC_4_0, 6, 1, 3, 1); | ||
| 292 | break; | 275 | break; |
| 293 | case DPU_HW_VER_720: | 276 | default: |
| 294 | msm_mdss_setup_ubwc_dec_40(msm_mdss, UBWC_3_0, 6, 1, 1, 1); | 277 | dev_err(msm_mdss->dev, "Unsupported UBWC decoder version %x\n", |
| 295 | break; | 278 | msm_mdss->mdss_data->ubwc_dec_version); |
| 296 | case DPU_HW_VER_800: | 279 | dev_err(msm_mdss->dev, "HW_REV: 0x%x\n", |
| 297 | msm_mdss_setup_ubwc_dec_40(msm_mdss, UBWC_4_0, 6, 1, 2, 1); | 280 | readl_relaxed(msm_mdss->mmio + HW_REV)); |
| 298 | break; | 281 | dev_err(msm_mdss->dev, "UBWC_DEC_HW_VERSION: 0x%x\n", |
| 299 | case DPU_HW_VER_810: | 282 | readl_relaxed(msm_mdss->mmio + UBWC_DEC_HW_VERSION)); |
| 300 | case DPU_HW_VER_900: | ||
| 301 | /* TODO: highest_bank_bit = 2 for LP_DDR4 */ | ||
| 302 | msm_mdss_setup_ubwc_dec_40(msm_mdss, UBWC_4_0, 6, 1, 3, 1); | ||
| 303 | break; | 283 | break; |
| 304 | } | 284 | } |
| 305 | 285 | ||
| @@ -490,6 +470,8 @@ static int mdss_probe(struct platform_device *pdev) · 184 unmodified lines | |||
| 490 | if (IS_ERR(mdss)) | 470 | if (IS_ERR(mdss)) |
| 491 | return PTR_ERR(mdss); | 471 | return PTR_ERR(mdss); |
| 492 | 472 | ||
| 473 | mdss->mdss_data = of_device_get_match_data(&pdev->dev); | ||
| 474 | |||
| 493 | platform_set_drvdata(pdev, mdss); | 475 | platform_set_drvdata(pdev, mdss); |
| 494 | 476 | ||
| 495 | /* | 477 | /* |
| @@ -519,21 +501,81 @@ static int mdss_remove(struct platform_device *pdev) · 23 unmodified lines | |||
| 519 | return 0; | 501 | return 0; |
| 520 | } | 502 | } |
| 521 | 503 | ||
| 504 | static const struct msm_mdss_data sc7180_data = { | ||
| 505 | .ubwc_version = UBWC_2_0, | ||
| 506 | .ubwc_dec_version = UBWC_2_0, | ||
| 507 | .ubwc_static = 0x1e, | ||
| 508 | }; | ||
| 509 | |||
| 510 | static const struct msm_mdss_data sc7280_data = { | ||
| 511 | .ubwc_version = UBWC_3_0, | ||
| 512 | .ubwc_dec_version = UBWC_4_0, | ||
| 513 | .ubwc_swizzle = 6, | ||
| 514 | .ubwc_static = 1, | ||
| 515 | .highest_bank_bit = 1, | ||
| 516 | .macrotile_mode = 1, | ||
| 517 | }; | ||
| 518 | |||
| 519 | static const struct msm_mdss_data sc8180x_data = { | ||
| 520 | .ubwc_version = UBWC_3_0, | ||
| 521 | .ubwc_dec_version = UBWC_3_0, | ||
| 522 | .highest_bank_bit = 3, | ||
| 523 | .macrotile_mode = 1, | ||
| 524 | }; | ||
| 525 | |||
| 526 | static const struct msm_mdss_data sc8280xp_data = { | ||
| 527 | .ubwc_version = UBWC_4_0, | ||
| 528 | .ubwc_dec_version = UBWC_4_0, | ||
| 529 | .ubwc_swizzle = 6, | ||
| 530 | .ubwc_static = 1, | ||
| 531 | .highest_bank_bit = 2, | ||
| 532 | .macrotile_mode = 1, | ||
| 533 | }; | ||
| 534 | |||
| 535 | static const struct msm_mdss_data sdm845_data = { | ||
| 536 | .ubwc_version = UBWC_2_0, | ||
| 537 | .ubwc_dec_version = UBWC_2_0, | ||
| 538 | .highest_bank_bit = 2, | ||
| 539 | }; | ||
| 540 | |||
| 541 | static const struct msm_mdss_data sm8150_data = { | ||
| 542 | .ubwc_version = UBWC_3_0, | ||
| 543 | .ubwc_dec_version = UBWC_3_0, | ||
| 544 | .highest_bank_bit = 2, | ||
| 545 | }; | ||
| 546 | |||
| 547 | static const struct msm_mdss_data sm6115_data = { | ||
| 548 | .ubwc_version = UBWC_1_0, | ||
| 549 | .ubwc_dec_version = UBWC_2_0, | ||
| 550 | .ubwc_swizzle = 7, | ||
| 551 | .ubwc_static = 0x11f, | ||
| 552 | }; | ||
| 553 | |||
| 554 | static const struct msm_mdss_data sm8250_data = { | ||
| 555 | .ubwc_version = UBWC_4_0, | ||
| 556 | .ubwc_dec_version = UBWC_4_0, | ||
| 557 | .ubwc_swizzle = 6, | ||
| 558 | .ubwc_static = 1, | ||
| 559 | /* TODO: highest_bank_bit = 2 for LP_DDR4 */ | ||
| 560 | .highest_bank_bit = 3, | ||
| 561 | .macrotile_mode = 1, | ||
| 562 | }; | ||
| 563 | |||
| 522 | static const struct of_device_id mdss_dt_match[] = { | 564 | static const struct of_device_id mdss_dt_match[] = { |
| 523 | { .compatible = "qcom,mdss" }, | 565 | { .compatible = "qcom,mdss" }, |
| 524 | { .compatible = "qcom,msm8998-mdss" }, | 566 | { .compatible = "qcom,msm8998-mdss" }, |
| 525 | { .compatible = "qcom,qcm2290-mdss" }, | 567 | { .compatible = "qcom,qcm2290-mdss" }, |
| 526 | { .compatible = "qcom,sdm845-mdss" }, | 568 | { .compatible = "qcom,sdm845-mdss", .data = &sdm845_data }, |
| 527 | { .compatible = "qcom,sc7180-mdss" }, | 569 | { .compatible = "qcom,sc7180-mdss", .data = &sc7180_data }, |
| 528 | { .compatible = "qcom,sc7280-mdss" }, | 570 | { .compatible = "qcom,sc7280-mdss", .data = &sc7280_data }, |
| 529 | { .compatible = "qcom,sc8180x-mdss" }, | 571 | { .compatible = "qcom,sc8180x-mdss", .data = &sc8180x_data }, |
| 530 | { .compatible = "qcom,sc8280xp-mdss" }, | 572 | { .compatible = "qcom,sc8280xp-mdss", .data = &sc8280xp_data }, |
| 531 | { .compatible = "qcom,sm6115-mdss" }, | 573 | { .compatible = "qcom,sm6115-mdss", .data = &sm6115_data }, |
| 532 | { .compatible = "qcom,sm8150-mdss" }, | 574 | { .compatible = "qcom,sm8150-mdss", .data = &sm8150_data }, |
| 533 | { .compatible = "qcom,sm8250-mdss" }, | 575 | { .compatible = "qcom,sm8250-mdss", .data = &sm8250_data }, |
| 534 | { .compatible = "qcom,sm8350-mdss" }, | 576 | { .compatible = "qcom,sm8350-mdss", .data = &sm8250_data }, |
| 535 | { .compatible = "qcom,sm8450-mdss" }, | 577 | { .compatible = "qcom,sm8450-mdss", .data = &sm8250_data }, |
| 536 | { .compatible = "qcom,sm8550-mdss" }, | 578 | { .compatible = "qcom,sm8550-mdss", .data = &sm8250_data }, |
| 537 | {} | 579 | {} |
| 538 | }; | 580 | }; |
| 539 | MODULE_DEVICE_TABLE(of, mdss_dt_match); | 581 | MODULE_DEVICE_TABLE(of, mdss_dt_match); |
| @@ -41,6 +41,7 @@ static inline void msm_mmu_init(struct msm_mmu *mmu, struct device *dev, · 40 unmodified lines | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | struct msm_mmu *msm_iommu_new(struct device *dev, unsigned long quirks); | 43 | struct msm_mmu *msm_iommu_new(struct device *dev, unsigned long quirks); |
| 44 | struct msm_mmu *msm_iommu_gpu_new(struct device *dev, struct msm_gpu *gpu, unsigned long quirks); | ||
| 44 | struct msm_mmu *msm_gpummu_new(struct device *dev, struct msm_gpu *gpu); | 45 | struct msm_mmu *msm_gpummu_new(struct device *dev, struct msm_gpu *gpu); |
| 45 | 46 | ||
| 46 | static inline void msm_mmu_set_fault_handler(struct msm_mmu *mmu, void *arg, | 47 | static inline void msm_mmu_set_fault_handler(struct msm_mmu *mmu, void *arg, |
| @@ -18,16 +18,14 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job) · 17 unmodified lines | |||
| 18 | struct msm_gpu *gpu = submit->gpu; | 18 | struct msm_gpu *gpu = submit->gpu; |
| 19 | int i; | 19 | int i; |
| 20 | 20 | ||
| 21 | submit->hw_fence = msm_fence_alloc(fctx); | 21 | msm_fence_init(submit->hw_fence, fctx); |
| 22 | 22 | ||
| 23 | for (i = 0; i < submit->nr_bos; i++) { | 23 | for (i = 0; i < submit->nr_bos; i++) { |
| 24 | struct drm_gem_object *obj = &submit->bos[i].obj->base; | 24 | struct drm_gem_object *obj = &submit->bos[i].obj->base; |
| 25 | 25 | ||
| 26 | msm_gem_lock(obj); | 26 | msm_gem_vma_unpin_fenced(submit->bos[i].vma, fctx); |
| 27 | msm_gem_unpin_vma_fenced(submit->bos[i].vma, fctx); | 27 | msm_gem_unpin_active(obj); |
| 28 | msm_gem_unpin_locked(obj); | ||
| 29 | submit->bos[i].flags &= ~(BO_VMA_PINNED | BO_OBJ_PINNED); | 28 | submit->bos[i].flags &= ~(BO_VMA_PINNED | BO_OBJ_PINNED); |
| 30 | msm_gem_unlock(obj); | ||
| 31 | } | 29 | } |
| 32 | 30 | ||
| 33 | /* TODO move submit path over to using a per-ring lock.. */ | 31 | /* TODO move submit path over to using a per-ring lock.. */ |
| @@ -200,7 +200,7 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx, · 199 unmodified lines | |||
| 200 | *id = queue->id; | 200 | *id = queue->id; |
| 201 | 201 | ||
| 202 | idr_init(&queue->fence_idr); | 202 | idr_init(&queue->fence_idr); |
| 203 | mutex_init(&queue->idr_lock); | 203 | spin_lock_init(&queue->idr_lock); |
| 204 | mutex_init(&queue->lock); | 204 | mutex_init(&queue->lock); |
| 205 | 205 | ||
| 206 | list_add_tail(&queue->node, &ctx->submitqueues); | 206 | list_add_tail(&queue->node, &ctx->submitqueues); |
| @@ -528,6 +528,13 @@ struct drm_connector * · 527 unmodified lines | |||
| 528 | drm_atomic_get_new_connector_for_encoder(const struct drm_atomic_state *state, | 528 | drm_atomic_get_new_connector_for_encoder(const struct drm_atomic_state *state, |
| 529 | struct drm_encoder *encoder); | 529 | struct drm_encoder *encoder); |
| 530 | 530 | ||
| 531 | struct drm_crtc * | ||
| 532 | drm_atomic_get_old_crtc_for_encoder(struct drm_atomic_state *state, | ||
| 533 | struct drm_encoder *encoder); | ||
| 534 | struct drm_crtc * | ||
| 535 | drm_atomic_get_new_crtc_for_encoder(struct drm_atomic_state *state, | ||
| 536 | struct drm_encoder *encoder); | ||
| 537 | |||
| 531 | /** | 538 | /** |
| 532 | * drm_atomic_get_existing_crtc_state - get CRTC state, if it exists | 539 | * drm_atomic_get_existing_crtc_state - get CRTC state, if it exists |
| 533 | * @state: global atomic state object | 540 | * @state: global atomic state object |
| @@ -485,6 +485,7 @@ int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, · 484 unmodified lines | |||
| 485 | 485 | ||
| 486 | void drm_gem_lru_init(struct drm_gem_lru *lru, struct mutex *lock); | 486 | void drm_gem_lru_init(struct drm_gem_lru *lru, struct mutex *lock); |
| 487 | void drm_gem_lru_remove(struct drm_gem_object *obj); | 487 | void drm_gem_lru_remove(struct drm_gem_object *obj); |
| 488 | void drm_gem_lru_move_tail_locked(struct drm_gem_lru *lru, struct drm_gem_object *obj); | ||
| 488 | void drm_gem_lru_move_tail(struct drm_gem_lru *lru, struct drm_gem_object *obj); | 489 | void drm_gem_lru_move_tail(struct drm_gem_lru *lru, struct drm_gem_object *obj); |
| 489 | unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru, | 490 | unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru, |
| 490 | unsigned int nr_to_scan, | 491 | unsigned int nr_to_scan, |
| @@ -151,8 +151,13 @@ struct drm_msm_gem_info { · 150 unmodified lines | |||
| 151 | #define MSM_PREP_READ 0x01 | 151 | #define MSM_PREP_READ 0x01 |
| 152 | #define MSM_PREP_WRITE 0x02 | 152 | #define MSM_PREP_WRITE 0x02 |
| 153 | #define MSM_PREP_NOSYNC 0x04 | 153 | #define MSM_PREP_NOSYNC 0x04 |
| 154 | #define MSM_PREP_BOOST 0x08 | ||
| 154 | 155 | ||
| 155 | #define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC) | 156 | #define MSM_PREP_FLAGS (MSM_PREP_READ | \ |
| 157 | MSM_PREP_WRITE | \ | ||
| 158 | MSM_PREP_NOSYNC | \ | ||
| 159 | MSM_PREP_BOOST | \ | ||
| 160 | 0) | ||
| 156 | 161 | ||
| 157 | struct drm_msm_gem_cpu_prep { | 162 | struct drm_msm_gem_cpu_prep { |
| 158 | __u32 handle; /* in */ | 163 | __u32 handle; /* in */ |
| @@ -181,7 +186,11 @@ struct drm_msm_gem_cpu_fini { · 22 unmodified lines | |||
| 181 | */ | 186 | */ |
| 182 | struct drm_msm_gem_submit_reloc { | 187 | struct drm_msm_gem_submit_reloc { |
| 183 | __u32 submit_offset; /* in, offset from submit_bo */ | 188 | __u32 submit_offset; /* in, offset from submit_bo */ |
| 189 | #ifdef __cplusplus | ||
| 190 | __u32 _or; /* in, value OR'd with result */ | ||
| 191 | #else | ||
| 184 | __u32 or; /* in, value OR'd with result */ | 192 | __u32 or; /* in, value OR'd with result */ |
| 193 | #endif | ||
| 185 | __s32 shift; /* in, amount of left shift (can be negative) */ | 194 | __s32 shift; /* in, amount of left shift (can be negative) */ |
| 186 | __u32 reloc_idx; /* in, index of reloc_bo buffer */ | 195 | __u32 reloc_idx; /* in, index of reloc_bo buffer */ |
| 187 | __u64 reloc_offset; /* in, offset from start of reloc_bo */ | 196 | __u64 reloc_offset; /* in, offset from start of reloc_bo */ |
| @@ -286,6 +295,11 @@ struct drm_msm_gem_submit { · 98 unmodified lines | |||
| 286 | 295 | ||
| 287 | }; | 296 | }; |
| 288 | 297 | ||
| 298 | #define MSM_WAIT_FENCE_BOOST 0x00000001 | ||
| 299 | #define MSM_WAIT_FENCE_FLAGS ( \ | ||
| 300 | MSM_WAIT_FENCE_BOOST | \ | ||
| 301 | 0) | ||
| 302 | |||
| 289 | /* The normal way to synchronize with the GPU is just to CPU_PREP on | 303 | /* The normal way to synchronize with the GPU is just to CPU_PREP on |
| 290 | * a buffer if you need to access it from the CPU (other cmdstream | 304 | * a buffer if you need to access it from the CPU (other cmdstream |
| 291 | * submission from same or other contexts, PAGE_FLIP ioctl, etc, all | 305 | * submission from same or other contexts, PAGE_FLIP ioctl, etc, all |
| @@ -295,7 +309,7 @@ struct drm_msm_gem_submit { · 3 unmodified lines | |||
| 295 | */ | 309 | */ |
| 296 | struct drm_msm_wait_fence { | 310 | struct drm_msm_wait_fence { |
| 297 | __u32 fence; /* in */ | 311 | __u32 fence; /* in */ |
| 298 | __u32 pad; | 312 | __u32 flags; /* in, bitmask of MSM_WAIT_FENCE_x */ |
| 299 | struct drm_msm_timespec timeout; /* in */ | 313 | struct drm_msm_timespec timeout; /* in */ |
| 300 | __u32 queueid; /* in, submitqueue id */ | 314 | __u32 queueid; /* in, submitqueue id */ |
| 301 | }; | 315 | }; |