mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Tammo Block <tammo.block@gmail.com>, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v0 1/5] Change/add data structures for SRG mouse reporting
Date: Fri, 26 Jun 2020 12:38:03 +0200	[thread overview]
Message-ID: <96153556-9c04-a570-e8f3-0a6a66222537@kernel.org> (raw)
In-Reply-To: <7e65f1f060c2b9b22a4a051d4afb605913dedf79.1593155911.git.tammo.block@gmail.com>

On 26. 06. 20, 9:22, Tammo Block wrote:
> This extends the data structures and defines needed for additional
> mouse reporting features. If URXVT and UTF8 reports should be supported
> in the future, vc_proto_mouse would need another bit.

Just a global remark: I have just rewritten a large part of the vt code.
You might need to rebase on the top of tty-next...

> Signed-off-by: Tammo Block <tammo.block@gmail.com>
> ---
>  include/linux/console_struct.h |  3 ++-
>  include/uapi/linux/tiocl.h     | 24 ++++++++++++++++--------
>  2 files changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
> index 24d4c16e3ae0..cfb581eb8b82 100644
> --- a/include/linux/console_struct.h
> +++ b/include/linux/console_struct.h
> @@ -122,7 +122,8 @@ struct vc_data {
>  	unsigned int	vc_priv		: 3;
>  	unsigned int	vc_need_wrap	: 1;
>  	unsigned int	vc_can_do_color	: 1;
> -	unsigned int	vc_report_mouse : 2;
> +	unsigned int	vc_report_mouse : 3;
> +	unsigned int	vc_proto_mouse  : 1;

bitfields... The generated code is so bad (it does masks, shifts and
ANDs in assembly), so please avoid them and define the new members the
standard way. I.e. unsigned char if 8 bits are enough, bool for one bit
and so on. The price is larger structure, but we can afford 5 more bits
per virt console, I think. Provided there is a very limited number them
-- this is not "struct page" after all :).

>  	unsigned char	vc_utf		: 1;	/* Unicode UTF-8 encoding */
>  	unsigned char	vc_utf_count;
>  		 int	vc_utf_char;
> diff --git a/include/uapi/linux/tiocl.h b/include/uapi/linux/tiocl.h
> index b32acc229024..df27608648f7 100644
> --- a/include/uapi/linux/tiocl.h
> +++ b/include/uapi/linux/tiocl.h
> @@ -3,13 +3,17 @@
>  #define _LINUX_TIOCL_H
>  
>  #define TIOCL_SETSEL	2	/* set a selection */
> -#define 	TIOCL_SELCHAR	0	/* select characters */
> -#define 	TIOCL_SELWORD	1	/* select whole words */
> -#define 	TIOCL_SELLINE	2	/* select whole lines */
> -#define 	TIOCL_SELPOINTER	3	/* show the pointer */
> -#define 	TIOCL_SELCLEAR	4	/* clear visibility of selection */
> -#define 	TIOCL_SELMOUSEREPORT	16	/* report beginning of selection */
> -#define 	TIOCL_SELBUTTONMASK	15	/* button mask for report */
> +#define		TIOCL_SELCHAR	0	/* select characters */
> +#define		TIOCL_SELWORD	1	/* select whole words */
> +#define		TIOCL_SELLINE	2	/* select whole lines */
> +#define		TIOCL_SELPOINTER	3	/* show the pointer */
> +#define		TIOCL_SELCLEAR	4	/* clear visibility of selection */
> +#define		TIOCL_SELMOUSEREPORT	16	/* send X10 mouse report */
> +#define		TIOCL_SELBUTTONMASK	15	/* button mask for X10 report */
> +#define		TIOCL_SELSRGREPORT	32	/* send SRG mouse report */
> +#define		TIOCL_SELSRGRELEASE	128	/* SRG report is release event */
> +#define		TIOCL_SELSRGMASK	(255 << 8)	/* mask for SRG report */

This right shift of all of them feels like too much right. Why do you do
it? And if you do it, do it in a separate patch. It makes this one
complicated to review.

> @@ -28,7 +32,11 @@ struct tiocl_selection {
>  
>  /* these two don't return a value: they write it back in the type */
>  #define TIOCL_GETSHIFTSTATE	6	/* write shift state */
> -#define TIOCL_GETMOUSEREPORTING	7	/* write whether mouse event are reported */
> +#define TIOCL_GETMOUSEREPORTING	7	/* write which mouse event to be reported */
> +#define		TIOCL_REPORTBTNPRESS	1	/* report button press only    "9" */
> +#define		TIOCL_REPORTRELEASE	2	/* report press and release "1000" */
> +#define		TIOCL_REPORTDRAG	5	/* report drag events       "1002" */
> +#define		TIOCL_REPORTANYMOVE	6	/* report any movement      "1003" */

Dtto.

>  #define TIOCL_SETVESABLANK	10	/* set vesa blanking mode */
>  #define TIOCL_SETKMSGREDIRECT	11	/* restrict kernel messages to a vt */
>  #define TIOCL_GETFGCONSOLE	12	/* get foreground vt */

thanks,
-- 
js

  reply	other threads:[~2020-06-26 10:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  7:21 [PATCH v0 0/5] vt: Add SRG mouse reporting features Tammo Block
2020-06-26  7:22 ` [PATCH v0 1/5] Change/add data structures for SRG mouse reporting Tammo Block
2020-06-26 10:38   ` Jiri Slaby [this message]
2020-06-26  7:22 ` [PATCH v0 2/5] Make it possible to enable/disable " Tammo Block
2020-06-26 10:43   ` Jiri Slaby
2020-06-26  7:22 ` [PATCH v0 3/5] Check for SRG protocol and move bit masking Tammo Block
2020-06-26  7:23 ` [PATCH v0 4/5] Add support for SRG report output format Tammo Block
2020-06-26 10:52   ` Jiri Slaby
2020-06-26  7:23 ` [PATCH v0 5/5] Add Documentation for console mouse reporting Tammo Block
2020-06-26 11:00   ` Jiri Slaby
2020-06-26 17:55   ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96153556-9c04-a570-e8f3-0a6a66222537@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tammo.block@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome