From 0e7bd41602ec439e5f0c03f47efe1fffe5500994 Mon Sep 17 00:00:00 2001 From: Ronald Brown Date: Sat, 14 Oct 2023 19:19:50 +0200 Subject: [PATCH 1/4] Input: Udev: Fix touch support building against older kernel headers --- input/drivers/udev_input.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index 865194e8b291..dda2f2430ca9 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -51,6 +51,7 @@ #include #include #include +#include #elif defined(__FreeBSD__) #include #endif @@ -956,8 +957,13 @@ static void udev_handle_mouse(void *data, */ static void udev_touch_event_ts_copy(const struct input_event *event, udev_touch_ts_t *ts) { - ts->s = event->input_event_sec; - ts->us = event->input_event_usec; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0) + ts->s = event->input_event_sec; + ts->us = event->input_event_usec; +#else + ts->s = event->time.tv_sec; + ts->us = event->time.tv_usec; +#endif } /** From fee476592bf194d557fbefc69a195a56319ebd53 Mon Sep 17 00:00:00 2001 From: Ronald Brown Date: Sat, 14 Oct 2023 21:31:45 +0200 Subject: [PATCH 2/4] Input: Udev: Fix Touch Deep Debug compile issues --- input/drivers/udev_input.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index dda2f2430ca9..9b26076224eb 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -120,12 +120,11 @@ /* UDEV_TOUCH_PRINTF_DEBUG */ #ifdef UDEV_TOUCH_DEEP_DEBUG -#define RARCH_DDBG(msg, ...) do{ \ - RARCH_DBG(msg, __VA_ARGS__); \ +#define RARCH_DDBG(...) do{ \ + RARCH_DBG(__VA_ARGS__); \ } while (0) #else -/* TODO - Since C89 doesn't allow variadic macros, we have an empty function instead... */ -void RARCH_DDBG(const char *fmt, ...) { } +#define RARCH_DDBG(msg, ...) #endif /* UDEV_TOUCH_DEEP_DEBUG */ From ffc11c005d8d06fd99d1402e00f2c4732c9b6d57 Mon Sep 17 00:00:00 2001 From: Ronald Brown Date: Tue, 17 Oct 2023 03:29:02 +0200 Subject: [PATCH 3/4] Input: Joypad: Udev: Joypad: Add Change detection for udev events This is handy with controllers like the Nintendo Joycons that have a daemon app in the background to handle combining them into one controller(Joycond) Since the device was already added, but joycond clamped permissions on evdev retroarch was never updating the controller input change, this fixes that issue. Note: Needs a patch in joycond as well, to send change uevent. This shouldnt cause any issues with other controllers, as the kernel probably will never send change events for these device types. --- input/drivers_joypad/udev_joypad.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index f004d904821e..ff4b55dcf037 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -506,6 +506,12 @@ static void udev_joypad_poll(void) /* Hotplug removal */ else if (string_is_equal(action, "remove")) udev_joypad_remove_device(devnode); + /* Device change */ + else if (string_is_equal(action, "change")) + { + udev_joypad_remove_device(devnode); + udev_check_device(dev, devnode); + } } udev_device_unref(dev); From 401bbb0dbc8b740bf6452afbc556f93a73973412 Mon Sep 17 00:00:00 2001 From: Ronald Brown Date: Mon, 23 Oct 2023 04:18:52 +0200 Subject: [PATCH 4/4] Lakka: Add canary builds to updater --- Makefile.common | 4 ++++ file_path_special.h | 4 +++- menu/cbs/menu_cbs_ok.c | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.common b/Makefile.common index 2587d2c28420..8b339f3218e7 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1050,6 +1050,10 @@ ifeq ($(HAVE_LAKKA_NIGHTLY), 1) DEFINES += -DHAVE_LAKKA_NIGHTLY endif +ifneq ($(HAVE_LAKKA_CANARY), "") + DEFINES += -DHAVE_LAKKA_CANARY=\"${HAVE_LAKKA_CANARY}\" +endif + ifeq ($(HAVE_MENU_COMMON), 1) OBJ += menu/menu_setting.o \ menu/menu_driver.o \ diff --git a/file_path_special.h b/file_path_special.h index 844141320e5b..7a35d9692bee 100644 --- a/file_path_special.h +++ b/file_path_special.h @@ -75,7 +75,9 @@ RETRO_BEGIN_DECLS #define FILE_PATH_LOBBY_LIBRETRO_URL "http://lobby.libretro.com/" #define FILE_PATH_CORE_THUMBNAILS_URL "http://thumbnails.libretro.com" #define FILE_PATH_CORE_THUMBNAILPACKS_URL "http://thumbnailpacks.libretro.com" -#ifdef HAVE_LAKKA_NIGHTLY +#ifdef HAVE_LAKKA_CANARY +#define FILE_PATH_LAKKA_URL HAVE_LAKKA_CANARY +#elif HAVE_LAKKA_NIGHTLY #define FILE_PATH_LAKKA_URL "http://nightly.builds.lakka.tv/.updater" #else #define FILE_PATH_LAKKA_URL "http://le.builds.lakka.tv" diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index c847a475cafe..d5033438a550 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -247,6 +247,7 @@ static int (funcname)(const char *path, const char *label, unsigned type, size_t #ifdef HAVE_LAKKA static char *lakka_get_project(void) { +#ifndef HAVE_LAKKA_CANARY size_t len; static char lakka_project[128]; FILE *command_file = popen("cat /etc/release | cut -d - -f 1", "r"); @@ -259,6 +260,9 @@ static char *lakka_get_project(void) pclose(command_file); return lakka_project; +#else + return "/"; +#endif } #endif #endif