diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mxc/vpu_malone/vpu_b0.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mxc/vpu_malone/vpu_b0.c b/drivers/mxc/vpu_malone/vpu_b0.c index 6482a05fca24..7ee3e8a5f570 100644 --- a/drivers/mxc/vpu_malone/vpu_b0.c +++ b/drivers/mxc/vpu_malone/vpu_b0.c @@ -5819,6 +5819,8 @@ static int v4l2_open(struct file *filp) atomic64_set(&ctx->statistic.total_alloc_size, 0); ctx->msg_buffer_size = sizeof(struct event_msg) * VID_API_MESSAGE_LIMIT; + if (!is_power_of_2(ctx->msg_buffer_size)) + ctx->msg_buffer_size = roundup_pow_of_two(ctx->msg_buffer_size); ctx->msg_buffer = vzalloc(ctx->msg_buffer_size); if (!ctx->msg_buffer) { vpu_err("fail to alloc fifo when open\n"); @@ -6348,6 +6350,8 @@ static int vpu_probe(struct platform_device *pdev) dev->mu_msg_buffer_size = sizeof(u_int32) * VPU_MAX_NUM_STREAMS * VID_API_MESSAGE_LIMIT; + if (!is_power_of_2(dev->mu_msg_buffer_size)) + dev->mu_msg_buffer_size = roundup_pow_of_two(dev->mu_msg_buffer_size); dev->mu_msg_buffer = vzalloc(dev->mu_msg_buffer_size); if (!dev->mu_msg_buffer) { vpu_err("error: fail to alloc mu msg fifo\n"); |