lkml.org 
[lkml]   [2000]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] make mousedev resolution module parameter
(Second try, this time with the correct mailing list address. Duh.)

Hi,

This patch makes the X and Y resolution in drivers/input/mousedev.c a
module parameter. In this way the screen resolution can be set by
using:

modprobe mousedev xres=1280 yres=1024

The configure-time resolution is used as a default resolution. The
patch is against 2.4.0-test10-pre3. Please consider applying.

Erik

--
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands
Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
--- linux/drivers/input/mousedev.c.orig Sun Oct 15 16:29:37 2000
+++ linux/drivers/input/mousedev.c Sun Oct 15 16:34:35 2000
@@ -79,6 +79,9 @@
static struct mousedev *mousedev_table[MOUSEDEV_MINORS];
static struct mousedev mousedev_mix;

+static int xres = CONFIG_INPUT_MOUSEDEV_SCREEN_X;
+static int yres = CONFIG_INPUT_MOUSEDEV_SCREEN_Y;
+
static void mousedev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
{
struct mousedev *mousedevs[3] = { handle->private, &mousedev_mix, NULL };
@@ -96,12 +99,12 @@
switch (code) {
case ABS_X:
size = handle->dev->absmax[ABS_X] - handle->dev->absmin[ABS_X];
- list->dx += (value * CONFIG_INPUT_MOUSEDEV_SCREEN_X - list->oldx) / size;
+ list->dx += (value * xres - list->oldx) / size;
list->oldx += list->dx * size;
break;
case ABS_Y:
size = handle->dev->absmax[ABS_Y] - handle->dev->absmin[ABS_Y];
- list->dy -= (value * CONFIG_INPUT_MOUSEDEV_SCREEN_Y - list->oldy) / size;
+ list->dy -= (value * yres - list->oldy) / size;
list->oldy -= list->dy * size;
break;
}
@@ -487,3 +490,7 @@

MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("Input driver to PS/2 or ImPS/2 device driver");
+MODULE_PARM(xres, "i");
+MODULE_PARM_DESC(xres, "Horizontal screen resolution");
+MODULE_PARM(yres, "i");
+MODULE_PARM_DESC(yres, "Vertical screen resolution");
--- linux/drivers/input/Config.in.orig Sun Oct 15 16:56:09 2000
+++ linux/drivers/input/Config.in Sun Oct 15 16:56:36 2000
@@ -10,8 +10,8 @@
dep_tristate ' Keyboard support' CONFIG_INPUT_KEYBDEV $CONFIG_INPUT
dep_tristate ' Mouse support' CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT
if [ "$CONFIG_INPUT_MOUSEDEV" != "n" ]; then
- int ' Horizontal screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024
- int ' Vertical screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_Y 768
+ int ' Default horizontal screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024
+ int ' Default vertical screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_Y 768
fi
dep_tristate ' Joystick support' CONFIG_INPUT_JOYDEV $CONFIG_INPUT
dep_tristate ' Event interface support' CONFIG_INPUT_EVDEV $CONFIG_INPUT
--- linux/Documentation/Configure.help.orig Sun Oct 15 16:53:40 2000
+++ linux/Documentation/Configure.help Sun Oct 15 16:55:48 2000
@@ -10116,19 +10116,23 @@
The module will be called mousedev.o. If you want to compile it as
a module, say M here and read Documentation/modules.txt.

-Horizontal screen resolution
+Default horizontal screen resolution
CONFIG_INPUT_MOUSEDEV_SCREEN_X
If you're using a digitizer, or a graphic tablet, and want to use
it as a mouse then the mousedev driver needs to know the X window
screen resolution you are using to correctly scale the data. If
- you're not using a digitizer, this value is ignored.
+ you're not using a digitizer, this value is ignored. Note that this
+ is only the default resolution, you can change it when loading the
+ module using the parameter "xres=xxx".

-Vertical screen resolution
+Default vertical screen resolution
CONFIG_INPUT_MOUSEDEV_SCREEN_Y
If you're using a digitizer, or a graphic tablet, and want to use
it as a mouse then the mousedev driver needs to know the X window
screen resolution you are using to correctly scale the data. If
- you're not using a digitizer, this value is ignored.
+ you're not using a digitizer, this value is ignored. Note that this
+ is only the default resolution, you can change it when loading the
+ module using the parameter "yres=yyy".

Joystick support
CONFIG_INPUT_JOYDEV
\
 
 \ /
  Last update: 2005-03-22 12:45    [W:0.046 / U:11.444 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site