History

Merge tag 'msm-next-5.19-fixes-06-01' of https://gitlab.freedesktop.org/abhinavk/msm into drm-next

5.19 fixes for msm-next - Fix to add minimum ICC vote in the msm_mdss pm_resume path to address bootup splats - Fix to avoid dereferencing without checking in WB encoder - Fix to avoid crash during suspend in DP driver by ensuring interrupt mask bits are updated - Remove unused code from dpu_encoder_virt_atomic_check() - Fix to remove redundant init of dsc variable Signed-off-by: Dave Airlie <airlied@redhat.com>

Dave Airlie committed 4 years ago

Commit b8042ff2 parents bf23729 b9364ee5 files · +66 −15Browse files

Unified · Split

5 files
  1. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +0 −3
  2. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +2 −2
  3. drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +0 −8
  4. drivers/gpu/drm/msm/dp/dp_ctrl.c +7 −2
  5. drivers/gpu/drm/msm/msm_mdss.c +57 −0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c+0−3
@@ -541,7 +541,6 @@ static int dpu_encoder_virt_atomic_check( · 540 unmodified lines
541541 struct dpu_encoder_virt *dpu_enc;
542542 struct msm_drm_private *priv;
543543 struct dpu_kms *dpu_kms;
544− const struct drm_display_mode *mode;
545544 struct drm_display_mode *adj_mode;
546545 struct msm_display_topology topology;
547546 struct dpu_global_state *global_state;
@@ -559,7 +558,6 @@ static int dpu_encoder_virt_atomic_check( · 11 unmodified lines
559558
560559 priv = drm_enc->dev->dev_private;
561560 dpu_kms = to_dpu_kms(priv->kms);
562− mode = &crtc_state->mode;
563561 adj_mode = &crtc_state->adjusted_mode;
564562 global_state = dpu_kms_get_global_state(crtc_state->state);
565563 if (IS_ERR(global_state))
@@ -1814,7 +1812,6 @@ static void dpu_encoder_prep_dsc(struct dpu_encoder_virt *dpu_enc, · 1248 unmodified lines
18141812 }
18151813 }
18161814
1817− dsc_common_mode = 0;
18181815 pic_width = dsc->drm->pic_width;
18191816
18201817 dsc_common_mode = DSC_MODE_MULTIPLEX | DSC_MODE_SPLIT_PANEL;
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c+2−2
@@ -574,11 +574,11 @@ static void dpu_encoder_phys_wb_disable(struct dpu_encoder_phys *phys_enc) · 573 unmodified lines
574574 */
575575 static void dpu_encoder_phys_wb_destroy(struct dpu_encoder_phys *phys_enc)
576576 {
577− DPU_DEBUG("[wb:%d]\n", phys_enc->wb_idx - WB_0);
578−
579577 if (!phys_enc)
580578 return;
581579
580+ DPU_DEBUG("[wb:%d]\n", phys_enc->wb_idx - WB_0);
581+
582582 kfree(phys_enc);
583583 }
584584
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c+0−8
@@ -49,8 +49,6 @@ · 48 unmodified lines
4949 #define DPU_DEBUGFS_DIR "msm_dpu"
5050 #define DPU_DEBUGFS_HWMASKNAME "hw_log_mask"
5151
52−#define MIN_IB_BW 400000000ULL /* Min ib vote 400MB */
53−
5452 static int dpu_kms_hw_init(struct msm_kms *kms);
5553 static void _dpu_kms_mmu_destroy(struct dpu_kms *dpu_kms);
5654
@@ -1305,15 +1303,9 @@ static int __maybe_unused dpu_runtime_resume(struct device *dev) · 1248 unmodified lines
13051303 struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms);
13061304 struct drm_encoder *encoder;
13071305 struct drm_device *ddev;
1308− int i;
13091306
13101307 ddev = dpu_kms->dev;
13111308
1312− WARN_ON(!(dpu_kms->num_paths));
1313− /* Min vote of BW is required before turning on AXI clk */
1314− for (i = 0; i < dpu_kms->num_paths; i++)
1315− icc_set_bw(dpu_kms->path[i], 0, Bps_to_icc(MIN_IB_BW));
1316−
13171309 rc = clk_bulk_prepare_enable(dpu_kms->num_clocks, dpu_kms->clocks);
13181310 if (rc) {
13191311 DPU_ERROR("clock enable failed rc:%d\n", rc);
drivers/gpu/drm/msm/dp/dp_ctrl.c+7−2
@@ -1390,8 +1390,13 @@ void dp_ctrl_reset_irq_ctrl(struct dp_ctrl *dp_ctrl, bool enable) · 1389 unmodified lines
13901390
13911391 dp_catalog_ctrl_reset(ctrl->catalog);
13921392
1393− if (enable)
1394− dp_catalog_ctrl_enable_irq(ctrl->catalog, enable);
1393+ /*
1394+ * all dp controller programmable registers will not
1395+ * be reset to default value after DP_SW_RESET
1396+ * therefore interrupt mask bits have to be updated
1397+ * to enable/disable interrupts
1398+ */
1399+ dp_catalog_ctrl_enable_irq(ctrl->catalog, enable);
13951400 }
13961401
13971402 void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl)
drivers/gpu/drm/msm/msm_mdss.c+57−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55
66 #include <linux/clk.h>
77 #include <linux/delay.h>
8+#include <linux/interconnect.h>
89 #include <linux/irq.h>
910 #include <linux/irqchip.h>
1011 #include <linux/irqdesc.h>
@@ -25,6 +26,8 @@ · 14 unmodified lines
2526 #define UBWC_CTRL_2 0x150
2627 #define UBWC_PREDICTION_MODE 0x154
2728
29+#define MIN_IB_BW 400000000UL /* Min ib vote 400MB */
30+
2831 struct msm_mdss {
2932 struct device *dev;
3033
@@ -36,8 +39,47 @@ struct msm_mdss { · 5 unmodified lines
3639 unsigned long enabled_mask;
3740 struct irq_domain *domain;
3841 } irq_controller;
42+ struct icc_path *path[2];
43+ u32 num_paths;
3944 };
4045
46+static int msm_mdss_parse_data_bus_icc_path(struct device *dev,
47+ struct msm_mdss *msm_mdss)
48+{
49+ struct icc_path *path0 = of_icc_get(dev, "mdp0-mem");
50+ struct icc_path *path1 = of_icc_get(dev, "mdp1-mem");
51+
52+ if (IS_ERR_OR_NULL(path0))
53+ return PTR_ERR_OR_ZERO(path0);
54+
55+ msm_mdss->path[0] = path0;
56+ msm_mdss->num_paths = 1;
57+
58+ if (!IS_ERR_OR_NULL(path1)) {
59+ msm_mdss->path[1] = path1;
60+ msm_mdss->num_paths++;
61+ }
62+
63+ return 0;
64+}
65+
66+static void msm_mdss_put_icc_path(void *data)
67+{
68+ struct msm_mdss *msm_mdss = data;
69+ int i;
70+
71+ for (i = 0; i < msm_mdss->num_paths; i++)
72+ icc_put(msm_mdss->path[i]);
73+}
74+
75+static void msm_mdss_icc_request_bw(struct msm_mdss *msm_mdss, unsigned long bw)
76+{
77+ int i;
78+
79+ for (i = 0; i < msm_mdss->num_paths; i++)
80+ icc_set_bw(msm_mdss->path[i], 0, Bps_to_icc(bw));
81+}
82+
4183 static void msm_mdss_irq(struct irq_desc *desc)
4284 {
4385 struct msm_mdss *msm_mdss = irq_desc_get_handler_data(desc);
@@ -136,6 +178,13 @@ static int msm_mdss_enable(struct msm_mdss *msm_mdss) · 92 unmodified lines
136178 {
137179 int ret;
138180
181+ /*
182+ * Several components have AXI clocks that can only be turned on if
183+ * the interconnect is enabled (non-zero bandwidth). Let's make sure
184+ * that the interconnects are at least at a minimum amount.
185+ */
186+ msm_mdss_icc_request_bw(msm_mdss, MIN_IB_BW);
187+
139188 ret = clk_bulk_prepare_enable(msm_mdss->num_clocks, msm_mdss->clocks);
140189 if (ret) {
141190 dev_err(msm_mdss->dev, "clock enable failed, ret:%d\n", ret);
@@ -178,6 +227,7 @@ static int msm_mdss_enable(struct msm_mdss *msm_mdss) · 36 unmodified lines
178227 static int msm_mdss_disable(struct msm_mdss *msm_mdss)
179228 {
180229 clk_bulk_disable_unprepare(msm_mdss->num_clocks, msm_mdss->clocks);
230+ msm_mdss_icc_request_bw(msm_mdss, 0);
181231
182232 return 0;
183233 }
@@ -271,6 +321,13 @@ static struct msm_mdss *msm_mdss_init(struct platform_device *pdev, bool is_mdp5 · 87 unmodified lines
271321
272322 dev_dbg(&pdev->dev, "mapped mdss address space @%pK\n", msm_mdss->mmio);
273323
324+ ret = msm_mdss_parse_data_bus_icc_path(&pdev->dev, msm_mdss);
325+ if (ret)
326+ return ERR_PTR(ret);
327+ ret = devm_add_action_or_reset(&pdev->dev, msm_mdss_put_icc_path, msm_mdss);
328+ if (ret)
329+ return ERR_PTR(ret);
330+
274331 if (is_mdp5)
275332 ret = mdp5_mdss_parse_clock(pdev, &msm_mdss->clocks);
276333 else

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