rename file names, package name and the prefix of the symbols 88/118888/2
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 14 Mar 2017 08:11:03 +0000 (17:11 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 15 Mar 2017 00:53:06 +0000 (09:53 +0900)
change drm to vc4..

Change-Id: I43fa091be38f75a75e77fedd6e46b0079c115f4c
Signed-off-by: SooChan Lim <sc1.lim@samsung.com>
12 files changed:
COPYING
configure.ac
packaging/libtdm-vc4.manifest [moved from packaging/libtdm-drm.manifest with 100% similarity]
packaging/libtdm-vc4.spec [moved from packaging/libtdm-drm.spec with 80% similarity]
src/Makefile.am
src/tdm_drm_pp.h [deleted file]
src/tdm_vc4.c [moved from src/tdm_drm.c with 57% similarity]
src/tdm_vc4.h [moved from src/tdm_drm.h with 54% similarity]
src/tdm_vc4_display.c [moved from src/tdm_drm_display.c with 70% similarity]
src/tdm_vc4_format.c [moved from src/tdm_drm_format.c with 94% similarity]
src/tdm_vc4_pp.c [moved from src/tdm_drm_pp.c with 87% similarity]
src/tdm_vc4_pp.h [new file with mode: 0644]

diff --git a/COPYING b/COPYING
index 817cb95..1bb9610 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
-Copyright 2013 Samsung Electronics co., Ltd. All Rights Reserved.
+Copyright 2017 Samsung Electronics co., Ltd. All Rights Reserved.
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the
index 3acfee2..4017c5a 100644 (file)
@@ -1,8 +1,8 @@
 AC_PREREQ([2.60])
-AC_INIT([libtdm-drm],
-        [1.0.0],
+AC_INIT([libtdm-vc4],
+        [0.5.0],
         [https://www.tizen.org],
-        [libtdm-drm])
+        [libtdm-vc4])
 
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_SRCDIR([Makefile.am])
@@ -23,16 +23,16 @@ LT_INIT([disable-static])
 # Enable quiet compiles on automake 1.11.
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
-PKG_CHECK_MODULES(TDM_DRM, libtdm libtbm libdrm pixman-1)
+PKG_CHECK_MODULES(TDM_VC4, libtdm libtbm libdrm pixman-1)
 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])
-       TDM_DRM_CFLAGS="$TDM_DRM_CFLAGS $UDEV_CFLAGS"
-       TDM_DRM_LIBS="$TDM_DRM_LIBS $UDEV_LIBS"
+       TDM_VC4_CFLAGS="$TDM_VC4_CFLAGS $UDEV_CFLAGS"
+       TDM_VC4_LIBS="$TDM_VC4_LIBS $UDEV_LIBS"
 fi
 
-AC_SUBST(TDM_DRM_CFLAGS)
-AC_SUBST(TDM_DRM_LIBS)
+AC_SUBST(TDM_VC4_CFLAGS)
+AC_SUBST(TDM_VC4_LIBS)
 
 AC_DEFINE_UNQUOTED(LIBDRM_MAJOR_VERSION, [`pkg-config --modversion libdrm | cut -d '.' -f 1`], dnl
                    [libdrm major version])
@@ -56,7 +56,7 @@ AC_OUTPUT([
 echo ""
 echo "$PACKAGE_STRING will be compiled with:"
 echo ""
-echo "TDM_DRM_CFLAGS : $TDM_DRM_CFLAGS"
-echo "TDM_DRM_LIBS   : $TDM_DRM_LIBS"
-echo "TDM_MODULE_DIR    : $TDM_MODULE_PATH"
+echo "TDM_VC4_CFLAGS : $TDM_VC4_CFLAGS"
+echo "TDM_VC4_LIBS   : $TDM_VC4_LIBS"
+echo "TDM_MODULE_DIR : $TDM_MODULE_PATH"
 echo ""
similarity index 80%
rename from packaging/libtdm-drm.spec
rename to packaging/libtdm-vc4.spec
index 3bf892b..9b751de 100644 (file)
@@ -1,7 +1,7 @@
-Name:           libtdm-drm
-Version:        1.0.5
+Name:           libtdm-vc4
+Version:        0.5.0
 Release:        0
-Summary:        Tizen Display Manager DRM Back-End Library
+Summary:        Tizen Display Manager VC4 Back-End Library
 Group:          Development/Libraries
 License:        MIT
 Source0:        %{name}-%{version}.tar.gz
@@ -12,7 +12,7 @@ BuildRequires: pkgconfig(libtdm)
 BuildRequires: pkgconfig(pixman-1)
 
 %description
-Back-End library of Tizen Display Manager DRM : libtdm-mgr DRM library
+Back-End library of Tizen Display Manager VC4 : libtdm-mgr VC4 library
 
 %global TZ_SYS_RO_SHARE  %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
 
@@ -36,7 +36,7 @@ cp -af COPYING %{buildroot}/%{TZ_SYS_RO_SHARE}/license/%{name}
 if [ -f %{_libdir}/tdm/libtdm-default.so ]; then
     rm -rf %{_libdir}/tdm/libtdm-default.so
 fi
-ln -s libtdm-drm.so %{_libdir}/tdm/libtdm-default.so
+ln -s libtdm-vc4.so %{_libdir}/tdm/libtdm-default.so
 
 %postun -p /sbin/ldconfig
 
@@ -44,4 +44,4 @@ ln -s libtdm-drm.so %{_libdir}/tdm/libtdm-default.so
 %defattr(-,root,root,-)
 %manifest %{name}.manifest
 %{TZ_SYS_RO_SHARE}/license/%{name}
-%{_libdir}/tdm/libtdm-drm.so
+%{_libdir}/tdm/libtdm-vc4.so
index 09338b8..01f7669 100644 (file)
@@ -1,14 +1,14 @@
 AM_CFLAGS = \
-       $(TDM_DRM_CFLAGS) \
+       $(TDM_VC4_CFLAGS) \
        -I$(top_srcdir)/src
 
-libtdm_drm_la_LTLIBRARIES = libtdm-drm.la
-libtdm_drm_ladir = $(TDM_MODULE_PATH)
-libtdm_drm_la_LDFLAGS = -module -avoid-version
-libtdm_drm_la_LIBADD = $(TDM_DRM_LIBS) -ldl
+libtdm_vc4_la_LTLIBRARIES = libtdm-vc4.la
+libtdm_vc4_ladir = $(TDM_MODULE_PATH)
+libtdm_vc4_la_LDFLAGS = -module -avoid-version
+libtdm_vc4_la_LIBADD = $(TDM_VC4_LIBS) -ldl
 
-libtdm_drm_la_SOURCES = \
-       tdm_drm_format.c \
-       tdm_drm_pp.c \
-       tdm_drm_display.c \
-       tdm_drm.c
+libtdm_vc4_la_SOURCES = \
+       tdm_vc4_format.c \
+       tdm_vc4_pp.c \
+       tdm_vc4_display.c \
+       tdm_vc4.c
diff --git a/src/tdm_drm_pp.h b/src/tdm_drm_pp.h
deleted file mode 100644 (file)
index acbb425..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _TDM_DRM_PP_H_
-#define _TDM_DRM_PP_H_
-
-#include "tdm_drm.h"
-
-tdm_error    tdm_drm_pp_get_capability(tdm_drm_data *drm_data, tdm_caps_pp *caps);
-tdm_pp*      tdm_drm_pp_create(tdm_drm_data *drm_data, tdm_error *error);
-void         tdm_drm_pp_handler(unsigned int prop_id, unsigned int *buf_idx,
-                                   unsigned int tv_sec, unsigned int tv_usec, void *data);
-void         tdm_drm_pp_cb(int fd, unsigned int prop_id, unsigned int *buf_idx,
-                              unsigned int tv_sec, unsigned int tv_usec,
-                              void *user_data);
-#endif /* _TDM_DRM_PP_H_ */
similarity index 57%
rename from src/tdm_drm.c
rename to src/tdm_vc4.c
index 1817c6e..e97b89b 100644 (file)
@@ -6,14 +6,14 @@
 #include <libudev.h>
 #endif
 
-#include "tdm_drm.h"
+#include "tdm_vc4.h"
 #include <tdm_helper.h>
 
 #define ENABLE_PP
 
-#define TDM_DRM_NAME "vigs"
+#define TDM_DRM_NAME "vc4-drm"
 
-static tdm_drm_data *drm_data;
+static tdm_vc4_data *vc4_data;
 
 #ifdef HAVE_UDEV
 static struct udev_device *
@@ -66,9 +66,9 @@ _tdm_find_primary_gpu(void)
 }
 
 static tdm_error
-_tdm_drm_udev_fd_handler(int fd, tdm_event_loop_mask mask, void *user_data)
+_tdm_vc4_udev_fd_handler(int fd, tdm_event_loop_mask mask, void *user_data)
 {
-       tdm_drm_data *edata = (tdm_drm_data*)user_data;
+       tdm_vc4_data *edata = (tdm_vc4_data*)user_data;
        struct udev_device *dev;
        const char *hotplug;
        struct stat s;
@@ -95,7 +95,7 @@ _tdm_drm_udev_fd_handler(int fd, tdm_event_loop_mask mask, void *user_data)
                hotplug && atoi(hotplug) == 1)
        {
                TDM_INFO("HotPlug");
-               tdm_drm_display_update_output_status(edata);
+               tdm_vc4_display_update_output_status(edata);
        }
 
        udev_device_unref(dev);
@@ -104,7 +104,7 @@ _tdm_drm_udev_fd_handler(int fd, tdm_event_loop_mask mask, void *user_data)
 }
 
 static void
