Skip to content

Commit

Permalink
fix(dri3.c): Allowed using the DRM_FORMAT_MOD_INVALID modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
xMeM authored and twaik committed Dec 9, 2024
1 parent 150eca2 commit d1990c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/src/main/cpp/lorie/dri3.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <android/hardware_buffer.h>
#include <sys/stat.h>
#include <errno.h>
#include "drm_fourcc.h"
#include "screenint.h"
#include "lorie.h"
#include "renderer.h"
Expand Down Expand Up @@ -441,12 +442,13 @@ static PixmapPtr loriePixmapFromFds(ScreenPtr screen, CARD8 num_fds, const int *
return NULL;
}

if (modifier != RAW_MMAPPABLE_FD && modifier != AHARDWAREBUFFER_SOCKET_FD) {
if (modifier != RAW_MMAPPABLE_FD && modifier != AHARDWAREBUFFER_SOCKET_FD &&
modifier != DRM_FORMAT_MOD_INVALID) {
log(ERROR, "DRI3: Modifier is not RAW_MMAPPABLE_FD or AHARDWAREBUFFER_SOCKET_FD");
return NULL;
}

if (modifier == RAW_MMAPPABLE_FD) {
if (modifier == DRM_FORMAT_MOD_INVALID || modifier == RAW_MMAPPABLE_FD) {
void *addr = mmap(NULL, strides[0] * height, PROT_READ, MAP_SHARED, fds[0], offsets[0]);
if (!addr || addr == MAP_FAILED) {
log(ERROR, "DRI3: RAW_MMAPPABLE_FD: mmap failed");
Expand Down

0 comments on commit d1990c5

Please sign in to comment.