mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 13:44:17 +00:00
Use drmIoctl() instead of bare ioctl() to handle EINTR/EAGAIN
This commit is contained in:
parent
e20d56041e
commit
c3e886fbcc
1 changed files with 2 additions and 3 deletions
|
@ -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…
Reference in a new issue