Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 936b491b authored by Vishnuvardhan Prodduturi's avatar Vishnuvardhan Prodduturi Committed by Sandeep Panda
Browse files

msm: mdss: fix 32 bit compilation issues



Fix compilation issues with unsigned division. Also build
errors are seen for 32bit compilation as local variable of
mdp_overlay in function mdss_mdp_overlay_get_fb_pipe has
huge size which crossing the 1024 limit. Use heap instead
of stack in this case to fix the issue.

Change-Id: I67e8498421d2e116e77076637716708cfc289c96
Signed-off-by: default avatarVishnuvardhan Prodduturi <vproddut@codeaurora.org>
parent ec7db6c5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -938,9 +938,11 @@ static void mdss_fb_videomode_from_panel_timing(struct fb_videomode *videomode,
		v_total = videomode->yres + videomode->lower_margin
			+ videomode->upper_margin + videomode->vsync_len;
		clk_rate = h_total * v_total * videomode->refresh;
		videomode->pixclock = KHZ2PICOS(clk_rate / 1000);
		videomode->pixclock =
			KHZ2PICOS(clk_rate / 1000);
	} else {
		videomode->pixclock = KHZ2PICOS(pt->clk_rate / 1000);
		videomode->pixclock =
			KHZ2PICOS((unsigned long)pt->clk_rate / 1000);
	}
}

@@ -3276,7 +3278,7 @@ void mdss_panelinfo_to_fb_var(struct mdss_panel_info *pinfo,
	var->right_margin = pinfo->lcdc.h_front_porch;
	var->left_margin = pinfo->lcdc.h_back_porch;
	var->hsync_len = pinfo->lcdc.h_pulse_width;
	var->pixclock = KHZ2PICOS(pinfo->clk_rate / 1000);
	var->pixclock = KHZ2PICOS((unsigned long int)pinfo->clk_rate/1000);

	if (pinfo->physical_width)
		var->width = pinfo->physical_width;
+3 −3
Original line number Diff line number Diff line
@@ -238,8 +238,8 @@ struct msm_mdp_interface {

#define IS_CALIB_MODE_BL(mfd) (((mfd)->calib_mode) & MDSS_CALIB_MODE_BL)
#define MDSS_BRIGHT_TO_BL(out, v, bl_max, max_bright) do {\
					out = (2 * (v) * (bl_max) + max_bright)\
					/ (2 * max_bright);\
				out = (2 * (v) * (bl_max) + max_bright);\
				do_div(out, 2 * max_bright);\
				} while (0)

struct mdss_fb_file_info {
+26 −21
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ static int mdss_mdp_splash_kickoff(struct msm_fb_data_type *mfd,
{
	struct mdss_mdp_pipe *pipe;
	struct fb_info *fbi;
	struct mdp_overlay req;
	struct mdp_overlay *req = NULL;
	struct mdss_overlay_private *mdp5_data;
	struct mdss_data_type *mdata;
	struct mdss_mdp_mixer *mixer;
@@ -399,7 +399,10 @@ static int mdss_mdp_splash_kickoff(struct msm_fb_data_type *mfd,
		goto end;
	}

	memset(&req, 0, sizeof(struct mdp_overlay));
	req = kzalloc(sizeof(struct mdp_overlay), GFP_KERNEL);
	if (!req)
		return -ENOMEM;

	/*
	 * use single pipe for
	 * 1. split display disabled
@@ -418,23 +421,23 @@ static int mdss_mdp_splash_kickoff(struct msm_fb_data_type *mfd,
		dest_rect->w < min_t(u16, mixer->width,
					mdss_mdp_line_buffer_width()));

	req.src.width = src_rect->w;
	req->src.width = src_rect->w;
	if (use_single_pipe)
		req.src_rect.w = src_rect->w;
		req->src_rect.w = src_rect->w;
	else
		req.src_rect.w = min_t(u16, mixer->width, src_rect->w >> 1);
	req.dst_rect.w = req.src_rect.w;
	req.src.height = req.dst_rect.h = req.src_rect.h =
		req->src_rect.w = min_t(u16, mixer->width, src_rect->w >> 1);
	req->dst_rect.w = req->src_rect.w;
	req->src.height = req->dst_rect.h = req->src_rect.h =
			src_rect->h;
	req.src.format = SPLASH_IMAGE_FORMAT;
	req.id = MSMFB_NEW_REQUEST;
	req.z_order = MDSS_MDP_STAGE_0;
	req.alpha = 0xff;
	req.transp_mask = MDP_TRANSP_NOP;
	req.dst_rect.x = dest_rect->x;
	req.dst_rect.y = dest_rect->y;

	pipe = mdss_mdp_splash_get_pipe(mfd, &req);
	req->src.format = SPLASH_IMAGE_FORMAT;
	req->id = MSMFB_NEW_REQUEST;
	req->z_order = MDSS_MDP_STAGE_0;
	req->alpha = 0xff;
	req->transp_mask = MDP_TRANSP_NOP;
	req->dst_rect.x = dest_rect->x;
	req->dst_rect.y = dest_rect->y;

	pipe = mdss_mdp_splash_get_pipe(mfd, req);
	if (!pipe) {
		pr_err("unable to allocate base pipe\n");
		ret = -EINVAL;
@@ -444,11 +447,11 @@ static int mdss_mdp_splash_kickoff(struct msm_fb_data_type *mfd,
	sinfo->pipe_ndx[0] = pipe->ndx;

	if (!use_single_pipe) {
		req.id = MSMFB_NEW_REQUEST;
		req.src_rect.x = src_rect->x + min_t(u16, mixer->width,
					src_rect->w - req.src_rect.w);
		req.dst_rect.x = mixer->width;
		pipe = mdss_mdp_splash_get_pipe(mfd, &req);
		req->id = MSMFB_NEW_REQUEST;
		req->src_rect.x = src_rect->x + min_t(u16, mixer->width,
					src_rect->w - req->src_rect.w);
		req->dst_rect.x = mixer->width;
		pipe = mdss_mdp_splash_get_pipe(mfd, req);
		if (!pipe) {
			pr_err("unable to allocate right base pipe\n");
			mdss_mdp_overlay_release(mfd, sinfo->pipe_ndx[0]);
@@ -466,8 +469,10 @@ static int mdss_mdp_splash_kickoff(struct msm_fb_data_type *mfd,
					sinfo->pipe_ndx[1]);
	}

	kfree(req);
	return ret;
end:
	kfree(req);
	sinfo->pipe_ndx[0] = INVALID_PIPE_INDEX;
	sinfo->pipe_ndx[1] = INVALID_PIPE_INDEX;
	mutex_unlock(&mdp5_data->ov_lock);