Skip to content

Commit 45a2974

Browse files
quic-kdybcioRob Clark
authored andcommitted
drm/msm: Use the central UBWC config database
As discussed a lot in the past, the UBWC config must be coherent across a number of IP blocks (currently display and GPU, but it also may/will concern camera/video as the drivers evolve). So far, we've been trying to keep the values reasonable in each of the two drivers separately, but it really make sense to do so centrally, especially given certain fields (e.g. HBB) may need to be gathered dynamically. To reduce room for error, move to fetching the config from a central source, so that the data programmed into the hardware is consistent across all multimedia blocks that request it. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Konrad Dybcio <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/660963/ Signed-off-by: Rob Clark <[email protected]>
1 parent 227d4ce commit 45a2974

File tree

11 files changed

+71
-319
lines changed

11 files changed

+71
-319
lines changed

drivers/gpu/drm/msm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ config DRM_MSM
3131
select SHMEM
3232
select TMPFS
3333
select QCOM_SCM
34+
select QCOM_UBWC_CONFIG
3435
select WANT_DEV_COREDUMP
3536
select SND_SOC_HDMI_CODEC if SND_SOC
3637
select SYNC_FILE

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
#include "dpu_hw_sspp.h"
1111
#include "dpu_kms.h"
1212

13-
#include "msm_mdss.h"
14-
1513
#include <drm/drm_file.h>
1614
#include <drm/drm_managed.h>
1715

16+
#include <linux/soc/qcom/ubwc.h>
17+
1818
#define DPU_FETCH_CONFIG_RESET_VALUE 0x00000087
1919

2020
/* SSPP registers */
@@ -684,7 +684,7 @@ int _dpu_hw_sspp_init_debugfs(struct dpu_hw_sspp *hw_pipe, struct dpu_kms *kms,
684684
struct dpu_hw_sspp *dpu_hw_sspp_init(struct drm_device *dev,
685685
const struct dpu_sspp_cfg *cfg,
686686
void __iomem *addr,
687-
const struct msm_mdss_data *mdss_data,
687+
const struct qcom_ubwc_cfg_data *mdss_data,
688688
const struct dpu_mdss_version *mdss_rev)
689689
{
690690
struct dpu_hw_sspp *hw_pipe;

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ struct dpu_hw_sspp_ops {
308308
struct dpu_hw_sspp {
309309
struct dpu_hw_blk base;
310310
struct dpu_hw_blk_reg_map hw;
311-
const struct msm_mdss_data *ubwc;
311+
const struct qcom_ubwc_cfg_data *ubwc;
312312

313313
/* Pipe */
314314
enum dpu_sspp idx;
@@ -325,7 +325,7 @@ struct dpu_kms;
325325
struct dpu_hw_sspp *dpu_hw_sspp_init(struct drm_device *dev,
326326
const struct dpu_sspp_cfg *cfg,
327327
void __iomem *addr,
328-
const struct msm_mdss_data *mdss_data,
328+
const struct qcom_ubwc_cfg_data *mdss_data,
329329
const struct dpu_mdss_version *mdss_rev);
330330

331331
int _dpu_hw_sspp_init_debugfs(struct dpu_hw_sspp *hw_pipe, struct dpu_kms *kms,

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
#include <drm/drm_vblank.h>
2121
#include <drm/drm_writeback.h>
2222

23+
#include <linux/soc/qcom/ubwc.h>
24+
2325
#include "msm_drv.h"
2426
#include "msm_mmu.h"
25-
#include "msm_mdss.h"
2627
#include "msm_gem.h"
2728
#include "disp/msm_disp_snapshot.h"
2829

@@ -1189,10 +1190,10 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
11891190
goto err_pm_put;
11901191
}
11911192

1192-
dpu_kms->mdss = msm_mdss_get_mdss_data(dpu_kms->pdev->dev.parent);
1193+
dpu_kms->mdss = qcom_ubwc_config_get_data();
11931194
if (IS_ERR(dpu_kms->mdss)) {
11941195
rc = PTR_ERR(dpu_kms->mdss);
1195-
DPU_ERROR("failed to get MDSS data: %d\n", rc);
1196+
DPU_ERROR("failed to get UBWC config data: %d\n", rc);
11961197
goto err_pm_put;
11971198
}
11981199

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct dpu_kms {
6060
struct msm_kms base;
6161
struct drm_device *dev;
6262
const struct dpu_mdss_cfg *catalog;
63-
const struct msm_mdss_data *mdss;
63+
const struct qcom_ubwc_cfg_data *mdss;
6464

6565
/* io/register spaces: */
6666
void __iomem *mmio, *vbif[VBIF_MAX];

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
#include <drm/drm_framebuffer.h>
1818
#include <drm/drm_gem_atomic_helper.h>
1919

20+
#include <linux/soc/qcom/ubwc.h>
21+
2022
#include "msm_drv.h"
21-
#include "msm_mdss.h"
2223
#include "dpu_kms.h"
2324
#include "dpu_hw_sspp.h"
2425
#include "dpu_hw_util.h"

drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static inline bool reserved_by_other(uint32_t *res_map, int idx,
4040
int dpu_rm_init(struct drm_device *dev,
4141
struct dpu_rm *rm,
4242
const struct dpu_mdss_cfg *cat,
43-
const struct msm_mdss_data *mdss_data,
43+
const struct qcom_ubwc_cfg_data *mdss_data,
4444
void __iomem *mmio)
4545
{
4646
int rc, i;

drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct msm_display_topology {
6969
int dpu_rm_init(struct drm_device *dev,
7070
struct dpu_rm *rm,
7171
const struct dpu_mdss_cfg *cat,
72-
const struct msm_mdss_data *mdss_data,
72+
const struct qcom_ubwc_cfg_data *mdss_data,
7373
void __iomem *mmio);
7474

7575
int dpu_rm_reserve(struct dpu_rm *rm,

0 commit comments

Comments
 (0)