From 93adc8b5705c14d16be382d43699d2ba71248a4b Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Mon, 8 May 2017 12:45:52 +0200
Subject: gpu: ipu-v3: allocate ipuv3_channels as needed
Most of the 64 IPUv3 DMA channels are never used, some of them (channels
16, 30, 32, 34-39, and 53-63) are even marked as reserved.
Allocate the channel control structure only when a channel is actually
requested, replace the fixed size array with a list, and remove the
unused enabled and busy fields from the ipuv3_channel structure.
Signed-off-by: Philipp Zabel
---
drivers/gpu/ipu-v3/ipu-prv.h | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
(limited to 'drivers/gpu/ipu-v3/ipu-prv.h')
diff --git a/drivers/gpu/ipu-v3/ipu-prv.h b/drivers/gpu/ipu-v3/ipu-prv.h
index ca2a223..b6e22d6 100644
--- a/drivers/gpu/ipu-v3/ipu-prv.h
+++ b/drivers/gpu/ipu-v3/ipu-prv.h
@@ -157,11 +157,8 @@ enum ipu_modules {
struct ipuv3_channel {
unsigned int num;
-
- bool enabled;
- bool busy;
-
struct ipu_soc *ipu;
+ struct list_head list;
};
struct ipu_cpmem;
@@ -184,6 +181,7 @@ struct ipu_soc {
enum ipuv3_type ipu_type;
spinlock_t lock;
struct mutex channel_lock;
+ struct list_head channels;
void __iomem *cm_reg;
void __iomem *idmac_reg;
@@ -193,8 +191,6 @@ struct ipu_soc {
struct clk *clk;
- struct ipuv3_channel channel[64];
-
int irq_sync;
int irq_err;
struct irq_domain *domain;
--
cgit v1.1