[KERNEL][N6P] FrancoKernel ⚡️- r77 - 7th December - Oreo & Pie

Roger.T

Senior Member
Nov 13, 2013
1,621
1,573
143
53
Zürich
None phone isn't for vr cause the heat comes quick.i was meaning if there is any kernel setting to reduce heat?
Not for VR.
VR needs a lot of power from CPU and GPU...
And the heat problem is known since the release of the 810 kernel in 2015.
The only option would be to lower the processor down. But then VR does not work properly..
So you have to live with it as it is [emoji6]

Gesendet von meinem Nexus 6P mit Tapatalk

---------- Post added at 10:00 PM ---------- Previous post was at 09:55 PM ----------

Running the latest version with pure Nexus, not sure why is this Android System thing always on top. What's the best way to check ?
This is a ROM problem and not a kernel issue.
Maybe you ask in the PureNexus thread? [emoji6]

Gesendet von meinem Nexus 6P mit Tapatalk
 

szale9001

Senior Member
Aug 19, 2010
250
142
73
So, to @franciscofranco or anyone else out there who's a programming guru, I took a stab at porting this patch from marlin to angler (disclaimer: not a programmer lol)
https://github.com/franciscofranco/marlin/commit/ed11186da9074b635a8ff63575dc8f92129d9ec6

It does compile and seems to be working on my device, but if I've learned anything tinkering with code, it's that a successful compilation and boot doesn't mean its done properly ;) .
Would anyone mind taking a look at this diff and letting me know if there is anything that should be changed? If it's any good/not totally wrong, maybe franco can merge it into his git.

Code:
Subject: [PATCH] mdss: rotator: Use FIFO kthread for rotator work

Bug: 30891496
Change-Id: I65725fd7f8bd2b10543bf3fc3307308d9d11a9c0
Signed-off-by: Naseer Ahmed <[email protected]>
---
 drivers/video/msm/mdss/mdss_mdp_rotator.c | 35 ++++++++++++++++++-------------
 drivers/video/msm/mdss/mdss_mdp_rotator.h |  3 ++-
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/video/msm/mdss/mdss_mdp_rotator.c b/drivers/video/msm/mdss/mdss_mdp_rotator.c
index d394dcf0a3be..1b6bca3ad0d0 100644
--- a/drivers/video/msm/mdss/mdss_mdp_rotator.c
+++ b/drivers/video/msm/mdss/mdss_mdp_rotator.c
@@ -30,6 +30,9 @@
 
 #define MAX_ROTATOR_SESSION_ID 0xfffffff
 
