Fix oversized DRM dumb buffer for 4:2:0 uploads

This commit is contained in:
Cameron Gutman
2026-01-06 00:49:49 -06:00
parent 80ddd5ba13
commit 377409f313

View File

@@ -1093,7 +1093,9 @@ bool DrmRenderer::mapSoftwareFrame(AVFrame *frame, AVDRMFrameDescriptor *mappedF
// value of the Y component will also include the space for chroma
// since it's all packed into a single plane.
if (planes > 1) {
createBuf.height += (2 * AV_CEIL_RSHIFT(frame->height, formatDesc->log2_chroma_h));
createBuf.height += (2 * AV_CEIL_RSHIFT(frame->height,
formatDesc->log2_chroma_w +
formatDesc->log2_chroma_h));
}
int err = drmIoctl(m_DrmFd, DRM_IOCTL_MODE_CREATE_DUMB, &createBuf);