summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangyeon Lee <cyeon.lee@samsung.com>2024-08-07 19:58:30 +0900
committerChangyeon Lee <cyeon.lee@samsung.com>2024-08-08 17:34:14 +0900
commit3553a72830de76db923bb5635365c8946e3d9887 (patch)
tree076582ab0b364527b9519bf3ca91538667e9a3a1
parent77c020dbe7b41195a00378e183a20e942e1d54b5 (diff)
downloadlibtdm-drm-3553a72830de76db923bb5635365c8946e3d9887.tar.gz
libtdm-drm-3553a72830de76db923bb5635365c8946e3d9887.tar.bz2
libtdm-drm-3553a72830de76db923bb5635365c8946e3d9887.zip
Build with hal-rootstrap
Change-Id: I09d42bd56d2f8205767f5a9193e860b1c3799021
-rw-r--r--configure.ac18
-rw-r--r--packaging/hal-backend-tdm-drm.spec9
-rw-r--r--src/tdm_backend_drm.c18
-rw-r--r--src/tdm_backend_drm_types.h8
-rw-r--r--src/tdm_backend_log.c2
-rw-r--r--src/tdm_drm_display.c5
6 files changed, 5 insertions, 55 deletions
diff --git a/configure.ac b/configure.ac
index 5842ed7..996f07c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,27 +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(UDEV, libudev, [udev=yes], [udev=no])
-
-PKG_CHECK_MODULES(LIBHAL_BACKEND_TDM_DRM, hal-api-common hal-api-tdm hal-api-tbm libtbm libdrm dlog pixman-1)
-
-if test x"$udev" = xyes; then
- AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
-
- LIBHAL_BACKEND_TDM_DRM_CFLAGS="$LIBHAL_BACKEND_TDM_DRM_CFLAGS $UDEV_CFLAGS"
- LIBHAL_BACKEND_TDM_DRM_LIBS="$LIBHAL_BACKEND_TDM_DRM_LIBS $UDEV_LIBS"
-fi
+PKG_CHECK_MODULES(LIBHAL_BACKEND_TDM_DRM, hal-rootstrap)
AC_SUBST(LIBHAL_BACKEND_TDM_DRM_CFLAGS)
AC_SUBST(LIBHAL_BACKEND_TDM_DRM_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-drm.spec b/packaging/hal-backend-tdm-drm.spec
index bd18bf5..1fc1f70 100644
--- a/packaging/hal-backend-tdm-drm.spec
+++ b/packaging/hal-backend-tdm-drm.spec
@@ -7,14 +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(pixman-1)
+BuildRequires: pkgconfig(hal-rootstrap)
%description
description: hal tdm backend module for drm
diff --git a/src/tdm_backend_drm.c b/src/tdm_backend_drm.c
index 4652b5d..cc2ae78 100644
--- a/src/tdm_backend_drm.c
+++ b/src/tdm_backend_drm.c
@@ -33,16 +33,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#include "tdm_backend_drm.h"
-
-#if HAVE_UDEV
#include <libudev.h>
-#endif
#define ENABLE_PP
#define TDM_DRM_NAME "vigs"
-#ifdef HAVE_UDEV
static int
_tdm_drm_is_kms(struct udev_device *device)
{
@@ -253,7 +249,6 @@ _tdm_drm_destroy_udev_monitor(struct udev_monitor *mon)
TDM_BACKEND_INFO("hotplug monitor destroyed");
}
-#endif
static int
_tdm_drm_open_drm(void)
@@ -264,7 +259,6 @@ _tdm_drm_open_drm(void)
if (fd < 0)
TDM_BACKEND_WRN("fail to open '%s' drm", TDM_DRM_NAME);
-#ifdef HAVE_UDEV
struct udev_device *drm_device = NULL;
const char *file_name;
@@ -293,7 +287,7 @@ _tdm_drm_open_drm(void)
}
ret:
if (drm_device) udev_device_unref(drm_device);
-#endif
+
return fd;
}
@@ -315,14 +309,12 @@ _tdm_drm_display_initialize(tdm_drm_display *display_data)
char *errno_msg;
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 {
TDM_BACKEND_INFO("has universal planes");
display_data->has_universal_plane = 1;
}
-#endif
display_data->mode_res = drmModeGetResources(display_data->drm_fd);
if (!display_data->mode_res) {
@@ -399,10 +391,8 @@ hal_backend_tdm_drm_exit(void *data)
_tdm_drm_display_deinitialize(display_data);
-#ifdef HAVE_UDEV
if (display_data->uevent_monitor)
_tdm_drm_destroy_udev_monitor(display_data->uevent_monitor);
-#endif
if (display_data->drm_fd >= 0)
close(display_data->drm_fd);
@@ -420,10 +410,8 @@ hal_backend_tdm_drm_init(void **data)
tdm_drm_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");
@@ -483,7 +471,6 @@ hal_backend_tdm_drm_init(void **data)
TDM_BACKEND_INFO("A backend requests an master drm_fd.\n");
}
-#ifdef HAVE_UDEV
mon = _tdm_drm_create_udev_monitor();
if (!mon) {
ret = HAL_TDM_ERROR_OPERATION_FAILED;
@@ -503,7 +490,6 @@ hal_backend_tdm_drm_init(void **data)
backend_data->event_sources[0] = udev_event_source;
backend_data->num_event_sources++;
-#endif
backend_data->display_funcs->display_get_capability = drm_display_get_capability;
backend_data->display_funcs->display_get_pp_capability = drm_display_get_pp_capability;
@@ -521,9 +507,7 @@ hal_backend_tdm_drm_init(void **data)
backend_data->output_funcs->output_get_dpms = drm_output_get_dpms;
backend_data->output_funcs->output_set_mode = drm_output_set_mode;
backend_data->output_funcs->output_get_mode = drm_output_get_mode;
-#ifdef HAVE_UDEV
backend_data->output_funcs->output_set_status_handler = drm_output_set_status_handler;
-#endif
backend_data->output_funcs->output_get_hwc = drm_output_get_hwc;
backend_data->hwc_funcs->hwc_create_window = drm_hwc_create_window;
diff --git a/src/tdm_backend_drm_types.h b/src/tdm_backend_drm_types.h
index 356d8ec..51f94b4 100644
--- a/src/tdm_backend_drm_types.h
+++ b/src/tdm_backend_drm_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>
#include <pixman.h>
@@ -145,14 +145,8 @@ typedef enum {
struct _tdm_drm_display {
int drm_fd;
-
-#if LIBDRM_MAJOR_VERSION >= 2 && LIBDRM_MINOR_VERSION >= 4 && LIBDRM_MICRO_VERSION >= 47
int has_universal_plane;
-#endif
-
-#if HAVE_UDEV
struct udev_monitor *uevent_monitor;
-#endif
drmModeResPtr mode_res;
drmModePlaneResPtr plane_res;
diff --git a/src/tdm_backend_log.c b/src/tdm_backend_log.c
index 662ad42..da3d789 100644
--- a/src/tdm_backend_log.c
+++ b/src/tdm_backend_log.c
@@ -56,7 +56,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_drm_display.c b/src/tdm_drm_display.c
index ea403b0..407620e 100644
--- a/src/tdm_drm_display.c
+++ b/src/tdm_drm_display.c
@@ -415,8 +415,6 @@ _tdm_drm_display_create_layer_list(tdm_drm_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_drm_display_get_property(tdm_drm_display *display_data,
unsigned int obj_id, unsigned int obj_type,
@@ -619,7 +617,6 @@ failed:
return HAL_TDM_ERROR_OPERATION_FAILED;
}
-#endif
hal_tdm_error
tdm_drm_display_create_layer_list(tdm_drm_display *display_data)
@@ -627,11 +624,9 @@ tdm_drm_display_create_layer_list(tdm_drm_display *display_data)
tdm_drm_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_drm_display_create_layer_list_type(display_data);
else
-#endif
ret = _tdm_drm_display_create_layer_list(display_data);
if (ret != HAL_TDM_ERROR_NONE)