[PATCH] dinput: Increase MAX_JOYDEV to 1024.

Roderick Colenbrander thunderbird2k at gmail.com
Tue May 21 23:35:08 CDT 2019


Hi Noor,

Thanks for your patch. Out of curiosity are you encountering a
practical issue with the current limit? It is very hard to really
reach this limit.

If there is a true use case for bumping it, I think other dinput code
should get refactored. From a quick glance "find_joydevs()" naively
tries to open MAX_JOYDEV count files (js0 to js1023). This feels quite
wasteful to do so as most users would have only a handful joystick
nodes or even 0.

Thanks,
Roderick

On Tue, May 21, 2019 at 2:35 PM Noor Schat <creeperlwd at gmail.com> wrote:
>
> As defined in drivers/input/input.c in the linux kernel, the highest number an evdev node can get assigned is 1023.
>
> Signed-off-by: Noor Schat <creeperlwd at gmail.com>
> ---
>  dlls/dinput/joystick_linuxinput.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
> index e4f5db848c..f6b0331f1a 100644
> --- a/dlls/dinput/joystick_linuxinput.c
> +++ b/dlls/dinput/joystick_linuxinput.c
> @@ -179,7 +179,7 @@ static const GUID DInput_Wine_Joystick_Constant_Part_GUID = {
>
>  #define test_bit(arr,bit) (((BYTE*)(arr))[(bit)>>3]&(1<<((bit)&7)))
>
> -#define MAX_JOYDEV 64
> +#define MAX_JOYDEV 1024
>
>  static int have_joydevs = -1;
>  static struct JoyDev *joydevs = NULL;
> --
> 2.21.0
>
>
>



More information about the wine-devel mailing list