History

Merge tag 'drm-msm-next-2023-04-10' of https://gitlab.freedesktop.org/drm/msm into drm-next

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.

Daniel Vetter committed 3 years ago

Commit b8d85bb2 parents 838ac90 ac7e7c9122 files · +7037 −4526Browse files

Unified · Split

122 files
  1. Documentation/devicetree/bindings/display/msm/dp-controller.yaml +15 −10
  2. Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml +5 −4
  3. Documentation/devicetree/bindings/display/msm/qcom,sm6115-mdss.yaml +8 −2
  4. Documentation/devicetree/bindings/display/msm/qcom,sm8450-mdss.yaml +3 −3
  5. Documentation/devicetree/bindings/display/msm/qcom,sm8550-dpu.yaml +133 −0
  6. Documentation/devicetree/bindings/display/msm/qcom,sm8550-mdss.yaml +333 −0
  7. MAINTAINERS +1 −0
  8. drivers/gpu/drm/bridge/panel.c +60 −8
  9. drivers/gpu/drm/drm_atomic.c +60 −0
  10. drivers/gpu/drm/drm_gem.c +10 −1
  11. drivers/gpu/drm/msm/Kconfig +2 −0
  12. drivers/gpu/drm/msm/adreno/a2xx.xml.h +39 −15
  13. drivers/gpu/drm/msm/adreno/a3xx.xml.h +15 −15
  14. drivers/gpu/drm/msm/adreno/a3xx_gpu.c +11 −0
  15. drivers/gpu/drm/msm/adreno/a4xx.xml.h +25 −13
  16. drivers/gpu/drm/msm/adreno/a4xx_gpu.c +11 −0
  17. drivers/gpu/drm/msm/adreno/a5xx.xml.h +25 −19
  18. drivers/gpu/drm/msm/adreno/a5xx_gpu.c +39 −30
  19. drivers/gpu/drm/msm/adreno/a6xx.xml.h +625 −170
  20. drivers/gpu/drm/msm/adreno/a6xx_gmu.c +50 −14
  21. drivers/gpu/drm/msm/adreno/a6xx_gmu.h +7 −0
  22. drivers/gpu/drm/msm/adreno/a6xx_gmu.xml.h +15 −15
  23. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +83 −100
  24. drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +1 −1
  25. drivers/gpu/drm/msm/adreno/adreno_common.xml.h +32 −20
  26. drivers/gpu/drm/msm/adreno/adreno_device.c +24 −9
  27. drivers/gpu/drm/msm/adreno/adreno_gpu.c +110 −64
  28. drivers/gpu/drm/msm/adreno/adreno_gpu.h +4 −0
  29. drivers/gpu/drm/msm/adreno/adreno_pm4.xml.h +97 −18
  30. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_3_0_msm8998.h +210 −0
  31. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_4_0_sdm845.h +210 −0
  32. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h +237 −0
  33. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h +217 −0
  34. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h +244 −0
  35. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h +156 −0
  36. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_3_sm6115.h +129 −0
  37. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_5_qcm2290.h +119 −0
  38. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h +226 −0
  39. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h +158 −0
  40. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h +222 −0
  41. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_1_sm8450.h +234 −0
  42. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h +239 −0
  43. drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +116 −221
  44. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +36 −45
  45. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h +0 −7
  46. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +5 −3
  47. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +22 −0
  48. drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c +12 −9
  49. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +40 −2115
  50. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +39 −67
  51. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +45 −4
  52. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h +4 −1
  53. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c +2 −2
  54. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +7 −1
  55. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +98 −89
  56. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +53 −62
  57. drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +39 −59
  58. drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h +0 −1
  59. drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +429 −438
  60. drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h +8 −32
  61. drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +22 −0
  62. drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h +12 −0
  63. drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h +9 −10
  64. drivers/gpu/drm/msm/disp/mdp4/mdp4.xml.h +20 −20
  65. drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +0 −5
  66. drivers/gpu/drm/msm/disp/mdp5/mdp5.xml.h +20 −20
  67. drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c +1 −1
  68. drivers/gpu/drm/msm/disp/mdp_common.xml.h +20 −20
  69. drivers/gpu/drm/msm/disp/msm_disp_snapshot.c +0 −3
  70. drivers/gpu/drm/msm/dp/dp_aux.c +40 −50
  71. drivers/gpu/drm/msm/dp/dp_aux.h +1 −1
  72. drivers/gpu/drm/msm/dp/dp_catalog.c +81 −1
  73. drivers/gpu/drm/msm/dp/dp_catalog.h +5 −1
  74. drivers/gpu/drm/msm/dp/dp_ctrl.c +88 −2
  75. drivers/gpu/drm/msm/dp/dp_ctrl.h +4 −1
  76. drivers/gpu/drm/msm/dp/dp_display.c +30 −14
  77. drivers/gpu/drm/msm/dp/dp_display.h +2 −0
  78. drivers/gpu/drm/msm/dp/dp_drm.c +169 −4
  79. drivers/gpu/drm/msm/dp/dp_drm.h +6 −3
  80. drivers/gpu/drm/msm/dp/dp_link.c +36 −0
  81. drivers/gpu/drm/msm/dp/dp_panel.c +22 −0
  82. drivers/gpu/drm/msm/dp/dp_panel.h +6 −0
  83. drivers/gpu/drm/msm/dp/dp_reg.h +27 −0
  84. drivers/gpu/drm/msm/dsi/dsi.c +4 −3
  85. drivers/gpu/drm/msm/dsi/dsi.xml.h +21 −20
  86. drivers/gpu/drm/msm/dsi/dsi_cfg.c +57 −104
  87. drivers/gpu/drm/msm/dsi/dsi_cfg.h +4 −5
  88. drivers/gpu/drm/msm/dsi/dsi_host.c +5 −9
  89. drivers/gpu/drm/msm/dsi/dsi_phy_10nm.xml.h +20 −20
  90. drivers/gpu/drm/msm/dsi/dsi_phy_14nm.xml.h +20 −20
  91. drivers/gpu/drm/msm/dsi/dsi_phy_20nm.xml.h +20 −20
  92. drivers/gpu/drm/msm/dsi/dsi_phy_28nm.xml.h +20 −20
  93. drivers/gpu/drm/msm/dsi/dsi_phy_28nm_8960.xml.h +20 −20
  94. drivers/gpu/drm/msm/dsi/dsi_phy_7nm.xml.h +18 −18
  95. drivers/gpu/drm/msm/dsi/mmss_cc.xml.h +20 −20
  96. drivers/gpu/drm/msm/dsi/sfpb.xml.h +19 −19
  97. drivers/gpu/drm/msm/hdmi/hdmi.xml.h +42 −20
  98. drivers/gpu/drm/msm/hdmi/qfprom.xml.h +20 −20
  99. drivers/gpu/drm/msm/msm_atomic.c +25 −4
  100. drivers/gpu/drm/msm/msm_debugfs.c +3 −3
  101. drivers/gpu/drm/msm/msm_drv.c +62 −47
  102. drivers/gpu/drm/msm/msm_drv.h +9 −6
  103. drivers/gpu/drm/msm/msm_fbdev.c +105 −68
  104. drivers/gpu/drm/msm/msm_fence.c +83 −3
  105. drivers/gpu/drm/msm/msm_fence.h +22 −1
  106. drivers/gpu/drm/msm/msm_gem.c +102 −48
  107. drivers/gpu/drm/msm/msm_gem.h +17 −12
  108. drivers/gpu/drm/msm/msm_gem_submit.c +22 −15
  109. drivers/gpu/drm/msm/msm_gem_vma.c +70 −21
  110. drivers/gpu/drm/msm/msm_gpu.c +2 −6
  111. drivers/gpu/drm/msm/msm_gpu.h +7 −5
  112. drivers/gpu/drm/msm/msm_gpu_devfreq.c +1 −1
  113. drivers/gpu/drm/msm/msm_io_utils.c +1 −0
  114. drivers/gpu/drm/msm/msm_iommu.c +27 −11
  115. drivers/gpu/drm/msm/msm_kms.h +0 −8
  116. drivers/gpu/drm/msm/msm_mdss.c +120 −78
  117. drivers/gpu/drm/msm/msm_mmu.h +1 −0
  118. drivers/gpu/drm/msm/msm_ringbuffer.c +3 −5
  119. drivers/gpu/drm/msm/msm_submitqueue.c +1 −1
  120. include/drm/drm_atomic.h +7 −0
  121. include/drm/drm_gem.h +1 −0
  122. include/uapi/drm/msm_drm.h +16 −2
Documentation/devicetree/bindings/display/msm/dp-controller.yaml+15−10
@@ -15,16 +15,21 @@ description: | · 14 unmodified lines
1515
1616 properties:
1717 compatible:
18− enum:
19− - qcom,sc7180-dp
20− - qcom,sc7280-dp
21− - qcom,sc7280-edp
22− - qcom,sc8180x-dp
23− - qcom,sc8180x-edp
24− - qcom,sc8280xp-dp
25− - qcom,sc8280xp-edp
26− - qcom,sdm845-dp
27− - qcom,sm8350-dp
18+ oneOf:
19+ - enum:
20+ - qcom,sc7180-dp
21+ - qcom,sc7280-dp
22+ - qcom,sc7280-edp
23+ - qcom,sc8180x-dp
24+ - qcom,sc8180x-edp
25+ - qcom,sc8280xp-dp
26+ - qcom,sc8280xp-edp
27+ - qcom,sdm845-dp
28+ - qcom,sm8350-dp
29+ - items:
30+ - enum:
31+ - qcom,sm8450-dp
32+ - const: qcom,sm8350-dp
2833
2934 reg:
3035 minItems: 4
Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml+5−4
@@ -25,16 +25,16 @@ properties: · 24 unmodified lines
2525 - qcom,sc7280-dsi-ctrl
2626 - qcom,sdm660-dsi-ctrl
2727 - qcom,sdm845-dsi-ctrl
28+ - qcom,sm6115-dsi-ctrl
2829 - qcom,sm8150-dsi-ctrl
2930 - qcom,sm8250-dsi-ctrl
3031 - qcom,sm8350-dsi-ctrl
3132 - qcom,sm8450-dsi-ctrl
3233 - qcom,sm8550-dsi-ctrl
3334 - const: qcom,mdss-dsi-ctrl
34− - items:
35− - enum:
36− - dsi-ctrl-6g-qcm2290
37− - const: qcom,mdss-dsi-ctrl
35+ - enum:
36+ - qcom,dsi-ctrl-6g-qcm2290
37+ - qcom,mdss-dsi-ctrl # This should always come with an SoC-specific compatible
3838 deprecated: true
3939
4040 reg:
@@ -351,6 +351,7 @@ allOf: · 310 unmodified lines
351351 contains:
352352 enum:
353353 - qcom,sdm845-dsi-ctrl
354+ - qcom,sm6115-dsi-ctrl
354355 then:
355356 properties:
356357 clocks:
Documentation/devicetree/bindings/display/msm/qcom,sm6115-mdss.yaml+8−2
@@ -40,7 +40,13 @@ patternProperties: · 39 unmodified lines
4040 type: object
4141 properties:
4242 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
4450
4551 "^phy@[0-9a-f]+$":
4652 type: object
@@ -114,7 +120,7 @@ examples: · 67 unmodified lines
114120 };
115121
116122 dsi@5e94000 {
117− compatible = "qcom,dsi-ctrl-6g-qcm2290";
123+ compatible = "qcom,sm6115-dsi-ctrl", "qcom,mdss-dsi-ctrl";
118124 reg = <0x05e94000 0x400>;
119125 reg-names = "dsi_ctrl";
120126
Documentation/devicetree/bindings/display/msm/qcom,sm8450-mdss.yaml+3−3
@@ -54,7 +54,7 @@ patternProperties: · 53 unmodified lines
5454 type: object
5555 properties:
5656 compatible:
57− const: qcom,dsi-phy-5nm-8450
57+ const: qcom,sm8450-dsi-phy-5nm
5858
5959 required:
6060 - compatible
@@ -254,7 +254,7 @@ examples: · 193 unmodified lines
254254 };
255255
256256 dsi0_phy: phy@ae94400 {
257− compatible = "qcom,dsi-phy-5nm-8450";
257+ compatible = "qcom,sm8450-dsi-phy-5nm";
258258 reg = <0x0ae94400 0x200>,
259259 <0x0ae94600 0x280>,
260260 <0x0ae94900 0x260>;
@@ -325,7 +325,7 @@ examples: · 64 unmodified lines
325325 };
326326
327327 dsi1_phy: phy@ae96400 {
328− compatible = "qcom,dsi-phy-5nm-8450";
328+ compatible = "qcom,sm8450-dsi-phy-5nm";
329329 reg = <0x0ae96400 0x200>,
330330 <0x0ae96600 0x280>,
331331 <0x0ae96900 0x260>;
Documentation/devicetree/bindings/display/msm/qcom,sm8550-dpu.yaml+133−0
@@ -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+...
Documentation/devicetree/bindings/display/msm/qcom,sm8550-mdss.yaml+333−0
@@ -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+...
MAINTAINERS+1−0
@@ -6518,6 +6518,7 @@ L: linux-arm-msm@vger.kernel.org · 6517 unmodified lines
65186518 L: dri-devel@lists.freedesktop.org
65196519 L: freedreno@lists.freedesktop.org
65206520 S: Maintained
6521+B: https://gitlab.freedesktop.org/drm/msm/-/issues
65216522 T: git https://gitlab.freedesktop.org/drm/msm.git
65226523 F: Documentation/devicetree/bindings/display/msm/
65236524 F: drivers/gpu/drm/msm/
drivers/gpu/drm/bridge/panel.c+60−8
@@ -111,30 +111,82 @@ static void panel_bridge_detach(struct drm_bridge *bridge) · 110 unmodified lines
111111 drm_connector_cleanup(connector);
112112 }
113113
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)
115116 {
116117 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;
117130
118131 drm_panel_prepare(panel_bridge->panel);
119132 }
120133
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)
122136 {
123137 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;
124150
125151 drm_panel_enable(panel_bridge->panel);
126152 }
127153
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)
129156 {
130157 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;
131170
132171 drm_panel_disable(panel_bridge->panel);
133172 }
134173
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)
136176 {
137177 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;
138190
139191 drm_panel_unprepare(panel_bridge->panel);
140192 }
@@ -161,10 +213,10 @@ static void panel_bridge_debugfs_init(struct drm_bridge *bridge, · 20 unmodified lines
161213 static const struct drm_bridge_funcs panel_bridge_bridge_funcs = {
162214 .attach = panel_bridge_attach,
163215 .detach = panel_bridge_detach,
164− .pre_enable = panel_bridge_pre_enable,
165− .enable = panel_bridge_enable,
166− .disable = panel_bridge_disable,
167− .post_disable = panel_bridge_post_disable,
216+ .atomic_pre_enable = panel_bridge_atomic_pre_enable,
217+ .atomic_enable = panel_bridge_atomic_enable,
218+ .atomic_disable = panel_bridge_atomic_disable,
219+ .atomic_post_disable = panel_bridge_atomic_post_disable,
168220 .get_modes = panel_bridge_get_modes,
169221 .atomic_reset = drm_atomic_helper_bridge_reset,
170222 .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
drivers/gpu/drm/drm_atomic.c+60−0
@@ -984,6 +984,66 @@ drm_atomic_get_new_connector_for_encoder(const struct drm_atomic_state *state, · 983 unmodified lines
984984 }
985985 EXPORT_SYMBOL(drm_atomic_get_new_connector_for_encoder);
986986
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+
9871047 /**
9881048 * drm_atomic_get_connector_state - get connector state
9891049 * @state: global atomic state object
drivers/gpu/drm/drm_gem.c+10−1
@@ -1337,7 +1337,15 @@ drm_gem_lru_remove(struct drm_gem_object *obj) · 1336 unmodified lines
13371337 }
13381338 EXPORT_SYMBOL(drm_gem_lru_remove);
13391339
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
13411349 drm_gem_lru_move_tail_locked(struct drm_gem_lru *lru, struct drm_gem_object *obj)
13421350 {
13431351 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
13491357 list_add_tail(&obj->lru_node, &lru->list);
13501358 obj->lru = lru;
13511359 }
1360+EXPORT_SYMBOL(drm_gem_lru_move_tail_locked);
13521361
13531362 /**
13541363 * drm_gem_lru_move_tail - move the object to the tail of the LRU
drivers/gpu/drm/msm/Kconfig+2−0
@@ -9,6 +9,7 @@ config DRM_MSM · 8 unmodified lines
99 depends on QCOM_OCMEM || QCOM_OCMEM=n
1010 depends on QCOM_LLCC || QCOM_LLCC=n
1111 depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n
12+ depends on PM
1213 select IOMMU_IO_PGTABLE
1314 select QCOM_MDT_LOADER if ARCH_QCOM
1415 select REGULATOR
@@ -28,6 +29,7 @@ config DRM_MSM · 13 unmodified lines
2829 select SYNC_FILE
2930 select PM_OPP
3031 select NVMEM
32+ select PM_GENERIC_DOMAINS
3133 help
3234 DRM/KMS driver for MSM/snapdragon.
3335
drivers/gpu/drm/msm/adreno/a2xx.xml.h+39−15
@@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56)
24−
25−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43)
17+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43)
18+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12)
19+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23)
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/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52)
24+
25+Copyright (C) 2013-2023 by the following authors:
2626 - Rob Clark <robdclark@gmail.com> (robclark)
2727 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
2828
@@ -1060,6 +1060,12 @@ enum a2xx_mh_perfcnt_select { · 1031 unmodified lines
10601060 AXI_TOTAL_READ_REQUEST_DATA_BEATS = 181,
10611061 };
10621062
1063+enum perf_mode_cnt {
1064+ PERF_STATE_RESET = 0,
1065+ PERF_STATE_ENABLE = 1,
1066+ PERF_STATE_FREEZE = 2,
1067+};
1068+
10631069 enum adreno_mmu_clnt_beh {
10641070 BEH_NEVR = 0,
10651071 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
13071313 #define A2XX_RBBM_PM_OVERRIDE1_MH_TCROQ_SCLK_PM_OVERRIDE 0x80000000
13081314
13091315 #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
13101328
13111329 #define REG_A2XX_RBBM_DEBUG_OUT 0x000003a0
13121330
@@ -1334,6 +1352,12 @@ static inline uint32_t A2XX_MH_MMU_VA_RANGE_VA_BASE(uint32_t val) · 21 unmodified lines
13341352 #define REG_A2XX_RBBM_PERIPHID2 0x000003fa
13351353
13361354 #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+}
13371361
13381362 #define REG_A2XX_CP_PERFCOUNTER_SELECT 0x00000445
13391363
drivers/gpu/drm/msm/adreno/a3xx.xml.h+15−15
@@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56)
24−
25−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43)
17+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43)
18+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12)
19+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23)
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/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52)
24+
25+Copyright (C) 2013-2022 by the following authors:
2626 - Rob Clark <robdclark@gmail.com> (robclark)
2727 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
2828
drivers/gpu/drm/msm/adreno/a3xx_gpu.c+11−0
@@ -477,6 +477,16 @@ static struct msm_gpu_state *a3xx_gpu_state_get(struct msm_gpu *gpu) · 476 unmodified lines
477477 return state;
478478 }
479479
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+
480490 static u32 a3xx_get_rptr(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
481491 {
482492 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
498508 #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
499509 .show = adreno_show,
500510 #endif
511+ .gpu_busy = a3xx_gpu_busy,
501512 .gpu_state_get = a3xx_gpu_state_get,
502513 .gpu_state_put = adreno_gpu_state_put,
503514 .create_address_space = adreno_create_address_space,
drivers/gpu/drm/msm/adreno/a4xx.xml.h+25−13
@@ -8,19 +8,19 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56)
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43)
17+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43)
18+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12)
19+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23)
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/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52)
2424
2525 Copyright (C) 2013-2022 by the following authors:
2626 - 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
31593159 #define REG_A4XX_TPL1_TP_GS_BORDER_COLOR_BASE_ADDR 0x0000238d
31603160
31613161 #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+}
31623174
31633175 #define REG_A4XX_TPL1_TP_FS_BORDER_COLOR_BASE_ADDR 0x000023a1
31643176
drivers/gpu/drm/msm/adreno/a4xx_gpu.c+11−0
@@ -611,6 +611,16 @@ static int a4xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) · 610 unmodified lines
611611 return 0;
612612 }
613613
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+
614624 static u32 a4xx_get_rptr(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
615625 {
616626 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
632642 #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
633643 .show = adreno_show,
634644 #endif
645+ .gpu_busy = a4xx_gpu_busy,
635646 .gpu_state_get = a4xx_gpu_state_get,
636647 .gpu_state_put = adreno_gpu_state_put,
637648 .create_address_space = adreno_create_address_space,
drivers/gpu/drm/msm/adreno/a5xx.xml.h+25−19
@@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56)
24−
25−Copyright (C) 2013-2022 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43)
17+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43)
18+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12)
19+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23)
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/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52)
24+
25+Copyright (C) 2013-2023 by the following authors:
2626 - Rob Clark <robdclark@gmail.com> (robclark)
2727 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
2828
@@ -4218,6 +4218,7 @@ static inline uint32_t A5XX_SP_CS_CONFIG_SHADEROBJOFFSET(uint32_t val) · 4189 unmodified lines
42184218 #define REG_A5XX_SP_FS_CONFIG_MAX_CONST 0x0000e58b
42194219
42204220 #define REG_A5XX_SP_VS_CTRL_REG0 0x0000e590
4221+#define A5XX_SP_VS_CTRL_REG0_BUFFER 0x00000004
42214222 #define A5XX_SP_VS_CTRL_REG0_THREADSIZE__MASK 0x00000008
42224223 #define A5XX_SP_VS_CTRL_REG0_THREADSIZE__SHIFT 3
42234224 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
43164317 #define REG_A5XX_SP_VS_OBJ_START_HI 0x0000e5ad
43174318
43184319 #define REG_A5XX_SP_FS_CTRL_REG0 0x0000e5c0
4320+#define A5XX_SP_FS_CTRL_REG0_BUFFER 0x00000004
43194321 #define A5XX_SP_FS_CTRL_REG0_THREADSIZE__MASK 0x00000008
43204322 #define A5XX_SP_FS_CTRL_REG0_THREADSIZE__SHIFT 3
43214323 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
44064408 #define REG_A5XX_UNKNOWN_E5DB 0x0000e5db
44074409
44084410 #define REG_A5XX_SP_CS_CTRL_REG0 0x0000e5f0
4411+#define A5XX_SP_CS_CTRL_REG0_BUFFER 0x00000004
44094412 #define A5XX_SP_CS_CTRL_REG0_THREADSIZE__MASK 0x00000008
44104413 #define A5XX_SP_CS_CTRL_REG0_THREADSIZE__SHIFT 3
44114414 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
44404443 #define REG_A5XX_SP_CS_OBJ_START_HI 0x0000e5f4
44414444
44424445 #define REG_A5XX_SP_HS_CTRL_REG0 0x0000e600
4446+#define A5XX_SP_HS_CTRL_REG0_BUFFER 0x00000004
44434447 #define A5XX_SP_HS_CTRL_REG0_THREADSIZE__MASK 0x00000008
44444448 #define A5XX_SP_HS_CTRL_REG0_THREADSIZE__SHIFT 3
44454449 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
44744478 #define REG_A5XX_SP_HS_OBJ_START_HI 0x0000e604
44754479
44764480 #define REG_A5XX_SP_DS_CTRL_REG0 0x0000e610
4481+#define A5XX_SP_DS_CTRL_REG0_BUFFER 0x00000004
44774482 #define A5XX_SP_DS_CTRL_REG0_THREADSIZE__MASK 0x00000008
44784483 #define A5XX_SP_DS_CTRL_REG0_THREADSIZE__SHIFT 3
44794484 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
45084513 #define REG_A5XX_SP_DS_OBJ_START_HI 0x0000e62d
45094514
45104515 #define REG_A5XX_SP_GS_CTRL_REG0 0x0000e640
4516+#define A5XX_SP_GS_CTRL_REG0_BUFFER 0x00000004
45114517 #define A5XX_SP_GS_CTRL_REG0_THREADSIZE__MASK 0x00000008
45124518 #define A5XX_SP_GS_CTRL_REG0_THREADSIZE__SHIFT 3
45134519 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
46654671 {
46664672 return ((val) << A5XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__SHIFT) & A5XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__MASK;
46674673 }
4668−#define A5XX_HLSQ_CONTROL_2_REG_SIZE__MASK 0xff000000
4669−#define A5XX_HLSQ_CONTROL_2_REG_SIZE__SHIFT 24
4670−static inline uint32_t A5XX_HLSQ_CONTROL_2_REG_SIZE(uint32_t val)
4674+#define A5XX_HLSQ_CONTROL_2_REG_CENTERRHW__MASK 0xff000000
4675+#define A5XX_HLSQ_CONTROL_2_REG_CENTERRHW__SHIFT 24
4676+static inline uint32_t A5XX_HLSQ_CONTROL_2_REG_CENTERRHW(uint32_t val)
46714677 {
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;
46734679 }
46744680
46754681 #define REG_A5XX_HLSQ_CONTROL_3_REG 0x0000e787
drivers/gpu/drm/msm/adreno/a5xx_gpu.c+39−30
@@ -567,7 +567,7 @@ static void a5xx_ucode_check_version(struct a5xx_gpu *a5xx_gpu, · 566 unmodified lines
567567 msm_gem_put_vaddr(obj);
568568 }
569569
570−static int a5xx_ucode_init(struct msm_gpu *gpu)
570+static int a5xx_ucode_load(struct msm_gpu *gpu)
571571 {
572572 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
573573 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
605605 a5xx_ucode_check_version(a5xx_gpu, a5xx_gpu->pfp_bo);
606606 }
607607
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);
609615
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+ }
611626
612627 return 0;
613628 }
@@ -900,9 +915,8 @@ static int a5xx_hw_init(struct msm_gpu *gpu) · 286 unmodified lines
900915 if (adreno_is_a530(adreno_gpu) || adreno_is_a540(adreno_gpu))
901916 a5xx_gpmu_ucode_init(gpu);
902917
903− ret = a5xx_ucode_init(gpu);
904− if (ret)
905− return ret;
918+ gpu_write64(gpu, REG_A5XX_CP_ME_INSTR_BASE_LO, a5xx_gpu->pm4_iova);
919+ gpu_write64(gpu, REG_A5XX_CP_PFP_INSTR_BASE_LO, a5xx_gpu->pfp_iova);
906920
907921 /* Set the ringbuffer address */
908922 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
916930 gpu_write(gpu, REG_A5XX_CP_RB_CNTL,
917931 MSM_GPU_RB_CNTL_DEFAULT | AXXX_CP_RB_CNTL_NO_UPDATE);
918932
919− /* Create a privileged buffer for the RPTR shadow */
920− if (a5xx_gpu->has_whereami) {
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−
933+ /* Configure the RPTR shadow if needed: */
934+ if (a5xx_gpu->shadow_bo) {
934935 gpu_write64(gpu, REG_A5XX_CP_RB_RPTR_ADDR,
935936 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;
940937 }
941938
942939 a5xx_preempt_hw_init(gpu);
@@ -1099,14 +1096,19 @@ bool a5xx_idle(struct msm_gpu *gpu, struct msm_ringbuffer *ring) · 156 unmodified lines
10991096 static int a5xx_fault_handler(void *arg, unsigned long iova, int flags, void *data)
11001097 {
11011098 struct msm_gpu *gpu = arg;
1102− pr_warn_ratelimited("*** gpu fault: iova=%08lx, flags=%d (%u,%u,%u,%u)\n",
1103− iova, flags,
1099+ struct adreno_smmu_fault_info *info = data;
1100+ char block[12] = "unknown";
1101+ u32 scratch[] = {
11041102 gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(4)),
11051103 gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(5)),
11061104 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+ };
11081107
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);
11101112 }
11111113
11121114 static void a5xx_cp_err_irq(struct msm_gpu *gpu)
@@ -1682,6 +1684,7 @@ static const struct adreno_gpu_funcs funcs = { · 569 unmodified lines
16821684 .get_param = adreno_get_param,
16831685 .set_param = adreno_set_param,
16841686 .hw_init = a5xx_hw_init,
1687+ .ucode_load = a5xx_ucode_load,
16851688 .pm_suspend = a5xx_pm_suspend,
16861689 .pm_resume = a5xx_pm_resume,
16871690 .recover = a5xx_recover,
@@ -1743,6 +1746,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) · 55 unmodified lines
17431746 struct a5xx_gpu *a5xx_gpu = NULL;
17441747 struct adreno_gpu *adreno_gpu;
17451748 struct msm_gpu *gpu;
1749+ unsigned int nr_rings;
17461750 int ret;
17471751
17481752 if (!pdev) {
@@ -1763,7 +1767,12 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) · 14 unmodified lines
17631767
17641768 check_speed_bin(&pdev->dev);
17651769
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);
17671776 if (ret) {
17681777 a5xx_destroy(&(a5xx_gpu->base.base));
17691778 return ERR_PTR(ret);
drivers/gpu/drm/msm/adreno/a6xx.xml.h+625−170
@@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56)
24−
25−Copyright (C) 2013-2022 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43)
17+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43)
18+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12)
19+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23)
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/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52)
24+
25+Copyright (C) 2013-2023 by the following authors:
2626 - Rob Clark <robdclark@gmail.com> (robclark)
2727 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
2828
@@ -911,6 +911,7 @@ enum a6xx_ztest_mode { · 882 unmodified lines
911911 A6XX_EARLY_Z = 0,
912912 A6XX_LATE_Z = 1,
913913 A6XX_EARLY_LRZ_LATE_Z = 2,
914+ A6XX_INVALID_ZTEST = 3,
914915 };
915916
916917 enum a6xx_sequenced_thread_dist {
@@ -946,6 +947,12 @@ enum a6xx_buffers_location { · 29 unmodified lines
946947 BUFFERS_IN_SYSMEM = 3,
947948 };
948949
950+enum a6xx_lrz_dir_status {
951+ LRZ_DIR_LE = 1,
952+ LRZ_DIR_GE = 2,
953+ LRZ_DIR_INVALID = 3,
954+};
955+
949956 enum a6xx_fragcoord_sample_mode {
950957 FRAGCOORD_CENTER = 0,
951958 FRAGCOORD_SAMPLE = 3,
@@ -978,6 +985,11 @@ enum a6xx_threadsize { · 26 unmodified lines
978985 THREAD128 = 1,
979986 };
980987
988+enum a6xx_bindless_descriptor_size {
989+ BINDLESS_DESCRIPTOR_16B = 1,
990+ BINDLESS_DESCRIPTOR_64B = 3,
991+};
992+
981993 enum a6xx_isam_mode {
982994 ISAMMODE_GL = 2,
983995 };
@@ -1030,6 +1042,8 @@ enum a6xx_tex_type { · 46 unmodified lines
10301042
10311043 #define A6XX_RBBM_INT_0_MASK_RBBM_GPU_IDLE 0x00000001
10321044 #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
10331047 #define A6XX_RBBM_INT_0_MASK_RBBM_ATB_ASYNCFIFO_OVERFLOW 0x00000040
10341048 #define A6XX_RBBM_INT_0_MASK_RBBM_GPC_ERROR 0x00000080
10351049 #define A6XX_RBBM_INT_0_MASK_CP_SW 0x00000100
@@ -1040,15 +1054,19 @@ enum a6xx_tex_type { · 4 unmodified lines
10401054 #define A6XX_RBBM_INT_0_MASK_CP_IB2 0x00002000
10411055 #define A6XX_RBBM_INT_0_MASK_CP_IB1 0x00004000
10421056 #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
10431059 #define A6XX_RBBM_INT_0_MASK_CP_RB_DONE_TS 0x00020000
10441060 #define A6XX_RBBM_INT_0_MASK_CP_WT_DONE_TS 0x00040000
10451061 #define A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS 0x00100000
1062+#define A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS_LPAC 0x00200000
10461063 #define A6XX_RBBM_INT_0_MASK_RBBM_ATB_BUS_OVERFLOW 0x00400000
10471064 #define A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT 0x00800000
10481065 #define A6XX_RBBM_INT_0_MASK_UCHE_OOB_ACCESS 0x01000000
10491066 #define A6XX_RBBM_INT_0_MASK_UCHE_TRAP_INTR 0x02000000
10501067 #define A6XX_RBBM_INT_0_MASK_DEBBUS_INTR_0 0x04000000
10511068 #define A6XX_RBBM_INT_0_MASK_DEBBUS_INTR_1 0x08000000
1069+#define A6XX_RBBM_INT_0_MASK_TSBWRITEERROR 0x10000000
10521070 #define A6XX_RBBM_INT_0_MASK_ISDB_CPU_IRQ 0x40000000
10531071 #define A6XX_RBBM_INT_0_MASK_ISDB_UNDER_DEBUG 0x80000000
10541072 #define A6XX_CP_INT_CP_OPCODE_ERROR 0x00000001
@@ -1058,15 +1076,21 @@ enum a6xx_tex_type { · 3 unmodified lines
10581076 #define A6XX_CP_INT_CP_AHB_ERROR 0x00000020
10591077 #define A6XX_CP_INT_CP_VSD_PARITY_ERROR 0x00000040
10601078 #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
10611089 #define REG_A6XX_CP_RB_BASE 0x00000800
10621090
1063−#define REG_A6XX_CP_RB_BASE_HI 0x00000801
1064−
10651091 #define REG_A6XX_CP_RB_CNTL 0x00000802
10661092
1067−#define REG_A6XX_CP_RB_RPTR_ADDR_LO 0x00000804
1068−
1069−#define REG_A6XX_CP_RB_RPTR_ADDR_HI 0x00000805
1093+#define REG_A6XX_CP_RB_RPTR_ADDR 0x00000804
10701094
10711095 #define REG_A6XX_CP_RB_RPTR 0x00000806
10721096
@@ -1083,26 +1107,28 @@ enum a6xx_tex_type { · 10 unmodified lines
10831107
10841108 #define REG_A6XX_CP_PROTECT_STATUS 0x00000824
10851109
1110+#define REG_A6XX_CP_STATUS_1 0x00000825
1111+
10861112 #define REG_A6XX_CP_SQE_INSTR_BASE 0x00000830
10871113
10881114 #define REG_A6XX_CP_MISC_CNTL 0x00000840
10891115
1090−#define REG_A6XX_CP_CHICKEN_DBG 0x00000841
1091−
10921116 #define REG_A6XX_CP_APRIV_CNTL 0x00000844
10931117
1118+#define REG_A6XX_CP_PREEMPT_THRESHOLD 0x000008c0
1119+
10941120 #define REG_A6XX_CP_ROQ_THRESHOLDS_1 0x000008c1
1095−#define A6XX_CP_ROQ_THRESHOLDS_1_RB_LO__MASK 0x000000ff
1096−#define A6XX_CP_ROQ_THRESHOLDS_1_RB_LO__SHIFT 0
1097−static inline uint32_t A6XX_CP_ROQ_THRESHOLDS_1_RB_LO(uint32_t val)
1121+#define A6XX_CP_ROQ_THRESHOLDS_1_MRB_START__MASK 0x000000ff
1122+#define A6XX_CP_ROQ_THRESHOLDS_1_MRB_START__SHIFT 0
1123+static inline uint32_t A6XX_CP_ROQ_THRESHOLDS_1_MRB_START(uint32_t val)
10981124 {
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;
11001126 }
1101−#define A6XX_CP_ROQ_THRESHOLDS_1_RB_HI__MASK 0x0000ff00
1102−#define A6XX_CP_ROQ_THRESHOLDS_1_RB_HI__SHIFT 8
1103−static inline uint32_t A6XX_CP_ROQ_THRESHOLDS_1_RB_HI(uint32_t val)
1127+#define A6XX_CP_ROQ_THRESHOLDS_1_VSD_START__MASK 0x0000ff00
1128+#define A6XX_CP_ROQ_THRESHOLDS_1_VSD_START__SHIFT 8
1129+static inline uint32_t A6XX_CP_ROQ_THRESHOLDS_1_VSD_START(uint32_t val)
11041130 {
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;
11061132 }
11071133 #define A6XX_CP_ROQ_THRESHOLDS_1_IB1_START__MASK 0x00ff0000
11081134 #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
11641190
11651191 #define REG_A6XX_CP_CONTEXT_SWITCH_CNTL 0x000008a0
11661192
1167−#define REG_A6XX_CP_CONTEXT_SWITCH_SMMU_INFO_LO 0x000008a1
1168−
1169−#define REG_A6XX_CP_CONTEXT_SWITCH_SMMU_INFO_HI 0x000008a2
1193+#define REG_A6XX_CP_CONTEXT_SWITCH_SMMU_INFO 0x000008a1
11701194
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
11721196
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
11741198
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
11761200
1177−#define REG_A6XX_CP_CONTEXT_SWITCH_PRIV_SECURE_RESTORE_ADDR_HI 0x000008a6
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
1201+#define REG_A7XX_CP_CONTEXT_SWITCH_LEVEL_STATUS 0x000008ab
11821202
11831203 static inline uint32_t REG_A6XX_CP_PERFCTR_CP_SEL(uint32_t i0) { return 0x000008d0 + 0x1*i0; }
11841204
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; }
11861206
1187−#define REG_A6XX_CP_CRASH_SCRIPT_BASE_HI 0x00000901
1207+#define REG_A6XX_CP_CRASH_SCRIPT_BASE 0x00000900
11881208
11891209 #define REG_A6XX_CP_CRASH_DUMP_CNTL 0x00000902
11901210
@@ -1212,63 +1232,165 @@ static inline uint32_t REG_A6XX_CP_PERFCTR_CP_SEL(uint32_t i0) { return 0x000008 · 21 unmodified lines
12121232
12131233 #define REG_A6XX_CP_IB1_BASE 0x00000928
12141234
1215−#define REG_A6XX_CP_IB1_BASE_HI 0x00000929
1216−
12171235 #define REG_A6XX_CP_IB1_REM_SIZE 0x0000092a
12181236
12191237 #define REG_A6XX_CP_IB2_BASE 0x0000092b
12201238
1221−#define REG_A6XX_CP_IB2_BASE_HI 0x0000092c
1222−
12231239 #define REG_A6XX_CP_IB2_REM_SIZE 0x0000092d
12241240
12251241 #define REG_A6XX_CP_SDS_BASE 0x0000092e
12261242
1227−#define REG_A6XX_CP_SDS_BASE_HI 0x0000092f
1228−
12291243 #define REG_A6XX_CP_SDS_REM_SIZE 0x00000930
12301244
12311245 #define REG_A6XX_CP_MRB_BASE 0x00000931
12321246
1233−#define REG_A6XX_CP_MRB_BASE_HI 0x00000932
1234−
12351247 #define REG_A6XX_CP_MRB_REM_SIZE 0x00000933
12361248
12371249 #define REG_A6XX_CP_VSD_BASE 0x00000934
12381250
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
12401340
12411341 #define REG_A6XX_CP_MRB_DWORDS 0x00000946
12421342
12431343 #define REG_A6XX_CP_VSD_DWORDS 0x00000947
12441344
1245−#define REG_A6XX_CP_CSQ_IB1_STAT 0x00000949
1246−#define A6XX_CP_CSQ_IB1_STAT_REM__MASK 0xffff0000
1247−#define A6XX_CP_CSQ_IB1_STAT_REM__SHIFT 16
1248−static inline uint32_t A6XX_CP_CSQ_IB1_STAT_REM(uint32_t val)
1345+#define REG_A6XX_CP_ROQ_AVAIL_RB 0x00000948
1346+#define A6XX_CP_ROQ_AVAIL_RB_REM__MASK 0xffff0000
1347+#define A6XX_CP_ROQ_AVAIL_RB_REM__SHIFT 16
1348+static inline uint32_t A6XX_CP_ROQ_AVAIL_RB_REM(uint32_t val)
12491349 {
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;
12511351 }
12521352
1253−#define REG_A6XX_CP_CSQ_IB2_STAT 0x0000094a
1254−#define A6XX_CP_CSQ_IB2_STAT_REM__MASK 0xffff0000
1255−#define A6XX_CP_CSQ_IB2_STAT_REM__SHIFT 16
1256−static inline uint32_t A6XX_CP_CSQ_IB2_STAT_REM(uint32_t val)
1353+#define REG_A6XX_CP_ROQ_AVAIL_IB1 0x00000949
1354+#define A6XX_CP_ROQ_AVAIL_IB1_REM__MASK 0xffff0000
1355+#define A6XX_CP_ROQ_AVAIL_IB1_REM__SHIFT 16
1356+static inline uint32_t A6XX_CP_ROQ_AVAIL_IB1_REM(uint32_t val)
12571357 {
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;
12591359 }
12601360
1261−#define REG_A6XX_CP_MRQ_MRB_STAT 0x0000094c
1262−#define A6XX_CP_MRQ_MRB_STAT_REM__MASK 0xffff0000
1263−#define A6XX_CP_MRQ_MRB_STAT_REM__SHIFT 16
1264−static inline uint32_t A6XX_CP_MRQ_MRB_STAT_REM(uint32_t val)
1361+#define REG_A6XX_CP_ROQ_AVAIL_IB2 0x0000094a
1362+#define A6XX_CP_ROQ_AVAIL_IB2_REM__MASK 0xffff0000
1363+#define A6XX_CP_ROQ_AVAIL_IB2_REM__SHIFT 16
1364+static inline uint32_t A6XX_CP_ROQ_AVAIL_IB2_REM(uint32_t val)
12651365 {
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;
12671367 }
12681368
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+}
12701376
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
12721394
12731395 #define REG_A6XX_CP_AHB_CNTL 0x0000098d
12741396
@@ -1276,12 +1398,70 @@ static inline uint32_t A6XX_CP_MRQ_MRB_STAT_REM(uint32_t val) · 1 unmodified line
12761398
12771399 #define REG_A6XX_CP_APERTURE_CNTL_CD 0x00000a03
12781400
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+
12791451 #define REG_A6XX_CP_LPAC_PROG_FIFO_SIZE 0x00000b34
12801452
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+
12811459 #define REG_A6XX_CP_LPAC_SQE_INSTR_BASE 0x00000b82
12821460
12831461 #define REG_A6XX_VSC_ADDR_MODE_CNTL 0x00000c01
12841462
1463+#define REG_A6XX_RBBM_GPR0_CNTL 0x00000018
1464+
12851465 #define REG_A6XX_RBBM_INT_0_STATUS 0x00000201
12861466
12871467 #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
13101490 #define A6XX_RBBM_STATUS_CP_AHB_BUSY_CP_MASTER 0x00000002
13111491 #define A6XX_RBBM_STATUS_CP_AHB_BUSY_CX_MASTER 0x00000001
13121492
1493+#define REG_A6XX_RBBM_STATUS1 0x00000211
1494+
1495+#define REG_A6XX_RBBM_STATUS2 0x00000212
1496+
13131497 #define REG_A6XX_RBBM_STATUS3 0x00000213
13141498 #define A6XX_RBBM_STATUS3_SMMU_STALLED_ON_FAULT 0x01000000
13151499
13161500 #define REG_A6XX_RBBM_VBIF_GX_RESET_STATUS 0x00000215
13171501
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+
13181514 static inline uint32_t REG_A6XX_RBBM_PERFCTR_CP(uint32_t i0) { return 0x00000400 + 0x2*i0; }
13191515
13201516 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
13471543
13481544 static inline uint32_t REG_A6XX_RBBM_PERFCTR_CMP(uint32_t i0) { return 0x000004f2 + 0x2*i0; }
13491545
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+
13501602 #define REG_A6XX_RBBM_PERFCTR_CNTL 0x00000500
13511603
13521604 #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
13711623
13721624 #define REG_A6XX_RBBM_ISDB_CNT 0x00000533
13731625
1626+#define REG_A7XX_RBBM_NC_MODE_CNTL 0x00000534
1627+
1628+#define REG_A7XX_RBBM_SNAPSHOT_STATUS 0x00000535
1629+
13741630 #define REG_A6XX_RBBM_PRIMCTR_0_LO 0x00000540
13751631
13761632 #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
14171673
14181674 #define REG_A6XX_RBBM_SECVID_TRUST_CNTL 0x0000f400
14191675
1420−#define REG_A6XX_RBBM_SECVID_TSB_TRUSTED_BASE_LO 0x0000f800
1421−
1422−#define REG_A6XX_RBBM_SECVID_TSB_TRUSTED_BASE_HI 0x0000f801
1676+#define REG_A6XX_RBBM_SECVID_TSB_TRUSTED_BASE 0x0000f800
14231677
14241678 #define REG_A6XX_RBBM_SECVID_TSB_TRUSTED_SIZE 0x0000f802
14251679
@@ -1427,6 +1681,8 @@ static inline uint32_t REG_A6XX_RBBM_PERFCTR_RBBM_SEL(uint32_t i0) { return 0x00 · 1 unmodified line
14271681
14281682 #define REG_A6XX_RBBM_SECVID_TSB_ADDR_MODE_CNTL 0x0000f810
14291683
1684+#define REG_A7XX_RBBM_SECVID_TSB_STATUS 0x0000fc00
1685+
14301686 #define REG_A6XX_RBBM_VBIF_CLIENT_QOS_CNTL 0x00000010
14311687
14321688 #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
14381694 #define REG_A6XX_RBBM_WAIT_FOR_GPU_IDLE_CMD 0x0000001c
14391695 #define A6XX_RBBM_WAIT_FOR_GPU_IDLE_CMD_WAIT_GPU_IDLE 0x00000001
14401696
1697+#define REG_A7XX_RBBM_GBIF_HALT 0x00000016
1698+
1699+#define REG_A7XX_RBBM_GBIF_HALT_ACK 0x00000017
1700+
14411701 #define REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL 0x0000001f
14421702
14431703 #define REG_A6XX_RBBM_INT_CLEAR_CMD 0x00000037
14441704
14451705 #define REG_A6XX_RBBM_INT_0_MASK 0x00000038
14461706
1707+#define REG_A7XX_RBBM_INT_2_MASK 0x0000003a
1708+
14471709 #define REG_A6XX_RBBM_SP_HYST_CNT 0x00000042
14481710
14491711 #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
16741936
16751937 #define REG_A6XX_RBBM_CLOCK_HYST_TEX_FCHE 0x00000122
16761938
1939+#define REG_A6XX_RBBM_LPAC_GBIF_CLIENT_QOS_CNTL 0x000005ff
1940+
16771941 #define REG_A6XX_DBGC_CFG_DBGBUS_SEL_A 0x00000600
16781942
16791943 #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
18522116
18532117 #define REG_A6XX_UCHE_MODE_CNTL 0x00000e01
18542118
1855−#define REG_A6XX_UCHE_WRITE_RANGE_MAX_LO 0x00000e05
1856−
1857−#define REG_A6XX_UCHE_WRITE_RANGE_MAX_HI 0x00000e06
1858−
1859−#define REG_A6XX_UCHE_WRITE_THRU_BASE_LO 0x00000e07
2119+#define REG_A6XX_UCHE_WRITE_RANGE_MAX 0x00000e05
18602120
1861−#define REG_A6XX_UCHE_WRITE_THRU_BASE_HI 0x00000e08
2121+#define REG_A6XX_UCHE_WRITE_THRU_BASE 0x00000e07
18622122
1863−#define REG_A6XX_UCHE_TRAP_BASE_LO 0x00000e09
2123+#define REG_A6XX_UCHE_TRAP_BASE 0x00000e09
18642124
1865−#define REG_A6XX_UCHE_TRAP_BASE_HI 0x00000e0a
2125+#define REG_A6XX_UCHE_GMEM_RANGE_MIN 0x00000e0b
18662126
1867−#define REG_A6XX_UCHE_GMEM_RANGE_MIN_LO 0x00000e0b
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
2127+#define REG_A6XX_UCHE_GMEM_RANGE_MAX 0x00000e0d
18742128
18752129 #define REG_A6XX_UCHE_CACHE_WAYS 0x00000e17
18762130
@@ -1886,6 +2140,8 @@ static inline uint32_t A6XX_UCHE_CLIENT_PF_PERFSEL(uint32_t val) · 9 unmodified lines
18862140
18872141 static inline uint32_t REG_A6XX_UCHE_PERFCTR_UCHE_SEL(uint32_t i0) { return 0x00000e1c + 0x1*i0; }
18882142
2143+#define REG_A6XX_UCHE_GBIF_GX_CONFIG 0x00000e3a
2144+
18892145 #define REG_A6XX_UCHE_CMDQ_CONFIG 0x00000e3c
18902146
18912147 #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
19832239
19842240 #define REG_A6XX_GBIF_PERF_PWR_CNT_EN 0x00003cc0
19852241
2242+#define REG_A6XX_GBIF_PERF_PWR_CNT_CLR 0x00003cc1
2243+
19862244 #define REG_A6XX_GBIF_PERF_CNT_SEL 0x00003cc2
19872245
19882246 #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
21052363 #define A6XX_GRAS_CL_CNTL_CLIP_DISABLE 0x00000001
21062364 #define A6XX_GRAS_CL_CNTL_ZNEAR_CLIP_DISABLE 0x00000002
21072365 #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
21092367 #define A6XX_GRAS_CL_CNTL_ZERO_GB_SCALE_Z 0x00000040
21102368 #define A6XX_GRAS_CL_CNTL_VP_CLIP_CODE_IGNORE 0x00000080
21112369 #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
24202678 {
24212679 return ((val) << A6XX_GRAS_SC_CNTL_SEQUENCED_THREAD_DISTRIBUTION__SHIFT) & A6XX_GRAS_SC_CNTL_SEQUENCED_THREAD_DISTRIBUTION__MASK;
24222680 }
2423−#define A6XX_GRAS_SC_CNTL_UNK9__MASK 0x00000e00
2424−#define A6XX_GRAS_SC_CNTL_UNK9__SHIFT 9
2425−static inline uint32_t A6XX_GRAS_SC_CNTL_UNK9(uint32_t val)
2681+#define A6XX_GRAS_SC_CNTL_UNK9 0x00000200
2682+#define A6XX_GRAS_SC_CNTL_ROTATION__MASK 0x00000c00
2683+#define A6XX_GRAS_SC_CNTL_ROTATION__SHIFT 10
2684+static inline uint32_t A6XX_GRAS_SC_CNTL_ROTATION(uint32_t val)
24262685 {
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;
24282687 }
24292688 #define A6XX_GRAS_SC_CNTL_EARLYVIZOUTEN 0x00001000
24302689
@@ -2697,12 +2956,14 @@ static inline uint32_t A6XX_GRAS_SC_WINDOW_SCISSOR_BR_Y(uint32_t val) · 266 unmodified lines
26972956 #define A6XX_GRAS_LRZ_CNTL_FC_ENABLE 0x00000008
26982957 #define A6XX_GRAS_LRZ_CNTL_Z_TEST_ENABLE 0x00000010
26992958 #define A6XX_GRAS_LRZ_CNTL_Z_BOUNDS_ENABLE 0x00000020
2700−#define A6XX_GRAS_LRZ_CNTL_UNK6__MASK 0x000003c0
2701−#define A6XX_GRAS_LRZ_CNTL_UNK6__SHIFT 6
2702−static inline uint32_t A6XX_GRAS_LRZ_CNTL_UNK6(uint32_t val)
2959+#define A6XX_GRAS_LRZ_CNTL_DIR__MASK 0x000000c0
2960+#define A6XX_GRAS_LRZ_CNTL_DIR__SHIFT 6
2961+static inline uint32_t A6XX_GRAS_LRZ_CNTL_DIR(enum a6xx_lrz_dir_status val)
27032962 {
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;
27052964 }
2965+#define A6XX_GRAS_LRZ_CNTL_DIR_WRITE 0x00000100
2966+#define A6XX_GRAS_LRZ_CNTL_DISABLE_ON_WRONG_DIR 0x00000200
27062967
27072968 #define REG_A6XX_GRAS_LRZ_PS_INPUT_CNTL 0x00008101
27082969 #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
27543015 #define REG_A6XX_GRAS_SAMPLE_CNTL 0x00008109
27553016 #define A6XX_GRAS_SAMPLE_CNTL_PER_SAMP_MODE 0x00000001
27563017
2757−#define REG_A6XX_GRAS_UNKNOWN_810A 0x0000810a
2758−#define A6XX_GRAS_UNKNOWN_810A_UNK0__MASK 0x000007ff
2759−#define A6XX_GRAS_UNKNOWN_810A_UNK0__SHIFT 0
2760−static inline uint32_t A6XX_GRAS_UNKNOWN_810A_UNK0(uint32_t val)
3018+#define REG_A6XX_GRAS_LRZ_DEPTH_VIEW 0x0000810a
3019+#define A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_LAYER__MASK 0x000007ff
3020+#define A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_LAYER__SHIFT 0
3021+static inline uint32_t A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_LAYER(uint32_t val)
27613022 {
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;
27633024 }
2764−#define A6XX_GRAS_UNKNOWN_810A_UNK16__MASK 0x07ff0000
2765−#define A6XX_GRAS_UNKNOWN_810A_UNK16__SHIFT 16
2766−static inline uint32_t A6XX_GRAS_UNKNOWN_810A_UNK16(uint32_t val)
3025+#define A6XX_GRAS_LRZ_DEPTH_VIEW_LAYER_COUNT__MASK 0x07ff0000
3026+#define A6XX_GRAS_LRZ_DEPTH_VIEW_LAYER_COUNT__SHIFT 16
3027+static inline uint32_t A6XX_GRAS_LRZ_DEPTH_VIEW_LAYER_COUNT(uint32_t val)
27673028 {
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;
27693030 }
2770−#define A6XX_GRAS_UNKNOWN_810A_UNK28__MASK 0xf0000000
2771−#define A6XX_GRAS_UNKNOWN_810A_UNK28__SHIFT 28
2772−static inline uint32_t A6XX_GRAS_UNKNOWN_810A_UNK28(uint32_t val)
3031+#define A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_MIP_LEVEL__MASK 0xf0000000
3032+#define A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_MIP_LEVEL__SHIFT 28
3033+static inline uint32_t A6XX_GRAS_LRZ_DEPTH_VIEW_BASE_MIP_LEVEL(uint32_t val)
27733034 {
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;
27753036 }
27763037
27773038 #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
29003161
29013162 #define REG_A6XX_GRAS_ADDR_MODE_CNTL 0x00008601
29023163
3164+#define REG_A7XX_GRAS_NC_MODE_CNTL 0x00008602
3165+
29033166 static inline uint32_t REG_A6XX_GRAS_PERFCTR_TSE_SEL(uint32_t i0) { return 0x00008610 + 0x1*i0; }
29043167
29053168 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
31263389
31273390 #define REG_A6XX_RB_RENDER_CONTROL1 0x0000880a
31283391 #define A6XX_RB_RENDER_CONTROL1_SAMPLEMASK 0x00000001
3129−#define A6XX_RB_RENDER_CONTROL1_UNK1 0x00000002
3392+#define A6XX_RB_RENDER_CONTROL1_POSTDEPTHCOVERAGE 0x00000002
31303393 #define A6XX_RB_RENDER_CONTROL1_FACENESS 0x00000004
31313394 #define A6XX_RB_RENDER_CONTROL1_SAMPLEID 0x00000008
31323395 #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
31353398 {
31363399 return ((val) << A6XX_RB_RENDER_CONTROL1_FRAGCOORDSAMPLEMODE__SHIFT) & A6XX_RB_RENDER_CONTROL1_FRAGCOORDSAMPLEMODE__MASK;
31373400 }
3138−#define A6XX_RB_RENDER_CONTROL1_SIZE 0x00000040
3401+#define A6XX_RB_RENDER_CONTROL1_CENTERRHW 0x00000040
31393402 #define A6XX_RB_RENDER_CONTROL1_LINELENGTHEN 0x00000080
31403403 #define A6XX_RB_RENDER_CONTROL1_FOVEATION 0x00000100
31413404
@@ -3691,7 +3954,7 @@ static inline uint32_t A6XX_RB_WINDOW_OFFSET_Y(uint32_t val) · 549 unmodified lines
36913954 }
36923955
36933956 #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
36953958 #define A6XX_RB_SAMPLE_COUNT_CONTROL_COPY 0x00000002
36963959
36973960 #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
37834046 return ((val) << A6XX_RB_WINDOW_OFFSET2_Y__SHIFT) & A6XX_RB_WINDOW_OFFSET2_Y__MASK;
37844047 }
37854048
3786−#define REG_A6XX_RB_MSAA_CNTL 0x000088d5
3787−#define A6XX_RB_MSAA_CNTL_SAMPLES__MASK 0x00000018
3788−#define A6XX_RB_MSAA_CNTL_SAMPLES__SHIFT 3
3789−static inline uint32_t A6XX_RB_MSAA_CNTL_SAMPLES(enum a3xx_msaa_samples val)
4049+#define REG_A6XX_RB_BLIT_GMEM_MSAA_CNTL 0x000088d5
4050+#define A6XX_RB_BLIT_GMEM_MSAA_CNTL_SAMPLES__MASK 0x00000018
4051+#define A6XX_RB_BLIT_GMEM_MSAA_CNTL_SAMPLES__SHIFT 3
4052+static inline uint32_t A6XX_RB_BLIT_GMEM_MSAA_CNTL_SAMPLES(enum a3xx_msaa_samples val)
37904053 {
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;
37924055 }
37934056
37944057 #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
38924155 {
38934156 return ((val) << A6XX_RB_BLIT_INFO_CLEAR_MASK__SHIFT) & A6XX_RB_BLIT_INFO_CLEAR_MASK__MASK;
38944157 }
3895−#define A6XX_RB_BLIT_INFO_UNK8__MASK 0x00000300
3896−#define A6XX_RB_BLIT_INFO_UNK8__SHIFT 8
3897−static inline uint32_t A6XX_RB_BLIT_INFO_UNK8(uint32_t val)
4158+#define A6XX_RB_BLIT_INFO_LAST__MASK 0x00000300
4159+#define A6XX_RB_BLIT_INFO_LAST__SHIFT 8
4160+static inline uint32_t A6XX_RB_BLIT_INFO_LAST(uint32_t val)
38984161 {
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;
39004163 }
3901−#define A6XX_RB_BLIT_INFO_UNK12__MASK 0x0000f000
3902−#define A6XX_RB_BLIT_INFO_UNK12__SHIFT 12
3903−static inline uint32_t A6XX_RB_BLIT_INFO_UNK12(uint32_t val)
4164+#define A6XX_RB_BLIT_INFO_BUFFER_ID__MASK 0x0000f000
4165+#define A6XX_RB_BLIT_INFO_BUFFER_ID__SHIFT 12
4166+static inline uint32_t A6XX_RB_BLIT_INFO_BUFFER_ID(uint32_t val)
39044167 {
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;
39064169 }
39074170
39084171 #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
41734436
41744437 #define REG_A6XX_RB_UNKNOWN_8E01 0x00008e01
41754438
4176−#define REG_A6XX_RB_UNKNOWN_8E04 0x00008e04
4439+#define REG_A6XX_RB_DBG_ECO_CNTL 0x00008e04
41774440
41784441 #define REG_A6XX_RB_ADDR_MODE_CNTL 0x00008e05
41794442
41804443 #define REG_A6XX_RB_CCU_CNTL 0x00008e07
4181−#define A6XX_RB_CCU_CNTL_COLOR_OFFSET__MASK 0xff800000
4182−#define A6XX_RB_CCU_CNTL_COLOR_OFFSET__SHIFT 23
4183−static inline uint32_t A6XX_RB_CCU_CNTL_COLOR_OFFSET(uint32_t val)
4444+#define A6XX_RB_CCU_CNTL_CONCURRENT_RESOLVE 0x00000004
4445+#define A6XX_RB_CCU_CNTL_DEPTH_OFFSET_HI__MASK 0x00000080
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)
41844448 {
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;
41864456 }
41874457 #define A6XX_RB_CCU_CNTL_DEPTH_OFFSET__MASK 0x001ff000
41884458 #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
41914461 return ((val >> 12) << A6XX_RB_CCU_CNTL_DEPTH_OFFSET__SHIFT) & A6XX_RB_CCU_CNTL_DEPTH_OFFSET__MASK;
41924462 }
41934463 #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+}
41954470
41964471 #define REG_A6XX_RB_NC_MODE_CNTL 0x00008e08
41974472 #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
42254500
42264501 static inline uint32_t REG_A6XX_RB_PERFCTR_CMP_SEL(uint32_t i0) { return 0x00008e2c + 0x1*i0; }
42274502
4503+static inline uint32_t REG_A7XX_RB_PERFCTR_UFC_SEL(uint32_t i0) { return 0x00008e30 + 0x1*i0; }
4504+
42284505 #define REG_A6XX_RB_RB_SUB_BLOCK_SEL_CNTL_HOST 0x00008e3b
42294506
42304507 #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
44404717 return ((val >> 2) << A6XX_VPC_SO_BUFFER_SIZE__SHIFT) & A6XX_VPC_SO_BUFFER_SIZE__MASK;
44414718 }
44424719
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+}
44444727
44454728 static inline uint32_t REG_A6XX_VPC_SO_BUFFER_OFFSET(uint32_t i0) { return 0x0000921e + 0x7*i0; }
44464729 #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
45974880 #define REG_A6XX_VPC_SO_DISABLE 0x00009306
45984881 #define A6XX_VPC_SO_DISABLE_DISABLE 0x00000001
45994882
4600−#define REG_A6XX_VPC_UNKNOWN_9600 0x00009600
4883+#define REG_A6XX_VPC_DBG_ECO_CNTL 0x00009600
46014884
46024885 #define REG_A6XX_VPC_ADDR_MODE_CNTL 0x00009601
46034886
@@ -4607,6 +4890,8 @@ static inline uint32_t A6XX_VPC_SO_STREAM_CNTL_STREAM_ENABLE(uint32_t val) · 3 unmodified lines
46074890
46084891 static inline uint32_t REG_A6XX_VPC_PERFCTR_VPC_SEL(uint32_t i0) { return 0x00009604 + 0x1*i0; }
46094892
4893+static inline uint32_t REG_A7XX_VPC_PERFCTR_VPC_SEL(uint32_t i0) { return 0x0000960b + 0x1*i0; }
4894+
46104895 #define REG_A6XX_PC_TESS_NUM_VERTEX 0x00009800
46114896
46124897 #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
46464931 #define REG_A6XX_PC_PRIMID_PASSTHRU 0x00009806
46474932
46484933 #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+}
46504940
46514941 #define REG_A6XX_PC_DGEN_SU_CONSERVATIVE_RAS_CNTL 0x0000980a
46524942 #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
49365226
49375227 static inline uint32_t REG_A6XX_PC_PERFCTR_PC_SEL(uint32_t i0) { return 0x00009e34 + 0x1*i0; }
49385228
5229+static inline uint32_t REG_A7XX_PC_PERFCTR_PC_SEL(uint32_t i0) { return 0x00009e42 + 0x1*i0; }
5230+
49395231 #define REG_A6XX_PC_UNKNOWN_9E72 0x00009e72
49405232
49415233 #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
51385430
51395431 static inline uint32_t REG_A6XX_VFD_PERFCTR_VFD_SEL(uint32_t i0) { return 0x0000a610 + 0x1*i0; }
51405432
5433+static inline uint32_t REG_A7XX_VFD_PERFCTR_VFD_SEL(uint32_t i0) { return 0x0000a610 + 0x1*i0; }
5434+
51415435 #define REG_A6XX_SP_VS_CTRL_REG0 0x0000a800
51425436 #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
51445438 #define A6XX_SP_VS_CTRL_REG0_THREADMODE__MASK 0x00000001
51455439 #define A6XX_SP_VS_CTRL_REG0_THREADMODE__SHIFT 0
51465440 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
53185612 }
53195613
53205614 #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
53225616 #define A6XX_SP_HS_CTRL_REG0_THREADMODE__MASK 0x00000001
53235617 #define A6XX_SP_HS_CTRL_REG0_THREADMODE__SHIFT 0
53245618 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
54285722 }
54295723
54305724 #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
54325726 #define A6XX_SP_DS_CTRL_REG0_THREADMODE__MASK 0x00000001
54335727 #define A6XX_SP_DS_CTRL_REG0_THREADMODE__SHIFT 0
54345728 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
56065900 }
56075901
56085902 #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
56105904 #define A6XX_SP_GS_CTRL_REG0_THREADMODE__MASK 0x00000001
56115905 #define A6XX_SP_GS_CTRL_REG0_THREADMODE__SHIFT 0
56125906 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
58626156 #define A6XX_SP_FS_CTRL_REG0_UNK24 0x01000000
58636157 #define A6XX_SP_FS_CTRL_REG0_UNK25 0x02000000
58646158 #define A6XX_SP_FS_CTRL_REG0_PIXLODENABLE 0x04000000
5865−#define A6XX_SP_FS_CTRL_REG0_UNK27__MASK 0x18000000
5866−#define A6XX_SP_FS_CTRL_REG0_UNK27__SHIFT 27
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−}
6159+#define A6XX_SP_FS_CTRL_REG0_UNK27 0x08000000
6160+#define A6XX_SP_FS_CTRL_REG0_EARLYPREAMBLE 0x10000000
58716161 #define A6XX_SP_FS_CTRL_REG0_MERGEDREGS 0x80000000
58726162 #define A6XX_SP_FS_CTRL_REG0_THREADMODE__MASK 0x00000001
58736163 #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
60696359 {
60706360 return ((val) << A6XX_SP_FS_PREFETCH_CNTL_COUNT__SHIFT) & A6XX_SP_FS_PREFETCH_CNTL_COUNT__MASK;
60716361 }
6072−#define A6XX_SP_FS_PREFETCH_CNTL_UNK3 0x00000008
6073−#define A6XX_SP_FS_PREFETCH_CNTL_UNK4__MASK 0x00000ff0
6074−#define A6XX_SP_FS_PREFETCH_CNTL_UNK4__SHIFT 4
6075−static inline uint32_t A6XX_SP_FS_PREFETCH_CNTL_UNK4(uint32_t val)
6362+#define A6XX_SP_FS_PREFETCH_CNTL_IJ_WRITE_DISABLE 0x00000008
6363+#define A6XX_SP_FS_PREFETCH_CNTL_UNK4 0x00000010
6364+#define A6XX_SP_FS_PREFETCH_CNTL_WRITE_COLOR_TO_OUTPUT 0x00000020
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)
60766368 {
6077− return ((val) << A6XX_SP_FS_PREFETCH_CNTL_UNK4__SHIFT) & A6XX_SP_FS_PREFETCH_CNTL_UNK4__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;
6369+ return ((val) << A6XX_SP_FS_PREFETCH_CNTL_UNK6__SHIFT) & A6XX_SP_FS_PREFETCH_CNTL_UNK6__MASK;
60846370 }
60856371
60866372 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
61176403 return ((val) << A6XX_SP_FS_PREFETCH_CMD_WRMASK__SHIFT) & A6XX_SP_FS_PREFETCH_CMD_WRMASK__MASK;
61186404 }
61196405 #define A6XX_SP_FS_PREFETCH_CMD_HALF 0x04000000
6120−#define A6XX_SP_FS_PREFETCH_CMD_CMD__MASK 0xf8000000
6121−#define A6XX_SP_FS_PREFETCH_CMD_CMD__SHIFT 27
6122−static inline uint32_t A6XX_SP_FS_PREFETCH_CMD_CMD(uint32_t val)
6406+#define A6XX_SP_FS_PREFETCH_CMD_UNK27 0x08000000
6407+#define A6XX_SP_FS_PREFETCH_CMD_BINDLESS 0x10000000
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)
61236411 {
61246412 return ((val) << A6XX_SP_FS_PREFETCH_CMD_CMD__SHIFT) & A6XX_SP_FS_PREFETCH_CMD_CMD__MASK;
61256413 }
@@ -6161,7 +6449,7 @@ static inline uint32_t A6XX_SP_CS_CTRL_REG0_THREADSIZE(enum a6xx_threadsize val) · 35 unmodified lines
61616449 }
61626450 #define A6XX_SP_CS_CTRL_REG0_UNK21 0x00200000
61636451 #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
61656453 #define A6XX_SP_CS_CTRL_REG0_MERGEDREGS 0x80000000
61666454 #define A6XX_SP_CS_CTRL_REG0_THREADMODE__MASK 0x00000001
61676455 #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
63556643
63566644 static inline uint32_t REG_A6XX_SP_CS_BINDLESS_BASE(uint32_t i0) { return 0x0000a9e8 + 0x2*i0; }
63576645
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+}
63596659
63606660 #define REG_A6XX_SP_CS_IBO 0x0000a9f2
63616661 #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
64066706
64076707 static inline uint32_t REG_A6XX_SP_BINDLESS_BASE(uint32_t i0) { return 0x0000ab10 + 0x2*i0; }
64086708
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+}
64106722
64116723 #define REG_A6XX_SP_IBO 0x0000ab1a
64126724 #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
64366748 return ((val) << A6XX_SP_2D_DST_FORMAT_MASK__SHIFT) & A6XX_SP_2D_DST_FORMAT_MASK__MASK;
64376749 }
64386750
6439−#define REG_A6XX_SP_UNKNOWN_AE00 0x0000ae00
6751+#define REG_A6XX_SP_DBG_ECO_CNTL 0x0000ae00
64406752
64416753 #define REG_A6XX_SP_ADDR_MODE_CNTL 0x0000ae01
64426754
@@ -6457,6 +6769,12 @@ static inline uint32_t A6XX_SP_2D_DST_FORMAT_MASK(uint32_t val) · 14 unmodified lines
64576769
64586770 static inline uint32_t REG_A6XX_SP_PERFCTR_SP_SEL(uint32_t i0) { return 0x0000ae10 + 0x1*i0; }
64596771
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+
64606778 #define REG_A6XX_SP_CONTEXT_SWITCH_GFX_PREEMPTION_SAFE_MODE 0x0000be22
64616779
64626780 #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
68877205
68887206 #define REG_A6XX_HLSQ_CONTROL_1_REG 0x0000b982
68897207
7208+#define REG_A7XX_HLSQ_CONTROL_1_REG 0x0000a9c7
7209+
68907210 #define REG_A6XX_HLSQ_CONTROL_2_REG 0x0000b983
68917211 #define A6XX_HLSQ_CONTROL_2_REG_FACEREGID__MASK 0x000000ff
68927212 #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
69067226 {
69077227 return ((val) << A6XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__SHIFT) & A6XX_HLSQ_CONTROL_2_REG_SAMPLEMASK__MASK;
69087228 }
6909−#define A6XX_HLSQ_CONTROL_2_REG_SIZE__MASK 0xff000000
6910−#define A6XX_HLSQ_CONTROL_2_REG_SIZE__SHIFT 24
6911−static inline uint32_t A6XX_HLSQ_CONTROL_2_REG_SIZE(uint32_t val)
7229+#define A6XX_HLSQ_CONTROL_2_REG_CENTERRHW__MASK 0xff000000
7230+#define A6XX_HLSQ_CONTROL_2_REG_CENTERRHW__SHIFT 24
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)
69127258 {
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;
69147260 }
69157261
69167262 #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
69397285 return ((val) << A6XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__SHIFT) & A6XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID__MASK;
69407286 }
69417287
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+
69427314 #define REG_A6XX_HLSQ_CONTROL_4_REG 0x0000b985
69437315 #define A6XX_HLSQ_CONTROL_4_REG_IJ_PERSP_SAMPLE__MASK 0x000000ff
69447316 #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
69657337 return ((val) << A6XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__SHIFT) & A6XX_HLSQ_CONTROL_4_REG_ZWCOORDREGID__MASK;
69667338 }
69677339
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+
69687366 #define REG_A6XX_HLSQ_CONTROL_5_REG 0x0000b986
69697367 #define A6XX_HLSQ_CONTROL_5_REG_LINELENGTHREGID__MASK 0x000000ff
69707368 #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
69797377 return ((val) << A6XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__SHIFT) & A6XX_HLSQ_CONTROL_5_REG_FOVEATIONQUALITYREGID__MASK;
69807378 }
69817379
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+
69827394 #define REG_A6XX_HLSQ_CS_CNTL 0x0000b987
69837395 #define A6XX_HLSQ_CS_CNTL_CONSTLEN__MASK 0x000000ff
69847396 #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
71247536
71257537 static inline uint32_t REG_A6XX_HLSQ_CS_BINDLESS_BASE(uint32_t i0) { return 0x0000b9c0 + 0x2*i0; }
71267538
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+}
71287552
71297553 #define REG_A6XX_HLSQ_CS_UNKNOWN_B9D0 0x0000b9d0
71307554 #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
72047628
72057629 static inline uint32_t REG_A6XX_HLSQ_BINDLESS_BASE(uint32_t i0) { return 0x0000bb20 + 0x2*i0; }
72067630
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+}
72087644
72097645 #define REG_A6XX_HLSQ_2D_EVENT_CMD 0x0000bd80
72107646 #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
72247660
72257661 #define REG_A6XX_HLSQ_UNKNOWN_BE01 0x0000be01
72267662
7227−#define REG_A6XX_HLSQ_UNKNOWN_BE04 0x0000be04
7663+#define REG_A6XX_HLSQ_DBG_ECO_CNTL 0x0000be04
72287664
72297665 #define REG_A6XX_HLSQ_ADDR_MODE_CNTL 0x0000be05
72307666
@@ -7234,6 +7670,8 @@ static inline uint32_t REG_A6XX_HLSQ_PERFCTR_HLSQ_SEL(uint32_t i0) { return 0x00 · 3 unmodified lines
72347670
72357671 #define REG_A6XX_HLSQ_CONTEXT_SWITCH_GFX_PREEMPTION_SAFE_MODE 0x0000be22
72367672
7673+#define REG_A7XX_SP_AHB_READ_APERTURE 0x0000c000
7674+
72377675 #define REG_A6XX_CP_EVENT_START 0x0000d600
72387676 #define A6XX_CP_EVENT_START_STATE_ID__MASK 0x000000ff
72397677 #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
74267864 }
74277865
74287866 #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+}
74307879 #define A6XX_TEX_CONST_2_PITCHALIGN__MASK 0x0000000f
74317880 #define A6XX_TEX_CONST_2_PITCHALIGN__SHIFT 0
74327881 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
74857934 }
74867935
74877936 #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+}
74887943 #define A6XX_TEX_CONST_6_PLANE_PITCH__MASK 0xffffff00
74897944 #define A6XX_TEX_CONST_6_PLANE_PITCH__SHIFT 8
74907945 static inline uint32_t A6XX_TEX_CONST_6_PLANE_PITCH(uint32_t val)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c+50−14
@@ -621,6 +621,8 @@ setup_pdc: · 620 unmodified lines
621621 /* ensure no writes happen before the uCode is fully written */
622622 wmb();
623623
624+ a6xx_rpmh_stop(gmu);
625+
624626 err:
625627 if (!IS_ERR_OR_NULL(pdcptr))
626628 iounmap(pdcptr);
@@ -753,7 +755,6 @@ static int a6xx_gmu_fw_load(struct a6xx_gmu *gmu) · 126 unmodified lines
753755
754756 static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state)
755757 {
756− static bool rpmh_init;
757758 struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu);
758759 struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
759760 int ret;
@@ -776,15 +777,9 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state) · 16 unmodified lines
776777 /* Turn on register retention */
777778 gmu_write(gmu, REG_A6XX_GMU_GENERAL_7, 1);
778779
779− /* We only need to load the RPMh microcode once */
780− if (!rpmh_init) {
781− a6xx_gmu_rpmh_init(gmu);
782− rpmh_init = true;
783− } else {
784− ret = a6xx_rpmh_start(gmu);
785− if (ret)
786− return ret;
787− }
780+ ret = a6xx_rpmh_start(gmu);
781+ if (ret)
782+ return ret;
788783
789784 ret = a6xx_gmu_fw_load(gmu);
790785 if (ret)
@@ -1482,6 +1477,12 @@ void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu) · 691 unmodified lines
14821477
14831478 pm_runtime_force_suspend(gmu->dev);
14841479
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+
14851486 if (!IS_ERR_OR_NULL(gmu->gxpd)) {
14861487 pm_runtime_disable(gmu->gxpd);
14871488 dev_pm_domain_detach(gmu->gxpd, false);
@@ -1504,6 +1505,17 @@ void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu) · 16 unmodified lines
15041505 gmu->initialized = false;
15051506 }
15061507
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+
15071519 int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
15081520 {
15091521 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
16081620
16091621 if (adreno_is_a650_family(adreno_gpu)) {
16101622 gmu->rscc = a6xx_gmu_get_mmio(pdev, "rscc");
1611− if (IS_ERR(gmu->rscc))
1623+ if (IS_ERR(gmu->rscc)) {
1624+ ret = -ENODEV;
16121625 goto err_mmio;
1626+ }
16131627 } else {
16141628 gmu->rscc = gmu->mmio + 0x23000;
16151629 }
@@ -1618,8 +1632,26 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) · 2 unmodified lines
16181632 gmu->hfi_irq = a6xx_gmu_get_irq(gmu, pdev, "hfi", a6xx_hfi_irq);
16191633 gmu->gmu_irq = a6xx_gmu_get_irq(gmu, pdev, "gmu", a6xx_gmu_irq);
16201634
1621− if (gmu->hfi_irq < 0 || gmu->gmu_irq < 0)
1635+ if (gmu->hfi_irq < 0 || gmu->gmu_irq < 0) {
1636+ ret = -ENODEV;
16221637 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;
16231655
16241656 /*
16251657 * 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
16331665 /* Set up the HFI queues */
16341666 a6xx_hfi_init(gmu);
16351667
1668+ /* Initialize RPMh */
1669+ a6xx_gmu_rpmh_init(gmu);
1670+
16361671 gmu->initialized = true;
16371672
16381673 return 0;
16391674
1675+detach_cxpd:
1676+ dev_pm_domain_detach(gmu->cxpd, false);
1677+
16401678 err_mmio:
16411679 iounmap(gmu->mmio);
16421680 if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "rscc"))
@@ -1644,8 +1682,6 @@ err_mmio: · 1 unmodified line
16441682 free_irq(gmu->gmu_irq, gmu);
16451683 free_irq(gmu->hfi_irq, gmu);
16461684
1647− ret = -ENODEV;
1648−
16491685 err_memory:
16501686 a6xx_gmu_memory_free(gmu);
16511687 err_put_device:
drivers/gpu/drm/msm/adreno/a6xx_gmu.h+7−0
@@ -4,8 +4,10 @@ · 3 unmodified lines
44 #ifndef _A6XX_GMU_H_
55 #define _A6XX_GMU_H_
66
7+#include <linux/completion.h>
78 #include <linux/iopoll.h>
89 #include <linux/interrupt.h>
10+#include <linux/notifier.h>
911 #include "msm_drv.h"
1012 #include "a6xx_hfi.h"
1113
@@ -56,6 +58,7 @@ struct a6xx_gmu { · 44 unmodified lines
5658 int gmu_irq;
5759
5860 struct device *gxpd;
61+ struct device *cxpd;
5962
6063 int idle_level;
6164
@@ -89,6 +92,10 @@ struct a6xx_gmu { · 27 unmodified lines
8992 bool initialized;
9093 bool hung;
9194 bool legacy; /* a618 or a630 */
95+
96+ /* For power domain callback */
97+ struct notifier_block pd_nb;
98+ struct completion pd_gate;
9299 };
93100
94101 static inline u32 gmu_read(struct a6xx_gmu *gmu, u32 offset)
drivers/gpu/drm/msm/adreno/a6xx_gmu.xml.h+15−15
@@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56)
24−
25−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43)
17+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43)
18+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12)
19+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23)
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/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52)
24+
25+Copyright (C) 2013-2023 by the following authors:
2626 - Rob Clark <robdclark@gmail.com> (robclark)
2727 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
2828
drivers/gpu/drm/msm/adreno/a6xx_gpu.c+83−100
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010
1111 #include <linux/bitfield.h>
1212 #include <linux/devfreq.h>
13−#include <linux/reset.h>
13+#include <linux/pm_domain.h>
1414 #include <linux/soc/qcom/llcc-qcom.h>
1515
1616 #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
187187 * GPU registers so we need to add 0x1a800 to the register value on A630
188188 * to get the right value from PM4.
189189 */
190− get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO,
190+ get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER,
191191 rbmemptr_stats(ring, index, alwayson_start));
192192
193193 /* 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
228228
229229 get_stats_counter(ring, REG_A6XX_RBBM_PERFCTR_CP(0),
230230 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,
232232 rbmemptr_stats(ring, index, alwayson_end));
233233
234234 /* 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
247247 OUT_RING(ring, submit->seqno);
248248
249249 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));
251251
252252 a6xx_flush(gpu, ring);
253253 }
@@ -917,7 +917,7 @@ out: · 663 unmodified lines
917917 return ret;
918918 }
919919
920−static int a6xx_ucode_init(struct msm_gpu *gpu)
920+static int a6xx_ucode_load(struct msm_gpu *gpu)
921921 {
922922 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
923923 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
946946 }
947947 }
948948
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+ }
950966
951967 return 0;
952968 }
@@ -997,7 +1013,7 @@ static int hw_init(struct msm_gpu *gpu) · 44 unmodified lines
9971013 * memory rendering at this point in time and we don't want to block off
9981014 * part of the virtual memory space.
9991015 */
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);
10011017 gpu_write(gpu, REG_A6XX_RBBM_SECVID_TSB_TRUSTED_SIZE, 0x00000000);
10021018
10031019 /* Turn on 64 bit addressing for all blocks */
@@ -1037,18 +1053,15 @@ static int hw_init(struct msm_gpu *gpu) · 33 unmodified lines
10371053 gpu_write(gpu, REG_A6XX_RBBM_PERFCTR_GPU_BUSY_MASKED, 0xffffffff);
10381054
10391055 /* Disable L2 bypass in the UCHE */
1040− gpu_write(gpu, REG_A6XX_UCHE_WRITE_RANGE_MAX_LO, 0xffffffc0);
1041− gpu_write(gpu, REG_A6XX_UCHE_WRITE_RANGE_MAX_HI, 0x0001ffff);
1042− gpu_write(gpu, REG_A6XX_UCHE_TRAP_BASE_LO, 0xfffff000);
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);
1056+ gpu_write64(gpu, REG_A6XX_UCHE_WRITE_RANGE_MAX, 0x0001ffffffffffc0llu);
1057+ gpu_write64(gpu, REG_A6XX_UCHE_TRAP_BASE, 0x0001fffffffff000llu);
1058+ gpu_write64(gpu, REG_A6XX_UCHE_WRITE_THRU_BASE, 0x0001fffffffff000llu);
10461059
10471060 if (!adreno_is_a650_family(adreno_gpu)) {
10481061 /* 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);
10501063
1051− gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MAX_LO,
1064+ gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MAX,
10521065 0x00100000 + adreno_gpu->gmem - 1);
10531066 }
10541067
@@ -1135,9 +1148,7 @@ static int hw_init(struct msm_gpu *gpu) · 80 unmodified lines
11351148 if (ret)
11361149 goto out;
11371150
1138− ret = a6xx_ucode_init(gpu);
1139− if (ret)
1140− goto out;
1151+ gpu_write64(gpu, REG_A6XX_CP_SQE_INSTR_BASE, a6xx_gpu->sqe_iova);
11411152
11421153 /* Set the ringbuffer address */
11431154 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
11521163 gpu_write(gpu, REG_A6XX_CP_RB_CNTL,
11531164 MSM_GPU_RB_CNTL_DEFAULT | AXXX_CP_RB_CNTL_NO_UPDATE);
11541165
1155− /*
1156− * Expanded APRIV and targets that support WHERE_AM_I both need a
1157− * privileged buffer to store the RPTR shadow
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,
1166+ /* Configure the RPTR shadow if needed: */
1167+ if (a6xx_gpu->shadow_bo) {
1168+ gpu_write64(gpu, REG_A6XX_CP_RB_RPTR_ADDR,
11751169 shadowptr(a6xx_gpu, gpu->rb[0]));
11761170 }
11771171
@@ -1259,6 +1253,7 @@ static void a6xx_recover(struct msm_gpu *gpu) · 81 unmodified lines
12591253 {
12601254 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
12611255 struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
1256+ struct a6xx_gmu *gmu = &a6xx_gpu->gmu;
12621257 int i, active_submits;
12631258
12641259 adreno_dump_info(gpu);
@@ -1297,6 +1292,10 @@ static void a6xx_recover(struct msm_gpu *gpu) · 32 unmodified lines
12971292 */
12981293 gpu->active_submits = 0;
12991294
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+
13001299 /* Drop the rpm refcount from active submits */
13011300 if (active_submits)
13021301 pm_runtime_put(&gpu->pdev->dev);
@@ -1304,8 +1303,10 @@ static void a6xx_recover(struct msm_gpu *gpu) · 1 unmodified line
13041303 /* And the final one from recover worker */
13051304 pm_runtime_put_sync(&gpu->pdev->dev);
13061305
1307− /* Call into gpucc driver to poll for cx gdsc collapse */
1308− reset_control_reset(gpu->cx_collapse);
1306+ if (!wait_for_completion_timeout(&gmu->pd_gate, msecs_to_jiffies(1000)))
1307+ DRM_DEV_ERROR(&gpu->pdev->dev, "cx gdsc didn't collapse\n");
1308+
1309+ dev_pm_genpd_remove_notifier(gmu->cxpd);
13091310
13101311 pm_runtime_use_autosuspend(&gpu->pdev->dev);
13111312
@@ -1361,73 +1362,23 @@ static const char *a6xx_fault_block(struct msm_gpu *gpu, u32 id) · 49 unmodified lines
13611362 return a6xx_uche_fault_block(gpu, id);
13621363 }
13631364
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−
13681365 static int a6xx_fault_handler(void *arg, unsigned long iova, int flags, void *data)
13691366 {
13701367 struct msm_gpu *gpu = arg;
13711368 struct adreno_smmu_fault_info *info = data;
1372− const char *type = "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− }
1369+ const char *block = "unknown";
13831370
1384− /*
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,
1371+ u32 scratch[] = {
13911372 gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(4)),
13921373 gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(5)),
13931374 gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(6)),
1394− gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(7)));
1395−
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;
1375+ gpu_read(gpu, REG_A6XX_CP_SCRATCH_REG(7)),
1376+ };
14261377
1427− kthread_queue_work(gpu->worker, &gpu->fault_work);
1428− }
1378+ if (info)
1379+ block = a6xx_fault_block(gpu, info->fsynr1 & 0xff);
14291380
1430− return 0;
1381+ return adreno_fault_handler(gpu, iova, flags, info, block, scratch);
14311382 }
14321383
14331384 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
17121663 /* Force the GPU power on so we can read this register */
17131664 a6xx_gmu_set_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET);
17141665
1715− *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO);
1666+ *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER);
17161667
17171668 a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET);
17181669
@@ -1848,8 +1799,8 @@ static bool a6xx_progress(struct msm_gpu *gpu, struct msm_ringbuffer *ring) · 129 unmodified lines
18481799 * to prevent prefetching into an unrelated submit. (And
18491800 * either way, at some point the ROQ will be full.)
18501801 */
1851− cp_state.ib1_rem += gpu_read(gpu, REG_A6XX_CP_CSQ_IB1_STAT) >> 16;
1852− cp_state.ib2_rem += gpu_read(gpu, REG_A6XX_CP_CSQ_IB2_STAT) >> 16;
1802+ cp_state.ib1_rem += gpu_read(gpu, REG_A6XX_CP_ROQ_AVAIL_IB1) >> 16;
1803+ cp_state.ib2_rem += gpu_read(gpu, REG_A6XX_CP_ROQ_AVAIL_IB2) >> 16;
18531804
18541805 progress = !!memcmp(&cp_state, &ring->last_cp_state, sizeof(cp_state));
18551806
@@ -1886,6 +1837,31 @@ static u32 a619_get_speed_bin(u32 fuse) · 30 unmodified lines
18861837 return UINT_MAX;
18871838 }
18881839
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+
18891865 static u32 adreno_7c3_get_speed_bin(u32 fuse)
18901866 {
18911867 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
19111887 if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev))
19121888 val = adreno_7c3_get_speed_bin(fuse);
19131889
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+
19141896 if (val == UINT_MAX) {
19151897 DRM_DEV_ERROR(dev,
19161898 "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
19541936 .get_param = adreno_get_param,
19551937 .set_param = adreno_set_param,
19561938 .hw_init = a6xx_hw_init,
1939+ .ucode_load = a6xx_ucode_load,
19571940 .pm_suspend = a6xx_pm_suspend,
19581941 .pm_resume = a6xx_pm_resume,
19591942 .recover = a6xx_recover,
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c+1−1
@@ -147,7 +147,7 @@ static int a6xx_crashdumper_run(struct msm_gpu *gpu, · 146 unmodified lines
147147 /* Make sure all pending memory writes are posted */
148148 wmb();
149149
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);
151151
152152 gpu_write(gpu, REG_A6XX_CP_CRASH_DUMP_CNTL, 1);
153153
drivers/gpu/drm/msm/adreno/adreno_common.xml.h+32−20
@@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56)
24−
25−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43)
17+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43)
18+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12)
19+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23)
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/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52)
24+
25+Copyright (C) 2013-2023 by the following authors:
2626 - Rob Clark <robdclark@gmail.com> (robclark)
2727 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
2828
@@ -49,11 +49,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. · 20 unmodified lines
4949
5050
5151 enum chip {
52− A2XX = 0,
53− A3XX = 0,
54− A4XX = 0,
55− A5XX = 0,
56− A6XX = 0,
52+ A2XX = 2,
53+ A3XX = 3,
54+ A4XX = 4,
55+ A5XX = 5,
56+ A6XX = 6,
57+ A7XX = 7,
5758 };
5859
5960 enum adreno_pa_su_sc_draw {
@@ -210,6 +211,17 @@ enum a5xx_line_mode { · 150 unmodified lines
210211 RECTANGULAR = 1,
211212 };
212213
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+
213225 #define REG_AXXX_CP_RB_BASE 0x000001c0
214226
215227 #define REG_AXXX_CP_RB_CNTL 0x000001c1
drivers/gpu/drm/msm/adreno/adreno_device.c+24−9
@@ -432,31 +432,35 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev) · 431 unmodified lines
432432 if (ret)
433433 return NULL;
434434
435+ if (gpu->funcs->ucode_load) {
436+ ret = gpu->funcs->ucode_load(gpu);
437+ if (ret)
438+ return NULL;
439+ }
440+
435441 /*
436442 * Now that we have firmware loaded, and are ready to begin
437443 * booting the gpu, go ahead and enable runpm:
438444 */
439445 pm_runtime_enable(&pdev->dev);
440446
441− /* Make sure pm runtime is active and reset any previous errors */
442− pm_runtime_set_active(&pdev->dev);
443−
444447 ret = pm_runtime_get_sync(&pdev->dev);
445448 if (ret < 0) {
446− pm_runtime_put_sync(&pdev->dev);
449+ pm_runtime_put_noidle(&pdev->dev);
447450 DRM_DEV_ERROR(dev->dev, "Couldn't power up the GPU: %d\n", ret);
448− return NULL;
451+ goto err_disable_rpm;
449452 }
450453
451454 mutex_lock(&gpu->lock);
452455 ret = msm_gpu_hw_init(gpu);
453456 mutex_unlock(&gpu->lock);
454− pm_runtime_put_autosuspend(&pdev->dev);
455457 if (ret) {
456458 DRM_DEV_ERROR(dev->dev, "gpu hw init failed: %d\n", ret);
457− return NULL;
459+ goto err_put_rpm;
458460 }
459461
462+ pm_runtime_put_autosuspend(&pdev->dev);
463+
460464 #ifdef CONFIG_DEBUG_FS
461465 if (gpu->funcs->debugfs_init) {
462466 gpu->funcs->debugfs_init(gpu, dev->primary);
@@ -465,6 +469,13 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev) · 2 unmodified lines
465469 #endif
466470
467471 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;
468479 }
469480
470481 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
548559 return PTR_ERR(gpu);
549560 }
550561
562+ ret = dev_pm_opp_of_find_icc_paths(dev, NULL);
563+ if (ret)
564+ return ret;
565+
551566 return 0;
552567 }
553568
@@ -566,8 +581,8 @@ static void adreno_unbind(struct device *dev, struct device *master, · 12 unmodified lines
566581 }
567582
568583 static const struct component_ops a3xx_ops = {
569− .bind = adreno_bind,
570− .unbind = adreno_unbind,
584+ .bind = adreno_bind,
585+ .unbind = adreno_unbind,
571586 };
572587
573588 static void adreno_device_register_headless(void)
drivers/gpu/drm/msm/adreno/adreno_gpu.c+110−64
@@ -208,7 +208,7 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, · 207 unmodified lines
208208 struct msm_gem_address_space *aspace;
209209 u64 start, size;
210210
211− mmu = msm_iommu_new(&pdev->dev, quirks);
211+ mmu = msm_iommu_gpu_new(&pdev->dev, gpu, quirks);
212212 if (IS_ERR_OR_NULL(mmu))
213213 return ERR_CAST(mmu);
214214
@@ -246,6 +246,66 @@ u64 adreno_private_address_space_size(struct msm_gpu *gpu) · 31 unmodified lines
246246 return SZ_4G;
247247 }
248248
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+
249309 int adreno_get_param(struct msm_gpu *gpu, struct msm_file_private *ctx,
250310 uint32_t param, uint64_t *value, uint32_t *len)
251311 {
@@ -503,16 +563,9 @@ struct drm_gem_object *adreno_fw_create_bo(struct msm_gpu *gpu, · 251 unmodified lines
503563
504564 int adreno_hw_init(struct msm_gpu *gpu)
505565 {
506− struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
507− int ret, i;
508−
509566 VERB("%s", gpu->name);
510567
511− ret = adreno_load_fw(adreno_gpu);
512− if (ret)
513− return ret;
514−
515− for (i = 0; i < gpu->nr_rings; i++) {
568+ for (int i = 0; i < gpu->nr_rings; i++) {
516569 struct msm_ringbuffer *ring = gpu->rb[i];
517570
518571 if (!ring)
@@ -922,73 +975,46 @@ void adreno_wait_ring(struct msm_ringbuffer *ring, uint32_t ndwords) · 403 unmodified lines
922975 ring->id);
923976 }
924977
925−/* Get legacy powerlevels from qcom,gpu-pwrlevels and populate the opp table */
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,
978+static int adreno_get_pwrlevels(struct device *dev,
958979 struct msm_gpu *gpu)
959980 {
981+ struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
960982 unsigned long freq = ULONG_MAX;
961983 struct dev_pm_opp *opp;
962984 int ret;
963985
964986 gpu->fast_rate = 0;
965987
966− /* You down with OPP? */
967− if (!of_property_present(dev->of_node, "operating-points-v2"))
968− ret = adreno_get_legacy_pwrlevels(dev);
969− else {
970− ret = devm_pm_opp_of_add_table(dev);
971− if (ret)
972− DRM_DEV_ERROR(dev, "Unable to set the OPP table\n");
973− }
974−
975− if (!ret) {
976− /* Find the fastest defined rate */
977− opp = dev_pm_opp_find_freq_floor(dev, &freq);
978− if (!IS_ERR(opp)) {
979− gpu->fast_rate = freq;
980− dev_pm_opp_put(opp);
988+ /* devm_pm_opp_of_add_table may error out but will still create an OPP table */
989+ ret = devm_pm_opp_of_add_table(dev);
990+ if (ret == -ENODEV) {
991+ /* Special cases for ancient hw with ancient DT bindings */
992+ if (adreno_is_a2xx(adreno_gpu)) {
993+ dev_warn(dev, "Unable to find the OPP table. Falling back to 200 MHz.\n");
994+ dev_pm_opp_add(dev, 200000000, 0);
995+ } else if (adreno_is_a320(adreno_gpu)) {
996+ dev_warn(dev, "Unable to find the OPP table. Falling back to 450 MHz.\n");
997+ dev_pm_opp_add(dev, 450000000, 0);
998+ } else {
999+ DRM_DEV_ERROR(dev, "Unable to find the OPP table\n");
1000+ return -ENODEV;
9811001 }
1002+ } else if (ret) {
1003+ DRM_DEV_ERROR(dev, "Unable to set the OPP table\n");
1004+ return ret;
9821005 }
9831006
984− if (!gpu->fast_rate) {
985− dev_warn(dev,
986− "Could not find a clock rate. Using a reasonable default\n");
987− /* Pick a suitably safe clock speed for any target */
988− gpu->fast_rate = 200000000;
989− }
1007+ /* Find the fastest defined rate */
1008+ opp = dev_pm_opp_find_freq_floor(dev, &freq);
1009+ if (IS_ERR(opp))
1010+ return PTR_ERR(opp);
1011+
1012+ gpu->fast_rate = freq;
1013+ dev_pm_opp_put(opp);
9901014
9911015 DBG("fast_rate=%u, slow_rate=27000000", gpu->fast_rate);
1016+
1017+ return 0;
9921018 }
9931019
9941020 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
10461072 struct adreno_rev *rev = &config->rev;
10471073 const char *gpu_name;
10481074 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+ }
10491093
10501094 adreno_gpu->funcs = funcs;
10511095 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
10701114
10711115 adreno_gpu_config.nr_rings = nr_rings;
10721116
1073− adreno_get_pwrlevels(dev, gpu);
1117+ ret = adreno_get_pwrlevels(dev, gpu);
1118+ if (ret)
1119+ return ret;
10741120
10751121 pm_runtime_set_autosuspend_delay(dev,
10761122 adreno_gpu->info->inactive_period);
drivers/gpu/drm/msm/adreno/adreno_gpu.h+4−0
@@ -341,6 +341,10 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, · 340 unmodified lines
341341 struct platform_device *pdev,
342342 unsigned long quirks);
343343
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+
344348 int adreno_read_speedbin(struct device *dev, u32 *speedbin);
345349
346350 /*
drivers/gpu/drm/msm/adreno/adreno_pm4.xml.h+97−18
@@ -8,21 +8,21 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a2xx.xml ( 90810 bytes, from 2021-06-21 15:24:24)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_common.xml ( 14609 bytes, from 2021-11-24 23:05:10)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 69086 bytes, from 2022-03-03 16:41:33)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2021-11-24 23:05:10)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113358 bytes, from 2022-01-31 23:06:21)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149512 bytes, from 2022-01-31 23:06:21)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx.xml ( 184954 bytes, from 2022-03-03 16:41:33)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/a6xx_gmu.xml ( 11331 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2021-01-30 18:25:22)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_control_regs.xml ( 6038 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2924 bytes, from 2021-07-22 15:21:56)
24−
25−Copyright (C) 2013-2022 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno.xml ( 594 bytes, from 2023-03-10 18:32:52)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a2xx.xml ( 91929 bytes, from 2023-02-28 23:52:27)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pm4.xml ( 74995 bytes, from 2023-03-20 18:06:23)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a3xx.xml ( 84231 bytes, from 2022-08-02 16:38:43)
17+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a4xx.xml ( 113474 bytes, from 2022-08-02 16:38:43)
18+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a5xx.xml ( 149590 bytes, from 2023-02-14 19:37:12)
19+- /home/robclark/src/mesa/mesa/src/freedreno/registers/adreno/a6xx.xml ( 198949 bytes, from 2023-03-20 18:06:23)
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/src/mesa/mesa/src/freedreno/registers/adreno/ocmem.xml ( 1773 bytes, from 2022-08-02 16:38:43)
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/src/mesa/mesa/src/freedreno/registers/adreno/adreno_pipe_regs.xml ( 2976 bytes, from 2023-03-10 18:32:52)
24+
25+Copyright (C) 2013-2023 by the following authors:
2626 - Rob Clark <robdclark@gmail.com> (robclark)
2727 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
2828
@@ -76,6 +76,10 @@ enum vgt_event_type { · 47 unmodified lines
7676 VS_FETCH_DONE = 27,
7777 FACENESS_FLUSH = 28,
7878 WT_DONE_TS = 8,
79+ START_FRAGMENT_CTRS = 13,
80+ STOP_FRAGMENT_CTRS = 14,
81+ START_COMPUTE_CTRS = 15,
82+ STOP_COMPUTE_CTRS = 16,
7983 FLUSH_SO_0 = 17,
8084 FLUSH_SO_1 = 18,
8185 FLUSH_SO_2 = 19,
@@ -86,7 +90,7 @@ enum vgt_event_type { · 4 unmodified lines
8690 PC_CCU_FLUSH_DEPTH_TS = 28,
8791 PC_CCU_FLUSH_COLOR_TS = 29,
8892 BLIT = 30,
89− UNK_25 = 37,
93+ LRZ_CLEAR = 37,
9094 LRZ_FLUSH = 38,
9195 BLIT_OP_FILL_2D = 39,
9296 BLIT_OP_COPY_2D = 40,
@@ -95,6 +99,20 @@ enum vgt_event_type { · 2 unmodified lines
9599 UNK_2C = 44,
96100 UNK_2D = 45,
97101 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,
98116 };
99117
100118 enum pc_di_primtype {
@@ -290,6 +308,9 @@ enum adreno_pm4_type3_packets { · 189 unmodified lines
290308 IN_INCR_UPDT_CONST = 86,
291309 IN_INCR_UPDT_INSTR = 87,
292310 PKT4 = 4,
311+ IN_IB_END = 10,
312+ IN_GMU_INTERRUPT = 11,
313+ IN_PREEMPT = 15,
293314 CP_SCRATCH_WRITE = 76,
294315 CP_REG_TO_MEM_OFFSET_MEM = 116,
295316 CP_REG_TO_MEM_OFFSET_REG = 114,
@@ -297,10 +318,20 @@ enum adreno_pm4_type3_packets { · 1 unmodified line
297318 CP_WAIT_TWO_REGS = 112,
298319 CP_MEMCPY = 117,
299320 CP_SET_BIN_DATA5_OFFSET = 46,
321+ CP_CONTEXT_SWITCH = 84,
300322 CP_SET_CTXSWITCH_IB = 85,
301323 CP_REG_WRITE = 109,
302324 CP_START_BIN = 80,
303325 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,
304335 };
305336
306337 enum adreno_state_block {
@@ -480,6 +511,13 @@ enum reg_tracker { · 173 unmodified lines
480511 TRACK_CNTL_REG = 1,
481512 TRACK_RENDER_CNTL = 2,
482513 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,
483521 };
484522
485523 #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
12561294 return ((val) << CP_SET_BIN_DATA5_6_BIN_PRIM_STRM_HI__SHIFT) & CP_SET_BIN_DATA5_6_BIN_PRIM_STRM_HI__MASK;
12571295 }
12581296
1297+#define REG_CP_SET_BIN_DATA5_7 0x00000007
1298+
1299+#define REG_CP_SET_BIN_DATA5_9 0x00000009
1300+
12591301 #define REG_CP_SET_BIN_DATA5_OFFSET_0 0x00000000
12601302 #define CP_SET_BIN_DATA5_OFFSET_0_VSC_SIZE__MASK 0x003f0000
12611303 #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
22022244 {
22032245 return ((val) << A6XX_CP_REG_TEST_0_BIT__SHIFT) & A6XX_CP_REG_TEST_0_BIT__MASK;
22042246 }
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
22062259
22072260 #define REG_CP_COND_REG_EXEC_0 0x00000000
22082261 #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
22112264 {
22122265 return ((val) << CP_COND_REG_EXEC_0_REG0__SHIFT) & CP_COND_REG_EXEC_0_REG0__MASK;
22132266 }
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+}
22142273 #define CP_COND_REG_EXEC_0_BINNING 0x02000000
22152274 #define CP_COND_REG_EXEC_0_GMEM 0x04000000
22162275 #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
23082367 }
23092368
23102369 #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
23122371 #define CP_REG_WRITE_0_TRACKER__SHIFT 0
23132372 static inline uint32_t CP_REG_WRITE_0_TRACKER(enum reg_tracker val)
23142373 {
23152374 return ((val) << CP_REG_WRITE_0_TRACKER__SHIFT) & CP_REG_WRITE_0_TRACKER__MASK;
23162375 }
23172376
2377+#define REG_CP_REG_WRITE_1 0x00000001
2378+
2379+#define REG_CP_REG_WRITE_2 0x00000002
2380+
23182381 #define REG_CP_SMMU_TABLE_UPDATE_0 0x00000000
23192382 #define CP_SMMU_TABLE_UPDATE_0_TTBR0_LO__MASK 0xffffffff
23202383 #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
23612424
23622425 #define REG_CP_START_BIN_BODY_DWORDS 0x00000004
23632426
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+
23642443
23652444 #endif /* ADRENO_PM4_XML */
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_3_0_msm8998.h+210−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_4_0_sdm845.h+210−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h+237−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h+217−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h+244−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h+156−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_3_sm6115.h+129−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_5_qcm2290.h+119−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h+226−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h+158−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h+222−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_1_sm8450.h+234−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h+239−0
@@ -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
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c+116−221
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <drm/drm_probe_helper.h>
2222 #include <drm/drm_rect.h>
2323 #include <drm/drm_vblank.h>
24+#include <drm/drm_self_refresh_helper.h>
2425
2526 #include "dpu_kms.h"
2627 #include "dpu_hw_lm.h"
@@ -400,6 +401,47 @@ static void _dpu_crtc_program_lm_output_roi(struct drm_crtc *crtc) · 373 unmodified lines
400401 }
401402 }
402403
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+
403445 static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
404446 struct dpu_crtc *dpu_crtc, struct dpu_crtc_mixer *mixer,
405447 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
412454 struct dpu_format *format;
413455 struct dpu_hw_ctl *ctl = mixer->lm_ctl;
414456
415− uint32_t stage_idx, lm_idx;
416− int zpos_cnt[DPU_STAGE_MAX + 1] = { 0 };
457+ uint32_t lm_idx;
417458 bool bg_alpha_enable = false;
418459 DECLARE_BITMAP(fetch_active, SSPP_MAX);
419460
420461 memset(fetch_active, 0, sizeof(fetch_active));
421462 drm_atomic_crtc_for_each_plane(plane, crtc) {
422− enum dpu_sspp sspp_idx;
423−
424463 state = plane->state;
425464 if (!state)
426465 continue;
@@ -431,40 +470,30 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, · 4 unmodified lines
431470 pstate = to_dpu_plane_state(state);
432471 fb = state->fb;
433472
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−
444473 format = to_dpu_format(msm_framebuffer_format(pstate->base.fb));
445474
446475 if (pstate->stage == DPU_STAGE_BASE && format->alpha_enable)
447476 bg_alpha_enable = true;
448477
449− stage_idx = zpos_cnt[pstate->stage]++;
450− stage_cfg->stage[pstate->stage][stage_idx] =
451− sspp_idx;
452− stage_cfg->multirect_index[pstate->stage][stage_idx] =
453− pstate->multirect_index;
454−
455− trace_dpu_crtc_setup_mixer(DRMID(crtc), DRMID(plane),
456− state, pstate, stage_idx,
457− sspp_idx - SSPP_VIG0,
458− format->base.pixel_format,
459− fb ? fb->modifier : 0);
478+ set_bit(pstate->pipe.sspp->idx, fetch_active);
479+ _dpu_crtc_blend_setup_pipe(crtc, plane,
480+ mixer, cstate->num_mixers,
481+ pstate->stage,
482+ format, fb ? fb->modifier : 0,
483+ &pstate->pipe, 0, stage_cfg);
484+
485+ if (pstate->r_pipe.sspp) {
486+ set_bit(pstate->r_pipe.sspp->idx, fetch_active);
487+ _dpu_crtc_blend_setup_pipe(crtc, plane,
488+ mixer, cstate->num_mixers,
489+ pstate->stage,
490+ format, fb ? fb->modifier : 0,
491+ &pstate->r_pipe, 1, stage_cfg);
492+ }
460493
461494 /* blend config update */
462495 for (lm_idx = 0; lm_idx < cstate->num_mixers; lm_idx++) {
463− _dpu_crtc_setup_blend_cfg(mixer + lm_idx,
464− pstate, format);
465−
466− mixer[lm_idx].lm_ctl->ops.update_pending_flush_sspp(mixer[lm_idx].lm_ctl,
467− sspp_idx);
496+ _dpu_crtc_setup_blend_cfg(mixer + lm_idx, pstate, format);
468497
469498 if (bg_alpha_enable && !format->alpha_enable)
470499 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
767796
768797 /* stage config flush mask */
769798 ctl->ops.update_pending_flush_dspp(ctl,
770− mixer[i].hw_dspp->idx);
799+ mixer[i].hw_dspp->idx, DPU_DSPP_PCC);
771800 }
772801 }
773802
@@ -1021,6 +1050,18 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, · 247 unmodified lines
10211050
10221051 DRM_DEBUG_KMS("crtc%d\n", crtc->base.id);
10231052
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+
10241065 /* Disable/save vblank irq handling */
10251066 drm_crtc_vblank_off(crtc);
10261067
@@ -1032,7 +1073,14 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, · 5 unmodified lines
10321073 */
10331074 if (dpu_encoder_get_intf_mode(encoder) == INTF_MODE_VIDEO)
10341075 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);
10361084 }
10371085
10381086 /* wait for frame_event_done completion */
@@ -1080,6 +1128,9 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, · 41 unmodified lines
10801128 struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
10811129 struct drm_encoder *encoder;
10821130 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);
10831134
10841135 pm_runtime_get_sync(crtc->dev->dev);
10851136
@@ -1102,25 +1153,23 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, · 16 unmodified lines
11021153 trace_dpu_crtc_enable(DRMID(crtc), true, dpu_crtc);
11031154 dpu_crtc->enabled = true;
11041155
1105− drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask)
1106− dpu_encoder_assign_crtc(encoder, crtc);
1156+ if (!old_crtc_state->self_refresh_active) {
1157+ drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask)
1158+ dpu_encoder_assign_crtc(encoder, crtc);
1159+ }
11071160
11081161 /* Enable/restore vblank irq handling */
11091162 drm_crtc_vblank_on(crtc);
11101163 }
11111164
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−
11191165 static bool dpu_crtc_needs_dirtyfb(struct drm_crtc_state *cstate)
11201166 {
11211167 struct drm_crtc *crtc = cstate->crtc;
11221168 struct drm_encoder *encoder;
11231169
1170+ if (cstate->self_refresh_active)
1171+ return true;
1172+
11241173 drm_for_each_encoder_mask (encoder, crtc->dev, cstate->encoder_mask) {
11251174 if (dpu_encoder_get_intf_mode(encoder) == INTF_MODE_CMD) {
11261175 return true;
@@ -1137,151 +1186,46 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, · 10 unmodified lines
11371186 crtc);
11381187 struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
11391188 struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc_state);
1140− struct plane_state *pstates;
11411189
11421190 const struct drm_plane_state *pstate;
11431191 struct drm_plane *plane;
1144− struct drm_display_mode *mode;
11451192
1146− int cnt = 0, rc = 0, mixer_width = 0, i, z_pos;
1193+ int rc = 0;
11471194
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 };
11531195 bool needs_dirtyfb = dpu_crtc_needs_dirtyfb(crtc_state);
11541196
1155− pstates = kzalloc(sizeof(*pstates) * DPU_STAGE_MAX * 4, GFP_KERNEL);
1156− if (!pstates)
1157− return -ENOMEM;
1158−
1159− if (!crtc_state->enable || !crtc_state->active) {
1197+ if (!crtc_state->enable || !drm_atomic_crtc_effectively_active(crtc_state)) {
11601198 DRM_DEBUG_ATOMIC("crtc%d -> enable %d, active %d, skip atomic_check\n",
11611199 crtc->base.id, crtc_state->enable,
11621200 crtc_state->active);
11631201 memset(&cstate->new_perf, 0, sizeof(cstate->new_perf));
1164− goto end;
1202+ return 0;
11651203 }
11661204
1167− mode = &crtc_state->adjusted_mode;
11681205 DRM_DEBUG_ATOMIC("%s: check\n", dpu_crtc->name);
11691206
11701207 /* force a full mode set if active state changed */
11711208 if (crtc_state->active_changed)
11721209 crtc_state->mode_changed = true;
11731210
1174− memset(pipe_staged, 0, sizeof(pipe_staged));
1175−
1176− if (cstate->num_mixers) {
1177− mixer_width = mode->hdisplay / cstate->num_mixers;
1178−
1211+ if (cstate->num_mixers)
11791212 _dpu_crtc_setup_lm_bounds(crtc, crtc_state);
1180− }
1181−
1182− crtc_rect.x2 = mode->hdisplay;
1183− crtc_rect.y2 = mode->vdisplay;
11841213
1185− /* get plane state for all drm planes associated with crtc state */
1214+ /* FIXME: move this to dpu_plane_atomic_check? */
11861215 drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) {
11871216 struct dpu_plane_state *dpu_pstate = to_dpu_plane_state(pstate);
1188− struct drm_rect dst, clip = crtc_rect;
11891217
11901218 if (IS_ERR_OR_NULL(pstate)) {
11911219 rc = PTR_ERR(pstate);
11921220 DPU_ERROR("%s: failed to get plane%d state, %d\n",
11931221 dpu_crtc->name, plane->base.id, rc);
1194− goto end;
1222+ return rc;
11951223 }
1196− if (cnt >= DPU_STAGE_MAX * 4)
1197− continue;
11981224
11991225 if (!pstate->visible)
12001226 continue;
12011227
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−
12071228 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− }
12851229 }
12861230
12871231 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
12901234 if (rc) {
12911235 DPU_ERROR("crtc%d failed performance check %d\n",
12921236 crtc->base.id, rc);
1293− goto end;
1237+ return rc;
12941238 }
12951239
1296− /* validate source split:
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;
1240+ return 0;
13611241 }
13621242
13631243 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
14741354 seq_printf(s, "\tdst x:%4d dst_y:%4d dst_w:%4d dst_h:%4d\n",
14751355 state->crtc_x, state->crtc_y, state->crtc_w,
14761356 state->crtc_h);
1477− seq_printf(s, "\tmultirect: mode: %d index: %d\n",
1478− pstate->multirect_mode, pstate->multirect_index);
1357+ seq_printf(s, "\tsspp[0]:%s\n",
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+ }
14791367
14801368 seq_puts(s, "\n");
14811369 }
@@ -1577,7 +1465,7 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane, · 95 unmodified lines
15771465 {
15781466 struct drm_crtc *crtc = NULL;
15791467 struct dpu_crtc *dpu_crtc = NULL;
1580− int i;
1468+ int i, ret;
15811469
15821470 dpu_crtc = kzalloc(sizeof(*dpu_crtc), GFP_KERNEL);
15831471 if (!dpu_crtc)
@@ -1614,6 +1502,13 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane, · 30 unmodified lines
16141502 /* initialize event handling */
16151503 spin_lock_init(&dpu_crtc->event_lock);
16161504
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+
16171512 DRM_DEBUG_KMS("%s: successfully initialized crtc\n", dpu_crtc->name);
16181513 return crtc;
16191514 }
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c+36−45
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/kthread.h>
1313 #include <linux/seq_file.h>
1414
15+#include <drm/drm_atomic.h>
1516 #include <drm/drm_crtc.h>
1617 #include <drm/drm_file.h>
1718 #include <drm/drm_probe_helper.h>
@@ -544,7 +545,8 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc) · 526 unmodified lines
544545 static struct msm_display_topology dpu_encoder_get_topology(
545546 struct dpu_encoder_virt *dpu_enc,
546547 struct dpu_kms *dpu_kms,
547− struct drm_display_mode *mode)
548+ struct drm_display_mode *mode,
549+ struct drm_crtc_state *crtc_state)
548550 {
549551 struct msm_display_topology topology = {0};
550552 int i, intf_count = 0;
@@ -562,8 +564,7 @@ static struct msm_display_topology dpu_encoder_get_topology( · 11 unmodified lines
562564 * 1 LM, 1 INTF
563565 * 2 LM, 1 INTF (stream merge to support high resolution interfaces)
564566 *
565− * Adding color blocks only to primary interface if available in
566− * sufficient number
567+ * Add dspps to the reservation requirements if ctm is requested
567568 */
568569 if (intf_count == 2)
569570 topology.num_lm = 2;
@@ -572,11 +573,8 @@ static struct msm_display_topology dpu_encoder_get_topology( · 2 unmodified lines
572573 else
573574 topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
574575
575− if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) {
576− if (dpu_kms->catalog->dspp &&
577− (dpu_kms->catalog->dspp_count >= topology.num_lm))
578− topology.num_dspp = topology.num_lm;
579− }
576+ if (crtc_state->ctm)
577+ topology.num_dspp = topology.num_lm;
580578
581579 topology.num_intf = intf_count;
582580
@@ -637,25 +635,22 @@ static int dpu_encoder_virt_atomic_check( · 54 unmodified lines
637635 if (ret) {
638636 DPU_ERROR_ENC(dpu_enc,
639637 "mode unsupported, phys idx %d\n", i);
640− break;
638+ return ret;
641639 }
642640 }
643641
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);
645643
646− /* Reserve dynamic resources now. */
647− if (!ret) {
648− /*
649− * Release and Allocate resources on every modeset
650− * Dont allocate when active is false.
651− */
652− if (drm_atomic_crtc_needs_modeset(crtc_state)) {
653− dpu_rm_release(global_state, drm_enc);
644+ /*
645+ * Release and Allocate resources on every modeset
646+ * Dont allocate when active is false.
647+ */
648+ if (drm_atomic_crtc_needs_modeset(crtc_state)) {
649+ dpu_rm_release(global_state, drm_enc);
654650
655− if (!crtc_state->active_changed || crtc_state->active)
656− ret = dpu_rm_reserve(&dpu_kms->rm, global_state,
657− drm_enc, crtc_state, topology);
658− }
651+ if (!crtc_state->active_changed || crtc_state->enable)
652+ ret = dpu_rm_reserve(&dpu_kms->rm, global_state,
653+ drm_enc, crtc_state, topology);
659654 }
660655
661656 trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags);
@@ -1171,7 +1166,8 @@ out: · 509 unmodified lines
11711166 mutex_unlock(&dpu_enc->enc_lock);
11721167 }
11731168
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)
11751171 {
11761172 struct dpu_encoder_virt *dpu_enc = NULL;
11771173 int ret = 0;
@@ -1207,14 +1203,28 @@ out: · 29 unmodified lines
12071203 mutex_unlock(&dpu_enc->enc_lock);
12081204 }
12091205
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)
12111208 {
12121209 struct dpu_encoder_virt *dpu_enc = NULL;
1210+ struct drm_crtc *crtc;
1211+ struct drm_crtc_state *old_state = NULL;
12131212 int i = 0;
12141213
12151214 dpu_enc = to_dpu_encoder_virt(drm_enc);
12161215 DPU_DEBUG_ENC(dpu_enc, "\n");
12171216
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+
12181228 mutex_lock(&dpu_enc->enc_lock);
12191229 dpu_enc->enabled = false;
12201230
@@ -2078,25 +2088,6 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc) · 857 unmodified lines
20782088 ctl->ops.clear_pending_flush(ctl);
20792089 }
20802090
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−
21002091 #ifdef CONFIG_DEBUG_FS
21012092 static int _dpu_encoder_status_show(struct seq_file *s, void *data)
21022093 {
@@ -2388,8 +2379,8 @@ static void dpu_encoder_frame_done_timeout(struct timer_list *t) · 285 unmodified lines
23882379
23892380 static const struct drm_encoder_helper_funcs dpu_encoder_helper_funcs = {
23902381 .atomic_mode_set = dpu_encoder_virt_atomic_mode_set,
2391− .disable = dpu_encoder_virt_disable,
2392− .enable = dpu_encoder_virt_enable,
2382+ .atomic_disable = dpu_encoder_virt_atomic_disable,
2383+ .atomic_enable = dpu_encoder_virt_atomic_enable,
23932384 .atomic_check = dpu_encoder_virt_atomic_check,
23942385 };
23952386
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h+0−7
@@ -146,13 +146,6 @@ struct drm_encoder *dpu_encoder_init( · 145 unmodified lines
146146 int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
147147 struct msm_display_info *disp_info);
148148
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−
156149 /**
157150 * dpu_encoder_set_idle_timeout - set the idle timeout for video
158151 * and command mode encoders.
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c+5−3
@@ -40,6 +40,8 @@ · 39 unmodified lines
4040
4141 #define DPU_ENC_MAX_POLL_TIMEOUT_US 2000
4242
43+static void dpu_encoder_phys_cmd_enable_te(struct dpu_encoder_phys *phys_enc);
44+
4345 static bool dpu_encoder_phys_cmd_is_master(struct dpu_encoder_phys *phys_enc)
4446 {
4547 return (phys_enc->split_role != ENC_ROLE_SLAVE);
@@ -565,6 +567,8 @@ static void dpu_encoder_phys_cmd_prepare_for_kickoff( · 519 unmodified lines
565567 phys_enc->hw_pp->idx - PINGPONG_0);
566568 }
567569
570+ dpu_encoder_phys_cmd_enable_te(phys_enc);
571+
568572 DPU_DEBUG_CMDENC(cmd_enc, "pp:%d pending_cnt %d\n",
569573 phys_enc->hw_pp->idx - PINGPONG_0,
570574 atomic_read(&phys_enc->pending_kickoff_cnt));
@@ -586,8 +590,7 @@ static bool dpu_encoder_phys_cmd_is_ongoing_pptx( · 15 unmodified lines
586590 return false;
587591 }
588592
589−static void dpu_encoder_phys_cmd_prepare_commit(
590− struct dpu_encoder_phys *phys_enc)
593+static void dpu_encoder_phys_cmd_enable_te(struct dpu_encoder_phys *phys_enc)
591594 {
592595 struct dpu_encoder_phys_cmd *cmd_enc =
593596 to_dpu_encoder_phys_cmd(phys_enc);
@@ -732,7 +735,6 @@ static void dpu_encoder_phys_cmd_trigger_start( · 138 unmodified lines
732735 static void dpu_encoder_phys_cmd_init_ops(
733736 struct dpu_encoder_phys_ops *ops)
734737 {
735− ops->prepare_commit = dpu_encoder_phys_cmd_prepare_commit;
736738 ops->is_master = dpu_encoder_phys_cmd_is_master;
737739 ops->atomic_mode_set = dpu_encoder_phys_cmd_atomic_mode_set;
738740 ops->enable = dpu_encoder_phys_cmd_enable;
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c+22−0
@@ -523,6 +523,7 @@ static void dpu_encoder_phys_vid_disable(struct dpu_encoder_phys *phys_enc) · 522 unmodified lines
523523 {
524524 unsigned long lock_flags;
525525 int ret;
526+ struct intf_status intf_status = {0};
526527
527528 if (!phys_enc->parent || !phys_enc->parent->dev) {
528529 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
567568 }
568569 }
569570
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);
570592 phys_enc->enable_state = DPU_ENC_DISABLED;
571593 }
572594
drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c+12−9
@@ -536,6 +536,16 @@ static const struct dpu_format dpu_format_map_ubwc[] = { · 535 unmodified lines
536536 true, 4, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_COMPRESSED,
537537 DPU_FETCH_UBWC, 2, DPU_TILE_HEIGHT_UBWC),
538538
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+
539549 PSEUDO_YUV_FMT_TILED(NV12,
540550 0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
541551 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
591601 {DRM_FORMAT_XBGR8888, COLOR_FMT_RGBA8888_UBWC},
592602 {DRM_FORMAT_XRGB8888, COLOR_FMT_RGBA8888_UBWC},
593603 {DRM_FORMAT_ABGR2101010, COLOR_FMT_RGBA1010102_UBWC},
604+ {DRM_FORMAT_ARGB2101010, COLOR_FMT_RGBA1010102_UBWC},
594605 {DRM_FORMAT_XRGB2101010, COLOR_FMT_RGBA1010102_UBWC},
595606 {DRM_FORMAT_XBGR2101010, COLOR_FMT_RGBA1010102_UBWC},
596607 {DRM_FORMAT_BGR565, COLOR_FMT_RGB565_UBWC},
@@ -918,8 +929,7 @@ int dpu_format_populate_layout( · 321 unmodified lines
918929 struct drm_framebuffer *fb,
919930 struct dpu_hw_fmt_layout *layout)
920931 {
921− uint32_t plane_addr[DPU_MAX_PLANES];
922− int i, ret;
932+ int ret;
923933
924934 if (!fb || !layout) {
925935 DRM_ERROR("invalid arguments\n");
@@ -940,9 +950,6 @@ int dpu_format_populate_layout( · 14 unmodified lines
940950 if (ret)
941951 return ret;
942952
943− for (i = 0; i < DPU_MAX_PLANES; ++i)
944− plane_addr[i] = layout->plane_addr[i];
945−
946953 /* Populate the addresses given the fb */
947954 if (DPU_FORMAT_IS_UBWC(layout->format) ||
948955 DPU_FORMAT_IS_TILE(layout->format))
@@ -950,10 +957,6 @@ int dpu_format_populate_layout( · 1 unmodified line
950957 else
951958 ret = _dpu_format_populate_addrs_linear(aspace, fb, layout);
952959
953− /* check if anything changed */
954− if (!ret && !memcmp(plane_addr, layout->plane_addr, sizeof(plane_addr)))
955− ret = -EAGAIN;
956−
957960 return ret;
958961 }
959962
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c+40−2115
@@ -27,9 +27,15 @@ · 26 unmodified lines
2727 #define VIG_SDM845_MASK \
2828 (VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED3))
2929
30+#define VIG_SDM845_MASK_SDMA \
31+ (VIG_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2))
32+
3033 #define VIG_SC7180_MASK \
3134 (VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED4))
3235
36+#define VIG_SC7180_MASK_SDMA \
37+ (VIG_SC7180_MASK | BIT(DPU_SSPP_SMART_DMA_V2))
38+
3339 #define VIG_QCM2290_MASK (VIG_BASE_MASK | BIT(DPU_SSPP_QOS_8LVL))
3440
3541 #define DMA_MSM8998_MASK \
@@ -40,6 +46,9 @@ · 4 unmodified lines
4046 #define VIG_SC7280_MASK \
4147 (VIG_SC7180_MASK | BIT(DPU_SSPP_INLINE_ROTATION))
4248
49+#define VIG_SC7280_MASK_SDMA \
50+ (VIG_SC7280_MASK | BIT(DPU_SSPP_SMART_DMA_V2))
51+
4352 #define DMA_SDM845_MASK \
4453 (BIT(DPU_SSPP_SRC) | BIT(DPU_SSPP_QOS) | BIT(DPU_SSPP_QOS_8LVL) |\
4554 BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\
@@ -48,6 +57,12 @@ · 2 unmodified lines
4857 #define DMA_CURSOR_SDM845_MASK \
4958 (DMA_SDM845_MASK | BIT(DPU_SSPP_CURSOR))
5059
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+
5166 #define DMA_CURSOR_MSM8998_MASK \
5267 (DMA_MSM8998_MASK | BIT(DPU_SSPP_CURSOR))
5368
@@ -66,7 +81,10 @@ · 12 unmodified lines
6681 (PINGPONG_SDM845_MASK | BIT(DPU_PINGPONG_TE2))
6782
6883 #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))
7088
7189 #define CTL_SM8550_MASK \
7290 (CTL_SC7280_MASK | BIT(DPU_CTL_HAS_LAYER_EXT4))
@@ -79,83 +97,11 @@ · 6 unmodified lines
7997
8098 #define INTF_SDM845_MASK (0)
8199
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))
83102
84103 #define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN)
85104
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−
159105 #define WB_SM8250_MASK (BIT(DPU_WB_LINE_MODE) | \
160106 BIT(DPU_WB_UBWC) | \
161107 BIT(DPU_WB_YUV_CONFIG) | \
@@ -188,6 +134,7 @@ static const uint32_t plane_formats[] = { · 26 unmodified lines
188134 DRM_FORMAT_RGBX8888,
189135 DRM_FORMAT_BGRX8888,
190136 DRM_FORMAT_XBGR8888,
137+ DRM_FORMAT_ARGB2101010,
191138 DRM_FORMAT_XRGB2101010,
192139 DRM_FORMAT_RGB888,
193140 DRM_FORMAT_BGR888,
@@ -217,6 +164,7 @@ static const uint32_t plane_formats_yuv[] = { · 23 unmodified lines
217164 DRM_FORMAT_RGBA8888,
218165 DRM_FORMAT_BGRX8888,
219166 DRM_FORMAT_BGRA8888,
167+ DRM_FORMAT_ARGB2101010,
220168 DRM_FORMAT_XRGB2101010,
221169 DRM_FORMAT_XRGB8888,
222170 DRM_FORMAT_XBGR8888,
@@ -294,789 +242,6 @@ static const uint32_t wb2_formats[] = { · 71 unmodified lines
294242 DRM_FORMAT_XBGR4444,
295243 };
296244
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−
1080245 /*************************************************************
1081246 * SSPP sub blocks config
1082247 *************************************************************/
@@ -1164,11 +329,11 @@ static const struct dpu_sspp_sub_blks sdm845_dma_sblk_1 = _DMA_SBLK("9", 2); · 81 unmodified lines
1164329 static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 = _DMA_SBLK("10", 3);
1165330 static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = _DMA_SBLK("11", 4);
1166331
1167−#define SSPP_BLK(_name, _id, _base, _features, \
332+#define SSPP_BLK(_name, _id, _base, _len, _features, \
1168333 _sblk, _xinid, _type, _clkctrl) \
1169334 { \
1170335 .name = _name, .id = _id, \
1171− .base = _base, .len = 0x1c8, \
336+ .base = _base, .len = _len, \
1172337 .features = _features, \
1173338 .sblk = &_sblk, \
1174339 .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
1176341 .clk_ctrl = _clkctrl \
1177342 }
1178343
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−
1217344 static const struct dpu_sspp_sub_blks sc7180_vig_sblk_0 =
1218345 _VIG_SBLK("0", 4, DPU_SSPP_SCALER_QSEED4);
1219346
1220347 static const struct dpu_sspp_sub_blks sc7280_vig_sblk_0 =
1221348 _VIG_SBLK_ROT("0", 4, DPU_SSPP_SCALER_QSEED4, &dpu_rot_sc7280_cfg_v2);
1222349
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−
1234350 static const struct dpu_sspp_sub_blks sm6115_vig_sblk_0 =
1235351 _VIG_SBLK("0", 2, DPU_SSPP_SCALER_QSEED4);
1236352
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−
1244353 static const struct dpu_sspp_sub_blks sm8250_vig_sblk_0 =
1245354 _VIG_SBLK("0", 5, DPU_SSPP_SCALER_QSEED4);
1246355 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
1250359 static const struct dpu_sspp_sub_blks sm8250_vig_sblk_3 =
1251360 _VIG_SBLK("3", 8, DPU_SSPP_SCALER_QSEED4);
1252361
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−
1300362 static const struct dpu_sspp_sub_blks sm8550_vig_sblk_0 =
1301363 _VIG_SBLK("0", 7, DPU_SSPP_SCALER_QSEED4);
1302364 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
1308370 static const struct dpu_sspp_sub_blks sm8550_dma_sblk_4 = _DMA_SBLK("12", 5);
1309371 static const struct dpu_sspp_sub_blks sm8550_dma_sblk_5 = _DMA_SBLK("13", 6);
1310372
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−
1373373 #define _VIG_SBLK_NOSCALE(num, sdma_pri) \
1374374 { \
1375375 .maxdwnscale = SSPP_UNITY_SCALE, \
@@ -1386,13 +386,6 @@ static const struct dpu_sspp_cfg sc8280xp_sspp[] = { · 10 unmodified lines
1386386 static const struct dpu_sspp_sub_blks qcm2290_vig_sblk_0 = _VIG_SBLK_NOSCALE("0", 2);
1387387 static const struct dpu_sspp_sub_blks qcm2290_dma_sblk_0 = _DMA_SBLK("8", 1);
1388388
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−
1396389 /*************************************************************
1397390 * MIXER sub blocks config
1398391 *************************************************************/
@@ -1419,21 +412,6 @@ static const struct dpu_lm_sub_blks msm8998_lm_sblk = { · 20 unmodified lines
1419412 },
1420413 };
1421414
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−
1437415 /* SDM845 */
1438416
1439417 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
1445423 },
1446424 };
1447425
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−
1463426 /* SC7180 */
1464427
1465428 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
1470433 },
1471434 };
1472435
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−
1517436 /* QCM2290 */
1518437
1519438 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
1524443 },
1525444 };
1526445
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−
1532446 /*************************************************************
1533447 * DSPP sub blocks config
1534448 *************************************************************/
@@ -1557,34 +471,6 @@ static const struct dpu_dspp_sub_blks sm8150_dspp_sblk = { · 22 unmodified lines
1557471 .sblk = _sblk \
1558472 }
1559473
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−
1588474 /*************************************************************
1589475 * PINGPONG sub blocks config
1590476 *************************************************************/
@@ -1636,151 +522,6 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = { · 45 unmodified lines
1636522 .intr_rdptr = _rdptr, \
1637523 }
1638524
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−
1784525 /*************************************************************
1785526 * MERGE_3D sub blocks config
1786527 *************************************************************/
@@ -1792,32 +533,6 @@ static const struct dpu_pingpong_cfg sm8550_pp[] = { · 5 unmodified lines
1792533 .sblk = NULL \
1793534 }
1794535
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−
1821536 /*************************************************************
1822537 * DSC sub blocks config
1823538 *************************************************************/
@@ -1828,27 +543,13 @@ static const struct dpu_merge_3d_cfg sm8550_merge_3d[] = { · 4 unmodified lines
1828543 .features = _features, \
1829544 }
1830545
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−
1845546 /*************************************************************
1846547 * INTF sub blocks config
1847548 *************************************************************/
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) \
1849550 {\
1850551 .name = _name, .id = _id, \
1851− .base = _base, .len = 0x280, \
552+ .base = _base, .len = _len, \
1852553 .features = _features, \
1853554 .type = _type, \
1854555 .controller_id = _ctrl_id, \
@@ -1857,88 +558,6 @@ static struct dpu_dsc_cfg sm8150_dsc[] = { · 2 unmodified lines
1857558 .intr_vsync = DPU_IRQ_IDX(_reg, _vsync_bit), \
1858559 }
1859560
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−
1942561 /*************************************************************
1943562 * Writeback blocks config
1944563 *************************************************************/
@@ -1957,11 +576,6 @@ static const struct dpu_intf_cfg sm8550_intf[] = { · 12 unmodified lines
1957576 .intr_wb_done = DPU_IRQ_IDX(_reg, _wb_done_bit) \
1958577 }
1959578
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−
1965579 /*************************************************************
1966580 * VBIF sub blocks config
1967581 *************************************************************/
@@ -2166,715 +780,26 @@ static const struct dpu_qos_lut_entry sc7180_qos_nrt[] = { · 198 unmodified lines
2166780 {.fl = 0, .lut = 0x0},
2167781 };
2168782
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−};
2519783 /*************************************************************
2520784 * Hardware catalog
2521785 *************************************************************/
2522786
2523−static const struct dpu_mdss_cfg msm8998_dpu_cfg = {
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−};
787+#include "catalog/dpu_3_0_msm8998.h"
2545788
2546−static const struct dpu_mdss_cfg sdm845_dpu_cfg = {
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−};
789+#include "catalog/dpu_4_0_sdm845.h"
2569790
2570−static const struct dpu_mdss_cfg sc7180_dpu_cfg = {
2571− .caps = &sc7180_dpu_caps,
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−};
791+#include "catalog/dpu_5_0_sm8150.h"
792+#include "catalog/dpu_5_1_sc8180x.h"
2751793
2752−static const struct dpu_mdss_cfg sm8450_dpu_cfg = {
2753− .caps = &sm8450_dpu_caps,
2754− .mdp_count = ARRAY_SIZE(sm8450_mdp),
2755− .mdp = sm8450_mdp,
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− }
794+#include "catalog/dpu_6_0_sm8250.h"
795+#include "catalog/dpu_6_2_sc7180.h"
796+#include "catalog/dpu_6_3_sm6115.h"
797+#include "catalog/dpu_6_5_qcm2290.h"
2875798
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"
2877801
2878− return ERR_PTR(-ENODEV);
2879−}
802+#include "catalog/dpu_8_0_sc8280xp.h"
803+#include "catalog/dpu_8_1_sm8450.h"
2880804
805+#include "catalog/dpu_9_0_sm8550.h"
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h+39−67
@@ -19,47 +19,6 @@ · 18 unmodified lines
1919 */
2020 #define MAX_BLOCKS 12
2121
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−
6322 #define DPU_HW_BLK_NAME_LEN 16
6423
6524 #define MAX_IMG_WIDTH 0x3fff
@@ -169,10 +128,12 @@ enum { · 103 unmodified lines
169128 * DSPP sub-blocks
170129 * @DPU_DSPP_PCC Panel color correction block
171130 * @DPU_DSPP_GC Gamma correction block
131+ * @DPU_DSPP_IGC Inverse gamma correction block
172132 */
173133 enum {
174134 DPU_DSPP_PCC = 0x1,
175135 DPU_DSPP_GC,
136+ DPU_DSPP_IGC,
176137 DPU_DSPP_MAX
177138 };
178139
@@ -200,6 +161,7 @@ enum { · 21 unmodified lines
200161 * @DPU_CTL_FETCH_ACTIVE: Active CTL for fetch HW (SSPPs)
201162 * @DPU_CTL_VM_CFG: CTL config to support multiple VMs
202163 * @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
203165 * @DPU_CTL_MAX
204166 */
205167 enum {
@@ -208,22 +170,25 @@ enum { · 2 unmodified lines
208170 DPU_CTL_FETCH_ACTIVE,
209171 DPU_CTL_VM_CFG,
210172 DPU_CTL_HAS_LAYER_EXT4,
173+ DPU_CTL_DSPP_SUB_BLOCK_FLUSH,
211174 DPU_CTL_MAX
212175 };
213176
214177 /**
215178 * INTF sub-blocks
216− * @DPU_INTF_INPUT_CTRL Supports the setting of pp block from which
217− * pixel data arrives to this INTF
218− * @DPU_INTF_TE INTF block has TE configuration support
219− * @DPU_DATA_HCTL_EN Allows data to be transferred at different rate
220− than video timing
179+ * @DPU_INTF_INPUT_CTRL Supports the setting of pp block from which
180+ * pixel data arrives to this INTF
181+ * @DPU_INTF_TE INTF block has TE configuration support
182+ * @DPU_DATA_HCTL_EN Allows data to be transferred at different rate
183+ * than video timing
184+ * @DPU_INTF_STATUS_SUPPORTED INTF block has INTF_STATUS register
221185 * @DPU_INTF_MAX
222186 */
223187 enum {
224188 DPU_INTF_INPUT_CTRL = 0x1,
225189 DPU_INTF_TE,
226190 DPU_DATA_HCTL_EN,
191+ DPU_INTF_STATUS_SUPPORTED,
227192 DPU_INTF_MAX
228193 };
229194
@@ -393,8 +358,6 @@ struct dpu_rotation_cfg { · 163 unmodified lines
393358 * @max_mixer_blendstages max layer mixer blend stages or
394359 * supported z order
395360 * @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)
398361 * @has_src_split source split feature status
399362 * @has_dim_layer dim layer feature status
400363 * @has_idle_pc indicate if idle power collapse feature is supported
@@ -408,8 +371,6 @@ struct dpu_caps { · 7 unmodified lines
408371 u32 max_mixer_width;
409372 u32 max_mixer_blendstages;
410373 u32 qseed_type;
411− u32 smart_dma_rev;
412− u32 ubwc_version;
413374 bool has_src_split;
414375 bool has_dim_layer;
415376 bool has_idle_pc;
@@ -538,15 +499,24 @@ struct dpu_clk_ctrl_reg { · 122 unmodified lines
538499 * @id: index identifying this block
539500 * @base: register base offset to mdss
540501 * @features bit mask identifying sub-blocks/features
541− * @highest_bank_bit: UBWC parameter
542− * @ubwc_swizzle: ubwc default swizzle setting
543502 * @clk_ctrls clock control register definition
544503 */
545504 struct dpu_mdp_cfg {
546505 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;
547518 u32 highest_bank_bit;
548519 u32 ubwc_swizzle;
549− struct dpu_clk_ctrl_reg clk_ctrls[DPU_CLK_CTRL_MAX];
550520 };
551521
552522 /* struct dpu_ctl_cfg : MDP CTL instance info
@@ -848,6 +818,8 @@ struct dpu_perf_cfg { · 295 unmodified lines
848818 struct dpu_mdss_cfg {
849819 const struct dpu_caps *caps;
850820
821+ const struct dpu_ubwc_cfg *ubwc;
822+
851823 u32 mdp_count;
852824 const struct dpu_mdp_cfg *mdp;
853825
@@ -867,7 +839,7 @@ struct dpu_mdss_cfg { · 13 unmodified lines
867839 const struct dpu_merge_3d_cfg *merge_3d;
868840
869841 u32 dsc_count;
870− struct dpu_dsc_cfg *dsc;
842+ const struct dpu_dsc_cfg *dsc;
871843
872844 u32 intf_count;
873845 const struct dpu_intf_cfg *intf;
@@ -896,18 +868,18 @@ struct dpu_mdss_cfg { · 22 unmodified lines
896868 unsigned long mdss_irqs;
897869 };
898870
899−struct dpu_mdss_hw_cfg_handler {
900− u32 hw_rev;
901− const struct dpu_mdss_cfg *dpu_cfg;
902−};
903−
904−/**
905− * dpu_hw_catalog_init - dpu hardware catalog init API retrieves
906− * hardcoded target specific catalog information in config structure
907− * @hw_rev: caller needs provide the hardware revision.
908− *
909− * Return: dpu config structure
910− */
911−const struct dpu_mdss_cfg *dpu_hw_catalog_init(u32 hw_rev);
871+extern const struct dpu_mdss_cfg dpu_msm8998_cfg;
872+extern const struct dpu_mdss_cfg dpu_sdm845_cfg;
873+extern const struct dpu_mdss_cfg dpu_sm8150_cfg;
874+extern const struct dpu_mdss_cfg dpu_sc8180x_cfg;
875+extern const struct dpu_mdss_cfg dpu_sm8250_cfg;
876+extern const struct dpu_mdss_cfg dpu_sc7180_cfg;
877+extern const struct dpu_mdss_cfg dpu_sm6115_cfg;
878+extern const struct dpu_mdss_cfg dpu_qcm2290_cfg;
879+extern const struct dpu_mdss_cfg dpu_sm8350_cfg;
880+extern const struct dpu_mdss_cfg dpu_sc7280_cfg;
881+extern const struct dpu_mdss_cfg dpu_sc8280xp_cfg;
882+extern const struct dpu_mdss_cfg dpu_sm8450_cfg;
883+extern const struct dpu_mdss_cfg dpu_sm8550_cfg;
912884
913885 #endif /* _DPU_HW_CATALOG_H */
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c+45−4
@@ -26,15 +26,16 @@ · 25 unmodified lines
2626 #define CTL_SW_RESET 0x030
2727 #define CTL_LAYER_EXTN_OFFSET 0x40
2828 #define CTL_MERGE_3D_ACTIVE 0x0E4
29+#define CTL_DSC_ACTIVE 0x0E8
2930 #define CTL_WB_ACTIVE 0x0EC
3031 #define CTL_INTF_ACTIVE 0x0F4
32+#define CTL_FETCH_PIPE_ACTIVE 0x0FC
3133 #define CTL_MERGE_3D_FLUSH 0x100
32−#define CTL_DSC_ACTIVE 0x0E8
3334 #define CTL_DSC_FLUSH 0x104
3435 #define CTL_WB_FLUSH 0x108
3536 #define CTL_INTF_FLUSH 0x110
3637 #define CTL_INTF_MASTER 0x134
37−#define CTL_FETCH_PIPE_ACTIVE 0x0FC
38+#define CTL_DSPP_n_FLUSH(n) ((0x13C) + ((n) * 4))
3839
3940 #define CTL_MIXER_BORDER_OUT BIT(24)
4041 #define CTL_FLUSH_MASK_CTL BIT(17)
@@ -44,6 +45,7 @@ · 3 unmodified lines
4445 #define DSC_IDX 22
4546 #define INTF_IDX 31
4647 #define WB_IDX 16
48+#define DSPP_IDX 29 /* From DPU hw rev 7.x.x */
4749 #define CTL_INVALID_BIT 0xffff
4850 #define CTL_DEFAULT_GROUP_ID 0xf
4951
@@ -115,6 +117,9 @@ static inline void dpu_hw_ctl_clear_pending_flush(struct dpu_hw_ctl *ctx) · 65 unmodified lines
115117 trace_dpu_hw_ctl_clear_pending_flush(ctx->pending_flush_mask,
116118 dpu_hw_ctl_get_flush_register(ctx));
117119 ctx->pending_flush_mask = 0x0;
120+
121+ memset(ctx->pending_dspp_flush_mask, 0,
122+ sizeof(ctx->pending_dspp_flush_mask));
118123 }
119124
120125 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
132137
133138 static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx)
134139 {
140+ int dspp;
141+
135142 if (ctx->pending_flush_mask & BIT(MERGE_3D_IDX))
136143 DPU_REG_WRITE(&ctx->hw, CTL_MERGE_3D_FLUSH,
137144 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
142149 DPU_REG_WRITE(&ctx->hw, CTL_WB_FLUSH,
143150 ctx->pending_wb_flush_mask);
144151
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+ }
145159 DPU_REG_WRITE(&ctx->hw, CTL_FLUSH, ctx->pending_flush_mask);
146160 }
147161
@@ -289,7 +303,7 @@ static void dpu_hw_ctl_update_pending_flush_merge_3d_v1(struct dpu_hw_ctl *ctx, · 141 unmodified lines
289303 }
290304
291305 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)
293307 {
294308 switch (dspp) {
295309 case DSPP_0:
@@ -309,6 +323,29 @@ static void dpu_hw_ctl_update_pending_flush_dspp(struct dpu_hw_ctl *ctx, · 13 unmodified lines
309323 }
310324 }
311325
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+
312349 static u32 dpu_hw_ctl_poll_reset_status(struct dpu_hw_ctl *ctx, u32 timeout_us)
313350 {
314351 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
630667 ops->setup_blendstage = dpu_hw_ctl_setup_blendstage;
631668 ops->update_pending_flush_sspp = dpu_hw_ctl_update_pending_flush_sspp;
632669 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+
634675 if (cap & BIT(DPU_CTL_FETCH_ACTIVE))
635676 ops->set_active_pipes = dpu_hw_ctl_set_fetch_pipe_active;
636677 };
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h+4−1
@@ -152,9 +152,11 @@ struct dpu_hw_ctl_ops { · 151 unmodified lines
152152 * No effect on hardware
153153 * @ctx : ctl path ctx pointer
154154 * @blk : DSPP block index
155+ * @dspp_sub_blk : DSPP sub-block index
155156 */
156157 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+
158160 /**
159161 * Write the value of the pending_flush_mask to hardware
160162 * @ctx : ctl path ctx pointer
@@ -242,6 +244,7 @@ struct dpu_hw_ctl { · 81 unmodified lines
242244 u32 pending_intf_flush_mask;
243245 u32 pending_wb_flush_mask;
244246 u32 pending_merge_3d_flush_mask;
247+ u32 pending_dspp_flush_mask[DSPP_MAX - DSPP_0];
245248
246249 /* ops */
247250 struct dpu_hw_ctl_ops ops;
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c+2−2
@@ -175,7 +175,7 @@ static void dpu_hw_dsc_bind_pingpong_blk( · 174 unmodified lines
175175 DPU_REG_WRITE(c, dsc_ctl_offset, mux_cfg);
176176 }
177177
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,
179179 const struct dpu_mdss_cfg *m,
180180 void __iomem *addr,
181181 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
207207 const struct dpu_mdss_cfg *m)
208208 {
209209 struct dpu_hw_dsc *c;
210− struct dpu_dsc_cfg *cfg;
210+ const struct dpu_dsc_cfg *cfg;
211211
212212 c = kzalloc(sizeof(*c), GFP_KERNEL);
213213 if (!c)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c+7−1
@@ -62,6 +62,7 @@ · 61 unmodified lines
6262 #define INTF_LINE_COUNT 0x0B0
6363
6464 #define INTF_MUX 0x25C
65+#define INTF_STATUS 0x26C
6566
6667 #define INTF_CFG_ACTIVE_H_EN BIT(29)
6768 #define INTF_CFG_ACTIVE_V_EN BIT(30)
@@ -297,8 +298,13 @@ static void dpu_hw_intf_get_status( · 229 unmodified lines
297298 struct intf_status *s)
298299 {
299300 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);
300307
301− s->is_en = DPU_REG_READ(c, INTF_TIMING_ENGINE_EN);
302308 s->is_prog_fetch_en = !!(DPU_REG_READ(c, INTF_CONFIG) & BIT(31));
303309 if (s->is_en) {
304310 s->frame_count = DPU_REG_READ(c, INTF_FRAME_COUNT);
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c+98−89
@@ -136,7 +136,7 @@ · 135 unmodified lines
136136 #define TS_CLK 19200000
137137
138138
139−static int _sspp_subblk_offset(struct dpu_hw_pipe *ctx,
139+static int _sspp_subblk_offset(struct dpu_hw_sspp *ctx,
140140 int s_id,
141141 u32 *idx)
142142 {
@@ -168,17 +168,16 @@ static int _sspp_subblk_offset(struct dpu_hw_pipe *ctx, · 25 unmodified lines
168168 return rc;
169169 }
170170
171−static void dpu_hw_sspp_setup_multirect(struct dpu_hw_pipe *ctx,
172− enum dpu_sspp_multirect_index index,
173− enum dpu_sspp_multirect_mode mode)
171+static void dpu_hw_sspp_setup_multirect(struct dpu_sw_pipe *pipe)
174172 {
173+ struct dpu_hw_sspp *ctx = pipe->sspp;
175174 u32 mode_mask;
176175 u32 idx;
177176
178177 if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx))
179178 return;
180179
181− if (index == DPU_SSPP_RECT_SOLO) {
180+ if (pipe->multirect_index == DPU_SSPP_RECT_SOLO) {
182181 /**
183182 * if rect index is RECT_SOLO, we cannot expect a
184183 * 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
187186 mode_mask = 0;
188187 } else {
189188 mode_mask = DPU_REG_READ(&ctx->hw, SSPP_MULTIRECT_OPMODE + idx);
190− mode_mask |= index;
191− if (mode == DPU_SSPP_MULTIRECT_TIME_MX)
189+ mode_mask |= pipe->multirect_index;
190+ if (pipe->multirect_mode == DPU_SSPP_MULTIRECT_TIME_MX)
192191 mode_mask |= BIT(2);
193192 else
194193 mode_mask &= ~BIT(2);
@@ -197,7 +196,7 @@ static void dpu_hw_sspp_setup_multirect(struct dpu_hw_pipe *ctx, · 2 unmodified lines
197196 DPU_REG_WRITE(&ctx->hw, SSPP_MULTIRECT_OPMODE + idx, mode_mask);
198197 }
199198
200−static void _sspp_setup_opmode(struct dpu_hw_pipe *ctx,
199+static void _sspp_setup_opmode(struct dpu_hw_sspp *ctx,
201200 u32 mask, u8 en)
202201 {
203202 u32 idx;
@@ -218,7 +217,7 @@ static void _sspp_setup_opmode(struct dpu_hw_pipe *ctx, · 14 unmodified lines
218217 DPU_REG_WRITE(&ctx->hw, SSPP_VIG_OP_MODE + idx, opmode);
219218 }
220219
221−static void _sspp_setup_csc10_opmode(struct dpu_hw_pipe *ctx,
220+static void _sspp_setup_csc10_opmode(struct dpu_hw_sspp *ctx,
222221 u32 mask, u8 en)
223222 {
224223 u32 idx;
@@ -239,10 +238,10 @@ static void _sspp_setup_csc10_opmode(struct dpu_hw_pipe *ctx, · 14 unmodified lines
239238 /*
240239 * Setup source pixel format, flip,
241240 */
242−static void dpu_hw_sspp_setup_format(struct dpu_hw_pipe *ctx,
243− const struct dpu_format *fmt, u32 flags,
244− enum dpu_sspp_multirect_index rect_mode)
241+static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe,
242+ const struct dpu_format *fmt, u32 flags)
245243 {
244+ struct dpu_hw_sspp *ctx = pipe->sspp;
246245 struct dpu_hw_blk_reg_map *c;
247246 u32 chroma_samp, unpack, src_format;
248247 u32 opmode = 0;
@@ -253,7 +252,8 @@ static void dpu_hw_sspp_setup_format(struct dpu_hw_pipe *ctx, · 4 unmodified lines
253252 if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx) || !fmt)
254253 return;
255254
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) {
257257 op_mode_off = SSPP_SRC_OP_MODE;
258258 unpack_pat_off = SSPP_SRC_UNPACK_PATTERN;
259259 format_off = SSPP_SRC_FORMAT;
@@ -307,25 +307,25 @@ static void dpu_hw_sspp_setup_format(struct dpu_hw_pipe *ctx, · 47 unmodified lines
307307 src_format |= (fmt->fetch_mode & 3) << 30; /*FRAME_FORMAT */
308308 DPU_REG_WRITE(c, SSPP_FETCH_CONFIG,
309309 DPU_FETCH_CONFIG_RESET_VALUE |
310− ctx->mdp->highest_bank_bit << 18);
311− switch (ctx->catalog->caps->ubwc_version) {
310+ ctx->ubwc->highest_bank_bit << 18);
311+ switch (ctx->ubwc->ubwc_version) {
312312 case DPU_HW_UBWC_VER_10:
313313 fast_clear = fmt->alpha_enable ? BIT(31) : 0;
314314 DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL,
315− fast_clear | (ctx->mdp->ubwc_swizzle & 0x1) |
315+ fast_clear | (ctx->ubwc->ubwc_swizzle & 0x1) |
316316 BIT(8) |
317− (ctx->mdp->highest_bank_bit << 4));
317+ (ctx->ubwc->highest_bank_bit << 4));
318318 break;
319319 case DPU_HW_UBWC_VER_20:
320320 fast_clear = fmt->alpha_enable ? BIT(31) : 0;
321321 DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL,
322− fast_clear | (ctx->mdp->ubwc_swizzle) |
323− (ctx->mdp->highest_bank_bit << 4));
322+ fast_clear | (ctx->ubwc->ubwc_swizzle) |
323+ (ctx->ubwc->highest_bank_bit << 4));
324324 break;
325325 case DPU_HW_UBWC_VER_30:
326326 DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL,
327− BIT(30) | (ctx->mdp->ubwc_swizzle) |
328− (ctx->mdp->highest_bank_bit << 4));
327+ BIT(30) | (ctx->ubwc->ubwc_swizzle) |
328+ (ctx->ubwc->highest_bank_bit << 4));
329329 break;
330330 case DPU_HW_UBWC_VER_40:
331331 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
360360 DPU_REG_WRITE(c, SSPP_UBWC_ERROR_STATUS + idx, BIT(31));
361361 }
362362
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,
364364 struct dpu_hw_pixel_ext *pe_ext)
365365 {
366366 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
418418 tot_req_pixels[3]);
419419 }
420420
421−static void _dpu_hw_sspp_setup_scaler3(struct dpu_hw_pipe *ctx,
422− struct dpu_hw_pipe_cfg *sspp,
423− void *scaler_cfg)
421+static void _dpu_hw_sspp_setup_scaler3(struct dpu_hw_sspp *ctx,
422+ struct dpu_hw_scaler3_cfg *scaler3_cfg,
423+ const struct dpu_format *format)
424424 {
425425 u32 idx;
426− struct dpu_hw_scaler3_cfg *scaler3_cfg = scaler_cfg;
427426
428− if (_sspp_subblk_offset(ctx, DPU_SSPP_SCALER_QSEED3, &idx) || !sspp
427+ if (_sspp_subblk_offset(ctx, DPU_SSPP_SCALER_QSEED3, &idx)
429428 || !scaler3_cfg)
430429 return;
431430
432431 dpu_hw_setup_scaler3(&ctx->hw, scaler3_cfg, idx,
433432 ctx->cap->sblk->scaler_blk.version,
434− sspp->layout.format);
433+ format);
435434 }
436435
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)
438437 {
439438 u32 idx;
440439
@@ -447,12 +446,12 @@ static u32 _dpu_hw_sspp_get_scaler3_ver(struct dpu_hw_pipe *ctx) · 6 unmodified lines
447446 /*
448447 * dpu_hw_sspp_setup_rects()
449448 */
450−static void dpu_hw_sspp_setup_rects(struct dpu_hw_pipe *ctx,
451− struct dpu_hw_pipe_cfg *cfg,
452− enum dpu_sspp_multirect_index rect_index)
449+static void dpu_hw_sspp_setup_rects(struct dpu_sw_pipe *pipe,
450+ struct dpu_sw_pipe_cfg *cfg)
453451 {
452+ struct dpu_hw_sspp *ctx = pipe->sspp;
454453 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;
456455 u32 src_size_off, src_xy_off, out_size_off, out_xy_off;
457456 u32 idx;
458457
@@ -461,7 +460,8 @@ static void dpu_hw_sspp_setup_rects(struct dpu_hw_pipe *ctx, · 2 unmodified lines
461460
462461 c = &ctx->hw;
463462
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) {
465465 src_size_off = SSPP_SRC_SIZE;
466466 src_xy_off = SSPP_SRC_XY;
467467 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
482482 dst_size = (drm_rect_height(&cfg->dst_rect) << 16) |
483483 drm_rect_width(&cfg->dst_rect);
484484
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−
509485 /* rectangle register programming */
510486 DPU_REG_WRITE(c, src_size_off + idx, src_size);
511487 DPU_REG_WRITE(c, src_xy_off + idx, src_xy);
512488 DPU_REG_WRITE(c, out_size_off + idx, dst_size);
513489 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);
517490 }
518491
519−static void dpu_hw_sspp_setup_sourceaddress(struct dpu_hw_pipe *ctx,
520− struct dpu_hw_pipe_cfg *cfg,
521− enum dpu_sspp_multirect_index rect_mode)
492+static void dpu_hw_sspp_setup_sourceaddress(struct dpu_sw_pipe *pipe,
493+ struct dpu_hw_fmt_layout *layout)
522494 {
495+ struct dpu_hw_sspp *ctx = pipe->sspp;
496+ u32 ystride0, ystride1;
523497 int i;
524498 u32 idx;
525499
526500 if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx))
527501 return;
528502
529− if (rect_mode == DPU_SSPP_RECT_SOLO) {
530− for (i = 0; i < ARRAY_SIZE(cfg->layout.plane_addr); i++)
503+ if (pipe->multirect_index == DPU_SSPP_RECT_SOLO) {
504+ for (i = 0; i < ARRAY_SIZE(layout->plane_addr); i++)
531505 DPU_REG_WRITE(&ctx->hw, SSPP_SRC0_ADDR + idx + i * 0x4,
532− cfg->layout.plane_addr[i]);
533− } else if (rect_mode == DPU_SSPP_RECT_0) {
506+ layout->plane_addr[i]);
507+ } else if (pipe->multirect_index == DPU_SSPP_RECT_0) {
534508 DPU_REG_WRITE(&ctx->hw, SSPP_SRC0_ADDR + idx,
535− cfg->layout.plane_addr[0]);
509+ layout->plane_addr[0]);
536510 DPU_REG_WRITE(&ctx->hw, SSPP_SRC2_ADDR + idx,
537− cfg->layout.plane_addr[2]);
511+ layout->plane_addr[2]);
538512 } else {
539513 DPU_REG_WRITE(&ctx->hw, SSPP_SRC1_ADDR + idx,
540− cfg->layout.plane_addr[0]);
514+ layout->plane_addr[0]);
541515 DPU_REG_WRITE(&ctx->hw, SSPP_SRC3_ADDR + idx,
542− cfg->layout.plane_addr[2]);
516+ layout->plane_addr[2]);
543517 }
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);
544545 }
545546
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,
547548 const struct dpu_csc_cfg *data)
548549 {
549550 u32 idx;
@@ -560,22 +561,28 @@ static void dpu_hw_sspp_setup_csc(struct dpu_hw_pipe *ctx, · 10 unmodified lines
560561 dpu_hw_csc_setup(&ctx->hw, idx, data, csc10);
561562 }
562563
563−static void dpu_hw_sspp_setup_solidfill(struct dpu_hw_pipe *ctx, u32 color, enum
564− dpu_sspp_multirect_index rect_index)
564+static void dpu_hw_sspp_setup_solidfill(struct dpu_sw_pipe *pipe, u32 color)
565565 {
566+ struct dpu_hw_sspp *ctx = pipe->sspp;
567+ struct dpu_hw_fmt_layout cfg;
566568 u32 idx;
567569
568570 if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx))
569571 return;
570572
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)
572579 DPU_REG_WRITE(&ctx->hw, SSPP_SRC_CONSTANT_COLOR + idx, color);
573580 else
574581 DPU_REG_WRITE(&ctx->hw, SSPP_SRC_CONSTANT_COLOR_REC1 + idx,
575582 color);
576583 }
577584
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,
579586 u32 danger_lut,
580587 u32 safe_lut)
581588 {
@@ -588,7 +595,7 @@ static void dpu_hw_sspp_setup_danger_safe_lut(struct dpu_hw_pipe *ctx, · 6 unmodified lines
588595 DPU_REG_WRITE(&ctx->hw, SSPP_SAFE_LUT + idx, safe_lut);
589596 }
590597
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,
592599 u64 creq_lut)
593600 {
594601 u32 idx;
@@ -605,7 +612,7 @@ static void dpu_hw_sspp_setup_creq_lut(struct dpu_hw_pipe *ctx, · 10 unmodified lines
605612 }
606613 }
607614
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,
609616 struct dpu_hw_pipe_qos_cfg *cfg)
610617 {
611618 u32 idx;
@@ -630,10 +637,10 @@ static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_pipe *ctx, · 18 unmodified lines
630637 DPU_REG_WRITE(&ctx->hw, SSPP_QOS_CTRL + idx, qos_ctrl);
631638 }
632639
633−static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx,
634− struct dpu_hw_cdp_cfg *cfg,
635− enum dpu_sspp_multirect_index index)
640+static void dpu_hw_sspp_setup_cdp(struct dpu_sw_pipe *pipe,
641+ struct dpu_hw_cdp_cfg *cfg)
636642 {
643+ struct dpu_hw_sspp *ctx = pipe->sspp;
637644 u32 idx;
638645 u32 cdp_cntl = 0;
639646 u32 cdp_cntl_offset = 0;
@@ -644,7 +651,8 @@ static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx, · 4 unmodified lines
644651 if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx))
645652 return;
646653
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)
648656 cdp_cntl_offset = SSPP_CDP_CNTL;
649657 else
650658 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
661669 DPU_REG_WRITE(&ctx->hw, cdp_cntl_offset, cdp_cntl);
662670 }
663671
664−static void _setup_layer_ops(struct dpu_hw_pipe *c,
672+static void _setup_layer_ops(struct dpu_hw_sspp *c,
665673 unsigned long features)
666674 {
667675 if (test_bit(DPU_SSPP_SRC, &features)) {
@@ -699,7 +707,8 @@ static void _setup_layer_ops(struct dpu_hw_pipe *c, · 31 unmodified lines
699707 }
700708
701709 #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)
703712 {
704713 const struct dpu_sspp_cfg *cfg = hw_pipe->cap;
705714 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
783792 return ERR_PTR(-ENOMEM);
784793 }
785794
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,
787796 void __iomem *addr, const struct dpu_mdss_cfg *catalog)
788797 {
789− struct dpu_hw_pipe *hw_pipe;
798+ struct dpu_hw_sspp *hw_pipe;
790799 const struct dpu_sspp_cfg *cfg;
791800
792801 if (!addr || !catalog)
@@ -804,7 +813,7 @@ struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx, · 11 unmodified lines
804813
805814 /* Assign ops */
806815 hw_pipe->catalog = catalog;
807− hw_pipe->mdp = &catalog->mdp[0];
816+ hw_pipe->ubwc = catalog->ubwc;
808817 hw_pipe->idx = idx;
809818 hw_pipe->cap = cfg;
810819 _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
812821 return hw_pipe;
813822 }
814823
815−void dpu_hw_sspp_destroy(struct dpu_hw_pipe *ctx)
824+void dpu_hw_sspp_destroy(struct dpu_hw_sspp *ctx)
816825 {
817826 kfree(ctx);
818827 }
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h+53−62
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include "dpu_hw_util.h"
1111 #include "dpu_formats.h"
1212
13−struct dpu_hw_pipe;
13+struct dpu_hw_sspp;
1414
1515 /**
1616 * Flags
@@ -153,20 +153,14 @@ struct dpu_hw_pixel_ext { · 136 unmodified lines
153153 };
154154
155155 /**
156− * struct dpu_hw_pipe_cfg : Pipe description
157− * @layout: format layout information for programming buffer to hardware
156+ * struct dpu_sw_pipe_cfg : software pipe configuration
158157 * @src_rect: src ROI, caller takes into account the different operations
159158 * such as decimation, flip etc to program this field
160159 * @dest_rect: destination ROI.
161− * @index: index of the rectangle of SSPP
162− * @mode: parallel or time multiplex multirect mode
163160 */
164−struct dpu_hw_pipe_cfg {
165− struct dpu_hw_fmt_layout layout;
161+struct dpu_sw_pipe_cfg {
166162 struct drm_rect src_rect;
167163 struct drm_rect dst_rect;
168− enum dpu_sspp_multirect_index index;
169− enum dpu_sspp_multirect_mode mode;
170164 };
171165
172166 /**
@@ -201,6 +195,18 @@ struct dpu_hw_pipe_ts_cfg { · 28 unmodified lines
201195 u64 time;
202196 };
203197
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+
204210 /**
205211 * struct dpu_hw_sspp_ops - interface to the SSPP Hw driver functions
206212 * 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
209215 struct dpu_hw_sspp_ops {
210216 /**
211217 * setup_format - setup pixel format cropping rectangle, flip
212− * @ctx: Pointer to pipe context
218+ * @pipe: Pointer to software pipe context
213219 * @cfg: Pointer to pipe config structure
214220 * @flags: Extra flags for format config
215− * @index: rectangle index in multirect
216221 */
217− void (*setup_format)(struct dpu_hw_pipe *ctx,
218− const struct dpu_format *fmt, u32 flags,
219− enum dpu_sspp_multirect_index index);
222+ void (*setup_format)(struct dpu_sw_pipe *pipe,
223+ const struct dpu_format *fmt, u32 flags);
220224
221225 /**
222226 * setup_rects - setup pipe ROI rectangles
223− * @ctx: Pointer to pipe context
227+ * @pipe: Pointer to software pipe context
224228 * @cfg: Pointer to pipe config structure
225− * @index: rectangle index in multirect
226229 */
227− void (*setup_rects)(struct dpu_hw_pipe *ctx,
228− struct dpu_hw_pipe_cfg *cfg,
229− enum dpu_sspp_multirect_index index);
230+ void (*setup_rects)(struct dpu_sw_pipe *pipe,
231+ struct dpu_sw_pipe_cfg *cfg);
230232
231233 /**
232234 * setup_pe - setup pipe pixel extension
233235 * @ctx: Pointer to pipe context
234236 * @pe_ext: Pointer to pixel ext settings
235237 */
236− void (*setup_pe)(struct dpu_hw_pipe *ctx,
238+ void (*setup_pe)(struct dpu_hw_sspp *ctx,
237239 struct dpu_hw_pixel_ext *pe_ext);
238240
239241 /**
240242 * setup_sourceaddress - setup pipe source addresses
241− * @ctx: Pointer to pipe context
242− * @cfg: Pointer to pipe config structure
243− * @index: rectangle index in multirect
243+ * @pipe: Pointer to software pipe context
244+ * @layout: format layout information for programming buffer to hardware
244245 */
245− void (*setup_sourceaddress)(struct dpu_hw_pipe *ctx,
246− struct dpu_hw_pipe_cfg *cfg,
247− enum dpu_sspp_multirect_index index);
246+ void (*setup_sourceaddress)(struct dpu_sw_pipe *ctx,
247+ struct dpu_hw_fmt_layout *layout);
248248
249249 /**
250250 * setup_csc - setup color space coversion
251251 * @ctx: Pointer to pipe context
252252 * @data: Pointer to config structure
253253 */
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);
255255
256256 /**
257257 * setup_solidfill - enable/disable colorfill
258− * @ctx: Pointer to pipe context
258+ * @pipe: Pointer to software pipe context
259259 * @const_color: Fill color value
260260 * @flags: Pipe flags
261− * @index: rectangle index in multirect
262261 */
263− void (*setup_solidfill)(struct dpu_hw_pipe *ctx, u32 color,
264− enum dpu_sspp_multirect_index index);
262+ void (*setup_solidfill)(struct dpu_sw_pipe *pipe, u32 color);
265263
266264 /**
267265 * setup_multirect - setup multirect configuration
268− * @ctx: Pointer to pipe context
269− * @index: rectangle index in multirect
270− * @mode: parallel fetch / time multiplex multirect mode
266+ * @pipe: Pointer to software pipe context
271267 */
272268
273− void (*setup_multirect)(struct dpu_hw_pipe *ctx,
274− enum dpu_sspp_multirect_index index,
275− enum dpu_sspp_multirect_mode mode);
269+ void (*setup_multirect)(struct dpu_sw_pipe *pipe);
276270
277271 /**
278272 * setup_sharpening - setup sharpening
279273 * @ctx: Pointer to pipe context
280274 * @cfg: Pointer to config structure
281275 */
282− void (*setup_sharpening)(struct dpu_hw_pipe *ctx,
276+ void (*setup_sharpening)(struct dpu_hw_sspp *ctx,
283277 struct dpu_hw_sharp_cfg *cfg);
284278
285279 /**
@@ -289,7 +283,7 @@ struct dpu_hw_sspp_ops { · 3 unmodified lines
289283 * @safe_lut: LUT for generate safe level based on fill level
290284 *
291285 */
292− void (*setup_danger_safe_lut)(struct dpu_hw_pipe *ctx,
286+ void (*setup_danger_safe_lut)(struct dpu_hw_sspp *ctx,
293287 u32 danger_lut,
294288 u32 safe_lut);
295289
@@ -299,7 +293,7 @@ struct dpu_hw_sspp_ops { · 3 unmodified lines
299293 * @creq_lut: LUT for generate creq level based on fill level
300294 *
301295 */
302− void (*setup_creq_lut)(struct dpu_hw_pipe *ctx,
296+ void (*setup_creq_lut)(struct dpu_hw_sspp *ctx,
303297 u64 creq_lut);
304298
305299 /**
@@ -308,7 +302,7 @@ struct dpu_hw_sspp_ops { · 2 unmodified lines
308302 * @cfg: Pointer to pipe QoS configuration
309303 *
310304 */
311− void (*setup_qos_ctrl)(struct dpu_hw_pipe *ctx,
305+ void (*setup_qos_ctrl)(struct dpu_hw_sspp *ctx,
312306 struct dpu_hw_pipe_qos_cfg *cfg);
313307
314308 /**
@@ -316,51 +310,48 @@ struct dpu_hw_sspp_ops { · 1 unmodified line
316310 * @ctx: Pointer to pipe context
317311 * @cfg: Pointer to histogram configuration
318312 */
319− void (*setup_histogram)(struct dpu_hw_pipe *ctx,
313+ void (*setup_histogram)(struct dpu_hw_sspp *ctx,
320314 void *cfg);
321315
322316 /**
323317 * setup_scaler - setup scaler
324− * @ctx: Pointer to pipe context
325− * @pipe_cfg: Pointer to pipe configuration
326− * @scaler_cfg: Pointer to scaler configuration
318+ * @scaler3_cfg: Pointer to scaler configuration
319+ * @format: pixel format parameters
327320 */
328− void (*setup_scaler)(struct dpu_hw_pipe *ctx,
329− struct dpu_hw_pipe_cfg *pipe_cfg,
330− void *scaler_cfg);
321+ void (*setup_scaler)(struct dpu_hw_sspp *ctx,
322+ struct dpu_hw_scaler3_cfg *scaler3_cfg,
323+ const struct dpu_format *format);
331324
332325 /**
333326 * get_scaler_ver - get scaler h/w version
334327 * @ctx: Pointer to pipe context
335328 */
336− u32 (*get_scaler_ver)(struct dpu_hw_pipe *ctx);
329+ u32 (*get_scaler_ver)(struct dpu_hw_sspp *ctx);
337330
338331 /**
339332 * setup_cdp - setup client driven prefetch
340− * @ctx: Pointer to pipe context
333+ * @pipe: Pointer to software pipe context
341334 * @cfg: Pointer to cdp configuration
342− * @index: rectangle index in multirect
343335 */
344− void (*setup_cdp)(struct dpu_hw_pipe *ctx,
345− struct dpu_hw_cdp_cfg *cfg,
346− enum dpu_sspp_multirect_index index);
336+ void (*setup_cdp)(struct dpu_sw_pipe *pipe,
337+ struct dpu_hw_cdp_cfg *cfg);
347338 };
348339
349340 /**
350− * struct dpu_hw_pipe - pipe description
341+ * struct dpu_hw_sspp - pipe description
351342 * @base: hardware block base structure
352343 * @hw: block hardware details
353344 * @catalog: back pointer to catalog
354− * @mdp: pointer to associated mdp portion of the catalog
345+ * @ubwc: ubwc configuration data
355346 * @idx: pipe index
356347 * @cap: pointer to layer_cfg
357348 * @ops: pointer to operations possible for this pipe
358349 */
359−struct dpu_hw_pipe {
350+struct dpu_hw_sspp {
360351 struct dpu_hw_blk base;
361352 struct dpu_hw_blk_reg_map hw;
362353 const struct dpu_mdss_cfg *catalog;
363− const struct dpu_mdp_cfg *mdp;
354+ const struct dpu_ubwc_cfg *ubwc;
364355
365356 /* Pipe */
366357 enum dpu_sspp idx;
@@ -378,7 +369,7 @@ struct dpu_kms; · 11 unmodified lines
378369 * @addr: Mapped register io address of MDP
379370 * @catalog : Pointer to mdss catalog data
380371 */
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,
382373 void __iomem *addr, const struct dpu_mdss_cfg *catalog);
383374
384375 /**
@@ -386,10 +377,10 @@ struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx, · 1 unmodified line
386377 * should be called during Hw pipe cleanup.
387378 * @ctx: Pointer to SSPP driver context returned by dpu_hw_sspp_init
388379 */
389−void dpu_hw_sspp_destroy(struct dpu_hw_pipe *ctx);
380+void dpu_hw_sspp_destroy(struct dpu_hw_sspp *ctx);
390381
391−void dpu_debugfs_sspp_init(struct dpu_kms *dpu_kms, struct dentry *debugfs_root);
392−int _dpu_hw_sspp_init_debugfs(struct dpu_hw_pipe *hw_pipe, struct dpu_kms *kms, struct dentry *entry);
382+int _dpu_hw_sspp_init_debugfs(struct dpu_hw_sspp *hw_pipe, struct dpu_kms *kms,
383+ struct dentry *entry);
393384
394385 #endif /*_DPU_HW_SSPP_H */
395386
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c+39−59
@@ -250,6 +250,24 @@ void dpu_debugfs_create_regset32(const char *name, umode_t mode, · 249 unmodified lines
250250 debugfs_create_file(name, mode, parent, regset, &dpu_regset32_fops);
251251 }
252252
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+
253271 static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
254272 {
255273 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
411429 pm_runtime_put_sync(&dpu_kms->pdev->dev);
412430 }
413431
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−
448432 static void dpu_kms_flush_commit(struct msm_kms *kms, unsigned crtc_mask)
449433 {
450434 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
491475 return;
492476 }
493477
494− if (!crtc->state->active) {
478+ if (!drm_atomic_crtc_effectively_active(crtc->state)) {
495479 DPU_DEBUG("[crtc:%d] not active\n", crtc->base.id);
496480 return;
497481 }
@@ -953,8 +937,6 @@ static const struct msm_kms_funcs kms_funcs = { · 455 unmodified lines
953937 .irq = dpu_core_irq,
954938 .enable_commit = dpu_kms_enable_commit,
955939 .disable_commit = dpu_kms_disable_commit,
956− .vsync_time = dpu_kms_vsync_time,
957− .prepare_commit = dpu_kms_prepare_commit,
958940 .flush_commit = dpu_kms_flush_commit,
959941 .wait_flush = dpu_kms_wait_flush,
960942 .complete_commit = dpu_kms_complete_commit,
@@ -1013,6 +995,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms) · 52 unmodified lines
1013995 struct dpu_kms *dpu_kms;
1014996 struct drm_device *dev;
1015997 int i, rc = -EINVAL;
998+ u32 core_rev;
1016999
10171000 if (!kms) {
10181001 DPU_ERROR("invalid kms\n");
@@ -1062,17 +1045,14 @@ static int dpu_kms_hw_init(struct msm_kms *kms) · 43 unmodified lines
10621045 if (rc < 0)
10631046 goto error;
10641047
1065− dpu_kms->core_rev = readl_relaxed(dpu_kms->mmio + 0x0);
1048+ core_rev = readl_relaxed(dpu_kms->mmio + 0x0);
10661049
1067− pr_info("dpu hardware revision:0x%x\n", dpu_kms->core_rev);
1050+ pr_info("dpu hardware revision:0x%x\n", core_rev);
10681051
1069− dpu_kms->catalog = dpu_hw_catalog_init(dpu_kms->core_rev);
1070− if (IS_ERR_OR_NULL(dpu_kms->catalog)) {
1071− rc = PTR_ERR(dpu_kms->catalog);
1072− if (!dpu_kms->catalog)
1073− rc = -EINVAL;
1074− DPU_ERROR("catalog init failed: %d\n", rc);
1075− dpu_kms->catalog = NULL;
1052+ dpu_kms->catalog = of_device_get_match_data(dev->dev);
1053+ if (!dpu_kms->catalog) {
1054+ DPU_ERROR("device config not known!\n");
1055+ rc = -EINVAL;
10761056 goto power_error;
10771057 }
10781058
@@ -1298,19 +1278,19 @@ static const struct dev_pm_ops dpu_pm_ops = { · 219 unmodified lines
12981278 };
12991279
13001280 static const struct of_device_id dpu_dt_match[] = {
1301− { .compatible = "qcom,msm8998-dpu", },
1302− { .compatible = "qcom,qcm2290-dpu", },
1303− { .compatible = "qcom,sdm845-dpu", },
1304− { .compatible = "qcom,sc7180-dpu", },
1305− { .compatible = "qcom,sc7280-dpu", },
1306− { .compatible = "qcom,sc8180x-dpu", },
1307− { .compatible = "qcom,sc8280xp-dpu", },
1308− { .compatible = "qcom,sm6115-dpu", },
1309− { .compatible = "qcom,sm8150-dpu", },
1310− { .compatible = "qcom,sm8250-dpu", },
1311− { .compatible = "qcom,sm8350-dpu", },
1312− { .compatible = "qcom,sm8450-dpu", },
1313− { .compatible = "qcom,sm8550-dpu", },
1281+ { .compatible = "qcom,msm8998-dpu", .data = &dpu_msm8998_cfg, },
1282+ { .compatible = "qcom,qcm2290-dpu", .data = &dpu_qcm2290_cfg, },
1283+ { .compatible = "qcom,sdm845-dpu", .data = &dpu_sdm845_cfg, },
1284+ { .compatible = "qcom,sc7180-dpu", .data = &dpu_sc7180_cfg, },
1285+ { .compatible = "qcom,sc7280-dpu", .data = &dpu_sc7280_cfg, },
1286+ { .compatible = "qcom,sc8180x-dpu", .data = &dpu_sc8180x_cfg, },
1287+ { .compatible = "qcom,sc8280xp-dpu", .data = &dpu_sc8280xp_cfg, },
1288+ { .compatible = "qcom,sm6115-dpu", .data = &dpu_sm6115_cfg, },
1289+ { .compatible = "qcom,sm8150-dpu", .data = &dpu_sm8150_cfg, },
1290+ { .compatible = "qcom,sm8250-dpu", .data = &dpu_sm8250_cfg, },
1291+ { .compatible = "qcom,sm8350-dpu", .data = &dpu_sm8350_cfg, },
1292+ { .compatible = "qcom,sm8450-dpu", .data = &dpu_sm8450_cfg, },
1293+ { .compatible = "qcom,sm8550-dpu", .data = &dpu_sm8550_cfg, },
13141294 {}
13151295 };
13161296 MODULE_DEVICE_TABLE(of, dpu_dt_match);
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h+0−1
@@ -68,7 +68,6 @@ · 67 unmodified lines
6868 struct dpu_kms {
6969 struct msm_kms base;
7070 struct drm_device *dev;
71− int core_rev;
7271 const struct dpu_mdss_cfg *catalog;
7372
7473 /* io/register spaces: */
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c+429−438
@@ -47,13 +47,6 @@ · 46 unmodified lines
4747 #define DPU_PLANE_COLOR_FILL_FLAG BIT(31)
4848 #define DPU_ZPOS_MAX 255
4949
50−/* multirect rect index */
51−enum {
52− R0,
53− R1,
54− R_MAX
55−};
56−
5750 /*
5851 * Default Preload Values
5952 */
@@ -69,6 +62,7 @@ static const uint32_t qcom_compressed_supported_formats[] = { · 9 unmodified lines
6962 DRM_FORMAT_ARGB8888,
7063 DRM_FORMAT_XBGR8888,
7164 DRM_FORMAT_XRGB8888,
65+ DRM_FORMAT_ARGB2101010,
7266 DRM_FORMAT_XRGB2101010,
7367 DRM_FORMAT_BGR565,
7468
@@ -104,7 +98,6 @@ struct dpu_plane { · 29 unmodified lines
10498
10599 enum dpu_sspp pipe;
106100
107− struct dpu_hw_pipe *pipe_hw;
108101 uint32_t color_fill;
109102 bool is_error;
110103 bool is_rt_pipe;
@@ -128,21 +121,19 @@ static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane) · 17 unmodified lines
128121
129122 /**
130123 * _dpu_plane_calc_bw - calculate bandwidth required for a plane
131− * @plane: Pointer to drm plane.
132− * @fb: Pointer to framebuffer associated with the given plane
124+ * @catalog: Points to dpu catalog structure
125+ * @fmt: Pointer to source buffer format
126+ * @mode: Pointer to drm display mode
133127 * @pipe_cfg: Pointer to pipe configuration
134128 * Result: Updates calculated bandwidth in the plane state.
135129 * BW Equation: src_w * src_h * bpp * fps * (v_total / v_dest)
136130 * Prefill BW Equation: line src bytes * line_time
137131 */
138−static void _dpu_plane_calc_bw(struct drm_plane *plane,
139− struct drm_framebuffer *fb,
140− struct dpu_hw_pipe_cfg *pipe_cfg)
132+static u64 _dpu_plane_calc_bw(const struct dpu_mdss_cfg *catalog,
133+ const struct dpu_format *fmt,
134+ const struct drm_display_mode *mode,
135+ struct dpu_sw_pipe_cfg *pipe_cfg)
141136 {
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);
146137 int src_width, src_height, dst_height, fps;
147138 u64 plane_prefill_bw;
148139 u64 plane_bw;
@@ -150,11 +141,6 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane, · 1 unmodified line
150141 u64 scale_factor;
151142 int vbp, vpw, vfp;
152143
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−
158144 src_width = drm_rect_width(&pipe_cfg->src_rect);
159145 src_height = drm_rect_height(&pipe_cfg->src_rect);
160146 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
162148 vbp = mode->vtotal - mode->vsync_end;
163149 vpw = mode->vsync_end - mode->vsync_start;
164150 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;
166152 scale_factor = src_height > dst_height ?
167153 mult_frac(src_height, 1, dst_height) : 1;
168154
@@ -182,61 +168,60 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane, · 13 unmodified lines
182168 do_div(plane_prefill_bw, hw_latency_lines);
183169
184170
185− pstate->plane_fetch_bw = max(plane_bw, plane_prefill_bw);
171+ return max(plane_bw, plane_prefill_bw);
186172 }
187173
188174 /**
189175 * _dpu_plane_calc_clk - calculate clock required for a plane
190− * @plane: Pointer to drm plane.
176+ * @mode: Pointer to drm display mode
191177 * @pipe_cfg: Pointer to pipe configuration
192178 * Result: Updates calculated clock in the plane state.
193179 * Clock equation: dst_w * v_total * fps * (src_h / dst_h)
194180 */
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)
196183 {
197− struct dpu_plane_state *pstate;
198− struct drm_display_mode *mode;
199184 int dst_width, src_height, dst_height, fps;
200−
201− pstate = to_dpu_plane_state(plane->state);
202− mode = &plane->state->crtc->mode;
185+ u64 plane_clk;
203186
204187 src_height = drm_rect_height(&pipe_cfg->src_rect);
205188 dst_width = drm_rect_width(&pipe_cfg->dst_rect);
206189 dst_height = drm_rect_height(&pipe_cfg->dst_rect);
207190 fps = drm_mode_vrefresh(mode);
208191
209− pstate->plane_clk =
192+ plane_clk =
210193 dst_width * mode->vtotal * fps;
211194
212195 if (src_height > dst_height) {
213− pstate->plane_clk *= src_height;
214− do_div(pstate->plane_clk, dst_height);
196+ plane_clk *= src_height;
197+ do_div(plane_clk, dst_height);
215198 }
199+
200+ return plane_clk;
216201 }
217202
218203 /**
219204 * _dpu_plane_calc_fill_level - calculate fill level of the given source format
220205 * @plane: Pointer to drm plane
206+ * @pipe: Pointer to software pipe
221207 * @fmt: Pointer to source buffer format
222208 * @src_width: width of source buffer
223209 * Return: fill level corresponding to the source buffer/format or 0 if error
224210 */
225211 static int _dpu_plane_calc_fill_level(struct drm_plane *plane,
212+ struct dpu_sw_pipe *pipe,
226213 const struct dpu_format *fmt, u32 src_width)
227214 {
228215 struct dpu_plane *pdpu;
229− struct dpu_plane_state *pstate;
230216 u32 fixed_buff_size;
231217 u32 total_fl;
232218
233− if (!fmt || !plane->state || !src_width || !fmt->bpp) {
219+ if (!fmt || !pipe || !src_width || !fmt->bpp) {
234220 DPU_ERROR("invalid arguments\n");
235221 return 0;
236222 }
237223
238224 pdpu = to_dpu_plane(plane);
239− pstate = to_dpu_plane_state(plane->state);
240225 fixed_buff_size = pdpu->catalog->caps->pixel_ram_size;
241226
242227 /* 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
252237 ((src_width + 32) * fmt->bpp);
253238 }
254239 } else {
255− if (pstate->multirect_mode == DPU_SSPP_MULTIRECT_PARALLEL) {
240+ if (pipe->multirect_mode == DPU_SSPP_MULTIRECT_PARALLEL) {
256241 total_fl = (fixed_buff_size / 2) * 2 /
257242 ((src_width + 32) * fmt->bpp);
258243 } else {
@@ -262,7 +247,7 @@ static int _dpu_plane_calc_fill_level(struct drm_plane *plane, · 3 unmodified lines
262247 }
263248
264249 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,
266251 (char *)&fmt->base.pixel_format,
267252 src_width, total_fl);
268253
@@ -272,24 +257,22 @@ static int _dpu_plane_calc_fill_level(struct drm_plane *plane, · 3 unmodified lines
272257 /**
273258 * _dpu_plane_set_qos_lut - set QoS LUT of the given plane
274259 * @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
276262 * @pipe_cfg: Pointer to pipe configuration
277263 */
278264 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)
280267 {
281268 struct dpu_plane *pdpu = to_dpu_plane(plane);
282− const struct dpu_format *fmt = NULL;
283269 u64 qos_lut;
284270 u32 total_fl = 0, lut_usage;
285271
286272 if (!pdpu->is_rt_pipe) {
287273 lut_usage = DPU_QOS_LUT_USAGE_NRT;
288274 } else {
289− fmt = dpu_get_dpu_format_ext(
290− fb->format->format,
291− fb->modifier);
292− total_fl = _dpu_plane_calc_fill_level(plane, fmt,
275+ total_fl = _dpu_plane_calc_fill_level(plane, pipe, fmt,
293276 drm_rect_width(&pipe_cfg->src_rect));
294277
295278 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
301284 qos_lut = _dpu_hw_get_qos_lut(
302285 &pdpu->catalog->perf->qos_lut_tbl[lut_usage], total_fl);
303286
304− trace_dpu_perf_set_qos_luts(pdpu->pipe - SSPP_VIG0,
287+ trace_dpu_perf_set_qos_luts(pipe->sspp->idx - SSPP_VIG0,
305288 (fmt) ? fmt->base.pixel_format : 0,
306289 pdpu->is_rt_pipe, total_fl, qos_lut, lut_usage);
307290
@@ -310,19 +293,20 @@ static void _dpu_plane_set_qos_lut(struct drm_plane *plane, · 2 unmodified lines
310293 fmt ? (char *)&fmt->base.pixel_format : NULL,
311294 pdpu->is_rt_pipe, total_fl, qos_lut);
312295
313− pdpu->pipe_hw->ops.setup_creq_lut(pdpu->pipe_hw, qos_lut);
296+ pipe->sspp->ops.setup_creq_lut(pipe->sspp, qos_lut);
314297 }
315298
316299 /**
317300 * _dpu_plane_set_danger_lut - set danger/safe LUT of the given plane
318301 * @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
320304 */
321305 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)
323308 {
324309 struct dpu_plane *pdpu = to_dpu_plane(plane);
325− const struct dpu_format *fmt = NULL;
326310 u32 danger_lut, safe_lut;
327311
328312 if (!pdpu->is_rt_pipe) {
@@ -331,10 +315,6 @@ static void _dpu_plane_set_danger_lut(struct drm_plane *plane, · 2 unmodified lines
331315 safe_lut = pdpu->catalog->perf->safe_lut_tbl
332316 [DPU_QOS_LUT_USAGE_NRT];
333317 } else {
334− fmt = dpu_get_dpu_format_ext(
335− fb->format->format,
336− fb->modifier);
337−
338318 if (fmt && DPU_FORMAT_IS_LINEAR(fmt)) {
339319 danger_lut = pdpu->catalog->perf->danger_lut_tbl
340320 [DPU_QOS_LUT_USAGE_LINEAR];
@@ -361,17 +341,19 @@ static void _dpu_plane_set_danger_lut(struct drm_plane *plane, · 20 unmodified lines
361341 danger_lut,
362342 safe_lut);
363343
364− pdpu->pipe_hw->ops.setup_danger_safe_lut(pdpu->pipe_hw,
344+ pipe->sspp->ops.setup_danger_safe_lut(pipe->sspp,
365345 danger_lut, safe_lut);
366346 }
367347
368348 /**
369349 * _dpu_plane_set_qos_ctrl - set QoS control of the given plane
370350 * @plane: Pointer to drm plane
351+ * @pipe: Pointer to software pipe
371352 * @enable: true to enable QoS control
372353 * @flags: QoS control mode (enum dpu_plane_qos)
373354 */
374355 static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane,
356+ struct dpu_sw_pipe *pipe,
375357 bool enable, u32 flags)
376358 {
377359 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
380362 memset(&pipe_qos_cfg, 0, sizeof(pipe_qos_cfg));
381363
382364 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;
384366 pipe_qos_cfg.danger_vblank =
385− pdpu->pipe_hw->cap->sblk->danger_vblank;
367+ pipe->sspp->cap->sblk->danger_vblank;
386368 pipe_qos_cfg.vblank_en = enable;
387369 }
388370
@@ -408,32 +390,35 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, · 19 unmodified lines
408390 pipe_qos_cfg.danger_vblank,
409391 pdpu->is_rt_pipe);
410392
411− pdpu->pipe_hw->ops.setup_qos_ctrl(pdpu->pipe_hw,
393+ pipe->sspp->ops.setup_qos_ctrl(pipe->sspp,
412394 &pipe_qos_cfg);
413395 }
414396
415397 /**
416398 * _dpu_plane_set_ot_limit - set OT limit for the given plane
417399 * @plane: Pointer to drm plane
418− * @crtc: Pointer to drm crtc
400+ * @pipe: Pointer to software pipe
419401 * @pipe_cfg: Pointer to pipe configuration
402+ * @frame_rate: CRTC's frame rate
420403 */
421404 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)
423408 {
424409 struct dpu_plane *pdpu = to_dpu_plane(plane);
425410 struct dpu_vbif_set_ot_params ot_params;
426411 struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
427412
428413 memset(&ot_params, 0, sizeof(ot_params));
429− ot_params.xin_id = pdpu->pipe_hw->cap->xin_id;
430− ot_params.num = pdpu->pipe_hw->idx - SSPP_NONE;
414+ ot_params.xin_id = pipe->sspp->cap->xin_id;
415+ ot_params.num = pipe->sspp->idx - SSPP_NONE;
431416 ot_params.width = drm_rect_width(&pipe_cfg->src_rect);
432417 ot_params.height = drm_rect_height(&pipe_cfg->src_rect);
433418 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;
435420 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;
437422 ot_params.rd = true;
438423
439424 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
442427 /**
443428 * _dpu_plane_set_qos_remap - set vbif QoS for the given plane
444429 * @plane: Pointer to drm plane
430+ * @pipe: Pointer to software pipe
445431 */
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)
447434 {
448435 struct dpu_plane *pdpu = to_dpu_plane(plane);
449436 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
451438
452439 memset(&qos_params, 0, sizeof(qos_params));
453440 qos_params.vbif_idx = VBIF_RT;
454− qos_params.clk_ctrl = pdpu->pipe_hw->cap->clk_ctrl;
455− qos_params.xin_id = pdpu->pipe_hw->cap->xin_id;
456− qos_params.num = pdpu->pipe_hw->idx - SSPP_VIG0;
441+ qos_params.clk_ctrl = pipe->sspp->cap->clk_ctrl;
442+ qos_params.xin_id = pipe->sspp->cap->xin_id;
443+ qos_params.num = pipe->sspp->idx - SSPP_VIG0;
457444 qos_params.is_rt = pdpu->is_rt_pipe;
458445
459446 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
465452 dpu_vbif_set_qos_remap(dpu_kms, &qos_params);
466453 }
467454
468−static void _dpu_plane_set_scanout(struct drm_plane *plane,
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,
455+static void _dpu_plane_setup_scaler3(struct dpu_hw_sspp *pipe_hw,
494456 uint32_t src_w, uint32_t src_h, uint32_t dst_w, uint32_t dst_h,
495457 struct dpu_hw_scaler3_cfg *scale_cfg,
496458 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)
498461 {
499462 uint32_t i;
500− bool inline_rotation = pstate->rotation & DRM_MODE_ROTATE_90;
463+ bool inline_rotation = rotation & DRM_MODE_ROTATE_90;
501464
502465 /*
503466 * 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
536499 scale_cfg->src_height[i] /= chroma_subsmpl_v;
537500 }
538501
539− if (pdpu->pipe_hw->cap->features &
502+ if (pipe_hw->cap->features &
540503 BIT(DPU_SSPP_SCALER_QSEED4)) {
541504 scale_cfg->preload_x[i] = DPU_QSEED4_DEFAULT_PRELOAD_H;
542505 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
607570 { 0x00, 0x3ff, 0x00, 0x3ff, 0x00, 0x3ff,},
608571 };
609572
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)
611575 {
612576 const struct dpu_csc_cfg *csc_ptr;
613577
614− if (!pdpu) {
615− DPU_ERROR("invalid plane\n");
616− return NULL;
617− }
618−
619578 if (!DPU_FORMAT_IS_YUV(fmt))
620579 return NULL;
621580
622− if (BIT(DPU_SSPP_CSC_10BIT) & pdpu->pipe_hw->cap->features)
581+ if (BIT(DPU_SSPP_CSC_10BIT) & pipe->sspp->cap->features)
623582 csc_ptr = &dpu_csc10_YUV2RGB_601L;
624583 else
625584 csc_ptr = &dpu_csc_YUV2RGB_601L;
626585
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−
632586 return csc_ptr;
633587 }
634588
635−static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu,
636− struct dpu_plane_state *pstate,
589+static void _dpu_plane_setup_scaler(struct dpu_sw_pipe *pipe,
637590 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)
639593 {
594+ struct dpu_hw_sspp *pipe_hw = pipe->sspp;
640595 const struct drm_format_info *info = drm_format_info(fmt->base.pixel_format);
641596 struct dpu_hw_scaler3_cfg scaler3_cfg;
642597 struct dpu_hw_pixel_ext pixel_ext;
@@ -650,20 +605,21 @@ static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu, · 7 unmodified lines
650605
651606 /* don't chroma subsample if decimating */
652607 /* update scaler. calculate default config for QSEED3 */
653− _dpu_plane_setup_scaler3(pdpu, pstate,
608+ _dpu_plane_setup_scaler3(pipe_hw,
654609 src_width,
655610 src_height,
656611 dst_width,
657612 dst_height,
658613 &scaler3_cfg, fmt,
659− info->hsub, info->vsub);
614+ info->hsub, info->vsub,
615+ rotation);
660616
661617 /* configure pixel extension based on scalar config */
662618 _dpu_plane_setup_pixel_ext(&scaler3_cfg, &pixel_ext,
663619 src_width, src_height, info->hsub, info->vsub);
664620
665− if (pdpu->pipe_hw->ops.setup_pe)
666− pdpu->pipe_hw->ops.setup_pe(pdpu->pipe_hw,
621+ if (pipe_hw->ops.setup_pe)
622+ pipe_hw->ops.setup_pe(pipe_hw,
667623 &pixel_ext);
668624
669625 /**
@@ -671,11 +627,44 @@ static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu, · 1 unmodified line
671627 * bypassed. Still we need to update alpha and bitwidth
672628 * ONLY for RECT0
673629 */
674− if (pdpu->pipe_hw->ops.setup_scaler &&
675− pstate->multirect_index != DPU_SSPP_RECT_1)
676− pdpu->pipe_hw->ops.setup_scaler(pdpu->pipe_hw,
677− pipe_cfg,
678− &scaler3_cfg);
630+ if (pipe_hw->ops.setup_scaler &&
631+ pipe->multirect_index != DPU_SSPP_RECT_1)
632+ pipe_hw->ops.setup_scaler(pipe_hw,
633+ &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);
679668 }
680669
681670 /**
@@ -683,15 +672,14 @@ static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu, · 1 unmodified line
683672 * @pdpu: Pointer to DPU plane object
684673 * @color: RGB fill color value, [23..16] Blue, [15..8] Green, [7..0] Red
685674 * @alpha: 8-bit fill alpha value, 255 selects 100% alpha
686− * Returns: 0 on success
687675 */
688−static int _dpu_plane_color_fill(struct dpu_plane *pdpu,
676+static void _dpu_plane_color_fill(struct dpu_plane *pdpu,
689677 uint32_t color, uint32_t alpha)
690678 {
691679 const struct dpu_format *fmt;
692680 const struct drm_plane *plane = &pdpu->base;
693681 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);
695683
696684 DPU_DEBUG_PLANE(pdpu, "\n");
697685
@@ -700,156 +688,17 @@ static int _dpu_plane_color_fill(struct dpu_plane *pdpu, · 2 unmodified lines
700688 * h/w only supports RGB variants
701689 */
702690 fmt = dpu_get_dpu_format(DRM_FORMAT_ABGR8888);
691+ /* should not happen ever */
692+ if (!fmt)
693+ return;
703694
704695 /* update sspp */
705− if (fmt && pdpu->pipe_hw->ops.setup_solidfill) {
706− pdpu->pipe_hw->ops.setup_solidfill(pdpu->pipe_hw,
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;
696+ _dpu_plane_color_fill_pipe(pstate, &pstate->pipe, &pstate->pipe_cfg.dst_rect,
697+ fill_color, fmt);
831698
832− if (dst[R1].y1 >= dst[R0].y2 + buffer_lines ||
833− dst[R0].y1 >= dst[R1].y2 + buffer_lines) {
834− pstate[R0]->multirect_mode = DPU_SSPP_MULTIRECT_TIME_MX;
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;
699+ if (pstate->r_pipe.sspp)
700+ _dpu_plane_color_fill_pipe(pstate, &pstate->r_pipe, &pstate->r_pipe_cfg.dst_rect,
701+ fill_color, fmt);
853702 }
854703
855704 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
914763 old_pstate->needs_dirtyfb);
915764 }
916765
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−
936766 static int dpu_plane_check_inline_rotation(struct dpu_plane *pdpu,
937767 const struct dpu_sspp_sub_blks *sblk,
938768 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
961791 return 0;
962792 }
963793
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+
964841 static int dpu_plane_atomic_check(struct drm_plane *plane,
965842 struct drm_atomic_state *state)
966843 {
@@ -969,14 +846,18 @@ static int dpu_plane_atomic_check(struct drm_plane *plane, · 2 unmodified lines
969846 int ret = 0, min_scale;
970847 struct dpu_plane *pdpu = to_dpu_plane(plane);
971848 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;
972851 const struct drm_crtc_state *crtc_state = NULL;
973852 const struct dpu_format *fmt;
974− struct drm_rect src, dst, fb_rect = { 0 };
975− uint32_t min_src_size, max_linewidth;
853+ struct dpu_sw_pipe_cfg *pipe_cfg = &pstate->pipe_cfg;
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;
976857 unsigned int rotation;
977858 uint32_t supported_rotations;
978− const struct dpu_sspp_cfg *pipe_hw_caps = pdpu->pipe_hw->cap;
979− const struct dpu_sspp_sub_blks *sblk = pdpu->pipe_hw->cap->sblk;
859+ const struct dpu_sspp_cfg *pipe_hw_caps = pstate->pipe.sspp->cap;
860+ const struct dpu_sspp_sub_blks *sblk = pstate->pipe.sspp->cap->sblk;
980861
981862 if (new_plane_state->crtc)
982863 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
994875 if (!new_plane_state->visible)
995876 return 0;
996877
997− src.x1 = new_plane_state->src_x >> 16;
998− src.y1 = new_plane_state->src_y >> 16;
999− src.x2 = src.x1 + (new_plane_state->src_w >> 16);
1000− src.y2 = src.y1 + (new_plane_state->src_h >> 16);
878+ pipe->multirect_index = DPU_SSPP_RECT_SOLO;
879+ pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
880+ r_pipe->multirect_index = DPU_SSPP_RECT_SOLO;
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;
1001898
1002− dst = drm_plane_state_dest(new_plane_state);
899+ pipe_cfg->dst_rect = new_plane_state->dst;
1003900
1004901 fb_rect.x2 = new_plane_state->fb->width;
1005902 fb_rect.y2 = new_plane_state->fb->height;
1006903
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+ }
1008911
1009912 fmt = to_dpu_format(msm_framebuffer_format(new_plane_state->fb));
1010913
1011− min_src_size = DPU_FORMAT_IS_YUV(fmt) ? 2 : 1;
914+ max_linewidth = pdpu->catalog->caps->max_linewidth;
1012915
1013− if (DPU_FORMAT_IS_YUV(fmt) &&
1014− (!(pipe_hw_caps->features & DPU_SSPP_SCALER) ||
1015− !(pipe_hw_caps->features & DPU_SSPP_CSC_ANY))) {
1016− DPU_DEBUG_PLANE(pdpu,
1017− "plane doesn't have scaler/csc for yuv\n");
1018− return -EINVAL;
916+ if (drm_rect_width(&pipe_cfg->src_rect) > max_linewidth) {
917+ /*
918+ * In parallel multirect case only the half of the usual width
919+ * is supported for tiled formats. If we are here, we know that
920+ * full width is more than max_linewidth, thus each rect is
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+ }
1019928
1020− /* check src bounds */
1021− } else if (!dpu_plane_validate_src(&src, &fb_rect, min_src_size)) {
1022− DPU_DEBUG_PLANE(pdpu, "invalid source " DRM_RECT_FMT "\n",
1023− DRM_RECT_ARG(&src));
1024− return -E2BIG;
929+ if (drm_rect_width(&pipe_cfg->src_rect) > 2 * max_linewidth) {
930+ DPU_DEBUG_PLANE(pdpu, "invalid src " DRM_RECT_FMT " line:%u\n",
931+ DRM_RECT_ARG(&pipe_cfg->src_rect), max_linewidth);
932+ return -E2BIG;
933+ }
1025934
1026− /* valid yuv image */
1027− } else if (DPU_FORMAT_IS_YUV(fmt) &&
1028− (src.x1 & 0x1 || src.y1 & 0x1 ||
1029− drm_rect_width(&src) & 0x1 ||
1030− drm_rect_height(&src) & 0x1)) {
1031− DPU_DEBUG_PLANE(pdpu, "invalid yuv source " DRM_RECT_FMT "\n",
1032− DRM_RECT_ARG(&src));
1033− return -EINVAL;
935+ if (drm_rect_width(&pipe_cfg->src_rect) != drm_rect_width(&pipe_cfg->dst_rect) ||
936+ drm_rect_height(&pipe_cfg->src_rect) != drm_rect_height(&pipe_cfg->dst_rect) ||
937+ (!test_bit(DPU_SSPP_SMART_DMA_V1, &pipe->sspp->cap->features) &&
938+ !test_bit(DPU_SSPP_SMART_DMA_V2, &pipe->sspp->cap->features)) ||
939+ DPU_FORMAT_IS_YUV(fmt)) {
940+ DPU_DEBUG_PLANE(pdpu, "invalid src " DRM_RECT_FMT " line:%u, can't use split source\n",
941+ DRM_RECT_ARG(&pipe_cfg->src_rect), max_linewidth);
942+ return -E2BIG;
943+ }
1034944
1035− /* min dst support */
1036− } else if (drm_rect_width(&dst) < 0x1 || drm_rect_height(&dst) < 0x1) {
1037− DPU_DEBUG_PLANE(pdpu, "invalid dest rect " DRM_RECT_FMT "\n",
1038− DRM_RECT_ARG(&dst));
1039− return -EINVAL;
945+ /*
946+ * Use multirect for wide plane. We do not support dynamic
947+ * assignment of SSPPs, so we know the configuration.
948+ */
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+ }
1040962
1041− /* check decimated source width */
1042− } else if (drm_rect_width(&src) > max_linewidth) {
1043− DPU_DEBUG_PLANE(pdpu, "invalid src " DRM_RECT_FMT " line:%u\n",
1044− DRM_RECT_ARG(&src), max_linewidth);
1045− return -E2BIG;
963+ ret = dpu_plane_atomic_check_pipe(pdpu, pipe, pipe_cfg, fmt);
964+ if (ret)
965+ return ret;
966+
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;
1046971 }
1047972
1048973 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
1055980
1056981 if ((pipe_hw_caps->features & BIT(DPU_SSPP_INLINE_ROTATION)) &&
1057982 (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);
1059984 if (ret)
1060985 return ret;
1061986 }
@@ -1066,6 +991,28 @@ static int dpu_plane_atomic_check(struct drm_plane *plane, · 4 unmodified lines
1066991 return 0;
1067992 }
1068993
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+
10691016 void dpu_plane_flush(struct drm_plane *plane)
10701017 {
10711018 struct dpu_plane *pdpu;
@@ -1089,12 +1036,9 @@ void dpu_plane_flush(struct drm_plane *plane) · 17 unmodified lines
10891036 else if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG)
10901037 /* force 100% alpha */
10911038 _dpu_plane_color_fill(pdpu, pdpu->color_fill, 0xFF);
1092− else if (pdpu->pipe_hw && pdpu->pipe_hw->ops.setup_csc) {
1093− const struct dpu_format *fmt = to_dpu_format(msm_framebuffer_format(plane->state->fb));
1094− const struct dpu_csc_cfg *csc_ptr = _dpu_plane_get_csc(pdpu, fmt);
1095−
1096− if (csc_ptr)
1097− pdpu->pipe_hw->ops.setup_csc(pdpu->pipe_hw, csc_ptr);
1039+ else {
1040+ dpu_plane_flush_csc(pdpu, &pstate->pipe);
1041+ dpu_plane_flush_csc(pdpu, &pstate->r_pipe);
10981042 }
10991043
11001044 /* flag h/w flush complete */
@@ -1118,45 +1062,24 @@ void dpu_plane_set_error(struct drm_plane *plane, bool error) · 17 unmodified lines
11181062 pdpu->is_error = error;
11191063 }
11201064
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)
11221071 {
11231072 uint32_t src_flags;
11241073 struct dpu_plane *pdpu = to_dpu_plane(plane);
11251074 struct drm_plane_state *state = plane->state;
11261075 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));
11351076
1136− _dpu_plane_set_scanout(plane, pstate, &pipe_cfg, fb);
1137−
1138− pstate->pending = true;
1139−
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;
1077+ if (layout && pipe->sspp->ops.setup_sourceaddress) {
1078+ trace_dpu_plane_set_scanout(pipe, layout);
1079+ pipe->sspp->ops.setup_sourceaddress(pipe, layout);
1080+ }
11581081
1159− pipe_cfg.dst_rect = state->dst;
1082+ _dpu_plane_set_qos_ctrl(plane, pipe, false, DPU_PLANE_QOS_PANIC_CTRL);
11601083
11611084 /* override for color fill */
11621085 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
11641087 return;
11651088 }
11661089
1167− if (pdpu->pipe_hw->ops.setup_rects) {
1168− pdpu->pipe_hw->ops.setup_rects(pdpu->pipe_hw,
1169− &pipe_cfg,
1170− pstate->multirect_index);
1090+ if (pipe->sspp->ops.setup_rects) {
1091+ pipe->sspp->ops.setup_rects(pipe,
1092+ pipe_cfg);
11711093 }
11721094
1173− _dpu_plane_setup_scaler(pdpu, pstate, fmt, false, &pipe_cfg);
1095+ _dpu_plane_setup_scaler(pipe, fmt, false, pipe_cfg, pstate->rotation);
11741096
1175− if (pdpu->pipe_hw->ops.setup_multirect)
1176− pdpu->pipe_hw->ops.setup_multirect(
1177− pdpu->pipe_hw,
1178− pstate->multirect_index,
1179− pstate->multirect_mode);
1097+ if (pipe->sspp->ops.setup_multirect)
1098+ pipe->sspp->ops.setup_multirect(
1099+ pipe);
11801100
1181− if (pdpu->pipe_hw->ops.setup_format) {
1101+ if (pipe->sspp->ops.setup_format) {
11821102 unsigned int rotation = pstate->rotation;
11831103
11841104 src_flags = 0x0;
@@ -1193,10 +1113,9 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) · 8 unmodified lines
11931113 src_flags |= DPU_SSPP_ROT_90;
11941114
11951115 /* update format */
1196− pdpu->pipe_hw->ops.setup_format(pdpu->pipe_hw, fmt, src_flags,
1197− pstate->multirect_index);
1116+ pipe->sspp->ops.setup_format(pipe, fmt, src_flags);
11981117
1199− if (pdpu->pipe_hw->ops.setup_cdp) {
1118+ if (pipe->sspp->ops.setup_cdp) {
12001119 struct dpu_hw_cdp_cfg cdp_cfg;
12011120
12021121 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
12101129 DPU_FORMAT_IS_TILE(fmt);
12111130 cdp_cfg.preload_ahead = DPU_SSPP_CDP_PRELOAD_AHEAD_64;
12121131
1213− pdpu->pipe_hw->ops.setup_cdp(pdpu->pipe_hw, &cdp_cfg, pstate->multirect_index);
1132+ pipe->sspp->ops.setup_cdp(pipe, &cdp_cfg);
12141133 }
12151134 }
12161135
1217− _dpu_plane_set_qos_lut(plane, fb, &pipe_cfg);
1218− _dpu_plane_set_danger_lut(plane, fb);
1136+ _dpu_plane_set_qos_lut(plane, pipe, fmt, pipe_cfg);
1137+ _dpu_plane_set_danger_lut(plane, pipe, fmt);
12191138
12201139 if (plane->type != DRM_PLANE_TYPE_CURSOR) {
1221− _dpu_plane_set_qos_ctrl(plane, true, DPU_PLANE_QOS_PANIC_CTRL);
1222− _dpu_plane_set_ot_limit(plane, crtc, &pipe_cfg);
1140+ _dpu_plane_set_qos_ctrl(plane, pipe, true, DPU_PLANE_QOS_PANIC_CTRL);
1141+ _dpu_plane_set_ot_limit(plane, pipe, pipe_cfg, frame_rate);
12231142 }
12241143
1225− if (pstate->needs_qos_remap) {
1226− pstate->needs_qos_remap = false;
1227− _dpu_plane_set_qos_remap(plane);
1144+ if (pstate->needs_qos_remap)
1145+ _dpu_plane_set_qos_remap(plane, pipe);
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);
12281193 }
12291194
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);
12311202
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+ }
12331208 }
12341209
12351210 static void _dpu_plane_atomic_disable(struct drm_plane *plane)
12361211 {
12371212 struct drm_plane_state *state = plane->state;
12381213 struct dpu_plane_state *pstate = to_dpu_plane_state(state);
1214+ struct dpu_sw_pipe *r_pipe = &pstate->r_pipe;
12391215
12401216 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+ }
12421226
12431227 pstate->pending = true;
12441228 }
@@ -1264,19 +1248,22 @@ static void dpu_plane_atomic_update(struct drm_plane *plane, · 19 unmodified lines
12641248 static void dpu_plane_destroy(struct drm_plane *plane)
12651249 {
12661250 struct dpu_plane *pdpu = plane ? to_dpu_plane(plane) : NULL;
1251+ struct dpu_plane_state *pstate;
12671252
12681253 DPU_DEBUG_PLANE(pdpu, "\n");
12691254
12701255 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);
12721261
12731262 mutex_destroy(&pdpu->lock);
12741263
12751264 /* this will destroy the states as well */
12761265 drm_plane_cleanup(plane);
12771266
1278− dpu_hw_sspp_destroy(pdpu->pipe_hw);
1279−
12801267 kfree(pdpu);
12811268 }
12821269 }
@@ -1352,18 +1339,36 @@ static void dpu_plane_atomic_print_state(struct drm_printer *p, · 69 unmodified lines
13521339 const struct drm_plane_state *state)
13531340 {
13541341 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;
13561346
13571347 drm_printf(p, "\tstage=%d\n", pstate->stage);
1358− drm_printf(p, "\tsspp=%s\n", pdpu->pipe_hw->cap->name);
1359− drm_printf(p, "\tmultirect_mode=%s\n", dpu_get_multirect_mode(pstate->multirect_mode));
1360− drm_printf(p, "\tmultirect_index=%s\n", dpu_get_multirect_index(pstate->multirect_index));
1348+
1349+ drm_printf(p, "\tsspp[0]=%s\n", pipe->sspp->cap->name);
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+ }
13611365 }
13621366
13631367 static void dpu_plane_reset(struct drm_plane *plane)
13641368 {
13651369 struct dpu_plane *pdpu;
13661370 struct dpu_plane_state *pstate;
1371+ struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
13671372
13681373 if (!plane) {
13691374 DPU_ERROR("invalid plane\n");
@@ -1385,6 +1390,16 @@ static void dpu_plane_reset(struct drm_plane *plane) · 15 unmodified lines
13851390 return;
13861391 }
13871392
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+
13881403 __drm_atomic_helper_plane_reset(plane, &pstate->base);
13891404 }
13901405
@@ -1392,31 +1407,18 @@ static void dpu_plane_reset(struct drm_plane *plane) · 1 unmodified line
13921407 void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
13931408 {
13941409 struct dpu_plane *pdpu = to_dpu_plane(plane);
1410+ struct dpu_plane_state *pstate = to_dpu_plane_state(plane->state);
13951411 struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
13961412
13971413 if (!pdpu->is_rt_pipe)
13981414 return;
13991415
14001416 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);
14021420 pm_runtime_put_sync(&dpu_kms->pdev->dev);
14031421 }
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−}
14201422 #endif
14211423
14221424 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
14501452 .atomic_update = dpu_plane_atomic_update,
14511453 };
14521454
1453−enum dpu_sspp dpu_plane_pipe(struct drm_plane *plane)
1454−{
1455− return plane ? to_dpu_plane(plane)->pipe : SSPP_NONE;
1456−}
1457−
14581455 /* initialize plane */
14591456 struct drm_plane *dpu_plane_init(struct drm_device *dev,
14601457 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
14651462 struct dpu_plane *pdpu;
14661463 struct msm_drm_private *priv = dev->dev_private;
14671464 struct dpu_kms *kms = to_dpu_kms(priv->kms);
1465+ struct dpu_hw_sspp *pipe_hw;
14681466 uint32_t num_formats;
14691467 uint32_t supported_rotations;
14701468 int ret = -EINVAL;
@@ -1482,24 +1480,20 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, · 11 unmodified lines
14821480 pdpu->pipe = pipe;
14831481
14841482 /* initialize underlying h/w driver */
1485− pdpu->pipe_hw = dpu_hw_sspp_init(pipe, kms->mmio, kms->catalog);
1486− if (IS_ERR(pdpu->pipe_hw)) {
1487− DPU_ERROR("[%u]SSPP init failed\n", pipe);
1488− ret = PTR_ERR(pdpu->pipe_hw);
1483+ pipe_hw = dpu_rm_get_sspp(&kms->rm, pipe);
1484+ if (!pipe_hw || !pipe_hw->cap || !pipe_hw->cap->sblk) {
1485+ DPU_ERROR("[%u]SSPP is invalid\n", pipe);
14891486 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;
14931487 }
14941488
1495− format_list = pdpu->pipe_hw->cap->sblk->format_list;
1496− num_formats = pdpu->pipe_hw->cap->sblk->num_formats;
1489+ format_list = pipe_hw->cap->sblk->format_list;
1490+ num_formats = pipe_hw->cap->sblk->num_formats;
14971491
14981492 ret = drm_universal_plane_init(dev, plane, 0xff, &dpu_plane_funcs,
14991493 format_list, num_formats,
15001494 supported_format_modifiers, type, NULL);
15011495 if (ret)
1502− goto clean_sspp;
1496+ goto clean_plane;
15031497
15041498 pdpu->catalog = kms->catalog;
15051499
@@ -1515,7 +1509,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, · 9 unmodified lines
15151509
15161510 supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180;
15171511
1518− if (pdpu->pipe_hw->cap->features & BIT(DPU_SSPP_INLINE_ROTATION))
1512+ if (pipe_hw->cap->features & BIT(DPU_SSPP_INLINE_ROTATION))
15191513 supported_rotations |= DRM_MODE_ROTATE_MASK;
15201514
15211515 drm_plane_create_rotation_property(plane,
@@ -1532,9 +1526,6 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, · 10 unmodified lines
15321526 pipe, plane->base.id);
15331527 return plane;
15341528
1535−clean_sspp:
1536− if (pdpu && pdpu->pipe_hw)
1537− dpu_hw_sspp_destroy(pdpu->pipe_hw);
15381529 clean_plane:
15391530 kfree(pdpu);
15401531 return ERR_PTR(ret);
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h+8−32
@@ -18,6 +18,10 @@ · 17 unmodified lines
1818 * struct dpu_plane_state: Define dpu extension of drm plane state object
1919 * @base: base drm plane state object
2020 * @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
2125 * @stage: assigned by crtc blender
2226 * @needs_qos_remap: qos remap settings need to be updated
2327 * @multirect_index: index of the rectangle of SSPP
@@ -31,10 +35,12 @@ · 7 unmodified lines
3135 struct dpu_plane_state {
3236 struct drm_plane_state base;
3337 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;
3442 enum dpu_stage stage;
3543 bool needs_qos_remap;
36− uint32_t multirect_index;
37− uint32_t multirect_mode;
3844 bool pending;
3945
4046 u64 plane_fetch_bw;
@@ -44,26 +50,9 @@ struct dpu_plane_state { · 3 unmodified lines
4450 unsigned int rotation;
4551 };
4652
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−
5753 #define to_dpu_plane_state(x) \
5854 container_of(x, struct dpu_plane_state, base)
5955
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−
6756 /**
6857 * dpu_plane_flush - final plane operations before commit flush
6958 * @plane: Pointer to drm plane structure
@@ -88,19 +77,6 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, · 18 unmodified lines
8877 uint32_t pipe, enum drm_plane_type type,
8978 unsigned long possible_crtcs);
9079
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−
10480 /**
10581 * dpu_plane_color_fill - enables color fill on plane
10682 * @plane: Pointer to DRM plane object
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c+22−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include "dpu_hw_lm.h"
99 #include "dpu_hw_ctl.h"
1010 #include "dpu_hw_pingpong.h"
11+#include "dpu_hw_sspp.h"
1112 #include "dpu_hw_intf.h"
1213 #include "dpu_hw_wb.h"
1314 #include "dpu_hw_dspp.h"
@@ -91,6 +92,9 @@ int dpu_rm_destroy(struct dpu_rm *rm) · 77 unmodified lines
9192 for (i = 0; i < ARRAY_SIZE(rm->hw_wb); i++)
9293 dpu_hw_wb_destroy(rm->hw_wb[i]);
9394
95+ for (i = 0; i < ARRAY_SIZE(rm->hw_sspp); i++)
96+ dpu_hw_sspp_destroy(rm->hw_sspp[i]);
97+
9498 return 0;
9599 }
96100
@@ -255,6 +259,24 @@ int dpu_rm_init(struct dpu_rm *rm, · 158 unmodified lines
255259 rm->dsc_blks[dsc->id - DSC_0] = &hw->base;
256260 }
257261
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+
258280 return 0;
259281
260282 fail:
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h+12−0
@@ -21,6 +21,7 @@ struct dpu_global_state; · 20 unmodified lines
2121 * @hw_intf: array of intf hardware resources
2222 * @hw_wb: array of wb hardware resources
2323 * @dspp_blks: array of dspp hardware resources
24+ * @hw_sspp: array of sspp hardware resources
2425 */
2526 struct dpu_rm {
2627 struct dpu_hw_blk *pingpong_blks[PINGPONG_MAX - PINGPONG_0];
@@ -31,6 +32,7 @@ struct dpu_rm { · 4 unmodified lines
3132 struct dpu_hw_blk *dspp_blks[DSPP_MAX - DSPP_0];
3233 struct dpu_hw_blk *merge_3d_blks[MERGE_3D_MAX - MERGE_3D_0];
3334 struct dpu_hw_blk *dsc_blks[DSC_MAX - DSC_0];
35+ struct dpu_hw_sspp *hw_sspp[SSPP_MAX - SSPP_NONE];
3436 };
3537
3638 /**
@@ -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
108110 return rm->hw_wb[wb_idx - WB_0];
109111 }
110112
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+
111123 #endif /* __DPU_RM_H__ */
112124
drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h+9−10
@@ -633,9 +633,9 @@ TRACE_EVENT(dpu_enc_phys_vid_irq_ctrl, · 632 unmodified lines
633633 TRACE_EVENT(dpu_crtc_setup_mixer,
634634 TP_PROTO(uint32_t crtc_id, uint32_t plane_id,
635635 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,
637637 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,
639639 pixel_format, modifier),
640640 TP_STRUCT__entry(
641641 __field( uint32_t, crtc_id )
@@ -659,9 +659,9 @@ TRACE_EVENT(dpu_crtc_setup_mixer, · 17 unmodified lines
659659 __entry->dst_rect = drm_plane_state_dest(state);
660660 __entry->stage_idx = stage_idx;
661661 __entry->stage = pstate->stage;
662− __entry->sspp = sspp;
663− __entry->multirect_idx = pstate->multirect_index;
664− __entry->multirect_mode = pstate->multirect_mode;
662+ __entry->sspp = pstate->pipe.sspp->idx;
663+ __entry->multirect_idx = pstate->pipe.multirect_index;
664+ __entry->multirect_mode = pstate->pipe.multirect_mode;
665665 __entry->pixel_format = pixel_format;
666666 __entry->modifier = modifier;
667667 ),
@@ -762,18 +762,17 @@ TRACE_EVENT(dpu_crtc_disable_frame_pending, · 94 unmodified lines
762762 );
763763
764764 TRACE_EVENT(dpu_plane_set_scanout,
765− TP_PROTO(enum dpu_sspp index, struct dpu_hw_fmt_layout *layout,
766− enum dpu_sspp_multirect_index multirect_index),
767− TP_ARGS(index, layout, multirect_index),
765+ TP_PROTO(struct dpu_sw_pipe *pipe, struct dpu_hw_fmt_layout *layout),
766+ TP_ARGS(pipe, layout),
768767 TP_STRUCT__entry(
769768 __field( enum dpu_sspp, index )
770769 __field_struct( struct dpu_hw_fmt_layout, layout )
771770 __field( enum dpu_sspp_multirect_index, multirect_index)
772771 ),
773772 TP_fast_assign(
774− __entry->index = index;
773+ __entry->index = pipe->sspp->idx;
775774 __entry->layout = *layout;
776− __entry->multirect_index = multirect_index;
775+ __entry->multirect_index = pipe->multirect_index;
777776 ),
778777 TP_printk("index:%d layout:{%ux%u @ [%u/%u, %u/%u, %u/%u, %u/%u]} "
779778 "multirect_index:%d", __entry->index, __entry->layout.width,
drivers/gpu/drm/msm/disp/mdp4/mdp4.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c+0−5
@@ -84,10 +84,6 @@ static void mdp4_disable_commit(struct msm_kms *kms) · 83 unmodified lines
8484 mdp4_disable(mdp4_kms);
8585 }
8686
87−static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *state)
88−{
89−}
90−
9187 static void mdp4_flush_commit(struct msm_kms *kms, unsigned crtc_mask)
9288 {
9389 /* TODO */
@@ -154,7 +150,6 @@ static const struct mdp_kms_funcs kms_funcs = { · 60 unmodified lines
154150 .disable_vblank = mdp4_disable_vblank,
155151 .enable_commit = mdp4_enable_commit,
156152 .disable_commit = mdp4_disable_commit,
157− .prepare_commit = mdp4_prepare_commit,
158153 .flush_commit = mdp4_flush_commit,
159154 .wait_flush = mdp4_wait_flush,
160155 .complete_commit = mdp4_complete_commit,
drivers/gpu/drm/msm/disp/mdp5/mdp5.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c+1−1
@@ -655,7 +655,7 @@ static const struct mdp5_cfg_hw msm8x96_config = { · 654 unmodified lines
655655 .max_clk = 412500000,
656656 };
657657
658−const struct mdp5_cfg_hw msm8x76_config = {
658+static const struct mdp5_cfg_hw msm8x76_config = {
659659 .name = "msm8x76",
660660 .mdp = {
661661 .count = 1,
drivers/gpu/drm/msm/disp/mdp_common.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/disp/msm_disp_snapshot.c+0−3
@@ -129,9 +129,6 @@ void msm_disp_snapshot_destroy(struct drm_device *drm_dev) · 128 unmodified lines
129129 }
130130
131131 priv = drm_dev->dev_private;
132− if (!priv->kms)
133− return;
134−
135132 kms = priv->kms;
136133
137134 if (kms->dump_worker)
drivers/gpu/drm/msm/dp/dp_aux.c+40−50
@@ -162,47 +162,6 @@ static ssize_t dp_aux_cmd_fifo_rx(struct dp_aux_private *aux, · 161 unmodified lines
162162 return i;
163163 }
164164
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−
206165 static void dp_aux_update_offset_and_segment(struct dp_aux_private *aux,
207166 struct drm_dp_aux_msg *input_msg)
208167 {
@@ -409,14 +368,14 @@ exit: · 200 unmodified lines
409368 return ret;
410369 }
411370
412−void dp_aux_isr(struct drm_dp_aux *dp_aux)
371+irqreturn_t dp_aux_isr(struct drm_dp_aux *dp_aux)
413372 {
414373 u32 isr;
415374 struct dp_aux_private *aux;
416375
417376 if (!dp_aux) {
418377 DRM_ERROR("invalid input\n");
419− return;
378+ return IRQ_NONE;
420379 }
421380
422381 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
425384
426385 /* no interrupts pending, return immediately */
427386 if (!isr)
428− return;
387+ return IRQ_NONE;
429388
430− if (!aux->cmd_busy)
431− return;
389+ if (!aux->cmd_busy) {
390+ DRM_ERROR("Unexpected DP AUX IRQ %#010x when not busy\n", isr);
391+ return IRQ_NONE;
392+ }
432393
433− if (aux->native)
434− dp_aux_native_handler(aux, isr);
435− else
436− dp_aux_i2c_handler(aux, isr);
394+ /*
395+ * The logic below assumes only one error bit is set (other than "done"
396+ * which can apparently be set at the same time as some of the other
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+ }
437425
438426 complete(&aux->comp);
427+
428+ return IRQ_HANDLED;
439429 }
440430
441431 void dp_aux_reconfig(struct drm_dp_aux *dp_aux)
drivers/gpu/drm/msm/dp/dp_aux.h+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111
1212 int dp_aux_register(struct drm_dp_aux *dp_aux);
1313 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);
1515 void dp_aux_init(struct drm_dp_aux *dp_aux);
1616 void dp_aux_deinit(struct drm_dp_aux *dp_aux);
1717 void dp_aux_reconfig(struct drm_dp_aux *dp_aux);
drivers/gpu/drm/msm/dp/dp_catalog.c+81−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #define DP_INTF_CONFIG_DATABUS_WIDEN BIT(4)
2828
2929 #define DP_INTERRUPT_STATUS1 \
30− (DP_INTR_AUX_I2C_DONE| \
30+ (DP_INTR_AUX_XFER_DONE| \
3131 DP_INTR_WRONG_ADDR | DP_INTR_TIMEOUT | \
3232 DP_INTR_NACK_DEFER | DP_INTR_WRONG_DATA_CNT | \
3333 DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER | \
@@ -47,6 +47,14 @@ · 13 unmodified lines
4747 #define DP_INTERRUPT_STATUS2_MASK \
4848 (DP_INTERRUPT_STATUS2 << DP_INTERRUPT_STATUS_MASK_SHIFT)
4949
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+
5058 struct dp_catalog_private {
5159 struct device *dev;
5260 struct drm_device *drm_dev;
@@ -359,6 +367,23 @@ void dp_catalog_ctrl_lane_mapping(struct dp_catalog *dp_catalog) · 306 unmodified lines
359367 ln_mapping);
360368 }
361369
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+
362387 void dp_catalog_ctrl_mainlink_ctrl(struct dp_catalog *dp_catalog,
363388 bool enable)
364389 {
@@ -610,6 +635,47 @@ void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog) · 245 unmodified lines
610635 dp_write_aux(catalog, REG_DP_DP_HPD_CTRL, DP_DP_HPD_CTRL_HPD_EN);
611636 }
612637
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+
613679 u32 dp_catalog_link_is_connected(struct dp_catalog *dp_catalog)
614680 {
615681 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
645711 return isr & (mask | ~DP_DP_HPD_INT_MASK);
646712 }
647713
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+
648728 int dp_catalog_ctrl_get_interrupt(struct dp_catalog *dp_catalog)
649729 {
650730 struct dp_catalog_private *catalog = container_of(dp_catalog,
drivers/gpu/drm/msm/dp/dp_catalog.h+5−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313
1414 /* interrupts */
1515 #define DP_INTR_HPD BIT(0)
16−#define DP_INTR_AUX_I2C_DONE BIT(3)
16+#define DP_INTR_AUX_XFER_DONE BIT(3)
1717 #define DP_INTR_WRONG_ADDR BIT(6)
1818 #define DP_INTR_TIMEOUT BIT(9)
1919 #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
9393 void dp_catalog_ctrl_config_ctrl(struct dp_catalog *dp_catalog, u32 config);
9494 void dp_catalog_ctrl_lane_mapping(struct dp_catalog *dp_catalog);
9595 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);
9697 void dp_catalog_ctrl_config_misc(struct dp_catalog *dp_catalog, u32 cc, u32 tb);
9798 void dp_catalog_ctrl_config_msa(struct dp_catalog *dp_catalog, u32 rate,
9899 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
104105 void dp_catalog_hpd_config_intr(struct dp_catalog *dp_catalog,
105106 u32 intr_mask, bool en);
106107 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);
107110 u32 dp_catalog_link_is_connected(struct dp_catalog *dp_catalog);
108111 u32 dp_catalog_hpd_get_intr_status(struct dp_catalog *dp_catalog);
109112 void dp_catalog_ctrl_phy_reset(struct dp_catalog *dp_catalog);
110113 int dp_catalog_ctrl_update_vx_px(struct dp_catalog *dp_catalog, u8 v_level,
111114 u8 p_level);
112115 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);
113117 void dp_catalog_ctrl_update_transfer_unit(struct dp_catalog *dp_catalog,
114118 u32 dp_tu, u32 valid_boundary,
115119 u32 valid_boundary2);
drivers/gpu/drm/msm/dp/dp_ctrl.c+88−2
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222
2323 #define DP_KHZ_TO_HZ 1000
2424 #define IDLE_PATTERN_COMPLETION_TIMEOUT_JIFFIES (30 * HZ / 1000) /* 30 ms */
25+#define PSR_OPERATION_COMPLETION_TIMEOUT_JIFFIES (300 * HZ / 1000) /* 300 ms */
2526 #define WAIT_FOR_VIDEO_READY_TIMEOUT_JIFFIES (HZ / 2)
2627
2728 #define DP_CTRL_INTR_READY_FOR_VIDEO BIT(0)
@@ -80,6 +81,7 @@ struct dp_ctrl_private { · 52 unmodified lines
8081 struct dp_catalog *catalog;
8182
8283 struct completion idle_comp;
84+ struct completion psr_op_comp;
8385 struct completion video_comp;
8486 };
8587
@@ -153,6 +155,9 @@ static void dp_ctrl_config_ctrl(struct dp_ctrl_private *ctrl) · 67 unmodified lines
153155 config |= DP_CONFIGURATION_CTRL_STATIC_DYNAMIC_CN;
154156 config |= DP_CONFIGURATION_CTRL_SYNC_ASYNC_CLK;
155157
158+ if (ctrl->panel->psr_cap.version)
159+ config |= DP_CONFIGURATION_CTRL_SEND_VSC;
160+
156161 dp_catalog_ctrl_config_ctrl(ctrl->catalog, config);
157162 }
158163
@@ -1375,6 +1380,64 @@ void dp_ctrl_reset_irq_ctrl(struct dp_ctrl *dp_ctrl, bool enable) · 1216 unmodified lines
13751380 dp_catalog_ctrl_enable_irq(ctrl->catalog, enable);
13761381 }
13771382
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+
13781441 void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl)
13791442 {
13801443 struct dp_ctrl_private *ctrl;
@@ -1979,27 +2042,49 @@ int dp_ctrl_off(struct dp_ctrl *dp_ctrl) · 598 unmodified lines
19792042 return ret;
19802043 }
19812044
1982−void dp_ctrl_isr(struct dp_ctrl *dp_ctrl)
2045+irqreturn_t dp_ctrl_isr(struct dp_ctrl *dp_ctrl)
19832046 {
19842047 struct dp_ctrl_private *ctrl;
19852048 u32 isr;
2049+ irqreturn_t ret = IRQ_NONE;
19862050
19872051 if (!dp_ctrl)
1988− return;
2052+ return IRQ_NONE;
19892053
19902054 ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
19912055
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+
19922072 isr = dp_catalog_ctrl_get_interrupt(ctrl->catalog);
19932073
2074+
19942075 if (isr & DP_CTRL_INTR_READY_FOR_VIDEO) {
19952076 drm_dbg_dp(ctrl->drm_dev, "dp_video_ready\n");
19962077 complete(&ctrl->video_comp);
2078+ ret = IRQ_HANDLED;
19972079 }
19982080
19992081 if (isr & DP_CTRL_INTR_IDLE_PATTERN_SENT) {
20002082 drm_dbg_dp(ctrl->drm_dev, "idle_patterns_sent\n");
20012083 complete(&ctrl->idle_comp);
2084+ ret = IRQ_HANDLED;
20022085 }
2086+
2087+ return ret;
20032088 }
20042089
20052090 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
20352120 dev_err(dev, "failed to add DP OPP table\n");
20362121
20372122 init_completion(&ctrl->idle_comp);
2123+ init_completion(&ctrl->psr_op_comp);
20382124 init_completion(&ctrl->video_comp);
20392125
20402126 /* in parameters */
drivers/gpu/drm/msm/dp/dp_ctrl.h+4−1
@@ -25,7 +25,7 @@ int dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl); · 24 unmodified lines
2525 int dp_ctrl_off_link(struct dp_ctrl *dp_ctrl);
2626 int dp_ctrl_off(struct dp_ctrl *dp_ctrl);
2727 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);
2929 void dp_ctrl_handle_sink_request(struct dp_ctrl *dp_ctrl);
3030 struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link,
3131 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
3737 void dp_ctrl_phy_exit(struct dp_ctrl *dp_ctrl);
3838 void dp_ctrl_irq_phy_exit(struct dp_ctrl *dp_ctrl);
3939
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+
4043 #endif /* _DP_CTRL_H_ */
drivers/gpu/drm/msm/dp/dp_display.c+30−14
@@ -406,6 +406,8 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp) · 405 unmodified lines
406406
407407 edid = dp->panel->edid;
408408
409+ dp->dp_display.psr_supported = dp->panel->psr_cap.version;
410+
409411 dp->audio_supported = drm_detect_monitor_audio(edid);
410412 dp_panel_handle_sink_request(dp->panel);
411413
@@ -910,6 +912,10 @@ static int dp_display_post_enable(struct msm_dp *dp_display) · 498 unmodified lines
910912
911913 /* signal the connect event late to synchronize video and display */
912914 dp_display_handle_plugged_change(dp_display, true);
915+
916+ if (dp_display->psr_supported)
917+ dp_ctrl_config_psr(dp->ctrl);
918+
913919 return 0;
914920 }
915921
@@ -990,14 +996,6 @@ enum drm_mode_status dp_bridge_mode_valid(struct drm_bridge *bridge, · 74 unmodified lines
990996 return -EINVAL;
991997 }
992998
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−
1001999 if (mode->clock > DP_MAX_PIXEL_CLK_KHZ)
10021000 return MODE_CLOCK_HIGH;
10031001
@@ -1104,6 +1102,19 @@ static void dp_display_config_hpd(struct dp_display_private *dp) · 100 unmodified lines
11041102 enable_irq(dp->irq);
11051103 }
11061104
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+
11071118 static int hpd_event_thread(void *data)
11081119 {
11091120 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
12041215 static irqreturn_t dp_display_irq_handler(int irq, void *dev_id)
12051216 {
12061217 struct dp_display_private *dp = dev_id;
1207− irqreturn_t ret = IRQ_HANDLED;
1218+ irqreturn_t ret = IRQ_NONE;
12081219 u32 hpd_isr_status;
12091220
12101221 if (!dp) {
@@ -1232,13 +1243,15 @@ static irqreturn_t dp_display_irq_handler(int irq, void *dev_id) · 21 unmodified lines
12321243
12331244 if (hpd_isr_status & DP_DP_HPD_UNPLUG_INT_MASK)
12341245 dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0);
1246+
1247+ ret = IRQ_HANDLED;
12351248 }
12361249
12371250 /* DP controller isr */
1238− dp_ctrl_isr(dp->ctrl);
1251+ ret |= dp_ctrl_isr(dp->ctrl);
12391252
12401253 /* DP aux isr */
1241− dp_aux_isr(dp->aux);
1254+ ret |= dp_aux_isr(dp->aux);
12421255
12431256 return ret;
12441257 }
@@ -1652,7 +1665,8 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, · 407 unmodified lines
16521665 return 0;
16531666 }
16541667
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)
16561670 {
16571671 struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge);
16581672 struct msm_dp *dp = dp_bridge->dp_display;
@@ -1707,7 +1721,8 @@ void dp_bridge_enable(struct drm_bridge *drm_bridge) · 48 unmodified lines
17071721 mutex_unlock(&dp_display->event_mutex);
17081722 }
17091723
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)
17111726 {
17121727 struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge);
17131728 struct msm_dp *dp = dp_bridge->dp_display;
@@ -1718,7 +1733,8 @@ void dp_bridge_disable(struct drm_bridge *drm_bridge) · 4 unmodified lines
17181733 dp_ctrl_push_idle(dp_display->ctrl);
17191734 }
17201735
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)
17221738 {
17231739 struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge);
17241740 struct msm_dp *dp = dp_bridge->dp_display;
drivers/gpu/drm/msm/dp/dp_display.h+2−0
@@ -29,6 +29,7 @@ struct msm_dp { · 28 unmodified lines
2929
3030 u32 max_dp_lanes;
3131 struct dp_audio *dp_audio;
32+ bool psr_supported;
3233 };
3334
3435 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
3940 int dp_display_get_test_bpp(struct msm_dp *dp_display);
4041 void dp_display_signal_audio_start(struct msm_dp *dp_display);
4142 void dp_display_signal_audio_complete(struct msm_dp *dp_display);
43+void dp_display_set_psr(struct msm_dp *dp, bool enter);
4244
4345 #endif /* _DP_DISPLAY_H_ */
drivers/gpu/drm/msm/dp/dp_drm.c+169−4
@@ -94,9 +94,9 @@ static const struct drm_bridge_funcs dp_bridge_ops = { · 93 unmodified lines
9494 .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
9595 .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
9696 .atomic_reset = drm_atomic_helper_bridge_reset,
97− .enable = dp_bridge_enable,
98− .disable = dp_bridge_disable,
99− .post_disable = dp_bridge_post_disable,
97+ .atomic_enable = dp_bridge_atomic_enable,
98+ .atomic_disable = dp_bridge_atomic_disable,
99+ .atomic_post_disable = dp_bridge_atomic_post_disable,
100100 .mode_set = dp_bridge_mode_set,
101101 .mode_valid = dp_bridge_mode_valid,
102102 .get_modes = dp_bridge_get_modes,
@@ -107,6 +107,171 @@ static const struct drm_bridge_funcs dp_bridge_ops = { · 4 unmodified lines
107107 .hpd_notify = dp_bridge_hpd_notify,
108108 };
109109
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+
110275 struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev,
111276 struct drm_encoder *encoder)
112277 {
@@ -121,7 +286,7 @@ struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device * · 8 unmodified lines
121286 dp_bridge->dp_display = dp_display;
122287
123288 bridge = &dp_bridge->bridge;
124− bridge->funcs = &dp_bridge_ops;
289+ bridge->funcs = dp_display->is_edp ? &edp_bridge_ops : &dp_bridge_ops;
125290 bridge->type = dp_display->connector_type;
126291
127292 /*
drivers/gpu/drm/msm/dp/dp_drm.h+6−3
@@ -23,9 +23,12 @@ struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct dr · 22 unmodified lines
2323 struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev,
2424 struct drm_encoder *encoder);
2525
26−void dp_bridge_enable(struct drm_bridge *drm_bridge);
27−void dp_bridge_disable(struct drm_bridge *drm_bridge);
28−void dp_bridge_post_disable(struct drm_bridge *drm_bridge);
26+void dp_bridge_atomic_enable(struct drm_bridge *drm_bridge,
27+ struct drm_bridge_state *old_bridge_state);
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);
2932 enum drm_mode_status dp_bridge_mode_valid(struct drm_bridge *bridge,
3033 const struct drm_display_info *info,
3134 const struct drm_display_mode *mode);
drivers/gpu/drm/msm/dp/dp_link.c+36−0
@@ -937,6 +937,38 @@ static int dp_link_process_phy_test_pattern_request( · 936 unmodified lines
937937 return 0;
938938 }
939939
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+
940972 static u8 get_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r)
941973 {
942974 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
10551087 dp_link->sink_request |= DP_TEST_LINK_TRAINING;
10561088 } else if (!dp_link_process_phy_test_pattern_request(link)) {
10571089 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");
10581094 } else {
10591095 ret = dp_link_process_link_status_update(link);
10601096 if (!ret) {
drivers/gpu/drm/msm/dp/dp_panel.c+22−0
@@ -20,6 +20,27 @@ struct dp_panel_private { · 19 unmodified lines
2020 bool aux_cfg_update_done;
2121 };
2222
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+
2344 static int dp_panel_read_dpcd(struct dp_panel *dp_panel)
2445 {
2546 int rc = 0;
@@ -107,6 +128,7 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel) · 81 unmodified lines
107128 }
108129 }
109130
131+ dp_panel_read_psr_cap(panel);
110132 end:
111133 return rc;
112134 }
drivers/gpu/drm/msm/dp/dp_panel.h+6−0
@@ -34,6 +34,11 @@ struct dp_panel_in { · 33 unmodified lines
3434 struct dp_catalog *catalog;
3535 };
3636
37+struct dp_panel_psr {
38+ u8 version;
39+ u8 capabilities;
40+};
41+
3742 struct dp_panel {
3843 /* dpcd raw data */
3944 u8 dpcd[DP_RECEIVER_CAP_SIZE + 1];
@@ -46,6 +51,7 @@ struct dp_panel { · 6 unmodified lines
4651 struct edid *edid;
4752 struct drm_connector *connector;
4853 struct dp_display_mode dp_mode;
54+ struct dp_panel_psr psr_cap;
4955 bool video_test;
5056
5157 u32 vic;
drivers/gpu/drm/msm/dp/dp_reg.h+27−0
@@ -22,6 +22,20 @@ · 21 unmodified lines
2222 #define REG_DP_INTR_STATUS2 (0x00000024)
2323 #define REG_DP_INTR_STATUS3 (0x00000028)
2424
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+
2539 #define REG_DP_DP_HPD_CTRL (0x00000000)
2640 #define DP_DP_HPD_CTRL_HPD_EN (0x00000001)
2741
@@ -164,6 +178,16 @@ · 136 unmodified lines
164178 #define MMSS_DP_AUDIO_TIMING_RBR_48 (0x00000094)
165179 #define MMSS_DP_AUDIO_TIMING_HBR_48 (0x00000098)
166180
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+
167191 #define MMSS_DP_PSR_CRC_RG (0x00000154)
168192 #define MMSS_DP_PSR_CRC_B (0x00000158)
169193
@@ -184,6 +208,9 @@ · 14 unmodified lines
184208 #define MMSS_DP_AUDIO_STREAM_0 (0x00000240)
185209 #define MMSS_DP_AUDIO_STREAM_1 (0x00000244)
186210
211+#define MMSS_DP_SDP_CFG3 (0x0000024c)
212+#define UPDATE_SDP (0x00000001)
213+
187214 #define MMSS_DP_EXTENSION_0 (0x00000250)
188215 #define MMSS_DP_EXTENSION_1 (0x00000254)
189216 #define MMSS_DP_EXTENSION_2 (0x00000258)
drivers/gpu/drm/msm/dsi/dsi.c+4−3
@@ -4,7 +4,6 @@ · 3 unmodified lines
44 */
55
66 #include "dsi.h"
7−#include "dsi_cfg.h"
87
98 bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi)
109 {
@@ -173,8 +172,10 @@ static int dsi_dev_remove(struct platform_device *pdev) · 162 unmodified lines
173172 }
174173
175174 static const struct of_device_id dt_match[] = {
176− { .compatible = "qcom,mdss-dsi-ctrl", .data = NULL /* autodetect cfg */ },
177− { .compatible = "qcom,dsi-ctrl-6g-qcm2290", .data = &qcm2290_dsi_cfg_handler },
175+ { .compatible = "qcom,mdss-dsi-ctrl" },
176+
177+ /* Deprecated, don't use */
178+ { .compatible = "qcom,dsi-ctrl-6g-qcm2290" },
178179 {}
179180 };
180181
drivers/gpu/drm/msm/dsi/dsi.xml.h+21−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
@@ -785,4 +785,5 @@ static inline uint32_t DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH(ui · 751 unmodified lines
785785 return ((val) << DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH__SHIFT) & DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH__MASK;
786786 }
787787
788+
788789 #endif /* DSI_XML */
drivers/gpu/drm/msm/dsi/dsi_cfg.c+57−104
@@ -21,8 +21,9 @@ static const struct msm_dsi_config apq8064_dsi_cfg = { · 20 unmodified lines
2121 .num_regulators = ARRAY_SIZE(apq8064_dsi_regulators),
2222 .bus_clk_names = dsi_v2_bus_clk_names,
2323 .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names),
24− .io_start = { 0x4700000, 0x5800000 },
25− .num_dsi = 2,
24+ .io_start = {
25+ { 0x4700000, 0x5800000 },
26+ },
2627 };
2728
2829 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
4142 .num_regulators = ARRAY_SIZE(msm8974_apq8084_regulators),
4243 .bus_clk_names = dsi_6g_bus_clk_names,
4344 .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
44− .io_start = { 0xfd922800, 0xfd922b00 },
45− .num_dsi = 2,
45+ .io_start = {
46+ { 0xfd922800, 0xfd922b00 },
47+ },
4648 };
4749
48−static const char * const dsi_8916_bus_clk_names[] = {
50+static const char * const dsi_v1_3_1_clk_names[] = {
4951 "mdp_core", "iface", "bus",
5052 };
5153
52−static const struct regulator_bulk_data msm8916_dsi_regulators[] = {
54+static const struct regulator_bulk_data dsi_v1_3_1_regulators[] = {
5355 { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */
5456 { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
5557 };
5658
5759 static const struct msm_dsi_config msm8916_dsi_cfg = {
5860 .io_offset = DSI_6G_REG_SHIFT,
59− .regulator_data = msm8916_dsi_regulators,
60− .num_regulators = ARRAY_SIZE(msm8916_dsi_regulators),
61− .bus_clk_names = dsi_8916_bus_clk_names,
62− .num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names),
63− .io_start = { 0x1a98000 },
64− .num_dsi = 1,
65−};
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 */
61+ .regulator_data = dsi_v1_3_1_regulators,
62+ .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators),
63+ .bus_clk_names = dsi_v1_3_1_clk_names,
64+ .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names),
65+ .io_start = {
66+ { 0x1a98000 },
67+ },
7468 };
7569
7670 static const struct msm_dsi_config msm8976_dsi_cfg = {
7771 .io_offset = DSI_6G_REG_SHIFT,
78− .regulator_data = msm8976_dsi_regulators,
79− .num_regulators = ARRAY_SIZE(msm8976_dsi_regulators),
80− .bus_clk_names = dsi_8976_bus_clk_names,
81− .num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names),
82− .io_start = { 0x1a94000, 0x1a96000 },
83− .num_dsi = 2,
72+ .regulator_data = dsi_v1_3_1_regulators,
73+ .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators),
74+ .bus_clk_names = dsi_v1_3_1_clk_names,
75+ .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names),
76+ .io_start = {
77+ { 0x1a94000, 0x1a96000 },
78+ },
8479 };
8580
8681 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
9893 .num_regulators = ARRAY_SIZE(msm8994_dsi_regulators),
9994 .bus_clk_names = dsi_6g_bus_clk_names,
10095 .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
101− .io_start = { 0xfd998000, 0xfd9a0000 },
102− .num_dsi = 2,
103−};
104−
105−static const char * const dsi_8996_bus_clk_names[] = {
106− "mdp_core", "iface", "bus", "core_mmss",
96+ .io_start = {
97+ { 0xfd998000, 0xfd9a0000 },
98+ },
10799 };
108100
109101 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
116108 .io_offset = DSI_6G_REG_SHIFT,
117109 .regulator_data = msm8996_dsi_regulators,
118110 .num_regulators = ARRAY_SIZE(msm8996_dsi_regulators),
119− .bus_clk_names = dsi_8996_bus_clk_names,
120− .num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names),
121− .io_start = { 0x994000, 0x996000 },
122− .num_dsi = 2,
111+ .bus_clk_names = dsi_6g_bus_clk_names,
112+ .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
113+ .io_start = {
114+ { 0x994000, 0x996000 },
115+ },
123116 };
124117
125118 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
137130 .num_regulators = ARRAY_SIZE(msm8998_dsi_regulators),
138131 .bus_clk_names = dsi_msm8998_bus_clk_names,
139132 .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names),
140− .io_start = { 0xc994000, 0xc996000 },
141− .num_dsi = 2,
133+ .io_start = {
134+ { 0xc994000, 0xc996000 },
135+ },
142136 };
143137
144138 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
155149 .num_regulators = ARRAY_SIZE(sdm660_dsi_regulators),
156150 .bus_clk_names = dsi_sdm660_bus_clk_names,
157151 .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names),
158− .io_start = { 0xc994000, 0xc996000 },
159− .num_dsi = 2,
152+ .io_start = {
153+ { 0xc994000, 0xc996000 },
154+ },
160155 };
161156
162−static const char * const dsi_sdm845_bus_clk_names[] = {
157+static const char * const dsi_v2_4_clk_names[] = {
163158 "iface", "bus",
164159 };
165160
166−static const char * const dsi_sc7180_bus_clk_names[] = {
167− "iface", "bus",
168−};
169−
170−static const struct regulator_bulk_data sdm845_dsi_regulators[] = {
161+static const struct regulator_bulk_data dsi_v2_4_regulators[] = {
171162 { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */
172163 };
173164
174165 static const struct msm_dsi_config sdm845_dsi_cfg = {
175166 .io_offset = DSI_6G_REG_SHIFT,
176− .regulator_data = sdm845_dsi_regulators,
177− .num_regulators = ARRAY_SIZE(sdm845_dsi_regulators),
178− .bus_clk_names = dsi_sdm845_bus_clk_names,
179− .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names),
180− .io_start = { 0xae94000, 0xae96000 },
181− .num_dsi = 2,
167+ .regulator_data = dsi_v2_4_regulators,
168+ .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators),
169+ .bus_clk_names = dsi_v2_4_clk_names,
170+ .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
171+ .io_start = {
172+ { 0xae94000, 0xae96000 }, /* SDM845 / SDM670 */
173+ { 0x5e94000 }, /* QCM2290 / SM6115 / SM6125 / SM6375 */
174+ },
182175 };
183176
184177 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
189182 .io_offset = DSI_6G_REG_SHIFT,
190183 .regulator_data = sm8550_dsi_regulators,
191184 .num_regulators = ARRAY_SIZE(sm8550_dsi_regulators),
192− .bus_clk_names = dsi_sdm845_bus_clk_names,
193− .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names),
194− .io_start = { 0xae94000, 0xae96000 },
195− .num_dsi = 2,
196−};
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",
185+ .bus_clk_names = dsi_v2_4_clk_names,
186+ .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
187+ .io_start = {
188+ { 0xae94000, 0xae96000 },
189+ },
214190 };
215191
216192 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
221197 .io_offset = DSI_6G_REG_SHIFT,
222198 .regulator_data = sc7280_dsi_regulators,
223199 .num_regulators = ARRAY_SIZE(sc7280_dsi_regulators),
224− .bus_clk_names = dsi_sc7280_bus_clk_names,
225− .num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names),
226− .io_start = { 0xae94000, 0xae96000 },
227− .num_dsi = 2,
228−};
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,
200+ .bus_clk_names = dsi_v2_4_clk_names,
201+ .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
202+ .io_start = {
203+ { 0xae94000, 0xae96000 },
204+ },
246205 };
247206
248207 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
311270 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_0,
312271 &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops},
313272 {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},
315274 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_5_0,
316275 &sc7280_dsi_cfg, &msm_dsi_6g_v2_host_ops},
317276 {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
335294
336295 return cfg_hnd;
337296 }
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−};
drivers/gpu/drm/msm/dsi/dsi_cfg.h+4−5
@@ -32,14 +32,16 @@ · 31 unmodified lines
3232
3333 #define DSI_6G_REG_SHIFT 4
3434
35+/* Maximum number of configurations matched against the same hw revision */
36+#define VARIANTS_MAX 2
37+
3538 struct msm_dsi_config {
3639 u32 io_offset;
3740 const struct regulator_bulk_data *regulator_data;
3841 int num_regulators;
3942 const char * const *bus_clk_names;
4043 const int num_bus_clks;
41− const resource_size_t io_start[DSI_MAX];
42− const int num_dsi;
44+ const resource_size_t io_start[VARIANTS_MAX][DSI_MAX];
4345 };
4446
4547 struct msm_dsi_host_cfg_ops {
@@ -63,8 +65,5 @@ struct msm_dsi_cfg_handler { · 17 unmodified lines
6365
6466 const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor);
6567
66−/* Non autodetect configs */
67−extern const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler;
68−
6968 #endif /* __MSM_DSI_CFG_H__ */
7069
drivers/gpu/drm/msm/dsi/dsi_host.c+5−9
@@ -214,10 +214,6 @@ static const struct msm_dsi_cfg_handler *dsi_get_config( · 213 unmodified lines
214214 int ret;
215215 u32 major = 0, minor = 0;
216216
217− cfg_hnd = device_get_match_data(dev);
218− if (cfg_hnd)
219− return cfg_hnd;
220−
221217 ahb_clk = msm_clk_get(msm_host->pdev, "iface");
222218 if (IS_ERR(ahb_clk)) {
223219 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
18621858 struct platform_device *pdev = msm_host->pdev;
18631859 const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg;
18641860 struct resource *res;
1865− int i;
1861+ int i, j;
18661862
18671863 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dsi_ctrl");
18681864 if (!res)
18691865 return -EINVAL;
18701866
1871− for (i = 0; i < cfg->num_dsi; i++) {
1872− if (cfg->io_start[i] == res->start)
1873− return i;
1874− }
1867+ for (i = 0; i < VARIANTS_MAX; i++)
1868+ for (j = 0; j < DSI_MAX; j++)
1869+ if (cfg->io_start[i][j] == res->start)
1870+ return j;
18751871
18761872 return -EINVAL;
18771873 }
drivers/gpu/drm/msm/dsi/dsi_phy_10nm.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/dsi/dsi_phy_14nm.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/dsi/dsi_phy_20nm.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/dsi/dsi_phy_28nm.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/dsi/dsi_phy_28nm_8960.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/dsi/dsi_phy_7nm.xml.h+18−18
@@ -8,24 +8,24 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
2929
3030 Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
drivers/gpu/drm/msm/dsi/mmss_cc.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/dsi/sfpb.xml.h+19−19
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
2929
30−Copyright (C) 2013-2021 by the following authors:
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/hdmi/hdmi.xml.h+42−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
@@ -776,10 +776,28 @@ static inline uint32_t HDMI_8x60_PHY_REG1_OUTVOL_SWING_CTRL(uint32_t val) · 742 unmodified lines
776776
777777 #define REG_HDMI_8x74_ANA_CFG1 0x00000004
778778
779+#define REG_HDMI_8x74_ANA_CFG2 0x00000008
780+
781+#define REG_HDMI_8x74_ANA_CFG3 0x0000000c
782+
779783 #define REG_HDMI_8x74_PD_CTRL0 0x00000010
780784
781785 #define REG_HDMI_8x74_PD_CTRL1 0x00000014
782786
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+
783801 #define REG_HDMI_8x74_BIST_CFG0 0x00000034
784802
785803 #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
790808
791809 #define REG_HDMI_8x74_BIST_PATN3 0x00000048
792810
811+#define REG_HDMI_8x74_STATUS 0x0000005c
812+
793813 #define REG_HDMI_28nm_PHY_PLL_REFCLK_CFG 0x00000000
794814
795815 #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
877897
878898 #define REG_HDMI_28nm_PHY_PLL_DEBUG_BUS_SEL 0x000000a0
879899
900+#define REG_HDMI_28nm_PHY_PLL_STATUS 0x000000c0
901+
880902 #define REG_HDMI_8996_PHY_CFG 0x00000000
881903
882904 #define REG_HDMI_8996_PHY_PD_CTL 0x00000004
drivers/gpu/drm/msm/hdmi/qfprom.xml.h+20−20
@@ -8,26 +8,26 @@ http://github.com/freedreno/envytools/ · 7 unmodified lines
88 git clone https://github.com/freedreno/envytools.git
99
1010 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)
12−- /home/robclark/tmp/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2020-12-31 19:26:32)
13−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2021-01-30 18:25:22)
14−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp_common.xml ( 2849 bytes, from 2021-01-30 18:25:22)
15−- /home/robclark/tmp/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2021-01-30 18:25:22)
16−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi.xml ( 17560 bytes, from 2021-09-16 22:37:02)
17−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_v2.xml ( 3236 bytes, from 2021-07-22 15:21:56)
18−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2021-07-22 15:21:56)
19−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_28nm.xml ( 7004 bytes, from 2021-07-22 15:21:56)
20−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2021-07-22 15:21:56)
21−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_14nm.xml ( 5381 bytes, from 2021-07-22 15:21:56)
22−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2021-07-22 15:21:56)
23−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/dsi_phy_7nm.xml ( 11007 bytes, from 2022-03-03 01:18:13)
24−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2021-01-30 18:25:22)
25−- /home/robclark/tmp/mesa/src/freedreno/registers/dsi/mmss_cc.xml ( 1686 bytes, from 2021-01-30 18:25:22)
26−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2021-01-30 18:25:22)
27−- /home/robclark/tmp/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 41874 bytes, from 2021-01-30 18:25:22)
28−- /home/robclark/tmp/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2021-01-30 18:25:22)
29−
30−Copyright (C) 2013-2021 by the following authors:
11+- /home/robclark/src/mesa/mesa/src/freedreno/registers/msm.xml ( 944 bytes, from 2022-07-23 20:21:46)
12+- /home/robclark/src/mesa/mesa/src/freedreno/registers/freedreno_copyright.xml ( 1572 bytes, from 2022-07-23 20:21:46)
13+- /home/robclark/src/mesa/mesa/src/freedreno/registers/mdp/mdp4.xml ( 20912 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/mdp/mdp5.xml ( 37461 bytes, from 2022-03-08 17:40:42)
16+- /home/robclark/src/mesa/mesa/src/freedreno/registers/dsi/dsi.xml ( 18746 bytes, from 2022-04-28 17:29:36)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_28nm_8960.xml ( 4935 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_20nm.xml ( 3712 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/dsi_phy_10nm.xml ( 4499 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/dsi/sfpb.xml ( 602 bytes, from 2022-03-08 17:40:42)
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/src/mesa/mesa/src/freedreno/registers/hdmi/qfprom.xml ( 600 bytes, from 2022-03-08 17:40:42)
27+- /home/robclark/src/mesa/mesa/src/freedreno/registers/hdmi/hdmi.xml ( 42350 bytes, from 2022-09-20 17:45:56)
28+- /home/robclark/src/mesa/mesa/src/freedreno/registers/edp/edp.xml ( 10416 bytes, from 2022-03-08 17:40:42)
29+
30+Copyright (C) 2013-2022 by the following authors:
3131 - Rob Clark <robdclark@gmail.com> (robclark)
3232 - Ilia Mirkin <imirkin@alum.mit.edu> (imirkin)
3333
drivers/gpu/drm/msm/msm_atomic.c+25−4
@@ -179,6 +179,24 @@ static unsigned get_crtc_mask(struct drm_atomic_state *state) · 178 unmodified lines
179179 return mask;
180180 }
181181
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+
182200 void msm_atomic_commit_tail(struct drm_atomic_state *state)
183201 {
184202 struct drm_device *dev = state->dev;
@@ -186,8 +204,7 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) · 1 unmodified line
186204 struct msm_kms *kms = priv->kms;
187205 struct drm_crtc *async_crtc = NULL;
188206 unsigned crtc_mask = get_crtc_mask(state);
189− bool async = kms->funcs->vsync_time &&
190− can_do_async(state, &async_crtc);
207+ bool async = can_do_async(state, &async_crtc);
191208
192209 trace_msm_atomic_commit_tail_start(async, crtc_mask);
193210
@@ -206,7 +223,8 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) · 12 unmodified lines
206223 * Now that there is no in-progress flush, prepare the
207224 * current update:
208225 */
209− kms->funcs->prepare_commit(kms, state);
226+ if (kms->funcs->prepare_commit)
227+ kms->funcs->prepare_commit(kms, state);
210228
211229 /*
212230 * Push atomic updates down to hardware:
@@ -231,7 +249,9 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) · 18 unmodified lines
231249
232250 kms->pending_crtc_mask |= crtc_mask;
233251
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+
235255 wakeup_time = ktime_sub(vsync_time, ms_to_ktime(1));
236256
237257 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
253273 return;
254274 }
255275
276+fallback:
256277 /*
257278 * If there is any async flush pending on updated crtcs, fold
258279 * them into the current flush.
drivers/gpu/drm/msm/msm_debugfs.c+3−3
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/fault-inject.h>
1111
1212 #include <drm/drm_debugfs.h>
13+#include <drm/drm_fb_helper.h>
1314 #include <drm/drm_file.h>
1415 #include <drm/drm_framebuffer.h>
1516
@@ -241,12 +242,11 @@ static int msm_fb_show(struct seq_file *m, void *arg) · 225 unmodified lines
241242 {
242243 struct drm_info_node *node = (struct drm_info_node *) m->private;
243244 struct drm_device *dev = node->minor->dev;
244− struct msm_drm_private *priv = dev->dev_private;
245245 struct drm_framebuffer *fb, *fbdev_fb = NULL;
246246
247− if (priv->fbdev) {
247+ if (dev->fb_helper && dev->fb_helper->fb) {
248248 seq_printf(m, "fbcon ");
249− fbdev_fb = priv->fbdev->fb;
249+ fbdev_fb = dev->fb_helper->fb;
250250 msm_framebuffer_describe(fbdev_fb, m);
251251 }
252252
drivers/gpu/drm/msm/msm_drv.c+62−47
@@ -8,10 +8,12 @@ · 7 unmodified lines
88 #include <linux/dma-mapping.h>
99 #include <linux/fault-inject.h>
1010 #include <linux/kthread.h>
11+#include <linux/of_address.h>
1112 #include <linux/sched/mm.h>
1213 #include <linux/uaccess.h>
1314 #include <uapi/linux/sched/types.h>
1415
16+#include <drm/drm_aperture.h>
1517 #include <drm/drm_bridge.h>
1618 #include <drm/drm_drv.h>
1719 #include <drm/drm_file.h>
@@ -46,15 +48,17 @@ · 28 unmodified lines
4648 * - 1.8.0 - Add MSM_BO_CACHED_COHERENT for supported GPUs (a6xx)
4749 * - 1.9.0 - Add MSM_SUBMIT_FENCE_SN_IN
4850 * - 1.10.0 - Add MSM_SUBMIT_BO_NO_IMPLICIT
51+ * - 1.11.0 - Add wait boost (MSM_WAIT_FENCE_BOOST, MSM_PREP_BOOST)
4952 */
5053 #define MSM_VERSION_MAJOR 1
5154 #define MSM_VERSION_MINOR 10
5255 #define MSM_VERSION_PATCHLEVEL 0
5356
57+static void msm_deinit_vram(struct drm_device *ddev);
58+
5459 static const struct drm_mode_config_funcs mode_config_funcs = {
5560 .fb_create = msm_framebuffer_create,
56− .output_poll_changed = drm_fb_helper_output_poll_changed,
57− .atomic_check = drm_atomic_helper_check,
61+ .atomic_check = msm_atomic_check,
5862 .atomic_commit = drm_atomic_helper_commit,
5963 };
6064
@@ -62,12 +66,6 @@ static const struct drm_mode_config_helper_funcs mode_config_helper_funcs = { · 1 unmodified line
6266 .atomic_commit_tail = msm_atomic_commit_tail,
6367 };
6468
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−
7169 static char *vram = "16m";
7270 MODULE_PARM_DESC(vram, "Configure VRAM size (for devices without IOMMU/GPUMMU)");
7371 module_param(vram, charp, 0);
@@ -150,9 +148,6 @@ static void msm_irq_uninstall(struct drm_device *dev) · 76 unmodified lines
150148 struct msm_drm_private *priv = dev->dev_private;
151149 struct msm_kms *kms = priv->kms;
152150
153− if (!priv->kms)
154− return;
155−
156151 kms->funcs->irq_uninstall(kms);
157152 if (kms->irq_requested)
158153 free_irq(kms->irq, dev);
@@ -240,12 +235,8 @@ static int msm_drm_uninit(struct device *dev) · 81 unmodified lines
240235 msm_perf_debugfs_cleanup(priv);
241236 msm_rd_debugfs_cleanup(priv);
242237
243−#ifdef CONFIG_DRM_FBDEV_EMULATION
244− if (fbdev && priv->fbdev)
245− msm_fbdev_free(ddev);
246−#endif
247−
248− msm_disp_snapshot_destroy(ddev);
238+ if (kms)
239+ msm_disp_snapshot_destroy(ddev);
249240
250241 drm_mode_config_cleanup(ddev);
251242
@@ -253,30 +244,27 @@ static int msm_drm_uninit(struct device *dev) · 1 unmodified line
253244 drm_bridge_remove(priv->bridges[i]);
254245 priv->num_bridges = 0;
255246
256− pm_runtime_get_sync(dev);
257− msm_irq_uninstall(ddev);
258− pm_runtime_put_sync(dev);
247+ if (kms) {
248+ pm_runtime_get_sync(dev);
249+ msm_irq_uninstall(ddev);
250+ pm_runtime_put_sync(dev);
251+ }
259252
260253 if (kms && kms->funcs)
261254 kms->funcs->destroy(kms);
262255
263− if (priv->vram.paddr) {
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− }
256+ msm_deinit_vram(ddev);
269257
270258 component_unbind_all(dev, ddev);
271259
272260 ddev->dev_private = NULL;
261+ drm_dev_put(ddev);
262+
273263 destroy_workqueue(priv->wq);
274264
275265 return 0;
276266 }
277267
278−#include <linux/of_address.h>
279−
280268 struct msm_gem_address_space *msm_kms_init_aspace(struct drm_device *dev)
281269 {
282270 struct msm_gem_address_space *aspace;
@@ -401,6 +389,19 @@ static int msm_init_vram(struct drm_device *dev) · 118 unmodified lines
401389 return ret;
402390 }
403391
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+
404405 static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
405406 {
406407 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
420421 priv->dev = ddev;
421422
422423 priv->wq = alloc_ordered_workqueue("msm", 0);
423− if (!priv->wq)
424− return -ENOMEM;
424+ if (!priv->wq) {
425+ ret = -ENOMEM;
426+ goto err_put_dev;
427+ }
425428
426429 INIT_LIST_HEAD(&priv->objects);
427430 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
444447
445448 ret = msm_init_vram(ddev);
446449 if (ret)
447− goto err_drm_dev_put;
450+ goto err_cleanup_mode_config;
448451
449452 /* Bind all our sub-components: */
450453 ret = component_bind_all(dev, ddev);
451454 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;
453461
454462 dma_set_max_seg_size(dev, UINT_MAX);
455463
@@ -529,23 +537,30 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) · 73 unmodified lines
529537 }
530538 drm_mode_config_reset(ddev);
531539
532−#ifdef CONFIG_DRM_FBDEV_EMULATION
533− if (kms && fbdev)
534− priv->fbdev = msm_fbdev_init(ddev);
535−#endif
536−
537540 ret = msm_debugfs_late_init(ddev);
538541 if (ret)
539542 goto err_msm_uninit;
540543
541544 drm_kms_helper_poll_init(ddev);
542545
546+ if (kms)
547+ msm_fbdev_setup(ddev);
548+
543549 return 0;
544550
545551 err_msm_uninit:
546552 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:
548562 drm_dev_put(ddev);
563+
549564 return ret;
550565 }
551566
@@ -899,7 +914,7 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data, · 347 unmodified lines
899914 }
900915
901916 static int wait_fence(struct msm_gpu_submitqueue *queue, uint32_t fence_id,
902− ktime_t timeout)
917+ ktime_t timeout, uint32_t flags)
903918 {
904919 struct dma_fence *fence;
905920 int ret;
@@ -918,17 +933,18 @@ static int wait_fence(struct msm_gpu_submitqueue *queue, uint32_t fence_id, · 12 unmodified lines
918933 * retired, so if the fence is not found it means there is nothing
919934 * to wait for
920935 */
921− ret = mutex_lock_interruptible(&queue->idr_lock);
922− if (ret)
923− return ret;
936+ spin_lock(&queue->idr_lock);
924937 fence = idr_find(&queue->fence_idr, fence_id);
925938 if (fence)
926939 fence = dma_fence_get_rcu(fence);
927− mutex_unlock(&queue->idr_lock);
940+ spin_unlock(&queue->idr_lock);
928941
929942 if (!fence)
930943 return 0;
931944
945+ if (flags & MSM_WAIT_FENCE_BOOST)
946+ dma_fence_set_deadline(fence, ktime_get());
947+
932948 ret = dma_fence_wait_timeout(fence, true, timeout_to_jiffies(&timeout));
933949 if (ret == 0) {
934950 ret = -ETIMEDOUT;
@@ -949,8 +965,8 @@ static int msm_ioctl_wait_fence(struct drm_device *dev, void *data, · 14 unmodified lines
949965 struct msm_gpu_submitqueue *queue;
950966 int ret;
951967
952− if (args->pad) {
953− DRM_ERROR("invalid pad: %08x\n", args->pad);
968+ if (args->flags & ~MSM_WAIT_FENCE_FLAGS) {
969+ DRM_ERROR("invalid flags: %08x\n", args->flags);
954970 return -EINVAL;
955971 }
956972
@@ -961,7 +977,7 @@ static int msm_ioctl_wait_fence(struct drm_device *dev, void *data, · 4 unmodified lines
961977 if (!queue)
962978 return -ENOENT;
963979
964− ret = wait_fence(queue, args->fence, to_ktime(args->timeout));
980+ ret = wait_fence(queue, args->fence, to_ktime(args->timeout), args->flags);
965981
966982 msm_submitqueue_put(queue);
967983
@@ -1068,7 +1084,6 @@ static const struct drm_driver msm_driver = { · 100 unmodified lines
10681084 DRIVER_SYNCOBJ,
10691085 .open = msm_open,
10701086 .postclose = msm_postclose,
1071− .lastclose = drm_fb_helper_lastclose,
10721087 .dumb_create = msm_gem_dumb_create,
10731088 .dumb_map_offset = msm_gem_dumb_map_offset,
10741089 .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
drivers/gpu/drm/msm/msm_drv.h+9−6
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929 #include <drm/drm_atomic.h>
3030 #include <drm/drm_atomic_helper.h>
3131 #include <drm/drm_probe_helper.h>
32−#include <drm/drm_fb_helper.h>
3332 #include <drm/display/drm_dsc.h>
3433 #include <drm/msm_drm.h>
3534 #include <drm/drm_gem.h>
@@ -129,8 +128,6 @@ struct msm_drm_private { · 93 unmodified lines
129128 bool is_a2xx;
130129 bool has_cached_coherent;
131130
132− struct drm_fb_helper *fbdev;
133−
134131 struct msm_rd_state *rd; /* debugfs to dump all submits */
135132 struct msm_rd_state *hangrd; /* debugfs to dump hanging submits */
136133 struct msm_perf_state *perf;
@@ -261,6 +258,7 @@ int msm_atomic_init_pending_timer(struct msm_pending_timer *timer, · 124 unmodified lines
261258 struct msm_kms *kms, int crtc_idx);
262259 void msm_atomic_destroy_pending_timer(struct msm_pending_timer *timer);
263260 void msm_atomic_commit_tail(struct drm_atomic_state *state);
261+int msm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state);
264262 struct drm_atomic_state *msm_atomic_state_alloc(struct drm_device *dev);
265263 void msm_atomic_state_clear(struct drm_atomic_state *state);
266264 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
306304 struct drm_framebuffer * msm_alloc_stolen_fb(struct drm_device *dev,
307305 int w, int h, int p, uint32_t format);
308306
309−struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev);
310−void msm_fbdev_free(struct drm_device *dev);
307+#ifdef CONFIG_DRM_FBDEV_EMULATION
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
311314
312315 struct hdmi;
313316 #ifdef CONFIG_DRM_MSM_HDMI
@@ -548,7 +551,7 @@ static inline unsigned long timeout_to_jiffies(const ktime_t *timeout) · 234 unmodified lines
548551 remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ);
549552 }
550553
551− return clamp(remaining_jiffies, 0LL, (s64)INT_MAX);
554+ return clamp(remaining_jiffies, 1LL, (s64)INT_MAX);
552555 }
553556
554557 /* Driver helpers */
drivers/gpu/drm/msm/msm_fbdev.c+105−68
@@ -4,8 +4,8 @@ · 3 unmodified lines
44 * Author: Rob Clark <robdclark@gmail.com>
55 */
66
7−#include <drm/drm_aperture.h>
8−#include <drm/drm_crtc.h>
7+#include <drm/drm_drv.h>
8+#include <drm/drm_crtc_helper.h>
99 #include <drm/drm_fb_helper.h>
1010 #include <drm/drm_fourcc.h>
1111 #include <drm/drm_framebuffer.h>
@@ -15,18 +15,40 @@ · 3 unmodified lines
1515 #include "msm_gem.h"
1616 #include "msm_kms.h"
1717
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);
1921
2022 /*
2123 * fbdev funcs, to implement legacy fbdev interface on top of drm driver
2224 */
2325
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);
2530
26−struct msm_fbdev {
27− struct drm_fb_helper base;
28− struct drm_framebuffer *fb;
29−};
31+ return drm_gem_prime_mmap(bo, vma);
32+}
33+
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+}
3052
3153 static const struct fb_ops msm_fb_ops = {
3254 .owner = THIS_MODULE,
@@ -41,21 +63,12 @@ static const struct fb_ops msm_fb_ops = { · 8 unmodified lines
4163 .fb_copyarea = drm_fb_helper_sys_copyarea,
4264 .fb_imageblit = drm_fb_helper_sys_imageblit,
4365 .fb_mmap = msm_fbdev_mmap,
66+ .fb_destroy = msm_fbdev_fb_destroy,
4467 };
4568
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−
5569 static int msm_fbdev_create(struct drm_fb_helper *helper,
5670 struct drm_fb_helper_surface_size *sizes)
5771 {
58− struct msm_fbdev *fbdev = to_msm_fbdev(helper);
5972 struct drm_device *dev = helper->dev;
6073 struct msm_drm_private *priv = dev->dev_private;
6174 struct drm_framebuffer *fb = NULL;
@@ -102,7 +115,6 @@ static int msm_fbdev_create(struct drm_fb_helper *helper, · 40 unmodified lines
102115
103116 DBG("fbi=%p, dev=%p", fbi, dev);
104117
105− fbdev->fb = fb;
106118 helper->fb = fb;
107119
108120 fbi->fbops = &msm_fb_ops;
@@ -119,7 +131,7 @@ static int msm_fbdev_create(struct drm_fb_helper *helper, · 10 unmodified lines
119131 fbi->fix.smem_len = bo->size;
120132
121133 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);
123135
124136 return 0;
125137
@@ -132,73 +144,98 @@ static const struct drm_fb_helper_funcs msm_fb_helper_funcs = { · 6 unmodified lines
132144 .fb_probe = msm_fbdev_create,
133145 };
134146
135−/* initialize fbdev helper */
136−struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
147+/*
148+ * struct drm_client
149+ */
150+
151+static void msm_fbdev_client_unregister(struct drm_client_dev *client)
137152 {
138− struct msm_drm_private *priv = dev->dev_private;
139− struct msm_fbdev *fbdev;
140− struct drm_fb_helper *helper;
141− int ret;
153+ struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client);
154+
155+ if (fb_helper->info) {
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+}
142163
143− fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);
144− if (!fbdev)
145− return NULL;
164+static int msm_fbdev_client_restore(struct drm_client_dev *client)
165+{
166+ drm_fb_helper_lastclose(client->dev);
146167
147− helper = &fbdev->base;
168+ return 0;
169+}
148170
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;
150176
151− ret = drm_fb_helper_init(dev, helper);
152− if (ret) {
153− DRM_DEV_ERROR(dev->dev, "could not init fbdev: ret=%d\n", ret);
154− goto fail;
155− }
177+ if (dev->fb_helper)
178+ return drm_fb_helper_hotplug_event(dev->fb_helper);
156179
157− /* the fw fb could be anywhere in memory */
158− ret = drm_aperture_remove_framebuffers(false, dev->driver);
180+ ret = drm_fb_helper_init(dev, fb_helper);
159181 if (ret)
160− goto fini;
182+ goto err_drm_err;
161183
162− ret = drm_fb_helper_initial_config(helper);
163− if (ret)
164− goto fini;
184+ if (!drm_drv_uses_atomic_modeset(dev))
185+ drm_helper_disable_unused_functions(dev);
165186
166− priv->fbdev = helper;
187+ ret = drm_fb_helper_initial_config(fb_helper);
188+ if (ret)
189+ goto err_drm_fb_helper_fini;
167190
168− return helper;
191+ return 0;
169192
170−fini:
171− drm_fb_helper_fini(helper);
172−fail:
173− drm_fb_helper_unprepare(helper);
174− kfree(fbdev);
175− return NULL;
193+err_drm_fb_helper_fini:
194+ drm_fb_helper_fini(fb_helper);
195+err_drm_err:
196+ drm_err(dev, "Failed to setup fbdev emulation (ret=%d)\n", ret);
197+ return ret;
176198 }
177199
178−void msm_fbdev_free(struct drm_device *dev)
179−{
180− struct msm_drm_private *priv = dev->dev_private;
181− struct drm_fb_helper *helper = priv->fbdev;
182− struct msm_fbdev *fbdev;
200+static const struct drm_client_funcs msm_fbdev_client_funcs = {
201+ .owner = THIS_MODULE,
202+ .unregister = msm_fbdev_client_unregister,
203+ .restore = msm_fbdev_client_restore,
204+ .hotplug = msm_fbdev_client_hotplug,
205+};
183206
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;
185212
186− drm_fb_helper_unregister_info(helper);
213+ if (!fbdev)
214+ return;
187215
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");
189218
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);
191223
192− /* this will free the backing object */
193− if (fbdev->fb) {
194− struct drm_gem_object *bo =
195− msm_framebuffer_bo(fbdev->fb, 0);
196− msm_gem_put_vaddr(bo);
197− drm_framebuffer_remove(fbdev->fb);
224+ ret = drm_client_init(dev, &helper->client, "fbdev", &msm_fbdev_client_funcs);
225+ if (ret) {
226+ drm_err(dev, "Failed to register client: %d\n", ret);
227+ goto err_drm_fb_helper_unprepare;
198228 }
199229
200− drm_fb_helper_unprepare(helper);
201− kfree(fbdev);
230+ ret = msm_fbdev_client_hotplug(&helper->client);
231+ if (ret)
232+ drm_dbg_kms(dev, "client hotplug ret=%d\n", ret);
233+
234+ drm_client_register(&helper->client);
202235
203− priv->fbdev = NULL;
236+ return;
237+
238+err_drm_fb_helper_unprepare:
239+ drm_fb_helper_unprepare(helper);
240+ kfree(helper);
204241 }
drivers/gpu/drm/msm/msm_fence.c+83−3
@@ -8,6 +8,35 @@ · 7 unmodified lines
88
99 #include "msm_drv.h"
1010 #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+}
1140
1241
1342 struct msm_fence_context *
@@ -36,6 +65,13 @@ msm_fence_context_alloc(struct drm_device *dev, volatile uint32_t *fenceptr, · 22 unmodified lines
3665 fctx->completed_fence = fctx->last_fence;
3766 *fctx->fenceptr = fctx->last_fence;
3867
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+
3975 return fctx;
4076 }
4177
@@ -62,6 +98,8 @@ void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence) · 20 unmodified lines
6298 spin_lock_irqsave(&fctx->spinlock, flags);
6399 if (fence_after(fence, fctx->completed_fence))
64100 fctx->completed_fence = fence;
101+ if (msm_fence_completed(fctx, fctx->next_deadline_fence))
102+ hrtimer_cancel(&fctx->deadline_timer);
65103 spin_unlock_irqrestore(&fctx->spinlock, flags);
66104 }
67105
@@ -92,14 +130,50 @@ static bool msm_fence_signaled(struct dma_fence *fence) · 24 unmodified lines
92130 return msm_fence_completed(f->fctx, f->base.seqno);
93131 }
94132
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+
95168 static const struct dma_fence_ops msm_fence_ops = {
96169 .get_driver_name = msm_fence_get_driver_name,
97170 .get_timeline_name = msm_fence_get_timeline_name,
98171 .signaled = msm_fence_signaled,
172+ .set_deadline = msm_fence_set_deadline,
99173 };
100174
101175 struct dma_fence *
102−msm_fence_alloc(struct msm_fence_context *fctx)
176+msm_fence_alloc(void)
103177 {
104178 struct msm_fence *f;
105179
@@ -107,10 +181,16 @@ msm_fence_alloc(struct msm_fence_context *fctx) · 1 unmodified line
107181 if (!f)
108182 return ERR_PTR(-ENOMEM);
109183
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+
110192 f->fctx = fctx;
111193
112194 dma_fence_init(&f->base, &msm_fence_ops, &fctx->spinlock,
113195 fctx->context, ++fctx->last_fence);
114−
115− return &f->base;
116196 }
drivers/gpu/drm/msm/msm_fence.h+22−1
@@ -52,6 +52,26 @@ struct msm_fence_context { · 51 unmodified lines
5252 volatile uint32_t *fenceptr;
5353
5454 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;
5575 };
5676
5777 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
6181 bool msm_fence_completed(struct msm_fence_context *fctx, uint32_t fence);
6282 void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence);
6383
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);
6586
6687 static inline bool
6788 fence_before(uint32_t a, uint32_t b)
drivers/gpu/drm/msm/msm_gem.c+102−48
@@ -19,8 +19,6 @@ · 18 unmodified lines
1919 #include "msm_gpu.h"
2020 #include "msm_mmu.h"
2121
22−static void update_lru(struct drm_gem_object *obj);
23−
2422 static dma_addr_t physaddr(struct drm_gem_object *obj)
2523 {
2624 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
6361 dma_unmap_sgtable(dev, msm_obj->sgt, DMA_BIDIRECTIONAL, 0);
6462 }
6563
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+
66107 /* allocate pages from VRAM carveout, used when no IOMMU: */
67108 static struct page **get_pages_vram(struct drm_gem_object *obj, int npages)
68109 {
@@ -180,6 +221,7 @@ static void put_pages(struct drm_gem_object *obj) · 111 unmodified lines
180221
181222 static struct page **msm_gem_pin_pages_locked(struct drm_gem_object *obj)
182223 {
224+ struct msm_drm_private *priv = obj->dev->dev_private;
183225 struct msm_gem_object *msm_obj = to_msm_bo(obj);
184226 struct page **p;
185227
@@ -190,10 +232,13 @@ static struct page **msm_gem_pin_pages_locked(struct drm_gem_object *obj) · 4 unmodified lines
190232 }
191233
192234 p = get_pages(obj);
193− if (!IS_ERR(p)) {
194− to_msm_bo(obj)->pin_count++;
195− update_lru(obj);
196− }
235+ if (IS_ERR(p))
236+ return p;
237+
238+ mutex_lock(&priv->lru.lock);
239+ msm_obj->pin_count++;
240+ update_lru_locked(obj);
241+ mutex_unlock(&priv->lru.lock);
197242
198243 return p;
199244 }
@@ -309,12 +354,10 @@ static struct msm_gem_vma *add_vma(struct drm_gem_object *obj, · 109 unmodified lines
309354
310355 msm_gem_assert_locked(obj);
311356
312− vma = kzalloc(sizeof(*vma), GFP_KERNEL);
357+ vma = msm_gem_vma_new(aspace);
313358 if (!vma)
314359 return ERR_PTR(-ENOMEM);
315360
316− vma->aspace = aspace;
317−
318361 list_add_tail(&vma->list, &msm_obj->vmas);
319362
320363 return vma;
@@ -361,9 +404,9 @@ put_iova_spaces(struct drm_gem_object *obj, bool close) · 40 unmodified lines
361404
362405 list_for_each_entry(vma, &msm_obj->vmas, list) {
363406 if (vma->aspace) {
364− msm_gem_purge_vma(vma->aspace, vma);
407+ msm_gem_vma_purge(vma);
365408 if (close)
366− msm_gem_close_vma(vma->aspace, vma);
409+ msm_gem_vma_close(vma);
367410 }
368411 }
369412 }
@@ -399,7 +442,7 @@ static struct msm_gem_vma *get_vma_locked(struct drm_gem_object *obj, · 29 unmodified lines
399442 if (IS_ERR(vma))
400443 return vma;
401444
402− ret = msm_gem_init_vma(aspace, vma, obj->size,
445+ ret = msm_gem_vma_init(vma, obj->size,
403446 range_start, range_end);
404447 if (ret) {
405448 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
437480 if (IS_ERR(pages))
438481 return PTR_ERR(pages);
439482
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);
441484 if (ret)
442485 msm_gem_unpin_locked(obj);
443486
@@ -446,14 +489,34 @@ int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma) · 2 unmodified lines
446489
447490 void msm_gem_unpin_locked(struct drm_gem_object *obj)
448491 {
492+ struct msm_drm_private *priv = obj->dev->dev_private;
449493 struct msm_gem_object *msm_obj = to_msm_bo(obj);
450494
451495 msm_gem_assert_locked(obj);
452496
497+ mutex_lock(&priv->lru.lock);
453498 msm_obj->pin_count--;
454499 GEM_WARN_ON(msm_obj->pin_count < 0);
500+ update_lru_locked(obj);
501+ mutex_unlock(&priv->lru.lock);
502+}
455503
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);
457520 }
458521
459522 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
539602 if (msm_gem_vma_inuse(vma))
540603 return -EBUSY;
541604
542− msm_gem_purge_vma(vma->aspace, vma);
543− msm_gem_close_vma(vma->aspace, vma);
605+ msm_gem_vma_purge(vma);
606+ msm_gem_vma_close(vma);
544607 del_vma(vma);
545608
546609 return 0;
@@ -589,7 +652,7 @@ void msm_gem_unpin_iova(struct drm_gem_object *obj, · 42 unmodified lines
589652 msm_gem_lock(obj);
590653 vma = lookup_vma(obj, aspace);
591654 if (!GEM_WARN_ON(!vma)) {
592− msm_gem_unpin_vma(vma);
655+ msm_gem_vma_unpin(vma);
593656 msm_gem_unpin_locked(obj);
594657 }
595658 msm_gem_unlock(obj);
@@ -628,6 +691,7 @@ fail: · 32 unmodified lines
628691 static void *get_vaddr(struct drm_gem_object *obj, unsigned madv)
629692 {
630693 struct msm_gem_object *msm_obj = to_msm_bo(obj);
694+ struct page **pages;
631695 int ret = 0;
632696
633697 msm_gem_assert_locked(obj);
@@ -641,6 +705,10 @@ static void *get_vaddr(struct drm_gem_object *obj, unsigned madv) · 7 unmodified lines
641705 return ERR_PTR(-EBUSY);
642706 }
643707
708+ pages = msm_gem_pin_pages_locked(obj);
709+ if (IS_ERR(pages))
710+ return ERR_CAST(pages);
711+
644712 /* increment vmap_count *before* vmap() call, so shrinker can
645713 * check vmap_count (is_vunmapable()) outside of msm_obj lock.
646714 * 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
650718 msm_obj->vmap_count++;
651719
652720 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− }
658721 msm_obj->vaddr = vmap(pages, obj->size >> PAGE_SHIFT,
659722 VM_MAP, msm_gem_pgprot(msm_obj, PAGE_KERNEL));
660723 if (msm_obj->vaddr == NULL) {
661724 ret = -ENOMEM;
662725 goto fail;
663726 }
664−
665− update_lru(obj);
666727 }
667728
668729 return msm_obj->vaddr;
669730
670731 fail:
671732 msm_obj->vmap_count--;
733+ msm_gem_unpin_locked(obj);
672734 return ERR_PTR(ret);
673735 }
674736
@@ -707,6 +769,7 @@ void msm_gem_put_vaddr_locked(struct drm_gem_object *obj) · 32 unmodified lines
707769 GEM_WARN_ON(msm_obj->vmap_count < 1);
708770
709771 msm_obj->vmap_count--;
772+ msm_gem_unpin_locked(obj);
710773 }
711774
712775 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
721784 */
722785 int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv)
723786 {
787+ struct msm_drm_private *priv = obj->dev->dev_private;
724788 struct msm_gem_object *msm_obj = to_msm_bo(obj);
725789
726790 msm_gem_lock(obj);
727791
792+ mutex_lock(&priv->lru.lock);
793+
728794 if (msm_obj->madv != __MSM_MADV_PURGED)
729795 msm_obj->madv = madv;
730796
@@ -733,7 +799,9 @@ int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) · 2 unmodified lines
733799 /* If the obj is inactive, we might need to move it
734800 * between inactive lists
735801 */
736− update_lru(obj);
802+ update_lru_locked(obj);
803+
804+ mutex_unlock(&priv->lru.lock);
737805
738806 msm_gem_unlock(obj);
739807
@@ -743,6 +811,7 @@ int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) · 3 unmodified lines
743811 void msm_gem_purge(struct drm_gem_object *obj)
744812 {
745813 struct drm_device *dev = obj->dev;
814+ struct msm_drm_private *priv = obj->dev->dev_private;
746815 struct msm_gem_object *msm_obj = to_msm_bo(obj);
747816
748817 msm_gem_assert_locked(obj);
@@ -759,7 +828,10 @@ void msm_gem_purge(struct drm_gem_object *obj) · 10 unmodified lines
759828
760829 put_iova_vmas(obj);
761830
831+ mutex_lock(&priv->lru.lock);
832+ /* A one-way transition: */
762833 msm_obj->madv = __MSM_MADV_PURGED;
834+ mutex_unlock(&priv->lru.lock);
763835
764836 drm_gem_free_mmap_offset(obj);
765837
@@ -806,29 +878,6 @@ void msm_gem_vunmap(struct drm_gem_object *obj) · 40 unmodified lines
806878 msm_obj->vaddr = NULL;
807879 }
808880
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−
832881 bool msm_gem_active(struct drm_gem_object *obj)
833882 {
834883 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
846895 op & MSM_PREP_NOSYNC ? 0 : timeout_to_jiffies(timeout);
847896 long ret;
848897
898+ if (op & MSM_PREP_BOOST) {
899+ dma_resv_set_deadline(obj->resv, dma_resv_usage_rw(write),
900+ ktime_get());
901+ }
902+
849903 ret = dma_resv_wait_timeout(obj->resv, dma_resv_usage_rw(write),
850904 true, remain);
851905 if (ret == 0)
drivers/gpu/drm/msm/msm_gem.h+17−12
@@ -59,6 +59,7 @@ struct msm_fence_context; · 58 unmodified lines
5959
6060 struct msm_gem_vma {
6161 struct drm_mm_node node;
62+ spinlock_t lock;
6263 uint64_t iova;
6364 struct msm_gem_address_space *aspace;
6465 struct list_head list; /* node in msm_gem_object::vmas */
@@ -69,19 +70,15 @@ struct msm_gem_vma { · 4 unmodified lines
6970 struct msm_fence_context *fctx[MSM_GPU_MAX_RINGS];
7071 };
7172
72−int msm_gem_init_vma(struct msm_gem_address_space *aspace,
73− struct msm_gem_vma *vma, int size,
73+struct msm_gem_vma *msm_gem_vma_new(struct msm_gem_address_space *aspace);
74+int msm_gem_vma_init(struct msm_gem_vma *vma, int size,
7475 u64 range_start, u64 range_end);
7576 bool msm_gem_vma_inuse(struct msm_gem_vma *vma);
76−void msm_gem_purge_vma(struct msm_gem_address_space *aspace,
77− struct msm_gem_vma *vma);
78−void msm_gem_unpin_vma(struct msm_gem_vma *vma);
79−void msm_gem_unpin_vma_fenced(struct msm_gem_vma *vma, struct msm_fence_context *fctx);
80−int msm_gem_map_vma(struct msm_gem_address_space *aspace,
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);
77+void msm_gem_vma_purge(struct msm_gem_vma *vma);
78+void msm_gem_vma_unpin(struct msm_gem_vma *vma);
79+void msm_gem_vma_unpin_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);
81+void msm_gem_vma_close(struct msm_gem_vma *vma);
8582
8683 struct msm_gem_object {
8784 struct drm_gem_object base;
@@ -89,7 +86,9 @@ struct msm_gem_object { · 1 unmodified line
8986 uint32_t flags;
9087
9188 /**
92− * Advice: are the backing pages purgeable?
89+ * madv: are the backing pages purgeable?
90+ *
91+ * Protected by obj lock and LRU lock
9392 */
9493 uint8_t madv;
9594
@@ -117,6 +116,11 @@ struct msm_gem_object { · 21 unmodified lines
117116
118117 char name[32]; /* Identifier to print for the debugfs files */
119118
119+ /**
120+ * pin_count: Number of times the pages are pinned
121+ *
122+ * Protected by LRU lock.
123+ */
120124 int pin_count;
121125 };
122126 #define to_msm_bo(x) container_of(x, struct msm_gem_object, base)
@@ -124,6 +128,7 @@ struct msm_gem_object { · 1 unmodified line
124128 uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj);
125129 int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma);
126130 void msm_gem_unpin_locked(struct drm_gem_object *obj);
131+void msm_gem_unpin_active(struct drm_gem_object *obj);
127132 struct msm_gem_vma *msm_gem_get_vma_locked(struct drm_gem_object *obj,
128133 struct msm_gem_address_space *aspace);
129134 int msm_gem_get_iova(struct drm_gem_object *obj,
drivers/gpu/drm/msm/msm_gem_submit.c+22−15
@@ -41,8 +41,16 @@ static struct msm_gem_submit *submit_create(struct drm_device *dev, · 40 unmodified lines
4141 if (!submit)
4242 return ERR_PTR(-ENOMEM);
4343
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+
4451 ret = drm_sched_job_init(&submit->base, queue->entity, queue);
4552 if (ret) {
53+ kfree(submit->hw_fence);
4654 kfree(submit);
4755 return ERR_PTR(ret);
4856 }
@@ -72,9 +80,9 @@ void __msm_gem_submit_destroy(struct kref *kref) · 23 unmodified lines
7280 unsigned i;
7381
7482 if (submit->fence_id) {
75− mutex_lock(&submit->queue->idr_lock);
83+ spin_lock(&submit->queue->idr_lock);
7684 idr_remove(&submit->queue->fence_idr, submit->fence_id);
77− mutex_unlock(&submit->queue->idr_lock);
85+ spin_unlock(&submit->queue->idr_lock);
7886 }
7987
8088 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
242250 submit->bos[i].flags &= ~cleanup_flags;
243251
244252 if (flags & BO_VMA_PINNED)
245− msm_gem_unpin_vma(submit->bos[i].vma);
253+ msm_gem_vma_unpin(submit->bos[i].vma);
246254
247255 if (flags & BO_OBJ_PINNED)
248256 msm_gem_unpin_locked(obj);
@@ -565,7 +573,6 @@ static struct drm_syncobj **msm_parse_deps(struct msm_gem_submit *submit, · 316 unmodified lines
565573
566574 for (i = 0; i < nr_in_syncobjs; ++i) {
567575 uint64_t address = in_syncobjs_addr + i * syncobj_stride;
568− struct dma_fence *fence;
569576
570577 if (copy_from_user(&syncobj_desc,
571578 u64_to_user_ptr(address),
@@ -585,12 +592,8 @@ static struct drm_syncobj **msm_parse_deps(struct msm_gem_submit *submit, · 13 unmodified lines
585592 break;
586593 }
587594
588− ret = drm_syncobj_find_fence(file, syncobj_desc.handle,
589− syncobj_desc.point, 0, &fence);
590− if (ret)
591− break;
592−
593− ret = drm_sched_job_add_dependency(&submit->base, fence);
595+ ret = drm_sched_job_add_syncobj_dependency(&submit->base, file,
596+ syncobj_desc.handle, syncobj_desc.point);
594597 if (ret)
595598 break;
596599
@@ -874,7 +877,9 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 277 unmodified lines
874877
875878 submit->nr_cmds = i;
876879
877− mutex_lock(&queue->idr_lock);
880+ idr_preload(GFP_KERNEL);
881+
882+ spin_lock(&queue->idr_lock);
878883
879884 /*
880885 * 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
884889 */
885890 if ((args->flags & MSM_SUBMIT_FENCE_SN_IN) &&
886891 idr_find(&queue->fence_idr, args->fence)) {
887− mutex_unlock(&queue->idr_lock);
892+ spin_unlock(&queue->idr_lock);
893+ idr_preload_end();
888894 ret = -EINVAL;
889895 goto out;
890896 }
@@ -902,7 +908,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 11 unmodified lines
902908 submit->fence_id = args->fence;
903909 ret = idr_alloc_u32(&queue->fence_idr, submit->user_fence,
904910 &submit->fence_id, submit->fence_id,
905− GFP_KERNEL);
911+ GFP_NOWAIT);
906912 /*
907913 * We've already validated that the fence_id slot is valid,
908914 * 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
915921 */
916922 submit->fence_id = idr_alloc_cyclic(&queue->fence_idr,
917923 submit->user_fence, 1,
918− INT_MAX, GFP_KERNEL);
924+ INT_MAX, GFP_NOWAIT);
919925 }
920926
921− mutex_unlock(&queue->idr_lock);
927+ spin_unlock(&queue->idr_lock);
928+ idr_preload_end();
922929
923930 if (submit->fence_id < 0) {
924931 ret = submit->fence_id;
drivers/gpu/drm/msm/msm_gem_vma.c+70−21
@@ -40,25 +40,34 @@ msm_gem_address_space_get(struct msm_gem_address_space *aspace) · 39 unmodified lines
4040
4141 bool msm_gem_vma_inuse(struct msm_gem_vma *vma)
4242 {
43+ bool ret = true;
44+
45+ spin_lock(&vma->lock);
46+
4347 if (vma->inuse > 0)
44− return true;
48+ goto out;
4549
4650 while (vma->fence_mask) {
4751 unsigned idx = ffs(vma->fence_mask) - 1;
4852
4953 if (!msm_fence_completed(vma->fctx[idx], vma->fence[idx]))
50− return true;
54+ goto out;
5155
5256 vma->fence_mask &= ~BIT(idx);
5357 }
5458
55− return false;
59+ ret = false;
60+
61+out:
62+ spin_unlock(&vma->lock);
63+
64+ return ret;
5665 }
5766
5867 /* Actually unmap memory for the vma */
59−void msm_gem_purge_vma(struct msm_gem_address_space *aspace,
60− struct msm_gem_vma *vma)
68+void msm_gem_vma_purge(struct msm_gem_vma *vma)
6169 {
70+ struct msm_gem_address_space *aspace = vma->aspace;
6271 unsigned size = vma->node.size;
6372
6473 /* 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
6877 if (!vma->mapped)
6978 return;
7079
71− if (aspace->mmu)
72− aspace->mmu->funcs->unmap(aspace->mmu, vma->iova, size);
80+ aspace->mmu->funcs->unmap(aspace->mmu, vma->iova, size);
7381
7482 vma->mapped = false;
7583 }
7684
77−/* Remove reference counts for the mapping */
78−void msm_gem_unpin_vma(struct msm_gem_vma *vma)
85+static void vma_unpin_locked(struct msm_gem_vma *vma)
7986 {
8087 if (GEM_WARN_ON(!vma->inuse))
8188 return;
@@ -83,50 +90,75 @@ void msm_gem_unpin_vma(struct msm_gem_vma *vma) · 1 unmodified line
8390 vma->inuse--;
8491 }
8592
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+
86101 /* 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)
88103 {
104+ spin_lock(&vma->lock);
89105 vma->fctx[fctx->index] = fctx;
90106 vma->fence[fctx->index] = fctx->last_fence;
91107 vma->fence_mask |= BIT(fctx->index);
92− msm_gem_unpin_vma(vma);
108+ vma_unpin_locked(vma);
109+ spin_unlock(&vma->lock);
93110 }
94111
95112 /* Map and pin vma: */
96113 int
97−msm_gem_map_vma(struct msm_gem_address_space *aspace,
98− struct msm_gem_vma *vma, int prot,
114+msm_gem_vma_map(struct msm_gem_vma *vma, int prot,
99115 struct sg_table *sgt, int size)
100116 {
101− int ret = 0;
117+ struct msm_gem_address_space *aspace = vma->aspace;
118+ int ret;
102119
103120 if (GEM_WARN_ON(!vma->iova))
104121 return -EINVAL;
105122
106123 /* Increase the usage counter */
124+ spin_lock(&vma->lock);
107125 vma->inuse++;
126+ spin_unlock(&vma->lock);
108127
109128 if (vma->mapped)
110129 return 0;
111130
112131 vma->mapped = true;
113132
114− if (aspace && aspace->mmu)
115− ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt,
116− size, prot);
133+ if (!aspace)
134+ return 0;
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);
117146
118147 if (ret) {
119148 vma->mapped = false;
149+ spin_lock(&vma->lock);
120150 vma->inuse--;
151+ spin_unlock(&vma->lock);
121152 }
122153
123154 return ret;
124155 }
125156
126157 /* Close an iova. Warn if it is still in use */
127−void msm_gem_close_vma(struct msm_gem_address_space *aspace,
128− struct msm_gem_vma *vma)
158+void msm_gem_vma_close(struct msm_gem_vma *vma)
129159 {
160+ struct msm_gem_address_space *aspace = vma->aspace;
161+
130162 GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped);
131163
132164 spin_lock(&aspace->lock);
@@ -139,13 +171,30 @@ void msm_gem_close_vma(struct msm_gem_address_space *aspace, · 6 unmodified lines
139171 msm_gem_address_space_put(aspace);
140172 }
141173
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+
142188 /* Initialize a new vma and allocate an iova for it */
143−int msm_gem_init_vma(struct msm_gem_address_space *aspace,
144− struct msm_gem_vma *vma, int size,
189+int msm_gem_vma_init(struct msm_gem_vma *vma, int size,
145190 u64 range_start, u64 range_end)
146191 {
192+ struct msm_gem_address_space *aspace = vma->aspace;
147193 int ret;
148194
195+ if (GEM_WARN_ON(!aspace))
196+ return -EINVAL;
197+
149198 if (GEM_WARN_ON(vma->iova))
150199 return -EBUSY;
151200
drivers/gpu/drm/msm/msm_gpu.c+2−6
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 #include <generated/utsrelease.h>
1717 #include <linux/string_helpers.h>
1818 #include <linux/devcoredump.h>
19−#include <linux/reset.h>
2019 #include <linux/sched/task.h>
2120
2221 /*
@@ -59,7 +58,7 @@ static int disable_pwrrail(struct msm_gpu *gpu) · 36 unmodified lines
5958 static int enable_clk(struct msm_gpu *gpu)
6059 {
6160 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);
6362
6463 /* Set the RBBM timer rate to 19.2Mhz */
6564 if (gpu->rbbmtimer_clk)
@@ -78,7 +77,7 @@ static int disable_clk(struct msm_gpu *gpu) · 12 unmodified lines
7877 * will be rounded down to zero anyway so it all works out.
7978 */
8079 if (gpu->core_clk)
81− clk_set_rate(gpu->core_clk, 27000000);
80+ dev_pm_opp_set_rate(&gpu->pdev->dev, 27000000);
8281
8382 if (gpu->rbbmtimer_clk)
8483 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
935934 if (IS_ERR(gpu->gpu_cx))
936935 gpu->gpu_cx = NULL;
937936
938− gpu->cx_collapse = devm_reset_control_get_optional_exclusive(&pdev->dev,
939− "cx_collapse");
940−
941937 gpu->pdev = pdev;
942938 platform_set_drvdata(pdev, &gpu->adreno_smmu);
943939
drivers/gpu/drm/msm/msm_gpu.h+7−5
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313 #include <linux/interconnect.h>
1414 #include <linux/pm_opp.h>
1515 #include <linux/regulator/consumer.h>
16−#include <linux/reset.h>
1716
1817 #include "msm_drv.h"
1918 #include "msm_fence.h"
@@ -50,6 +49,12 @@ struct msm_gpu_funcs { · 30 unmodified lines
5049 int (*set_param)(struct msm_gpu *gpu, struct msm_file_private *ctx,
5150 uint32_t param, uint64_t value, uint32_t len);
5251 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+
5358 int (*pm_suspend)(struct msm_gpu *gpu);
5459 int (*pm_resume)(struct msm_gpu *gpu);
5560 void (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit);
@@ -281,9 +286,6 @@ struct msm_gpu { · 225 unmodified lines
281286 bool hw_apriv;
282287
283288 struct thermal_cooling_device *cooling;
284−
285− /* To poll for cx gdsc collapse during gpu recovery */
286− struct reset_control *cx_collapse;
287289 };
288290
289291 static inline struct msm_gpu *dev_to_gpu(struct device *dev)
@@ -499,7 +501,7 @@ struct msm_gpu_submitqueue { · 209 unmodified lines
499501 struct msm_file_private *ctx;
500502 struct list_head node;
501503 struct idr fence_idr;
502− struct mutex idr_lock;
504+ struct spinlock idr_lock;
503505 struct mutex lock;
504506 struct kref ref;
505507 struct drm_sched_entity *entity;
drivers/gpu/drm/msm/msm_gpu_devfreq.c+1−1
@@ -48,7 +48,7 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, · 47 unmodified lines
4848 gpu->funcs->gpu_set_freq(gpu, opp, df->suspended);
4949 mutex_unlock(&df->lock);
5050 } else {
51− clk_set_rate(gpu->core_clk, *freq);
51+ dev_pm_opp_set_rate(dev, *freq);
5252 }
5353
5454 dev_pm_opp_put(opp);
drivers/gpu/drm/msm/msm_io_utils.c+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 */
77
88 #include <linux/interconnect.h>
9+#include <linux/io.h>
910
1011 #include "msm_drv.h"
1112
drivers/gpu/drm/msm/msm_iommu.c+27−11
@@ -237,13 +237,6 @@ struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent) · 236 unmodified lines
237237 if (!ttbr1_cfg)
238238 return ERR_PTR(-ENODEV);
239239
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−
247240 pagetable = kzalloc(sizeof(*pagetable), GFP_KERNEL);
248241 if (!pagetable)
249242 return ERR_PTR(-ENOMEM);
@@ -271,9 +264,6 @@ struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent) · 21 unmodified lines
271264 * the arm-smmu driver as a trigger to set up TTBR0
272265 */
273266 if (atomic_inc_return(&iommu->pagetables) == 1) {
274− /* Enable stall on iommu fault: */
275− adreno_smmu->set_stall(adreno_smmu->cookie, true);
276−
277267 ret = adreno_smmu->set_ttbr0_cfg(adreno_smmu->cookie, &ttbr0_cfg);
278268 if (ret) {
279269 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
302292 unsigned long iova, int flags, void *arg)
303293 {
304294 struct msm_iommu *iommu = arg;
295+ struct msm_mmu *mmu = &iommu->base;
305296 struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(iommu->base.dev);
306297 struct adreno_smmu_fault_info info, *ptr = NULL;
307298
@@ -314,6 +305,10 @@ static int msm_fault_handler(struct iommu_domain *domain, struct device *dev, · 6 unmodified lines
314305 return iommu->base.handler(iommu->base.arg, iova, flags, ptr);
315306
316307 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+
317312 return 0;
318313 }
319314
@@ -321,7 +316,8 @@ static void msm_iommu_resume_translation(struct msm_mmu *mmu) · 1 unmodified line
321316 {
322317 struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(mmu->dev);
323318
324− adreno_smmu->resume_translation(adreno_smmu->cookie, true);
319+ if (adreno_smmu->resume_translation)
320+ adreno_smmu->resume_translation(adreno_smmu->cookie, true);
325321 }
326322
327323 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
406402
407403 return &iommu->base;
408404 }
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+}
drivers/gpu/drm/msm/msm_kms.h+0−8
@@ -59,14 +59,6 @@ struct msm_kms_funcs { · 58 unmodified lines
5959 void (*enable_commit)(struct msm_kms *kms);
6060 void (*disable_commit)(struct msm_kms *kms);
6161
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−
7062 /**
7163 * Prepare for atomic commit. This is called after any previous
7264 * (async or otherwise) commit has completed.
drivers/gpu/drm/msm/msm_mdss.c+120−78
@@ -16,9 +16,6 @@ · 15 unmodified lines
1616 #include "msm_drv.h"
1717 #include "msm_kms.h"
1818
19−/* for DPU_HW_* defines */
20−#include "disp/dpu1/dpu_hw_catalog.h"
21−
2219 #define HW_REV 0x0
2320 #define HW_INTR_STATUS 0x0010
2421
@@ -29,6 +26,16 @@ · 4 unmodified lines
2926
3027 #define MIN_IB_BW 400000000UL /* Min ib vote 400MB */
3128
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+
3239 struct msm_mdss {
3340 struct device *dev;
3441
@@ -40,6 +47,7 @@ struct msm_mdss { · 5 unmodified lines
4047 unsigned long enabled_mask;
4148 struct irq_domain *domain;
4249 } irq_controller;
50+ const struct msm_mdss_data *mdss_data;
4351 struct icc_path *path[2];
4452 u32 num_paths;
4553 };
@@ -182,46 +190,40 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss) · 136 unmodified lines
182190 #define UBWC_3_0 0x30000000
183191 #define UBWC_4_0 0x40000000
184192
185−static void msm_mdss_setup_ubwc_dec_20(struct msm_mdss *msm_mdss,
186− u32 ubwc_static)
193+static void msm_mdss_setup_ubwc_dec_20(struct msm_mdss *msm_mdss)
187194 {
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);
189198 }
190199
191−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)
200+static void msm_mdss_setup_ubwc_dec_30(struct msm_mdss *msm_mdss)
196201 {
197− u32 value = (ubwc_swizzle & 0x1) |
198− (highest_bank_bit & 0x3) << 4 |
199− (macrotile_mode & 0x1) << 12;
202+ const struct msm_mdss_data *data = msm_mdss->mdss_data;
203+ u32 value = (data->ubwc_swizzle & 0x1) |
204+ (data->highest_bank_bit & 0x3) << 4 |
205+ (data->macrotile_mode & 0x1) << 12;
200206
201− if (ubwc_version == UBWC_3_0)
207+ if (data->ubwc_version == UBWC_3_0)
202208 value |= BIT(10);
203209
204− if (ubwc_version == UBWC_1_0)
210+ if (data->ubwc_version == UBWC_1_0)
205211 value |= BIT(8);
206212
207213 writel_relaxed(value, msm_mdss->mmio + UBWC_STATIC);
208214 }
209215
210−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+static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss)
216217 {
217− u32 value = (ubwc_swizzle & 0x7) |
218− (ubwc_static & 0x1) << 3 |
219− (highest_bank_bit & 0x7) << 4 |
220− (macrotile_mode & 0x1) << 12;
218+ const struct msm_mdss_data *data = msm_mdss->mdss_data;
219+ u32 value = (data->ubwc_swizzle & 0x7) |
220+ (data->ubwc_static & 0x1) << 3 |
221+ (data->highest_bank_bit & 0x7) << 4 |
222+ (data->macrotile_mode & 0x1) << 12;
221223
222224 writel_relaxed(value, msm_mdss->mmio + UBWC_STATIC);
223225
224− if (ubwc_version == UBWC_3_0) {
226+ if (data->ubwc_version == UBWC_3_0) {
225227 writel_relaxed(1, msm_mdss->mmio + UBWC_CTRL_2);
226228 writel_relaxed(0, msm_mdss->mmio + UBWC_PREDICTION_MODE);
227229 } else {
@@ -233,7 +235,6 @@ static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss, · 5 unmodified lines
233235 static int msm_mdss_enable(struct msm_mdss *msm_mdss)
234236 {
235237 int ret;
236− u32 hw_rev;
237238
238239 /*
239240 * 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
249250 }
250251
251252 /*
252− * HW_REV requires MDSS_MDP_CLK, which is not enabled by the mdss on
253− * mdp5 hardware. Skip reading it for now.
253+ * Register access requires MDSS_MDP_CLK, which is not enabled by the
254+ * mdss on mdp5 hardware. Skip it for now.
254255 */
255− if (msm_mdss->is_mdp5)
256+ if (msm_mdss->is_mdp5 || !msm_mdss->mdss_data)
256257 return 0;
257258
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−
263259 /*
264260 * ubwc config is part of the "mdss" region which is not accessible
265261 * from the rest of the driver. hardcode known configurations here
266262 *
267263 * Decoder version can be read from the UBWC_DEC_HW_VERSION reg,
268− * UBWC_n and the rest of params comes from hw_catalog.
269− * Unforunately this driver can not access hw catalog, so we have to
270− * hardcode them here.
264+ * UBWC_n and the rest of params comes from hw data.
271265 */
272− switch (hw_rev) {
273− case DPU_HW_VER_500:
274− case DPU_HW_VER_501:
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);
266+ switch (msm_mdss->mdss_data->ubwc_dec_version) {
267+ case UBWC_2_0:
268+ msm_mdss_setup_ubwc_dec_20(msm_mdss);
284269 break;
285− case DPU_HW_VER_630:
286− /* UBWC_2_0 */
287− msm_mdss_setup_ubwc_dec_20(msm_mdss, 0x11f);
270+ case UBWC_3_0:
271+ msm_mdss_setup_ubwc_dec_30(msm_mdss);
288272 break;
289− case DPU_HW_VER_700:
290− /* TODO: highest_bank_bit = 2 for LP_DDR4 */
291− msm_mdss_setup_ubwc_dec_40(msm_mdss, UBWC_4_0, 6, 1, 3, 1);
273+ case UBWC_4_0:
274+ msm_mdss_setup_ubwc_dec_40(msm_mdss);
292275 break;
293− case DPU_HW_VER_720:
294− msm_mdss_setup_ubwc_dec_40(msm_mdss, UBWC_3_0, 6, 1, 1, 1);
295− break;
296− case DPU_HW_VER_800:
297− msm_mdss_setup_ubwc_dec_40(msm_mdss, UBWC_4_0, 6, 1, 2, 1);
298− break;
299− case DPU_HW_VER_810:
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);
276+ default:
277+ dev_err(msm_mdss->dev, "Unsupported UBWC decoder version %x\n",
278+ msm_mdss->mdss_data->ubwc_dec_version);
279+ dev_err(msm_mdss->dev, "HW_REV: 0x%x\n",
280+ readl_relaxed(msm_mdss->mmio + HW_REV));
281+ dev_err(msm_mdss->dev, "UBWC_DEC_HW_VERSION: 0x%x\n",
282+ readl_relaxed(msm_mdss->mmio + UBWC_DEC_HW_VERSION));
303283 break;
304284 }
305285
@@ -490,6 +470,8 @@ static int mdss_probe(struct platform_device *pdev) · 184 unmodified lines
490470 if (IS_ERR(mdss))
491471 return PTR_ERR(mdss);
492472
473+ mdss->mdss_data = of_device_get_match_data(&pdev->dev);
474+
493475 platform_set_drvdata(pdev, mdss);
494476
495477 /*
@@ -519,21 +501,81 @@ static int mdss_remove(struct platform_device *pdev) · 23 unmodified lines
519501 return 0;
520502 }
521503
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+
522564 static const struct of_device_id mdss_dt_match[] = {
523565 { .compatible = "qcom,mdss" },
524566 { .compatible = "qcom,msm8998-mdss" },
525567 { .compatible = "qcom,qcm2290-mdss" },
526− { .compatible = "qcom,sdm845-mdss" },
527− { .compatible = "qcom,sc7180-mdss" },
528− { .compatible = "qcom,sc7280-mdss" },
529− { .compatible = "qcom,sc8180x-mdss" },
530− { .compatible = "qcom,sc8280xp-mdss" },
531− { .compatible = "qcom,sm6115-mdss" },
532− { .compatible = "qcom,sm8150-mdss" },
533− { .compatible = "qcom,sm8250-mdss" },
534− { .compatible = "qcom,sm8350-mdss" },
535− { .compatible = "qcom,sm8450-mdss" },
536− { .compatible = "qcom,sm8550-mdss" },
568+ { .compatible = "qcom,sdm845-mdss", .data = &sdm845_data },
569+ { .compatible = "qcom,sc7180-mdss", .data = &sc7180_data },
570+ { .compatible = "qcom,sc7280-mdss", .data = &sc7280_data },
571+ { .compatible = "qcom,sc8180x-mdss", .data = &sc8180x_data },
572+ { .compatible = "qcom,sc8280xp-mdss", .data = &sc8280xp_data },
573+ { .compatible = "qcom,sm6115-mdss", .data = &sm6115_data },
574+ { .compatible = "qcom,sm8150-mdss", .data = &sm8150_data },
575+ { .compatible = "qcom,sm8250-mdss", .data = &sm8250_data },
576+ { .compatible = "qcom,sm8350-mdss", .data = &sm8250_data },
577+ { .compatible = "qcom,sm8450-mdss", .data = &sm8250_data },
578+ { .compatible = "qcom,sm8550-mdss", .data = &sm8250_data },
537579 {}
538580 };
539581 MODULE_DEVICE_TABLE(of, mdss_dt_match);
drivers/gpu/drm/msm/msm_mmu.h+1−0
@@ -41,6 +41,7 @@ static inline void msm_mmu_init(struct msm_mmu *mmu, struct device *dev, · 40 unmodified lines
4141 }
4242
4343 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);
4445 struct msm_mmu *msm_gpummu_new(struct device *dev, struct msm_gpu *gpu);
4546
4647 static inline void msm_mmu_set_fault_handler(struct msm_mmu *mmu, void *arg,
drivers/gpu/drm/msm/msm_ringbuffer.c+3−5
@@ -18,16 +18,14 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job) · 17 unmodified lines
1818 struct msm_gpu *gpu = submit->gpu;
1919 int i;
2020
21− submit->hw_fence = msm_fence_alloc(fctx);
21+ msm_fence_init(submit->hw_fence, fctx);
2222
2323 for (i = 0; i < submit->nr_bos; i++) {
2424 struct drm_gem_object *obj = &submit->bos[i].obj->base;
2525
26− msm_gem_lock(obj);
27− msm_gem_unpin_vma_fenced(submit->bos[i].vma, fctx);
28− msm_gem_unpin_locked(obj);
26+ msm_gem_vma_unpin_fenced(submit->bos[i].vma, fctx);
27+ msm_gem_unpin_active(obj);
2928 submit->bos[i].flags &= ~(BO_VMA_PINNED | BO_OBJ_PINNED);
30− msm_gem_unlock(obj);
3129 }
3230
3331 /* TODO move submit path over to using a per-ring lock.. */
drivers/gpu/drm/msm/msm_submitqueue.c+1−1
@@ -200,7 +200,7 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx, · 199 unmodified lines
200200 *id = queue->id;
201201
202202 idr_init(&queue->fence_idr);
203− mutex_init(&queue->idr_lock);
203+ spin_lock_init(&queue->idr_lock);
204204 mutex_init(&queue->lock);
205205
206206 list_add_tail(&queue->node, &ctx->submitqueues);
include/drm/drm_atomic.h+7−0
@@ -528,6 +528,13 @@ struct drm_connector * · 527 unmodified lines
528528 drm_atomic_get_new_connector_for_encoder(const struct drm_atomic_state *state,
529529 struct drm_encoder *encoder);
530530
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+
531538 /**
532539 * drm_atomic_get_existing_crtc_state - get CRTC state, if it exists
533540 * @state: global atomic state object
include/drm/drm_gem.h+1−0
@@ -485,6 +485,7 @@ int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, · 484 unmodified lines
485485
486486 void drm_gem_lru_init(struct drm_gem_lru *lru, struct mutex *lock);
487487 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);
488489 void drm_gem_lru_move_tail(struct drm_gem_lru *lru, struct drm_gem_object *obj);
489490 unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru,
490491 unsigned int nr_to_scan,
include/uapi/drm/msm_drm.h+16−2
@@ -151,8 +151,13 @@ struct drm_msm_gem_info { · 150 unmodified lines
151151 #define MSM_PREP_READ 0x01
152152 #define MSM_PREP_WRITE 0x02
153153 #define MSM_PREP_NOSYNC 0x04
154+#define MSM_PREP_BOOST 0x08
154155
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)
156161
157162 struct drm_msm_gem_cpu_prep {
158163 __u32 handle; /* in */
@@ -181,7 +186,11 @@ struct drm_msm_gem_cpu_fini { · 22 unmodified lines
181186 */
182187 struct drm_msm_gem_submit_reloc {
183188 __u32 submit_offset; /* in, offset from submit_bo */
189+#ifdef __cplusplus
190+ __u32 _or; /* in, value OR'd with result */
191+#else
184192 __u32 or; /* in, value OR'd with result */
193+#endif
185194 __s32 shift; /* in, amount of left shift (can be negative) */
186195 __u32 reloc_idx; /* in, index of reloc_bo buffer */
187196 __u64 reloc_offset; /* in, offset from start of reloc_bo */
@@ -286,6 +295,11 @@ struct drm_msm_gem_submit { · 98 unmodified lines
286295
287296 };
288297
298+#define MSM_WAIT_FENCE_BOOST 0x00000001
299+#define MSM_WAIT_FENCE_FLAGS ( \
300+ MSM_WAIT_FENCE_BOOST | \
301+ 0)
302+
289303 /* The normal way to synchronize with the GPU is just to CPU_PREP on
290304 * a buffer if you need to access it from the CPU (other cmdstream
291305 * submission from same or other contexts, PAGE_FLIP ioctl, etc, all
@@ -295,7 +309,7 @@ struct drm_msm_gem_submit { · 3 unmodified lines
295309 */
296310 struct drm_msm_wait_fence {
297311 __u32 fence; /* in */
298− __u32 pad;
312+ __u32 flags; /* in, bitmask of MSM_WAIT_FENCE_x */
299313 struct drm_msm_timespec timeout; /* in */
300314 __u32 queueid; /* in, submitqueue id */
301315 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t