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

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

Merge "msm: mdp3: Fix retire scheduling"

parents ed489f6b 654dac27
Loading
Loading
Loading
Loading
+19 −4
Original line number Original line Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -261,7 +261,8 @@ static void mdp3_vsync_retire_handle_vsync(void *arg)
		return;
		return;
	}
	}


	schedule_work(&mdp3_session->retire_work);
	kthread_queue_work(&mdp3_session->retire_worker,
		&mdp3_session->retire_work);
}
}


void mdp3_vsync_retire_signal(struct msm_fb_data_type *mfd, int val)
void mdp3_vsync_retire_signal(struct msm_fb_data_type *mfd, int val)
@@ -282,7 +283,7 @@ void mdp3_vsync_retire_signal(struct msm_fb_data_type *mfd, int val)
	mutex_unlock(&mfd->mdp_sync_pt_data.sync_mutex);
	mutex_unlock(&mfd->mdp_sync_pt_data.sync_mutex);
}
}


static void mdp3_vsync_retire_work_handler(struct work_struct *work)
static void mdp3_vsync_retire_work_handler(struct kthread_work *work)
{
{
	struct mdp3_session_data *mdp3_session =
	struct mdp3_session_data *mdp3_session =
		container_of(work, struct mdp3_session_data, retire_work);
		container_of(work, struct mdp3_session_data, retire_work);
@@ -2981,6 +2982,7 @@ static int mdp3_vsync_retire_setup(struct msm_fb_data_type *mfd)
	struct mdp3_session_data *mdp3_session;
	struct mdp3_session_data *mdp3_session;
	struct mdp3_notification retire_client;
	struct mdp3_notification retire_client;
	char name[24];
	char name[24];
	struct sched_param param = { .sched_priority = 16 };


	mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
	mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;


@@ -2998,7 +3000,20 @@ static int mdp3_vsync_retire_setup(struct msm_fb_data_type *mfd)
	if (mdp3_session->dma)
	if (mdp3_session->dma)
		mdp3_session->dma->retire_client = retire_client;
		mdp3_session->dma->retire_client = retire_client;


	INIT_WORK(&mdp3_session->retire_work, mdp3_vsync_retire_work_handler);
	kthread_init_worker(&mdp3_session->retire_worker);
	kthread_init_work(&mdp3_session->retire_work,
			mdp3_vsync_retire_work_handler);

	mdp3_session->retire_thread = kthread_run(kthread_worker_fn,
					&mdp3_session->retire_worker,
					"vsync_retire_work");
	if (IS_ERR(mdp3_session->retire_thread)) {
		pr_err("unable to start vsync thread\n");
		mdp3_session->retire_thread = NULL;
		return -ENOMEM;
	}

	sched_setscheduler(mdp3_session->retire_thread, SCHED_FIFO, &param);


	return 0;
	return 0;
}
}
+5 −2
Original line number Original line Diff line number Diff line
/* Copyright (c) 2013-2014, 2016-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, 2016-2019, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -61,6 +61,10 @@ struct mdp3_session_data {
	struct kthread_worker worker;
	struct kthread_worker worker;
	struct task_struct *thread;
	struct task_struct *thread;


	struct kthread_work retire_work;
	struct kthread_worker retire_worker;
	struct task_struct *retire_thread;

	atomic_t dma_done_cnt;
	atomic_t dma_done_cnt;
	int histo_status;
	int histo_status;
	struct mutex histo_lock;
	struct mutex histo_lock;
@@ -84,7 +88,6 @@ struct mdp3_session_data {
	/* For retire fence */
	/* For retire fence */
	struct mdss_timeline *vsync_timeline;
	struct mdss_timeline *vsync_timeline;
	int retire_cnt;
	int retire_cnt;
	struct work_struct retire_work;
};
};


void mdp3_bufq_deinit(struct mdp3_buffer_queue *bufq, int client);
void mdp3_bufq_deinit(struct mdp3_buffer_queue *bufq, int client);