[PATCH 2/2] drm/radeon: handle runtime pm in fbcon (v2)
Deucher, Alexander
Alexander.Deucher at amd.com
Wed Sep 7 11:09:52 UTC 2016
> -----Original Message-----
> From: Edward O'Callaghan [mailto:funfunctor at folklore1984.net]
> Sent: Saturday, September 03, 2016 1:08 AM
> To: Alex Deucher; amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander
> Subject: Re: [PATCH 2/2] drm/radeon: handle runtime pm in fbcon (v2)
>
>
>
> On 09/03/2016 01:18 AM, Alex Deucher wrote:
> > Ported from nouveau.
> >
> > v2: re-enable runtime autosuspend in the error case
> >
> > Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> > ---
> > drivers/gpu/drm/radeon/radeon_fb.c | 28
> ++++++++++++++++++++++++++++
> > 1 file changed, 28 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_fb.c
> b/drivers/gpu/drm/radeon/radeon_fb.c
> > index 0e3143a..6b2537d 100644
> > --- a/drivers/gpu/drm/radeon/radeon_fb.c
> > +++ b/drivers/gpu/drm/radeon/radeon_fb.c
> > @@ -26,6 +26,7 @@
> > #include <linux/module.h>
> > #include <linux/slab.h>
> > #include <linux/fb.h>
> > +#include <linux/pm_runtime.h>
> >
> > #include <drm/drmP.h>
> > #include <drm/drm_crtc.h>
> > @@ -47,8 +48,35 @@ struct radeon_fbdev {
> > struct radeon_device *rdev;
> > };
> >
> > +static int
> > +radeonfb_open(struct fb_info *info, int user)
> > +{
> > + struct radeon_fbdev *rfbdev = info->par;
> > + struct radeon_device *rdev = rfbdev->rdev;
> > + int ret = pm_runtime_get_sync(rdev->ddev->dev);
> > + if (ret < 0 && ret != -EACCES) {
> > + pm_runtime_mark_last_busy(rdev->ddev->dev);
> > + pm_runtime_put_autosuspend(rdev->ddev->dev);
> > + return ret;
> > + }
> > + return 0;
>
> Hi Alex,
>
> Minor question - in the case of (ret == -EACCES) is that still regarded
> as successful in the context of radeonfb_open()'s call?
>
> If it indeed is then,
Yes, -EACCES just means runtime pm is disabled so there is no power up of the device necessary.
Alex
>
> Acked-by: Edward O'Callaghan <funfunctor at folklore1984.net>
>
> Thanks for your time,
> Edward.
>
> > +}
> > +
> > +static int
> > +radeonfb_release(struct fb_info *info, int user)
> > +{
> > + struct radeon_fbdev *rfbdev = info->par;
> > + struct radeon_device *rdev = rfbdev->rdev;
> > +
> > + pm_runtime_mark_last_busy(rdev->ddev->dev);
> > + pm_runtime_put_autosuspend(rdev->ddev->dev);
> > + return 0;
> > +}
> > +
> > static struct fb_ops radeonfb_ops = {
> > .owner = THIS_MODULE,
> > + .fb_open = radeonfb_open,
> > + .fb_release = radeonfb_release,
> > .fb_check_var = drm_fb_helper_check_var,
> > .fb_set_par = drm_fb_helper_set_par,
> > .fb_fillrect = drm_fb_helper_cfb_fillrect,
> >
More information about the amd-gfx
mailing list