Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68fc31c5 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab
Browse files

[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: 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 d60b18ba
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1378,8 +1378,10 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
	}
	}


	ret = coda_alloc_framebuffers(ctx, q_data_dst, src_fourcc);
	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;
		return ret;
	}


	/* Tell the decoder how many frame buffers we allocated. */
	/* Tell the decoder how many frame buffers we allocated. */
	coda_write(dev, ctx->num_internal_frames, CODA_CMD_SET_FRAME_BUF_NUM);
	coda_write(dev, ctx->num_internal_frames, CODA_CMD_SET_FRAME_BUF_NUM);
+5 −1
Original line number Original line Diff line number Diff line
@@ -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,
	buf->vaddr = dma_alloc_coherent(&dev->plat_dev->dev, size, &buf->paddr,
					GFP_KERNEL);
					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;
		return -ENOMEM;
	}


	buf->size = size;
	buf->size = size;