From 44d78c021c2f457d7096c002bcef3cce295f7bb0 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Fri, 17 Jul 2015 17:18:45 -0400 Subject: msm: mdss: y offset calc based on format micro tile height Address offset was using hardcoded micro tile height of 8; Micro tile height is not fixed and varies from format to format. Change-Id: Idd033c955997ce56c64861637c60dd8e6f08c61e Signed-off-by: Terence Hampson --- drivers/video/fbdev/msm/mdss_mdp_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/video/fbdev/msm/mdss_mdp_util.c b/drivers/video/fbdev/msm/mdss_mdp_util.c index bde3f67c2da5..668f19169c02 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_util.c +++ b/drivers/video/fbdev/msm/mdss_mdp_util.c @@ -822,7 +822,7 @@ int mdss_mdp_validate_offset_for_ubwc_format( return -EINVAL; } - if (y % (UBWC_META_MACRO_W_H)) { + if (y % (micro_h * UBWC_META_MACRO_W_H)) { pr_err("y=%d does not align with meta height=%d\n", y, UBWC_META_MACRO_W_H); return -EINVAL; @@ -875,7 +875,7 @@ void mdss_mdp_ubwc_data_calc_offset(struct mdss_mdp_data *data, u16 x, u16 y, goto done; } - offset = (y / 8) * ps->ystride[2] + + offset = (y / micro_h) * ps->ystride[2] + ((x / micro_w) / UBWC_META_MACRO_W_H) * UBWC_META_BLOCK_SIZE; if (offset < data->p[2].len) { @@ -885,7 +885,7 @@ void mdss_mdp_ubwc_data_calc_offset(struct mdss_mdp_data *data, u16 x, u16 y, goto done; } - offset = ((y / 2) / 8) * ps->ystride[3] + + offset = ((y / 2) / micro_h) * ps->ystride[3] + (((x / 2) / chroma_micro_w) / UBWC_META_MACRO_W_H) * UBWC_META_BLOCK_SIZE; if (offset < data->p[3].len) { @@ -905,7 +905,7 @@ void mdss_mdp_ubwc_data_calc_offset(struct mdss_mdp_data *data, u16 x, u16 y, goto done; } - offset = DIV_ROUND_UP(y, 8) * ps->ystride[2] + + offset = DIV_ROUND_UP(y, micro_h) * ps->ystride[2] + ((x / micro_w) / UBWC_META_MACRO_W_H) * UBWC_META_BLOCK_SIZE; if (offset < data->p[2].len) { -- cgit v1.2.3