-_tdm_drm_udev_init(tdm_drm_data *edata)
+_tdm_vc4_udev_init(tdm_vc4_data *edata)
 {
        struct udev *u = NULL;
        struct udev_monitor *mon = NULL;
@@ -130,7 +130,7 @@ _tdm_drm_udev_init(tdm_drm_data *edata)
        edata->uevent_source =
                tdm_event_loop_add_fd_handler(edata->dpy, udev_monitor_get_fd(mon),
                                              TDM_EVENT_LOOP_READABLE,
-                                             _tdm_drm_udev_fd_handler,
+                                             _tdm_vc4_udev_fd_handler,
                                              edata, NULL);
        if (!edata->uevent_source) {
                TDM_ERR("couldn't create udev event source");
@@ -150,7 +150,7 @@ failed:
 }
 
 static void
-_tdm_drm_udev_deinit(tdm_drm_data *edata)
+_tdm_vc4_udev_deinit(tdm_vc4_data *edata)
 {
        if (edata->uevent_source) {
                tdm_event_loop_source_remove(edata->uevent_source);
@@ -168,7 +168,7 @@ _tdm_drm_udev_deinit(tdm_drm_data *edata)
 #endif
 
 static int
-_tdm_drm_open_drm(void)
+_tdm_vc4_open_drm(void)
 {
        int fd = -1;
 
@@ -205,38 +205,38 @@ close_l:
 }
 
 void
-tdm_drm_deinit(tdm_backend_data *bdata)
+tdm_vc4_deinit(tdm_backend_data *bdata)
 {
-       if (drm_data != bdata)
+       if (vc4_data != bdata)
                return;
 
        TDM_INFO("deinit");
 
 #ifdef HAVE_UDEV
-       _tdm_drm_udev_deinit(drm_data);
+       _tdm_vc4_udev_deinit(vc4_data);
 #endif
 
-       tdm_drm_display_destroy_output_list(drm_data);
+       tdm_vc4_display_destroy_output_list(vc4_data);
 
-       if (drm_data->plane_res)
-               drmModeFreePlaneResources(drm_data->plane_res);
-       if (drm_data->mode_res)
-               drmModeFreeResources(drm_data->mode_res);
-       if (drm_data->drm_fd >= 0)
-               close(drm_data->drm_fd);
+       if (vc4_data->plane_res)
+               drmModeFreePlaneResources(vc4_data->plane_res);
+       if (vc4_data->mode_res)
+               drmModeFreeResources(vc4_data->mode_res);
+       if (vc4_data->drm_fd >= 0)
+               close(vc4_data->drm_fd);
 
-       free(drm_data);
-       drm_data = NULL;
+       free(vc4_data);
+       vc4_data = NULL;
 }
 
 tdm_backend_data *
-tdm_drm_init(tdm_display *dpy, tdm_error *error)
+tdm_vc4_init(tdm_display *dpy, tdm_error *error)
 {
-       tdm_func_display drm_func_display;
-       tdm_func_output drm_func_output;
-       tdm_func_layer drm_func_layer;
+       tdm_func_display vc4_func_display;
+       tdm_func_output vc4_func_output;
+       tdm_func_layer vc4_func_layer;
 #ifdef ENABLE_PP
-       tdm_func_pp drm_func_pp;
+       tdm_func_pp vc4_func_pp;
 #endif
        tdm_error ret;
 
@@ -247,142 +247,142 @@ tdm_drm_init(tdm_display *dpy, tdm_error *error)
                return NULL;
        }
 
-       if (drm_data) {
+       if (vc4_data) {
                TDM_ERR("failed: init twice");
                if (error)
                        *error = TDM_ERROR_BAD_REQUEST;
                return NULL;
        }
 
-       drm_data = calloc(1, sizeof(tdm_drm_data));
-       if (!drm_data) {
+       vc4_data = calloc(1, sizeof(tdm_vc4_data));
+       if (!vc4_data) {
                TDM_ERR("alloc failed");
                if (error)
                        *error = TDM_ERROR_OUT_OF_MEMORY;
                return NULL;
        }
 
-       LIST_INITHEAD(&drm_data->output_list);
-       LIST_INITHEAD(&drm_data->buffer_list);
-
-       memset(&drm_func_display, 0, sizeof(drm_func_display));
-       drm_func_display.display_get_capability = drm_display_get_capability;
-       drm_func_display.display_get_pp_capability = drm_display_get_pp_capability;
-       drm_func_display.display_get_outputs = drm_display_get_outputs;
-       drm_func_display.display_get_fd = drm_display_get_fd;
-       drm_func_display.display_handle_events = drm_display_handle_events;
-       drm_func_display.display_create_pp = drm_display_create_pp;
-
-       memset(&drm_func_output, 0, sizeof(drm_func_output));
-       drm_func_output.output_get_capability = drm_output_get_capability;
-       drm_func_output.output_get_layers = drm_output_get_layers;
-       drm_func_output.output_set_property = drm_output_set_property;
-       drm_func_output.output_get_property = drm_output_get_property;
-       drm_func_output.output_wait_vblank = drm_output_wait_vblank;
-       drm_func_output.output_set_vblank_handler = drm_output_set_vblank_handler;
-       drm_func_output.output_commit = drm_output_commit;
-       drm_func_output.output_set_commit_handler = drm_output_set_commit_handler;
-       drm_func_output.output_set_dpms = drm_output_set_dpms;
-       drm_func_output.output_get_dpms = drm_output_get_dpms;
-       drm_func_output.output_set_mode = drm_output_set_mode;
-       drm_func_output.output_get_mode = drm_output_get_mode;
+       LIST_INITHEAD(&vc4_data->output_list);
+       LIST_INITHEAD(&vc4_data->buffer_list);
+
+       memset(&vc4_func_display, 0, sizeof(vc4_func_display));
+       vc4_func_display.display_get_capability = vc4_display_get_capability;
+       vc4_func_display.display_get_pp_capability = vc4_display_get_pp_capability;
+       vc4_func_display.display_get_outputs = vc4_display_get_outputs;
+       vc4_func_display.display_get_fd = vc4_display_get_fd;
+       vc4_func_display.display_handle_events = vc4_display_handle_events;
+       vc4_func_display.display_create_pp = vc4_display_create_pp;
+
+       memset(&vc4_func_output, 0, sizeof(vc4_func_output));
+       vc4_func_output.output_get_capability = vc4_output_get_capability;
+       vc4_func_output.output_get_layers = vc4_output_get_layers;
+       vc4_func_output.output_set_property = vc4_output_set_property;
+       vc4_func_output.output_get_property = vc4_output_get_property;
+       vc4_func_output.output_wait_vblank = vc4_output_wait_vblank;
+       vc4_func_output.output_set_vblank_handler = vc4_output_set_vblank_handler;
+       vc4_func_output.output_commit = vc4_output_commit;
+       vc4_func_output.output_set_commit_handler = vc4_output_set_commit_handler;
+       vc4_func_output.output_set_dpms = vc4_output_set_dpms;
+       vc4_func_output.output_get_dpms = vc4_output_get_dpms;
+       vc4_func_output.output_set_mode = vc4_output_set_mode;
+       vc4_func_output.output_get_mode = vc4_output_get_mode;
 #ifdef HAVE_UDEV
-       drm_func_output.output_set_status_handler = drm_output_set_status_handler;
+       vc4_func_output.output_set_status_handler = vc4_output_set_status_handler;
 #endif
 
-       memset(&drm_func_layer, 0, sizeof(drm_func_layer));
-       drm_func_layer.layer_get_capability = drm_layer_get_capability;
-       drm_func_layer.layer_set_property = drm_layer_set_property;
-       drm_func_layer.layer_get_property = drm_layer_get_property;
-       drm_func_layer.layer_set_info = drm_layer_set_info;
-       drm_func_layer.layer_get_info = drm_layer_get_info;
-       drm_func_layer.layer_set_buffer = drm_layer_set_buffer;
-       drm_func_layer.layer_unset_buffer = drm_layer_unset_buffer;
+       memset(&vc4_func_layer, 0, sizeof(vc4_func_layer));
+       vc4_func_layer.layer_get_capability = vc4_layer_get_capability;
+       vc4_func_layer.layer_set_property = vc4_layer_set_property;
+       vc4_func_layer.layer_get_property = vc4_layer_get_property;
+       vc4_func_layer.layer_set_info = vc4_layer_set_info;
+       vc4_func_layer.layer_get_info = vc4_layer_get_info;
+       vc4_func_layer.layer_set_buffer = vc4_layer_set_buffer;
+       vc4_func_layer.layer_unset_buffer = vc4_layer_unset_buffer;
 
 #ifdef ENABLE_PP
-       memset(&drm_func_pp, 0, sizeof(drm_func_pp));
-       drm_func_pp.pp_destroy = drm_pp_destroy;
-       drm_func_pp.pp_set_info = drm_pp_set_info;
-       drm_func_pp.pp_attach = drm_pp_attach;
-       drm_func_pp.pp_commit = drm_pp_commit;
-       drm_func_pp.pp_set_done_handler = drm_pp_set_done_handler;
+       memset(&vc4_func_pp, 0, sizeof(vc4_func_pp));
+       vc4_func_pp.pp_destroy = vc4_pp_destroy;
+       vc4_func_pp.pp_set_info = vc4_pp_set_info;
+       vc4_func_pp.pp_attach = vc4_pp_attach;
+       vc4_func_pp.pp_commit = vc4_pp_commit;
+       vc4_func_pp.pp_set_done_handler = vc4_pp_set_done_handler;
 #endif
 
-       ret = tdm_backend_register_func_display(dpy, &drm_func_display);
+       ret = tdm_backend_register_func_display(dpy, &vc4_func_display);
        if (ret != TDM_ERROR_NONE)
                goto failed;
 
-       ret = tdm_backend_register_func_output(dpy, &drm_func_output);
+       ret = tdm_backend_register_func_output(dpy, &vc4_func_output);
        if (ret != TDM_ERROR_NONE)
                goto failed;
 
-       ret = tdm_backend_register_func_layer(dpy, &drm_func_layer);
+       ret = tdm_backend_register_func_layer(dpy, &vc4_func_layer);
        if (ret != TDM_ERROR_NONE)
                goto failed;
 
 #ifdef ENABLE_PP
-       ret = tdm_backend_register_func_pp(dpy, &drm_func_pp);
+       ret = tdm_backend_register_func_pp(dpy, &vc4_func_pp);
        if (ret != TDM_ERROR_NONE)
                goto failed;
 #endif
 
-       drm_data->dpy = dpy;
+       vc4_data->dpy = dpy;
 
-       /* The drm master fd can be opened by a tbm backend module in
+       /* The vc4 master fd can be opened by a tbm backend module in
         * tbm_bufmgr_init() time. In this case, we just get it from
-        * TBM_DRM_MASTER_FD enviroment.
+        * TBM_vc4_MASTER_FD enviroment.
         * 
         */
-       drm_data->drm_fd = tdm_helper_get_fd("TBM_DRM_MASTER_FD");
-       if (drm_data->drm_fd < 0)
-               drm_data->drm_fd = _tdm_drm_open_drm();
+       vc4_data->drm_fd = tdm_helper_get_fd("TBM_DRM_MASTER_FD");
+       if (vc4_data->drm_fd < 0)
+               vc4_data->drm_fd = _tdm_vc4_open_drm();
 
-       if (drm_data->drm_fd < 0) {
+       if (vc4_data->drm_fd < 0) {
                ret = TDM_ERROR_OPERATION_FAILED;
                goto failed;
        }
 
        /* To share the drm master fd with other modules in display server side. */
-       tdm_helper_set_fd("TDM_DRM_MASTER_FD", drm_data->drm_fd);
+       tdm_helper_set_fd("TDM_DRM_MASTER_FD", vc4_data->drm_fd);
 
 #ifdef HAVE_UDEV
-       _tdm_drm_udev_init(drm_data);
+       _tdm_vc4_udev_init(vc4_data);
 #endif
 
 #if LIBDRM_MAJOR_VERSION >= 2 && LIBDRM_MINOR_VERSION >= 4  && LIBDRM_MICRO_VERSION >= 47
-       if (drmSetClientCap(drm_data->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0) {
+       if (drmSetClientCap(vc4_data->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0) {
                TDM_WRN("Set DRM_CLIENT_CAP_UNIVERSAL_PLANES failed");
        } else {
                TDM_INFO("has universal planes");
-               drm_data->has_universal_plane = 1;
+               vc4_data->has_universal_plane = 1;
        }
 #endif
 
-       drm_data->mode_res = drmModeGetResources(drm_data->drm_fd);
-       if (!drm_data->mode_res) {
+       vc4_data->mode_res = drmModeGetResources(vc4_data->drm_fd);
+       if (!vc4_data->mode_res) {
                TDM_ERR("no drm resource: %m");
                ret = TDM_ERROR_OPERATION_FAILED;
                goto failed;
        }
 
-       drm_data->plane_res = drmModeGetPlaneResources(drm_data->drm_fd);
-       if (!drm_data->plane_res) {
+       vc4_data->plane_res = drmModeGetPlaneResources(vc4_data->drm_fd);
+       if (!vc4_data->plane_res) {
                TDM_ERR("no drm plane resource: %m");
                ret = TDM_ERROR_OPERATION_FAILED;
                goto failed;
        }
 
-       if (drm_data->plane_res->count_planes <= 0) {
+       if (vc4_data->plane_res->count_planes <= 0) {
                TDM_ERR("no drm plane resource");
                ret = TDM_ERROR_OPERATION_FAILED;
                goto failed;
        }
 
-       ret = tdm_drm_display_create_output_list(drm_data);
+       ret = tdm_vc4_display_create_output_list(vc4_data);
        if (ret != TDM_ERROR_NONE)
                goto failed;
 
-       ret = tdm_drm_display_create_layer_list(drm_data);
+       ret = tdm_vc4_display_create_layer_list(vc4_data);
        if (ret != TDM_ERROR_NONE)
                goto failed;
 
@@ -391,12 +391,12 @@ tdm_drm_init(tdm_display *dpy, tdm_error *error)
 
        TDM_INFO("init success!");
 
-       return (tdm_backend_data *)drm_data;
+       return (tdm_backend_data *)vc4_data;
 failed:
        if (error)
                *error = ret;
 
-       tdm_drm_deinit(drm_data);
+       tdm_vc4_deinit(vc4_data);
 
        TDM_ERR("init failed!");
        return NULL;
@@ -406,6 +406,6 @@ tdm_backend_module tdm_backend_module_data = {
        "drm",
        "Samsung",
        TDM_BACKEND_SET_ABI_VERSION(1, 1),
-       tdm_drm_init,
-       tdm_drm_deinit
+       tdm_vc4_init,
+       tdm_vc4_deinit
 };
similarity index 54%
rename from src/tdm_drm.h
rename to src/tdm_vc4.h
index 99d6a36..8de6c1f 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _TDM_DRM_H_
-#define _TDM_DRM_H_
+#ifndef _TDM_VC4_H_
+#define _TDM_VC4_H_
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
 /* drm backend functions (display) */
-tdm_error    drm_display_get_capability(tdm_backend_data *bdata, tdm_caps_display *caps);
-tdm_error    drm_display_get_pp_capability(tdm_backend_data *bdata, tdm_caps_pp *caps);
-tdm_output** drm_display_get_outputs(tdm_backend_data *bdata, int *count, tdm_error *error);
-tdm_error    drm_display_get_fd(tdm_backend_data *bdata, int *fd);
-tdm_error    drm_display_handle_events(tdm_backend_data *bdata);
-tdm_pp*      drm_display_create_pp(tdm_backend_data *bdata, tdm_error *error);
-tdm_error    drm_output_get_capability(tdm_output *output, tdm_caps_output *caps);
-tdm_layer**  drm_output_get_layers(tdm_output *output, int *count, tdm_error *error);
-tdm_error    drm_output_set_property(tdm_output *output, unsigned int id, tdm_value value);
-tdm_error    drm_output_get_property(tdm_output *output, unsigned int id, tdm_value *value);
-tdm_error    drm_output_wait_vblank(tdm_output *output, int interval, int sync, void *user_data);
-tdm_error    drm_output_set_vblank_handler(tdm_output *output, tdm_output_vblank_handler func);
-tdm_error    drm_output_commit(tdm_output *output, int sync, void *user_data);
-tdm_error    drm_output_set_commit_handler(tdm_output *output, tdm_output_commit_handler func);
-tdm_error    drm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value);
-tdm_error    drm_output_get_dpms(tdm_output *output, tdm_output_dpms *dpms_value);
-tdm_error    drm_output_set_mode(tdm_output *output, const tdm_output_mode *mode);
-tdm_error    drm_output_get_mode(tdm_output *output, const tdm_output_mode **mode);
-tdm_error    drm_output_set_status_handler(tdm_output *output, tdm_output_status_handler func, void *user_data);
-tdm_error    drm_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps);
-tdm_error    drm_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value value);
-tdm_error    drm_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value);
-tdm_error    drm_layer_set_info(tdm_layer *layer, tdm_info_layer *info);
-tdm_error    drm_layer_get_info(tdm_layer *layer, tdm_info_layer *info);
-tdm_error    drm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer);
-tdm_error    drm_layer_unset_buffer(tdm_layer *layer);
-void         drm_pp_destroy(tdm_pp *pp);
-tdm_error    drm_pp_set_info(tdm_pp *pp, tdm_info_pp *info);
-tdm_error    drm_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst);
-tdm_error    drm_pp_commit(tdm_pp *pp);
-tdm_error    drm_pp_set_done_handler(tdm_pp *pp, tdm_pp_done_handler func, void *user_data);
+tdm_error    vc4_display_get_capability(tdm_backend_data *bdata, tdm_caps_display *caps);
+tdm_error    vc4_display_get_pp_capability(tdm_backend_data *bdata, tdm_caps_pp *caps);
+tdm_output** vc4_display_get_outputs(tdm_backend_data *bdata, int *count, tdm_error *error);
+tdm_error    vc4_display_get_fd(tdm_backend_data *bdata, int *fd);
+tdm_error    vc4_display_handle_events(tdm_backend_data *bdata);
+tdm_pp*      vc4_display_create_pp(tdm_backend_data *bdata, tdm_error *error);
+tdm_error    vc4_output_get_capability(tdm_output *output, tdm_caps_output *caps);
+tdm_layer**  vc4_output_get_layers(tdm_output *output, int *count, tdm_error *error);
+tdm_error    vc4_output_set_property(tdm_output *output, unsigned int id, tdm_value value);
+tdm_error    vc4_output_get_property(tdm_output *output, unsigned int id, tdm_value *value);
+tdm_error    vc4_output_wait_vblank(tdm_output *output, int interval, int sync, void *user_data);
+tdm_error    vc4_output_set_vblank_handler(tdm_output *output, tdm_output_vblank_handler func);
+tdm_error    vc4_output_commit(tdm_output *output, int sync, void *user_data);
+tdm_error    vc4_output_set_commit_handler(tdm_output *output, tdm_output_commit_handler func);
+tdm_error    vc4_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value);
+tdm_error    vc4_output_get_dpms(tdm_output *output, tdm_output_dpms *dpms_value);
+tdm_error    vc4_output_set_mode(tdm_output *output, const tdm_output_mode *mode);
+tdm_error    vc4_output_get_mode(tdm_output *output, const tdm_output_mode **mode);
+tdm_error    vc4_output_set_status_handler(tdm_output *output, tdm_output_status_handler func, void *user_data);
+tdm_error    vc4_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps);
+tdm_error    vc4_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value value);
+tdm_error    vc4_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value);
+tdm_error    vc4_layer_set_info(tdm_layer *layer, tdm_info_layer *info);
+tdm_error    vc4_layer_get_info(tdm_layer *layer, tdm_info_layer *info);
+tdm_error    vc4_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer);
+tdm_error    vc4_layer_unset_buffer(tdm_layer *layer);
+void         vc4_pp_destroy(tdm_pp *pp);
+tdm_error    vc4_pp_set_info(tdm_pp *pp, tdm_info_pp *info);
+tdm_error    vc4_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst);
+tdm_error    vc4_pp_commit(tdm_pp *pp);
+tdm_error    vc4_pp_set_done_handler(tdm_pp *pp, tdm_pp_done_handler func, void *user_data);
 
 /* drm module internal macros, structures, functions */
 #define NEVER_GET_HERE() TDM_ERR("** NEVER GET HERE **")
