amdgpu.c \
dri.c \
drv.c \
- evdi.c \
+ dumb_driver.c \
exynos.c \
helpers_array.c \
helpers.c \
i915.c \
- marvell.c \
mediatek.c \
meson.c \
msm.c \
- nouveau.c \
radeon.c \
rockchip.c \
- synaptics.c \
tegra.c \
- udl.c \
vc4.c \
virtio_gpu.c
#ifdef DRV_AMDGPU
extern const struct backend backend_amdgpu;
#endif
-extern const struct backend backend_evdi;
#ifdef DRV_EXYNOS
extern const struct backend backend_exynos;
#endif
#ifdef DRV_I915
extern const struct backend backend_i915;
#endif
-#ifdef DRV_MARVELL
-extern const struct backend backend_marvell;
-#endif
#ifdef DRV_MEDIATEK
extern const struct backend backend_mediatek;
#endif
-#ifdef DRV_MESON
-extern const struct backend backend_meson;
-#endif
#ifdef DRV_MSM
extern const struct backend backend_msm;
#endif
-extern const struct backend backend_nouveau;
-#ifdef DRV_RADEON
-extern const struct backend backend_radeon;
-#endif
#ifdef DRV_ROCKCHIP
extern const struct backend backend_rockchip;
#endif
-#ifdef DRV_SYNAPTICS
-extern const struct backend backend_synaptics;
-#endif
#ifdef DRV_TEGRA
extern const struct backend backend_tegra;
#endif
-extern const struct backend backend_udl;
#ifdef DRV_VC4
extern const struct backend backend_vc4;
#endif
+
+// Dumb / generic drivers
+extern const struct backend backend_evdi;
+extern const struct backend backend_marvell;
+extern const struct backend backend_meson;
+extern const struct backend backend_nouveau;
+extern const struct backend backend_komeda;
+extern const struct backend backend_radeon;
+extern const struct backend backend_synaptics;
extern const struct backend backend_virtio_gpu;
+extern const struct backend backend_udl;
static const struct backend *drv_get_backend(int fd)
{
#ifdef DRV_AMDGPU
&backend_amdgpu,
#endif
- &backend_evdi,
#ifdef DRV_EXYNOS
&backend_exynos,
#endif
#ifdef DRV_I915
&backend_i915,
#endif
-#ifdef DRV_MARVELL
- &backend_marvell,
-#endif
#ifdef DRV_MEDIATEK
&backend_mediatek,
#endif
-#ifdef DRV_MESON
- &backend_meson,
-#endif
#ifdef DRV_MSM
&backend_msm,
#endif
- &backend_nouveau,
-#ifdef DRV_RADEON
- &backend_radeon,
-#endif
#ifdef DRV_ROCKCHIP
&backend_rockchip,
#endif
-#ifdef DRV_SYNAPTICS
- &backend_synaptics,
-#endif
-#ifdef DRV_TEGRA
- &backend_tegra,
-#endif
- &backend_udl,
#ifdef DRV_VC4
&backend_vc4,
#endif
- &backend_virtio_gpu,
+ &backend_marvell, &backend_meson, &backend_nouveau, &backend_komeda,
+ &backend_radeon, &backend_synaptics, &backend_virtio_gpu,
};
for (i = 0; i < ARRAY_SIZE(backend_list); i++) {
/*
- * Copyright 2018 The Chromium OS Authors. All rights reserved.
+ * Copyright 2020 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#ifdef DRV_MESON
-
#include "drv_priv.h"
#include "helpers.h"
#include "util.h"
+#define INIT_DUMB_DRIVER(driver) \
+ const struct backend backend_##driver = { \
+ .name = #driver, \
+ .init = dumb_driver_init, \
+ .bo_create = drv_dumb_bo_create, \
+ .bo_destroy = drv_dumb_bo_destroy, \
+ .bo_import = drv_prime_bo_import, \
+ .bo_map = drv_dumb_bo_map, \
+ .bo_unmap = drv_bo_munmap, \
+ };
+
static const uint32_t scanout_render_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888,
DRM_FORMAT_ABGR8888, DRM_FORMAT_XBGR8888,
DRM_FORMAT_BGR888, DRM_FORMAT_BGR565 };
static const uint32_t texture_only_formats[] = { DRM_FORMAT_NV12, DRM_FORMAT_NV21,
DRM_FORMAT_YVU420, DRM_FORMAT_YVU420_ANDROID };
-static int meson_init(struct driver *drv)
+static int dumb_driver_init(struct driver *drv)
{
drv_add_combinations(drv, scanout_render_formats, ARRAY_SIZE(scanout_render_formats),
&LINEAR_METADATA, BO_USE_RENDER_MASK | BO_USE_SCANOUT);
return drv_modify_linear_combinations(drv);
}
-const struct backend backend_meson = {
- .name = "meson",
- .init = meson_init,
- .bo_create = drv_dumb_bo_create,
- .bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
- .bo_map = drv_dumb_bo_map,
- .bo_unmap = drv_bo_munmap,
-};
-
-#endif
+INIT_DUMB_DRIVER(komeda)
+INIT_DUMB_DRIVER(marvell)
+INIT_DUMB_DRIVER(meson)
+INIT_DUMB_DRIVER(nouveau)
+INIT_DUMB_DRIVER(radeon)
+INIT_DUMB_DRIVER(synaptics)
+++ /dev/null
-/*
- * Copyright 2016 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "drv_priv.h"
-#include "helpers.h"
-#include "util.h"
-
-static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888 };
-
-static int evdi_init(struct driver *drv)
-{
- drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
- &LINEAR_METADATA, BO_USE_RENDER_MASK);
-
- return drv_modify_linear_combinations(drv);
-}
-
-const struct backend backend_evdi = {
- .name = "evdi",
- .init = evdi_init,
- .bo_create = drv_dumb_bo_create,
- .bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
- .bo_map = drv_dumb_bo_map,
- .bo_unmap = drv_bo_munmap,
-};
+++ /dev/null
-/*
- * Copyright 2015 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifdef DRV_MARVELL
-
-#include "drv_priv.h"
-#include "helpers.h"
-#include "util.h"
-
-static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888 };
-
-static int marvell_init(struct driver *drv)
-{
- drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
- &LINEAR_METADATA, BO_USE_RENDER_MASK);
-
- return drv_add_linear_combinations(drv, render_target_formats,
- ARRAY_SIZE(render_target_formats));
-}
-
-const struct backend backend_marvell = {
- .name = "marvell",
- .init = marvell_init,
- .bo_create = drv_dumb_bo_create,
- .bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
- .bo_map = drv_dumb_bo_map,
- .bo_unmap = drv_bo_munmap,
-};
-
-#endif
+++ /dev/null
-/*
- * Copyright 2016 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "drv_priv.h"
-#include "helpers.h"
-#include "util.h"
-
-static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888 };
-
-static int nouveau_init(struct driver *drv)
-{
- drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
- &LINEAR_METADATA, BO_USE_RENDER_MASK);
-
- return drv_modify_linear_combinations(drv);
-}
-
-const struct backend backend_nouveau = {
- .name = "nouveau",
- .init = nouveau_init,
- .bo_create = drv_dumb_bo_create,
- .bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
- .bo_map = drv_dumb_bo_map,
- .bo_unmap = drv_bo_munmap,
-};
+++ /dev/null
-/*
- * Copyright 2017 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "drv_priv.h"
-#include "helpers.h"
-#include "util.h"
-
-static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888 };
-
-static int radeon_init(struct driver *drv)
-{
- drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
- &LINEAR_METADATA, BO_USE_RENDER_MASK);
-
- return drv_modify_linear_combinations(drv);
-}
-
-const struct backend backend_radeon = {
- .name = "radeon",
- .init = radeon_init,
- .bo_create = drv_dumb_bo_create,
- .bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
- .bo_map = drv_dumb_bo_map,
- .bo_unmap = drv_bo_munmap,
-};
+++ /dev/null
-/*
- * Copyright 2020 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifdef DRV_SYNAPTICS
-
-#include "drv_priv.h"
-#include "helpers.h"
-#include "util.h"
-
-static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_ABGR8888,
- DRM_FORMAT_XRGB8888 };
-
-static const uint32_t texture_source_formats[] = { DRM_FORMAT_R8, DRM_FORMAT_NV12,
- DRM_FORMAT_YVU420, DRM_FORMAT_YVU420_ANDROID };
-
-static int synaptics_init(struct driver *drv)
-{
- drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
- &LINEAR_METADATA, BO_USE_RENDER_MASK | BO_USE_SCANOUT);
-
- drv_add_combinations(drv, texture_source_formats, ARRAY_SIZE(texture_source_formats),
- &LINEAR_METADATA, BO_USE_TEXTURE_MASK | BO_USE_HW_VIDEO_ENCODER);
-
- return drv_modify_linear_combinations(drv);
-}
-
-const struct backend backend_synaptics = {
- .name = "synaptics",
- .init = synaptics_init,
- .bo_create = drv_dumb_bo_create,
- .bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
- .bo_map = drv_dumb_bo_map,
- .bo_unmap = drv_bo_munmap,
-};
-
-#endif
+++ /dev/null
-/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "drv_priv.h"
-#include "helpers.h"
-#include "util.h"
-
-static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888 };
-
-static int udl_init(struct driver *drv)
-{
- drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
- &LINEAR_METADATA, BO_USE_RENDER_MASK);
-
- return drv_modify_linear_combinations(drv);
-}
-
-const struct backend backend_udl = {
- .name = "udl",
- .init = udl_init,
- .bo_create = drv_dumb_bo_create,
- .bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
- .bo_map = drv_dumb_bo_map,
- .bo_unmap = drv_bo_munmap,
-};