Skip to content
Snippets Groups Projects
Commit ae881a1d authored by yuan.tian's avatar yuan.tian Committed by Gianfranco Mariotti
Browse files

MGS-6490 [#ccc] 0022-IMX-2729-CL402351-KERNEL-SPACE-IMX-2729-modify-GPU-t


IMX-2729 modify GPU
 thermal_hot_pm_notify to support different thermal event Some use case of
 iMX8MQ only use limited heat sink, but the power consumption is too large
 when run some android application. Need to decrease the power consumption and
 keep system accessible. Here add half of Max GPU frequence work point when do
 thermal PM processing. GPU clock will switch to minClock/64, 32/64, 64/64 of
 max GPU frequency according to thermal event.

Signed-off-by: default avatarKe Feng <ke.feng@verisilicon.com>

Signed-off-by: default avataryuan.tian <yuan.tian@nxp.com>
parent cedee04a
No related branches found
No related tags found
1 merge request!156Draft: [i.MX] mxc: gpu-viv: apply patches
......@@ -287,7 +287,7 @@ static int thermal_hot_pm_notify(struct notifier_block *nb, unsigned long event,
void *dummy)
{
static gctUINT orgFscale, minFscale, maxFscale;
static gctBOOL bAlreadyTooHot = gcvFALSE;
static unsigned long prev_event = 0xffffffff;
gckHARDWARE hardware;
gckGALDEVICE galDevice;
gctUINT FscaleVal = orgFscale;
......@@ -312,14 +312,34 @@ static int thermal_hot_pm_notify(struct notifier_block *nb, unsigned long event,
return NOTIFY_OK;
}
if (event && !bAlreadyTooHot) {
if (prev_event == 0xffffffff) /* get initial value of Fscale */
gckHARDWARE_GetFscaleValue(hardware,&orgFscale,&minFscale, &maxFscale);
FscaleVal = minFscale;
bAlreadyTooHot = gcvTRUE;
printk("System is too hot. GPU3D will work at %d/64 clock.\n", minFscale);
} else if (!event && bAlreadyTooHot) {
printk("Hot alarm is canceled. GPU3D clock will return to %d/64\n", orgFscale);
bAlreadyTooHot = gcvFALSE;
else if (prev_event == event)
return NOTIFY_OK;
prev_event = event;
switch (event) {
case 0:
FscaleVal = orgFscale;
printk("Hot alarm is canceled. GPU3D clock will return to %d/64\n", orgFscale);
break;
case 1:
#if defined(CONFIG_ANDROID)
if (of_find_compatible_node(NULL, NULL, "fsl,imx8mq-gpu")) {
FscaleVal = maxFscale >> 1; /* switch to 1/2 of max frequency */
printk("System is a little hot. GPU3D clock will work at %d/64\n", maxFscale >> 1);
break;
}
#endif
case 2:
FscaleVal = minFscale;
printk("System is too hot. GPU3D will work at %d/64 clock.\n", minFscale);
break;
default:
FscaleVal = orgFscale;
printk("System don't support such event: %ld.\n", event);
break;
}
while (galDevice->kernels[core] && core <= gcvCORE_3D_MAX)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment