From patchwork Tue Dec 20 20:27:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 8911 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Rd6IR-00033S-Os; Tue, 20 Dec 2011 21:28:24 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1Rd6IR-0004Wg-GW; Tue, 20 Dec 2011 21:28:23 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752935Ab1LTU2V (ORCPT + 3 others); Tue, 20 Dec 2011 15:28:21 -0500 Received: from smtp.nokia.com ([147.243.128.26]:17022 "EHLO mgw-da02.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752638Ab1LTU2P (ORCPT ); Tue, 20 Dec 2011 15:28:15 -0500 Received: from maxwell.research.nokia.com (maxwell.research.nokia.com [172.21.50.162]) by mgw-da02.nokia.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pBKKSBOs024103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Dec 2011 22:28:12 +0200 Received: from lanttu (unknown [192.168.239.74]) by maxwell.research.nokia.com (Postfix) with ESMTPS id E7ED938663D; Tue, 20 Dec 2011 22:28:10 +0200 (EET) Received: from sakke by lanttu with local (Exim 4.72) (envelope-from ) id 1Rd6IG-0004j4-Q4; Tue, 20 Dec 2011 22:28:12 +0200 From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, dacohen@gmail.com, snjw23@gmail.com Subject: [RFC 07/17] v4l: Add pixelrate to struct v4l2_mbus_framefmt Date: Tue, 20 Dec 2011 22:27:59 +0200 Message-Id: <1324412889-17961-7-git-send-email-sakari.ailus@maxwell.research.nokia.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <4EF0EFC9.6080501@maxwell.research.nokia.com> References: <4EF0EFC9.6080501@maxwell.research.nokia.com> X-Nokia-AV: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.12.20.201815 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_POSSIBLE_EXPLOIT_SUBJ 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -1.9 (-) X-LSpam-Report: No, score=-1.9 required=5.0 tests=BAYES_00=-1.9 autolearn=ham From: Sakari Ailus Pixelrate is an essential part of the image data parameters. Add this. Together, the current parameters also define the frame rate. Sensors do not have a concept of frame rate; pixelrate is much more meaningful in this context. Also, it is best to combine the pixelrate with the other format parameters since there are dependencies between them. Signed-off-by: Sakari Ailus --- Documentation/DocBook/media/v4l/subdev-formats.xml | 10 +++++++++- include/linux/v4l2-mediabus.h | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml index 49c532e..a6a6630 100644 --- a/Documentation/DocBook/media/v4l/subdev-formats.xml +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml @@ -35,7 +35,15 @@ __u32 - reserved[7] + pixelrate + Pixel rate in kp/s. This clock is the maximum rate at + which pixels are transferred on the bus. The + pixelrate field is + read-only. + + + __u32 + reserved[6] Reserved for future extensions. Applications and drivers must set the array to zero. diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h index 5ea7f75..35c6b96 100644 --- a/include/linux/v4l2-mediabus.h +++ b/include/linux/v4l2-mediabus.h @@ -101,6 +101,7 @@ enum v4l2_mbus_pixelcode { * @code: data format code (from enum v4l2_mbus_pixelcode) * @field: used interlacing type (from enum v4l2_field) * @colorspace: colorspace of the data (from enum v4l2_colorspace) + * @pixel_clock: pixel clock, in kHz */ struct v4l2_mbus_framefmt { __u32 width; @@ -108,7 +109,8 @@ struct v4l2_mbus_framefmt { __u32 code; __u32 field; __u32 colorspace; - __u32 reserved[7]; + __u32 pixelrate; + __u32 reserved[6]; }; #endif