X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgbm%2Fmain%2Fgbm.h;h=aed26a0162106b7794935717ae1df3efb740e4e9;hb=b86ecea3446e3eb461f6fbdf245a640a8a5d4739;hp=e3e5d34d9764f11b663a9a0ca174799aa62d7bae;hpb=2ee34bd5dcf30f202c9f37e3d986640f71b8a210;p=mesa.git diff --git a/src/gbm/main/gbm.h b/src/gbm/main/gbm.h index e3e5d34d976..aed26a01621 100644 --- a/src/gbm/main/gbm.h +++ b/src/gbm/main/gbm.h @@ -77,6 +77,12 @@ enum gbm_bo_format { GBM_BO_FORMAT_ARGB8888 }; + +/** + * The FourCC format codes are taken from the drm_fourcc.h definition, and + * re-namespaced. New GBM formats must not be added, unless they are + * identical ports from drm_fourcc. + */ #define __gbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) @@ -243,9 +249,16 @@ gbm_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, + uint32_t width, uint32_t height, + uint32_t format, + const uint64_t *modifiers, + const unsigned int count); #define GBM_BO_IMPORT_WL_BUFFER 0x5501 #define GBM_BO_IMPORT_EGL_IMAGE 0x5502 #define GBM_BO_IMPORT_FD 0x5503 +#define GBM_BO_IMPORT_FD_MODIFIER 0x5504 struct gbm_import_fd_data { int fd; @@ -255,6 +268,17 @@ struct gbm_import_fd_data { uint32_t format; }; +struct gbm_import_fd_modifier_data { + uint32_t width; + uint32_t height; + uint32_t format; + uint32_t num_fds; + int fds[4]; + int strides[4]; + int offsets[4]; + uint64_t modifier; +}; + struct gbm_bo * gbm_bo_import(struct gbm_device *gbm, uint32_t type, void *buffer, uint32_t usage); @@ -309,7 +333,10 @@ gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane); uint32_t gbm_bo_get_format(struct gbm_bo *bo); -int64_t +uint32_t +gbm_bo_get_bpp(struct gbm_bo *bo); + +uint32_t gbm_bo_get_offset(struct gbm_bo *bo, int plane); struct gbm_device * @@ -321,6 +348,9 @@ gbm_bo_get_handle(struct gbm_bo *bo); int gbm_bo_get_fd(struct gbm_bo *bo); +uint64_t +gbm_bo_get_modifier(struct gbm_bo *bo); + int gbm_bo_get_plane_count(struct gbm_bo *bo); @@ -345,6 +375,12 @@ gbm_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, + uint32_t width, uint32_t height, + uint32_t format, + const uint64_t *modifiers, + const unsigned int count); int gbm_surface_needs_lock_front_buffer(struct gbm_surface *surface);