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

Commit 6ff2991f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mdss: move mdp3_dispatch_dma_done to a kthread"

parents 3bf2c68e e7f6aaec
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ int mdp3_ctrl_notify(struct mdp3_session_data *ses, int event)
	return blocking_notifier_call_chain(&ses->notifier_head, event, ses);
}

static void mdp3_dispatch_dma_done(struct work_struct *work)
static void mdp3_dispatch_dma_done(struct kthread_work *work)
{
	struct mdp3_session_data *session;
	int cnt = 0;
@@ -259,7 +259,7 @@ void dma_done_notify_handler(void *arg)
{
	struct mdp3_session_data *session = (struct mdp3_session_data *)arg;
	atomic_inc(&session->dma_done_cnt);
	schedule_work(&session->dma_done_work);
	queue_kthread_work(&session->worker, &session->dma_done_work);
	complete_all(&session->dma_completion);
}

@@ -2773,6 +2773,7 @@ int mdp3_ctrl_init(struct msm_fb_data_type *mfd)
	u32 intf_type = MDP3_DMA_OUTPUT_SEL_DSI_VIDEO;
	int rc;
	int splash_mismatch = 0;
	struct sched_param sched = { .sched_priority = 16 };

	pr_info("mdp3_ctrl_init\n");
	rc = mdp3_parse_dt_splash(mfd);
@@ -2798,7 +2799,21 @@ int mdp3_ctrl_init(struct msm_fb_data_type *mfd)
	}
	mutex_init(&mdp3_session->lock);
	INIT_WORK(&mdp3_session->clk_off_work, mdp3_dispatch_clk_off);
	INIT_WORK(&mdp3_session->dma_done_work, mdp3_dispatch_dma_done);

	init_kthread_worker(&mdp3_session->worker);
	init_kthread_work(&mdp3_session->dma_done_work, mdp3_dispatch_dma_done);

	mdp3_session->thread = kthread_run(kthread_worker_fn, &mdp3_session->worker,
					   "mdp3_dispatch_dma_done");

	if (IS_ERR(mdp3_session->thread)) {
		pr_err("Can't initialize mdp3_dispatch_dma_done thread\n");
		rc = -ENODEV;
		goto init_done;
	}

	sched_setscheduler(mdp3_session->thread, SCHED_FIFO, &sched);

	atomic_set(&mdp3_session->vsync_countdown, 0);
	mutex_init(&mdp3_session->histo_lock);
	mdp3_session->dma = mdp3_get_dma_pipe(MDP3_DMA_CAP_ALL);
+7 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2014, 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, 2016-2017 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
@@ -18,6 +18,7 @@
#include <linux/mutex.h>
#include <linux/completion.h>
#include <linux/timer.h>
#include <linux/kthread.h>

#include "mdp3.h"
#include "mdp3_dma.h"
@@ -51,7 +52,11 @@ struct mdp3_session_data {
	struct mdp3_buffer_queue bufq_in;
	struct mdp3_buffer_queue bufq_out;
	struct work_struct clk_off_work;
	struct work_struct dma_done_work;

	struct kthread_work dma_done_work;
	struct kthread_worker worker;
	struct task_struct *thread;

	atomic_t dma_done_cnt;
	int histo_status;
	struct mutex histo_lock;