Skip to content

Commit

Permalink
drm/msm/adreno: Defer enabling runpm until hw_init()
Browse files Browse the repository at this point in the history
To avoid preventing the display from coming up before the rootfs is
mounted, without resorting to packing fw in the initrd, the GPU has
this limbo state where the device is probed, but we aren't ready to
start sending commands to it.  This is particularly problematic for
a6xx, since the GMU (which requires fw to be loaded) is the one that
is controlling the power/clk/icc votes.

So defer enabling runpm until we are ready to call gpu->hw_init(),
as that is a point where we know we have all the needed fw and are
ready to start sending commands to the coproc's.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Patchwork: https://patchwork.freedesktop.org/patch/489337/
Link: https://lore.kernel.org/r/20220613182036.2567963-1-robdclark@gmail.com
  • Loading branch information
robclark committed Jul 7, 2022
1 parent a414fe3 commit 4b18299
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/msm/adreno/adreno_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev)
if (ret)
return NULL;

/*
* Now that we have firmware loaded, and are ready to begin
* booting the gpu, go ahead and enable runpm:
*/
pm_runtime_enable(&pdev->dev);

/* Make sure pm runtime is active and reset any previous errors */
pm_runtime_set_active(&pdev->dev);

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/msm/adreno/adreno_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
pm_runtime_set_autosuspend_delay(dev,
adreno_gpu->info->inactive_period);
pm_runtime_use_autosuspend(dev);
pm_runtime_enable(dev);

return msm_gpu_init(drm, pdev, &adreno_gpu->base, &funcs->base,
gpu_name, &adreno_gpu_config);
Expand Down

0 comments on commit 4b18299

Please sign in to comment.