Commit 71e00fc0 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/mdss: export UBWC data

DPU programming requires knowledge of some of UBWC parameters. This
results in duplication of UBWC data between MDSS and DPU drivers. Export
the required data from MDSS driver.
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/550052/
Link: https://lore.kernel.org/r/20230728213320.97309-4-dmitry.baryshkov@linaro.org
parent cab5b406
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/reset.h> #include <linux/reset.h>
#include "msm_drv.h" #include "msm_mdss.h"
#include "msm_kms.h" #include "msm_kms.h"
#define HW_REV 0x0 #define HW_REV 0x0
...@@ -26,16 +26,6 @@ ...@@ -26,16 +26,6 @@
#define MIN_IB_BW 400000000UL /* Min ib vote 400MB */ #define MIN_IB_BW 400000000UL /* Min ib vote 400MB */
struct msm_mdss_data {
u32 ubwc_enc_version;
/* can be read from register 0x58 */
u32 ubwc_dec_version;
u32 ubwc_swizzle;
u32 ubwc_static;
u32 highest_bank_bit;
u32 macrotile_mode;
};
struct msm_mdss { struct msm_mdss {
struct device *dev; struct device *dev;
...@@ -185,12 +175,6 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss) ...@@ -185,12 +175,6 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss)
return 0; return 0;
} }
#define UBWC_1_0 0x10000000
#define UBWC_2_0 0x20000000
#define UBWC_3_0 0x30000000
#define UBWC_4_0 0x40000000
#define UBWC_4_3 0x40030000
static void msm_mdss_setup_ubwc_dec_20(struct msm_mdss *msm_mdss) static void msm_mdss_setup_ubwc_dec_20(struct msm_mdss *msm_mdss)
{ {
const struct msm_mdss_data *data = msm_mdss->mdss_data; const struct msm_mdss_data *data = msm_mdss->mdss_data;
...@@ -236,6 +220,18 @@ static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss) ...@@ -236,6 +220,18 @@ static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss)
} }
} }
const struct msm_mdss_data *msm_mdss_get_mdss_data(struct device *dev)
{
struct msm_mdss *mdss;
if (!dev)
return ERR_PTR(-EINVAL);
mdss = dev_get_drvdata(dev);
return mdss->mdss_data;
}
static int msm_mdss_enable(struct msm_mdss *msm_mdss) static int msm_mdss_enable(struct msm_mdss *msm_mdss)
{ {
int ret; int ret;
......
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2018, The Linux Foundation
*/
#ifndef __MSM_MDSS_H__
#define __MSM_MDSS_H__
struct msm_mdss_data {
u32 ubwc_enc_version;
/* can be read from register 0x58 */
u32 ubwc_dec_version;
u32 ubwc_swizzle;
u32 ubwc_static;
u32 highest_bank_bit;
u32 macrotile_mode;
};
#define UBWC_1_0 0x10000000
#define UBWC_2_0 0x20000000
#define UBWC_3_0 0x30000000
#define UBWC_4_0 0x40000000
#define UBWC_4_3 0x40030000
const struct msm_mdss_data *msm_mdss_get_mdss_data(struct device *dev);
#endif /* __MSM_MDSS_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment