From c3e886fbcc4664b7afb5f0062c1558eda02b9001 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 5 Jan 2024 18:33:17 -0600 Subject: [PATCH] Use drmIoctl() instead of bare ioctl() to handle EINTR/EAGAIN --- app/streaming/video/ffmpeg-renderers/drm.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/drm.cpp b/app/streaming/video/ffmpeg-renderers/drm.cpp index 89e0a6cd..786ac62c 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -11,7 +11,6 @@ extern "C" { #include #include -#include // Special Rockchip type #ifndef DRM_FORMAT_NA12 @@ -844,7 +843,7 @@ bool DrmRenderer::mapSoftwareFrame(AVFrame *frame, AVDRMFrameDescriptor *mappedF // Prepare to write to the dumb buffer from the CPU struct dma_buf_sync sync; sync.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_WRITE; - ioctl(drmFrame->primeFd, DMA_BUF_IOCTL_SYNC, &sync); + drmIoctl(drmFrame->primeFd, DMA_BUF_IOCTL_SYNC, &sync); int lastPlaneSize = 0; for (int i = 0; i < 4; i++) { @@ -898,7 +897,7 @@ bool DrmRenderer::mapSoftwareFrame(AVFrame *frame, AVDRMFrameDescriptor *mappedF // End the CPU write to the dumb buffer sync.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_WRITE; - ioctl(drmFrame->primeFd, DMA_BUF_IOCTL_SYNC, &sync); + drmIoctl(drmFrame->primeFd, DMA_BUF_IOCTL_SYNC, &sync); } ret = true;