Files
RedBear-OS/local/patches/libdrm/P1-ioctl-response-sizes.patch
T
vasilito 6a0659ee04 feat: add VirtGPU ioctl bridge and PCI info patches for libdrm
P1: Replaces the old per-ioctl C handlers with a unified dispatch through\nredox_drm_simple_ioctl(), adds VirtGPU NR mappings (MAP, EXECBUFFER,\nGETPARAM, RESOURCE_CREATE, GET_CAPS, etc.), and special handlers for\nEXECBUFFER (inline command buffer) and GET_CAPS (variable response).

P2: Adds __redox__ blocks to drmParsePciBusInfo, drmParsePciDeviceInfo,\nand drmGetDevice2 using the DRM scheme GET_PCI_INFO ioctl to populate\nPCI device identification without /sys access.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 07:23:57 +01:00

31 lines
874 B
Diff

diff --git a/local/recipes/libs/libdrm/source/xf86drm.c b/local/recipes/libs/libdrm/source/xf86drm.c
index 0379aafd7e..2d3fcd6d3b 100644
--- a/local/recipes/libs/libdrm/source/xf86drm.c
+++ b/local/recipes/libs/libdrm/source/xf86drm.c
@@ -1653,6 +1653,10 @@ static size_t redox_drm_expected_response_size(unsigned long linux_nr, size_t ar
case 0xA9:
case 0xAA:
case 0xAC:
+ case 0xB2:
+ case 0xB4:
+ case 0xBD:
+ case 0xBE:
case 0xB8:
case 0xB9:
case 0xB3:
@@ -4482,7 +4486,13 @@ drm_public int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags,
return -errno;
}
- *prime_fd = response.fd;
+ char path[64];
+ snprintf(path, sizeof(path), "card0/dmabuf/%d", response.fd);
+ int real_fd = openat(fd, path, O_RDWR | O_CLOEXEC);
+ if (real_fd < 0) {
+ return -errno;
+ }
+ *prime_fd = real_fd;
return 0;
#else
struct drm_prime_handle args;