summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2013-09-13 14:05:50 +0200
committerLucas Stach <l.stach@pengutronix.de>2013-09-17 08:45:15 +0200
commit7ca6b7bbe918faae24aadee202112e910a8b7353 (patch)
treed513e0fb1f6d5ef96c0c216d1bfc996adb226f68
parent2d6a4abe9d5542ee8aa4d7f65186b66d8890e0b0 (diff)
downloadlinux-7ca6b7bbe918faae24aadee202112e910a8b7353.tar.gz
linux-7ca6b7bbe918faae24aadee202112e910a8b7353.tar.xz
WIP: move out adreno_gpu_funcs into global header
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
-rw-r--r--drivers/gpu/drm/msm/adreno/a3xx_gpu.c26
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c2
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.h5
-rw-r--r--drivers/gpu/drm/msm/msm_drv.h1
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c2
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.h24
-rw-r--r--include/drm/drm_adreno.h45
7 files changed, 63 insertions, 42 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
index dc30cbed0e01..0761794bdc81 100644
--- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
@@ -367,22 +367,20 @@ static void a3xx_show(struct msm_gpu *gpu, struct seq_file *m)
#endif
static const struct adreno_gpu_funcs funcs = {
- .base = {
- .get_param = adreno_get_param,
- .hw_init = a3xx_hw_init,
- .pm_suspend = msm_gpu_pm_suspend,
- .pm_resume = msm_gpu_pm_resume,
- .recover = adreno_recover,
- .last_fence = adreno_last_fence,
- .submit = adreno_submit,
- .flush = adreno_flush,
- .idle = a3xx_idle,
- .irq = a3xx_irq,
- .destroy = a3xx_destroy,
+ .get_param = adreno_get_param,
+ .hw_init = a3xx_hw_init,
+ .pm_suspend = msm_gpu_pm_suspend,
+ .pm_resume = msm_gpu_pm_resume,
+ .recover = adreno_recover,
+ .last_fence = adreno_last_fence,
+ .submit = adreno_submit,
+ .flush = adreno_flush,
+ .idle = a3xx_idle,
+ .irq = a3xx_irq,
+ .destroy = a3xx_destroy,
#ifdef CONFIG_DEBUG_FS
- .show = a3xx_show,
+ .show = a3xx_show,
#endif
- },
};
struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 91416963d120..1f7c71816d87 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -319,7 +319,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
return ret;
}
- ret = msm_gpu_init(drm, pdev, &gpu->base, &funcs->base,
+ ret = msm_gpu_init(drm, pdev, &gpu->base, funcs,
gpu->info->name, "kgsl_3d0_reg_memory", "kgsl_3d0_irq",
RB_SIZE);
if (ret)
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index eba015a36631..d7fff0a0ee17 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -19,6 +19,7 @@
#define __ADRENO_GPU_H__
#include <linux/firmware.h>
+#include <drm/drm_adreno.h>
#include "msm_gpu.h"
#include "adreno_ringbuffer.h"
@@ -36,10 +37,6 @@ struct adreno_rev {
#define ADRENO_REV(core, major, minor, patchid) \
((struct adreno_rev){ core, major, minor, patchid })
-struct adreno_gpu_funcs {
- struct msm_gpu_funcs base;
-};
-
struct adreno_info;
struct adreno_rbmemptrs {
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 80d75094bf0a..cb5d2e6b51d5 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -41,6 +41,7 @@
#include <drm/drm_crtc_helper.h>
#include <drm/drm_fb_helper.h>
#include <drm/msm_drm.h>
+#include <drm/drm_adreno.h>
struct msm_kms;
struct msm_gpu;
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 0b4747f88cdd..f8ea6b28be13 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -344,7 +344,7 @@ static const char *clk_names[] = {
};
int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
- struct msm_gpu *gpu, const struct msm_gpu_funcs *funcs,
+ struct msm_gpu *gpu, const struct adreno_gpu_funcs *funcs,
const char *name, const char *ioname, const char *irqname, int ringsz)
{
int i, ret;
diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
index 9aa7748b2db9..7cac83c1da3b 100644
--- a/drivers/gpu/drm/msm/msm_gpu.h
+++ b/drivers/gpu/drm/msm/msm_gpu.h
@@ -23,8 +23,6 @@
#include "msm_drv.h"
-struct msm_gem_submit;
-
/* So far, with hardware that I've seen to date, we can have:
* + zero, one, or two z180 2d cores
* + a3xx or a2xx 3d core, which share a common CP (the firmware
@@ -39,29 +37,11 @@ struct msm_gem_submit;
* + a2xx_gpu
* + z180_gpu
*/
-struct msm_gpu_funcs {
- int (*get_param)(struct msm_gpu *gpu, uint32_t param, uint64_t *value);
- int (*hw_init)(struct msm_gpu *gpu);
- int (*pm_suspend)(struct msm_gpu *gpu);
- int (*pm_resume)(struct msm_gpu *gpu);
- int (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit,
- struct msm_file_private *ctx);
- void (*flush)(struct msm_gpu *gpu);
- void (*idle)(struct msm_gpu *gpu);
- irqreturn_t (*irq)(struct msm_gpu *irq);
- uint32_t (*last_fence)(struct msm_gpu *gpu);
- void (*recover)(struct msm_gpu *gpu);
- void (*destroy)(struct msm_gpu *gpu);
-#ifdef CONFIG_DEBUG_FS
- /* show GPU status in debugfs: */
- void (*show)(struct msm_gpu *gpu, struct seq_file *m);
-#endif
-};
struct msm_gpu {
const char *name;
struct drm_device *dev;
- const struct msm_gpu_funcs *funcs;
+ const struct adreno_gpu_funcs *funcs;
/* list of GEM active objects: */
struct list_head active_list;
@@ -109,7 +89,7 @@ int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
struct msm_file_private *ctx);
int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
- struct msm_gpu *gpu, const struct msm_gpu_funcs *funcs,
+ struct msm_gpu *gpu, const struct adreno_gpu_funcs *funcs,
const char *name, const char *ioname, const char *irqname, int ringsz);
void msm_gpu_cleanup(struct msm_gpu *gpu);
diff --git a/include/drm/drm_adreno.h b/include/drm/drm_adreno.h
new file mode 100644
index 000000000000..566b0c8e2131
--- /dev/null
+++ b/include/drm/drm_adreno.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 Pengutronix
+ * Author: Lucas Stach <l.stach@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __DRM_ADRENO_H__
+#define __DRM_ADRENO_H__
+
+#include <drm/drmP.h>
+
+struct msm_gpu;
+struct msm_gem_submit;
+struct msm_file_private;
+
+struct adreno_gpu_funcs {
+ int (*get_param)(struct msm_gpu *gpu, uint32_t param, uint64_t *value);
+ int (*hw_init)(struct msm_gpu *gpu);
+ int (*pm_suspend)(struct msm_gpu *gpu);
+ int (*pm_resume)(struct msm_gpu *gpu);
+ int (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit,
+ struct msm_file_private *ctx);
+ void (*flush)(struct msm_gpu *gpu);
+ void (*idle)(struct msm_gpu *gpu);
+ irqreturn_t (*irq)(struct msm_gpu *irq);
+ uint32_t (*last_fence)(struct msm_gpu *gpu);
+ void (*recover)(struct msm_gpu *gpu);
+ void (*destroy)(struct msm_gpu *gpu);
+#ifdef CONFIG_DEBUG_FS
+ /* show GPU status in debugfs: */
+ void (*show)(struct msm_gpu *gpu, struct seq_file *m);
+#endif
+};
+
+#endif /* __DRM_ADRENO_H__ */