Merge tag 'LA.UM.9.14.r1-20700-LAHAINA.QSSI13.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/display-drivers into android13-5.4-lahaina

"LA.UM.9.14.r1-20700-LAHAINA.QSSI13.0"

* tag 'LA.UM.9.14.r1-20700-LAHAINA.QSSI13.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/display-drivers:
  disp: msm: sde: fix min ib vote in mnoc and ebi_ib path
  disp: msm: dsi: add support for dsi config

Change-Id: Ie88226bfc57764c185a1e013e9ed6e2a6819a419
This commit is contained in:
Michael Bestas 2022-11-09 19:42:47 +02:00
commit 99fc40776e
No known key found for this signature in database
GPG Key ID: CC95044519BE6669
4 changed files with 82 additions and 45 deletions

View File

@ -11,6 +11,10 @@
#include <linux/of_irq.h>
#include <video/mipi_display.h>
#ifdef CONFIG_UIO
#include <linux/uio_driver.h>
#endif
#include "msm_drv.h"
#include "msm_kms.h"
#include "msm_mmu.h"
@ -2094,6 +2098,58 @@ static int dsi_ctrl_dts_parse(struct dsi_ctrl *dsi_ctrl,
return 0;
}
#ifdef CONFIG_UIO
static void uio_init(struct platform_device *pdev)
{
struct uio_info *uio_reg_info = NULL;
struct resource *clnt_res = NULL;
int ret = 0;
u32 mem_size = 0;
phys_addr_t mem_pyhsical = 0;
clnt_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "disp_conf");
if (!clnt_res) {
pr_debug("resource not found\n");
return;
}
mem_size = resource_size(clnt_res);
if (mem_size == 0) {
pr_debug("resource memory size is zero\n");
goto exit;
}
uio_reg_info = devm_kzalloc(&pdev->dev, sizeof(struct uio_info),
GFP_KERNEL);
if (!uio_reg_info)
goto exit;
mem_pyhsical = clnt_res->start;
/* Setup device */
uio_reg_info->name = clnt_res->name;
uio_reg_info->version = "1.0";
uio_reg_info->mem[0].addr = mem_pyhsical;
uio_reg_info->mem[0].size = mem_size;
uio_reg_info->mem[0].memtype = UIO_MEM_PHYS;
ret = uio_register_device(&pdev->dev, uio_reg_info);
if (ret) {
pr_debug("uio register failed. ret:%d\n", ret);
goto exit;
}
pr_debug("Device file created for dsi_ctrl config.\n");
return;
exit:
pr_debug("Unable to get dsi_ctrl config.\n");
}
#else /* CONFIG_UIO */
static void uio_init(struct platform_device *pdev)
{
}
#endif /* CONFIG_UIO */
static int dsi_ctrl_dev_probe(struct platform_device *pdev)
{
struct dsi_ctrl *dsi_ctrl;
@ -2173,6 +2229,9 @@ static int dsi_ctrl_dev_probe(struct platform_device *pdev)
dsi_ctrl->pdev = pdev;
platform_set_drvdata(pdev, dsi_ctrl);
uio_init(pdev);
DSI_CTRL_INFO(dsi_ctrl, "Probe successful\n");
return 0;

View File

@ -1240,12 +1240,14 @@ static void _sde_kms_release_splash_resource(struct sde_kms *sde_kms,
{
struct msm_drm_private *priv;
struct sde_splash_display *splash_display;
struct sde_power_handle *phandle;
int i;
if (!sde_kms || !crtc)
return;
priv = sde_kms->dev->dev_private;
phandle = &priv->phandle;
if (!crtc->state->active || !sde_kms->splash_data.num_splash_displays)
return;
@ -1272,9 +1274,9 @@ static void _sde_kms_release_splash_resource(struct sde_kms *sde_kms,
/* remove the votes if all displays are done with splash */
if (!sde_kms->splash_data.num_splash_displays) {
for (i = 0; i < SDE_POWER_HANDLE_DBUS_ID_MAX; i++)
sde_power_data_bus_set_quota(&priv->phandle, i,
sde_power_data_bus_set_quota(phandle, i,
SDE_POWER_HANDLE_ENABLE_BUS_AB_QUOTA,
SDE_POWER_HANDLE_ENABLE_BUS_IB_QUOTA);
phandle->ib_quota[i]);
pm_runtime_put_sync(sde_kms->dev->dev);
}

View File

@ -473,21 +473,24 @@ static void sde_power_parse_ib_votes(struct platform_device *pdev,
if (rc)
pr_err("error reading min core ib vote. rc=%d, np=%x\n", rc, pdev->dev.of_node);
phandle->min_ib_vote.min_core_ib = (!rc ? tmp*1000 : 0);
phandle->ib_quota[SDE_POWER_HANDLE_DBUS_ID_MNOC] = (!rc ? tmp*1000 :
SDE_POWER_HANDLE_ENABLE_BUS_IB_QUOTA);
rc = of_property_read_u32(pdev->dev.of_node,
"qcom,sde-min-llcc-ib-kbps", &tmp);
if (rc)
pr_err("error reading min llcc ib vote. rc=%d\n", rc);
phandle->min_ib_vote.min_llcc_ib = (!rc ? tmp*1000 : 0);
phandle->ib_quota[SDE_POWER_HANDLE_DBUS_ID_LLCC] = (!rc ? tmp*1000 :
SDE_POWER_HANDLE_ENABLE_BUS_IB_QUOTA);
rc = of_property_read_u32(pdev->dev.of_node,
"qcom,sde-min-dram-ib-kbps", &tmp);
if (rc)
pr_err("error reading min dram ib vote. rc=%d\n", rc);
phandle->min_ib_vote.min_dram_ib = (!rc ? tmp*1000 : 0);
phandle->ib_quota[SDE_POWER_HANDLE_DBUS_ID_EBI] = (!rc ? tmp*1000 :
SDE_POWER_HANDLE_ENABLE_BUS_IB_QUOTA);
}
static int sde_power_bus_parse(struct platform_device *pdev,
@ -732,7 +735,6 @@ int sde_power_resource_enable(struct sde_power_handle *phandle, bool enable)
{
int rc = 0, i = 0;
struct dss_module_power *mp;
u32 bus_ib_quota = 0;
if (!phandle) {
pr_err("invalid input argument\n");
@ -754,32 +756,17 @@ int sde_power_resource_enable(struct sde_power_handle *phandle, bool enable)
sde_power_event_trigger_locked(phandle,
SDE_POWER_EVENT_PRE_ENABLE);
for (i = 0; i < SDE_POWER_HANDLE_DBUS_ID_MAX &&
phandle->data_bus_handle[i].data_paths_cnt > 0; i++) {
bus_ib_quota = 0;
switch (i) {
case SDE_POWER_HANDLE_DBUS_ID_MNOC:
bus_ib_quota =
phandle->min_ib_vote.min_core_ib;
break;
case SDE_POWER_HANDLE_DBUS_ID_LLCC:
bus_ib_quota =
phandle->min_ib_vote.min_llcc_ib;
break;
case SDE_POWER_HANDLE_DBUS_ID_EBI:
bus_ib_quota =
phandle->min_ib_vote.min_dram_ib;
}
rc = _sde_power_data_bus_set_quota(
&phandle->data_bus_handle[i],
SDE_POWER_HANDLE_ENABLE_BUS_AB_QUOTA,
bus_ib_quota);
if (rc) {
pr_err("failed to set data bus vote id=%d rc=%d\n",
i, rc);
goto vreg_err;
for (i = 0; i < SDE_POWER_HANDLE_DBUS_ID_MAX; i++) {
if (phandle->data_bus_handle[i].data_paths_cnt > 0) {
rc = _sde_power_data_bus_set_quota(
&phandle->data_bus_handle[i],
SDE_POWER_HANDLE_ENABLE_BUS_AB_QUOTA,
phandle->ib_quota[i]);
if (rc) {
pr_err("failed to set data bus vote id=%d rc=%d\n",
i, rc);
goto vreg_err;
}
}
}
rc = msm_dss_enable_vreg(mp->vreg_config, mp->num_vreg,

View File

@ -126,18 +126,6 @@ struct sde_power_reg_bus_handle {
struct sde_power_bus_scaling_data scale_table[VOTE_INDEX_MAX];
};
/**
* struct sde_min_ib_vote: ib votes on data bus
* @min_core_ib: ib vote on mnoc
* @min_llcc_ib: ib vote on llcc
* @min_dram_ib: ib vote on dram
*/
struct sde_min_ib_vote {
u32 min_core_ib;
u32 min_llcc_ib;
u32 min_dram_ib;
};
/*
* struct sde_power_event - local event registration structure
* @client_name: name of the client registering
@ -166,6 +154,7 @@ struct sde_power_event {
* @event_list: current power handle event list
* @rsc_client: sde rsc client pointer
* @rsc_client_init: boolean to control rsc client create
* @ib_quota: ib quota of the given bus
*/
struct sde_power_handle {
struct dss_module_power mp;
@ -178,7 +167,7 @@ struct sde_power_handle {
u32 last_event_handled;
struct sde_rsc_client *rsc_client;
bool rsc_client_init;
struct sde_min_ib_vote min_ib_vote;
u64 ib_quota[SDE_POWER_HANDLE_DBUS_ID_MAX];
};
/**