Merge tag ‘drm-misc-fixes-2019-05-22’ of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes [Linux 5.2]

Merge tag ‘drm-misc-fixes-2019-05-22’ of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes [Linux 5.2]

This Linux kernel change "Merge tag ‘drm-misc-fixes-2019-05-22’ of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes" is included in the Linux 5.2 release. This change is authored by Dave Airlie <airlied [at] redhat.com> on Thu May 23 12:03:35 2019 +1000. The commit for this change in Linux stable tree is eab007d (patch). Other info about this change: Merge: 27e248c f3617b4

Merge tag 'drm-misc-fixes-2019-05-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

- sun4i fixes to hdmi phy as well as u16 overflow in dsi (left from -next-fixes)
- gma500 fix to make lvds detection more reliable
- select devfreq for panfrost since it can't probe without it

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20190522194440.GA22359@art_vandelay

There is no are 0 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/gpu/drm/panfrost/Kconfig            |  1 +
 drivers/gpu/drm/panfrost/panfrost_devfreq.c | 13 ++-----------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/Kconfig b/drivers/gpu/drm/panfrost/Kconfig
index 591611d..81963e9 100644
--- a/drivers/gpu/drm/panfrost/Kconfig
+++ b/drivers/gpu/drm/panfrost/Kconfig
@@ -9,6 +9,7 @@ config DRM_PANFROST
    select IOMMU_SUPPORT
    select IOMMU_IO_PGTABLE_LPAE
    select DRM_GEM_SHMEM_HELPER
+   select PM_DEVFREQ
    help
      DRM driver for ARM Mali Midgard (T6xx, T7xx, T8xx) and
      Bifrost (G3x, G5x, G7x) GPUs.
diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
index 238bd1d8..29fcffd 100644
--- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
@@ -140,8 +140,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
        return 0;

    ret = dev_pm_opp_of_add_table(&pfdev->pdev->dev);
-   if (ret == -ENODEV) /* Optional, continue without devfreq */
-       return 0;
+   if (ret)
+       return ret;

    panfrost_devfreq_reset(pfdev);

@@ -170,9 +170,6 @@ void panfrost_devfreq_resume(struct panfrost_device *pfdev)
 {
    int i;

-   if (!pfdev->devfreq.devfreq)
-       return;
-
    panfrost_devfreq_reset(pfdev);
    for (i = 0; i < NUM_JOB_SLOTS; i++)
        pfdev->devfreq.slot[i].busy = false;
@@ -182,9 +179,6 @@ void panfrost_devfreq_resume(struct panfrost_device *pfdev)

 void panfrost_devfreq_suspend(struct panfrost_device *pfdev)
 {
-   if (!pfdev->devfreq.devfreq)
-       return;
-
    devfreq_suspend_device(pfdev->devfreq.devfreq);
 }

@@ -194,9 +188,6 @@ static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev, i
    ktime_t now;
    ktime_t last;

-   if (!pfdev->devfreq.devfreq)
-       return;
-
    now = ktime_get();
    last = pfdev->devfreq.slot[slot].time_last_update;

Leave a Reply

Your email address will not be published. Required fields are marked *