mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 00:39:53 +00:00
(DRM/KMS) If we have the X11 input driver selected, default to udev and/or
linuxraw driver instead
This commit is contained in:
parent
96bfb35e0b
commit
3443153ccc
@ -35,7 +35,9 @@
|
|||||||
|
|
||||||
#include <lists/dir_list.h>
|
#include <lists/dir_list.h>
|
||||||
#include <streams/file_stream.h>
|
#include <streams/file_stream.h>
|
||||||
|
#include <string/stdstring.h>
|
||||||
|
|
||||||
|
#include "../../configuration.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../common/drm_common.h"
|
#include "../common/drm_common.h"
|
||||||
@ -732,9 +734,42 @@ static void gfx_ctx_drm_destroy(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_drm_input_driver(void *data,
|
static void gfx_ctx_drm_input_driver(void *data,
|
||||||
const char *name,
|
const char *joypad_name,
|
||||||
const input_driver_t **input, void **input_data)
|
const input_driver_t **input, void **input_data)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_X11
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
/* We cannot use the X11 input driver for DRM/KMS */
|
||||||
|
if (string_is_equal(settings->arrays.input_driver, "x"))
|
||||||
|
{
|
||||||
|
#ifdef HAVE_UDEV
|
||||||
|
{
|
||||||
|
/* Try to set it to udev instead */
|
||||||
|
void *udev = input_udev.init(joypad_name);
|
||||||
|
if (udev)
|
||||||
|
{
|
||||||
|
*input = &input_udev;
|
||||||
|
*input_data = udev;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(__linux__) && !defined(ANDROID)
|
||||||
|
{
|
||||||
|
/* Try to set it to linuxraw instead */
|
||||||
|
void *linuxraw = input_linuxraw.init(joypad_name);
|
||||||
|
if (linuxraw)
|
||||||
|
{
|
||||||
|
*input = &input_linuxraw;
|
||||||
|
*input_data = linuxraw;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
*input = NULL;
|
*input = NULL;
|
||||||
*input_data = NULL;
|
*input_data = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user