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

Commit 40961ea2 authored by Dhaval Patel's avatar Dhaval Patel
Browse files

msm: mdss: Move splash thread functionality



framebuffer and overlay drivers are tightly coupled with
splash thread functionality. This adds lots of code
related to continuous splash screen handling in
both drivers. Moving them to separate file cleans up
both drivers and allows to handle continuous splash screen
cases efficiently.

CRs-fixed: 605934
Change-Id: Id89bb281dbbf22e726cf5fd97e93f891e5c73f60
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 11e8434e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ mdss-mdp-objs += mdss_mdp_intf_cmd.o
mdss-mdp-objs += mdss_mdp_intf_writeback.o
mdss-mdp-objs += mdss_mdp_rotator.o
mdss-mdp-objs += mdss_mdp_overlay.o
mdss-mdp-objs += mdss_mdp_splash_logo.o
mdss-mdp-objs += mdss_mdp_wb.o
obj-$(CONFIG_FB_MSM_MDSS) += mdss-mdp.o

+2 −8
Original line number Diff line number Diff line
@@ -27,10 +27,7 @@

#define VSYNC_EXPIRE_TICK	4

static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd,
					struct mdp_overlay *req,
					int image_size,
					int *pipe_ndx);
static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd);
static int mdp3_overlay_unset(struct msm_fb_data_type *mfd, int ndx);
static int mdp3_histogram_stop(struct mdp3_session_data *session,
					u32 block);
@@ -1057,10 +1054,7 @@ static int mdp3_ctrl_display_commit_kickoff(struct msm_fb_data_type *mfd,
	return 0;
}

static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd,
					struct mdp_overlay *req,
					int image_size,
					int *pipe_ndx)
static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd)
{
	struct fb_info *fbi;
	struct mdp3_session_data *mdp3_session;
+4 −61
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@
#include <linux/msm_iommu_domains.h>

#include "mdss_fb.h"
#include "mdss_mdp_splash_logo.h"

#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
#define MDSS_FB_NUM 3
@@ -195,47 +196,6 @@ static int mdss_fb_notify_update(struct msm_fb_data_type *mfd,
	return ret;
}

static int mdss_fb_splash_thread(void *data)
{
	struct msm_fb_data_type *mfd = data;
	int ret = -EINVAL;
	struct fb_info *fbi = NULL;
	int ov_index[2];

	if (!mfd || !mfd->fbi || !mfd->mdp.splash_fnc) {
		pr_err("Invalid input parameter\n");
		goto end;
	}

	fbi = mfd->fbi;

	ret = mdss_fb_open(fbi, current->tgid);
	if (ret) {
		pr_err("fb_open failed\n");
		goto end;
	}

	mfd->bl_updated = true;
	mdss_fb_set_backlight(mfd, mfd->panel_info->bl_max >> 1);

	ret = mfd->mdp.splash_fnc(mfd, ov_index, MDP_CREATE_SPLASH_OV);
	if (ret) {
		pr_err("Splash image failed\n");
		goto splash_err;
	}

	do {
		schedule_timeout_interruptible(SPLASH_THREAD_WAIT_TIMEOUT * HZ);
	} while (!kthread_should_stop());

	mfd->mdp.splash_fnc(mfd, ov_index, MDP_REMOVE_SPLASH_OV);

splash_err:
	mdss_fb_release(fbi, current->tgid);
end:
	return ret;
}

static int lcd_backlight_registered;

static void mdss_fb_set_bl_brightness(struct led_classdev *led_cdev,
@@ -342,9 +302,6 @@ static void mdss_fb_parse_dt_split(struct msm_fb_data_type *mfd)
	u32 data[2] = {0};
	struct platform_device *pdev = mfd->pdev;

	mfd->splash_logo_enabled = of_property_read_bool(pdev->dev.of_node,
				"qcom,mdss-fb-splash-logo-enabled");

	of_property_read_u32_array(pdev->dev.of_node,
		"qcom,mdss-fb-split", data, 2);

@@ -642,15 +599,8 @@ static int mdss_fb_probe(struct platform_device *pdev)
		break;
	}

	if (mfd->splash_logo_enabled) {
		mfd->splash_thread = kthread_run(mdss_fb_splash_thread, mfd,
				"mdss_fb_splash");
		if (IS_ERR(mfd->splash_thread)) {
			pr_err("unable to start splash thread %d\n",
				mfd->index);
			mfd->splash_thread = NULL;
		}
	}
	if (mfd->mdp.splash_init_fnc)
		mfd->mdp.splash_init_fnc(mfd);

	INIT_DELAYED_WORK(&mfd->idle_notify_work, __mdss_fb_idle_notify_work);

@@ -1547,13 +1497,6 @@ static int mdss_fb_open(struct fb_info *info, int user)
	pinfo->ref_cnt++;
	mfd->ref_cnt++;

	/* Stop the splash thread once userspace open the fb node */
	if (mfd->splash_thread && mfd->ref_cnt > 1) {
		kthread_stop(mfd->splash_thread);
		mfd->splash_thread = NULL;
		mdss_fb_free_fb_ion_memory(mfd);
	}

	return 0;

blank_error:
@@ -1957,7 +1900,7 @@ static int mdss_fb_pan_display_sub(struct fb_var_screeninfo *var,
		(var->yoffset / info->fix.ypanstep) * info->fix.ypanstep;

	if (mfd->mdp.dma_fnc)
		mfd->mdp.dma_fnc(mfd, NULL, 0, NULL);
		mfd->mdp.dma_fnc(mfd);
	else
		pr_warn("dma function not set for panel type=%d\n",
				mfd->panel.type);
+4 −12
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/notifier.h>

#include "mdss_panel.h"
#include "mdss_mdp_splash_logo.h"

#define MDSS_LPAE_CHECK(phys)	\
	((sizeof(phys) > sizeof(unsigned long)) ? ((phys >> 32) & 0xFF) : (0))
@@ -36,8 +37,6 @@
#define WAIT_DISP_OP_TIMEOUT ((WAIT_FENCE_FIRST_TIMEOUT + \
		WAIT_FENCE_FINAL_TIMEOUT) * MDP_MAX_FENCE_FD)

