media: mtk-mdp: alloc bigger cmdq pkt if request is too big

If the request is too big for the cmdq pkt, then we just fail. Don't
fail by replacing the cmdq pkt with a bigger one.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Change-Id: I129885f60599d9bd7f432811f777d8165eb556a7
diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c b/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c
index a3e7b55..317ea67 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c
@@ -168,9 +168,17 @@
 	request_size = cmdq->cmd_size;
 	if (unlikely(request_size > handle->buf_size)) {
 		request_size = roundup(request_size, PAGE_SIZE);
-		err = -1;//cmdq_pkt_realloc_cmd_buffer(handle, request_size);
-		if (err < 0)
+
+		handle = cmdq_pkt_create(ctx->mdp_dev->cmdq_client, request_size);
+		if (IS_ERR(handle)) {
+			err = PTR_ERR(handle);
+			dev_err(&ctx->mdp_dev->pdev->dev,
+				"Create cmdq ptk failed %d\n", err);
 			return err;
+		}
+
+		cmdq_pkt_destroy(ctx->cmdq_handle);
+		ctx->cmdq_handle = handle;
 	}
 
 	memcpy(handle->va_base,