summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangyeon Lee <cyeon.lee@samsung.com>2024-08-06 15:24:31 +0900
committerChangyeon Lee <cyeon.lee@samsung.com>2024-08-07 16:35:44 +0900
commita2eb6c3abcda48959cbdb81cb3810c42ed0ac4c7 (patch)
treeace7e8d38d41ae6c4d2d869fb6d85f570df38b9c
parenta89ad9660942635b610a2cf940f4e7f6f13a9105 (diff)
downloadlibtdm-vc4-a2eb6c3abcda48959cbdb81cb3810c42ed0ac4c7.tar.gz
libtdm-vc4-a2eb6c3abcda48959cbdb81cb3810c42ed0ac4c7.tar.bz2
libtdm-vc4-a2eb6c3abcda48959cbdb81cb3810c42ed0ac4c7.zip
Build with hal-rootstrap
Change-Id: I509b53a2533ef1c9def46db88e8d20538020cfe0
-rw-r--r--configure.ac17
-rw-r--r--packaging/hal-backend-tdm-vc4.spec8
-rw-r--r--src/tdm_backend_log.c2
-rw-r--r--src/tdm_backend_vc4.c24
-rw-r--r--src/tdm_backend_vc4.h4
-rw-r--r--src/tdm_backend_vc4_types.h6
-rw-r--r--src/tdm_vc4_display.c5
7 files changed, 5 insertions, 61 deletions
diff --git a/configure.ac b/configure.ac
index e105b33..0d996ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,26 +23,11 @@ LT_INIT([disable-static])
# Enable quiet compiles on automake 1.11.
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-PKG_CHECK_MODULES(LIBHAL_BACKEND_TDM_VC4, hal-api-common hal-api-tdm hal-api-tbm libdrm dlog libtbm)
-
-PKG_CHECK_MODULES(UDEV, libudev, [udev=yes], [udev=no])
-if test x"$udev" = xyes; then
- AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
-
- LIBHAL_BACKEND_TDM_VC4_CFLAGS="$LIBHAL_BACKEND_TDM_VC4_CFLAGS $UDEV_CFLAGS"
- LIBHAL_BACKEND_TDM_VC4_LIBS="$LIBHAL_BACKEND_TDM_VC4_LIBS $UDEV_LIBS"
-fi
+PKG_CHECK_MODULES(LIBHAL_BACKEND_TDM_VC4, hal-rootstrap)
AC_SUBST(LIBHAL_BACKEND_TDM_VC4_CFLAGS)
AC_SUBST(LIBHAL_BACKEND_TDM_VC4_LIBS)
-AC_DEFINE_UNQUOTED(LIBDRM_MAJOR_VERSION, [`pkg-config --modversion libdrm | cut -d '.' -f 1`], dnl
- [libdrm major version])
-AC_DEFINE_UNQUOTED(LIBDRM_MINOR_VERSION, [`pkg-config --modversion libdrm | cut -d '.' -f 2`], dnl
- [libdrm major version])
-AC_DEFINE_UNQUOTED(LIBDRM_MICRO_VERSION, [`pkg-config --modversion libdrm | cut -d '.' -f 3`], dnl
- [libdrm major version])
-
# set the library dir for the tdm hal backend
DEFAULT_HAL_LIBDIR="/hal/lib"
AC_ARG_WITH(hal-libdir, AS_HELP_STRING([--with-hal-libdir=PATH], [hal backend library path]),
diff --git a/packaging/hal-backend-tdm-vc4.spec b/packaging/hal-backend-tdm-vc4.spec
index f61b8ad..72ea1bc 100644
--- a/packaging/hal-backend-tdm-vc4.spec
+++ b/packaging/hal-backend-tdm-vc4.spec
@@ -7,13 +7,7 @@ License: MIT
Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
-BuildRequires: pkgconfig(libdrm)
-BuildRequires: pkgconfig(libudev)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(libtbm)
-BuildRequires: pkgconfig(hal-api-common)
-BuildRequires: pkgconfig(hal-api-tdm)
-BuildRequires: pkgconfig(hal-api-tbm)
+BuildRequires: pkgconfig(hal-rootstrap)
ExclusiveArch: %{arm} aarch64
%description
diff --git a/src/tdm_backend_log.c b/src/tdm_backend_log.c
index 808ceb1..d3ff2c5 100644
--- a/src/tdm_backend_log.c
+++ b/src/tdm_backend_log.c
@@ -53,7 +53,7 @@ _tdm_backend_log_dlog_print(int level, const char *fmt, va_list arg)
default:
return;
}
- __dlog_vprint(LOG_ID_SYSTEM, dlog_prio, LOG_TAG, fmt, arg);
+ dlog_vprint(dlog_prio, LOG_TAG, fmt, arg);
}
void
diff --git a/src/tdm_backend_vc4.c b/src/tdm_backend_vc4.c
index 446388f..469f670 100644
--- a/src/tdm_backend_vc4.c
+++ b/src/tdm_backend_vc4.c
@@ -32,19 +32,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "config.h"
#endif
-#if HAVE_UDEV
#include <libudev.h>
-#endif
-
#include "tdm_backend_vc4.h"
-#if HAVE_UDEV
-#include <libudev.h>
-#endif
-
#define TDM_DRM_NAME "vc4"
-#ifdef HAVE_UDEV
static struct udev_device *
_tdm_find_primary_gpu(void)
{
@@ -183,7 +175,6 @@ _tdm_vc4_destroy_udev_monitor(struct udev_monitor *mon)
TDM_BACKEND_INFO("hotplug monitor destroyed");
}
-#endif
static int
_tdm_vc4_open_drm(void)
@@ -191,10 +182,6 @@ _tdm_vc4_open_drm(void)
int fd = -1;
fd = drmOpen(TDM_DRM_NAME, NULL);
- if (fd < 0)
- TDM_BACKEND_WRN("Cannot open '%s' drm", TDM_DRM_NAME);
-
-#ifdef HAVE_UDEV
if (fd < 0) {
struct udev_device *drm_device = NULL;
const char *filename;
@@ -217,7 +204,6 @@ _tdm_vc4_open_drm(void)
udev_device_unref(drm_device);
}
close_l:
-#endif
return fd;
}
@@ -239,7 +225,6 @@ _tdm_vc4_display_initialize(tdm_vc4_display *display_data)
{
hal_tdm_error ret;
-#if LIBDRM_MAJOR_VERSION >= 2 && LIBDRM_MINOR_VERSION >= 4 && LIBDRM_MICRO_VERSION >= 47
if (drmSetClientCap(display_data->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0) {
TDM_BACKEND_WRN("Set DRM_CLIENT_CAP_UNIVERSAL_PLANES failed");
} else {
@@ -252,7 +237,6 @@ _tdm_vc4_display_initialize(tdm_vc4_display *display_data)
TDM_BACKEND_INFO("has atomic");
display_data->has_atomic = 1;
}
-#endif
display_data->mode_res = drmModeGetResources(display_data->drm_fd);
if (!display_data->mode_res) {
@@ -328,10 +312,8 @@ hal_backend_tdm_vc4_exit(void *data)
_tdm_vc4_display_deinitialize(display_data);
-#ifdef HAVE_UDEV
if (display_data->uevent_monitor)
_tdm_vc4_destroy_udev_monitor(display_data->uevent_monitor);
-#endif
if (display_data->drm_fd >= 0)
close(display_data->drm_fd);
@@ -349,10 +331,8 @@ hal_backend_tdm_vc4_init(void **data)
tdm_vc4_display *display_data = NULL;
hal_tdm_error ret;
int drm_fd;
-#ifdef HAVE_UDEV
static struct udev_monitor *mon;
hal_tdm_event_source *udev_event_source;
-#endif
if (!data) {
TDM_BACKEND_ERR("data is NULL");
@@ -412,7 +392,6 @@ hal_backend_tdm_vc4_init(void **data)
TDM_BACKEND_INFO("A backend requests an master drm_fd.\n");
}
-#ifdef HAVE_UDEV
mon = _tdm_vc4_create_udev_monitor();
if (!mon) {
ret = HAL_TDM_ERROR_OPERATION_FAILED;
@@ -432,7 +411,6 @@ hal_backend_tdm_vc4_init(void **data)
backend_data->event_sources[0] = udev_event_source;
backend_data->num_event_sources++;
-#endif
backend_data->display_funcs->display_get_capability = vc4_display_get_capability;
backend_data->display_funcs->display_get_outputs = vc4_display_get_outputs;
@@ -450,9 +428,7 @@ hal_backend_tdm_vc4_init(void **data)
backend_data->output_funcs->output_get_mode = vc4_output_get_mode;
backend_data->output_funcs->output_set_mirror = vc4_output_set_mirror;
backend_data->output_funcs->output_unset_mirror = vc4_output_unset_mirror;
-#ifdef HAVE_UDEV
backend_data->output_funcs->output_set_status_handler = vc4_output_set_status_handler;
-#endif
backend_data->output_funcs->output_get_hwc = vc4_output_get_hwc;
backend_data->hwc_funcs->hwc_create_window = vc4_hwc_create_window;
diff --git a/src/tdm_backend_vc4.h b/src/tdm_backend_vc4.h
index 75959c8..7fbe3be 100644
--- a/src/tdm_backend_vc4.h
+++ b/src/tdm_backend_vc4.h
@@ -46,16 +46,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
-#if HAVE_UDEV
#include <libudev.h>
-#endif
#include <xf86drm.h>
#include <xf86drmMode.h>
#include <tbm_surface.h>
#include <tbm_surface_internal.h>
#include <tbm_surface_queue.h>
-#include <hal-common.h>
+#include <hal-common-interface.h>
#include <hal-tdm-types.h>
#include <hal-tdm-interface.h>
diff --git a/src/tdm_backend_vc4_types.h b/src/tdm_backend_vc4_types.h
index 535f5b7..4455160 100644
--- a/src/tdm_backend_vc4_types.h
+++ b/src/tdm_backend_vc4_types.h
@@ -53,7 +53,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tbm_surface_internal.h>
#include <tbm_surface_queue.h>
-#include <hal-common.h>
+#include <hal-common-interface.h>
#include <hal-tdm-types.h>
#include <hal-tdm-interface.h>
@@ -116,14 +116,10 @@ typedef enum {
struct _tdm_vc4_display {
int drm_fd;
-#if LIBDRM_MAJOR_VERSION >= 2 && LIBDRM_MINOR_VERSION >= 4 && LIBDRM_MICRO_VERSION >= 47
int has_universal_plane;
int has_atomic;
-#endif
-#if HAVE_UDEV
struct udev_monitor *uevent_monitor;
-#endif
drmModeResPtr mode_res;
drmModePlaneResPtr plane_res;
diff --git a/src/tdm_vc4_display.c b/src/tdm_vc4_display.c
index fe9d70f..4b8eca3 100644
--- a/src/tdm_vc4_display.c
+++ b/src/tdm_vc4_display.c
@@ -534,8 +534,6 @@ _tdm_vc4_display_create_layer_list(tdm_vc4_display *display_data)
return HAL_TDM_ERROR_NONE;
}
-#if LIBDRM_MAJOR_VERSION >= 2 && LIBDRM_MINOR_VERSION >= 4 && LIBDRM_MICRO_VERSION >= 47
-
static hal_tdm_error
_tdm_vc4_display_get_property(tdm_vc4_display *display_data,
unsigned int obj_id, unsigned int obj_type,
@@ -759,7 +757,6 @@ failed_atomic_prop_id:
return HAL_TDM_ERROR_OPERATION_FAILED;
}
-#endif
static int
_get_primary_layer_zpos(tdm_vc4_output *output_data)
@@ -780,11 +777,9 @@ tdm_vc4_display_create_layer_list(tdm_vc4_display *display_data)
tdm_vc4_output *output_data = NULL;
hal_tdm_error ret;
-#if LIBDRM_MAJOR_VERSION >= 2 && LIBDRM_MINOR_VERSION >= 4 && LIBDRM_MICRO_VERSION >= 47
if (display_data->has_universal_plane)
ret = _tdm_vc4_display_create_layer_list_type(display_data);
else
-#endif
ret = _tdm_vc4_display_create_layer_list(display_data);
if (ret != HAL_TDM_ERROR_NONE)