%define enable_driver() %{expand:%%{?!enable_%{1}: %%global enable_%{1} 1}}
%ifarch %ix86 x86_64
+%define USE_GBM 1
+%define USE_VULKAN 0
%define gallium_drivers "i915,virgl,swrast"
%define vulkan_drivers ""
%define dri_drivers ""
%define USE_GBM 0
%define USE_VULKAN 1
%define VULKAN_DRIVER broadcom
+%define gallium_drivers "vc4,v3d,kmsro,virgl,swrast"
+%define vulkan_drivers "%{?enable_vulkan:%{VULKAN_DRIVER}}"
+%define dri_drivers "auto"
+%endif
%if %{USE_GBM} == 1
%enable_driver gbm
%endif
%if %{USE_VULKAN} == 1
%enable_driver vulkan
%endif
-%define gallium_drivers "vc4,v3d,kmsro,virgl,swrast"
-%define vulkan_drivers "%{?enable_vulkan:%{VULKAN_DRIVER}}"
-%define dri_drivers "auto"
-%endif
-
%description
Mesa is a 3-D graphics library with an API which is very similar to
* OpenGL is a trademark of Silicon Graphics Incorporated.
+%if %{USE_GBM} == 1
+%package -n libgbm-mesa-devel
+Summary: AAAAAAAAAAAAA ASDFJOKASDFIOJKSDFIOJSDFJKSDFJKSDFKJ:SDFJK:KJL:SDKJ:FLS
+Group: System/Libraries
+Requires: %{name}
+%description -n libgbm-mesa-devel
+AAAAAAAAAAAAA ASDFJOKASDFIOJKSDFIOJSDFJKSDFJKSDFKJ:SDFJK:KJL:SDKJ:FLS
+%endif
+
%prep
%setup -q -n %{name}-%{version}
cp %{SOURCE1001} .
mkdir -p %{buildroot}%{_hal_prefix}/share/licenses/%{name}
cp COPYING %{buildroot}%{_hal_prefix}/share/licenses/%{name}/
+%if "%{USE_GBM}" == "1"
+mkdir -p %{buildroot}%{_libdir}/pkgconfig
+mv %{buildroot}%{_hal_libdir}/pkgconfig/gbm_mesa.pc %{buildroot}%{_libdir}/pkgconfig/gbm_mesa.pc
+%endif
+
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%{_hal_libdir}/driver/*
%{_hal_libdir}/dri/*
%if "%{USE_GBM}" == "1"
-%{_hal_libdir}/libgbm*
+%{_hal_libdir}/libgbm_mesa.so.1
+%{_hal_libdir}/libgbm_mesa.so.1.0.0
%endif
%if "%{USE_VULKAN}" == "1"
%{_hal_libdir}/libvulkan_%{VULKAN_DRIVER}.so
%{_hal_prefix}/share/vulkan/icd.d/*
%endif
%{_hal_libdir}/udev/rules.d/99-GPU-Acceleration.rules
+
+%if "%{USE_GBM}" == "1"
+%files -n libgbm-mesa-devel
+%manifest %{name}.manifest
+%defattr(-,root,root)
+%{_libdir}/pkgconfig/gbm_mesa.pc
+%{_hal_prefix}/include/gbm.h
+%{_hal_libdir}/libgbm_mesa.so
+%endif
for (unsigned i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
if (dri2_surf->color_buffers[i].bo)
- gbm_bo_destroy(dri2_surf->color_buffers[i].bo);
+ gbm_mesa_bo_destroy(dri2_surf->color_buffers[i].bo);
}
dri2_egl_surface_free_local_buffers(dri2_surf);
return -1;
if (dri2_surf->back->bo == NULL) {
if (surf->base.v0.modifiers)
- dri2_surf->back->bo = gbm_bo_create_with_modifiers(&dri2_dpy->gbm_dri->base,
+ dri2_surf->back->bo = gbm_mesa_bo_create_with_modifiers(&dri2_dpy->gbm_dri->base,
surf->base.v0.width,
surf->base.v0.height,
surf->base.v0.format,
unsigned flags = surf->base.v0.flags;
if (dri2_surf->base.ProtectedContent)
flags |= GBM_BO_USE_PROTECTED;
- dri2_surf->back->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base,
+ dri2_surf->back->bo = gbm_mesa_bo_create(&dri2_dpy->gbm_dri->base,
surf->base.v0.width,
surf->base.v0.height,
surf->base.v0.format,
}
if (dri2_surf->current->bo == NULL)
- dri2_surf->current->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base,
+ dri2_surf->current->bo = gbm_mesa_bo_create(&dri2_dpy->gbm_dri->base,
surf->base.v0.width,
surf->base.v0.height,
surf->base.v0.format,
bo = gbm_dri_bo(dri2_surf->current->bo);
- bpp = gbm_bo_get_bpp(&bo->base);
+ bpp = gbm_mesa_bo_get_bpp(&bo->base);
if (bpp == 0)
return;
bo = gbm_dri_bo(dri2_surf->current->bo);
- bpp = gbm_bo_get_bpp(&bo->base);
+ bpp = gbm_mesa_bo_get_bpp(&bo->base);
if (bpp == 0)
return;
if (!format_count[i]) {
struct gbm_format_name_desc desc;
_eglLog(_EGL_DEBUG, "No DRI config supports native format %s",
- gbm_format_get_name(visuals[i].gbm_format, &desc));
+ gbm_mesa_format_get_name(visuals[i].gbm_format, &desc));
}
}
int n = snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, 0);
if (n != -1 && n < sizeof(buf))
dri2_dpy->fd = loader_open_device(buf);
- gbm = gbm_create_device(dri2_dpy->fd);
+ gbm = gbm_mesa_create_device(dri2_dpy->fd);
if (gbm == NULL) {
err = "DRI2: failed to create gbm device";
goto cleanup;
}
dri2_dpy->own_device = true;
} else {
- dri2_dpy->fd = os_dupfd_cloexec(gbm_device_get_fd(gbm));
+ dri2_dpy->fd = os_dupfd_cloexec(gbm_mesa_device_get_fd(gbm));
if (dri2_dpy->fd < 0) {
err = "DRI2: failed to fcntl() existing gbm device";
goto cleanup;
}
dri2_dpy->gbm_dri = gbm_dri_device(gbm);
- if (strcmp(gbm_device_get_backend_name(gbm), "drm") != 0) {
+ if (strcmp(gbm_mesa_device_get_backend_name(gbm), "drm") != 0) {
err = "DRI2: gbm device using incorrect/incompatible backend";
goto cleanup;
}
dri2_teardown_drm(struct dri2_egl_display *dri2_dpy)
{
if (dri2_dpy->own_device)
- gbm_device_destroy(&dri2_dpy->gbm_dri->base);
+ gbm_mesa_device_destroy(&dri2_dpy->gbm_dri->base);
}
#ifdef HAVE_DRM_PLATFORM
/* gbm has a pointer to its constructor as first element. */
- if (first_pointer == gbm_create_device)
+ if (first_pointer == gbm_mesa_create_device)
return _EGL_PLATFORM_DRM;
#endif
}
{
struct pipe_resource tmpl = *templat;
- /* gbm_bo_create_with_modifiers & gbm_surface_create_with_modifiers
+ /* gbm_mesa_bo_create_with_modifiers & gbm_mesa_surface_create_with_modifiers
* don't have usage parameter, but buffer created by these functions
* may be used for scanout. So we assume buffer created by this
* function always enable scanout if linear modifier is permitted.
exit(1);
}
- struct gbm_device *gbm = gbm_create_device(fd);
+ struct gbm_device *gbm = gbm_mesa_create_device(fd);
if (unlikely(gbm == NULL)) {
fprintf(stderr, "ERROR: Couldn't create gbm device\n");
exit(1);
*
* Technically it is possible for applications to create resources without
* specifying a modifier but still query the modifier associated with the
- * resource (e.g. using gbm_bo_get_modifier()) before handing it to the
+ * resource (e.g. using gbm_mesa_bo_get_modifier()) before handing it to the
* framebuffer creation API (such as the DRM_IOCTL_MODE_ADDFB2 IOCTL).
*/
if (template->bind & PIPE_BIND_SCANOUT)
/*
* Assume that resources created with modifiers will always be used for
* scanout. This is necessary because some of the APIs that are used to
- * create resources with modifiers (e.g. gbm_bo_create_with_modifiers())
+ * create resources with modifiers (e.g. gbm_mesa_bo_create_with_modifiers())
* can't pass along usage information. Adding that capability might be
* worth adding to remove this ambiguity. Not all future use-cases that
* involve modifiers may always be targetting scanout hardware.
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
+#define LOG_TAG "TBM_GBM"
+#include <dlog.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
static struct gbm_device *
dri_device_create(int fd, uint32_t gbm_backend_version)
{
+ SLOGI(".");
struct gbm_dri_device *dri;
int ret;
bool force_sw;
+ SLOGI(".");
/*
* Since the DRI backend is built-in to the loader, the loader ABI version is
* guaranteed to match this backend's ABI version
assert(gbm_core.v0.core_version == GBM_BACKEND_ABI_VERSION);
assert(gbm_core.v0.core_version == gbm_backend_version);
+ SLOGI(".");
dri = calloc(1, sizeof *dri);
if (!dri)
return NULL;
+ SLOGI(".");
dri->base.v0.fd = fd;
dri->base.v0.backend_version = gbm_backend_version;
dri->base.v0.bo_create = gbm_dri_bo_create;
dri->visual_table = gbm_dri_visuals_table;
dri->num_visuals = ARRAY_SIZE(gbm_dri_visuals_table);
+ SLOGI(".");
mtx_init(&dri->mutex, mtx_plain);
+ SLOGI(".");
force_sw = debug_get_bool_option("GBM_ALWAYS_SOFTWARE", false);
if (!force_sw) {
+ SLOGI(".");
ret = dri_screen_create(dri);
- if (ret)
+ if (ret) {
+ SLOGI(".");
ret = dri_screen_create_sw(dri);
+ }
} else {
+ SLOGI(".");
ret = dri_screen_create_sw(dri);
}
if (ret)
goto err_dri;
+ SLOGI(".");
return &dri->base;
err_dri:
free(dri);
+ SLOGI(".");
return NULL;
}
-gbm_bo_create
-gbm_bo_create_with_modifiers
-gbm_bo_create_with_modifiers2
-gbm_bo_destroy
-gbm_bo_get_bpp
-gbm_bo_get_device
-gbm_bo_get_fd
-gbm_bo_get_fd_for_plane
-gbm_bo_get_format
-gbm_bo_get_handle
-gbm_bo_get_handle_for_plane
-gbm_bo_get_height
-gbm_bo_get_modifier
-gbm_bo_get_offset
-gbm_bo_get_plane_count
-gbm_bo_get_stride
-gbm_bo_get_stride_for_plane
-gbm_bo_get_user_data
-gbm_bo_get_width
-gbm_bo_import
-gbm_bo_map
-gbm_bo_set_user_data
-gbm_bo_unmap
-gbm_bo_write
-gbm_create_device
-gbm_device_destroy
-gbm_device_get_backend_name
-gbm_device_get_fd
-gbm_device_get_format_modifier_plane_count
-gbm_device_is_format_supported
-gbm_format_get_name
-gbm_surface_create
-gbm_surface_create_with_modifiers
-gbm_surface_create_with_modifiers2
-gbm_surface_destroy
-gbm_surface_has_free_buffers
-gbm_surface_lock_front_buffer
-gbm_surface_release_buffer
+gbm_mesa_bo_create
+gbm_mesa_bo_create_with_modifiers
+gbm_mesa_bo_create_with_modifiers2
+gbm_mesa_bo_destroy
+gbm_mesa_bo_get_bpp
+gbm_mesa_bo_get_device
+gbm_mesa_bo_get_fd
+gbm_mesa_bo_get_fd_for_plane
+gbm_mesa_bo_get_format
+gbm_mesa_bo_get_handle
+gbm_mesa_bo_get_handle_for_plane
+gbm_mesa_bo_get_height
+gbm_mesa_bo_get_modifier
+gbm_mesa_bo_get_offset
+gbm_mesa_bo_get_plane_count
+gbm_mesa_bo_get_stride
+gbm_mesa_bo_get_stride_for_plane
+gbm_mesa_bo_get_user_data
+gbm_mesa_bo_get_width
+gbm_mesa_bo_import
+gbm_mesa_bo_map
+gbm_mesa_bo_set_user_data
+gbm_mesa_bo_unmap
+gbm_mesa_bo_write
+gbm_mesa_create_device
+gbm_mesa_device_destroy
+gbm_mesa_device_get_backend_name
+gbm_mesa_device_get_fd
+gbm_mesa_device_get_format_modifier_plane_count
+gbm_mesa_device_is_format_supported
+gbm_mesa_format_get_name
+gbm_mesa_surface_create
+gbm_mesa_surface_create_with_modifiers
+gbm_mesa_surface_create_with_modifiers2
+gbm_mesa_surface_destroy
+gbm_mesa_surface_has_free_buffers
+gbm_mesa_surface_lock_front_buffer
+gbm_mesa_surface_release_buffer
* James Jones <jajones@nvidia.com>
*/
+#define LOG_TAG "TBM_GBM"
+#include <dlog.h>
+
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
static struct gbm_device *
backend_create_device(const struct gbm_backend_desc *bd, int fd)
{
+ SLOGI(".");
const uint32_t abi_ver = VER_MIN(GBM_BACKEND_ABI_VERSION,
bd->backend->v0.backend_version);
+ SLOGI(".");
struct gbm_device *dev = bd->backend->v0.create_device(fd, abi_ver);
+ SLOGI(".");
if (dev) {
+ SLOGI(".");
if (abi_ver != dev->v0.backend_version) {
+ SLOGI(".");
_gbm_device_destroy(dev);
return NULL;
}
+ SLOGI(".");
dev->v0.backend_desc = bd;
}
+ SLOGI(".");
return dev;
}
static struct gbm_device *
load_backend(void *lib, int fd, const char *name)
{
+ SLOGI(".");
struct gbm_device *dev = NULL;
struct gbm_backend_desc *backend_desc;
const struct gbm_backend *gbm_backend;
GBM_GET_BACKEND_PROC_PTR get_backend;
+ SLOGI(".");
get_backend = dlsym(lib, GBM_GET_BACKEND_PROC_NAME);
+ SLOGI(".");
if (!get_backend)
goto fail;
+ SLOGI(".");
gbm_backend = get_backend(&gbm_core);
backend_desc = create_backend_desc(name, gbm_backend, lib);
+ SLOGI(".");
if (!backend_desc)
goto fail;
+ SLOGI(".");
dev = backend_create_device(backend_desc, fd);
+ SLOGI(".");
if (!dev)
free_backend_desc(backend_desc);
+ SLOGI(".");
return dev;
fail:
static struct gbm_device *
find_backend(const char *name, int fd)
{
+ SLOGI(".");
struct gbm_device *dev = NULL;
const struct gbm_backend_desc *bd;
void *lib;
unsigned i;
+ SLOGI(".");
for (i = 0; i < ARRAY_SIZE(builtin_backends); ++i) {
+ SLOGI(".");
bd = &builtin_backends[i];
+ SLOGI(".");
if (name && strcmp(bd->name, name))
continue;
+ SLOGI(".");
dev = backend_create_device(bd, fd);
+ SLOGI(".");
if (dev)
break;
}
+ SLOGI(".");
if (name && !dev) {
+ SLOGI(".");
lib = loader_open_driver_lib(name, BACKEND_LIB_SUFFIX,
backend_search_path_vars,
DEFAULT_BACKENDS_PATH,
true);
+ SLOGI(".");
if (lib)
dev = load_backend(lib, fd, name);
}
+ SLOGI(".");
return dev;
}
static struct gbm_device *
override_backend(int fd)
{
+ SLOGI(".");
struct gbm_device *dev = NULL;
const char *b;
+ SLOGI(".");
b = getenv("GBM_BACKEND");
if (b)
dev = find_backend(b, fd);
+ SLOGI(".");
return dev;
}
static struct gbm_device *
backend_from_driver_name(int fd)
{
+ SLOGI(".");
struct gbm_device *dev = NULL;
drmVersionPtr v = drmGetVersion(fd);
void *lib;
+ SLOGI(".");
if (!v)
return NULL;
+ SLOGI(".");
lib = loader_open_driver_lib(v->name, BACKEND_LIB_SUFFIX,
backend_search_path_vars,
DEFAULT_BACKENDS_PATH,
false);
+ SLOGI(".");
if (lib)
dev = load_backend(lib, fd, v->name);
+ SLOGI(".");
drmFreeVersion(v);
+ SLOGI(".");
return dev;
}
struct gbm_device *
_gbm_create_device(int fd)
{
+ SLOGI(".");
struct gbm_device *dev;
+ SLOGI(".");
dev = override_backend(fd);
+ SLOGI(".");
if (!dev)
dev = backend_from_driver_name(fd);
+ SLOGI(".");
if (!dev)
dev = find_backend(NULL, fd);
+ SLOGI(".");
return dev;
}
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
+#define LOG_TAG "TBM_GBM"
+#include <dlog.h>
+
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
* \return The fd that the struct gbm_device was created with
*/
GBM_EXPORT int
-gbm_device_get_fd(struct gbm_device *gbm)
+gbm_mesa_device_get_fd(struct gbm_device *gbm)
{
return gbm->v0.fd;
}
* be freed
*/
GBM_EXPORT const char *
-gbm_device_get_backend_name(struct gbm_device *gbm)
+gbm_mesa_device_get_backend_name(struct gbm_device *gbm)
{
return gbm->v0.name;
}
* \sa enum gbm_bo_format for the list of formats
*/
GBM_EXPORT int
-gbm_device_is_format_supported(struct gbm_device *gbm,
+gbm_mesa_device_is_format_supported(struct gbm_device *gbm,
uint32_t format, uint32_t flags)
{
return gbm->v0.is_format_supported(gbm, format, flags);
* \param modifier The modifier to query
*/
GBM_EXPORT int
-gbm_device_get_format_modifier_plane_count(struct gbm_device *gbm,
+gbm_mesa_device_get_format_modifier_plane_count(struct gbm_device *gbm,
uint32_t format,
uint64_t modifier)
{
* \param gbm The device created using gbm_create_device()
*/
GBM_EXPORT void
-gbm_device_destroy(struct gbm_device *gbm)
+gbm_mesa_device_destroy(struct gbm_device *gbm)
{
_gbm_device_destroy(gbm);
}
* needed. If the creation of the device failed NULL will be returned.
*/
GBM_EXPORT struct gbm_device *
-gbm_create_device(int fd)
+gbm_mesa_create_device(int fd)
{
+ SLOGI(".");
struct gbm_device *gbm = NULL;
struct stat buf;
+ SLOGI(".");
if (fd < 0 || fstat(fd, &buf) < 0 || !S_ISCHR(buf.st_mode)) {
errno = EINVAL;
return NULL;
}
+ SLOGI(".");
gbm = _gbm_create_device(fd);
if (gbm == NULL)
return NULL;
- gbm->dummy = gbm_create_device;
+ SLOGI(".");
+ gbm->dummy = gbm_mesa_create_device;
+ SLOGI(".");
return gbm;
}
*
*/
GBM_EXPORT uint32_t
-gbm_bo_get_width(struct gbm_bo *bo)
+gbm_mesa_bo_get_width(struct gbm_bo *bo)
{
return bo->v0.width;
}
* \return The height of the allocated buffer object
*/
GBM_EXPORT uint32_t
-gbm_bo_get_height(struct gbm_bo *bo)
+gbm_mesa_bo_get_height(struct gbm_bo *bo)
{
return bo->v0.height;
}
* \return The stride of the allocated buffer object in bytes
*/
GBM_EXPORT uint32_t
-gbm_bo_get_stride(struct gbm_bo *bo)
+gbm_mesa_bo_get_stride(struct gbm_bo *bo)
{
- return gbm_bo_get_stride_for_plane(bo, 0);
+ return gbm_mesa_bo_get_stride_for_plane(bo, 0);
}
/** Get the stride for the given plane
* \sa gbm_bo_get_stride()
*/
GBM_EXPORT uint32_t
-gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane)
+gbm_mesa_bo_get_stride_for_plane(struct gbm_bo *bo, int plane)
{
return bo->gbm->v0.bo_get_stride(bo, plane);
}
* \return The format of buffer object, one of the GBM_FORMAT_* codes
*/
GBM_EXPORT uint32_t
-gbm_bo_get_format(struct gbm_bo *bo)
+gbm_mesa_bo_get_format(struct gbm_bo *bo)
{
return bo->v0.format;
}
* \return The number of bits0per-pixel of the buffer object's format.
*/
GBM_EXPORT uint32_t
-gbm_bo_get_bpp(struct gbm_bo *bo)
+gbm_mesa_bo_get_bpp(struct gbm_bo *bo)
{
switch (bo->v0.format) {
default:
* \return The offset
*/
GBM_EXPORT uint32_t
-gbm_bo_get_offset(struct gbm_bo *bo, int plane)
+gbm_mesa_bo_get_offset(struct gbm_bo *bo, int plane)
{
return bo->gbm->v0.bo_get_offset(bo, plane);
}
* \return Returns the gbm device with which the buffer object was created
*/
GBM_EXPORT struct gbm_device *
-gbm_bo_get_device(struct gbm_bo *bo)
+gbm_mesa_bo_get_device(struct gbm_bo *bo)
{
return bo->gbm;
}
* \return Returns the handle of the allocated buffer object
*/
GBM_EXPORT union gbm_bo_handle
-gbm_bo_get_handle(struct gbm_bo *bo)
+gbm_mesa_bo_get_handle(struct gbm_bo *bo)
{
return bo->v0.handle;
}
* if an error occurs.
*/
GBM_EXPORT int
-gbm_bo_get_fd(struct gbm_bo *bo)
+gbm_mesa_bo_get_fd(struct gbm_bo *bo)
{
return bo->gbm->v0.bo_get_fd(bo);
}
* \return The number of planes
*/
GBM_EXPORT int
-gbm_bo_get_plane_count(struct gbm_bo *bo)
+gbm_mesa_bo_get_plane_count(struct gbm_bo *bo)
{
return bo->gbm->v0.bo_get_planes(bo);
}
* \sa gbm_bo_get_handle()
*/
GBM_EXPORT union gbm_bo_handle
-gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane)
+gbm_mesa_bo_get_handle_for_plane(struct gbm_bo *bo, int plane)
{
return bo->gbm->v0.bo_get_handle(bo, plane);
}
* \sa gbm_bo_get_fd()
*/
GBM_EXPORT int
-gbm_bo_get_fd_for_plane(struct gbm_bo *bo, int plane)
+gbm_mesa_bo_get_fd_for_plane(struct gbm_bo *bo, int plane)
{
return bo->gbm->v0.bo_get_plane_fd(bo, plane);
}
* \sa define DRM_FORMAT_MOD_* in drm_fourcc.h for possible modifiers
*/
GBM_EXPORT uint64_t
-gbm_bo_get_modifier(struct gbm_bo *bo)
+gbm_mesa_bo_get_modifier(struct gbm_bo *bo)
{
return bo->gbm->v0.bo_get_modifier(bo);
}
* \return Returns 0 on success, otherwise -1 is returned an errno set
*/
GBM_EXPORT int
-gbm_bo_write(struct gbm_bo *bo, const void *buf, size_t count)
+gbm_mesa_bo_write(struct gbm_bo *bo, const void *buf, size_t count)
{
return bo->gbm->v0.bo_write(bo, buf, count);
}
* called prior to the buffer destruction
*/
GBM_EXPORT void
-gbm_bo_set_user_data(struct gbm_bo *bo, void *data,
+gbm_mesa_bo_set_user_data(struct gbm_bo *bo, void *data,
void (*destroy_user_data)(struct gbm_bo *, void *))
{
bo->v0.user_data = data;
* \sa gbm_bo_set_user_data()
*/
GBM_EXPORT void *
-gbm_bo_get_user_data(struct gbm_bo *bo)
+gbm_mesa_bo_get_user_data(struct gbm_bo *bo)
{
return bo->v0.user_data;
}
* \param bo The buffer object
*/
GBM_EXPORT void
-gbm_bo_destroy(struct gbm_bo *bo)
+gbm_mesa_bo_destroy(struct gbm_bo *bo)
{
if (bo->v0.destroy_user_data)
bo->v0.destroy_user_data(bo, bo->v0.user_data);
* \sa enum gbm_bo_flags for the list of usage flags
*/
GBM_EXPORT struct gbm_bo *
-gbm_bo_create(struct gbm_device *gbm,
+gbm_mesa_bo_create(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format, uint32_t flags)
{
}
GBM_EXPORT struct gbm_bo *
-gbm_bo_create_with_modifiers(struct gbm_device *gbm,
+gbm_mesa_bo_create_with_modifiers(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format,
const uint64_t *modifiers,
flags |= GBM_BO_USE_SCANOUT;
}
- return gbm_bo_create_with_modifiers2(gbm, width, height, format, modifiers,
+ return gbm_mesa_bo_create_with_modifiers2(gbm, width, height, format, modifiers,
count, flags);
}
GBM_EXPORT struct gbm_bo *
-gbm_bo_create_with_modifiers2(struct gbm_device *gbm,
+gbm_mesa_bo_create_with_modifiers2(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format,
const uint64_t *modifiers,
* \sa enum gbm_bo_flags for the list of usage flags
*/
GBM_EXPORT struct gbm_bo *
-gbm_bo_import(struct gbm_device *gbm,
+gbm_mesa_bo_import(struct gbm_device *gbm,
uint32_t type, void *buffer, uint32_t flags)
{
return gbm->v0.bo_import(gbm, type, buffer, flags);
* \sa enum gbm_bo_transfer_flags for the list of flags
*/
GBM_EXPORT void *
-gbm_bo_map(struct gbm_bo *bo,
+gbm_mesa_bo_map(struct gbm_bo *bo,
uint32_t x, uint32_t y,
uint32_t width, uint32_t height,
uint32_t flags, uint32_t *stride, void **map_data)
* \param map_data opaque ptr returned from prior gbm_bo_map
*/
GBM_EXPORT void
-gbm_bo_unmap(struct gbm_bo *bo, void *map_data)
+gbm_mesa_bo_unmap(struct gbm_bo *bo, void *map_data)
{
bo->gbm->v0.bo_unmap(bo, map_data);
}
* \sa enum gbm_bo_format for the list of formats
*/
GBM_EXPORT struct gbm_surface *
-gbm_surface_create(struct gbm_device *gbm,
+gbm_mesa_surface_create(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format, uint32_t flags)
{
}
GBM_EXPORT struct gbm_surface *
-gbm_surface_create_with_modifiers(struct gbm_device *gbm,
+gbm_mesa_surface_create_with_modifiers(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format,
const uint64_t *modifiers,
flags |= GBM_BO_USE_SCANOUT;
}
- return gbm_surface_create_with_modifiers2(gbm, width, height, format,
+ return gbm_mesa_surface_create_with_modifiers2(gbm, width, height, format,
modifiers, count,
flags);
}
GBM_EXPORT struct gbm_surface *
-gbm_surface_create_with_modifiers2(struct gbm_device *gbm,
+gbm_mesa_surface_create_with_modifiers2(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format,
const uint64_t *modifiers,
* \param surf The surface
*/
GBM_EXPORT void
-gbm_surface_destroy(struct gbm_surface *surf)
+gbm_mesa_surface_destroy(struct gbm_surface *surf)
{
surf->gbm->v0.surface_destroy(surf);
}
* returns %NULL.
*/
GBM_EXPORT struct gbm_bo *
-gbm_surface_lock_front_buffer(struct gbm_surface *surf)
+gbm_mesa_surface_lock_front_buffer(struct gbm_surface *surf)
{
return surf->gbm->v0.surface_lock_front_buffer(surf);
}
* \param bo The buffer object
*/
GBM_EXPORT void
-gbm_surface_release_buffer(struct gbm_surface *surf, struct gbm_bo *bo)
+gbm_mesa_surface_release_buffer(struct gbm_surface *surf, struct gbm_bo *bo)
{
surf->gbm->v0.surface_release_buffer(surf, bo);
}
* \return 1 if the surface has free buffers, 0 otherwise
*/
GBM_EXPORT int
-gbm_surface_has_free_buffers(struct gbm_surface *surf)
+gbm_mesa_surface_has_free_buffers(struct gbm_surface *surf)
{
return surf->gbm->v0.surface_has_free_buffers(surf);
}
* \return String containing the fourcc of the format.
*/
GBM_EXPORT char *
-gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc)
+gbm_mesa_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc)
{
gbm_format = format_canonicalize(gbm_format);
};
int
-gbm_device_get_fd(struct gbm_device *gbm);
+gbm_mesa_device_get_fd(struct gbm_device *gbm);
const char *
-gbm_device_get_backend_name(struct gbm_device *gbm);
+gbm_mesa_device_get_backend_name(struct gbm_device *gbm);
int
-gbm_device_is_format_supported(struct gbm_device *gbm,
+gbm_mesa_device_is_format_supported(struct gbm_device *gbm,
uint32_t format, uint32_t flags);
int
-gbm_device_get_format_modifier_plane_count(struct gbm_device *gbm,
+gbm_mesa_device_get_format_modifier_plane_count(struct gbm_device *gbm,
uint32_t format,
uint64_t modifier);
void
-gbm_device_destroy(struct gbm_device *gbm);
+gbm_mesa_device_destroy(struct gbm_device *gbm);
struct gbm_device *
-gbm_create_device(int fd);
+gbm_mesa_create_device(int fd);
struct gbm_bo *
-gbm_bo_create(struct gbm_device *gbm,
+gbm_mesa_bo_create(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format, uint32_t flags);
struct gbm_bo *
-gbm_bo_create_with_modifiers(struct gbm_device *gbm,
+gbm_mesa_bo_create_with_modifiers(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format,
const uint64_t *modifiers,
const unsigned int count);
struct gbm_bo *
-gbm_bo_create_with_modifiers2(struct gbm_device *gbm,
+gbm_mesa_bo_create_with_modifiers2(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format,
const uint64_t *modifiers,
};
struct gbm_bo *
-gbm_bo_import(struct gbm_device *gbm, uint32_t type,
+gbm_mesa_bo_import(struct gbm_device *gbm, uint32_t type,
void *buffer, uint32_t flags);
/**
};
void *
-gbm_bo_map(struct gbm_bo *bo,
+gbm_mesa_bo_map(struct gbm_bo *bo,
uint32_t x, uint32_t y, uint32_t width, uint32_t height,
uint32_t flags, uint32_t *stride, void **map_data);
void
-gbm_bo_unmap(struct gbm_bo *bo, void *map_data);
+gbm_mesa_bo_unmap(struct gbm_bo *bo, void *map_data);
uint32_t
-gbm_bo_get_width(struct gbm_bo *bo);
+gbm_mesa_bo_get_width(struct gbm_bo *bo);
uint32_t
-gbm_bo_get_height(struct gbm_bo *bo);
+gbm_mesa_bo_get_height(struct gbm_bo *bo);
uint32_t
-gbm_bo_get_stride(struct gbm_bo *bo);
+gbm_mesa_bo_get_stride(struct gbm_bo *bo);
uint32_t
-gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane);
+gbm_mesa_bo_get_stride_for_plane(struct gbm_bo *bo, int plane);
uint32_t
-gbm_bo_get_format(struct gbm_bo *bo);
+gbm_mesa_bo_get_format(struct gbm_bo *bo);
uint32_t
-gbm_bo_get_bpp(struct gbm_bo *bo);
+gbm_mesa_bo_get_bpp(struct gbm_bo *bo);
uint32_t
-gbm_bo_get_offset(struct gbm_bo *bo, int plane);
+gbm_mesa_bo_get_offset(struct gbm_bo *bo, int plane);
struct gbm_device *
-gbm_bo_get_device(struct gbm_bo *bo);
+gbm_mesa_bo_get_device(struct gbm_bo *bo);
union gbm_bo_handle
-gbm_bo_get_handle(struct gbm_bo *bo);
+gbm_mesa_bo_get_handle(struct gbm_bo *bo);
int
-gbm_bo_get_fd(struct gbm_bo *bo);
+gbm_mesa_bo_get_fd(struct gbm_bo *bo);
uint64_t
-gbm_bo_get_modifier(struct gbm_bo *bo);
+gbm_mesa_bo_get_modifier(struct gbm_bo *bo);
int
-gbm_bo_get_plane_count(struct gbm_bo *bo);
+gbm_mesa_bo_get_plane_count(struct gbm_bo *bo);
union gbm_bo_handle
-gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane);
+gbm_mesa_bo_get_handle_for_plane(struct gbm_bo *bo, int plane);
int
-gbm_bo_get_fd_for_plane(struct gbm_bo *bo, int plane);
+gbm_mesa_bo_get_fd_for_plane(struct gbm_bo *bo, int plane);
int
-gbm_bo_write(struct gbm_bo *bo, const void *buf, size_t count);
+gbm_mesa_bo_write(struct gbm_bo *bo, const void *buf, size_t count);
void
-gbm_bo_set_user_data(struct gbm_bo *bo, void *data,
+gbm_mesa_bo_set_user_data(struct gbm_bo *bo, void *data,
void (*destroy_user_data)(struct gbm_bo *, void *));
void *
-gbm_bo_get_user_data(struct gbm_bo *bo);
+gbm_mesa_bo_get_user_data(struct gbm_bo *bo);
void
-gbm_bo_destroy(struct gbm_bo *bo);
+gbm_mesa_bo_destroy(struct gbm_bo *bo);
struct gbm_surface *
-gbm_surface_create(struct gbm_device *gbm,
+gbm_mesa_surface_create(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format, uint32_t flags);
struct gbm_surface *
-gbm_surface_create_with_modifiers(struct gbm_device *gbm,
+gbm_mesa_surface_create_with_modifiers(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format,
const uint64_t *modifiers,
const unsigned int count);
struct gbm_surface *
-gbm_surface_create_with_modifiers2(struct gbm_device *gbm,
+gbm_mesa_surface_create_with_modifiers2(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format,
const uint64_t *modifiers,
uint32_t flags);
struct gbm_bo *
-gbm_surface_lock_front_buffer(struct gbm_surface *surface);
+gbm_mesa_surface_lock_front_buffer(struct gbm_surface *surface);
void
-gbm_surface_release_buffer(struct gbm_surface *surface, struct gbm_bo *bo);
+gbm_mesa_surface_release_buffer(struct gbm_surface *surface, struct gbm_bo *bo);
int
-gbm_surface_has_free_buffers(struct gbm_surface *surface);
+gbm_mesa_surface_has_free_buffers(struct gbm_surface *surface);
void
-gbm_surface_destroy(struct gbm_surface *surface);
+gbm_mesa_surface_destroy(struct gbm_surface *surface);
char *
-gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc);
+gbm_mesa_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc);
#ifdef __cplusplus
}
incs_gbm += inc_wayland_drm
endif
-libgbm_name = 'gbm'
+# libgbm_name = 'gbm'
-if with_platform_android and get_option('platform-sdk-version') >= 30
+# if with_platform_android and get_option('platform-sdk-version') >= 30
libgbm_name = 'gbm_mesa'
-endif
+# endif
libgbm = shared_library(
libgbm_name,
c_args : [args_gbm],
link_args : [ld_args_gc_sections],
link_with : libloader,
- dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil, idep_xmlconfig],
+ dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil, idep_xmlconfig, dep_dlog], # dlog be a G
gnu_symbol_visibility : 'hidden',
version : '1.0.0',
install : true,
install_headers('main/gbm.h')
pkg.generate(
- name : 'gbm',
- filebase : 'gbm',
+ name : libgbm_name,
+ filebase : libgbm_name,
description : 'Mesa gbm library',
version : meson.project_version(),
libraries : libgbm,