From c1572b75606623551dfbf9301cb769e60eaeda3b Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Fri, 1 Nov 2019 13:03:12 +0000 Subject: drm/panfrost: remove DRM_AUTH and respective comment As of earlier commit we have address space separation. Yet we forgot to remove the respective comment and DRM_AUTH in the ioctl declaration. Cc: Tomeu Vizoso Cc: David Airlie Cc: Daniel Vetter Cc: Robin Murphy Cc: Steven Price Fixes: 7282f7645d06 ("drm/panfrost: Implement per FD address spaces") Signed-off-by: Emil Velikov Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20191101130313.8862-4-emil.l.velikov@gmail.com --- drivers/gpu/drm/panfrost/panfrost_drv.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/gpu/drm/panfrost') diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 9d086133a84e..f8a8aca9c658 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -451,15 +451,11 @@ panfrost_postclose(struct drm_device *dev, struct drm_file *file) kfree(panfrost_priv); } -/* DRM_AUTH is required on SUBMIT for now, while all clients share a single - * address space. Note that render nodes would be able to submit jobs that - * could access BOs from clients authenticated with the master node. - */ static const struct drm_ioctl_desc panfrost_drm_driver_ioctls[] = { #define PANFROST_IOCTL(n, func, flags) \ DRM_IOCTL_DEF_DRV(PANFROST_##n, panfrost_ioctl_##func, flags) - PANFROST_IOCTL(SUBMIT, submit, DRM_RENDER_ALLOW | DRM_AUTH), + PANFROST_IOCTL(SUBMIT, submit, DRM_RENDER_ALLOW), PANFROST_IOCTL(WAIT_BO, wait_bo, DRM_RENDER_ALLOW), PANFROST_IOCTL(CREATE_BO, create_bo, DRM_RENDER_ALLOW), PANFROST_IOCTL(MMAP_BO, mmap_bo, DRM_RENDER_ALLOW), -- cgit From bc1152b086c1a99971ef3d351c9e1fd5814a6e46 Mon Sep 17 00:00:00 2001 From: Robin Murphy Date: Thu, 28 Nov 2019 20:54:27 +0000 Subject: drm/panfrost: Register devfreq cooling device When we have devfreq, also try to register a basic cooling device in case GPU workloads manage to hit thermal throttling thresholds. Signed-off-by: Robin Murphy Reviewed-by: Steven Price Signed-off-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/21f228099321f460d62e0ab7c77b2d2213dd4da8.1574974319.git.robin.murphy@arm.com --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 32 +++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'drivers/gpu/drm/panfrost') diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 4c4e8a30a1ac..fe8ee77c96e4 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright 2019 Collabora ltd. */ #include +#include #include #include #include @@ -81,8 +82,11 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) int ret; struct dev_pm_opp *opp; unsigned long cur_freq; + struct device *dev = &pfdev->pdev->dev; + struct devfreq *devfreq; + struct thermal_cooling_device *cooling; - ret = dev_pm_opp_of_add_table(&pfdev->pdev->dev); + ret = dev_pm_opp_of_add_table(dev); if (ret == -ENODEV) /* Optional, continue without devfreq */ return 0; else if (ret) @@ -92,29 +96,35 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) cur_freq = clk_get_rate(pfdev->clock); - opp = devfreq_recommended_opp(&pfdev->pdev->dev, &cur_freq, 0); + opp = devfreq_recommended_opp(dev, &cur_freq, 0); if (IS_ERR(opp)) return PTR_ERR(opp); panfrost_devfreq_profile.initial_freq = cur_freq; dev_pm_opp_put(opp); - pfdev->devfreq.devfreq = devm_devfreq_add_device(&pfdev->pdev->dev, - &panfrost_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND, - NULL); - if (IS_ERR(pfdev->devfreq.devfreq)) { - DRM_DEV_ERROR(&pfdev->pdev->dev, "Couldn't initialize GPU devfreq\n"); - ret = PTR_ERR(pfdev->devfreq.devfreq); - pfdev->devfreq.devfreq = NULL; - dev_pm_opp_of_remove_table(&pfdev->pdev->dev); - return ret; + devfreq = devm_devfreq_add_device(dev, &panfrost_devfreq_profile, + DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL); + if (IS_ERR(devfreq)) { + DRM_DEV_ERROR(dev, "Couldn't initialize GPU devfreq\n"); + dev_pm_opp_of_remove_table(dev); + return PTR_ERR(devfreq); } + pfdev->devfreq.devfreq = devfreq; + + cooling = of_devfreq_cooling_register(dev->of_node, devfreq); + if (IS_ERR(cooling)) + DRM_DEV_INFO(dev, "Failed to register cooling device\n"); + else + pfdev->devfreq.cooling = cooling; return 0; } void panfrost_devfreq_fini(struct panfrost_device *pfdev) { + if (pfdev->devfreq.cooling) + devfreq_cooling_unregister(pfdev->devfreq.cooling); dev_pm_opp_of_remove_table(&pfdev->pdev->dev); } -- cgit