aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2014-08-05 13:00:16 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-08-21 16:25:25 -0400
commit68fc31c5d29690685476ea3fbc7da8876f227792 (patch)
tree7d738eb1559450ab753bb27a1c239d920e648f8d
parentd60b18ba318ec4fb32851ad72f33e1dbc1b641f0 (diff)
[media] coda: improve allocation error messages
Produce some error messages when internal buffer allocation fails, for example because the CMA region is too small. 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>
-rw-r--r--drivers/media/platform/coda/coda-bit.c4
-rw-r--r--drivers/media/platform/coda/coda-common.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index fddd10d53558..529cc3e8acb0 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -1378,8 +1378,10 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
1378 } 1378 }
1379 1379
1380 ret = coda_alloc_framebuffers(ctx, q_data_dst, src_fourcc); 1380 ret = coda_alloc_framebuffers(ctx, q_data_dst, src_fourcc);
1381 if (ret < 0) 1381 if (ret < 0) {
1382 v4l2_err(&dev->v4l2_dev, "failed to allocate framebuffers\n");
1382 return ret; 1383 return ret;
1384 }
1383 1385
1384 /* Tell the decoder how many frame buffers we allocated. */ 1386 /* Tell the decoder how many frame buffers we allocated. */
1385 coda_write(dev, ctx->num_internal_frames, CODA_CMD_SET_FRAME_BUF_NUM); 1387 coda_write(dev, ctx->num_internal_frames, CODA_CMD_SET_FRAME_BUF_NUM);
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 73114529b2c4..0f8a2c970405 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -971,8 +971,12 @@ int coda_alloc_aux_buf(struct coda_dev *dev, struct coda_aux_buf *buf,
971{ 971{
972 buf->vaddr = dma_alloc_coherent(&dev->plat_dev->dev, size, &buf->paddr, 972 buf->vaddr = dma_alloc_coherent(&dev->plat_dev->dev, size, &buf->paddr,
973 GFP_KERNEL); 973 GFP_KERNEL);
974 if (!buf->vaddr) 974 if (!buf->vaddr) {
975 v4l2_err(&dev->v4l2_dev,
976 "Failed to allocate %s buffer of size %u\n",
977 name, size);
975 return -ENOMEM; 978 return -ENOMEM;
979 }
976 980
977 buf->size = size; 981 buf->size = size;
978 982