summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUjwal Patel <ujwalp@codeaurora.org>2013-10-21 16:54:26 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:22:26 -0700
commit0722eaeef4db8520554a25cee4c7e9408e3b485b (patch)
treef60d6cdf37bf110273854897ee46d300975599e6
parent854eb17b511e86dbecf29dd2d14cdc1aa6b13e23 (diff)
msm: mdss: remove obsolete method of mixer register read/writes
Starting apq8084, mixer offsets have changed compared to previous chip-sets. Some of the code is still using old method of reading and writing to mixer registers which leads to incorrect hw programming. Replace these mixer register read/writes with working method. CRs-Fixed: 564273 Change-Id: I2aa1c5d24c6a1c5b89f77bd8d450c0831dd720b7 Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp.h12
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_ctl.c11
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_hwio.h2
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_overlay.c29
4 files changed, 27 insertions, 27 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp.h b/drivers/video/fbdev/msm/mdss_mdp.h
index 4afc5adc421d..5bec49f3c3af 100644
--- a/drivers/video/fbdev/msm/mdss_mdp.h
+++ b/drivers/video/fbdev/msm/mdss_mdp.h
@@ -422,7 +422,6 @@ enum mdss_screen_state {
MDSS_SCREEN_FORCE_BLANK,
};
-#define is_vig_pipe(_pipe_id_) ((_pipe_id_) <= MDSS_MDP_SSPP_VIG2)
static inline void mdss_mdp_ctl_write(struct mdss_mdp_ctl *ctl,
u32 reg, u32 val)
{
@@ -434,6 +433,17 @@ static inline u32 mdss_mdp_ctl_read(struct mdss_mdp_ctl *ctl, u32 reg)
return readl_relaxed(ctl->base + reg);
}
+static inline void mdp_mixer_write(struct mdss_mdp_mixer *mixer,
+ u32 reg, u32 val)
+{
+ writel_relaxed(val, mixer->base + reg);
+}
+
+static inline u32 mdp_mixer_read(struct mdss_mdp_mixer *mixer, u32 reg)
+{
+ return readl_relaxed(mixer->base + reg);
+}
+
static inline void mdss_mdp_pingpong_write(struct mdss_mdp_mixer *mixer,
u32 reg, u32 val)
{
diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
index d77e23eeaf60..296ee8b9f774 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
@@ -60,12 +60,6 @@ static DEFINE_MUTEX(mdss_mdp_ctl_lock);
static int mdss_mdp_mixer_free(struct mdss_mdp_mixer *mixer);
static inline int __mdss_mdp_ctl_get_mixer_off(struct mdss_mdp_mixer *mixer);
-static inline void mdp_mixer_write(struct mdss_mdp_mixer *mixer,
- u32 reg, u32 val)
-{
- writel_relaxed(val, mixer->base + reg);
-}
-
static inline u32 mdss_mdp_get_pclk_rate(struct mdss_mdp_ctl *ctl)
{
struct mdss_panel_info *pinfo = &ctl->panel_data->panel_info;
@@ -1162,13 +1156,12 @@ int mdss_mdp_ctl_start(struct mdss_mdp_ctl *ctl)
mdss_mdp_ctl_split_display_enable(1, ctl, sctl);
} else if (ctl->mixer_right) {
struct mdss_mdp_mixer *mixer = ctl->mixer_right;
- u32 out, off;
+ u32 out;
mdss_mdp_pp_resume(ctl, mixer->num);
mixer->params_changed++;
out = (mixer->height << 16) | mixer->width;
- off = MDSS_MDP_REG_LM_OFFSET(mixer->num);
- MDSS_MDP_REG_WRITE(off + MDSS_MDP_REG_LM_OUT_SIZE, out);
+ mdp_mixer_write(mixer, MDSS_MDP_REG_LM_OUT_SIZE, out);
mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_PACK_3D, 0);
}
}
diff --git a/drivers/video/fbdev/msm/mdss_mdp_hwio.h b/drivers/video/fbdev/msm/mdss_mdp_hwio.h
index 9dad5cd1d6ab..753f072a57c3 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_hwio.h
+++ b/drivers/video/fbdev/msm/mdss_mdp_hwio.h
@@ -280,8 +280,6 @@ enum mdss_mdp_stage_index {
MDSS_MDP_MAX_STAGE
};
-#define MDSS_MDP_REG_LM_OFFSET(lm) (0x03200 + ((lm) * 0x400))
-
#define MDSS_MDP_REG_LM_OP_MODE 0x000
#define MDSS_MDP_REG_LM_OUT_SIZE 0x004
#define MDSS_MDP_REG_LM_BORDER_COLOR_0 0x008
diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
index 742e6b598c2b..49cecb37c8aa 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
@@ -1841,7 +1841,7 @@ static int mdss_mdp_hw_cursor_update(struct msm_fb_data_type *mfd,
struct mdss_mdp_mixer *mixer;
struct fb_image *img = &cursor->image;
u32 blendcfg;
- int off, ret = 0;
+ int ret = 0;
if (!mfd->cursor_buf && (cursor->set & FB_CUR_SETIMAGE)) {
mfd->cursor_buf = dma_alloc_coherent(NULL, MDSS_MDP_CURSOR_SIZE,
@@ -1867,7 +1867,6 @@ static int mdss_mdp_hw_cursor_update(struct msm_fb_data_type *mfd,
}
mixer = mdss_mdp_mixer_get(mdp5_data->ctl, MDSS_MDP_MIXER_MUX_DEFAULT);
- off = MDSS_MDP_REG_LM_OFFSET(mixer->num);
if ((img->width > MDSS_MDP_CURSOR_WIDTH) ||
(img->height > MDSS_MDP_CURSOR_HEIGHT) ||
@@ -1878,10 +1877,10 @@ static int mdss_mdp_hw_cursor_update(struct msm_fb_data_type *mfd,
cursor->set);
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON, false);
- blendcfg = MDSS_MDP_REG_READ(off + MDSS_MDP_REG_LM_CURSOR_BLEND_CONFIG);
+ blendcfg = mdp_mixer_read(mixer, MDSS_MDP_REG_LM_CURSOR_BLEND_CONFIG);
if (cursor->set & FB_CUR_SETPOS)
- MDSS_MDP_REG_WRITE(off + MDSS_MDP_REG_LM_CURSOR_START_XY,
+ mdp_mixer_write(mixer, MDSS_MDP_REG_LM_CURSOR_START_XY,
(img->dy << 16) | img->dx);
if (cursor->set & FB_CUR_SETIMAGE) {
@@ -1919,37 +1918,37 @@ static int mdss_mdp_hw_cursor_update(struct msm_fb_data_type *mfd,
calpha_en = 0x2; /* argb */
size = (img->height << 16) | img->width;
- MDSS_MDP_REG_WRITE(off + MDSS_MDP_REG_LM_CURSOR_IMG_SIZE, size);
- MDSS_MDP_REG_WRITE(off + MDSS_MDP_REG_LM_CURSOR_SIZE, size);
- MDSS_MDP_REG_WRITE(off + MDSS_MDP_REG_LM_CURSOR_STRIDE,
+ mdp_mixer_write(mixer, MDSS_MDP_REG_LM_CURSOR_IMG_SIZE, size);
+ mdp_mixer_write(mixer, MDSS_MDP_REG_LM_CURSOR_SIZE, size);
+ mdp_mixer_write(mixer, MDSS_MDP_REG_LM_CURSOR_STRIDE,
img->width * 4);
- MDSS_MDP_REG_WRITE(off + MDSS_MDP_REG_LM_CURSOR_BASE_ADDR,
+ mdp_mixer_write(mixer, MDSS_MDP_REG_LM_CURSOR_BASE_ADDR,
cursor_addr);
wmb();
blendcfg &= ~0x1;
blendcfg |= (transp_en << 3) | (calpha_en << 1);
- MDSS_MDP_REG_WRITE(off + MDSS_MDP_REG_LM_CURSOR_BLEND_CONFIG,
+ mdp_mixer_write(mixer, MDSS_MDP_REG_LM_CURSOR_BLEND_CONFIG,
blendcfg);
if (calpha_en)
- MDSS_MDP_REG_WRITE(off +
+ mdp_mixer_write(mixer,
MDSS_MDP_REG_LM_CURSOR_BLEND_PARAM,
alpha);
if (transp_en) {
- MDSS_MDP_REG_WRITE(off +
+ mdp_mixer_write(mixer,
MDSS_MDP_REG_LM_CURSOR_BLEND_TRANSP_LOW0,
((img->bg_color & 0xff00) << 8) |
(img->bg_color & 0xff));
- MDSS_MDP_REG_WRITE(off +
+ mdp_mixer_write(mixer,
MDSS_MDP_REG_LM_CURSOR_BLEND_TRANSP_LOW1,
((img->bg_color & 0xff0000) >> 16));
- MDSS_MDP_REG_WRITE(off +
+ mdp_mixer_write(mixer,
MDSS_MDP_REG_LM_CURSOR_BLEND_TRANSP_HIGH0,
((img->bg_color & 0xff00) << 8) |
(img->bg_color & 0xff));
- MDSS_MDP_REG_WRITE(off +
+ mdp_mixer_write(mixer,
MDSS_MDP_REG_LM_CURSOR_BLEND_TRANSP_HIGH1,
((img->bg_color & 0xff0000) >> 16));
}
@@ -1964,7 +1963,7 @@ static int mdss_mdp_hw_cursor_update(struct msm_fb_data_type *mfd,
blendcfg &= ~0x1;
}
- MDSS_MDP_REG_WRITE(off + MDSS_MDP_REG_LM_CURSOR_BLEND_CONFIG,
+ mdp_mixer_write(mixer, MDSS_MDP_REG_LM_CURSOR_BLEND_CONFIG,
blendcfg);
mixer->cursor_enabled = cursor->enable;