Commit 401e972f authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

[media] coda: store IRAM size in struct coda_devtype

Similarly to workbuf_size and tempbuf_size, store iram_size in the
coda_devtype structure. This also decreases the IRAM used on i.MX6DL
to 128 KiB.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 5d73fad1
...@@ -46,9 +46,6 @@ ...@@ -46,9 +46,6 @@
#define CODA_PARA_BUF_SIZE (10 * 1024) #define CODA_PARA_BUF_SIZE (10 * 1024)
#define CODA_ISRAM_SIZE (2048 * 2) #define CODA_ISRAM_SIZE (2048 * 2)
#define CODADX6_IRAM_SIZE 0xb000
#define CODA7_IRAM_SIZE 0x14000
#define CODA9_IRAM_SIZE 0x21000
#define CODA7_PS_BUF_SIZE 0x28000 #define CODA7_PS_BUF_SIZE 0x28000
#define CODA9_PS_SAVE_SIZE (512 * 1024) #define CODA9_PS_SAVE_SIZE (512 * 1024)
...@@ -109,6 +106,7 @@ struct coda_devtype { ...@@ -109,6 +106,7 @@ struct coda_devtype {
unsigned int num_codecs; unsigned int num_codecs;
size_t workbuf_size; size_t workbuf_size;
size_t tempbuf_size; size_t tempbuf_size;
size_t iram_size;
}; };
/* Per-queue, driver-specific private data */ /* Per-queue, driver-specific private data */
...@@ -3678,6 +3676,7 @@ static const struct coda_devtype coda_devdata[] = { ...@@ -3678,6 +3676,7 @@ static const struct coda_devtype coda_devdata[] = {
.codecs = codadx6_codecs, .codecs = codadx6_codecs,
.num_codecs = ARRAY_SIZE(codadx6_codecs), .num_codecs = ARRAY_SIZE(codadx6_codecs),
.workbuf_size = 288 * 1024 + FMO_SLICE_SAVE_BUF_SIZE * 8 * 1024, .workbuf_size = 288 * 1024 + FMO_SLICE_SAVE_BUF_SIZE * 8 * 1024,
.iram_size = 0xb000,
}, },
[CODA_IMX53] = { [CODA_IMX53] = {
.firmware = "v4l-coda7541-imx53.bin", .firmware = "v4l-coda7541-imx53.bin",
...@@ -3686,6 +3685,7 @@ static const struct coda_devtype coda_devdata[] = { ...@@ -3686,6 +3685,7 @@ static const struct coda_devtype coda_devdata[] = {
.num_codecs = ARRAY_SIZE(coda7_codecs), .num_codecs = ARRAY_SIZE(coda7_codecs),
.workbuf_size = 128 * 1024, .workbuf_size = 128 * 1024,
.tempbuf_size = 304 * 1024, .tempbuf_size = 304 * 1024,
.iram_size = 0x14000,
}, },
[CODA_IMX6Q] = { [CODA_IMX6Q] = {
.firmware = "v4l-coda960-imx6q.bin", .firmware = "v4l-coda960-imx6q.bin",
...@@ -3694,6 +3694,7 @@ static const struct coda_devtype coda_devdata[] = { ...@@ -3694,6 +3694,7 @@ static const struct coda_devtype coda_devdata[] = {
.num_codecs = ARRAY_SIZE(coda9_codecs), .num_codecs = ARRAY_SIZE(coda9_codecs),
.workbuf_size = 80 * 1024, .workbuf_size = 80 * 1024,
.tempbuf_size = 204 * 1024, .tempbuf_size = 204 * 1024,
.iram_size = 0x21000,
}, },
[CODA_IMX6DL] = { [CODA_IMX6DL] = {
.firmware = "v4l-coda960-imx6dl.bin", .firmware = "v4l-coda960-imx6dl.bin",
...@@ -3702,6 +3703,7 @@ static const struct coda_devtype coda_devdata[] = { ...@@ -3702,6 +3703,7 @@ static const struct coda_devtype coda_devdata[] = {
.num_codecs = ARRAY_SIZE(coda9_codecs), .num_codecs = ARRAY_SIZE(coda9_codecs),
.workbuf_size = 80 * 1024, .workbuf_size = 80 * 1024,
.tempbuf_size = 204 * 1024, .tempbuf_size = 204 * 1024,
.iram_size = 0x20000,
}, },
}; };
...@@ -3843,16 +3845,7 @@ static int coda_probe(struct platform_device *pdev) ...@@ -3843,16 +3845,7 @@ static int coda_probe(struct platform_device *pdev)
} }
} }
switch (dev->devtype->product) { dev->iram.size = dev->devtype->iram_size;
case CODA_DX6:
dev->iram.size = CODADX6_IRAM_SIZE;
break;
case CODA_7541:
dev->iram.size = CODA7_IRAM_SIZE;
break;
case CODA_960:
dev->iram.size = CODA9_IRAM_SIZE;
}
dev->iram.vaddr = gen_pool_dma_alloc(dev->iram_pool, dev->iram.size, dev->iram.vaddr = gen_pool_dma_alloc(dev->iram_pool, dev->iram.size,
&dev->iram.paddr); &dev->iram.paddr);
if (!dev->iram.vaddr) { if (!dev->iram.vaddr) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment