OSDN Git Service

drm/msm/adreno: load gpu at probe/bind time
authorRob Clark <robdclark@gmail.com>
Mon, 16 Oct 2017 13:22:38 +0000 (09:22 -0400)
committerRob Clark <robdclark@gmail.com>
Sat, 28 Oct 2017 15:01:31 +0000 (11:01 -0400)
commiteec874ce5ff1fe1742317513904a2292af749c7d
tree35af7532497223ab4fa94f5120cd29c475c999bf
parentaacd9e6bdb7f7e66e779ca0316257cce667d3431
drm/msm/adreno: load gpu at probe/bind time

Previously, in an effort to defer initializing the gpu until firmware
was available (ie. rootfs mounted), the gpu was not loaded at when the
subdevice was bound.  Which resulted that clks/etc were requested in a
place that devm couldn't really help unwind if something failed.

Instead move request_firmware() to gpu->hw_init() and construct the gpu
earlier in adreno_bind().  To avoid the rest of the driver needing to
be aware of a gpu that hasn't managed to load firmware and hw_init()
yet, stash the gpu ptr in the adreno device's drvdata, and don't set
priv->gpu() until hw_init() succeeds.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/a5xx_gpu.c
drivers/gpu/drm/msm/adreno/adreno_device.c
drivers/gpu/drm/msm/adreno/adreno_gpu.c
drivers/gpu/drm/msm/msm_drv.c