@@ -100,7 +100,7 @@ tdm_error    drm_pp_set_done_handler(tdm_pp *pp, tdm_pp_done_handler func, void
     }\
 }
 
-typedef struct _tdm_drm_data
+typedef struct _tdm_vc4_data
 {
     tdm_display *dpy;
 
@@ -120,14 +120,14 @@ typedef struct _tdm_drm_data
 
     struct list_head output_list;
     struct list_head buffer_list;
-} tdm_drm_data;
+} tdm_vc4_data;
 
-uint32_t     tdm_drm_format_to_drm_format(tbm_format format);
-tbm_format   tdm_drm_format_to_tbm_format(uint32_t format);
+uint32_t     tdm_vc4_format_to_drm_format(tbm_format format);
+tbm_format   tdm_vc4_format_to_tbm_format(uint32_t format);
 
-void         tdm_drm_display_update_output_status(tdm_drm_data *drm_data);
-tdm_error    tdm_drm_display_create_output_list(tdm_drm_data *drm_data);
-void         tdm_drm_display_destroy_output_list(tdm_drm_data *drm_data);
-tdm_error    tdm_drm_display_create_layer_list(tdm_drm_data *drm_data);
+void         tdm_vc4_display_update_output_status(tdm_vc4_data *vc4_data);
+tdm_error    tdm_vc4_display_create_output_list(tdm_vc4_data *vc4_data);
+void         tdm_vc4_display_destroy_output_list(tdm_vc4_data *vc4_data);
+tdm_error    tdm_vc4_display_create_layer_list(tdm_vc4_data *vc4_data);
 
-#endif /* _TDM_DRM_H_ */
+#endif /* _TDM_VC4_H_ */
similarity index 70%
rename from src/tdm_drm_display.c
rename to src/tdm_vc4_display.c
index 312de60..348089f 100644 (file)
@@ -5,52 +5,52 @@
 #include <drm_fourcc.h>
 #include <tdm_helper.h>
 
-#include "tdm_drm.h"
-#include "tdm_drm_pp.h"
+#include "tdm_vc4.h"
+#include "tdm_vc4_pp.h"
 
 #define MIN_WIDTH   32
 
-typedef struct _tdm_drm_output_data tdm_drm_output_data;
-typedef struct _tdm_drm_layer_data tdm_drm_layer_data;
-typedef struct _tdm_drm_event_data tdm_drm_event_data;
+typedef struct _tdm_vc4_output_data tdm_vc4_output_data;
+typedef struct _tdm_vc4_layer_data tdm_vc4_layer_data;
+typedef struct _tdm_vc4_event_data tdm_vc4_event_data;
 
 typedef enum {
         TDM_DRM_EVENT_TYPE_WAIT,
         TDM_DRM_EVENT_TYPE_COMMIT,
         TDM_DRM_EVENT_TYPE_PAGEFLIP,
-} tdm_drm_event_type;
+} tdm_vc4_event_type;
 
-typedef struct _tdm_drm_display_buffer {
+typedef struct _tdm_vc4_display_buffer {
        struct list_head link;
 
        unsigned int fb_id;
        tbm_surface_h buffer;
        int width;
-} tdm_drm_display_buffer;
+} tdm_vc4_display_buffer;
 
