From patchwork Mon Apr 21 09:26:01 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: 4023121 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 CAC63BFF02 for ; Mon, 21 Apr 2014 09:26:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7DA1202FE for ; Mon, 21 Apr 2014 09:26:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6A3420254 for ; Mon, 21 Apr 2014 09:26:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751214AbaDUJ0X (ORCPT ); Mon, 21 Apr 2014 05:26:23 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:64702 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbaDUJ0V (ORCPT ); Mon, 21 Apr 2014 05:26:21 -0400 Received: by mail-pa0-f44.google.com with SMTP id bj1so3576434pad.3 for ; Mon, 21 Apr 2014 02:26:20 -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=g50EQy0mSgwRBnxDOCTZbFaASDGOTWbNVMl5YRzws2A=; b=K+ek9MajpNKTgQ5N+rbTrwCIx+lvwkBpYUHkE4b6bQ2iHb36mrWXS5JWWh6FLZTRn8 eDq/rptnw7i9g9dzgmCYfGLc1CaVxZLolN+v6SAxNYFuZCa/t7IJ0FU43lWNGVZgHpTY MI9iqfMpTtnsk/a8rrigU6SD9vpGwSOAHfn1+1y1Gp+f/Qz76IkrFi2RvR7tHQhv205v 4+2g4XLlUmKue2AfkhO6j8G1fabQacxun60aLBbpIZSRFjt9FB0mLAlOmhTF0OIfYKqI ZqC+A3/JmCr+UZA2gVfcKVJzHjANe7JGacLBSDCDrjdqa3XbvAOtSpJaAFpSUeCQCn1d DDlg== X-Received: by 10.68.236.229 with SMTP id ux5mr36750897pbc.98.1398072380485; Mon, 21 Apr 2014 02:26:20 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id qv9sm69825413pbc.71.2014.04.21.02.26.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 02:26:19 -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 1/2] v4l: Add resolution change event. Date: Mon, 21 Apr 2014 14:56:01 +0530 Message-Id: <1398072362-24962-2-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=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 This event indicates that the decoder has reached a point in the stream, at which the resolution changes. The userspace is expected to provide a new set of CAPTURE buffers for the new format before decoding can continue. The event can also be used for more generic events involving resolution or format changes at runtime for all kinds of video devices. Signed-off-by: Pawel Osciak Signed-off-by: Arun Kumar K --- .../DocBook/media/v4l/vidioc-subscribe-event.xml | 16 ++++++++++++++++ include/uapi/linux/videodev2.h | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml index 5c70b61..0aec831 100644 --- a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml +++ b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml @@ -155,6 +155,22 @@ + V4L2_EVENT_SOURCE_CHANGE + 5 + + This event is triggered when a resolution or format change + is detected during runtime by the video device. It can be a + runtime resolution change triggered by a video decoder or the + format change happening on an HDMI connector. Application may + need to reinitialize buffers before proceeding further. + + This event has a &v4l2-event-source-change; associated + with it. This has significance only for v4l2 subdevs where the + pad_num field will be updated with + the pad number on which the event is triggered. + + + V4L2_EVENT_PRIVATE_START 0x08000000 Base event number for driver-private events. diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 6ae7bbe..12e0614 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1733,6 +1733,7 @@ struct v4l2_streamparm { #define V4L2_EVENT_EOS 2 #define V4L2_EVENT_CTRL 3 #define V4L2_EVENT_FRAME_SYNC 4 +#define V4L2_EVENT_SOURCE_CHANGE 5 #define V4L2_EVENT_PRIVATE_START 0x08000000 /* Payload for V4L2_EVENT_VSYNC */ @@ -1764,12 +1765,17 @@ struct v4l2_event_frame_sync { __u32 frame_sequence; }; +struct v4l2_event_source_change { + __u32 pad_num; +}; + struct v4l2_event { __u32 type; union { struct v4l2_event_vsync vsync; struct v4l2_event_ctrl ctrl; struct v4l2_event_frame_sync frame_sync; + struct v4l2_event_source_change source_change; __u8 data[64]; } u; __u32 pending;