aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPawel Osciak <posciak@chromium.org>2014-05-14 02:59:43 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-05-23 18:51:10 -0400
commit0520e4cc3bb9ddc6eb7cc45d01191deee035b22a (patch)
tree67444127f9e84f030544ced53ba31345fece1a74 /drivers
parent3cbe6e5bcad0b102c06b9c6029fda75630045475 (diff)
[media] s5p-mfc: Add support for resolution change event
When a resolution change point is reached, queue an event to signal the userspace that a new set of buffers is required before decoding can continue. Signed-off-by: Pawel Osciak <posciak@chromium.org> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc.c8
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_dec.c2
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index d5f634d0ba05..41723180d10c 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -342,8 +342,16 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx,
342 /* All frames remaining in the buffer have been extracted */ 342 /* All frames remaining in the buffer have been extracted */
343 if (dst_frame_status == S5P_FIMV_DEC_STATUS_DECODING_EMPTY) { 343 if (dst_frame_status == S5P_FIMV_DEC_STATUS_DECODING_EMPTY) {
344 if (ctx->state == MFCINST_RES_CHANGE_FLUSH) { 344 if (ctx->state == MFCINST_RES_CHANGE_FLUSH) {
345 static const struct v4l2_event ev_src_ch = {
346 .type = V4L2_EVENT_SOURCE_CHANGE,
347 .u.src_change.changes =
348 V4L2_EVENT_SRC_CH_RESOLUTION,
349 };
350
345 s5p_mfc_handle_frame_all_extracted(ctx); 351 s5p_mfc_handle_frame_all_extracted(ctx);
346 ctx->state = MFCINST_RES_CHANGE_END; 352 ctx->state = MFCINST_RES_CHANGE_END;
353 v4l2_event_queue_fh(&ctx->fh, &ev_src_ch);
354
347 goto leave_handle_frame; 355 goto leave_handle_frame;
348 } else { 356 } else {
349 s5p_mfc_handle_frame_all_extracted(ctx); 357 s5p_mfc_handle_frame_all_extracted(ctx);
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index 6a8697e9ba23..4d93835dec9d 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -867,6 +867,8 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh,
867 switch (sub->type) { 867 switch (sub->type) {
868 case V4L2_EVENT_EOS: 868 case V4L2_EVENT_EOS:
869 return v4l2_event_subscribe(fh, sub, 2, NULL); 869 return v4l2_event_subscribe(fh, sub, 2, NULL);
870 case V4L2_EVENT_SOURCE_CHANGE:
871 return v4l2_src_change_event_subscribe(fh, sub);
870 default: 872 default:
871 return -EINVAL; 873 return -EINVAL;
872 } 874 }