From patchwork Thu May 8 11:49:16 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: 4135751 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 430C8C0ACC for ; Thu, 8 May 2014 11:49:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6283920251 for ; Thu, 8 May 2014 11:49:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A3B22025B for ; Thu, 8 May 2014 11:49:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753962AbaEHLtg (ORCPT ); Thu, 8 May 2014 07:49:36 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:32898 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753270AbaEHLtf (ORCPT ); Thu, 8 May 2014 07:49:35 -0400 Received: by mail-pd0-f179.google.com with SMTP id g10so2238095pdj.38 for ; Thu, 08 May 2014 04:49:35 -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=3SqKLGOT9sdbDKvc5HTROHTKn731/LoCtlKvFPEG1vE=; b=TA9n3zoQ6Lp55tCcQoK4mE+j803izEwNvkYeolQnIgrs/y2d+NlSR45WwmvYQ2Kj8R /unDzHzBGK7iBT/0gc0RzEkfKHxO7yOsyVHCCALLnxZ3oT3LDYqOPze2UNozAKClADh4 wfLYafS7EujlpomPA7RQ0R3LA6BaIkw+jh7757IR0sop0lqvAUv1pV9Wvc1xW6ClSGTC hi7XYCuK4DOjvBSrbGXSRs8oEBLt9yFY2sJULYMF5eXKWJ0gKgKP770WIVM45h/NvmBk +FApXAa6IyeDG34MhRiCCLHh8nKMDL+DFkYSQtthHzDmMR7oVNq5N3E8n0UN/+kd/vkp oOlA== X-Received: by 10.66.164.201 with SMTP id ys9mr6990470pab.40.1399549775379; Thu, 08 May 2014 04:49:35 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id h5sm1622553pbw.81.2014.05.08.04.49.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 May 2014 04:49:34 -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 v3 2/2] [media] s5p-mfc: Add support for resolution change event Date: Thu, 8 May 2014 17:19:16 +0530 Message-Id: <1399549756-3743-3-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1399549756-3743-1-git-send-email-arun.kk@samsung.com> References: <1399549756-3743-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 07c3d5e..c25a2b0 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; }