From patchwork Mon Apr 21 09:26:02 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: 4023151 Return-Path: X-Original-To: patchwork-linux-media@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 F012A9F387 for ; Mon, 21 Apr 2014 09:26:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E8F1202EB for ; Mon, 21 Apr 2014 09:26:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E43220254 for ; Mon, 21 Apr 2014 09:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751323AbaDUJ01 (ORCPT ); Mon, 21 Apr 2014 05:26:27 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35198 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbaDUJ0Y (ORCPT ); Mon, 21 Apr 2014 05:26:24 -0400 Received: by mail-pa0-f42.google.com with SMTP id fb1so3586172pad.29 for ; Mon, 21 Apr 2014 02:26:24 -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=56TJET0+tkF1TvTYUJZb+p90ND3q/8lI5xxpVvJGlXM=; b=rwUw98c3/t3fHynzCYPdtUAlt2tBFYWqCibpgQfs1yRamWXfwA1gXDBqghXRDq68UF l7cIGNJWFBvMpF4L/WckQPTM9I4KJCtgtIbFHuHKNVJClzCUvPc/v4DBfcNX9++/vtVG glPBVtVwkjBSuxgBag1V+1Mf/oMCOSmE1vX1x8csLbwpkL2tCIMQT/zYbTsumAKjMuIl sp3VBcM9kXXtpNf8TCnNb1p2CSM0wNIA64H5DJbEfH2VXBDyHhzhoEQvlaGgRe5mQ6k2 DLR52HzjSXyeDFZobagGdEJvLI0UvJdoDtc8BwE3vWZMpqKrCg/hYxd8JGNE5YTwl5La hhCw== X-Received: by 10.68.164.130 with SMTP id yq2mr1746633pbb.151.1398072384125; Mon, 21 Apr 2014 02:26:24 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id qv9sm69825413pbc.71.2014.04.21.02.26.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 02:26:23 -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 v2 2/2] [media] s5p-mfc: Add support for resolution change event Date: Mon, 21 Apr 2014 14:56:02 +0530 Message-Id: <1398072362-24962-3-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398072362-24962-1-git-send-email-arun.kk@samsung.com> References: <1398072362-24962-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..5152a23 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_SOURCE_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..069d354 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_event_subscribe(fh, sub, 2, NULL); default: return -EINVAL; }