mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-17 08:10:33 +01:00
This provides just enough of a "DRI driver" for non-glamor-using xservers to initialize GLX and enable direct clients. We build it if you build DRI support for GLX, or if you build any X11 client support for EGL. We only build it at this point, we'll swap it into the install next. Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Co-authored-by: Pavel Ondračka <pavel.ondracka@gmail.com> Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28378>
83 lines
1.8 KiB
C
83 lines
1.8 KiB
C
/*
|
|
* Mesa 3-D graphics library
|
|
*
|
|
* Copyright (C) 2022 Roman Stratiienko (r.stratiienko@gmail.com)
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef U_GRALLOC_H
|
|
#define U_GRALLOC_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <cutils/native_handle.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "util/macros.h"
|
|
#include "gallium/include/mesa_interface.h"
|
|
|
|
struct u_gralloc;
|
|
|
|
/* Both Vulkan and EGL API exposes HAL format / pixel stride which is required
|
|
* by the fallback implementation.
|
|
*/
|
|
struct u_gralloc_buffer_handle {
|
|
const native_handle_t *handle;
|
|
int hal_format;
|
|
int pixel_stride;
|
|
};
|
|
|
|
struct u_gralloc_buffer_basic_info {
|
|
uint32_t drm_fourcc;
|
|
uint64_t modifier;
|
|
|
|
int num_planes;
|
|
int fds[4];
|
|
int offsets[4];
|
|
int strides[4];
|
|
};
|
|
|
|
struct u_gralloc_buffer_color_info {
|
|
enum __DRIYUVColorSpace yuv_color_space;
|
|
enum __DRISampleRange sample_range;
|
|
enum __DRIChromaSiting horizontal_siting;
|
|
enum __DRIChromaSiting vertical_siting;
|
|
};
|
|
|
|
enum u_gralloc_type {
|
|
U_GRALLOC_TYPE_AUTO,
|
|
U_GRALLOC_TYPE_GRALLOC4,
|
|
U_GRALLOC_TYPE_CROS,
|
|
U_GRALLOC_TYPE_LIBDRM,
|
|
U_GRALLOC_TYPE_QCOM,
|
|
U_GRALLOC_TYPE_FALLBACK,
|
|
U_GRALLOC_TYPE_COUNT,
|
|
};
|
|
|
|
struct u_gralloc *u_gralloc_create(enum u_gralloc_type type);
|
|
|
|
void u_gralloc_destroy(struct u_gralloc **gralloc);
|
|
|
|
int u_gralloc_get_buffer_basic_info(
|
|
struct u_gralloc *gralloc,
|
|
struct u_gralloc_buffer_handle *hnd,
|
|
struct u_gralloc_buffer_basic_info *out);
|
|
|
|
int u_gralloc_get_buffer_color_info(
|
|
struct u_gralloc *gralloc,
|
|
struct u_gralloc_buffer_handle *hnd,
|
|
struct u_gralloc_buffer_color_info *out);
|
|
|
|
int u_gralloc_get_front_rendering_usage(struct u_gralloc *gralloc,
|
|
uint64_t *out_usage);
|
|
|
|
int u_gralloc_get_type(struct u_gralloc *gralloc);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* U_GRALLOC_H */
|