diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | cube-tex.c | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 242164f..aa0ef36 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Obtain compiler/linker options for depedencies PKG_CHECK_MODULES(DRM, libdrm) -PKG_CHECK_MODULES(GBM, gbm) +PKG_CHECK_MODULES(GBM, gbm >= 13.0) PKG_CHECK_MODULES(EGL, egl) PKG_CHECK_MODULES(GLES2, glesv2) @@ -223,7 +223,7 @@ static int get_fd_rgba(uint32_t *pstride) int fd; /* NOTE: do not actually use GBM_BO_USE_WRITE since that gets us a dumb buffer: */ - bo = gbm_bo_create(gl.gbm->dev, texw, texh, GBM_FORMAT_ARGB8888, GBM_BO_USE_LINEAR); + bo = gbm_bo_create(gl.gbm->dev, texw, texh, GBM_FORMAT_ABGR8888, GBM_BO_USE_LINEAR); map = gbm_bo_map(bo, 0, 0, texw, texh, GBM_BO_TRANSFER_WRITE, &stride, &map_data); @@ -253,10 +253,9 @@ static int get_fd_y(uint32_t *pstride) int fd; /* NOTE: do not actually use GBM_BO_USE_WRITE since that gets us a dumb buffer: */ - /* hmm, no R8/R8G8 gbm formats?? */ - bo = gbm_bo_create(gl.gbm->dev, texw/4, texh, GBM_FORMAT_ARGB8888, GBM_BO_USE_LINEAR); + bo = gbm_bo_create(gl.gbm->dev, texw, texh, GBM_FORMAT_R8, GBM_BO_USE_LINEAR); - map = gbm_bo_map(bo, 0, 0, texw/4, texh, GBM_BO_TRANSFER_WRITE, &stride, &map_data); + map = gbm_bo_map(bo, 0, 0, texw, texh, GBM_BO_TRANSFER_WRITE, &stride, &map_data); for (uint32_t i = 0; i < texh; i++) { memcpy(&map[stride * i], &src[texw * i], texw); @@ -284,10 +283,9 @@ static int get_fd_uv(uint32_t *pstride) int fd; /* NOTE: do not actually use GBM_BO_USE_WRITE since that gets us a dumb buffer: */ - /* hmm, no R8/R8G8 gbm formats?? */ - bo = gbm_bo_create(gl.gbm->dev, texw/2/2, texh/2, GBM_FORMAT_ARGB8888, GBM_BO_USE_LINEAR); + bo = gbm_bo_create(gl.gbm->dev, texw/2, texh/2, GBM_FORMAT_GR88, GBM_BO_USE_LINEAR); - map = gbm_bo_map(bo, 0, 0, texw/2/2, texh/2, GBM_BO_TRANSFER_WRITE, &stride, &map_data); + map = gbm_bo_map(bo, 0, 0, texw/2, texh/2, GBM_BO_TRANSFER_WRITE, &stride, &map_data); for (uint32_t i = 0; i < texh/2; i++) { memcpy(&map[stride * i], &src[texw * i], texw); |