.cwb = sm8650_cwb,
.intf_count = ARRAY_SIZE(sm8650_intf),
.intf = sm8650_intf,
- .vbif_count = ARRAY_SIZE(sm8650_vbif),
- .vbif = sm8650_vbif,
+ .vbif = &sm8650_vbif,
.perf = &sm8650_perf_data,
};
.cwb = sm8650_cwb,
.intf_count = ARRAY_SIZE(sm8750_intf),
.intf = sm8750_intf,
- .vbif_count = ARRAY_SIZE(sm8650_vbif),
- .vbif = sm8650_vbif,
+ .vbif = &sm8650_vbif,
.perf = &sm8750_perf_data,
};
.cwb = sm8650_cwb,
.intf_count = ARRAY_SIZE(glymur_intf),
.intf = glymur_intf,
- .vbif_count = ARRAY_SIZE(sm8650_vbif),
- .vbif = sm8650_vbif,
+ .vbif = &sm8650_vbif,
.perf = &glymur_perf_data,
};
.cwb = sm8650_cwb,
.intf_count = ARRAY_SIZE(eliza_intf),
.intf = eliza_intf,
- .vbif_count = ARRAY_SIZE(sm8650_vbif),
- .vbif = sm8650_vbif,
+ .vbif = &sm8650_vbif,
.perf = &eliza_perf_data,
};
.cwb = sm8650_cwb,
.intf_count = ARRAY_SIZE(kaanapali_intf),
.intf = kaanapali_intf,
- .vbif_count = ARRAY_SIZE(sm8650_vbif),
- .vbif = sm8650_vbif,
+ .vbif = &sm8650_vbif,
.perf = &kaanapali_perf_data,
};
.pingpong = msm8937_pp,
.intf_count = ARRAY_SIZE(msm8937_intf),
.intf = msm8937_intf,
- .vbif_count = ARRAY_SIZE(msm8996_vbif),
- .vbif = msm8996_vbif,
+ .vbif = &msm8996_vbif,
.perf = &msm8937_perf_data,
};
.pingpong = msm8917_pp,
.intf_count = ARRAY_SIZE(msm8917_intf),
.intf = msm8917_intf,
- .vbif_count = ARRAY_SIZE(msm8996_vbif),
- .vbif = msm8996_vbif,
+ .vbif = &msm8996_vbif,
.perf = &msm8917_perf_data,
};
.pingpong = msm8953_pp,
.intf_count = ARRAY_SIZE(msm8953_intf),
.intf = msm8953_intf,
- .vbif_count = ARRAY_SIZE(msm8996_vbif),
- .vbif = msm8996_vbif,
+ .vbif = &msm8996_vbif,
.perf = &msm8953_perf_data,
};
.dsc = msm8996_dsc,
.intf_count = ARRAY_SIZE(msm8996_intf),
.intf = msm8996_intf,
- .vbif_count = ARRAY_SIZE(msm8996_vbif),
- .vbif = msm8996_vbif,
+ .vbif = &msm8996_vbif,
.perf = &msm8996_perf_data,
};
.dsc = msm8998_dsc,
.intf_count = ARRAY_SIZE(msm8998_intf),
.intf = msm8998_intf,
- .vbif_count = ARRAY_SIZE(msm8998_vbif),
- .vbif = msm8998_vbif,
+ .vbif = &msm8998_vbif,
.perf = &msm8998_perf_data,
};
.dsc = sdm660_dsc,
.intf_count = ARRAY_SIZE(sdm660_intf),
.intf = sdm660_intf,
- .vbif_count = ARRAY_SIZE(msm8998_vbif),
- .vbif = msm8998_vbif,
+ .vbif = &msm8998_vbif,
.perf = &sdm660_perf_data,
};
.pingpong = sdm630_pp,
.intf_count = ARRAY_SIZE(sdm630_intf),
.intf = sdm630_intf,
- .vbif_count = ARRAY_SIZE(msm8998_vbif),
- .vbif = msm8998_vbif,
+ .vbif = &msm8998_vbif,
.perf = &sdm630_perf_data,
};
.dsc = sdm845_dsc,
.intf_count = ARRAY_SIZE(sdm845_intf),
.intf = sdm845_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sdm845_perf_data,
};
.dsc = sdm670_dsc,
.intf_count = ARRAY_SIZE(sdm845_intf),
.intf = sdm845_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sdm845_perf_data,
};
.wb = sm8150_wb,
.intf_count = ARRAY_SIZE(sm8150_intf),
.intf = sm8150_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sm8150_perf_data,
};
.wb = sc8180x_wb,
.intf_count = ARRAY_SIZE(sc8180x_intf),
.intf = sc8180x_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sc8180x_perf_data,
};
.intf = sm7150_intf,
.wb_count = ARRAY_SIZE(sm7150_wb),
.wb = sm7150_wb,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sm7150_perf_data,
};
.wb = sm6150_wb,
.intf_count = ARRAY_SIZE(sm6150_intf),
.intf = sm6150_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sm6150_perf_data,
};
.wb = sm6125_wb,
.intf_count = ARRAY_SIZE(sm6125_intf),
.intf = sm6125_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sm6125_perf_data,
};
.merge_3d = sm8250_merge_3d,
.intf_count = ARRAY_SIZE(sm8250_intf),
.intf = sm8250_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.wb_count = ARRAY_SIZE(sm8250_wb),
.wb = sm8250_wb,
.perf = &sm8250_perf_data,
.intf = sc7180_intf,
.wb_count = ARRAY_SIZE(sc7180_wb),
.wb = sc7180_wb,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sc7180_perf_data,
};
.pingpong = sm6115_pp,
.intf_count = ARRAY_SIZE(sm6115_intf),
.intf = sm6115_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sm6115_perf_data,
};
.wb = sm6350_wb,
.intf_count = ARRAY_SIZE(sm6350_intf),
.intf = sm6350_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sm6350_perf_data,
};
.pingpong = qcm2290_pp,
.intf_count = ARRAY_SIZE(qcm2290_intf),
.intf = qcm2290_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &qcm2290_perf_data,
};
.pingpong = sm6375_pp,
.intf_count = ARRAY_SIZE(sm6375_intf),
.intf = sm6375_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sm6375_perf_data,
};
.wb = sm8350_wb,
.intf_count = ARRAY_SIZE(sm8350_intf),
.intf = sm8350_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sm8350_perf_data,
};
.wb = sc7280_wb,
.intf_count = ARRAY_SIZE(sc7280_intf),
.intf = sc7280_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sc7280_perf_data,
};
.merge_3d = sc8280xp_merge_3d,
.intf_count = ARRAY_SIZE(sc8280xp_intf),
.intf = sc8280xp_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sc8280xp_perf_data,
};
.wb = sm8450_wb,
.intf_count = ARRAY_SIZE(sm8450_intf),
.intf = sm8450_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sm8450_perf_data,
};
.wb = sa8775p_wb,
.intf_count = ARRAY_SIZE(sa8775p_intf),
.intf = sa8775p_intf,
- .vbif_count = ARRAY_SIZE(sdm845_vbif),
- .vbif = sdm845_vbif,
+ .vbif = &sdm845_vbif,
.perf = &sa8775p_perf_data,
};
.wb = sm8550_wb,
.intf_count = ARRAY_SIZE(sm8550_intf),
.intf = sm8550_intf,
- .vbif_count = ARRAY_SIZE(sm8550_vbif),
- .vbif = sm8550_vbif,
+ .vbif = &sm8550_vbif,
.perf = &sm8550_perf_data,
};
.wb = sar2130p_wb,
.intf_count = ARRAY_SIZE(sar2130p_intf),
.intf = sar2130p_intf,
- .vbif_count = ARRAY_SIZE(sm8550_vbif),
- .vbif = sm8550_vbif,
+ .vbif = &sm8550_vbif,
.perf = &sar2130p_perf_data,
};
.wb = x1e80100_wb,
.intf_count = ARRAY_SIZE(x1e80100_intf),
.intf = x1e80100_intf,
- .vbif_count = ARRAY_SIZE(sm8550_vbif),
- .vbif = sm8550_vbif,
+ .vbif = &sm8550_vbif,
.perf = &x1e80100_perf_data,
};
},
};
-static const struct dpu_vbif_cfg msm8996_vbif[] = {
- {
+static const struct dpu_vbif_cfg msm8996_vbif = {
.name = "vbif_rt", .id = VBIF_RT,
.base = 0, .len = 0x1040,
.default_ot_rd_limit = 32,
.npriority_lvl = ARRAY_SIZE(msm8998_nrt_pri_lvl),
.priority_lvl = msm8998_nrt_pri_lvl,
},
- },
};
-static const struct dpu_vbif_cfg msm8998_vbif[] = {
- {
+static const struct dpu_vbif_cfg msm8998_vbif = {
.name = "vbif_rt", .id = VBIF_RT,
.base = 0, .len = 0x1040,
.default_ot_rd_limit = 32,
},
.memtype_count = 14,
.memtype = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
- },
};
-static const struct dpu_vbif_cfg sdm845_vbif[] = {
- {
+static const struct dpu_vbif_cfg sdm845_vbif = {
.name = "vbif_rt", .id = VBIF_RT,
.base = 0, .len = 0x1040,
.features = BIT(DPU_VBIF_QOS_REMAP),
},
.memtype_count = 14,
.memtype = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
- },
};
-static const struct dpu_vbif_cfg sm8550_vbif[] = {
- {
+static const struct dpu_vbif_cfg sm8550_vbif = {
.name = "vbif_rt", .id = VBIF_RT,
.base = 0, .len = 0x1040,
.features = BIT(DPU_VBIF_QOS_REMAP),
},
.memtype_count = 16,
.memtype = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
- },
};
-static const struct dpu_vbif_cfg sm8650_vbif[] = {
- {
+static const struct dpu_vbif_cfg sm8650_vbif = {
.name = "vbif_rt", .id = VBIF_RT,
.base = 0, .len = 0x1074,
.features = BIT(DPU_VBIF_QOS_REMAP),
},
.memtype_count = 16,
.memtype = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
- },
};
/*************************************************************
u32 intf_count;
const struct dpu_intf_cfg *intf;
- u32 vbif_count;
const struct dpu_vbif_cfg *vbif;
u32 wb_count;
dpu_kms->mmio + cat->cdm->base,
"%s", cat->cdm->name);
- for (i = 0; i < dpu_kms->catalog->vbif_count; i++) {
- const struct dpu_vbif_cfg *vbif = &dpu_kms->catalog->vbif[i];
+ const struct dpu_vbif_cfg *vbif = dpu_kms->catalog->vbif;
- msm_disp_snapshot_add_block(disp_state, vbif->len,
- dpu_kms->vbif[vbif->id] + vbif->base,
- "%s", vbif->name);
- }
+ msm_disp_snapshot_add_block(disp_state, vbif->len,
+ dpu_kms->vbif,
+ "vbif");
pm_runtime_put_sync(&dpu_kms->pdev->dev);
}
{
struct dpu_kms *dpu_kms;
struct drm_device *dev;
- int i, rc = -EINVAL;
+ int rc = -EINVAL;
unsigned long max_core_clk_rate;
u32 core_rev;
goto err_pm_put;
}
- for (i = 0; i < dpu_kms->catalog->vbif_count; i++) {
- struct dpu_hw_vbif *hw;
- const struct dpu_vbif_cfg *vbif = &dpu_kms->catalog->vbif[i];
-
- hw = dpu_hw_vbif_init(dev, vbif, dpu_kms->vbif[vbif->id]);
- if (IS_ERR(hw)) {
- rc = PTR_ERR(hw);
- DPU_ERROR("failed to init vbif %d: %d\n", vbif->id, rc);
- goto err_pm_put;
- }
+ struct dpu_hw_vbif *hw;
+ const struct dpu_vbif_cfg *vbif = dpu_kms->catalog->vbif;
- dpu_kms->hw_vbif[vbif->id] = hw;
+ hw = dpu_hw_vbif_init(dev, vbif, dpu_kms->vbif[vbif->id]);
+ if (IS_ERR(hw)) {
+ rc = PTR_ERR(hw);
+ DPU_ERROR("failed to init vbif: %d\n", rc);
+ goto err_pm_put;
}
+ dpu_kms->hw_vbif[vbif->id] = hw;
+
/* TODO: use the same max_freq as in dpu_kms_hw_init */
max_core_clk_rate = dpu_kms_get_clk_rate(dpu_kms, "core");
if (!max_core_clk_rate) {
void dpu_debugfs_vbif_init(struct dpu_kms *dpu_kms, struct dentry *debugfs_root)
{
+ const struct dpu_vbif_cfg *vbif = dpu_kms->catalog->vbif;
char vbif_name[32];
- struct dentry *entry, *debugfs_vbif;
- int i, j;
-
- entry = debugfs_create_dir("vbif", debugfs_root);
-
- for (i = 0; i < dpu_kms->catalog->vbif_count; i++) {
- const struct dpu_vbif_cfg *vbif = &dpu_kms->catalog->vbif[i];
-
- snprintf(vbif_name, sizeof(vbif_name), "%d", vbif->id);
+ struct dentry *debugfs_vbif;
+ int j;
- debugfs_vbif = debugfs_create_dir(vbif_name, entry);
+ debugfs_vbif = debugfs_create_dir("vbif", debugfs_root);
- debugfs_create_u32("features", 0600, debugfs_vbif,
- (u32 *)&vbif->features);
+ debugfs_create_u32("features", 0600, debugfs_vbif,
+ (u32 *)&vbif->features);
- debugfs_create_u32("xin_halt_timeout", 0400, debugfs_vbif,
- (u32 *)&vbif->xin_halt_timeout);
+ debugfs_create_u32("xin_halt_timeout", 0400, debugfs_vbif,
+ (u32 *)&vbif->xin_halt_timeout);
- debugfs_create_u32("default_rd_ot_limit", 0400, debugfs_vbif,
- (u32 *)&vbif->default_ot_rd_limit);
+ debugfs_create_u32("default_rd_ot_limit", 0400, debugfs_vbif,
+ (u32 *)&vbif->default_ot_rd_limit);
- debugfs_create_u32("default_wr_ot_limit", 0400, debugfs_vbif,
- (u32 *)&vbif->default_ot_wr_limit);
+ debugfs_create_u32("default_wr_ot_limit", 0400, debugfs_vbif,
+ (u32 *)&vbif->default_ot_wr_limit);
- for (j = 0; j < vbif->dynamic_ot_rd_tbl.count; j++) {
- const struct dpu_vbif_dynamic_ot_cfg *cfg =
- &vbif->dynamic_ot_rd_tbl.cfg[j];
+ for (j = 0; j < vbif->dynamic_ot_rd_tbl.count; j++) {
+ const struct dpu_vbif_dynamic_ot_cfg *cfg =
+ &vbif->dynamic_ot_rd_tbl.cfg[j];
- snprintf(vbif_name, sizeof(vbif_name),
- "dynamic_ot_rd_%d_pps", j);
- debugfs_create_u64(vbif_name, 0400, debugfs_vbif,
- (u64 *)&cfg->pps);
- snprintf(vbif_name, sizeof(vbif_name),
- "dynamic_ot_rd_%d_ot_limit", j);
- debugfs_create_u32(vbif_name, 0400, debugfs_vbif,
- (u32 *)&cfg->ot_limit);
- }
+ snprintf(vbif_name, sizeof(vbif_name),
+ "dynamic_ot_rd_%d_pps", j);
+ debugfs_create_u64(vbif_name, 0400, debugfs_vbif,
+ (u64 *)&cfg->pps);
+ snprintf(vbif_name, sizeof(vbif_name),
+ "dynamic_ot_rd_%d_ot_limit", j);
+ debugfs_create_u32(vbif_name, 0400, debugfs_vbif,
+ (u32 *)&cfg->ot_limit);
+ }
- for (j = 0; j < vbif->dynamic_ot_wr_tbl.count; j++) {
- const struct dpu_vbif_dynamic_ot_cfg *cfg =
- &vbif->dynamic_ot_wr_tbl.cfg[j];
-
- snprintf(vbif_name, sizeof(vbif_name),
- "dynamic_ot_wr_%d_pps", j);
- debugfs_create_u64(vbif_name, 0400, debugfs_vbif,
- (u64 *)&cfg->pps);
- snprintf(vbif_name, sizeof(vbif_name),
- "dynamic_ot_wr_%d_ot_limit", j);
- debugfs_create_u32(vbif_name, 0400, debugfs_vbif,
- (u32 *)&cfg->ot_limit);
- }
+ for (j = 0; j < vbif->dynamic_ot_wr_tbl.count; j++) {
+ const struct dpu_vbif_dynamic_ot_cfg *cfg =
+ &vbif->dynamic_ot_wr_tbl.cfg[j];
+
+ snprintf(vbif_name, sizeof(vbif_name),
+ "dynamic_ot_wr_%d_pps", j);
+ debugfs_create_u64(vbif_name, 0400, debugfs_vbif,
+ (u64 *)&cfg->pps);
+ snprintf(vbif_name, sizeof(vbif_name),
+ "dynamic_ot_wr_%d_ot_limit", j);
+ debugfs_create_u32(vbif_name, 0400, debugfs_vbif,
+ (u32 *)&cfg->ot_limit);
}
}
#endif