mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-01 23:35:55 +00:00
Use drmIoctl() instead of bare ioctl() to handle EINTR/EAGAIN
This commit is contained in:
parent
e20d56041e
commit
c3e886fbcc
@ -11,7 +11,6 @@ extern "C" {
|
||||
|
||||
#include <libdrm/drm_fourcc.h>
|
||||
#include <linux/dma-buf.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
// 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user