#define SPLASH_THREAD_WAIT_TIMEOUT 3

#ifndef MAX
#define  MAX(x, y) (((x) > (y)) ? (x) : (y))
#endif
@@ -72,11 +71,6 @@ enum mdp_notify_event {
	MDP_NOTIFY_FRAME_TIMEOUT,
};

enum mdp_splash_event {
	MDP_CREATE_SPLASH_OV = 0,
	MDP_REMOVE_SPLASH_OV,
};

struct disp_info_type_suspend {
	int op_enable;
	int panel_power_on;
@@ -125,8 +119,7 @@ struct msm_mdp_interface {
	int (*kickoff_fnc)(struct msm_fb_data_type *mfd,
					struct mdp_display_commit *data);
	int (*ioctl_handler)(struct msm_fb_data_type *mfd, u32 cmd, void *arg);
	void (*dma_fnc)(struct msm_fb_data_type *mfd, struct mdp_overlay *req,
				int image_len, int *pipe_ndx);
	void (*dma_fnc)(struct msm_fb_data_type *mfd);
	int (*cursor_update)(struct msm_fb_data_type *mfd,
				struct fb_cursor *cursor);
	int (*lut_update)(struct msm_fb_data_type *mfd, struct fb_cmap *cmap);
@@ -135,7 +128,7 @@ struct msm_mdp_interface {
	int (*update_ad_input)(struct msm_fb_data_type *mfd);
	int (*panel_register_done)(struct mdss_panel_data *pdata);
	u32 (*fb_stride)(u32 fb_index, u32 xres, int bpp);
	int (*splash_fnc) (struct msm_fb_data_type *mfd, int *index, int req);
	int (*splash_init_fnc)(struct msm_fb_data_type *mfd);
	struct msm_sync_pt_data *(*get_sync_fnc)(struct msm_fb_data_type *mfd,
				const struct mdp_buf_sync *buf_sync);
	void *private1;
@@ -220,8 +213,7 @@ struct msm_fb_data_type {
	wait_queue_head_t idle_wait_q;
	bool shutdown_pending;

	struct task_struct *splash_thread;
	bool splash_logo_enabled;
	struct msm_fb_splash_info splash_info;

	wait_queue_head_t ioctl_q;
	atomic_t ioctl_ref_cnt;
+19 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#define MDP_CLK_DEFAULT_RATE	200000000
#define PHASE_STEP_SHIFT	21
#define MAX_MIXER_WIDTH		2048
#define MAX_LINE_BUFFER_WIDTH	2048
#define MAX_MIXER_HEIGHT	0xFFFF
#define MAX_IMG_WIDTH		0x3FFF
#define MAX_IMG_HEIGHT		0x3FFF
@@ -541,6 +542,17 @@ static inline int mdss_mdp_pipe_is_sw_reset_available(
	}
}

static inline int mdss_mdp_iommu_dyn_attach_supported(
	struct mdss_data_type *mdata)
{
	return (mdata->mdp_rev >= MDSS_MDP_HW_REV_103);
}

static inline int mdss_mdp_line_buffer_width(void)
{
	return MAX_LINE_BUFFER_WIDTH;
}

irqreturn_t mdss_mdp_isr(int irq, void *ptr);
int mdss_iommu_attach(struct mdss_data_type *mdata);
int mdss_iommu_dettach(struct mdss_data_type *mdata);
@@ -573,6 +585,13 @@ int mdss_mdp_overlay_get_buf(struct msm_fb_data_type *mfd,
			     struct msmfb_data *planes,
			     int num_planes,
			     u32 flags);
int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
	struct mdp_overlay *req, struct mdss_mdp_pipe **ppipe,
	struct mdss_mdp_pipe *left_blend_pipe);
void mdss_mdp_handoff_cleanup_pipes(struct msm_fb_data_type *mfd,
							u32 type);
int mdss_mdp_overlay_release(struct msm_fb_data_type *mfd, int ndx);
int mdss_mdp_overlay_start(struct msm_fb_data_type *mfd);
int mdss_mdp_video_addr_setup(struct mdss_data_type *mdata,
		u32 *offsets,  u32 count);
int mdss_mdp_video_start(struct mdss_mdp_ctl *ctl);
Loading