mirror_ubuntu-kernels/drivers/gpu/drm/msm/adreno
Nathan Chancellor 390d645877 drm/msm/gpu: Avoid -Wunused-function with !CONFIG_PM_SLEEP
When building with CONFIG_PM=y and CONFIG_PM_SLEEP=n (such as ARCH=riscv
allmodconfig), the following warnings/errors occur:

  drivers/gpu/drm/msm/adreno/adreno_device.c:679:12: error: 'adreno_system_resume' defined but not used [-Werror=unused-function]
    679 | static int adreno_system_resume(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~
  drivers/gpu/drm/msm/adreno/adreno_device.c:655:12: error: 'adreno_system_suspend' defined but not used [-Werror=unused-function]
    655 | static int adreno_system_suspend(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

These functions are only used in SET_SYSTEM_SLEEP_PM_OPS(), which
evaluates to empty when CONFIG_PM_SLEEP is not set, making these
functions unused.

To resolve this, use the SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS()
macros, which were introduced in commit 1a3c7bb088 ("PM: core: Add new
*_PM_OPS macros, deprecate old ones"). They are designed to avoid these
compiler warnings while still guarding their use on
CONFIG_PM{,_SLEEP}=y.

Fixes: 7e4167c9e0 ("drm/msm/gpu: Park scheduler threads for system suspend")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20220411181249.2758344-1-nathan@kernel.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
2022-04-11 18:35:31 -07:00
..
a2xx_gpu.c drm/msm: Add SET_PARAM ioctl 2022-03-04 11:50:41 -08:00
a2xx_gpu.h drm/msm/adreno: add a2xx 2018-12-11 13:07:06 -05:00
a2xx.xml.h drm/msm: Update generated headers 2022-03-04 11:50:41 -08:00
a3xx_gpu.c drm/msm: Add SET_PARAM ioctl 2022-03-04 11:50:41 -08:00
a3xx_gpu.h drm/msm/gpu: add ocmem init/cleanup functions 2019-10-07 08:17:39 -07:00
a3xx.xml.h drm/msm: Update generated headers 2022-03-04 11:50:41 -08:00
a4xx_gpu.c drm/msm: Add SET_PARAM ioctl 2022-03-04 11:50:41 -08:00
a4xx_gpu.h drm/msm/gpu: add ocmem init/cleanup functions 2019-10-07 08:17:39 -07:00
a4xx.xml.h drm/msm: Update generated headers 2022-03-04 11:50:41 -08:00
a5xx_debugfs.c drm/msm: Remove struct_mutex usage 2021-11-28 09:50:33 -08:00
a5xx_gpu.c drm/msm: Add SET_PARAM ioctl 2022-03-04 11:50:41 -08:00
a5xx_gpu.h drm/msm: Allow a5xx to mark the RPTR shadow as privileged 2020-09-15 10:47:44 -07:00
a5xx_power.c drm/msm: drop drm_gem_object_put_locked() 2021-07-27 18:09:18 -07:00
a5xx_preempt.c drm/msm: drop drm_gem_object_put_locked() 2021-07-27 18:09:18 -07:00
a5xx.xml.h drm/msm: Update generated headers 2022-03-04 11:50:41 -08:00
a6xx_gmu.c drm/msm/gpu: Name GMU bos 2021-11-29 16:19:58 -08:00
a6xx_gmu.h drm/msm/a6xx: Serialize GMU communication 2021-10-01 13:10:20 -07:00
a6xx_gmu.xml.h drm/msm: Update generated headers 2022-03-04 11:50:41 -08:00
a6xx_gpu_state.c drm/msm/a6xx: Skip crashdumper state if GPU needs_hw_init 2021-12-13 13:46:18 -08:00
a6xx_gpu_state.h drm/msm/a6xx: fix crashdec section name typo 2020-08-22 10:36:30 -07:00
a6xx_gpu.c drm/msm: Fix range size vs end confusion 2022-04-11 09:36:13 -07:00
a6xx_gpu.h drm/msm: Drop priv->lastctx 2021-11-28 09:50:33 -08:00
a6xx_hfi.c drm/msm/gpu: Also snapshot GMU HFI buffer 2021-11-29 16:19:58 -08:00
a6xx_hfi.h drm/msm/gpu: Also snapshot GMU HFI buffer 2021-11-29 16:19:58 -08:00
a6xx.xml.h drm/msm: Update generated headers 2022-03-04 11:50:41 -08:00
adreno_common.xml.h drm/msm: Update generated headers 2022-03-04 11:50:41 -08:00
adreno_device.c drm/msm/gpu: Avoid -Wunused-function with !CONFIG_PM_SLEEP 2022-04-11 18:35:31 -07:00
adreno_gpu.c drm/msm/adreno: fix cast in adreno_get_param() 2022-03-08 09:49:00 -08:00
adreno_gpu.h drm/msm: Add SET_PARAM ioctl 2022-03-04 11:50:41 -08:00
adreno_pm4.xml.h drm/msm: Update generated headers 2022-03-04 11:50:41 -08:00