modesetting: map gbm bo's read/write

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111
2025-12-30 00:40:13 +02:00
committed by Enrico Weigelt
parent f4362fc4ec
commit 50ffe711ca

View File

@@ -1087,10 +1087,13 @@ drmmode_bo_map(drmmode_ptr drmmode, drmmode_bo *bo)
#ifdef GLAMOR_HAS_GBM
if (bo->gbm) {
/* We shouldn't read from gpu memory */
/**
* We shouldn't read from gpu memory, as it's really slow.
* We do allow it though, so nothing breaks.
*/
uint32_t stride = 0;
void* map_addr = NULL;
void* map_data = gbm_bo_map(bo->gbm, 0, 0, bo->width, bo->height, GBM_BO_TRANSFER_WRITE, &stride, &map_addr);
void* map_data = gbm_bo_map(bo->gbm, 0, 0, bo->width, bo->height, GBM_BO_TRANSFER_READ_WRITE, &stride, &map_addr);
if (map_data) {
bo->map_data = map_data;
bo->map_addr = map_addr;