Commit 163195fc authored by Eric Anholt's avatar Eric Anholt

drm/vc4: Fix handling of a pm_runtime_get_sync() success case.

If the device was already up, a 1 is returned instead of 0.  We were
erroring out, leading the 3D driver to sometimes fail at screen
initialization (generally with ENOENT returned to it).
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Fixes: af713795 ("drm/vc4: Add a getparam ioctl for getting the V3D identity regs.")
parent ece7267d
...@@ -57,21 +57,21 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, ...@@ -57,21 +57,21 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data,
switch (args->param) { switch (args->param) {
case DRM_VC4_PARAM_V3D_IDENT0: case DRM_VC4_PARAM_V3D_IDENT0:
ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
if (ret) if (ret < 0)
return ret; return ret;
args->value = V3D_READ(V3D_IDENT0); args->value = V3D_READ(V3D_IDENT0);
pm_runtime_put(&vc4->v3d->pdev->dev); pm_runtime_put(&vc4->v3d->pdev->dev);
break; break;
case DRM_VC4_PARAM_V3D_IDENT1: case DRM_VC4_PARAM_V3D_IDENT1:
ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
if (ret) if (ret < 0)
return ret; return ret;
args->value = V3D_READ(V3D_IDENT1); args->value = V3D_READ(V3D_IDENT1);
pm_runtime_put(&vc4->v3d->pdev->dev); pm_runtime_put(&vc4->v3d->pdev->dev);
break; break;
case DRM_VC4_PARAM_V3D_IDENT2: case DRM_VC4_PARAM_V3D_IDENT2:
ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
if (ret) if (ret < 0)
return ret; return ret;
args->value = V3D_READ(V3D_IDENT2); args->value = V3D_READ(V3D_IDENT2);
pm_runtime_put(&vc4->v3d->pdev->dev); pm_runtime_put(&vc4->v3d->pdev->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment