From: Stephen Rothwell Date: Mon, 10 Dec 2018 00:57:50 +0000 (+1100) Subject: Merge remote-tracking branch 'v4l-dvb/master' X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5ccbff545c77bbb8f1af601b4089cf6e740af63c;p=users%2Fwilly%2Flinux.git Merge remote-tracking branch 'v4l-dvb/master' --- 5ccbff545c77bbb8f1af601b4089cf6e740af63c diff --cc drivers/media/platform/vicodec/vicodec-core.c index 13fb69c58967,2b7daff63425..0d7876f5acf0 --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@@ -997,23 -1006,14 +1006,21 @@@ static int vicodec_start_streaming(stru q_data->sequence = 0; - if (!V4L2_TYPE_IS_OUTPUT(q->type)) + if (!V4L2_TYPE_IS_OUTPUT(q->type)) { + if (!ctx->is_enc) { + state->width = q_data->width; + state->height = q_data->height; + } return 0; + } - state->width = q_data->width; - state->height = q_data->height; + if (ctx->is_enc) { + state->width = q_data->width; + state->height = q_data->height; + } state->ref_frame.width = state->ref_frame.height = 0; - state->ref_frame.luma = kvmalloc(size + 2 * size / chroma_div, - GFP_KERNEL); - ctx->comp_max_size = size + 2 * size / chroma_div + - sizeof(struct fwht_cframe_hdr); + state->ref_frame.luma = kvmalloc(total_planes_size, GFP_KERNEL); + ctx->comp_max_size = total_planes_size + sizeof(struct fwht_cframe_hdr); state->compressed_frame = kvmalloc(ctx->comp_max_size, GFP_KERNEL); if (!state->ref_frame.luma || !state->compressed_frame) { kvfree(state->ref_frame.luma);