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

Commit 9f0797e0 authored by Terence Hampson's avatar Terence Hampson
Browse files

mdp3: configure dma source when displaying new frame



During Linux Bootloader to kernel transition, kernel's first call
to overlay_set would reconfigure dma source configurations. This
reconfiguration could happen before vsync but the corresponding
call to overlay_commit would occur after the vsync. This race
condition could cause artifacts to appear on screen. This issue
only occurs on video mode panels.

Change-Id: I1c1274a9c32cb74276162e74c22ad35afef0eb7c
Signed-off-by: default avatarTerence Hampson <thampson@codeaurora.org>
parent 93438b82
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -898,9 +898,7 @@ static int mdp3_overlay_set(struct msm_fb_data_type *mfd,
			dma->source_config.stride = stride;
			dma->output_config.pack_pattern =
				mdp3_ctrl_get_pack_pattern(req->src.format);
			mdp3_clk_enable(1, 0);
			mdp3_session->dma->dma_config_source(dma);
			mdp3_clk_enable(0, 0);
			dma->update_src_cfg = true;
		}
		mdp3_session->overlay.id = 1;
		req->id = 1;
@@ -924,14 +922,6 @@ static int mdp3_overlay_unset(struct msm_fb_data_type *mfd, int ndx)
	mutex_lock(&mdp3_session->lock);

	if (mdp3_session->overlay.id == ndx && ndx == 1) {
		struct mdp3_dma *dma = mdp3_session->dma;
		dma->source_config.format = format;
		dma->source_config.stride = fix->line_length;
		dma->output_config.pack_pattern =
			mdp3_ctrl_get_pack_pattern(mfd->fb_imgType);
		mdp3_clk_enable(1, 0);
		mdp3_session->dma->dma_config_source(dma);
		mdp3_clk_enable(0, 0);
		mdp3_session->overlay.id = MSMFB_NEW_REQUEST;
		mdp3_bufq_deinit(&mdp3_session->bufq_in);
	} else {
+8 −0
Original line number Diff line number Diff line
@@ -605,6 +605,13 @@ static int mdp3_dmap_update(struct mdp3_dma *dma, void *buf,
			}
		}
	}
	if (dma->update_src_cfg) {
		if (dma->output_config.out_sel ==
				 MDP3_DMA_OUTPUT_SEL_DSI_VIDEO && intf->active)
			pr_err("configuring dma source while dma is active\n");
		dma->dma_config_source(dma);
		dma->update_src_cfg = false;
	}
	spin_lock_irqsave(&dma->dma_lock, flag);
	MDP3_REG_WRITE(MDP3_REG_DMA_P_IBUF_ADDR, (u32)buf);
	dma->source_config.buf = (int)buf;
@@ -961,6 +968,7 @@ int mdp3_dma_init(struct mdp3_dma *dma)
	dma->vsync_client.handler = NULL;
	dma->vsync_client.arg = NULL;
	dma->histo_state = MDP3_DMA_HISTO_STATE_IDLE;
	dma->update_src_cfg = false;

	memset(&dma->cursor, 0, sizeof(dma->cursor));
	memset(&dma->ccs_config, 0, sizeof(dma->ccs_config));
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -259,6 +259,7 @@ struct mdp3_dma {
	int histo_state;
	struct mdp3_dma_histogram_data histo_data;
	unsigned int vsync_status;
	bool update_src_cfg;

	int (*dma_config)(struct mdp3_dma *dma,
			struct mdp3_dma_source *source_config,