summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeera Sundaram Sankaran <veeras@codeaurora.org>2015-01-08 12:20:41 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:37:16 -0700
commit6fada7ee2f6eeec23b441bf5f38ceac66ddb01f2 (patch)
treedd7e3eddbc6e89f23551acb60b446c2359bd7bf8
parent737b46a4bcb2eb702e516845c5e81b219f803597 (diff)
msm: mdss: Fix apq8084 compilation failure due to large struct size
Due to overlay struct size increase, the stack size requirement for function is increasing when it is used as local variable. This causes the compilation failure due to fix stack size on APQ8084. This change fixes the issue by using overlay structure from heap instead of stack. Change-Id: I9ca116a8db9c01f488a7cbc85c659827ba3693b3 Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_overlay.c55
1 files changed, 31 insertions, 24 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
index f04202b820d7..c87f9796415d 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
@@ -2781,7 +2781,7 @@ static int mdss_mdp_hw_cursor_pipe_update(struct msm_fb_data_type *mfd,
struct mdss_mdp_mixer *mixer;
struct fb_image *img = &cursor->image;
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
- struct mdp_overlay req;
+ struct mdp_overlay *req = NULL;
struct mdss_rect roi;
int ret = 0;
u32 xres = mfd->fbi->var.xres;
@@ -2879,24 +2879,30 @@ static int mdss_mdp_hw_cursor_pipe_update(struct msm_fb_data_type *mfd,
roi.w = min(xres - start_x, img->width - roi.x);
roi.h = min(yres - start_y, img->height - roi.y);
- memset(&req, 0, sizeof(struct mdp_overlay));
- req.pipe_type = PIPE_TYPE_CURSOR;
- req.z_order = MDSS_MDP_STAGE_6;
+ req = kzalloc(sizeof(struct mdp_overlay), GFP_KERNEL);
+ if (!req) {
+ pr_err("not able to allocate memory for req\n");
+ goto done;
+ }
- req.src.width = img->width;
- req.src.height = img->height;
- req.src.format = MDP_ARGB_8888;
+ req->pipe_type = PIPE_TYPE_CURSOR;
+ req->z_order = MDSS_MDP_STAGE_6;
- mdss_mdp_set_rect(&req.src_rect, roi.x, roi.y, img->width, img->height);
- mdss_mdp_set_rect(&req.dst_rect, start_x, start_y, roi.w, roi.h);
+ req->src.width = img->width;
+ req->src.height = img->height;
+ req->src.format = MDP_ARGB_8888;
- req.bg_color = img->bg_color;
- req.alpha = (img->fg_color & 0xff000000) >> 24;
- if (req.alpha == 0xff)
- req.blend_op = BLEND_OP_OPAQUE;
+ mdss_mdp_set_rect(&req->src_rect, roi.x, roi.y, img->width,
+ img->height);
+ mdss_mdp_set_rect(&req->dst_rect, start_x, start_y, roi.w, roi.h);
+
+ req->bg_color = img->bg_color;
+ req->alpha = (img->fg_color & 0xff000000) >> 24;
+ if (req->alpha == 0xff)
+ req->blend_op = BLEND_OP_OPAQUE;
else
- req.blend_op = BLEND_OP_COVERAGE;
- req.transp_mask = (img->bg_color & 0xffffff);
+ req->blend_op = BLEND_OP_COVERAGE;
+ req->transp_mask = (img->bg_color & 0xffffff);
if (mfd->cursor_buf && (cursor->set & FB_CUR_SETIMAGE)) {
u32 cursor_addr;
@@ -2925,29 +2931,30 @@ static int mdss_mdp_hw_cursor_pipe_update(struct msm_fb_data_type *mfd,
}
if (start_x + roi.w <= left_lm_w) {
- ret = mdss_mdp_cursor_pipe_setup(mfd, &req, CURSOR_PIPE_LEFT);
+ ret = mdss_mdp_cursor_pipe_setup(mfd, req, CURSOR_PIPE_LEFT);
mdss_mdp_curor_pipe_cleanup(mfd, CURSOR_PIPE_RIGHT);
} else if (start_x >= left_lm_w) {
- ret = mdss_mdp_cursor_pipe_setup(mfd, &req, CURSOR_PIPE_RIGHT);
+ ret = mdss_mdp_cursor_pipe_setup(mfd, req, CURSOR_PIPE_RIGHT);
mdss_mdp_curor_pipe_cleanup(mfd, CURSOR_PIPE_LEFT);
} else {
- mdss_mdp_set_rect(&req.dst_rect, start_x, start_y,
+ mdss_mdp_set_rect(&req->dst_rect, start_x, start_y,
(left_lm_w - start_x), roi.h);
- mdss_mdp_set_rect(&req.src_rect, 0, 0, (left_lm_w -
+ mdss_mdp_set_rect(&req->src_rect, 0, 0, (left_lm_w -
start_x), img->height);
- ret = mdss_mdp_cursor_pipe_setup(mfd, &req, CURSOR_PIPE_LEFT);
+ ret = mdss_mdp_cursor_pipe_setup(mfd, req, CURSOR_PIPE_LEFT);
if (ret)
goto done;
- mdss_mdp_set_rect(&req.dst_rect, left_lm_w, start_y, ((start_x +
- roi.w) - left_lm_w), roi.h);
- mdss_mdp_set_rect(&req.src_rect, (left_lm_w - start_x), 0,
+ mdss_mdp_set_rect(&req->dst_rect, left_lm_w, start_y,
+ ((start_x + roi.w) - left_lm_w), roi.h);
+ mdss_mdp_set_rect(&req->src_rect, (left_lm_w - start_x), 0,
(img->width - (left_lm_w - start_x)),
img->height);
- ret = mdss_mdp_cursor_pipe_setup(mfd, &req, CURSOR_PIPE_RIGHT);
+ ret = mdss_mdp_cursor_pipe_setup(mfd, req, CURSOR_PIPE_RIGHT);
}
done:
+ kfree(req);
mutex_unlock(&mdp5_data->ov_lock);
return ret;
}