From patchwork Tue May 13 05:59:03 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: 4162341 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C93F39F387 for ; Tue, 13 May 2014 05:59:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F32B920328 for ; Tue, 13 May 2014 05:59:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3074D2034C for ; Tue, 13 May 2014 05:59:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751507AbaEMF7W (ORCPT ); Tue, 13 May 2014 01:59:22 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:48037 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbaEMF7V (ORCPT ); Tue, 13 May 2014 01:59:21 -0400 Received: by mail-pa0-f48.google.com with SMTP id rd3so9802005pab.35 for ; Mon, 12 May 2014 22:59:21 -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=2apy5hqazaLMSazr+6KynfwZLijXs3/1Cpdr29qpslg=; b=mKqCS3F/2duEWQfni/VXKMRHs1hK0TudHsmfXR6Y/qVA2UQ1L64YwxP7O5quwUlahW MrHGQpUWBlCt7nIHj21fio6GZpeZyNfiiHFEDLg4vjrCkHGou0ecKfYiND1EOVOkPqCQ 8P1Iv0E5lVeApY/kgZCCwds50aMqck1u2oEEMt8uvTOEnHkcnNuiwJqRtfYUtDQ1KupA 887iR3sqST7QILphcSBmXP6NSWt5PI0Dja9aHoFr//Etzt622f+g1ig14XwIJBU4njaL hzZSRUPzkKhDhsPJpz4W1dhlBeyWnTUanmJ+imdWGGzkjvNEbEdTrDX9M1+zKSBa35Pp X+fA== X-Received: by 10.68.224.198 with SMTP id re6mr2903987pbc.8.1399960761003; Mon, 12 May 2014 22:59:21 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id ek2sm26139959pbd.30.2014.05.12.22.59.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 22:59:20 -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 v4 2/2] [media] s5p-mfc: Add support for resolution change event Date: Tue, 13 May 2014 11:29:03 +0530 Message-Id: <1399960743-4542-3-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1399960743-4542-1-git-send-email-arun.kk@samsung.com> References: <1399960743-4542-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 --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 7 +++++++ drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 54f7ba1..2d7d1ae 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -320,6 +320,7 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *src_buf; unsigned long flags; unsigned int res_change; + struct v4l2_event ev; dst_frame_status = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_status, dev) & S5P_FIMV_DEC_STATUS_DECODING_STATUS_MASK; @@ -351,6 +352,12 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, if (ctx->state == MFCINST_RES_CHANGE_FLUSH) { s5p_mfc_handle_frame_all_extracted(ctx); ctx->state = MFCINST_RES_CHANGE_END; + + memset(&ev, 0, sizeof(struct v4l2_event)); + ev.type = V4L2_EVENT_SOURCE_CHANGE; + ev.u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION; + v4l2_event_queue_fh(&ctx->fh, &ev); + 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 4f94491..b383829 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -855,6 +855,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; }