+struct kthread_worker worker;
+struct task_struct *thread;
+
 struct mdss_mdp_rot_pipe {
 	struct mdss_mdp_pipe *pipe;
 	struct mdss_mdp_rotator_session *active_session;
@@ -49,13 +52,11 @@ struct mdss_mdp_rot_session_mgr {
 	int pipe_count;
 	struct mutex pipe_lock;
 	struct mdss_mdp_rot_pipe rot_pipes[MAX_ROTATOR_PIPE_COUNT];
-
-	struct workqueue_struct *rot_work_queue;
 };
 
 static struct mdss_mdp_rot_session_mgr *rot_mgr;
 static int mdss_mdp_rotator_finish(struct mdss_mdp_rotator_session *rot);
-static void mdss_mdp_rotator_commit_wq_handler(struct work_struct *work);
+static void mdss_mdp_rotator_commit_work_handler(struct kthread_work *work);
 static int mdss_mdp_rotator_busy_wait(struct mdss_mdp_rotator_session *rot,
 	struct mdss_mdp_pipe *pipe);
 static int mdss_mdp_rotator_queue_helper(struct mdss_mdp_rotator_session *rot);
@@ -64,6 +65,8 @@ static struct msm_sync_pt_data *mdss_mdp_rotator_sync_pt_create(
 
 int mdss_mdp_rot_mgr_init(void)
 {
+	struct sched_param param = { .sched_priority = 5 };
+
 	if (rot_mgr) {
 		pr_debug("rot manager initialized already\n");
 		return 0;
@@ -78,16 +81,18 @@ int mdss_mdp_rot_mgr_init(void)
 	mutex_init(&rot_mgr->session_lock);
 	mutex_init(&rot_mgr->pipe_lock);
 	INIT_LIST_HEAD(&rot_mgr->queue);
-	rot_mgr->rot_work_queue = alloc_workqueue("rot_commit_workq",
-			WQ_UNBOUND | WQ_HIGHPRI | WQ_MEM_RECLAIM,
-						MAX_ROTATOR_PIPE_COUNT);
-	if (!rot_mgr->rot_work_queue) {
-		pr_err("fail to create rot commit work queue\n");
+	init_kthread_worker(&worker);
+	thread = kthread_run(kthread_worker_fn, &worker, "thread");
+
+	if (IS_ERR(thread)) {
+		pr_err("fail to create rot commit kthread\n");
 		kfree(rot_mgr);
 		rot_mgr = NULL;
 		return -ENOMEM;
 	}
 
+	sched_setscheduler(thread, SCHED_FIFO, &param);
+
 	return 0;
 }
 
@@ -619,7 +624,7 @@ error:
 	return ret;
 }
 
-static void mdss_mdp_rotator_commit_wq_handler(struct work_struct *work)
+static void mdss_mdp_rotator_commit_work_handler(struct kthread_work *work)
 {
 	struct mdss_mdp_rotator_session *rot;
 	int ret;
@@ -665,8 +670,8 @@ static struct msm_sync_pt_data *mdss_mdp_rotator_sync_pt_create(
 	} else {
 		sync_pt_data->timeline_value = 0;
 	}
-	INIT_WORK(&rot->commit_work,
-				mdss_mdp_rotator_commit_wq_handler);
+	init_kthread_work(&rot->commit_work,
+				mdss_mdp_rotator_commit_work_handler);
 	mutex_init(&sync_pt_data->sync_mutex);
 	return sync_pt_data;
 }
@@ -714,7 +719,7 @@ static int mdss_mdp_rotator_queue(struct mdss_mdp_rotator_session *rot)
 				rot->rot_sync_pt_data->temp_fen,
 				&rot->rot_sync_pt_data->temp_fen_cnt);
 		atomic_inc(&rot->rot_sync_pt_data->commit_cnt);
-		queue_work(rot_mgr->rot_work_queue, &rot->commit_work);
+		queue_kthread_work(&worker, &rot->commit_work);
 	} else {
 		ret = mdss_mdp_rotator_queue_helper(rot);
 	}
@@ -935,7 +940,7 @@ static int mdss_mdp_rotator_config_ex(struct msm_fb_data_type *mfd,
 		return 0;
 	}
 
-	flush_work(&rot->commit_work);
+	flush_kthread_work(&rot->commit_work);
 
 	mutex_lock(&rot->lock);
 	ret = mdss_mdp_rotator_config(mfd, rot, req, fmt);
@@ -977,7 +982,7 @@ static int mdss_mdp_rotator_finish(struct mdss_mdp_rotator_session *rot)
 {
 	pr_debug("finish rot id=%x\n", rot->session_id);
 
-	flush_work(&rot->commit_work);
+	flush_kthread_work(&rot->commit_work);
 	mdss_mdp_rot_mgr_del_session(rot);
 
 	return 0;
@@ -1033,7 +1038,7 @@ int mdss_mdp_rotator_play(struct msm_fb_data_type *mfd,
 
 	flgs = rot->flags & MDP_SECURE_OVERLAY_SESSION;
 
-	flush_work(&rot->commit_work);
+	flush_kthread_work(&rot->commit_work);
 
 	mdss_iommu_ctrl(1);
 	mutex_lock(&rot->lock);
diff --git a/drivers/video/msm/mdss/mdss_mdp_rotator.h b/drivers/video/msm/mdss/mdss_mdp_rotator.h
index ca67ff78f867..c34a55b52470 100644
--- a/drivers/video/msm/mdss/mdss_mdp_rotator.h
+++ b/drivers/video/msm/mdss/mdss_mdp_rotator.h
@@ -13,6 +13,7 @@
 #ifndef MDSS_MDP_ROTATOR_H
 #define MDSS_MDP_ROTATOR_H
 
+#include <linux/kthread.h>
 #include <linux/types.h>
 
 #include "mdss_mdp.h"
@@ -47,7 +48,7 @@ struct mdss_mdp_rotator_session {
 	struct list_head head;
 	struct list_head list;
 	struct msm_sync_pt_data *rot_sync_pt_data;
-	struct work_struct commit_work;
+	struct kthread_work commit_work;
 
 	struct mdp_overlay req_data;
 };
-- 
2.13.0
 

franciscofranco

Recognized Developer
Dec 9, 2010
24,725
136,397
0
Carcavelos
Ok break from XDA is over, and vacations are over. Sorry for the absence but I had to rest.

r53 is up with the June security patches and some other enhancements I picked from Pixel's Android O Kernel patches.

You can flash it with https://play.google.com/store/apps/details?id=com.franco.kernel or any other mean you're used to!

Hope you're having a great start of summer!
 

CyberZeus1977

Senior Member
Jan 23, 2009
559
175
0
Mesero
Ok break from XDA is over, and vacations are over. Sorry for the absence but I had to rest.

r53 is up with the June security patches and some other enhancements I picked from Pixel's Android O Kernel patches.

You can flash it with https://play.google.com/store/apps/details?id=com.franco.kernel or any other mean you're used to!

Hope you're having a great start of summer!
You certainly had to rest. Welcome back!
Thanks for the new release!

Sent from Enterprise bridge
 

Roger.T

Senior Member
Nov 13, 2013
1,621
1,573
143
53
Zürich
@franciscofranco
Welcome back!
I hope you had a good time ?
Unfortunately, I have bad news.
I can not flash the new kernel. Always ends with an error.
Downloaded via app and your server...Screenshot_2017-06-20-00-55-20.png

Edit:
Solved..
I flashed the bootimage from the ROM and afterwards it went..
Excuse me for the post...?

Gesendet von meinem Nexus 6P mit Tapatalk
 
Last edited:

mobileman88

Senior Member
Oct 27, 2008
2,269
420
153
@franciscofranco
Welcome back!
I hope you had a good time ?
Unfortunately, I have bad news.
I can not flash the new kernel. Always ends with an error.
Downloaded via app and your server...View attachment 4187465

Edit:
Solved..
I flashed the bootimage from the ROM and afterwards it went..
Excuse me for the post...?

Gesendet von meinem Nexus 6P mit Tapatalk
It's always good to flash from a stock boot image
 

szale9001

Senior Member
Aug 19, 2010
250
142
73
Ok break from XDA is over, and vacations are over. Sorry for the absence but I had to rest.

r53 is up with the June security patches and some other enhancements I picked from Pixel's Android O Kernel patches.

You can flash it with https://play.google.com/store/apps/details?id=com.franco.kernel or any other mean you're used to!

Hope you're having a great start of summer!
So, to @franciscofranco or anyone else out there who's a programming guru, I took a stab at porting this patch from marlin to angler (disclaimer: not a programmer lol)
https://github.com/franciscofranco/marlin/commit/ed11186da9074b635a8ff63575dc8f92129d9ec6

It does compile and seems to be working on my device, but if I've learned anything tinkering with code, it's that a successful compilation and boot doesn't mean its done properly ;) .
Would anyone mind taking a look at this diff and letting me know if there is anything that should be changed? If it's any good/not totally wrong, maybe franco can merge it into his git.

Code:
Subject: [PATCH] mdss: rotator: Use FIFO kthread for rotator work

Bug: 30891496
Change-Id: I65725fd7f8bd2b10543bf3fc3307308d9d11a9c0
Signed-off-by: Naseer Ahmed <[email protected]>
---
 drivers/video/msm/mdss/mdss_mdp_rotator.c | 35 ++++++++++++++++++-------------
 drivers/video/msm/mdss/mdss_mdp_rotator.h |  3 ++-
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/video/msm/mdss/mdss_mdp_rotator.c b/drivers/video/msm/mdss/mdss_mdp_rotator.c
index d394dcf0a3be..1b6bca3ad0d0 100644
--- a/drivers/video/msm/mdss/mdss_mdp_rotator.c
+++ b/drivers/video/msm/mdss/mdss_mdp_rotator.c
@@ -30,6 +30,9 @@
 
 #define MAX_ROTATOR_SESSION_ID 0xfffffff
 
+struct kthread_worker worker;
+struct task_struct *thread;
+
 struct mdss_mdp_rot_pipe {
 	struct mdss_mdp_pipe *pipe;
 	struct mdss_mdp_rotator_session *active_session;
@@ -49,13 +52,11 @@ struct mdss_mdp_rot_session_mgr {
 	int pipe_count;
 	struct mutex pipe_lock;
 	struct mdss_mdp_rot_pipe rot_pipes[MAX_ROTATOR_PIPE_COUNT];
-
-	struct workqueue_struct *rot_work_queue;
 };
 
 static struct mdss_mdp_rot_session_mgr *rot_mgr;
 static int mdss_mdp_rotator_finish(struct mdss_mdp_rotator_session *rot);
-static void mdss_mdp_rotator_commit_wq_handler(struct work_struct *work);
+static void mdss_mdp_rotator_commit_work_handler(struct kthread_work *work);
 static int mdss_mdp_rotator_busy_wait(struct mdss_mdp_rotator_session *rot,
 	struct mdss_mdp_pipe *pipe);
 static int mdss_mdp_rotator_queue_helper(struct mdss_mdp_rotator_session *rot);
@@ -64,6 +65,8 @@ static struct msm_sync_pt_data *mdss_mdp_rotator_sync_pt_create(
 
 int mdss_mdp_rot_mgr_init(void)
 {
+	struct sched_param param = { .sched_priority = 5 };
+
 	if (rot_mgr) {
 		pr_debug("rot manager initialized already\n");
 		return 0;
@@ -78,16 +81,18 @@ int mdss_mdp_rot_mgr_init(void)
 	mutex_init(&rot_mgr->session_lock);
 	mutex_init(&rot_mgr->pipe_lock);
 	INIT_LIST_HEAD(&rot_mgr->queue);
-	rot_mgr->rot_work_queue = alloc_workqueue("rot_commit_workq",
-			WQ_UNBOUND | WQ_HIGHPRI | WQ_MEM_RECLAIM,
-						MAX_ROTATOR_PIPE_COUNT);
-	if (!rot_mgr->rot_work_queue) {
-		pr_err("fail to create rot commit work queue\n");
+	init_kthread_worker(&worker);
+	thread = kthread_run(kthread_worker_fn, &worker, "thread");
+
+	if (IS_ERR(thread)) {
+		pr_err("fail to create rot commit kthread\n");
 		kfree(rot_mgr);
 		rot_mgr = NULL;
 		return -ENOMEM;
 	}
 
+	sched_setscheduler(thread, SCHED_FIFO, &param);
+
 	return 0;
 }
 
@@ -619,7 +624,7 @@ error:
 	return ret;
 }
 
-static void mdss_mdp_rotator_commit_wq_handler(struct work_struct *work)
+static void mdss_mdp_rotator_commit_work_handler(struct kthread_work *work)
 {
 	struct mdss_mdp_rotator_session *rot;
 	int ret;
@@ -665,8 +670,8 @@ static struct msm_sync_pt_data *mdss_mdp_rotator_sync_pt_create(
 	} else {
 		sync_pt_data->timeline_value = 0;
 	}
-	INIT_WORK(&rot->commit_work,
-				mdss_mdp_rotator_commit_wq_handler);
+	init_kthread_work(&rot->commit_work,
+				mdss_mdp_rotator_commit_work_handler);
 	mutex_init(&sync_pt_data->sync_mutex);
 	return sync_pt_data;
 }
@@ -714,7 +719,7 @@ static int mdss_mdp_rotator_queue(struct mdss_mdp_rotator_session *rot)
 				rot->rot_sync_pt_data->temp_fen,
 				&rot->rot_sync_pt_data->temp_fen_cnt);
 		atomic_inc(&rot->rot_sync_pt_data->commit_cnt);
-		queue_work(rot_mgr->rot_work_queue, &rot->commit_work);
+		queue_kthread_work(&worker, &rot->commit_work);
 	} else {
 		ret = mdss_mdp_rotator_queue_helper(rot);
 	}
@@ -935,7 +940,7 @@ static int mdss_mdp_rotator_config_ex(struct msm_fb_data_type *mfd,
 		return 0;
 	}
 
-	flush_work(&rot->commit_work);
+	flush_kthread_work(&rot->commit_work);
 
 	mutex_lock(&rot->lock);
 	ret = mdss_mdp_rotator_config(mfd, rot, req, fmt);
@@ -977,7 +982,7 @@ static int mdss_mdp_rotator_finish(struct mdss_mdp_rotator_session *rot)
 {
 	pr_debug("finish rot id=%x\n", rot->session_id);
 
-	flush_work(&rot->commit_work);
+	flush_kthread_work(&rot->commit_work);
 	mdss_mdp_rot_mgr_del_session(rot);
 
 	return 0;
@@ -1033,7 +1038,7 @@ int mdss_mdp_rotator_play(struct msm_fb_data_type *mfd,
 
 	flgs = rot->flags & MDP_SECURE_OVERLAY_SESSION;
 
-	flush_work(&rot->commit_work);
+	flush_kthread_work(&rot->commit_work);
 
 	mdss_iommu_ctrl(1);
 	mutex_lock(&rot->lock);
diff --git a/drivers/video/msm/mdss/mdss_mdp_rotator.h b/drivers/video/msm/mdss/mdss_mdp_rotator.h
index ca67ff78f867..c34a55b52470 100644
--- a/drivers/video/msm/mdss/mdss_mdp_rotator.h
+++ b/drivers/video/msm/mdss/mdss_mdp_rotator.h
@@ -13,6 +13,7 @@
 #ifndef MDSS_MDP_ROTATOR_H
 #define MDSS_MDP_ROTATOR_H
 
+#include <linux/kthread.h>
 #include <linux/types.h>
 
 #include "mdss_mdp.h"
@@ -47,7 +48,7 @@ struct mdss_mdp_rotator_session {
 	struct list_head head;
 	struct list_head list;
 	struct msm_sync_pt_data *rot_sync_pt_data;
-	struct work_struct commit_work;
+	struct kthread_work commit_work;
 
 	struct mdp_overlay req_data;
 };
-- 
2.13.0
Hey franco, wasn't sure you saw this and wanted to get your opinion on it.
 

mondohow

Senior Member
Jun 3, 2014
338
644
133
Hi Franco, welcome back and thanks for the update ! :highfive:
I just wanted to let you know that the link to the changelog on the 1st page is still for 7.1.1. ;)
View attachment 4188108

Gesendet von meinem Nexus 6P mit Tapatalk
The point of your post? The changelog link on XDA is still pointing to 7.1.1.
Low priority. I'm sure he'll fix it when he gets a chance.

In the mean time r53 Changelog: https://kernels.franco-lnx.net/Nexus6P/7.1.2/appfiles/changelog.xml
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone