* [PATCH] drm/panfrost: Select devfreq
@ 2019-05-17 15:00 Ezequiel Garcia
2019-05-17 15:33 ` Neil Armstrong
0 siblings, 1 reply; 3+ messages in thread
From: Ezequiel Garcia @ 2019-05-17 15:00 UTC (permalink / raw)
To: Rob Herring, Tomeu Vizoso, David Airlie, Daniel Vetter
Cc: kernel, Ezequiel Garcia, dri-devel
Currently, there is some logic for the driver to work without devfreq.
However, the driver actually fails to probe if !CONFIG_PM_DEVFREQ.
Fix this by selecting devfreq, and drop the additional checks
for devfreq.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
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 591611dc4e34..81963e964b0f 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 238bd1d89d43..29fcffdf2d57 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;
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panfrost: Select devfreq
2019-05-17 15:00 [PATCH] drm/panfrost: Select devfreq Ezequiel Garcia
@ 2019-05-17 15:33 ` Neil Armstrong
2019-05-22 19:37 ` Rob Herring
0 siblings, 1 reply; 3+ messages in thread
From: Neil Armstrong @ 2019-05-17 15:33 UTC (permalink / raw)
To: Ezequiel Garcia, Rob Herring, Tomeu Vizoso, David Airlie, Daniel Vetter
Cc: kernel, dri-devel
On 17/05/2019 17:00, Ezequiel Garcia wrote:
> Currently, there is some logic for the driver to work without devfreq.
> However, the driver actually fails to probe if !CONFIG_PM_DEVFREQ.
>
> Fix this by selecting devfreq, and drop the additional checks
> for devfreq.
>
Please add a Fixes tag.
Neil
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> ---
> 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 591611dc4e34..81963e964b0f 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 238bd1d89d43..29fcffdf2d57 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;
>
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panfrost: Select devfreq
2019-05-17 15:33 ` Neil Armstrong
@ 2019-05-22 19:37 ` Rob Herring
0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2019-05-22 19:37 UTC (permalink / raw)
To: Neil Armstrong
Cc: Tomeu Vizoso, David Airlie, dri-devel, kernel, Ezequiel Garcia
On Fri, May 17, 2019 at 10:33 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> On 17/05/2019 17:00, Ezequiel Garcia wrote:
> > Currently, there is some logic for the driver to work without devfreq.
> > However, the driver actually fails to probe if !CONFIG_PM_DEVFREQ.
> >
> > Fix this by selecting devfreq, and drop the additional checks
> > for devfreq.
> >
>
> Please add a Fixes tag.
I applied this, but forgot the Fixes tag.
Rob
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-22 19:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-17 15:00 [PATCH] drm/panfrost: Select devfreq Ezequiel Garcia
2019-05-17 15:33 ` Neil Armstrong
2019-05-22 19:37 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).