mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 02:31:27 +02:00
drm/v3d: Get rid of pm code
Runtime PM doesn't seem to work correctly on this driver. On top of
that, commit 8b6864e3e1 ("drm/v3d/v3d_drv: Remove unused static
variable 'v3d_v3d_pm_ops'") hints that it most likely never did as the
driver's PM ops were not hooked-up.
So, in order to support regular operation with V3D on BCM2711 (Raspberry
Pi 4), get rid of the PM code. PM will be reinstated once we figure out
the underlying issues.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220603092610.1909675-3-pbrobinson@gmail.com
This commit is contained in:
parent
9c63e25348
commit
90a64adb08
|
|
@ -4,7 +4,6 @@
|
||||||
#include <linux/circ_buf.h>
|
#include <linux/circ_buf.h>
|
||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/pm_runtime.h>
|
|
||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
#include <linux/string_helpers.h>
|
#include <linux/string_helpers.h>
|
||||||
|
|
||||||
|
|
@ -131,11 +130,7 @@ static int v3d_v3d_debugfs_ident(struct seq_file *m, void *unused)
|
||||||
struct drm_device *dev = node->minor->dev;
|
struct drm_device *dev = node->minor->dev;
|
||||||
struct v3d_dev *v3d = to_v3d_dev(dev);
|
struct v3d_dev *v3d = to_v3d_dev(dev);
|
||||||
u32 ident0, ident1, ident2, ident3, cores;
|
u32 ident0, ident1, ident2, ident3, cores;
|
||||||
int ret, core;
|
int core;
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(v3d->drm.dev);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ident0 = V3D_READ(V3D_HUB_IDENT0);
|
ident0 = V3D_READ(V3D_HUB_IDENT0);
|
||||||
ident1 = V3D_READ(V3D_HUB_IDENT1);
|
ident1 = V3D_READ(V3D_HUB_IDENT1);
|
||||||
|
|
@ -188,9 +183,6 @@ static int v3d_v3d_debugfs_ident(struct seq_file *m, void *unused)
|
||||||
(misccfg & V3D_MISCCFG_OVRTMUOUT) != 0);
|
(misccfg & V3D_MISCCFG_OVRTMUOUT) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pm_runtime_mark_last_busy(v3d->drm.dev);
|
|
||||||
pm_runtime_put_autosuspend(v3d->drm.dev);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -218,11 +210,6 @@ static int v3d_measure_clock(struct seq_file *m, void *unused)
|
||||||
uint32_t cycles;
|
uint32_t cycles;
|
||||||
int core = 0;
|
int core = 0;
|
||||||
int measure_ms = 1000;
|
int measure_ms = 1000;
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(v3d->drm.dev);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if (v3d->ver >= 40) {
|
if (v3d->ver >= 40) {
|
||||||
V3D_CORE_WRITE(core, V3D_V4_PCTR_0_SRC_0_3,
|
V3D_CORE_WRITE(core, V3D_V4_PCTR_0_SRC_0_3,
|
||||||
|
|
@ -246,9 +233,6 @@ static int v3d_measure_clock(struct seq_file *m, void *unused)
|
||||||
cycles / (measure_ms * 1000),
|
cycles / (measure_ms * 1000),
|
||||||
(cycles / (measure_ms * 100)) % 10);
|
(cycles / (measure_ms * 100)) % 10);
|
||||||
|
|
||||||
pm_runtime_mark_last_busy(v3d->drm.dev);
|
|
||||||
pm_runtime_put_autosuspend(v3d->drm.dev);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/pm_runtime.h>
|
|
||||||
#include <linux/reset.h>
|
#include <linux/reset.h>
|
||||||
|
|
||||||
#include <drm/drm_drv.h>
|
#include <drm/drm_drv.h>
|
||||||
|
|
@ -43,7 +42,6 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
|
||||||
{
|
{
|
||||||
struct v3d_dev *v3d = to_v3d_dev(dev);
|
struct v3d_dev *v3d = to_v3d_dev(dev);
|
||||||
struct drm_v3d_get_param *args = data;
|
struct drm_v3d_get_param *args = data;
|
||||||
int ret;
|
|
||||||
static const u32 reg_map[] = {
|
static const u32 reg_map[] = {
|
||||||
[DRM_V3D_PARAM_V3D_UIFCFG] = V3D_HUB_UIFCFG,
|
[DRM_V3D_PARAM_V3D_UIFCFG] = V3D_HUB_UIFCFG,
|
||||||
[DRM_V3D_PARAM_V3D_HUB_IDENT1] = V3D_HUB_IDENT1,
|
[DRM_V3D_PARAM_V3D_HUB_IDENT1] = V3D_HUB_IDENT1,
|
||||||
|
|
@ -69,17 +67,12 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
|
||||||
if (args->value != 0)
|
if (args->value != 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(v3d->drm.dev);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
|
if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
|
||||||
args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
|
args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
|
||||||
args->value = V3D_CORE_READ(0, offset);
|
args->value = V3D_CORE_READ(0, offset);
|
||||||
} else {
|
} else {
|
||||||
args->value = V3D_READ(offset);
|
args->value = V3D_READ(offset);
|
||||||
}
|
}
|
||||||
pm_runtime_mark_last_busy(v3d->drm.dev);
|
|
||||||
pm_runtime_put_autosuspend(v3d->drm.dev);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -280,10 +273,6 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
pm_runtime_use_autosuspend(dev);
|
|
||||||
pm_runtime_set_autosuspend_delay(dev, 50);
|
|
||||||
pm_runtime_enable(dev);
|
|
||||||
|
|
||||||
ret = v3d_gem_init(drm);
|
ret = v3d_gem_init(drm);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto dma_free;
|
goto dma_free;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/pm_runtime.h>
|
|
||||||
#include <linux/reset.h>
|
#include <linux/reset.h>
|
||||||
#include <linux/sched/signal.h>
|
#include <linux/sched/signal.h>
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
|
|
@ -372,9 +371,6 @@ v3d_job_free(struct kref *ref)
|
||||||
dma_fence_put(job->irq_fence);
|
dma_fence_put(job->irq_fence);
|
||||||
dma_fence_put(job->done_fence);
|
dma_fence_put(job->done_fence);
|
||||||
|
|
||||||
pm_runtime_mark_last_busy(job->v3d->drm.dev);
|
|
||||||
pm_runtime_put_autosuspend(job->v3d->drm.dev);
|
|
||||||
|
|
||||||
if (job->perfmon)
|
if (job->perfmon)
|
||||||
v3d_perfmon_put(job->perfmon);
|
v3d_perfmon_put(job->perfmon);
|
||||||
|
|
||||||
|
|
@ -476,14 +472,10 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv,
|
||||||
job->v3d = v3d;
|
job->v3d = v3d;
|
||||||
job->free = free;
|
job->free = free;
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(v3d->drm.dev);
|
|
||||||
if (ret < 0)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
ret = drm_sched_job_init(&job->base, &v3d_priv->sched_entity[queue],
|
ret = drm_sched_job_init(&job->base, &v3d_priv->sched_entity[queue],
|
||||||
v3d_priv);
|
v3d_priv);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail_job;
|
goto fail;
|
||||||
|
|
||||||
if (has_multisync) {
|
if (has_multisync) {
|
||||||
if (se->in_sync_count && se->wait_stage == queue) {
|
if (se->in_sync_count && se->wait_stage == queue) {
|
||||||
|
|
@ -514,8 +506,6 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv,
|
||||||
|
|
||||||
fail_deps:
|
fail_deps:
|
||||||
drm_sched_job_cleanup(&job->base);
|
drm_sched_job_cleanup(&job->base);
|
||||||
fail_job:
|
|
||||||
pm_runtime_put_autosuspend(v3d->drm.dev);
|
|
||||||
fail:
|
fail:
|
||||||
kfree(*container);
|
kfree(*container);
|
||||||
*container = NULL;
|
*container = NULL;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user