From patchwork Wed May 14 06:59:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar K X-Patchwork-Id: 4173121 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 75979BFF02 for ; Wed, 14 May 2014 07:00:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F33220374 for ; Wed, 14 May 2014 07:00:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BDEBF20373 for ; Wed, 14 May 2014 07:00:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbaENHAA (ORCPT ); Wed, 14 May 2014 03:00:00 -0400 Received: from mail-pb0-f53.google.com ([209.85.160.53]:55849 "EHLO mail-pb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbaENG77 (ORCPT ); Wed, 14 May 2014 02:59:59 -0400 Received: by mail-pb0-f53.google.com with SMTP id md12so1318359pbc.12 for ; Tue, 13 May 2014 23:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=j4NyBUpnqAMGWWw/z2wS00b4E9G8sBXUFt3CXoExQAc=; b=TSryuAAXZLVF+Z3pivv+bUz/Gsjk/ZWywn6id3QYpLGqwHZ7QJSo2sUpyCJ1K3cnBt tjNQrjbyX1FmhxY0MNHIHW6dT+hgNM6353N4JUMUmSc1KGKKr8BVG8tVQi4mMb3EV06Q scy2xHofPMEMvHpjosoS8B1D5rAsw6y8zPjAtNNf+MJ70DeYwcsDgILkYFT+wPY/mJUt 7cipLh18G0Ik3m8uAssQomBvZ/axYXv0IXySpA+Wa9BF6hT1arhH2HfvRGlSwSfkhoco HoYJBVdtDx04dIh3xCdNWyqr2tY05prZORWzvLrKOM8gXK6s3x5DliamwBWS8yUCK4Gi EdvQ== X-Received: by 10.66.119.136 with SMTP id ku8mr2101247pab.121.1400050798632; Tue, 13 May 2014 23:59:58 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id bq4sm1668351pbb.60.2014.05.13.23.59.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 23:59:57 -0700 (PDT) From: Arun Kumar K To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: k.debski@samsung.com, s.nawrocki@samsung.com, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, posciak@chromium.org, arunkk.samsung@gmail.com Subject: [PATCH v5 2/2] [media] s5p-mfc: Add support for resolution change event Date: Wed, 14 May 2014 12:29:43 +0530 Message-Id: <1400050783-2158-3-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400050783-2158-1-git-send-email-arun.kk@samsung.com> References: <1400050783-2158-1-git-send-email-arun.kk@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Pawel Osciak 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 Signed-off-by: Arun Kumar K Acked-by: Sylwester Nawrocki Acked-by: Kamil Debski --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 8 ++++++++ drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 6b04f17..f3a4576 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -349,8 +349,16 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, /* All frames remaining in the buffer have been extracted */ if (dst_frame_status == S5P_FIMV_DEC_STATUS_DECODING_EMPTY) { if (ctx->state == MFCINST_RES_CHANGE_FLUSH) { + static const struct v4l2_event ev_src_ch = { + .type = V4L2_EVENT_SOURCE_CHANGE, + .u.src_change.changes = + V4L2_EVENT_SRC_CH_RESOLUTION, + }; + s5p_mfc_handle_frame_all_extracted(ctx); ctx->state = MFCINST_RES_CHANGE_END; + v4l2_event_queue_fh(&ctx->fh, &ev_src_ch); + goto leave_handle_frame; } else { 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 4586186..326d8db 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -851,6 +851,8 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh, switch (sub->type) { case V4L2_EVENT_EOS: return v4l2_event_subscribe(fh, sub, 2, NULL); + case V4L2_EVENT_SOURCE_CHANGE: + return v4l2_src_change_event_subscribe(fh, sub); default: return -EINVAL; }