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

Commit 6684d266 authored by Krishna Chaitanya Parimi's avatar Krishna Chaitanya Parimi Committed by Ian Maund
Browse files

msm: mdss: Fix case of pack pattern being 0 in mdp3



The pack pattern in mdp3 should never be 0. This pack pattern
is read by userspace using sysfs node. If found zero there
might be error in computation logic used for calculation of
CSC registers. This may cause adverse effects such as black
screen, hence the pack pattern exposed should be non zero
and valid.

Change-Id: I9d3a13f3ff3d932a6b62cf2f5715e6b18a6834e5
Signed-off-by: default avatarKrishna Chaitanya Parimi <cparimi@codeaurora.org>
parent 47723d76
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ static int mdp3_ctrl_lut_config(struct msm_fb_data_type *mfd,
				struct mdp_rgb_lut_data *cfg);
static void mdp3_ctrl_pp_resume(struct msm_fb_data_type *mfd);
static int mdp3_ctrl_reset(struct msm_fb_data_type *mfd);
static int mdp3_ctrl_get_pack_pattern(u32 imgType);

u32 mdp_lut_inverse16[MDP_LUT_SIZE] = {
0, 65536, 32768, 21845, 16384, 13107, 10923, 9362, 8192, 7282, 6554, 5958,
@@ -349,6 +350,10 @@ static ssize_t mdp3_packpattern_show(struct device *dev,

	pattern = mdp3_session->dma->output_config.pack_pattern;

	/* If pattern was found to be 0 then get pattern for fb imagetype */
	if (!pattern)
		pattern = mdp3_ctrl_get_pack_pattern(mfd->fb_imgType);

	pr_debug("fb%d pack_pattern c= %d.", mfd->index, pattern);
	rc = scnprintf(buf, PAGE_SIZE, "packpattern=%d \n", pattern);
	return rc;