diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2014-07-11 05:36:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-22 11:16:31 -0400 |
commit | 5d73fad1eba7a62d13687ded6db3a5d72323c4db (patch) | |
tree | 2fbfbc35048c4b3b856ce591c118c9dce3a0da71 /drivers/media/platform | |
parent | e5b0d1c60fff0b3420a97f3687906df04afc8b66 (diff) |
[media] coda: store global temporary buffer size in struct coda_devtype
Similarly to the work buffer size, store the temporary buffer size in the
coda_devtype structure.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/coda.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c index 23c2111fa916..c1e950aacd36 100644 --- a/drivers/media/platform/coda.c +++ b/drivers/media/platform/coda.c | |||
@@ -44,8 +44,6 @@ | |||
44 | 44 | ||
45 | #define CODADX6_MAX_INSTANCES 4 | 45 | #define CODADX6_MAX_INSTANCES 4 |
46 | 46 | ||
47 | #define CODA7_TEMP_BUF_SIZE (304 * 1024) | ||
48 | #define CODA9_TEMP_BUF_SIZE (204 * 1024) | ||
49 | #define CODA_PARA_BUF_SIZE (10 * 1024) | 47 | #define CODA_PARA_BUF_SIZE (10 * 1024) |
50 | #define CODA_ISRAM_SIZE (2048 * 2) | 48 | #define CODA_ISRAM_SIZE (2048 * 2) |
51 | #define CODADX6_IRAM_SIZE 0xb000 | 49 | #define CODADX6_IRAM_SIZE 0xb000 |
@@ -110,6 +108,7 @@ struct coda_devtype { | |||
110 | struct coda_codec *codecs; | 108 | struct coda_codec *codecs; |
111 | unsigned int num_codecs; | 109 | unsigned int num_codecs; |
112 | size_t workbuf_size; | 110 | size_t workbuf_size; |
111 | size_t tempbuf_size; | ||
113 | }; | 112 | }; |
114 | 113 | ||
115 | /* Per-queue, driver-specific private data */ | 114 | /* Per-queue, driver-specific private data */ |
@@ -3686,6 +3685,7 @@ static const struct coda_devtype coda_devdata[] = { | |||
3686 | .codecs = coda7_codecs, | 3685 | .codecs = coda7_codecs, |
3687 | .num_codecs = ARRAY_SIZE(coda7_codecs), | 3686 | .num_codecs = ARRAY_SIZE(coda7_codecs), |
3688 | .workbuf_size = 128 * 1024, | 3687 | .workbuf_size = 128 * 1024, |
3688 | .tempbuf_size = 304 * 1024, | ||
3689 | }, | 3689 | }, |
3690 | [CODA_IMX6Q] = { | 3690 | [CODA_IMX6Q] = { |
3691 | .firmware = "v4l-coda960-imx6q.bin", | 3691 | .firmware = "v4l-coda960-imx6q.bin", |
@@ -3693,6 +3693,7 @@ static const struct coda_devtype coda_devdata[] = { | |||
3693 | .codecs = coda9_codecs, | 3693 | .codecs = coda9_codecs, |
3694 | .num_codecs = ARRAY_SIZE(coda9_codecs), | 3694 | .num_codecs = ARRAY_SIZE(coda9_codecs), |
3695 | .workbuf_size = 80 * 1024, | 3695 | .workbuf_size = 80 * 1024, |
3696 | .tempbuf_size = 204 * 1024, | ||
3696 | }, | 3697 | }, |
3697 | [CODA_IMX6DL] = { | 3698 | [CODA_IMX6DL] = { |
3698 | .firmware = "v4l-coda960-imx6dl.bin", | 3699 | .firmware = "v4l-coda960-imx6dl.bin", |
@@ -3700,6 +3701,7 @@ static const struct coda_devtype coda_devdata[] = { | |||
3700 | .codecs = coda9_codecs, | 3701 | .codecs = coda9_codecs, |
3701 | .num_codecs = ARRAY_SIZE(coda9_codecs), | 3702 | .num_codecs = ARRAY_SIZE(coda9_codecs), |
3702 | .workbuf_size = 80 * 1024, | 3703 | .workbuf_size = 80 * 1024, |
3704 | .tempbuf_size = 204 * 1024, | ||
3703 | }, | 3705 | }, |
3704 | }; | 3706 | }; |
3705 | 3707 | ||
@@ -3819,8 +3821,7 @@ static int coda_probe(struct platform_device *pdev) | |||
3819 | dev_warn(&pdev->dev, "failed to create debugfs root\n"); | 3821 | dev_warn(&pdev->dev, "failed to create debugfs root\n"); |
3820 | 3822 | ||
3821 | /* allocate auxiliary per-device buffers for the BIT processor */ | 3823 | /* allocate auxiliary per-device buffers for the BIT processor */ |
3822 | switch (dev->devtype->product) { | 3824 | if (dev->devtype->product == CODA_DX6) { |
3823 | case CODA_DX6: | ||
3824 | ret = coda_alloc_aux_buf(dev, &dev->workbuf, | 3825 | ret = coda_alloc_aux_buf(dev, &dev->workbuf, |
3825 | dev->devtype->workbuf_size, "workbuf", | 3826 | dev->devtype->workbuf_size, "workbuf", |
3826 | dev->debugfs_root); | 3827 | dev->debugfs_root); |
@@ -3829,17 +3830,11 @@ static int coda_probe(struct platform_device *pdev) | |||
3829 | v4l2_device_unregister(&dev->v4l2_dev); | 3830 | v4l2_device_unregister(&dev->v4l2_dev); |
3830 | return ret; | 3831 | return ret; |
3831 | } | 3832 | } |
3832 | break; | ||
3833 | case CODA_7541: | ||
3834 | dev->tempbuf.size = CODA7_TEMP_BUF_SIZE; | ||
3835 | break; | ||
3836 | case CODA_960: | ||
3837 | dev->tempbuf.size = CODA9_TEMP_BUF_SIZE; | ||
3838 | break; | ||
3839 | } | 3833 | } |
3840 | if (dev->tempbuf.size) { | 3834 | |
3835 | if (dev->devtype->tempbuf_size) { | ||
3841 | ret = coda_alloc_aux_buf(dev, &dev->tempbuf, | 3836 | ret = coda_alloc_aux_buf(dev, &dev->tempbuf, |
3842 | dev->tempbuf.size, "tempbuf", | 3837 | dev->devtype->tempbuf_size, "tempbuf", |
3843 | dev->debugfs_root); | 3838 | dev->debugfs_root); |
3844 | if (ret < 0) { | 3839 | if (ret < 0) { |
3845 | dev_err(&pdev->dev, "failed to allocate temp buffer\n"); | 3840 | dev_err(&pdev->dev, "failed to allocate temp buffer\n"); |