Merge drm/drm-next into drm-misc-next
[sfrench/cifs-2.6.git] / drivers / gpu / drm / panfrost / panfrost_devfreq.c
index e78de99e9933586b5bb8d114d1cd39f3c10313f0..f59c82ea887013c6b4a333a01fc5c3e1444bbc04 100644 (file)
@@ -58,6 +58,7 @@ static int panfrost_devfreq_get_dev_status(struct device *dev,
        spin_lock_irqsave(&pfdevfreq->lock, irqflags);
 
        panfrost_devfreq_update_utilization(pfdevfreq);
+       pfdevfreq->current_frequency = status->current_frequency;
 
        status->total_time = ktime_to_ns(ktime_add(pfdevfreq->busy_time,
                                                   pfdevfreq->idle_time));
@@ -117,6 +118,7 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
        struct devfreq *devfreq;
        struct thermal_cooling_device *cooling;
        struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq;
+       unsigned long freq = ULONG_MAX;
 
        if (pfdev->comp->num_supplies > 1) {
                /*
@@ -172,6 +174,12 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
                return ret;
        }
 
+       /* Find the fastest defined rate  */
+       opp = dev_pm_opp_find_freq_floor(dev, &freq);
+       if (IS_ERR(opp))
+               return PTR_ERR(opp);
+       pfdevfreq->fast_rate = freq;
+
        dev_pm_opp_put(opp);
 
        /*