summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2013-09-16 14:57:38 +0200
committerLucas Stach <l.stach@pengutronix.de>2013-09-17 08:45:23 +0200
commit40c5dd7d86c05354f8d4a29bf3183539ef5929a8 (patch)
tree030a19e4b6eec5ea21772123ac5df798deadc4be
parent0956d33399fc884b083b575477397bffc32b6d95 (diff)
downloadlinux-40c5dd7d86c05354f8d4a29bf3183539ef5929a8.tar.gz
WIP: move irq into adreno_gpu
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c21
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.h1
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c21
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.h2
4 files changed, 22 insertions, 23 deletions
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 1083894..0e995f1 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -313,6 +313,12 @@ static inline bool _rev_match(uint8_t entry, uint8_t id)
return (entry == ANY_ID) || (entry == id);
}
+static irqreturn_t irq_handler(int irq, void *data)
+{
+ struct adreno_gpu *gpu = data;
+ return gpu->funcs->irq(gpu);
+}
+
static void __iomem *adreno_ioremap(struct platform_device *pdev,
const char *name, const char *dbgname)
{
@@ -405,6 +411,21 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (IS_ERR(gpu->mmio))
return PTR_ERR(gpu->mmio);
+ /* Get Interrupt: */
+ gpu->irq = platform_get_irq_byname(pdev, "kgsl_3d0_irq");
+ if (gpu->irq < 0) {
+ ret = gpu->irq;
+ dev_err(drm->dev, "failed to get irq: %d\n", ret);
+ return ret;
+ }
+
+ ret = devm_request_irq(&pdev->dev, gpu->irq, irq_handler,
+ IRQF_TRIGGER_HIGH, adreno_get_name(gpu), gpu);
+ if (ret) {
+ dev_err(drm->dev, "failed to request IRQ%u: %d\n", gpu->irq, ret);
+ return ret;
+ }
+
ret = msm_gpu_init(drm, pdev, &gpu->base, funcs,
"kgsl_3d0_reg_memory", "kgsl_3d0_irq",
RB_SIZE);
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index 38edd4f..17c5628 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -62,6 +62,7 @@ struct adreno_gpu {
const struct firmware *pm4, *pfp;
void __iomem *mmio;
+ int irq;
/* ringbuffer rptr/wptr: */
// TODO should this be in adreno_ringbuffer? I think it would be
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 67d0427..a319dc1 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -285,12 +285,6 @@ int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
* Init/Cleanup:
*/
-static irqreturn_t irq_handler(int irq, void *data)
-{
- struct msm_gpu *gpu = data;
- return gpu->funcs->irq(gpu->gpu);
-}
-
static const char *clk_names[] = {
"src_clk", "core_clk", "iface_clk", "mem_clk", "mem_iface_clk",
};
@@ -309,21 +303,6 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
BUG_ON(ARRAY_SIZE(clk_names) != ARRAY_SIZE(gpu->grp_clks));
- /* Get Interrupt: */
- gpu->irq = platform_get_irq_byname(pdev, irqname);
- if (gpu->irq < 0) {
- ret = gpu->irq;
- dev_err(drm->dev, "failed to get irq: %d\n", ret);
- goto fail;
- }
-
- ret = devm_request_irq(&pdev->dev, gpu->irq, irq_handler,
- IRQF_TRIGGER_HIGH, adreno_get_name(gpu->gpu), gpu);
- if (ret) {
- dev_err(drm->dev, "failed to request IRQ%u: %d\n", gpu->irq, ret);
- goto fail;
- }
-
/* Acquire clocks: */
for (i = 0; i < ARRAY_SIZE(clk_names); i++) {
gpu->grp_clks[i] = devm_clk_get(&pdev->dev, clk_names[i]);
diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
index cc0f800..4d5ccba 100644
--- a/drivers/gpu/drm/msm/msm_gpu.h
+++ b/drivers/gpu/drm/msm/msm_gpu.h
@@ -49,8 +49,6 @@ struct msm_gpu {
/* worker for handling active-list retiring: */
struct work_struct retire_work;
- int irq;
-
struct iommu_domain *iommu;
int id;