* [PATCH] input/touchscreen/sur40: use COLORSPACE_RAW
@ 2019-06-26 9:52 Hans Verkuil
2019-06-27 8:12 ` Florian Echtler
2019-06-30 7:23 ` Dmitry Torokhov
0 siblings, 2 replies; 5+ messages in thread
From: Hans Verkuil @ 2019-06-26 9:52 UTC (permalink / raw)
To: Linux Media Mailing List, linux-input; +Cc: Florian Echtler, Dmitry Torokhov
This driver set the colorspace to SRGB, but that makes no sense for
a touchscreen. Use RAW instead. This also ensures consistency with the
v4l_pix_format_touch() call that's used in v4l2-ioctl.c.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
Dmitry, do you want to take this, or shall I? I have no preference.
---
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index 00cb1ba2d364..3fd3e862269b 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -186,7 +186,7 @@ static const struct v4l2_pix_format sur40_pix_format[] = {
.width = SENSOR_RES_X / 2,
.height = SENSOR_RES_Y / 2,
.field = V4L2_FIELD_NONE,
- .colorspace = V4L2_COLORSPACE_SRGB,
+ .colorspace = V4L2_COLORSPACE_RAW,
.bytesperline = SENSOR_RES_X / 2,
.sizeimage = (SENSOR_RES_X/2) * (SENSOR_RES_Y/2),
},
@@ -195,7 +195,7 @@ static const struct v4l2_pix_format sur40_pix_format[] = {
.width = SENSOR_RES_X / 2,
.height = SENSOR_RES_Y / 2,
.field = V4L2_FIELD_NONE,
- .colorspace = V4L2_COLORSPACE_SRGB,
+ .colorspace = V4L2_COLORSPACE_RAW,
.bytesperline = SENSOR_RES_X / 2,
.sizeimage = (SENSOR_RES_X/2) * (SENSOR_RES_Y/2),
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] input/touchscreen/sur40: use COLORSPACE_RAW
2019-06-26 9:52 [PATCH] input/touchscreen/sur40: use COLORSPACE_RAW Hans Verkuil
@ 2019-06-27 8:12 ` Florian Echtler
2019-06-27 8:20 ` Hans Verkuil
2019-06-30 7:23 ` Dmitry Torokhov
1 sibling, 1 reply; 5+ messages in thread
From: Florian Echtler @ 2019-06-27 8:12 UTC (permalink / raw)
To: Hans Verkuil, Linux Media Mailing List, linux-input; +Cc: Dmitry Torokhov
[-- Attachment #1.1: Type: text/plain, Size: 446 bytes --]
On 26.06.19 11:52, Hans Verkuil wrote:
> This driver set the colorspace to SRGB, but that makes no sense for
> a touchscreen. Use RAW instead. This also ensures consistency with the
> v4l_pix_format_touch() call that's used in v4l2-ioctl.c.
One question for clarification: this will only affect userspace applications
which explicitly request a certain colorspace, correct?
Best regards, Florian
--
SENT FROM MY DEC VT50 TERMINAL
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] input/touchscreen/sur40: use COLORSPACE_RAW
2019-06-27 8:12 ` Florian Echtler
@ 2019-06-27 8:20 ` Hans Verkuil
2019-06-28 7:17 ` Florian Echtler
0 siblings, 1 reply; 5+ messages in thread
From: Hans Verkuil @ 2019-06-27 8:20 UTC (permalink / raw)
To: Florian Echtler, Linux Media Mailing List, linux-input; +Cc: Dmitry Torokhov
On 6/27/19 10:12 AM, Florian Echtler wrote:
> On 26.06.19 11:52, Hans Verkuil wrote:
>> This driver set the colorspace to SRGB, but that makes no sense for
>> a touchscreen. Use RAW instead. This also ensures consistency with the
>> v4l_pix_format_touch() call that's used in v4l2-ioctl.c.
>
> One question for clarification: this will only affect userspace applications
> which explicitly request a certain colorspace, correct?
You can't request a colorspace from userspace. The driver sets it.
In this case is it inconsistent anyway since VIDIOC_S_FMT will return RAW
(due to the v4l_pix_format_touch() call), but G/TRY_FMT will return SRGB
from the driver. TRY_FMT should return RAW as well, but it didn't call
v4l_pix_format_touch(), for which I posted a separate patch fixing that.
Regards,
Hans
>
> Best regards, Florian
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] input/touchscreen/sur40: use COLORSPACE_RAW
2019-06-27 8:20 ` Hans Verkuil
@ 2019-06-28 7:17 ` Florian Echtler
0 siblings, 0 replies; 5+ messages in thread
From: Florian Echtler @ 2019-06-28 7:17 UTC (permalink / raw)
To: Hans Verkuil, Linux Media Mailing List, linux-input; +Cc: Dmitry Torokhov
[-- Attachment #1.1: Type: text/plain, Size: 1124 bytes --]
On 27.06.19 10:20, Hans Verkuil wrote:
> On 6/27/19 10:12 AM, Florian Echtler wrote:
>> On 26.06.19 11:52, Hans Verkuil wrote:
>>> This driver set the colorspace to SRGB, but that makes no sense for
>>> a touchscreen. Use RAW instead. This also ensures consistency with the
>>> v4l_pix_format_touch() call that's used in v4l2-ioctl.c.
>>
>> One question for clarification: this will only affect userspace applications
>> which explicitly request a certain colorspace, correct?
>
> You can't request a colorspace from userspace. The driver sets it.
What I meant is: ... will only affect applications which explicitly search for
formats with a specific colorspace value.
> In this case is it inconsistent anyway since VIDIOC_S_FMT will return RAW
> (due to the v4l_pix_format_touch() call), but G/TRY_FMT will return SRGB
> from the driver. TRY_FMT should return RAW as well, but it didn't call
> v4l_pix_format_touch(), for which I posted a separate patch fixing that.
OK, understood.
Acked-by: Florian Echtler <floe@butterbrot.org>
Best regards, Florian
--
SENT FROM MY DEC VT50 TERMINAL
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] input/touchscreen/sur40: use COLORSPACE_RAW
2019-06-26 9:52 [PATCH] input/touchscreen/sur40: use COLORSPACE_RAW Hans Verkuil
2019-06-27 8:12 ` Florian Echtler
@ 2019-06-30 7:23 ` Dmitry Torokhov
1 sibling, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2019-06-30 7:23 UTC (permalink / raw)
To: Hans Verkuil; +Cc: Linux Media Mailing List, linux-input, Florian Echtler
On Wed, Jun 26, 2019 at 11:52:16AM +0200, Hans Verkuil wrote:
> This driver set the colorspace to SRGB, but that makes no sense for
> a touchscreen. Use RAW instead. This also ensures consistency with the
> v4l_pix_format_touch() call that's used in v4l2-ioctl.c.
>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> ---
> Dmitry, do you want to take this, or shall I? I have no preference.
Please take it.
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
> index 00cb1ba2d364..3fd3e862269b 100644
> --- a/drivers/input/touchscreen/sur40.c
> +++ b/drivers/input/touchscreen/sur40.c
> @@ -186,7 +186,7 @@ static const struct v4l2_pix_format sur40_pix_format[] = {
> .width = SENSOR_RES_X / 2,
> .height = SENSOR_RES_Y / 2,
> .field = V4L2_FIELD_NONE,
> - .colorspace = V4L2_COLORSPACE_SRGB,
> + .colorspace = V4L2_COLORSPACE_RAW,
> .bytesperline = SENSOR_RES_X / 2,
> .sizeimage = (SENSOR_RES_X/2) * (SENSOR_RES_Y/2),
> },
> @@ -195,7 +195,7 @@ static const struct v4l2_pix_format sur40_pix_format[] = {
> .width = SENSOR_RES_X / 2,
> .height = SENSOR_RES_Y / 2,
> .field = V4L2_FIELD_NONE,
> - .colorspace = V4L2_COLORSPACE_SRGB,
> + .colorspace = V4L2_COLORSPACE_RAW,
> .bytesperline = SENSOR_RES_X / 2,
> .sizeimage = (SENSOR_RES_X/2) * (SENSOR_RES_Y/2),
> }
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-06-30 7:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 9:52 [PATCH] input/touchscreen/sur40: use COLORSPACE_RAW Hans Verkuil
2019-06-27 8:12 ` Florian Echtler
2019-06-27 8:20 ` Hans Verkuil
2019-06-28 7:17 ` Florian Echtler
2019-06-30 7:23 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).