Skip to content

Commit

Permalink
drm/vc4: Fix handling of a pm_runtime_get_sync() success case.
Browse files Browse the repository at this point in the history
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: Eric Anholt <eric@anholt.net>
Fixes: af71379 ("drm/vc4: Add a getparam ioctl for getting the V3D identity regs.")
  • Loading branch information
Eric Anholt committed Aug 20, 2016
1 parent ece7267 commit 163195f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/vc4/vc4_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data,
switch (args->param) {
case DRM_VC4_PARAM_V3D_IDENT0:
ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
if (ret)
if (ret < 0)
return ret;
args->value = V3D_READ(V3D_IDENT0);
pm_runtime_put(&vc4->v3d->pdev->dev);
break;
case DRM_VC4_PARAM_V3D_IDENT1:
ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
if (ret)
if (ret < 0)
return ret;
args->value = V3D_READ(V3D_IDENT1);
pm_runtime_put(&vc4->v3d->pdev->dev);
break;
case DRM_VC4_PARAM_V3D_IDENT2:
ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
if (ret)
if (ret < 0)
return ret;
args->value = V3D_READ(V3D_IDENT2);
pm_runtime_put(&vc4->v3d->pdev->dev);
Expand Down

0 comments on commit 163195f

Please sign in to comment.