On Wed, Aug 31, 2016 at 9:04 PM, Michel Dänzer <mic...@daenzer.net> wrote: > On 01/09/16 07:08 AM, Alex Deucher wrote: >> Ported from nouveau. >> >> Signed-off-by: Alex Deucher <alexander.deuc...@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.
pm_runtime_get_sync only returns -EACCES when runtime pm has been disabled in which case the GPU is on and pm_runtime_put_autosuspend won't do anything. Alex > > > -- > Earthling Michel Dänzer | http://www.amd.com > Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx