hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/drivers/soc/rockchip/rockchip_system_monitor.c
....@@ -68,6 +68,7 @@
6868 int temp_hysteresis;
6969 unsigned int delay;
7070 bool is_temp_offline;
71
+ bool boosted;
7172 };
7273
7374 static unsigned long system_status;
....@@ -288,6 +289,7 @@
288289 {
289290 struct video_info *video_info;
290291 unsigned int max_res = 0, max_stream_bitrate = 0, res = 0;
292
+ unsigned int max_video_framerate = 0;
291293
292294 mutex_lock(&video_info_mutex);
293295 if (list_empty(&video_info_list)) {
....@@ -302,6 +304,8 @@
302304 max_res = res;
303305 if (video_info->streamBitrate > max_stream_bitrate)
304306 max_stream_bitrate = video_info->streamBitrate;
307
+ if (video_info->videoFramerate > max_video_framerate)
308
+ max_video_framerate = video_info->videoFramerate;
305309 }
306310 mutex_unlock(&video_info_mutex);
307311
....@@ -310,8 +314,9 @@
310314 } else {
311315 if (max_stream_bitrate == 10)
312316 rockchip_set_system_status(SYS_STATUS_VIDEO_4K_10B);
313
- else
314
- rockchip_set_system_status(SYS_STATUS_VIDEO_4K);
317
+ if (max_video_framerate == 60)
318
+ rockchip_set_system_status(SYS_STATUS_VIDEO_4K_60P);
319
+ rockchip_set_system_status(SYS_STATUS_VIDEO_4K);
315320 }
316321 }
317322
....@@ -737,6 +742,20 @@
737742 }
738743 EXPORT_SYMBOL(rockchip_monitor_cpu_high_temp_adjust);
739744
745
+void rockchip_monitor_set_boosted(void)
746
+{
747
+ if (system_monitor)
748
+ system_monitor->boosted = true;
749
+}
750
+EXPORT_SYMBOL(rockchip_monitor_set_boosted);
751
+
752
+void rockchip_monitor_clear_boosted(void)
753
+{
754
+ if (system_monitor)
755
+ system_monitor->boosted = false;
756
+}
757
+EXPORT_SYMBOL(rockchip_monitor_clear_boosted);
758
+
740759 static int rockchip_monitor_update_devfreq(struct devfreq *df)
741760 {
742761 int ret = 0;
....@@ -764,6 +783,8 @@
764783 if (info->devp && info->devp->data) {
765784 df = (struct devfreq *)info->devp->data;
766785 rockchip_monitor_update_devfreq(df);
786
+ } else if (info->devp && info->devp->low_temp_adjust_volt) {
787
+ info->devp->low_temp_adjust_volt(info);
767788 }
768789
769790 return 0;
....@@ -1120,7 +1141,7 @@
11201141
11211142 monitor_set_freq_table(dev, info);
11221143
1123
- if (info->devp->type == MONITOR_TPYE_DEV) {
1144
+ if (info->devp->type == MONITOR_TPYE_DEV && info->devp->data) {
11241145 info->devfreq_nb.notifier_call =
11251146 system_monitor_devfreq_notifier_call;
11261147 devfreq = (struct devfreq *)info->devp->data;
....@@ -1154,11 +1175,12 @@
11541175 list_del(&info->node);
11551176 up_write(&mdev_list_sem);
11561177
1157
- devfreq = (struct devfreq *)info->devp->data;
1158
- if (info->devp->type == MONITOR_TPYE_DEV)
1178
+ if (info->devp->type == MONITOR_TPYE_DEV && info->devp->data) {
1179
+ devfreq = (struct devfreq *)info->devp->data;
11591180 devm_devfreq_unregister_notifier(info->dev, devfreq,
11601181 &info->devfreq_nb,
11611182 DEVFREQ_TRANSITION_NOTIFIER);
1183
+ }
11621184
11631185 kfree(info->low_temp_adjust_table);
11641186 kfree(info->opp_table);
....@@ -1413,7 +1435,8 @@
14131435 if (limit_freq > info->wide_temp_limit / 1000)
14141436 limit_freq = info->wide_temp_limit / 1000;
14151437 }
1416
- if (info->status_max_limit &&
1438
+ if (!system_monitor->boosted &&
1439
+ info->status_max_limit &&
14171440 limit_freq > info->status_max_limit)
14181441 limit_freq = info->status_max_limit;
14191442