summaryrefslogtreecommitdiff
path: root/drivers/media/platform/vicodec
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna3@gmail.com>2019-03-06 16:13:31 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-03-25 13:44:54 -0400
commitbdbfd992bb9f19817911205cb7173cc6328de2a3 (patch)
tree6161dcfdd69ed22c2bb176976e4ab48e82fe0b77 /drivers/media/platform/vicodec
parent30364c41bd27ff28bc600a5080558b3b11c008ba (diff)
media: vicodec: add field 'buf' to fwht_raw_frame
Add the field 'buf' to fwht_raw_frame to indicate the start of the raw frame buffer. This field will be used to copy the capture buffer to the reference buffer in the next patch. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/vicodec')
-rw-r--r--drivers/media/platform/vicodec/codec-fwht.h1
-rw-r--r--drivers/media/platform/vicodec/vicodec-core.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/platform/vicodec/codec-fwht.h b/drivers/media/platform/vicodec/codec-fwht.h
index c410512d47c5..8f0b790839f8 100644
--- a/drivers/media/platform/vicodec/codec-fwht.h
+++ b/drivers/media/platform/vicodec/codec-fwht.h
@@ -124,6 +124,7 @@ struct fwht_raw_frame {
unsigned int luma_alpha_step;
unsigned int chroma_step;
unsigned int components_num;
+ u8 *buf;
u8 *luma, *cb, *cr, *alpha;
};
diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c
index 41e09b558a88..467352d71674 100644
--- a/drivers/media/platform/vicodec/vicodec-core.c
+++ b/drivers/media/platform/vicodec/vicodec-core.c
@@ -1366,7 +1366,8 @@ static int vicodec_start_streaming(struct vb2_queue *q,
state->stride = q_data->coded_width *
info->bytesperline_mult;
- state->ref_frame.luma = kvmalloc(total_planes_size, GFP_KERNEL);
+ state->ref_frame.buf = kvmalloc(total_planes_size, GFP_KERNEL);
+ state->ref_frame.luma = state->ref_frame.buf;
ctx->comp_max_size = total_planes_size;
new_comp_frame = kvmalloc(ctx->comp_max_size, GFP_KERNEL);
@@ -1415,7 +1416,9 @@ static void vicodec_stop_streaming(struct vb2_queue *q)
if ((!V4L2_TYPE_IS_OUTPUT(q->type) && !ctx->is_enc) ||
(V4L2_TYPE_IS_OUTPUT(q->type) && ctx->is_enc)) {
- kvfree(ctx->state.ref_frame.luma);
+ kvfree(ctx->state.ref_frame.buf);
+ ctx->state.ref_frame.buf = NULL;
+ ctx->state.ref_frame.luma = NULL;
ctx->comp_max_size = 0;
ctx->source_changed = false;
}