2022-05-21 11:02:23 +00:00
|
|
|
/**
|
|
|
|
|
* Copyright 2022 Eugenio Paolantonio (g7)
|
2024-01-12 09:51:43 +01:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2022-05-21 11:02:23 +00:00
|
|
|
*/
|
|
|
|
|
|
2024-01-25 09:59:45 +00:00
|
|
|
|
2022-05-21 11:02:23 +00:00
|
|
|
#include "backends.h"
|
|
|
|
|
|
2024-03-28 13:44:33 +01:00
|
|
|
#include "../shared/log.h"
|
|
|
|
|
|
2022-05-21 11:02:23 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
|
2024-03-28 13:44:33 +01:00
|
|
|
|
2022-05-21 11:02:23 +00:00
|
|
|
/**
|
|
|
|
|
* Public interface
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const char *ul_backends_backends[] = {
|
2024-01-25 09:59:45 +00:00
|
|
|
#if LV_USE_LINUX_FBDEV
|
2022-05-21 11:02:23 +00:00
|
|
|
"fbdev",
|
2024-01-25 09:59:45 +00:00
|
|
|
#endif /* LV_USE_LINUX_FBDEV */
|
|
|
|
|
#if LV_USE_LINUX_DRM
|
2022-05-21 11:02:23 +00:00
|
|
|
"drm",
|
2024-01-25 09:59:45 +00:00
|
|
|
#endif /* LV_USE_LINUX_DRM */
|
2022-05-21 11:02:23 +00:00
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ul_backends_backend_id_t ul_backends_find_backend_with_name(const char *name) {
|
|
|
|
|
for (int i = 0; ul_backends_backends[i] != NULL; ++i) {
|
|
|
|
|
if (strcmp(ul_backends_backends[i], name) == 0) {
|
2024-03-28 13:44:33 +01:00
|
|
|
bb_log(BB_LOG_LEVEL_VERBOSE, "Found backend: %s\n", name);
|
2022-05-21 11:02:23 +00:00
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-28 13:44:33 +01:00
|
|
|
bb_log(BB_LOG_LEVEL_WARNING, "Backend %s not found\n", name);
|
2022-05-21 11:02:23 +00:00
|
|
|
return UL_BACKENDS_BACKEND_NONE;
|
|
|
|
|
}
|