From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751818AbcE0Mws (ORCPT ); Fri, 27 May 2016 08:52:48 -0400 Received: from zencphosting06.zen.co.uk ([82.71.204.9]:54993 "EHLO zencphosting06.zen.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727AbcE0Mwq (ORCPT ); Fri, 27 May 2016 08:52:46 -0400 Subject: Re: [PATCH v2 2/8] [media] Add signed 16-bit pixel format To: Hans Verkuil , Dmitry Torokhov References: <1462381638-7818-1-git-send-email-nick.dyer@itdev.co.uk> <1462381638-7818-3-git-send-email-nick.dyer@itdev.co.uk> <57483FD1.9080704@xs4all.nl> 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 From: Nick Dyer Message-ID: <82b68931-0da1-bd26-87c1-1cd9e2296f71@itdev.co.uk> Date: Fri, 27 May 2016 13:52:13 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <57483FD1.9080704@xs4all.nl> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-1.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - zencphosting06.zen.co.uk X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - itdev.co.uk X-Get-Message-Sender-Via: zencphosting06.zen.co.uk: authenticated_id: nick.dyer@itdev.co.uk X-Authenticated-Sender: zencphosting06.zen.co.uk: nick.dyer@itdev.co.uk Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/05/2016 13:38, Hans Verkuil wrote: > On 05/04/2016 07:07 PM, Nick Dyer wrote: >> + 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). > > I'm not sure this should be described in terms of grey-scale, since negative > values make no sense for that. How are these values supposed to be interpreted > if you want to display them? -32768 == black and 32767 is white? We have written a utility to display this data and it is able to display the values mapped to grayscale or color: https://github.com/ndyer/heatmap/blob/master/src/display.c#L44 An example of the output is here: https://www.youtube.com/watch?v=Uj4T6fUCySw The data is intrinsically signed because that's how the low level touch controller treats it. I'm happy to change it to "Signed image" if you think that would be better.