vrend: match Mesa gbm header

We can now use gbm_bo_map(..) directly to match Mesa.

If minigbm doesn't define the needed use flags, we define it
internally.

This should allow us to build with minigbm allocation enabled and
use the Mesa gbm header.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Gurchetan Singh 4 years ago
parent ba6d1e387b
commit 9dac27a026
  1. 2
      src/vrend_winsys_gbm.c
  2. 16
      src/vrend_winsys_gbm.h

@ -336,7 +336,7 @@ int virgl_gbm_transfer(struct gbm_bo *bo, uint32_t direction, const struct iovec
host_map_stride0 = 0; host_map_stride0 = 0;
uint32_t map_flags = (direction == VIRGL_TRANSFER_TO_HOST) ? GBM_BO_TRANSFER_WRITE : uint32_t map_flags = (direction == VIRGL_TRANSFER_TO_HOST) ? GBM_BO_TRANSFER_WRITE :
GBM_BO_TRANSFER_READ; GBM_BO_TRANSFER_READ;
void *addr = gbm_bo_map2(bo, 0, 0, width, height, map_flags, &host_map_stride0, &map_data, 0); void *addr = gbm_bo_map(bo, 0, 0, width, height, map_flags, &host_map_stride0, &map_data);
if (!addr) if (!addr)
return -1; return -1;

@ -40,6 +40,22 @@
#define GBM_FORMAT_ABGR16161616F __gbm_fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */ #define GBM_FORMAT_ABGR16161616F __gbm_fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */
#endif #endif
#ifndef MINIGBM
#define GBM_BO_USE_TEXTURING (1 << 5),
#define GBM_BO_USE_CAMERA_WRITE (1 << 6)
#define GBM_BO_USE_CAMERA_READ (1 << 7)
#define GBM_BO_USE_PROTECTED (1 << 8)
#define GBM_BO_USE_SW_READ_OFTEN (1 << 9)
#define GBM_BO_USE_SW_READ_RARELY (1 << 10)
#define GBM_BO_USE_SW_WRITE_OFTEN (1 << 11)
#define GBM_BO_USE_SW_WRITE_RARELY (1 << 12)
#define GBM_BO_USE_HW_VIDEO_DECODER (1 << 13)
#define GBM_BO_USE_HW_VIDEO_ENCODER (1 << 14)
#define GBM_TEST_ALLOC (1 << 15)
#endif
/* /*
* If fd >= 0, virglrenderer owns the fd since it was opened via a rendernode * If fd >= 0, virglrenderer owns the fd since it was opened via a rendernode
* query. If fd < 0, the gbm device was opened with the fd provided by the * query. If fd < 0, the gbm device was opened with the fd provided by the

Loading…
Cancel
Save