-struct _tdm_drm_event_data {
-       tdm_drm_event_type type;
-       tdm_drm_output_data *output_data;
+struct _tdm_vc4_event_data {
+       tdm_vc4_event_type type;
+       tdm_vc4_output_data *output_data;
        void *user_data;
 };
 
-struct _tdm_drm_output_data {
+struct _tdm_vc4_output_data {
        struct list_head link;
 
        /* data which are fixed at initializing */
-       tdm_drm_data *drm_data;
+       tdm_vc4_data *vc4_data;
        uint32_t connector_id;
        uint32_t encoder_id;
        uint32_t crtc_id;
        uint32_t pipe;
        uint32_t dpms_prop_id;
        int count_modes;
-       drmModeModeInfoPtr drm_modes;
+       drmModeModeInfoPtr vc4_modes;
        tdm_output_mode *output_modes;
        tdm_output_type connector_type;
        unsigned int connector_type_id;
        struct list_head layer_list;
-       tdm_drm_layer_data *primary_layer;
+       tdm_vc4_layer_data *primary_layer;
 
        /* not fixed data below */
        tdm_output_vblank_handler vblank_func;
@@ -64,12 +64,12 @@ struct _tdm_drm_output_data {
        const tdm_output_mode *current_mode;
 };
 
-struct _tdm_drm_layer_data {
+struct _tdm_vc4_layer_data {
        struct list_head link;
 
        /* data which are fixed at initializing */
-       tdm_drm_data *drm_data;
-       tdm_drm_output_data *output_data;
+       tdm_vc4_data *vc4_data;
+       tdm_vc4_output_data *output_data;
        uint32_t plane_id;
        tdm_layer_capability capabilities;
        int zpos;
@@ -78,12 +78,12 @@ struct _tdm_drm_layer_data {
        tdm_info_layer info;
        int info_changed;
 
-       tdm_drm_display_buffer *display_buffer;
+       tdm_vc4_display_buffer *display_buffer;
        int display_buffer_changed;
 };
 
 static drmModeModeInfoPtr
-_tdm_drm_display_get_mode(tdm_drm_output_data *output_data)
+_tdm_vc4_display_get_mode(tdm_vc4_output_data *output_data)
 {
        int i;
 
@@ -93,25 +93,25 @@ _tdm_drm_display_get_mode(tdm_drm_output_data *output_data)
        }
 
        for (i = 0; i < output_data->count_modes; i++) {
-               drmModeModeInfoPtr drm_mode = &output_data->drm_modes[i];
-               if ((drm_mode->hdisplay == output_data->current_mode->hdisplay) &&
-                   (drm_mode->vdisplay == output_data->current_mode->vdisplay) &&
-                   (drm_mode->vrefresh == output_data->current_mode->vrefresh) &&
-                   (drm_mode->flags == output_data->current_mode->flags) &&
-                   (drm_mode->type == output_data->current_mode->type) &&
-                   !(strncmp(drm_mode->name, output_data->current_mode->name, TDM_NAME_LEN)))
-                       return drm_mode;
+               drmModeModeInfoPtr vc4_mode = &output_data->vc4_modes[i];
+               if ((vc4_mode->hdisplay == output_data->current_mode->hdisplay) &&
+                   (vc4_mode->vdisplay == output_data->current_mode->vdisplay) &&
+                   (vc4_mode->vrefresh == output_data->current_mode->vrefresh) &&
+                   (vc4_mode->flags == output_data->current_mode->flags) &&
+                   (vc4_mode->type == output_data->current_mode->type) &&
+                   !(strncmp(vc4_mode->name, output_data->current_mode->name, TDM_NAME_LEN)))
+                       return vc4_mode;
        }
 
        return NULL;
 }
 
-static tdm_drm_display_buffer *
-_tdm_drm_display_find_buffer(tdm_drm_data *drm_data, tbm_surface_h buffer)
+static tdm_vc4_display_buffer *
+_tdm_vc4_display_find_buffer(tdm_vc4_data *vc4_data, tbm_surface_h buffer)
 {
-       tdm_drm_display_buffer *display_buffer = NULL;
+       tdm_vc4_display_buffer *display_buffer = NULL;
 
-       LIST_FOR_EACH_ENTRY(display_buffer, &drm_data->buffer_list, link) {
+       LIST_FOR_EACH_ENTRY(display_buffer, &vc4_data->buffer_list, link) {
                if (display_buffer->buffer == buffer)
                        return display_buffer;
        }
@@ -120,28 +120,28 @@ _tdm_drm_display_find_buffer(tdm_drm_data *drm_data, tbm_surface_h buffer)
 }
 
 static void
-_tdm_drm_display_to_tdm_mode(drmModeModeInfoPtr drm_mode,
+_tdm_vc4_display_to_tdm_mode(drmModeModeInfoPtr vc4_mode,
                              tdm_output_mode *tdm_mode)
 {
-       tdm_mode->clock = drm_mode->clock;
-       tdm_mode->hdisplay = drm_mode->hdisplay;
-       tdm_mode->hsync_start = drm_mode->hsync_start;
-       tdm_mode->hsync_end = drm_mode->hsync_end;
-       tdm_mode->htotal = drm_mode->htotal;
-       tdm_mode->hskew = drm_mode->hskew;
-       tdm_mode->vdisplay = drm_mode->vdisplay;
-       tdm_mode->vsync_start = drm_mode->vsync_start;
-       tdm_mode->vsync_end = drm_mode->vsync_end;
-       tdm_mode->vtotal = drm_mode->vtotal;
-       tdm_mode->vscan = drm_mode->vscan;
-       tdm_mode->vrefresh = drm_mode->vrefresh;
-       tdm_mode->flags = drm_mode->flags;
-       tdm_mode->type = drm_mode->type;
-       snprintf(tdm_mode->name, TDM_NAME_LEN, "%s", drm_mode->name);
+       tdm_mode->clock = vc4_mode->clock;
+       tdm_mode->hdisplay = vc4_mode->hdisplay;
+       tdm_mode->hsync_start = vc4_mode->hsync_start;
+       tdm_mode->hsync_end = vc4_mode->hsync_end;
+       tdm_mode->htotal = vc4_mode->htotal;
+       tdm_mode->hskew = vc4_mode->hskew;
+       tdm_mode->vdisplay = vc4_mode->vdisplay;
+       tdm_mode->vsync_start = vc4_mode->vsync_start;
+       tdm_mode->vsync_end = vc4_mode->vsync_end;
+       tdm_mode->vtotal = vc4_mode->vtotal;
+       tdm_mode->vscan = vc4_mode->vscan;
+       tdm_mode->vrefresh = vc4_mode->vrefresh;
+       tdm_mode->flags = vc4_mode->flags;
+       tdm_mode->type = vc4_mode->type;
+       snprintf(tdm_mode->name, TDM_NAME_LEN, "%s", vc4_mode->name);
 }
 
 static tdm_error
-_tdm_drm_display_get_cur_msc (int fd, int pipe, uint *msc)
+_tdm_vc4_display_get_cur_msc (int fd, int pipe, uint *msc)
 {
        drmVBlank vbl;
 
@@ -162,7 +162,7 @@ _tdm_drm_display_get_cur_msc (int fd, int pipe, uint *msc)
 }
 
 static tdm_error
-_tdm_drm_display_wait_vblank(int fd, int pipe, uint *target_msc, void *data)
+_tdm_vc4_display_wait_vblank(int fd, int pipe, uint *target_msc, void *data)
 {
        drmVBlank vbl;
 
@@ -185,7 +185,7 @@ _tdm_drm_display_wait_vblank(int fd, int pipe, uint *target_msc, void *data)
 }
 
 static tdm_error
-_tdm_drm_output_update_status(tdm_drm_output_data *output_data,
+_tdm_vc4_output_update_status(tdm_vc4_output_data *output_data,
                               tdm_output_conn_status status)
 {
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
@@ -203,11 +203,11 @@ _tdm_drm_output_update_status(tdm_drm_output_data *output_data,
 }
 
 static tdm_error
-_tdm_drm_display_commit_primary_layer(tdm_drm_layer_data *layer_data,
+_tdm_vc4_display_commit_primary_layer(tdm_vc4_layer_data *layer_data,
                                       void *user_data, int *do_waitvblank)
 {
-       tdm_drm_data *drm_data = layer_data->drm_data;
-       tdm_drm_output_data *output_data = layer_data->output_data;
+       tdm_vc4_data *vc4_data = layer_data->vc4_data;
+       tdm_vc4_output_data *output_data = layer_data->output_data;
 
        if (output_data->mode_changed && layer_data->display_buffer_changed) {
                drmModeModeInfoPtr mode;
@@ -221,20 +221,20 @@ _tdm_drm_display_commit_primary_layer(tdm_drm_layer_data *layer_data,
                layer_data->display_buffer_changed = 0;
                layer_data->info_changed = 0;
 
-               mode = _tdm_drm_display_get_mode(output_data);
+               mode = _tdm_vc4_display_get_mode(output_data);
                if (!mode) {
                        TDM_ERR("couldn't find proper mode");
                        return TDM_ERROR_BAD_REQUEST;
                }
 
-               if (drmModeSetCrtc(drm_data->drm_fd, output_data->crtc_id,
+               if (drmModeSetCrtc(vc4_data->drm_fd, output_data->crtc_id,
                                   layer_data->display_buffer->fb_id, 0, 0,
                                   &output_data->connector_id, 1, mode)) {
                        TDM_ERR("set crtc failed: %m");
                        return TDM_ERROR_OPERATION_FAILED;
                }
 
-               _tdm_drm_output_update_status(output_data, TDM_OUTPUT_CONN_STATUS_MODE_SETTED);
+               _tdm_vc4_output_update_status(output_data, TDM_OUTPUT_CONN_STATUS_MODE_SETTED);
 
                *do_waitvblank = 1;
                return TDM_ERROR_NONE;
@@ -242,18 +242,18 @@ _tdm_drm_display_commit_primary_layer(tdm_drm_layer_data *layer_data,
                layer_data->display_buffer_changed = 0;
 
                if (!layer_data->display_buffer) {
-                       if (drmModeSetCrtc(drm_data->drm_fd, output_data->crtc_id,
+                       if (drmModeSetCrtc(vc4_data->drm_fd, output_data->crtc_id,
                                           0, 0, 0, NULL, 0, NULL)) {
                                TDM_ERR("unset crtc failed: %m");
                                return TDM_ERROR_OPERATION_FAILED;
                        }
 
                        if (output_data->status == TDM_OUTPUT_CONN_STATUS_MODE_SETTED)
-                               _tdm_drm_output_update_status(output_data, TDM_OUTPUT_CONN_STATUS_CONNECTED);
+                               _tdm_vc4_output_update_status(output_data, TDM_OUTPUT_CONN_STATUS_CONNECTED);
 
                        *do_waitvblank = 1;
                } else {
-                       tdm_drm_event_data *event_data = calloc(1, sizeof(tdm_drm_event_data));
+                       tdm_vc4_event_data *event_data = calloc(1, sizeof(tdm_vc4_event_data));
 
                        if (!event_data) {
                                TDM_ERR("alloc failed");
@@ -263,7 +263,7 @@ _tdm_drm_display_commit_primary_layer(tdm_drm_layer_data *layer_data,
                        event_data->type = TDM_DRM_EVENT_TYPE_PAGEFLIP;
                        event_data->output_data = output_data;
                        event_data->user_data = user_data;
-                       if (drmModePageFlip(drm_data->drm_fd, output_data->crtc_id,
+                       if (drmModePageFlip(vc4_data->drm_fd, output_data->crtc_id,
                                            layer_data->display_buffer->fb_id, DRM_MODE_PAGE_FLIP_EVENT, event_data)) {
                                TDM_ERR("pageflip failed: %m");
                                return TDM_ERROR_OPERATION_FAILED;
@@ -276,10 +276,10 @@ _tdm_drm_display_commit_primary_layer(tdm_drm_layer_data *layer_data,
 }
 
 static tdm_error
-_tdm_drm_display_commit_layer(tdm_drm_layer_data *layer_data)
+_tdm_vc4_display_commit_layer(tdm_vc4_layer_data *layer_data)
 {
-       tdm_drm_data *drm_data = layer_data->drm_data;
-       tdm_drm_output_data *output_data = layer_data->output_data;
+       tdm_vc4_data *vc4_data = layer_data->vc4_data;
+       tdm_vc4_output_data *output_data = layer_data->output_data;
        uint32_t fx, fy, fw, fh;
        int crtc_w;
 
@@ -289,7 +289,7 @@ _tdm_drm_display_commit_layer(tdm_drm_layer_data *layer_data)
        if (output_data->current_mode)
                crtc_w = output_data->current_mode->hdisplay;
        else {
-               drmModeCrtcPtr crtc = drmModeGetCrtc(drm_data->drm_fd, output_data->crtc_id);
+               drmModeCrtcPtr crtc = drmModeGetCrtc(vc4_data->drm_fd, output_data->crtc_id);
                if (!crtc) {
                        TDM_ERR("getting crtc failed");
                        return TDM_ERROR_OPERATION_FAILED;
@@ -307,7 +307,7 @@ _tdm_drm_display_commit_layer(tdm_drm_layer_data *layer_data)
        layer_data->info_changed = 0;
 
        if (!layer_data->display_buffer) {
-               if (drmModeSetPlane(drm_data->drm_fd, layer_data->plane_id,
+               if (drmModeSetPlane(vc4_data->drm_fd, layer_data->plane_id,
                                    output_data->crtc_id, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
                        TDM_ERR("unset plane(%d) filed: %m", layer_data->plane_id);
 
@@ -320,7 +320,7 @@ _tdm_drm_display_commit_layer(tdm_drm_layer_data *layer_data)
        fw = ((unsigned int)layer_data->info.src_config.pos.w) << 16;
        fh = ((unsigned int)layer_data->info.src_config.pos.h) << 16;
 
-       if (drmModeSetPlane(drm_data->drm_fd, layer_data->plane_id,
+       if (drmModeSetPlane(vc4_data->drm_fd, layer_data->plane_id,
                            output_data->crtc_id, layer_data->display_buffer->fb_id, 0,
                            layer_data->info.dst_pos.x, layer_data->info.dst_pos.y,
                            layer_data->info.dst_pos.w, layer_data->info.dst_pos.h,
@@ -341,12 +341,12 @@ _tdm_drm_display_commit_layer(tdm_drm_layer_data *layer_data)
 }
 
 static void
-_tdm_drm_display_cb_event(int fd, unsigned int sequence,
+_tdm_vc4_display_cb_event(int fd, unsigned int sequence,
                           unsigned int tv_sec, unsigned int tv_usec,
                           void *user_data)
 {
-       tdm_drm_event_data *event_data = user_data;
-       tdm_drm_output_data *output_data;
+       tdm_vc4_event_data *event_data = user_data;
+       tdm_vc4_output_data *output_data;
 
        if (!event_data) {
                TDM_ERR("no event data");
@@ -379,31 +379,31 @@ _tdm_drm_display_cb_event(int fd, unsigned int sequence,
 }
 
 static tdm_error
-_tdm_drm_display_create_layer_list(tdm_drm_data *drm_data)
+_tdm_vc4_display_create_layer_list(tdm_vc4_data *vc4_data)
 {
-       tdm_drm_output_data *output_data = NULL;
+       tdm_vc4_output_data *output_data = NULL;
        int i;
 
-       if (LIST_IS_EMPTY(&drm_data->output_list)) {
+       if (LIST_IS_EMPTY(&vc4_data->output_list)) {
                TDM_ERR("no output");
                return TDM_ERROR_OPERATION_FAILED;
        }
 
        /* The TDM drm backend only support one output. */
-       LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link) {
+       LIST_FOR_EACH_ENTRY(output_data, &vc4_data->output_list, link) {
                break;
        }
 
-       if (drm_data->plane_res->count_planes == 0) {
+       if (vc4_data->plane_res->count_planes == 0) {
                TDM_ERR("no layer error");
                return TDM_ERROR_OPERATION_FAILED;
        }
 
-       for (i = 0; i < drm_data->plane_res->count_planes; i++) {
-               tdm_drm_layer_data *layer_data;
+       for (i = 0; i < vc4_data->plane_res->count_planes; i++) {
+               tdm_vc4_layer_data *layer_data;
                drmModePlanePtr plane;
 
-               plane = drmModeGetPlane(drm_data->drm_fd, drm_data->plane_res->planes[i]);
+               plane = drmModeGetPlane(vc4_data->drm_fd, vc4_data->plane_res->planes[i]);
                if (!plane) {
                        TDM_ERR("no plane");
                        continue;
@@ -414,16 +414,16 @@ _tdm_drm_display_create_layer_list(tdm_drm_data *drm_data)
                        continue;
                }
 
-               layer_data = calloc(1, sizeof(tdm_drm_layer_data));
+               layer_data = calloc(1, sizeof(tdm_vc4_layer_data));
                if (!layer_data) {
                        TDM_ERR("alloc failed");
                        drmModeFreePlane(plane);
                        continue;
                }
 
-               layer_data->drm_data = drm_data;
+               layer_data->vc4_data = vc4_data;
                layer_data->output_data = output_data;
-               layer_data->plane_id = drm_data->plane_res->planes[i];
+               layer_data->plane_id = vc4_data->plane_res->planes[i];
 
                layer_data->capabilities = TDM_LAYER_CAPABILITY_PRIMARY |
                                           TDM_LAYER_CAPABILITY_GRAPHIC;
@@ -447,7 +447,7 @@ _tdm_drm_display_create_layer_list(tdm_drm_data *drm_data)
 #if LIBDRM_MAJOR_VERSION >= 2 && LIBDRM_MINOR_VERSION >= 4  && LIBDRM_MICRO_VERSION >= 47
 
 static tdm_error
-_tdm_drm_display_get_property(tdm_drm_data *drm_data,
+_tdm_vc4_display_get_property(tdm_vc4_data *vc4_data,
                               unsigned int obj_id, unsigned int obj_type,
                               const char *name, unsigned int *value,
                               int *is_immutable)
@@ -455,12 +455,12 @@ _tdm_drm_display_get_property(tdm_drm_data *drm_data,
        drmModeObjectPropertiesPtr props = NULL;
        int i;
 
-       props = drmModeObjectGetProperties(drm_data->drm_fd, obj_id, obj_type);
+       props = drmModeObjectGetProperties(vc4_data->drm_fd, obj_id, obj_type);
        if (!props)
                return TDM_ERROR_OPERATION_FAILED;
 
        for (i = 0; i < props->count_props; i++) {
-               drmModePropertyPtr prop = drmModeGetProperty(drm_data->drm_fd,
+               drmModePropertyPtr prop = drmModeGetProperty(vc4_data->drm_fd,
                                          props->props[i]);
 
                if (!prop)
@@ -484,9 +484,9 @@ _tdm_drm_display_get_property(tdm_drm_data *drm_data,
 }
 
 static tdm_error
-_tdm_drm_display_create_layer_list_type(tdm_drm_data *drm_data)
+_tdm_vc4_display_create_layer_list_type(tdm_vc4_data *vc4_data)
 {
-       tdm_drm_output_data *output_data = NULL;
+       tdm_vc4_output_data *output_data = NULL;
        drmModePlanePtr *planes = NULL;
        unsigned int *types = NULL;
        unsigned int type = 0;
@@ -495,18 +495,18 @@ _tdm_drm_display_create_layer_list_type(tdm_drm_data *drm_data)
        tdm_error ret;
        int i;
 
-       if (LIST_IS_EMPTY(&drm_data->output_list)) {
+       if (LIST_IS_EMPTY(&vc4_data->output_list)) {
                TDM_ERR("no output");
                return TDM_ERROR_OPERATION_FAILED;
        }
 
        /* The TDM drm backend only support one output. */
-       LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link) {
+       LIST_FOR_EACH_ENTRY(output_data, &vc4_data->output_list, link) {
                break;
        }
 
-       ret = _tdm_drm_display_get_property(drm_data,
-                                           drm_data->plane_res->planes[0],
+       ret = _tdm_vc4_display_get_property(vc4_data,
+                                           vc4_data->plane_res->planes[0],
                                            DRM_MODE_OBJECT_PLANE, "type", &type,
                                            NULL);
        if (ret != TDM_ERROR_NONE) {
@@ -515,28 +515,28 @@ _tdm_drm_display_create_layer_list_type(tdm_drm_data *drm_data)
                /* if a plane doesn't have "type" property, we call a fallback function
                 * as default
                 */
-               return _tdm_drm_display_create_layer_list(drm_data);
+               return _tdm_vc4_display_create_layer_list(vc4_data);
        }
 
-       planes = calloc(drm_data->plane_res->count_planes, sizeof(drmModePlanePtr));
+       planes = calloc(vc4_data->plane_res->count_planes, sizeof(drmModePlanePtr));
        if (!planes) {
                TDM_ERR("alloc failed");
                goto failed;
        }
 
-       types = calloc(drm_data->plane_res->count_planes, sizeof(unsigned int));
+       types = calloc(vc4_data->plane_res->count_planes, sizeof(unsigned int));
        if (!types) {
                TDM_ERR("alloc failed");
                goto failed;
        }
 
        plane_cnt = 0;
-       for (i = 0; i < drm_data->plane_res->count_planes; i++) {
+       for (i = 0; i < vc4_data->plane_res->count_planes; i++) {
                drmModePlanePtr plane;
 
-               plane = drmModeGetPlane(drm_data->drm_fd, drm_data->plane_res->planes[i]);
+               plane = drmModeGetPlane(vc4_data->drm_fd, vc4_data->plane_res->planes[i]);
                if (!plane) {
-                       TDM_ERR("no plane(%d)", drm_data->plane_res->planes[i]);
+                       TDM_ERR("no plane(%d)", vc4_data->plane_res->planes[i]);
                        goto failed;
                }
 
@@ -545,14 +545,14 @@ _tdm_drm_display_create_layer_list_type(tdm_drm_data *drm_data)
                        continue;
                }
 
-               ret = _tdm_drm_display_get_property(drm_data,
-                                                   drm_data->plane_res->planes[i],
+               ret = _tdm_vc4_display_get_property(vc4_data,
+                                                   vc4_data->plane_res->planes[i],
                                                    DRM_MODE_OBJECT_PLANE, "type", &type,
                                                    NULL);
                if (ret != TDM_ERROR_NONE) {
                        drmModeFreePlane(plane);
                        TDM_ERR("plane(%d) doesn't have 'type' info",
-                               drm_data->plane_res->planes[i]);
+                               vc4_data->plane_res->planes[i]);
                        goto failed;
                }
 
@@ -581,15 +581,15 @@ _tdm_drm_display_create_layer_list_type(tdm_drm_data *drm_data)
        opos_next = 1;
        cpos_next = ovl_cnt;
        for (i = 0; i < plane_cnt; i++) {
-               tdm_drm_layer_data *layer_data;
+               tdm_vc4_layer_data *layer_data;
 
-               layer_data = calloc(1, sizeof(tdm_drm_layer_data));
+               layer_data = calloc(1, sizeof(tdm_vc4_layer_data));
                if (!layer_data) {
                        TDM_ERR("alloc failed");
                        goto failed;
                }
 
-               layer_data->drm_data = drm_data;
+               layer_data->vc4_data = vc4_data;
                layer_data->output_data = output_data;
                layer_data->plane_id = planes[i]->plane_id;
 
@@ -629,7 +629,7 @@ _tdm_drm_display_create_layer_list_type(tdm_drm_data *drm_data)
 
 failed:
        if (planes) {
-               for (i = 0; i < drm_data->plane_res->count_planes; i++)
+               for (i = 0; i < vc4_data->plane_res->count_planes; i++)
                        if (planes[i])
                                drmModeFreePlane(planes[i]);
                free(planes);
@@ -642,10 +642,10 @@ failed:
 #endif
 
 static void
-_tdm_drm_display_cb_destroy_buffer(tbm_surface_h buffer, void *user_data)
+_tdm_vc4_display_cb_destroy_buffer(tbm_surface_h buffer, void *user_data)
 {
-       tdm_drm_data *drm_data;
-       tdm_drm_display_buffer *display_buffer;
+       tdm_vc4_data *vc4_data;
+       tdm_vc4_display_buffer *display_buffer;
        int ret;
 
        if (!user_data) {
@@ -657,9 +657,9 @@ _tdm_drm_display_cb_destroy_buffer(tbm_surface_h buffer, void *user_data)
                return;
        }
 
-       drm_data = (tdm_drm_data *)user_data;
+       vc4_data = (tdm_vc4_data *)user_data;
 
-       display_buffer = _tdm_drm_display_find_buffer(drm_data, buffer);
+       display_buffer = _tdm_vc4_display_find_buffer(vc4_data, buffer);
        if (!display_buffer) {
                TDM_ERR("no display_buffer");
                return;
@@ -667,7 +667,7 @@ _tdm_drm_display_cb_destroy_buffer(tbm_surface_h buffer, void *user_data)
        LIST_DEL(&display_buffer->link);
 
        if (display_buffer->fb_id > 0) {
-               ret = drmModeRmFB(drm_data->drm_fd, display_buffer->fb_id);
+               ret = drmModeRmFB(vc4_data->drm_fd, display_buffer->fb_id);
                if (ret < 0) {
                        TDM_ERR("rm fb failed");
                        return;
@@ -680,22 +680,22 @@ _tdm_drm_display_cb_destroy_buffer(tbm_surface_h buffer, void *user_data)
 }
 
 tdm_error
-tdm_drm_display_create_layer_list(tdm_drm_data *drm_data)
+tdm_vc4_display_create_layer_list(tdm_vc4_data *vc4_data)
 {
-       tdm_drm_output_data *output_data = NULL;
+       tdm_vc4_output_data *output_data = NULL;
        tdm_error ret;
 
 #if LIBDRM_MAJOR_VERSION >= 2 && LIBDRM_MINOR_VERSION >= 4  && LIBDRM_MICRO_VERSION >= 47
-       if (drm_data->has_universal_plane)
-               ret = _tdm_drm_display_create_layer_list_type(drm_data);
+       if (vc4_data->has_universal_plane)
+               ret = _tdm_vc4_display_create_layer_list_type(vc4_data);
        else
 #endif
-               ret = _tdm_drm_display_create_layer_list(drm_data);
+               ret = _tdm_vc4_display_create_layer_list(vc4_data);
 
        if (ret != TDM_ERROR_NONE)
                return ret;
 
-       LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link) {
+       LIST_FOR_EACH_ENTRY(output_data, &vc4_data->output_list, link) {
                if (!output_data->primary_layer) {
                        TDM_ERR("output(%d) no primary layer", output_data->pipe);
                        return TDM_ERROR_OPERATION_FAILED;
@@ -706,41 +706,41 @@ tdm_drm_display_create_layer_list(tdm_drm_data *drm_data)
 }
 
 void
-tdm_drm_display_destroy_output_list(tdm_drm_data *drm_data)
+tdm_vc4_display_destroy_output_list(tdm_vc4_data *vc4_data)
 {
-       tdm_drm_output_data *o = NULL, *oo = NULL;
+       tdm_vc4_output_data *o = NULL, *oo = NULL;
 
-       if (LIST_IS_EMPTY(&drm_data->output_list))
+       if (LIST_IS_EMPTY(&vc4_data->output_list))
                return;
 
-       LIST_FOR_EACH_ENTRY_SAFE(o, oo, &drm_data->output_list, link) {
+       LIST_FOR_EACH_ENTRY_SAFE(o, oo, &vc4_data->output_list, link) {
                LIST_DEL(&o->link);
                if (!LIST_IS_EMPTY(&o->layer_list)) {
-                       tdm_drm_layer_data *l = NULL, *ll = NULL;
+                       tdm_vc4_layer_data *l = NULL, *ll = NULL;
                        LIST_FOR_EACH_ENTRY_SAFE(l, ll, &o->layer_list, link) {
                                LIST_DEL(&l->link);
                                free(l);
                        }
                }
-               free(o->drm_modes);
+               free(o->vc4_modes);
                free(o->output_modes);
                free(o);
        }
 }
 
 void
-tdm_drm_display_update_output_status(tdm_drm_data *drm_data)
+tdm_vc4_display_update_output_status(tdm_vc4_data *vc4_data)
 {
-       tdm_drm_output_data *output_data = NULL;
+       tdm_vc4_output_data *output_data = NULL;
 
-       if (LIST_IS_EMPTY(&drm_data->output_list))
+       if (LIST_IS_EMPTY(&vc4_data->output_list))
                return;
 
-       LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link) {
+       LIST_FOR_EACH_ENTRY(output_data, &vc4_data->output_list, link) {
                drmModeConnectorPtr connector;
                tdm_output_conn_status new_status;
 
-               connector = drmModeGetConnector(drm_data->drm_fd,
+               connector = drmModeGetConnector(vc4_data->drm_fd,
                                                output_data->connector_id);
                if (!connector) {
                        TDM_ERR("no connector: %d", output_data->connector_id);
@@ -752,30 +752,30 @@ tdm_drm_display_update_output_status(tdm_drm_data *drm_data)
                else
                        new_status = TDM_OUTPUT_CONN_STATUS_DISCONNECTED;
 
-               _tdm_drm_output_update_status(output_data, new_status);
+               _tdm_vc4_output_update_status(output_data, new_status);
 
                drmModeFreeConnector(connector);
        }
 }
 
 tdm_error
-tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
+tdm_vc4_display_create_output_list(tdm_vc4_data *vc4_data)
 {
-       tdm_drm_output_data *output_data;
+       tdm_vc4_output_data *output_data;
        int i;
        tdm_error ret;
        int allocated = 0;
 
-       RETURN_VAL_IF_FAIL(LIST_IS_EMPTY(&drm_data->output_list),
+       RETURN_VAL_IF_FAIL(LIST_IS_EMPTY(&vc4_data->output_list),
                           TDM_ERROR_OPERATION_FAILED);
 
-       for (i = 0; i < drm_data->mode_res->count_connectors; i++) {
+       for (i = 0; i < vc4_data->mode_res->count_connectors; i++) {
                drmModeConnectorPtr connector;
                drmModeEncoderPtr encoder;
                int crtc_id = 0, c, j;
 
-               connector = drmModeGetConnector(drm_data->drm_fd,
-                                               drm_data->mode_res->connectors[i]);
+               connector = drmModeGetConnector(vc4_data->drm_fd,
+                                               vc4_data->mode_res->connectors[i]);
                if (!connector) {
                        TDM_ERR("no connector");
                        ret = TDM_ERROR_OPERATION_FAILED;
@@ -800,7 +800,7 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
                        goto failed_create;
                }
 
-               encoder = drmModeGetEncoder(drm_data->drm_fd, connector->encoders[0]);
+               encoder = drmModeGetEncoder(vc4_data->drm_fd, connector->encoders[0]);
                if (!encoder) {
                        TDM_ERR("no encoder");
                        drmModeFreeConnector(connector);
@@ -808,14 +808,14 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
                        goto failed_create;
                }
 
-               for (c = 0; c < drm_data->mode_res->count_crtcs; c++) {
+               for (c = 0; c < vc4_data->mode_res->count_crtcs; c++) {
                        if (allocated & (1 << c))
                                continue;
 
                        if ((encoder->possible_crtcs & (1 << c)) == 0)
                                continue;
 
-                       crtc_id = drm_data->mode_res->crtcs[c];
+                       crtc_id = vc4_data->mode_res->crtcs[c];
                        allocated |= (1 << c);
                        break;
                }
@@ -827,7 +827,7 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
                        goto failed_create;
                }
 
-               output_data = calloc(1, sizeof(tdm_drm_output_data));
+               output_data = calloc(1, sizeof(tdm_vc4_output_data));
                if (!output_data) {
                        TDM_ERR("alloc failed");
                        drmModeFreeConnector(connector);
@@ -838,8 +838,8 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
 
                LIST_INITHEAD(&output_data->layer_list);
 
-               output_data->drm_data = drm_data;
-               output_data->connector_id = drm_data->mode_res->connectors[i];
+               output_data->vc4_data = vc4_data;
+               output_data->connector_id = vc4_data->mode_res->connectors[i];
                output_data->encoder_id = encoder->encoder_id;
                output_data->crtc_id = crtc_id;
                output_data->pipe = c;
@@ -852,7 +852,7 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
                        output_data->status = TDM_OUTPUT_CONN_STATUS_DISCONNECTED;
 
                for (j = 0; j < connector->count_props; j++) {
-                       drmModePropertyPtr prop = drmModeGetProperty(drm_data->drm_fd,
+                       drmModePropertyPtr prop = drmModeGetProperty(vc4_data->drm_fd,
                                                  connector->props[j]);
                        if (!prop)
                                continue;
@@ -868,9 +868,9 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
                        TDM_WRN("not support DPMS");
 
                output_data->count_modes = connector->count_modes;
-               output_data->drm_modes = calloc(connector->count_modes,
+               output_data->vc4_modes = calloc(connector->count_modes,
                                                sizeof(drmModeModeInfo));
-               if (!output_data->drm_modes) {
+               if (!output_data->vc4_modes) {
                        TDM_ERR("alloc failed");
                        free(output_data);
                        drmModeFreeConnector(connector);
@@ -882,7 +882,7 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
                                                   sizeof(tdm_output_mode));
                if (!output_data->output_modes) {
                        TDM_ERR("alloc failed");
-                       free(output_data->drm_modes);
+                       free(output_data->vc4_modes);
                        free(output_data);
                        drmModeFreeConnector(connector);
                        drmModeFreeEncoder(encoder);
@@ -890,12 +890,12 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
                        goto failed_create;
                }
                for (j = 0; j < connector->count_modes; j++) {
-                       output_data->drm_modes[j] = connector->modes[j];
-                       _tdm_drm_display_to_tdm_mode(&output_data->drm_modes[j],
+                       output_data->vc4_modes[j] = connector->modes[j];
+                       _tdm_vc4_display_to_tdm_mode(&output_data->vc4_modes[j],
                                                     &output_data->output_modes[j]);
                }
 
-               LIST_ADDTAIL(&output_data->link, &drm_data->output_list);
+               LIST_ADDTAIL(&output_data->link, &vc4_data->output_list);
 
                TDM_DBG("output_data(%p) connector_id(%d:%d:%d-%d) encoder_id(%d) crtc_id(%d) pipe(%d) dpms_id(%d)",
                        output_data, output_data->connector_id, output_data->status,
@@ -915,16 +915,16 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
                break;
        }
 
-       TDM_DBG("output count: %d", drm_data->mode_res->count_connectors);
+       TDM_DBG("output count: %d", vc4_data->mode_res->count_connectors);
 
        return TDM_ERROR_NONE;
 failed_create:
-       tdm_drm_display_destroy_output_list(drm_data);
+       tdm_vc4_display_destroy_output_list(vc4_data);
        return ret;
 }
 
 tdm_error
-drm_display_get_capability(tdm_backend_data *bdata, tdm_caps_display *caps)
+vc4_display_get_capability(tdm_backend_data *bdata, tdm_caps_display *caps)
 {
        RETURN_VAL_IF_FAIL(caps, TDM_ERROR_INVALID_PARAMETER);
 
@@ -934,25 +934,25 @@ drm_display_get_capability(tdm_backend_data *bdata, tdm_caps_display *caps)
 }
 
 tdm_error
-drm_display_get_pp_capability(tdm_backend_data *bdata, tdm_caps_pp *caps)
+vc4_display_get_pp_capability(tdm_backend_data *bdata, tdm_caps_pp *caps)
 {
-       return tdm_drm_pp_get_capability(bdata, caps);
+       return tdm_vc4_pp_get_capability(bdata, caps);
 }
 
 tdm_output **
-drm_display_get_outputs(tdm_backend_data *bdata, int *count, tdm_error *error)
+vc4_display_get_outputs(tdm_backend_data *bdata, int *count, tdm_error *error)
 {
-       tdm_drm_data *drm_data = bdata;
-       tdm_drm_output_data *output_data = NULL;
+       tdm_vc4_data *vc4_data = bdata;
+       tdm_vc4_output_data *output_data = NULL;
        tdm_output **outputs;
        tdm_error ret;
        int i;
 
-       RETURN_VAL_IF_FAIL(drm_data, NULL);
+       RETURN_VAL_IF_FAIL(vc4_data, NULL);
        RETURN_VAL_IF_FAIL(count, NULL);
 
        *count = 0;
-       LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link)
+       LIST_FOR_EACH_ENTRY(output_data, &vc4_data->output_list, link)
        (*count)++;
 
        if (*count == 0) {
@@ -961,7 +961,7 @@ drm_display_get_outputs(tdm_backend_data *bdata, int *count, tdm_error *error)
        }
 
        /* will be freed in frontend */
-       outputs = calloc(*count, sizeof(tdm_drm_output_data *));
+       outputs = calloc(*count, sizeof(tdm_vc4_output_data *));
        if (!outputs) {
                TDM_ERR("failed: alloc memory");
                *count = 0;
@@ -970,7 +970,7 @@ drm_display_get_outputs(tdm_backend_data *bdata, int *count, tdm_error *error)
        }
 
        i = 0;
-       LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link)
+       LIST_FOR_EACH_ENTRY(output_data, &vc4_data->output_list, link)
        outputs[i++] = output_data;
 
        if (error)
@@ -984,52 +984,52 @@ failed_get:
 }
 
 tdm_error
-drm_display_get_fd(tdm_backend_data *bdata, int *fd)
+vc4_display_get_fd(tdm_backend_data *bdata, int *fd)
 {
-       tdm_drm_data *drm_data = bdata;
+       tdm_vc4_data *vc4_data = bdata;
 
-       RETURN_VAL_IF_FAIL(drm_data, TDM_ERROR_INVALID_PARAMETER);
+       RETURN_VAL_IF_FAIL(vc4_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(fd, TDM_ERROR_INVALID_PARAMETER);
 
-       *fd = drm_data->drm_fd;
+       *fd = vc4_data->drm_fd;
 
        return TDM_ERROR_NONE;
 }
 
 tdm_error
-drm_display_handle_events(tdm_backend_data *bdata)
+vc4_display_handle_events(tdm_backend_data *bdata)
 {
-       tdm_drm_data *drm_data = bdata;
+       tdm_vc4_data *vc4_data = bdata;
        drmEventContext ctx;
 
-       RETURN_VAL_IF_FAIL(drm_data, TDM_ERROR_INVALID_PARAMETER);
+       RETURN_VAL_IF_FAIL(vc4_data, TDM_ERROR_INVALID_PARAMETER);
 
        memset(&ctx, 0, sizeof(drmEventContext));
 
        ctx.version = DRM_EVENT_CONTEXT_VERSION;
-       ctx.page_flip_handler = _tdm_drm_display_cb_event;
-       ctx.vblank_handler = _tdm_drm_display_cb_event;
+       ctx.page_flip_handler = _tdm_vc4_display_cb_event;
+       ctx.vblank_handler = _tdm_vc4_display_cb_event;
 
-       drmHandleEvent(drm_data->drm_fd, &ctx);
+       drmHandleEvent(vc4_data->drm_fd, &ctx);
 
        return TDM_ERROR_NONE;
 }
 
 tdm_pp *
-drm_display_create_pp(tdm_backend_data *bdata, tdm_error *error)
+vc4_display_create_pp(tdm_backend_data *bdata, tdm_error *error)
 {
-       tdm_drm_data *drm_data = bdata;
+       tdm_vc4_data *vc4_data = bdata;
 
-       RETURN_VAL_IF_FAIL(drm_data, NULL);
+       RETURN_VAL_IF_FAIL(vc4_data, NULL);
 
-       return tdm_drm_pp_create(drm_data, error);
+       return tdm_vc4_pp_create(vc4_data, error);
 }
 
 tdm_error
-drm_output_get_capability(tdm_output *output, tdm_caps_output *caps)
+vc4_output_get_capability(tdm_output *output, tdm_caps_output *caps)
 {
-       tdm_drm_output_data *output_data = output;
-       tdm_drm_data *drm_data;
+       tdm_vc4_output_data *output_data = output;
+       tdm_vc4_data *vc4_data;
        drmModeConnectorPtr connector = NULL;
        drmModeCrtcPtr crtc = NULL;
        drmModeObjectPropertiesPtr props = NULL;
@@ -1041,7 +1041,7 @@ drm_output_get_capability(tdm_output *output, tdm_caps_output *caps)
 
        memset(caps, 0, sizeof(tdm_caps_output));
 
-       drm_data = output_data->drm_data;
+       vc4_data = output_data->vc4_data;
 
        snprintf(caps->maker, TDM_NAME_LEN, "unknown");
        snprintf(caps->model, TDM_NAME_LEN, "unknown");
@@ -1051,7 +1051,7 @@ drm_output_get_capability(tdm_output *output, tdm_caps_output *caps)
        caps->type = output_data->connector_type;
        caps->type_id = output_data->connector_type_id;
 
-       connector = drmModeGetConnector(drm_data->drm_fd, output_data->connector_id);
+       connector = drmModeGetConnector(vc4_data->drm_fd, output_data->connector_id);
        RETURN_VAL_IF_FAIL(connector, TDM_ERROR_OPERATION_FAILED);
 
        caps->mode_count = connector->count_modes;
@@ -1068,20 +1068,20 @@ drm_output_get_capability(tdm_output *output, tdm_caps_output *caps)
        caps->mmHeight = connector->mmHeight;
        caps->subpixel = connector->subpixel;
 
-       caps->min_w = drm_data->mode_res->min_width;
-       caps->min_h = drm_data->mode_res->min_height;
-       caps->max_w = drm_data->mode_res->max_width;
-       caps->max_h = drm_data->mode_res->max_height;
+       caps->min_w = vc4_data->mode_res->min_width;
+       caps->min_h = vc4_data->mode_res->min_height;
+       caps->max_w = vc4_data->mode_res->max_width;
+       caps->max_h = vc4_data->mode_res->max_height;
        caps->preferred_align = -1;
 
-       crtc = drmModeGetCrtc(drm_data->drm_fd, output_data->crtc_id);
+       crtc = drmModeGetCrtc(vc4_data->drm_fd, output_data->crtc_id);
        if (!crtc) {
                ret = TDM_ERROR_OPERATION_FAILED;
                TDM_ERR("get crtc failed: %m\n");
                goto failed_get;
        }
 
-       props = drmModeObjectGetProperties(drm_data->drm_fd, output_data->crtc_id,
+       props = drmModeObjectGetProperties(vc4_data->drm_fd, output_data->crtc_id,
                                           DRM_MODE_OBJECT_CRTC);
        if (!props) {
                ret = TDM_ERROR_OPERATION_FAILED;
@@ -1098,7 +1098,7 @@ drm_output_get_capability(tdm_output *output, tdm_caps_output *caps)
        }
 
        for (i = 0; i < caps->prop_count; i++) {
-               drmModePropertyPtr prop = drmModeGetProperty(drm_data->drm_fd, props->props[i]);
+               drmModePropertyPtr prop = drmModeGetProperty(vc4_data->drm_fd, props->props[i]);
                if (!prop)
                        continue;
                snprintf(caps->props[i].name, TDM_NAME_LEN, "%s", prop->name);
@@ -1122,10 +1122,10 @@ failed_get:
 }
 
 tdm_layer **
-drm_output_get_layers(tdm_output *output,  int *count, tdm_error *error)
+vc4_output_get_layers(tdm_output *output,  int *count, tdm_error *error)
 {
-       tdm_drm_output_data *output_data = output;
-       tdm_drm_layer_data *layer_data = NULL;
+       tdm_vc4_output_data *output_data = output;
+       tdm_vc4_layer_data *layer_data = NULL;
        tdm_layer **layers;
        tdm_error ret;
        int i;
@@ -1143,7 +1143,7 @@ drm_output_get_layers(tdm_output *output,  int *count, tdm_error *error)
        }
 
        /* will be freed in frontend */
-       layers = calloc(*count, sizeof(tdm_drm_layer_data *));
+       layers = calloc(*count, sizeof(tdm_vc4_layer_data *));
        if (!layers) {
                TDM_ERR("failed: alloc memory");
                *count = 0;
@@ -1166,17 +1166,17 @@ failed_get:
 }
 
 tdm_error
-drm_output_set_property(tdm_output *output, unsigned int id, tdm_value value)
+vc4_output_set_property(tdm_output *output, unsigned int id, tdm_value value)
 {
-       tdm_drm_output_data *output_data = output;
-       tdm_drm_data *drm_data;
+       tdm_vc4_output_data *output_data = output;
+       tdm_vc4_data *vc4_data;
        int ret;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(output_data->crtc_id > 0, TDM_ERROR_INVALID_PARAMETER);
 
-       drm_data = output_data->drm_data;
-       ret = drmModeObjectSetProperty(drm_data->drm_fd,
+       vc4_data = output_data->vc4_data;
+       ret = drmModeObjectSetProperty(vc4_data->drm_fd,
                                       output_data->crtc_id, DRM_MODE_OBJECT_CRTC,
                                       id, value.u32);
        if (ret < 0) {
@@ -1188,10 +1188,10 @@ drm_output_set_property(tdm_output *output, unsigned int id, tdm_value value)
 }
 
 tdm_error
-drm_output_get_property(tdm_output *output, unsigned int id, tdm_value *value)
+vc4_output_get_property(tdm_output *output, unsigned int id, tdm_value *value)
 {
-       tdm_drm_output_data *output_data = output;
-       tdm_drm_data *drm_data;
+       tdm_vc4_output_data *output_data = output;
+       tdm_vc4_data *vc4_data;
        drmModeObjectPropertiesPtr props;
        int i;
 
@@ -1199,8 +1199,8 @@ drm_output_get_property(tdm_output *output, unsigned int id, tdm_value *value)
        RETURN_VAL_IF_FAIL(output_data->crtc_id > 0, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(value, TDM_ERROR_INVALID_PARAMETER);
 
-       drm_data = output_data->drm_data;
-       props = drmModeObjectGetProperties(drm_data->drm_fd, output_data->crtc_id,
+       vc4_data = output_data->vc4_data;
+       props = drmModeObjectGetProperties(vc4_data->drm_fd, output_data->crtc_id,
                                           DRM_MODE_OBJECT_CRTC);
        if (props == NULL) {
                TDM_ERR("get property failed: %m");
@@ -1219,26 +1219,26 @@ drm_output_get_property(tdm_output *output, unsigned int id, tdm_value *value)
 }
 
 tdm_error
-drm_output_wait_vblank(tdm_output *output, int interval, int sync,
+vc4_output_wait_vblank(tdm_output *output, int interval, int sync,
                        void *user_data)
 {
-       tdm_drm_output_data *output_data = output;
-       tdm_drm_data *drm_data;
-       tdm_drm_event_data *event_data;
+       tdm_vc4_output_data *output_data = output;
+       tdm_vc4_data *vc4_data;
+       tdm_vc4_event_data *event_data;
        uint target_msc;
        tdm_error ret;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
 
-       event_data = calloc(1, sizeof(tdm_drm_event_data));
+       event_data = calloc(1, sizeof(tdm_vc4_event_data));
        if (!event_data) {
                TDM_ERR("alloc failed");
                return TDM_ERROR_OUT_OF_MEMORY;
        }
 
-       drm_data = output_data->drm_data;
+       vc4_data = output_data->vc4_data;
 
-       ret = _tdm_drm_display_get_cur_msc(drm_data->drm_fd, output_data->pipe,
+       ret = _tdm_vc4_display_get_cur_msc(vc4_data->drm_fd, output_data->pipe,
                                           &target_msc);
        if (ret != TDM_ERROR_NONE)
                goto failed_vblank;
@@ -1249,7 +1249,7 @@ drm_output_wait_vblank(tdm_output *output, int interval, int sync,
        event_data->output_data = output_data;
        event_data->user_data = user_data;
 
-       ret = _tdm_drm_display_wait_vblank(drm_data->drm_fd, output_data->pipe,
+       ret = _tdm_vc4_display_wait_vblank(vc4_data->drm_fd, output_data->pipe,
                                           &target_msc, event_data);
        if (ret != TDM_ERROR_NONE)
                goto failed_vblank;
@@ -1261,10 +1261,10 @@ failed_vblank:
 }
 
 tdm_error
-drm_output_set_vblank_handler(tdm_output *output,
+vc4_output_set_vblank_handler(tdm_output *output,
                               tdm_output_vblank_handler func)
 {
-       tdm_drm_output_data *output_data = output;
+       tdm_vc4_output_data *output_data = output;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(func, TDM_ERROR_INVALID_PARAMETER);
@@ -1275,33 +1275,33 @@ drm_output_set_vblank_handler(tdm_output *output,
 }
 
 tdm_error
-drm_output_commit(tdm_output *output, int sync, void *user_data)
+vc4_output_commit(tdm_output *output, int sync, void *user_data)
 {
-       tdm_drm_output_data *output_data = output;
-       tdm_drm_data *drm_data;
-       tdm_drm_layer_data *layer_data = NULL;
+       tdm_vc4_output_data *output_data = output;
+       tdm_vc4_data *vc4_data;
+       tdm_vc4_layer_data *layer_data = NULL;
        tdm_error ret;
        int do_waitvblank = 1;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
 
-       drm_data = output_data->drm_data;
+       vc4_data = output_data->vc4_data;
 
        LIST_FOR_EACH_ENTRY(layer_data, &output_data->layer_list, link) {
                if (layer_data == output_data->primary_layer) {
-                       ret = _tdm_drm_display_commit_primary_layer(layer_data, user_data,
+                       ret = _tdm_vc4_display_commit_primary_layer(layer_data, user_data,
                                        &do_waitvblank);
                        if (ret != TDM_ERROR_NONE)
                                return ret;
                } else {
-                       ret = _tdm_drm_display_commit_layer(layer_data);
+                       ret = _tdm_vc4_display_commit_layer(layer_data);
                        if (ret != TDM_ERROR_NONE)
                                return ret;
                }
        }
 
        if (do_waitvblank == 1) {
-               tdm_drm_event_data *event_data = calloc(1, sizeof(tdm_drm_event_data));
+               tdm_vc4_event_data *event_data = calloc(1, sizeof(tdm_vc4_event_data));
                uint target_msc;
 
                if (!event_data) {
@@ -1309,7 +1309,7 @@ drm_output_commit(tdm_output *output, int sync, void *user_data)
                        return TDM_ERROR_OUT_OF_MEMORY;
                }
 
-               ret = _tdm_drm_display_get_cur_msc(drm_data->drm_fd, output_data->pipe,
+               ret = _tdm_vc4_display_get_cur_msc(vc4_data->drm_fd, output_data->pipe,
                                                   &target_msc);
                if (ret != TDM_ERROR_NONE) {
                        free(event_data);
@@ -1322,7 +1322,7 @@ drm_output_commit(tdm_output *output, int sync, void *user_data)
                event_data->output_data = output_data;
                event_data->user_data = user_data;
 
-               ret = _tdm_drm_display_wait_vblank(drm_data->drm_fd, output_data->pipe,
+               ret = _tdm_vc4_display_wait_vblank(vc4_data->drm_fd, output_data->pipe,
                                                   &target_msc, event_data);
                if (ret != TDM_ERROR_NONE) {
                        free(event_data);
@@ -1334,10 +1334,10 @@ drm_output_commit(tdm_output *output, int sync, void *user_data)
 }
 
 tdm_error
-drm_output_set_commit_handler(tdm_output *output,
+vc4_output_set_commit_handler(tdm_output *output,
                               tdm_output_commit_handler func)
 {
-       tdm_drm_output_data *output_data = output;
+       tdm_vc4_output_data *output_data = output;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(func, TDM_ERROR_INVALID_PARAMETER);
@@ -1348,10 +1348,10 @@ drm_output_set_commit_handler(tdm_output *output,
 }
 
 tdm_error
-drm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value)
+vc4_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value)
 {
-       tdm_drm_output_data *output_data = output;
-       tdm_drm_data *drm_data;
+       tdm_vc4_output_data *output_data = output;
+       tdm_vc4_data *vc4_data;
        int ret;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
@@ -1361,8 +1361,8 @@ drm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value)
                return TDM_ERROR_OPERATION_FAILED;
        }
 
-       drm_data = output_data->drm_data;
-       ret = drmModeObjectSetProperty(drm_data->drm_fd,
+       vc4_data = output_data->vc4_data;
+       ret = drmModeObjectSetProperty(vc4_data->drm_fd,
                                       output_data->connector_id, DRM_MODE_OBJECT_CONNECTOR,
                                       output_data->dpms_prop_id, dpms_value);
        if (ret < 0) {
@@ -1374,18 +1374,18 @@ drm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value)
 }
 
 tdm_error
-drm_output_get_dpms(tdm_output *output, tdm_output_dpms *dpms_value)
+vc4_output_get_dpms(tdm_output *output, tdm_output_dpms *dpms_value)
 {
-       tdm_drm_output_data *output_data = output;
-       tdm_drm_data *drm_data;
+       tdm_vc4_output_data *output_data = output;
+       tdm_vc4_data *vc4_data;
        drmModeObjectPropertiesPtr props;
        int i;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(dpms_value, TDM_ERROR_INVALID_PARAMETER);
 
-       drm_data = output_data->drm_data;
-       props = drmModeObjectGetProperties(drm_data->drm_fd, output_data->connector_id,
+       vc4_data = output_data->vc4_data;
+       props = drmModeObjectGetProperties(vc4_data->drm_fd, output_data->connector_id,
                                           DRM_MODE_OBJECT_CONNECTOR);
        if (props == NULL) {
                TDM_ERR("get property failed: %m");
@@ -1404,9 +1404,9 @@ drm_output_get_dpms(tdm_output *output, tdm_output_dpms *dpms_value)
 }
 
 tdm_error
-drm_output_set_mode(tdm_output *output, const tdm_output_mode *mode)
+vc4_output_set_mode(tdm_output *output, const tdm_output_mode *mode)
 {
-       tdm_drm_output_data *output_data = output;
+       tdm_vc4_output_data *output_data = output;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(mode, TDM_ERROR_INVALID_PARAMETER);
@@ -1418,9 +1418,9 @@ drm_output_set_mode(tdm_output *output, const tdm_output_mode *mode)
 }
 
 tdm_error
-drm_output_get_mode(tdm_output *output, const tdm_output_mode **mode)
+vc4_output_get_mode(tdm_output *output, const tdm_output_mode **mode)
 {
-       tdm_drm_output_data *output_data = output;
+       tdm_vc4_output_data *output_data = output;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(mode, TDM_ERROR_INVALID_PARAMETER);
@@ -1431,11 +1431,11 @@ drm_output_get_mode(tdm_output *output, const tdm_output_mode **mode)
 }
 
 tdm_error
-drm_output_set_status_handler(tdm_output *output,
+vc4_output_set_status_handler(tdm_output *output,
                               tdm_output_status_handler func,
                               void *user_data)
 {
-       tdm_drm_output_data *output_data = output;
+       tdm_vc4_output_data *output_data = output;
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(func, TDM_ERROR_INVALID_PARAMETER);
@@ -1447,10 +1447,10 @@ drm_output_set_status_handler(tdm_output *output,
 }
 
 tdm_error
-drm_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps)
+vc4_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps)
 {
-       tdm_drm_layer_data *layer_data = layer;
-       tdm_drm_data *drm_data;
+       tdm_vc4_layer_data *layer_data = layer;
+       tdm_vc4_data *vc4_data;
        drmModePlanePtr plane = NULL;
        drmModeObjectPropertiesPtr props = NULL;
        int i, format_count = 0;
@@ -1461,8 +1461,8 @@ drm_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps)
 
        memset(caps, 0, sizeof(tdm_caps_layer));
 
-       drm_data = layer_data->drm_data;
-       plane = drmModeGetPlane(drm_data->drm_fd, layer_data->plane_id);
+       vc4_data = layer_data->vc4_data;
+       plane = drmModeGetPlane(vc4_data->drm_fd, layer_data->plane_id);
        if (!plane) {
                TDM_ERR("get plane failed: %m");
                ret = TDM_ERROR_OPERATION_FAILED;
@@ -1485,13 +1485,13 @@ drm_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps)
                if (plane->formats[i] != DRM_FORMAT_XRGB8888 &&
                    plane->formats[i] != DRM_FORMAT_ARGB8888)
                        continue;
-               caps->formats[i] = tdm_drm_format_to_tbm_format(plane->formats[i]);
+               caps->formats[i] = tdm_vc4_format_to_tbm_format(plane->formats[i]);
                format_count++;
        }
 
        caps->format_count = format_count;
 
-       props = drmModeObjectGetProperties(drm_data->drm_fd, layer_data->plane_id,
+       props = drmModeObjectGetProperties(vc4_data->drm_fd, layer_data->plane_id,
                                           DRM_MODE_OBJECT_PLANE);
        if (!props) {
                ret = TDM_ERROR_OPERATION_FAILED;
@@ -1508,7 +1508,7 @@ drm_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps)
 
        caps->prop_count = 0;
        for (i = 0; i < props->count_props; i++) {
-               drmModePropertyPtr prop = drmModeGetProperty(drm_data->drm_fd, props->props[i]);
+               drmModePropertyPtr prop = drmModeGetProperty(vc4_data->drm_fd, props->props[i]);
                if (!prop)
                        continue;
                if (!strncmp(prop->name, "type", TDM_NAME_LEN))
@@ -1535,17 +1535,17 @@ failed_get:
 }
 
 tdm_error
-drm_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value value)
+vc4_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value value)
 {
-       tdm_drm_layer_data *layer_data = layer;
-       tdm_drm_data *drm_data;
+       tdm_vc4_layer_data *layer_data = layer;
+       tdm_vc4_data *vc4_data;
        int ret;
 
        RETURN_VAL_IF_FAIL(layer_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(layer_data->plane_id > 0, TDM_ERROR_INVALID_PARAMETER);
 
-       drm_data = layer_data->drm_data;
-       ret = drmModeObjectSetProperty(drm_data->drm_fd,
+       vc4_data = layer_data->vc4_data;
+       ret = drmModeObjectSetProperty(vc4_data->drm_fd,
                                       layer_data->plane_id, DRM_MODE_OBJECT_PLANE,
                                       id, value.u32);
        if (ret < 0) {
@@ -1557,10 +1557,10 @@ drm_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value value)
 }
 
 tdm_error
-drm_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value)
+vc4_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value)
 {
-       tdm_drm_layer_data *layer_data = layer;
-       tdm_drm_data *drm_data;
+       tdm_vc4_layer_data *layer_data = layer;
+       tdm_vc4_data *vc4_data;
        drmModeObjectPropertiesPtr props;
        int i;
 
@@ -1568,8 +1568,8 @@ drm_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value)
        RETURN_VAL_IF_FAIL(layer_data->plane_id > 0, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(value, TDM_ERROR_INVALID_PARAMETER);
 
-       drm_data = layer_data->drm_data;
-       props = drmModeObjectGetProperties(drm_data->drm_fd, layer_data->plane_id,
+       vc4_data = layer_data->vc4_data;
+       props = drmModeObjectGetProperties(vc4_data->drm_fd, layer_data->plane_id,
                                           DRM_MODE_OBJECT_PLANE);
        if (props == NULL) {
                TDM_ERR("get property failed: %m");
@@ -1588,9 +1588,9 @@ drm_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value)
 }
 
 tdm_error
-drm_layer_set_info(tdm_layer *layer, tdm_info_layer *info)
+vc4_layer_set_info(tdm_layer *layer, tdm_info_layer *info)
 {
-       tdm_drm_layer_data *layer_data = layer;
+       tdm_vc4_layer_data *layer_data = layer;
 
        RETURN_VAL_IF_FAIL(layer_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(info, TDM_ERROR_INVALID_PARAMETER);
@@ -1602,9 +1602,9 @@ drm_layer_set_info(tdm_layer *layer, tdm_info_layer *info)
 }
 
 tdm_error
-drm_layer_get_info(tdm_layer *layer, tdm_info_layer *info)
+vc4_layer_get_info(tdm_layer *layer, tdm_info_layer *info)
 {
-       tdm_drm_layer_data *layer_data = layer;
+       tdm_vc4_layer_data *layer_data = layer;
 
        RETURN_VAL_IF_FAIL(layer_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(info, TDM_ERROR_INVALID_PARAMETER);
@@ -1615,37 +1615,37 @@ drm_layer_get_info(tdm_layer *layer, tdm_info_layer *info)
 }
 
 tdm_error
-drm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
+vc4_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
 {
-       tdm_drm_layer_data *layer_data = layer;
-       tdm_drm_data *drm_data;
-       tdm_drm_display_buffer *display_buffer;
+       tdm_vc4_layer_data *layer_data = layer;
+       tdm_vc4_data *vc4_data;
+       tdm_vc4_display_buffer *display_buffer;
        tdm_error err = TDM_ERROR_NONE;
        int ret, i, count;
 
        RETURN_VAL_IF_FAIL(layer_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(buffer, TDM_ERROR_INVALID_PARAMETER);
 
-       drm_data = layer_data->drm_data;
+       vc4_data = layer_data->vc4_data;
 
-       display_buffer = _tdm_drm_display_find_buffer(drm_data, buffer);
+       display_buffer = _tdm_vc4_display_find_buffer(vc4_data, buffer);
        if (!display_buffer) {
-               display_buffer = calloc(1, sizeof(tdm_drm_display_buffer));
+               display_buffer = calloc(1, sizeof(tdm_vc4_display_buffer));
                if (!display_buffer) {
                        TDM_ERR("alloc failed");
                        return TDM_ERROR_OUT_OF_MEMORY;
                }
                display_buffer->buffer = buffer;
 
-               err = tdm_buffer_add_destroy_handler(buffer, _tdm_drm_display_cb_destroy_buffer,
-                                                    drm_data);
+               err = tdm_buffer_add_destroy_handler(buffer, _tdm_vc4_display_cb_destroy_buffer,
+                                                    vc4_data);
                if (err != TDM_ERROR_NONE) {
                        TDM_ERR("add destroy handler fail");
                        free(display_buffer);
                        return TDM_ERROR_OPERATION_FAILED;
                }
 
-               LIST_ADDTAIL(&display_buffer->link, &drm_data->buffer_list);
+               LIST_ADDTAIL(&display_buffer->link, &vc4_data->buffer_list);
        }
 
        if (display_buffer->fb_id == 0) {
@@ -1669,13 +1669,13 @@ drm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
                for (i = 0; i < count; i++)
                        tbm_surface_internal_get_plane_data(buffer, i, &size, &offsets[i], &pitches[i]);
 
-               ret = drmModeAddFB2(drm_data->drm_fd, width, height, format,
+               ret = drmModeAddFB2(vc4_data->drm_fd, width, height, format,
                                    handles, pitches, offsets, &display_buffer->fb_id, 0);
                if (ret < 0) {
                        TDM_ERR("add fb failed: %m");
                        return TDM_ERROR_OPERATION_FAILED;
                }
-               TDM_DBG("drm_data->drm_fd : %d, display_buffer->fb_id:%u", drm_data->drm_fd,
+               TDM_DBG("vc4_data->drm_fd : %d, display_buffer->fb_id:%u", vc4_data->drm_fd,
                        display_buffer->fb_id);
 
                if (IS_RGB(format))
@@ -1691,9 +1691,9 @@ drm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
 }
 
 tdm_error
-drm_layer_unset_buffer(tdm_layer *layer)
+vc4_layer_unset_buffer(tdm_layer *layer)
 {
-       tdm_drm_layer_data *layer_data = layer;
+       tdm_vc4_layer_data *layer_data = layer;
 
        RETURN_VAL_IF_FAIL(layer_data, TDM_ERROR_INVALID_PARAMETER);
 
similarity index 94%
rename from src/tdm_drm_format.c
rename to src/tdm_vc4_format.c
index eeda432..93fda10 100644 (file)
@@ -5,14 +5,14 @@
 #include <drm_fourcc.h>
 #include <tbm_surface.h>
 
-#include "tdm_drm.h"
+#include "tdm_vc4.h"
 
 typedef struct {
        tbm_format  tbm_format;
        uint32_t    drm_format;
-} tbm_drm_format_data;
+} tbm_vc4_format_data;
 
-static const tbm_drm_format_data formats[] = {
+static const tbm_vc4_format_data formats[] = {
        {TBM_FORMAT_C8, DRM_FORMAT_C8},
        {TBM_FORMAT_RGB332, DRM_FORMAT_RGB332},
        {TBM_FORMAT_BGR233, DRM_FORMAT_BGR233},
@@ -76,7 +76,7 @@ static const tbm_drm_format_data formats[] = {
 #define NUM_FORMATS (sizeof(formats) / sizeof(formats[0]))
 
 uint32_t
-tdm_drm_format_to_drm_format(tbm_format format)
+tdm_vc4_format_to_drm_format(tbm_format format)
 {
        int i;
 
@@ -90,7 +90,7 @@ tdm_drm_format_to_drm_format(tbm_format format)
 }
 
 tbm_format
-tdm_drm_format_to_tbm_format(uint32_t format)
+tdm_vc4_format_to_tbm_format(uint32_t format)
 {
        int i;
 
similarity index 87%
rename from src/tdm_drm_pp.c
rename to src/tdm_vc4_pp.c
index 97ee9de..8aba908 100644 (file)
@@ -4,18 +4,18 @@
 
 #include <pixman.h>
 
-#include "tdm_drm.h"
+#include "tdm_vc4.h"
 #include "tdm_helper.h"
 
-typedef struct _tdm_drm_pp_buffer {
+typedef struct _tdm_vc4_pp_buffer {
        tbm_surface_h src;
        tbm_surface_h dst;
 
        struct list_head link;
-} tdm_drm_pp_buffer;
+} tdm_vc4_pp_buffer;
 
-typedef struct _tdm_drm_pp_data {
-       tdm_drm_data *drm_data;
+typedef struct _tdm_vc4_pp_data {
+       tdm_vc4_data *vc4_data;
 
        tdm_info_pp info;
 
@@ -25,7 +25,7 @@ typedef struct _tdm_drm_pp_data {
        void *done_user_data;
 
        struct list_head link;
-} tdm_drm_pp_data;
+} tdm_vc4_pp_data;
 
 
 static tbm_format pp_formats[] = {
@@ -41,7 +41,7 @@ static int pp_list_init;
 static struct list_head pp_list;
 
 static pixman_format_code_t
-_tdm_drm_pp_pixman_get_format(tbm_format tbmfmt)
+_tdm_vc4_pp_pixman_get_format(tbm_format tbmfmt)
 {
        switch (tbmfmt) {
        case TBM_FORMAT_ARGB8888:
@@ -57,7 +57,7 @@ _tdm_drm_pp_pixman_get_format(tbm_format tbmfmt)
 }
 
 int
-_tdm_drm_pp_pixman_convert(pixman_op_t op,
+_tdm_vc4_pp_pixman_convert(pixman_op_t op,
                            unsigned char *srcbuf, unsigned char *dstbuf,
                            pixman_format_code_t src_format, pixman_format_code_t dst_format,
                            int sbw, int sbh, int sx, int sy, int sw, int sh,
@@ -160,7 +160,7 @@ CANT_CONVERT:
 }
 
 static tdm_error
-_tdm_drm_pp_convert(tdm_drm_pp_buffer *buffer, tdm_info_pp *info)
+_tdm_vc4_pp_convert(tdm_vc4_pp_buffer *buffer, tdm_info_pp *info)
 {
        tbm_surface_info_s src_info, dst_info;
        pixman_format_code_t src_format, dst_format;
@@ -196,9 +196,9 @@ _tdm_drm_pp_convert(tdm_drm_pp_buffer *buffer, tdm_info_pp *info)
        tbm_surface_map(buffer->dst, TBM_OPTION_WRITE, &dst_info);
        GOTO_IF_FAIL(dst_info.planes[0].ptr != NULL, fail_convert);
 
-       src_format = _tdm_drm_pp_pixman_get_format(src_info.format);
+       src_format = _tdm_vc4_pp_pixman_get_format(src_info.format);
        GOTO_IF_FAIL(src_format > 0, fail_convert);
-       dst_format = _tdm_drm_pp_pixman_get_format(dst_info.format);
+       dst_format = _tdm_vc4_pp_pixman_get_format(dst_info.format);
        GOTO_IF_FAIL(dst_format > 0, fail_convert);
 
        if (src_info.format == TBM_FORMAT_YUV420) {
@@ -234,7 +234,7 @@ _tdm_drm_pp_convert(tdm_drm_pp_buffer *buffer, tdm_info_pp *info)
                goto fail_convert;
        }
 
-       _tdm_drm_pp_pixman_convert(PIXMAN_OP_SRC,
+       _tdm_vc4_pp_pixman_convert(PIXMAN_OP_SRC,
                                   src_info.planes[0].ptr, dst_info.planes[0].ptr,
                                   src_format, dst_format,
                                   sbw, src_info.height,
@@ -255,7 +255,7 @@ fail_convert:
 }
 
 tdm_error
-tdm_drm_pp_get_capability(tdm_drm_data *drm_data, tdm_caps_pp *caps)
+tdm_vc4_pp_get_capability(tdm_vc4_data *vc4_data, tdm_caps_pp *caps)
 {
        int i;
 
@@ -287,9 +287,9 @@ tdm_drm_pp_get_capability(tdm_drm_data *drm_data, tdm_caps_pp *caps)
 }
 
 tdm_pp *
-tdm_drm_pp_create(tdm_drm_data *drm_data, tdm_error *error)
+tdm_vc4_pp_create(tdm_vc4_data *vc4_data, tdm_error *error)
 {
-       tdm_drm_pp_data *pp_data = calloc(1, sizeof(tdm_drm_pp_data));
+       tdm_vc4_pp_data *pp_data = calloc(1, sizeof(tdm_vc4_pp_data));
        if (!pp_data) {
                TDM_ERR("alloc failed");
                if (error)
@@ -297,7 +297,7 @@ tdm_drm_pp_create(tdm_drm_data *drm_data, tdm_error *error)
                return NULL;
        }
 
-       pp_data->drm_data = drm_data;
+       pp_data->vc4_data = vc4_data;
 
        LIST_INITHEAD(&pp_data->pending_buffer_list);
 
@@ -311,10 +311,10 @@ tdm_drm_pp_create(tdm_drm_data *drm_data, tdm_error *error)
 }
 
 void
-drm_pp_destroy(tdm_pp *pp)
+vc4_pp_destroy(tdm_pp *pp)
 {
-       tdm_drm_pp_data *pp_data = pp;
-       tdm_drm_pp_buffer *b = NULL, *bb = NULL;
+       tdm_vc4_pp_data *pp_data = pp;
+       tdm_vc4_pp_buffer *b = NULL, *bb = NULL;
 
        if (!pp_data)
                return;
@@ -330,9 +330,9 @@ drm_pp_destroy(tdm_pp *pp)
 }
 
 tdm_error
-drm_pp_set_info(tdm_pp *pp, tdm_info_pp *info)
+vc4_pp_set_info(tdm_pp *pp, tdm_info_pp *info)
 {
-       tdm_drm_pp_data *pp_data = pp;
+       tdm_vc4_pp_data *pp_data = pp;
 
        RETURN_VAL_IF_FAIL(pp_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(info, TDM_ERROR_INVALID_PARAMETER);
@@ -343,10 +343,10 @@ drm_pp_set_info(tdm_pp *pp, tdm_info_pp *info)
 }
 
 tdm_error
-drm_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst)
+vc4_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst)
 {
-       tdm_drm_pp_data *pp_data = pp;
-       tdm_drm_pp_buffer *buffer;
+       tdm_vc4_pp_data *pp_data = pp;
+       tdm_vc4_pp_buffer *buffer;
 
        RETURN_VAL_IF_FAIL(pp_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(src, TDM_ERROR_INVALID_PARAMETER);
@@ -358,7 +358,7 @@ drm_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst)
                return TDM_ERROR_OPERATION_FAILED;
        }
 
-       buffer = calloc(1, sizeof(tdm_drm_pp_buffer));
+       buffer = calloc(1, sizeof(tdm_vc4_pp_buffer));
        if (!buffer) {
                TDM_ERR("alloc failed");
                return TDM_ERROR_NONE;
@@ -373,17 +373,17 @@ drm_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst)
 }
 
 tdm_error
-drm_pp_commit(tdm_pp *pp)
+vc4_pp_commit(tdm_pp *pp)
 {
-       tdm_drm_pp_data *pp_data = pp;
-       tdm_drm_pp_buffer *b = NULL, *bb = NULL;
+       tdm_vc4_pp_data *pp_data = pp;
+       tdm_vc4_pp_buffer *b = NULL, *bb = NULL;
 
        RETURN_VAL_IF_FAIL(pp_data, TDM_ERROR_INVALID_PARAMETER);
 
        LIST_FOR_EACH_ENTRY_SAFE(b, bb, &pp_data->pending_buffer_list, link) {
                LIST_DEL(&b->link);
 
-               _tdm_drm_pp_convert(b, &pp_data->info);
+               _tdm_vc4_pp_convert(b, &pp_data->info);
 
                if (pp_data->done_func)
                        pp_data->done_func(pp_data,
@@ -397,9 +397,9 @@ drm_pp_commit(tdm_pp *pp)
 }
 
 tdm_error
-drm_pp_set_done_handler(tdm_pp *pp, tdm_pp_done_handler func, void *user_data)
+vc4_pp_set_done_handler(tdm_pp *pp, tdm_pp_done_handler func, void *user_data)
 {
-       tdm_drm_pp_data *pp_data = pp;
+       tdm_vc4_pp_data *pp_data = pp;
 
        RETURN_VAL_IF_FAIL(pp_data, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(func, TDM_ERROR_INVALID_PARAMETER);
diff --git a/src/tdm_vc4_pp.h b/src/tdm_vc4_pp.h
new file mode 100644 (file)
index 0000000..864eb77
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _TDM_VC4_PP_H_
+#define _TDM_VC4_PP_H_
+
+#include "tdm_vc4.h"
+
+tdm_error    tdm_vc4_pp_get_capability(tdm_vc4_data *drm_data, tdm_caps_pp *caps);
+tdm_pp*      tdm_vc4_pp_create(tdm_vc4_data *drm_data, tdm_error *error);
+void         tdm_vc4_pp_handler(unsigned int prop_id, unsigned int *buf_idx,
+                                   unsigned int tv_sec, unsigned int tv_usec, void *data);
+void         tdm_vc4_pp_cb(int fd, unsigned int prop_id, unsigned int *buf_idx,
+                              unsigned int tv_sec, unsigned int tv_usec,
+                              void *user_data);
+#endif /* _TDM_VC4_PP_H_ */