virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio_input: Initialize multi-touch slots on ABS_MT_SLOT
@ 2020-01-02 19:12 Rudolf Streif
  2020-04-15  0:24 ` Rudolf Streif
  0 siblings, 1 reply; 3+ messages in thread
From: Rudolf Streif @ 2020-01-02 19:12 UTC (permalink / raw)
  To: kraxel@redhat.com; +Cc: virtualization@lists.linux-foundation.org


[-- Attachment #1.1: Type: text/plain, Size: 1955 bytes --]

For multi-touch devices the frontend needs to initialize the correct
number of slots for touch tracking. Hardware drivers do this by
calling input_mt_init_slots() on initialization. For virtio_input
the function must be called when the backend sends ABS_MT_SLOT.

Signed-off-by: Rudolf J Streif <rstreif@blackberry.com>
---
 drivers/virtio/virtio_input.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c
index 5ae529671b3d..582ba808b955 100644
--- a/drivers/virtio/virtio_input.c
+++ b/drivers/virtio/virtio_input.c
@@ -3,6 +3,7 @@
 #include <linux/virtio.h>
 #include <linux/virtio_config.h>
 #include <linux/input.h>
+#include <linux/input/mt.h>

 #include <uapi/linux/virtio_ids.h>
 #include <uapi/linux/virtio_input.h>
@@ -164,6 +165,9 @@ static void virtinput_cfg_abs(struct virtio_input *vi, int abs)
        virtio_cread(vi->vdev, struct virtio_input_config, u.abs.flat, &fl);
        input_set_abs_params(vi->idev, abs, mi, ma, fu, fl);
        input_abs_set_res(vi->idev, abs, re);
+
+       if (abs == ABS_MT_SLOT)
+               input_mt_init_slots(vi->idev, ma + 1, INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
 }

 static int virtinput_init_vqs(struct virtio_input *vi)
--
2.17.1


----------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

[-- Attachment #1.2: Type: text/html, Size: 2799 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio_input: Initialize multi-touch slots on ABS_MT_SLOT
  2020-01-02 19:12 [PATCH] virtio_input: Initialize multi-touch slots on ABS_MT_SLOT Rudolf Streif
@ 2020-04-15  0:24 ` Rudolf Streif
  2020-04-28 10:13   ` kraxel
  0 siblings, 1 reply; 3+ messages in thread
From: Rudolf Streif @ 2020-04-15  0:24 UTC (permalink / raw)
  To: kraxel@redhat.com, mst@redhat.com,
	virtualization@lists.linux-foundation.org


[-- Attachment #1.1: Type: text/plain, Size: 2957 bytes --]

Resubmit. Thank you.


________________________________
From: Virtualization <virtualization-bounces@lists.linux-foundation.org> on behalf of Rudolf Streif <rstreif@blackberry.com>
Sent: Thursday, January 2, 2020 11:12 AM
To: kraxel@redhat.com
Cc: virtualization@lists.linux-foundation.org
Subject: [PATCH] virtio_input: Initialize multi-touch slots on ABS_MT_SLOT


For multi-touch devices the frontend needs to initialize the correct
number of slots for touch tracking. Hardware drivers do this by
calling input_mt_init_slots() on initialization. For virtio_input
the function must be called when the backend sends ABS_MT_SLOT.

Signed-off-by: Rudolf J Streif <rstreif@blackberry.com>
---
 drivers/virtio/virtio_input.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c
index 5ae529671b3d..582ba808b955 100644
--- a/drivers/virtio/virtio_input.c
+++ b/drivers/virtio/virtio_input.c
@@ -3,6 +3,7 @@
 #include <linux/virtio.h>
 #include <linux/virtio_config.h>
 #include <linux/input.h>
+#include <linux/input/mt.h>

 #include <uapi/linux/virtio_ids.h>
 #include <uapi/linux/virtio_input.h>
@@ -164,6 +165,9 @@ static void virtinput_cfg_abs(struct virtio_input *vi, int abs)
        virtio_cread(vi->vdev, struct virtio_input_config, u.abs.flat, &fl);
        input_set_abs_params(vi->idev, abs, mi, ma, fu, fl);
        input_abs_set_res(vi->idev, abs, re);
+
+       if (abs == ABS_MT_SLOT)
+               input_mt_init_slots(vi->idev, ma + 1, INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
 }

 static int virtinput_init_vqs(struct virtio_input *vi)
--
2.17.1



________________________________
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

----------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

[-- Attachment #1.2: Type: text/html, Size: 4538 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio_input: Initialize multi-touch slots on ABS_MT_SLOT
  2020-04-15  0:24 ` Rudolf Streif
@ 2020-04-28 10:13   ` kraxel
  0 siblings, 0 replies; 3+ messages in thread
From: kraxel @ 2020-04-28 10:13 UTC (permalink / raw)
  To: Rudolf Streif; +Cc: virtualization@lists.linux-foundation.org, mst@redhat.com

On Wed, Apr 15, 2020 at 12:24:12AM +0000, Rudolf Streif wrote:
> Resubmit. Thank you.

Better re-send with "git send-email" as new message.
As reply in an existing thread it gets lost easily.

> ________________________________
> From: Virtualization <virtualization-bounces@lists.linux-foundation.org> on behalf of Rudolf Streif <rstreif@blackberry.com>
> Sent: Thursday, January 2, 2020 11:12 AM
> To: kraxel@redhat.com
> Cc: virtualization@lists.linux-foundation.org
> Subject: [PATCH] virtio_input: Initialize multi-touch slots on ABS_MT_SLOT
> 
> 
> For multi-touch devices the frontend needs to initialize the correct
> number of slots for touch tracking. Hardware drivers do this by
> calling input_mt_init_slots() on initialization. For virtio_input
> the function must be called when the backend sends ABS_MT_SLOT.
> 
> Signed-off-by: Rudolf J Streif <rstreif@blackberry.com>
> ---
>  drivers/virtio/virtio_input.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c
> index 5ae529671b3d..582ba808b955 100644
> --- a/drivers/virtio/virtio_input.c
> +++ b/drivers/virtio/virtio_input.c
> @@ -3,6 +3,7 @@
>  #include <linux/virtio.h>
>  #include <linux/virtio_config.h>
>  #include <linux/input.h>
> +#include <linux/input/mt.h>
> 
>  #include <uapi/linux/virtio_ids.h>
>  #include <uapi/linux/virtio_input.h>
> @@ -164,6 +165,9 @@ static void virtinput_cfg_abs(struct virtio_input *vi, int abs)
>         virtio_cread(vi->vdev, struct virtio_input_config, u.abs.flat, &fl);
>         input_set_abs_params(vi->idev, abs, mi, ma, fu, fl);
>         input_abs_set_res(vi->idev, abs, re);
> +
> +       if (abs == ABS_MT_SLOT)
> +               input_mt_init_slots(vi->idev, ma + 1, INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>

mst, can you pick it up?

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-28 10:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-02 19:12 [PATCH] virtio_input: Initialize multi-touch slots on ABS_MT_SLOT Rudolf Streif
2020-04-15  0:24 ` Rudolf Streif
2020-04-28 10:13   ` kraxel

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).