From patchwork Wed Apr 16 12:59:22 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: 4000971 Return-Path: X-Original-To: patchwork-linux-media@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 471D0BFF02 for ; Wed, 16 Apr 2014 12:59:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FDDA20303 for ; Wed, 16 Apr 2014 12:59:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 911D320259 for ; Wed, 16 Apr 2014 12:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756115AbaDPM7e (ORCPT ); Wed, 16 Apr 2014 08:59:34 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:47378 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756055AbaDPM7c (ORCPT ); Wed, 16 Apr 2014 08:59:32 -0400 Received: by mail-pd0-f180.google.com with SMTP id v10so10676115pde.25 for ; Wed, 16 Apr 2014 05:59:31 -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=8LigahY9STc0e269tRNmknD+B5lU9IBXwmcEqIVOoqA=; b=Jjn7EaQx0VKxgt2Cuyy4bT12CD1IWgrqdhDQpoZfdCQXnGTwRoyHVi6KTnCilcmrXu Au/vwxWbObNSrRRtDW4PkYK3rh8FNrp+K/YLilx2WZNXgpOPlbg48ydLM2NEQqgmfDDn gZYfmIuQ1h2PHxQCPjT1wVZGy+0MRaFcO7m76PWYOoq2UJRVarNuf0Bk9Mfr4sMR5jcL Azf5ehs/aIjCzuOmZiRRbpgd/dsVcn4lH6sB3Kj1YhR6XrlyfEObgIunRpz5PkaPPCVP 09oH5TxH3AUK3icY6SKMoebxhKP5vUR3MTuAC/+oyP0zQtxUEbdoElf+S0Obbjl7B1Y4 Kqow== X-Received: by 10.68.137.136 with SMTP id qi8mr8325051pbb.79.1397653171646; Wed, 16 Apr 2014 05:59:31 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id xo9sm109799290pab.18.2014.04.16.05.59.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Apr 2014 05:59:31 -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, posciak@chromium.org, arunkk.samsung@gmail.com Subject: [PATCH 2/2] [media] s5p-mfc: Add support for resolution change event Date: Wed, 16 Apr 2014 18:29:22 +0530 Message-Id: <1397653162-10179-2-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397653162-10179-1-git-send-email-arun.kk@samsung.com> References: <1397653162-10179-1-git-send-email-arun.kk@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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=unavailable 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 | 6 ++++++ drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 4ee5a02..2efa758 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -308,6 +308,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; @@ -339,6 +340,11 @@ 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_RESOLUTION_CHANGE; + 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 4586186..dd0ec6f 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_RESOLUTION_CHANGE: + return v4l2_event_subscribe(fh, sub, 2, NULL); default: return -EINVAL; }