summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/msm/adreno/a3xx_gpu.c')
-rw-r--r--drivers/gpu/drm/msm/adreno/a3xx_gpu.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
index c97f8f4..7ac734d 100644
--- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
@@ -365,7 +365,7 @@ static void a3xx_show(struct adreno_gpu *gpu, struct seq_file *m)
}
#endif
-static const struct adreno_gpu_funcs funcs = {
+static struct adreno_gpu_funcs a3xx_gpu_funcs = {
.get_param = adreno_get_param,
.hw_init = a3xx_hw_init,
.pm_suspend = a3xx_gpu_pm_suspend,
@@ -386,11 +386,12 @@ static const char *clk_names[] = {
"src_clk", "core_clk", "iface_clk", "mem_clk", "mem_iface_clk",
};
-struct msm_gpu *a3xx_gpu_init(struct drm_device *dev, struct adreno_gem *gem,
- struct workqueue_struct *wq, int reglog)
+int a3xx_gpu_init(struct drm_device *dev,
+ const struct adreno_gem *gem, struct workqueue_struct *wq,
+ int reglog, struct adreno_gpu **gpu,
+ struct adreno_gpu_funcs **funcs)
{
struct a3xx_gpu *a3xx_gpu = NULL;
- struct msm_gpu *gpu;
struct platform_device *pdev = a3xx_pdev;
struct adreno_platform_config *config;
int i, ret;
@@ -408,8 +409,6 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev, struct adreno_gem *gem,
goto fail;
}
- gpu = &a3xx_gpu->base.base;
-
get_device(&pdev->dev);
a3xx_gpu->base.pdev = pdev;
@@ -450,17 +449,19 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev, struct adreno_gem *gem,
adreno_reglog = reglog;
ret = adreno_gpu_init(dev, pdev, &a3xx_gpu->base,
- &funcs, gem, wq, config->rev);
+ &a3xx_gpu_funcs, gem, wq, config->rev);
if (ret)
goto fail;
- return &a3xx_gpu->base.base;
+ *gpu = &a3xx_gpu->base;
+ *funcs = &a3xx_gpu_funcs;
+ return 0;
fail:
if (a3xx_gpu)
a3xx_destroy(&a3xx_gpu->base);
- return ERR_PTR(ret);
+ return ret;
}
/*