lkml.org 
[lkml]   [2021]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v15 12/39] drm/tegra: gr2d: Support generic power domain and runtime PM
On Sun, Nov 14, 2021 at 10:34:08PM +0300, Dmitry Osipenko wrote:
> Add runtime power management and support generic power domains.
[...]
> @@ -104,10 +127,17 @@ static int gr2d_open_channel(struct tegra_drm_client *client,
> struct tegra_drm_context *context)
> {
> struct gr2d *gr2d = to_gr2d(client);
> + int err;
> +
> + err = pm_runtime_resume_and_get(client->base.dev);
> + if (err)
> + return err;
>
> context->channel = host1x_channel_get(gr2d->channel);
> - if (!context->channel)
> + if (!context->channel) {
> + pm_runtime_put(context->client->base.dev);

Could host1x_channel_get/put() handle pm_runtime* calls ? I would expect
this to be common code for the users.

BTW, pm_runtime_resume_and_get() uses different dev than
pm_runtime_put() in the error path - is this intended?

Best Regards
Michał Mirosław

\
 
 \ /
  Last update: 2021-11-28 06:50    [W:0.132 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site