[media] coda: improve allocation error messages
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 5 Aug 2014 17:00:16 +0000 (14:00 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 21 Aug 2014 20:25:25 +0000 (15:25 -0500)
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>
drivers/media/platform/coda/coda-bit.c
drivers/media/platform/coda/coda-common.c

index fddd10d5355878dfa1b5f3163b2e85bcdb85e21f..529cc3e8acb0b088b3f37a9199093de0a88aad11 100644 (file)
@@ -1378,8 +1378,10 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
        }
 
        ret = coda_alloc_framebuffers(ctx, q_data_dst, src_fourcc);
-       if (ret < 0)
+       if (ret < 0) {
+               v4l2_err(&dev->v4l2_dev, "failed to allocate framebuffers\n");
                return ret;
+       }
 
        /* Tell the decoder how many frame buffers we allocated. */
        coda_write(dev, ctx->num_internal_frames, CODA_CMD_SET_FRAME_BUF_NUM);
index 73114529b2c4dccf1442bfc4dacd38e398de0b36..0f8a2c9704052d3bf9e93a5764af336083646b71 100644 (file)
@@ -971,8 +971,12 @@ int coda_alloc_aux_buf(struct coda_dev *dev, struct coda_aux_buf *buf,
 {
        buf->vaddr = dma_alloc_coherent(&dev->plat_dev->dev, size, &buf->paddr,
                                        GFP_KERNEL);
-       if (!buf->vaddr)
+       if (!buf->vaddr) {
+               v4l2_err(&dev->v4l2_dev,
+                        "Failed to allocate %s buffer of size %u\n",
+                        name, size);
                return -ENOMEM;
+       }
 
        buf->size = size;