diff options
| author | Shivaraj Shetty <shivaraj@codeaurora.org> | 2014-09-24 22:51:55 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:37:10 -0700 |
| commit | 67354515db39483f29a8a77121d4787325f681df (patch) | |
| tree | 13b8d45dd8e0d517ffc725f184f612feaacb60e2 | |
| parent | a3beddf7a2cb4e8741bd6dfc2ff38817e997dfe8 (diff) | |
msm: mdss: Add get pan cfg and get iommu dom to common interface
Add get panel configuration and get iommu domain functions to
common utility interface. This will make sure that DSI 6G gets
the right information on ferrum which has mdp3.
Change-Id: Ib5a9d70b8202eaa9e3003475398ecef88dfb573d
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdp3.c | 40 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss.h | 4 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.c | 11 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi_host.c | 10 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp.c | 4 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_util.c | 5 |
6 files changed, 48 insertions, 26 deletions
diff --git a/drivers/video/fbdev/msm/mdp3.c b/drivers/video/fbdev/msm/mdp3.c index c5d83d4a63f6..7f45398131cd 100644 --- a/drivers/video/fbdev/msm/mdp3.c +++ b/drivers/video/fbdev/msm/mdp3.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. * Copyright (C) 2007 Google Incorporated * * This software is licensed under the terms of the GNU General Public @@ -705,6 +705,18 @@ static int mdp3_irq_setup(void) return 0; } + +static int mdp3_get_iommu_domain(u32 type) +{ + if (type >= MDSS_IOMMU_MAX_DOMAIN) + return -EINVAL; + + if (!mdp3_res) + return -ENODEV; + + return mdp3_res->domains[type].domain_idx; +} + int mdp3_iommu_attach(int context) { int rc = 0; @@ -1948,6 +1960,18 @@ int mdp3_footswitch_ctrl(int enable) return rc; } +struct mdss_panel_cfg *mdp3_panel_intf_type(int intf_val) +{ + if (!mdp3_res || !mdp3_res->pan_cfg.init_done) + return ERR_PTR(-EPROBE_DEFER); + + if (mdp3_res->pan_cfg.pan_intf == intf_val) + return &mdp3_res->pan_cfg; + else + return NULL; +} +EXPORT_SYMBOL(mdp3_panel_intf_type); + static int mdp3_probe(struct platform_device *pdev) { int rc; @@ -1992,9 +2016,11 @@ static int mdp3_probe(struct platform_device *pdev) rc = -ENODEV; goto get_util_fail; } + mdp3_res->mdss_util->get_iommu_domain = mdp3_get_iommu_domain; mdp3_res->mdss_util->iommu_attached = mdp3_iommu_is_attached; mdp3_res->mdss_util->iommu_ctrl = mdp3_iommu_ctrl; mdp3_res->mdss_util->bus_scale_set_quota = mdp3_bus_scale_set_quota; + mdp3_res->mdss_util->panel_intf_type = mdp3_panel_intf_type; rc = mdp3_parse_dt(pdev); if (rc) @@ -2066,18 +2092,6 @@ get_util_fail: return rc; } -struct mdss_panel_cfg *mdp3_panel_intf_type(int intf_val) -{ - if (!mdp3_res || !mdp3_res->pan_cfg.init_done) - return ERR_PTR(-EPROBE_DEFER); - - if (mdp3_res->pan_cfg.pan_intf == intf_val) - return &mdp3_res->pan_cfg; - else - return NULL; -} -EXPORT_SYMBOL(mdp3_panel_intf_type); - int mdp3_panel_get_boot_cfg(void) { int rc; diff --git a/drivers/video/fbdev/msm/mdss.h b/drivers/video/fbdev/msm/mdss.h index 1420e4fd70be..57cb83450ebd 100644 --- a/drivers/video/fbdev/msm/mdss.h +++ b/drivers/video/fbdev/msm/mdss.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -325,10 +325,12 @@ struct mdss_util_intf { void (*disable_irq)(struct mdss_hw *hw); void (*disable_irq_nosync)(struct mdss_hw *hw); int (*irq_dispatch)(u32 hw_ndx, int irq, void *ptr); + int (*get_iommu_domain)(u32 type); int (*iommu_attached)(void); int (*iommu_ctrl)(int enable); void (*bus_bandwidth_ctrl)(int enable); int (*bus_scale_set_quota)(int client, u64 ab_quota, u64 ib_quota); + struct mdss_panel_cfg* (*panel_intf_type)(int intf_val); }; struct mdss_util_intf *mdss_get_util_intf(void); diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c index d25a04bb136b..3f35de8cd608 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.c +++ b/drivers/video/fbdev/msm/mdss_dsi.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -497,7 +497,8 @@ novreg: return rc; } -static int mdss_dsi_get_panel_cfg(char *panel_cfg) +static int mdss_dsi_get_panel_cfg(char *panel_cfg, + struct mdss_dsi_ctrl_pdata *ctrl) { int rc; struct mdss_panel_cfg *pan_cfg = NULL; @@ -505,7 +506,7 @@ static int mdss_dsi_get_panel_cfg(char *panel_cfg) if (!panel_cfg) return MDSS_PANEL_INTF_INVALID; - pan_cfg = mdss_panel_intf_type(MDSS_PANEL_INTF_DSI); + pan_cfg = ctrl->mdss_util->panel_intf_type(MDSS_PANEL_INTF_DSI); if (IS_ERR(pan_cfg)) { return PTR_ERR(pan_cfg); } else if (!pan_cfg) { @@ -1507,7 +1508,7 @@ static int mdss_dsi_ctrl_probe(struct platform_device *pdev) return -ENOTSUPP; } - pan_cfg = mdss_panel_intf_type(MDSS_PANEL_INTF_HDMI); + pan_cfg = util->panel_intf_type(MDSS_PANEL_INTF_HDMI); if (IS_ERR(pan_cfg)) { return PTR_ERR(pan_cfg); } else if (pan_cfg) { @@ -1586,7 +1587,7 @@ static int mdss_dsi_ctrl_probe(struct platform_device *pdev) pdev->dev.of_node, "qcom,dsi-panel-bias-vreg"); /* DSI panels can be different between controllers */ - rc = mdss_dsi_get_panel_cfg(panel_cfg); + rc = mdss_dsi_get_panel_cfg(panel_cfg, ctrl_pdata); if (!rc) /* dsi panel cfg not present */ pr_warn("%s:%d:dsi specific cfg not present\n", diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c index 847cbe3dd1a0..75f0c430962d 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_host.c +++ b/drivers/video/fbdev/msm/mdss_dsi_host.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1522,7 +1522,7 @@ static int mdss_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl, if (ctrl->mdss_util->iommu_attached()) { int ret = msm_iommu_map_contig_buffer(tp->dmap, - mdss_get_iommu_domain(domain), 0, + ctrl->mdss_util->get_iommu_domain(domain), 0, ctrl->dma_size, SZ_4K, 0, &(ctrl->dma_addr)); if (IS_ERR_VALUE(ret)) { pr_err("unable to map dma memory to iommu(%d)\n", ret); @@ -1570,7 +1570,8 @@ static int mdss_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl, if (mctrl && mctrl->dma_addr) { if (ctrl->mdss_util->iommu_attached()) { msm_iommu_unmap_contig_buffer(mctrl->dma_addr, - mdss_get_iommu_domain(domain), 0, mctrl->dma_size); + ctrl->mdss_util->get_iommu_domain(domain), + 0, mctrl->dma_size); } mctrl->dma_addr = 0; mctrl->dma_size = 0; @@ -1578,7 +1579,8 @@ static int mdss_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl, if (ctrl->mdss_util->iommu_attached()) { msm_iommu_unmap_contig_buffer(ctrl->dma_addr, - mdss_get_iommu_domain(domain), 0, ctrl->dma_size); + ctrl->mdss_util->get_iommu_domain(domain), + 0, ctrl->dma_size); } ctrl->dma_addr = 0; diff --git a/drivers/video/fbdev/msm/mdss_mdp.c b/drivers/video/fbdev/msm/mdss_mdp.c index ac9d21fb3034..1c55ef28d705 100644 --- a/drivers/video/fbdev/msm/mdss_mdp.c +++ b/drivers/video/fbdev/msm/mdss_mdp.c @@ -1,7 +1,7 @@ /* * MDSS MDP Interface (used by framebuffer core) * - * Copyright (c) 2007-2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2007-2015, The Linux Foundation. All rights reserved. * Copyright (C) 2007 Google Incorporated * * This software is licensed under the terms of the GNU General Public @@ -1480,10 +1480,12 @@ static int mdss_mdp_probe(struct platform_device *pdev) return -ENODEV; } + mdss_res->mdss_util->get_iommu_domain = mdss_get_iommu_domain; mdss_res->mdss_util->iommu_attached = is_mdss_iommu_attached; mdss_res->mdss_util->iommu_ctrl = mdss_iommu_ctrl; mdss_res->mdss_util->bus_scale_set_quota = mdss_bus_scale_set_quota; mdss_res->mdss_util->bus_bandwidth_ctrl = mdss_bus_bandwidth_ctrl; + mdss_res->mdss_util->panel_intf_type = mdss_panel_intf_type; rc = msm_dss_ioremap_byname(pdev, &mdata->mdss_io, "mdp_phys"); if (rc) { diff --git a/drivers/video/fbdev/msm/mdss_util.c b/drivers/video/fbdev/msm/mdss_util.c index b0eb962f909d..bde9add2c6dd 100644 --- a/drivers/video/fbdev/msm/mdss_util.c +++ b/drivers/video/fbdev/msm/mdss_util.c @@ -1,5 +1,5 @@ -/* Copyright (c) 2007-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2007-2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -145,12 +145,13 @@ struct mdss_util_intf mdss_util = { .disable_irq = mdss_disable_irq, .disable_irq_nosync = mdss_disable_irq_nosync, .irq_dispatch = mdss_irq_dispatch, + .get_iommu_domain = NULL, .iommu_attached = NULL, .iommu_ctrl = NULL, .bus_bandwidth_ctrl = NULL, .bus_scale_set_quota = NULL, + .panel_intf_type = NULL, .mdp_probe_done = false - }; struct mdss_util_intf *mdss_get_util_intf() |
