[PATCH 03/10] drm/amdgpu: handle runtime pm in fbcon
Michel Dänzer
michel at daenzer.net
Thu Sep 1 01:04:21 UTC 2016
On 01/09/16 07:08 AM, Alex Deucher wrote:
> Ported from nouveau.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
[...]
> +static int
> +amdgpufb_open(struct fb_info *info, int user)
> +{
> + struct amdgpu_fbdev *rfbdev = info->par;
> + struct amdgpu_device *adev = rfbdev->adev;
> + int ret = pm_runtime_get_sync(adev->ddev->dev);
> + if (ret < 0 && ret != -EACCES)
> + return ret;
> + return 0;
> +}
> +
> +static int
> +amdgpufb_release(struct fb_info *info, int user)
> +{
> + struct amdgpu_fbdev *rfbdev = info->par;
> + struct amdgpu_device *adev = rfbdev->adev;
> +
> + pm_runtime_mark_last_busy(adev->ddev->dev);
> + pm_runtime_put_autosuspend(adev->ddev->dev);
> + return 0;
> +}
If pm_runtime_get_sync returns -EACCES, won't there be an imbalance with
the pm_runtime_put_autosuspend call, which might result in the GPU
powering off even when there's something else which is supposed to keep
it on?
Same for patch 8.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the amd-gfx
mailing list