1 /* 2 * Mesa 3-D graphics library 3 * 4 * Copyright (C) 2023 Roman Stratiienko (r.stratiienko@gmail.com) 5 * SPDX-License-Identifier: MIT 6 */ 7 8 #ifndef U_GRALLOC_INTERNAL_H 9 #define U_GRALLOC_INTERNAL_H 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 #include "u_gralloc.h" 16 17 struct u_gralloc_ops { 18 int (*get_buffer_basic_info)(struct u_gralloc *gralloc, 19 struct u_gralloc_buffer_handle *hnd, 20 struct u_gralloc_buffer_basic_info *out); 21 int (*get_buffer_color_info)(struct u_gralloc *gralloc, 22 struct u_gralloc_buffer_handle *hnd, 23 struct u_gralloc_buffer_color_info *out); 24 int (*get_front_rendering_usage)(struct u_gralloc *gralloc, 25 uint64_t *out_usage); 26 int (*destroy)(struct u_gralloc *gralloc); 27 }; 28 29 struct u_gralloc { 30 struct u_gralloc_ops ops; 31 }; 32 33 extern struct u_gralloc *u_gralloc_cros_api_create(void); 34 #ifdef USE_IMAPPER4_METADATA_API 35 extern struct u_gralloc *u_gralloc_imapper_api_create(void); 36 #endif 37 extern struct u_gralloc *u_gralloc_fallback_create(void); 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #endif /* U_GRALLOC_INTERNAL_H */ 44