2019-06-03 07:44:50 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2014-09-05 13:06:37 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013-2014 Red Hat
|
|
|
|
* Author: Rob Clark <robdclark@gmail.com>
|
|
|
|
*
|
2017-03-07 10:02:54 -07:00
|
|
|
* Copyright (c) 2014,2017 The Linux Foundation. All rights reserved.
|
2014-09-05 13:06:37 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "adreno_gpu.h"
|
|
|
|
|
2014-09-05 15:03:40 -04:00
|
|
|
bool hang_debug = false;
|
|
|
|
MODULE_PARM_DESC(hang_debug, "Dump registers when hang is detected (can be slow!)");
|
|
|
|
module_param_named(hang_debug, hang_debug, bool, 0600);
|
|
|
|
|
2020-08-11 16:36:57 -07:00
|
|
|
bool snapshot_debugbus = false;
|
|
|
|
MODULE_PARM_DESC(snapshot_debugbus, "Include debugbus sections in GPU devcoredump (if not fused off)");
|
|
|
|
module_param_named(snapshot_debugbus, snapshot_debugbus, bool, 0600);
|
|
|
|
|
2024-10-03 18:13:00 +02:00
|
|
|
int enable_preemption = -1;
|
|
|
|
MODULE_PARM_DESC(enable_preemption, "Enable preemption (A7xx only) (1=on , 0=disable, -1=auto (default))");
|
|
|
|
module_param(enable_preemption, int, 0600);
|
|
|
|
|
2025-04-19 20:21:33 +05:30
|
|
|
bool disable_acd;
|
|
|
|
MODULE_PARM_DESC(disable_acd, "Forcefully disable GPU ACD");
|
|
|
|
module_param_unsafe(disable_acd, bool, 0400);
|
|
|
|
|
2024-06-18 09:42:48 -07:00
|
|
|
extern const struct adreno_gpulist a2xx_gpulist;
|
|
|
|
extern const struct adreno_gpulist a3xx_gpulist;
|
|
|
|
extern const struct adreno_gpulist a4xx_gpulist;
|
|
|
|
extern const struct adreno_gpulist a5xx_gpulist;
|
|
|
|
extern const struct adreno_gpulist a6xx_gpulist;
|
|
|
|
extern const struct adreno_gpulist a7xx_gpulist;
|
2024-06-18 09:42:47 -07:00
|
|
|
|
|
|
|
static const struct adreno_gpulist *gpulists[] = {
|
|
|
|
&a2xx_gpulist,
|
|
|
|
&a3xx_gpulist,
|
|
|
|
&a4xx_gpulist,
|
|
|
|
&a5xx_gpulist,
|
|
|
|
&a6xx_gpulist,
|
2024-06-26 09:53:16 +02:00
|
|
|
&a7xx_gpulist,
|
2014-09-05 13:30:27 -04:00
|
|
|
};
|
|
|
|
|
2023-07-27 14:20:18 -07:00
|
|
|
static const struct adreno_info *adreno_info(uint32_t chip_id)
|
2014-09-05 13:30:27 -04:00
|
|
|
{
|
|
|
|
/* identify gpu: */
|
2024-06-18 09:42:47 -07:00
|
|
|
for (int i = 0; i < ARRAY_SIZE(gpulists); i++) {
|
|
|
|
for (int j = 0; j < gpulists[i]->gpus_count; j++) {
|
|
|
|
const struct adreno_info *info = &gpulists[i]->gpus[j];
|
|
|
|
|
|
|
|
if (info->machine && !of_machine_is_compatible(info->machine))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
for (int k = 0; info->chip_ids[k]; k++)
|
|
|
|
if (info->chip_ids[k] == chip_id)
|
|
|
|
return info;
|
|
|
|
}
|
2014-09-05 13:30:27 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct msm_gpu *adreno_load_gpu(struct drm_device *dev)
|
|
|
|
{
|
|
|
|
struct msm_drm_private *priv = dev->dev_private;
|
|
|
|
struct platform_device *pdev = priv->gpu_pdev;
|
2017-12-22 15:41:13 +05:30
|
|
|
struct msm_gpu *gpu = NULL;
|
2018-08-06 11:33:22 -06:00
|
|
|
struct adreno_gpu *adreno_gpu;
|
2017-10-16 09:22:38 -04:00
|
|
|
int ret;
|
2014-09-05 13:30:27 -04:00
|
|
|
|
2017-12-22 15:41:13 +05:30
|
|
|
if (pdev)
|
2020-08-17 15:01:31 -07:00
|
|
|
gpu = dev_to_gpu(&pdev->dev);
|
2017-12-22 15:41:13 +05:30
|
|
|
|
2017-10-16 09:22:38 -04:00
|
|
|
if (!gpu) {
|
2017-12-22 15:41:13 +05:30
|
|
|
dev_err_once(dev->dev, "no GPU device was found\n");
|
2014-09-05 13:30:27 -04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-08-06 11:33:22 -06:00
|
|
|
adreno_gpu = to_adreno_gpu(gpu);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The number one reason for HW init to fail is if the firmware isn't
|
|
|
|
* loaded yet. Try that first and don't bother continuing on
|
|
|
|
* otherwise
|
|
|
|
*/
|
|
|
|
|
|
|
|
ret = adreno_load_fw(adreno_gpu);
|
|
|
|
if (ret)
|
|
|
|
return NULL;
|
|
|
|
|
2023-03-20 07:43:35 -07:00
|
|
|
if (gpu->funcs->ucode_load) {
|
|
|
|
ret = gpu->funcs->ucode_load(gpu);
|
|
|
|
if (ret)
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2022-06-13 11:20:30 -07:00
|
|
|
/*
|
|
|
|
* Now that we have firmware loaded, and are ready to begin
|
|
|
|
* booting the gpu, go ahead and enable runpm:
|
|
|
|
*/
|
|
|
|
pm_runtime_enable(&pdev->dev);
|
|
|
|
|
2018-08-06 11:33:22 -06:00
|
|
|
ret = pm_runtime_get_sync(&pdev->dev);
|
|
|
|
if (ret < 0) {
|
2023-03-03 17:48:05 +01:00
|
|
|
pm_runtime_put_noidle(&pdev->dev);
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "Couldn't power up the GPU: %d\n", ret);
|
2023-03-03 17:48:05 +01:00
|
|
|
goto err_disable_rpm;
|
2018-08-06 11:33:22 -06:00
|
|
|
}
|
|
|
|
|
2021-11-09 10:11:03 -08:00
|
|
|
mutex_lock(&gpu->lock);
|
2017-10-16 09:22:38 -04:00
|
|
|
ret = msm_gpu_hw_init(gpu);
|
2021-11-09 10:11:03 -08:00
|
|
|
mutex_unlock(&gpu->lock);
|
2017-10-16 09:22:38 -04:00
|
|
|
if (ret) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "gpu hw init failed: %d\n", ret);
|
2023-03-03 17:48:05 +01:00
|
|
|
goto err_put_rpm;
|
2014-09-05 13:30:27 -04:00
|
|
|
}
|
|
|
|
|
2023-03-03 17:48:05 +01:00
|
|
|
pm_runtime_put_autosuspend(&pdev->dev);
|
|
|
|
|
2018-02-26 10:49:26 +01:00
|
|
|
#ifdef CONFIG_DEBUG_FS
|
2017-12-13 15:12:56 -05:00
|
|
|
if (gpu->funcs->debugfs_init) {
|
|
|
|
gpu->funcs->debugfs_init(gpu, dev->primary);
|
|
|
|
gpu->funcs->debugfs_init(gpu, dev->render);
|
|
|
|
}
|
2018-02-26 10:49:26 +01:00
|
|
|
#endif
|
2017-12-13 15:12:56 -05:00
|
|
|
|
2014-09-05 13:30:27 -04:00
|
|
|
return gpu;
|
2023-03-03 17:48:05 +01:00
|
|
|
|
|
|
|
err_put_rpm:
|
2023-03-31 01:15:16 +02:00
|
|
|
pm_runtime_put_sync_suspend(&pdev->dev);
|
2023-03-03 17:48:05 +01:00
|
|
|
err_disable_rpm:
|
|
|
|
pm_runtime_disable(&pdev->dev);
|
|
|
|
|
|
|
|
return NULL;
|
2014-09-05 13:30:27 -04:00
|
|
|
}
|
|
|
|
|
2025-06-09 11:24:36 -07:00
|
|
|
static int find_chipid(struct device_node *node, uint32_t *chipid)
|
2017-01-30 11:02:27 -05:00
|
|
|
{
|
|
|
|
const char *compat;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* first search the compat strings for qcom,adreno-XYZ.W: */
|
|
|
|
ret = of_property_read_string_index(node, "compatible", 0, &compat);
|
|
|
|
if (ret == 0) {
|
2017-11-21 12:40:54 -07:00
|
|
|
unsigned int r, patch;
|
2017-01-30 11:02:27 -05:00
|
|
|
|
2018-12-04 10:16:58 -05:00
|
|
|
if (sscanf(compat, "qcom,adreno-%u.%u", &r, &patch) == 2 ||
|
|
|
|
sscanf(compat, "amd,imageon-%u.%u", &r, &patch) == 2) {
|
2023-07-27 14:20:18 -07:00
|
|
|
uint32_t core, major, minor;
|
|
|
|
|
|
|
|
core = r / 100;
|
2017-11-21 12:40:54 -07:00
|
|
|
r %= 100;
|
2023-07-27 14:20:18 -07:00
|
|
|
major = r / 10;
|
2017-11-21 12:40:54 -07:00
|
|
|
r %= 10;
|
2023-07-27 14:20:18 -07:00
|
|
|
minor = r;
|
|
|
|
|
|
|
|
*chipid = (core << 24) |
|
|
|
|
(major << 16) |
|
|
|
|
(minor << 8) |
|
|
|
|
patch;
|
2017-01-30 11:02:27 -05:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2023-07-27 14:20:18 -07:00
|
|
|
|
|
|
|
if (sscanf(compat, "qcom,adreno-%08x", chipid) == 1)
|
|
|
|
return 0;
|
2017-01-30 11:02:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/* and if that fails, fall back to legacy "qcom,chipid" property: */
|
2023-07-27 14:20:18 -07:00
|
|
|
ret = of_property_read_u32(node, "qcom,chipid", chipid);
|
2017-11-21 12:40:54 -07:00
|
|
|
if (ret) {
|
2025-06-09 11:24:36 -07:00
|
|
|
DRM_ERROR("%pOF: could not parse qcom,chipid: %d\n",
|
|
|
|
node, ret);
|
2017-01-30 11:02:27 -05:00
|
|
|
return ret;
|
2017-11-21 12:40:54 -07:00
|
|
|
}
|
|
|
|
|
2025-06-09 11:24:36 -07:00
|
|
|
pr_warn("%pOF: Using legacy qcom,chipid binding!\n", node);
|
2017-01-30 11:02:27 -05:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2025-06-09 11:24:37 -07:00
|
|
|
bool adreno_has_gpu(struct device_node *node)
|
|
|
|
{
|
|
|
|
const struct adreno_info *info;
|
|
|
|
uint32_t chip_id;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = find_chipid(node, &chip_id);
|
|
|
|
if (ret)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
info = adreno_info(chip_id);
|
|
|
|
if (!info) {
|
|
|
|
pr_warn("%pOF: Unknown GPU revision: %"ADRENO_CHIPID_FMT"\n",
|
|
|
|
node, ADRENO_CHIPID_ARGS(chip_id));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-09-05 13:06:37 -04:00
|
|
|
static int adreno_bind(struct device *dev, struct device *master, void *data)
|
|
|
|
{
|
|
|
|
static struct adreno_platform_config config = {};
|
2017-10-16 09:22:38 -04:00
|
|
|
const struct adreno_info *info;
|
2021-12-01 11:52:09 +01:00
|
|
|
struct msm_drm_private *priv = dev_get_drvdata(master);
|
|
|
|
struct drm_device *drm = priv->dev;
|
2017-10-16 09:22:38 -04:00
|
|
|
struct msm_gpu *gpu;
|
2017-01-30 11:15:14 -05:00
|
|
|
int ret;
|
2014-09-05 13:06:37 -04:00
|
|
|
|
2025-06-09 11:24:36 -07:00
|
|
|
ret = find_chipid(dev->of_node, &config.chip_id);
|
2025-06-09 11:24:37 -07:00
|
|
|
/* We shouldn't have gotten this far if we can't parse the chip_id */
|
|
|
|
if (WARN_ON(ret))
|
2014-09-05 13:06:37 -04:00
|
|
|
return ret;
|
|
|
|
|
|
|
|
dev->platform_data = &config;
|
2021-12-01 11:52:09 +01:00
|
|
|
priv->gpu_pdev = to_platform_device(dev);
|
2017-10-16 09:22:38 -04:00
|
|
|
|
2023-07-27 14:20:18 -07:00
|
|
|
info = adreno_info(config.chip_id);
|
2025-06-09 11:24:37 -07:00
|
|
|
/* We shouldn't have gotten this far if we don't recognize the GPU: */
|
2025-06-13 07:41:44 -07:00
|
|
|
if (WARN_ON(!info))
|
2017-10-16 09:22:38 -04:00
|
|
|
return -ENXIO;
|
|
|
|
|
2023-07-27 14:20:16 -07:00
|
|
|
config.info = info;
|
|
|
|
|
2023-07-27 14:20:18 -07:00
|
|
|
DBG("Found GPU: %"ADRENO_CHIPID_FMT, ADRENO_CHIPID_ARGS(config.chip_id));
|
2017-10-16 09:22:38 -04:00
|
|
|
|
2023-07-27 14:20:14 -07:00
|
|
|
priv->is_a2xx = info->family < ADRENO_3XX;
|
2023-07-27 14:20:11 -07:00
|
|
|
priv->has_cached_coherent =
|
|
|
|
!!(info->quirks & ADRENO_QUIRK_HAS_CACHED_COHERENT);
|
2018-11-14 17:08:04 -05:00
|
|
|
|
2017-10-16 09:22:38 -04:00
|
|
|
gpu = info->init(drm);
|
|
|
|
if (IS_ERR(gpu)) {
|
|
|
|
dev_warn(drm->dev, "failed to load adreno gpu\n");
|
|
|
|
return PTR_ERR(gpu);
|
|
|
|
}
|
|
|
|
|
2023-02-23 11:52:03 +01:00
|
|
|
ret = dev_pm_opp_of_find_icc_paths(dev, NULL);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
2014-09-05 13:06:37 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-01-09 22:25:47 +00:00
|
|
|
static int adreno_system_suspend(struct device *dev);
|
2014-09-05 13:06:37 -04:00
|
|
|
static void adreno_unbind(struct device *dev, struct device *master,
|
|
|
|
void *data)
|
|
|
|
{
|
2021-12-01 11:52:09 +01:00
|
|
|
struct msm_drm_private *priv = dev_get_drvdata(master);
|
2020-08-17 15:01:31 -07:00
|
|
|
struct msm_gpu *gpu = dev_to_gpu(dev);
|
2017-10-16 09:22:38 -04:00
|
|
|
|
2023-02-21 11:14:27 +01:00
|
|
|
if (pm_runtime_enabled(dev))
|
|
|
|
WARN_ON_ONCE(adreno_system_suspend(dev));
|
2017-10-16 09:22:38 -04:00
|
|
|
gpu->funcs->destroy(gpu);
|
|
|
|
|
2021-12-01 11:52:09 +01:00
|
|
|
priv->gpu_pdev = NULL;
|
2014-09-05 13:06:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct component_ops a3xx_ops = {
|
2023-03-03 17:48:07 +01:00
|
|
|
.bind = adreno_bind,
|
|
|
|
.unbind = adreno_unbind,
|
2014-09-05 13:06:37 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
static int adreno_probe(struct platform_device *pdev)
|
|
|
|
{
|
2025-07-05 13:02:35 +03:00
|
|
|
if (of_device_is_compatible(pdev->dev.of_node, "amd,imageon") ||
|
|
|
|
msm_gpu_no_components())
|
2025-07-05 13:02:34 +03:00
|
|
|
return msm_gpu_probe(pdev, &a3xx_ops);
|
2018-12-04 10:16:58 -05:00
|
|
|
|
2025-07-05 13:02:34 +03:00
|
|
|
return component_add(&pdev->dev, &a3xx_ops);
|
2014-09-05 13:06:37 -04:00
|
|
|
}
|
|
|
|
|
2023-05-07 18:25:54 +02:00
|
|
|
static void adreno_remove(struct platform_device *pdev)
|
2014-09-05 13:06:37 -04:00
|
|
|
{
|
2025-07-05 13:02:34 +03:00
|
|
|
struct msm_drm_private *priv = platform_get_drvdata(pdev);
|
|
|
|
|
|
|
|
if (priv->kms_init)
|
|
|
|
component_del(&pdev->dev, &a3xx_ops);
|
|
|
|
else
|
|
|
|
msm_gpu_remove(pdev, &a3xx_ops);
|
2014-09-05 13:06:37 -04:00
|
|
|
}
|
|
|
|
|
2020-10-19 18:49:17 +05:30
|
|
|
static void adreno_shutdown(struct platform_device *pdev)
|
|
|
|
{
|
2023-01-09 22:25:47 +00:00
|
|
|
WARN_ON_ONCE(adreno_system_suspend(&pdev->dev));
|
2020-10-19 18:49:17 +05:30
|
|
|
}
|
|
|
|
|
2014-09-05 13:06:37 -04:00
|
|
|
static const struct of_device_id dt_match[] = {
|
2017-01-30 11:02:27 -05:00
|
|
|
{ .compatible = "qcom,adreno" },
|
2014-09-05 13:06:37 -04:00
|
|
|
{ .compatible = "qcom,adreno-3xx" },
|
2018-12-04 10:16:58 -05:00
|
|
|
/* for compatibility with imx5 gpu: */
|
|
|
|
{ .compatible = "amd,imageon" },
|
2014-09-05 13:06:37 -04:00
|
|
|
/* for backwards compat w/ downstream kgsl DT files: */
|
|
|
|
{ .compatible = "qcom,kgsl-3d0" },
|
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
2022-03-10 15:46:04 -08:00
|
|
|
static int adreno_runtime_resume(struct device *dev)
|
2017-02-10 15:36:33 -05:00
|
|
|
{
|
2020-08-17 15:01:31 -07:00
|
|
|
struct msm_gpu *gpu = dev_to_gpu(dev);
|
2017-02-10 15:36:33 -05:00
|
|
|
|
|
|
|
return gpu->funcs->pm_resume(gpu);
|
|
|
|
}
|
|
|
|
|
2022-03-10 15:46:04 -08:00
|
|
|
static int adreno_runtime_suspend(struct device *dev)
|
2017-02-10 15:36:33 -05:00
|
|
|
{
|
2020-08-17 15:01:31 -07:00
|
|
|
struct msm_gpu *gpu = dev_to_gpu(dev);
|
2022-03-10 15:46:05 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* We should be holding a runpm ref, which will prevent
|
|
|
|
* runtime suspend. In the system suspend path, we've
|
|
|
|
* already waited for active jobs to complete.
|
|
|
|
*/
|
|
|
|
WARN_ON_ONCE(gpu->active_submits);
|
|
|
|
|
|
|
|
return gpu->funcs->pm_suspend(gpu);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void suspend_scheduler(struct msm_gpu *gpu)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Shut down the scheduler before we force suspend, so that
|
|
|
|
* suspend isn't racing with scheduler kthread feeding us
|
|
|
|
* more work.
|
|
|
|
*
|
|
|
|
* Note, we just want to park the thread, and let any jobs
|
|
|
|
* that are already on the hw queue complete normally, as
|
|
|
|
* opposed to the drm_sched_stop() path used for handling
|
|
|
|
* faulting/timed-out jobs. We can't really cancel any jobs
|
|
|
|
* already on the hw queue without racing with the GPU.
|
|
|
|
*/
|
|
|
|
for (i = 0; i < gpu->nr_rings; i++) {
|
|
|
|
struct drm_gpu_scheduler *sched = &gpu->rb[i]->sched;
|
2023-10-30 20:24:35 -07:00
|
|
|
|
|
|
|
drm_sched_wqueue_stop(sched);
|
2022-03-10 15:46:05 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void resume_scheduler(struct msm_gpu *gpu)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < gpu->nr_rings; i++) {
|
|
|
|
struct drm_gpu_scheduler *sched = &gpu->rb[i]->sched;
|
2023-10-30 20:24:35 -07:00
|
|
|
|
|
|
|
drm_sched_wqueue_start(sched);
|
2022-03-10 15:46:05 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int adreno_system_suspend(struct device *dev)
|
|
|
|
{
|
|
|
|
struct msm_gpu *gpu = dev_to_gpu(dev);
|
|
|
|
int remaining, ret;
|
|
|
|
|
2022-09-28 12:49:00 +05:30
|
|
|
if (!gpu)
|
|
|
|
return 0;
|
|
|
|
|
2022-03-10 15:46:05 -08:00
|
|
|
suspend_scheduler(gpu);
|
2022-01-08 10:09:10 -08:00
|
|
|
|
|
|
|
remaining = wait_event_timeout(gpu->retire_event,
|
2022-03-10 15:46:06 -08:00
|
|
|
gpu->active_submits == 0,
|
2022-01-08 10:09:10 -08:00
|
|
|
msecs_to_jiffies(1000));
|
|
|
|
if (remaining == 0) {
|
|
|
|
dev_err(dev, "Timeout waiting for GPU to suspend\n");
|
2022-03-10 15:46:05 -08:00
|
|
|
ret = -EBUSY;
|
|
|
|
goto out;
|
2022-01-08 10:09:10 -08:00
|
|
|
}
|
2017-02-10 15:36:33 -05:00
|
|
|
|
2022-03-10 15:46:05 -08:00
|
|
|
ret = pm_runtime_force_suspend(dev);
|
|
|
|
out:
|
|
|
|
if (ret)
|
|
|
|
resume_scheduler(gpu);
|
|
|
|
|
|
|
|
return ret;
|
2017-02-10 15:36:33 -05:00
|
|
|
}
|
2022-03-10 15:46:05 -08:00
|
|
|
|
|
|
|
static int adreno_system_resume(struct device *dev)
|
|
|
|
{
|
2022-09-28 12:49:00 +05:30
|
|
|
struct msm_gpu *gpu = dev_to_gpu(dev);
|
|
|
|
|
|
|
|
if (!gpu)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
resume_scheduler(gpu);
|
2022-03-10 15:46:05 -08:00
|
|
|
return pm_runtime_force_resume(dev);
|
|
|
|
}
|
|
|
|
|
2017-02-10 15:36:33 -05:00
|
|
|
static const struct dev_pm_ops adreno_pm_ops = {
|
2022-04-11 11:12:50 -07:00
|
|
|
SYSTEM_SLEEP_PM_OPS(adreno_system_suspend, adreno_system_resume)
|
|
|
|
RUNTIME_PM_OPS(adreno_runtime_suspend, adreno_runtime_resume, NULL)
|
2017-02-10 15:36:33 -05:00
|
|
|
};
|
|
|
|
|
2014-09-05 13:06:37 -04:00
|
|
|
static struct platform_driver adreno_driver = {
|
|
|
|
.probe = adreno_probe,
|
2024-12-01 15:12:43 -08:00
|
|
|
.remove = adreno_remove,
|
2020-10-19 18:49:17 +05:30
|
|
|
.shutdown = adreno_shutdown,
|
2014-09-05 13:06:37 -04:00
|
|
|
.driver = {
|
|
|
|
.name = "adreno",
|
|
|
|
.of_match_table = dt_match,
|
2017-02-10 15:36:33 -05:00
|
|
|
.pm = &adreno_pm_ops,
|
2014-09-05 13:06:37 -04:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
void __init adreno_register(void)
|
|
|
|
{
|
|
|
|
platform_driver_register(&adreno_driver);
|
|
|
|
}
|
|
|
|
|
|
|
|
void __exit adreno_unregister(void)
|
|
|
|
{
|
|
|
|
platform_driver_unregister(&adreno_driver);
|
|
|
|
}
|