From patchwork Wed Jun 1 16:39:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Dyer X-Patchwork-Id: 9147831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 60BE260751 for ; Wed, 1 Jun 2016 16:45:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51FF624B5B for ; Wed, 1 Jun 2016 16:45:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46AC126B4A; Wed, 1 Jun 2016 16:45:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B025B24B5B for ; Wed, 1 Jun 2016 16:45:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932108AbcFAQkI (ORCPT ); Wed, 1 Jun 2016 12:40:08 -0400 Received: from kdh-gw.itdev.co.uk ([89.21.227.133]:64386 "EHLO hermes.kdh.itdev.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932631AbcFAQkH (ORCPT ); Wed, 1 Jun 2016 12:40:07 -0400 Received: from localhost.localdomain (unknown [80.229.148.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by hermes.kdh.itdev.co.uk (Postfix) with ESMTPSA id BABA18423C; Wed, 1 Jun 2016 17:40:02 +0100 (BST) From: Nick Dyer To: Dmitry Torokhov , Hans Verkuil Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Benjamin Tissoires , Benson Leung , Alan Bowens , Javier Martinez Canillas , Chris Healy , Henrik Rydberg , Andrew Duggan , James Chen , Dudley Du , Andrew de los Reyes , sheckylin@chromium.org, Peter Hutterer , Florian Echtler , mchehab@osg.samsung.com, Nick Dyer Subject: [PATCH v3 2/8] [media] Add signed 16-bit pixel format Date: Wed, 1 Jun 2016 17:39:46 +0100 Message-Id: <1464799192-28034-3-git-send-email-nick.dyer@itdev.co.uk> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1464799192-28034-1-git-send-email-nick.dyer@itdev.co.uk> References: <1464799192-28034-1-git-send-email-nick.dyer@itdev.co.uk> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This will be used for output of raw touch delta data. This format is used by Atmel maXTouch (atmel_mxt_ts) and also Synaptics RMI4. Signed-off-by: Nick Dyer --- Documentation/DocBook/media/v4l/pixfmt-ys16.xml | 79 +++++++++++++++++++++++++ Documentation/DocBook/media/v4l/pixfmt.xml | 1 + drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 4 files changed, 82 insertions(+) create mode 100644 Documentation/DocBook/media/v4l/pixfmt-ys16.xml diff --git a/Documentation/DocBook/media/v4l/pixfmt-ys16.xml b/Documentation/DocBook/media/v4l/pixfmt-ys16.xml new file mode 100644 index 0000000..f92d65e --- /dev/null +++ b/Documentation/DocBook/media/v4l/pixfmt-ys16.xml @@ -0,0 +1,79 @@ + + + V4L2_PIX_FMT_YS16 ('YS16') + &manvol; + + + V4L2_PIX_FMT_YS16 + Grey-scale image + + + Description + + This is a signed grey-scale image with a depth of 16 bits per +pixel. The most significant byte is stored at higher memory addresses +(little-endian). + + + <constant>V4L2_PIX_FMT_YS16</constant> 4 × 4 +pixel image + + + Byte Order. + Each cell is one byte. + + + + + + start + 0: + Y'00low + Y'00high + Y'01low + Y'01high + Y'02low + Y'02high + Y'03low + Y'03high + + + start + 8: + Y'10low + Y'10high + Y'11low + Y'11high + Y'12low + Y'12high + Y'13low + Y'13high + + + start + 16: + Y'20low + Y'20high + Y'21low + Y'21high + Y'22low + Y'22high + Y'23low + Y'23high + + + start + 24: + Y'30low + Y'30high + Y'31low + Y'31high + Y'32low + Y'32high + Y'33low + Y'33high + + + + + + + + + diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml index 5a08aee..f3e3e6d 100644 --- a/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt.xml @@ -1619,6 +1619,7 @@ information. &sub-y12; &sub-y10b; &sub-y16; + &sub-ys16; &sub-y16-be; &sub-y8i; &sub-y12i; diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 28e5be2..ecf7e0b 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1164,6 +1164,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_Y10: descr = "10-bit Greyscale"; break; case V4L2_PIX_FMT_Y12: descr = "12-bit Greyscale"; break; case V4L2_PIX_FMT_Y16: descr = "16-bit Greyscale"; break; + case V4L2_PIX_FMT_YS16: descr = "16-bit Greyscale (Signed)"; break; case V4L2_PIX_FMT_Y16_BE: descr = "16-bit Greyscale BE"; break; case V4L2_PIX_FMT_Y10BPACK: descr = "10-bit Greyscale (Packed)"; break; case V4L2_PIX_FMT_PAL8: descr = "8-bit Palette"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 8f95191..e0125cf 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -493,6 +493,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */ #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ #define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */ +#define V4L2_PIX_FMT_YS16 v4l2_fourcc('Y', 'S', '1', '6') /* signed 16-bit Greyscale */ /* Grey bit-packed formats */ #define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */