This patch adds two new ioctl's to the VIA Unichrome/Pro DRM driver: DRM_IOCTL_VIA_DMA_INIT DRM_IOCTL_VIA_CMDBUFFER
The first call sets up an area in AGP memory that will be used as the ring buffer. The second call copies a command buffer from user space memory to the ring buffer.
The motivation for this patch is to avoid the wait for engine idle call before each buffer flush in the current DRI driver. With this patch, the DRI driver can continue to flush its buffer as long as there is free space in the ring buffer.
This patch adds an additional copy operation on the command buffer. This buffer copying is necessary to support multiple DRI clients rendering simultaneously. Otherwise, more CPU time will be spent in the busy loop waiting for engine idle between DRI context switch. Even in the single client case, the tradeoff is reasonable in comparision to the kernel call to check for free buffer space for the client to render directly to the ring buffer.
Once the DRI driver code is changed to utilize the ring buffer, we don't need to allow user space access to MMIO registers by non-privileged user applications. Hopefully that will make the Unichrome DRI driver secure enough to leave Mesa CVS.
unichrome_drm_ringbuf.patch.bz2
Description: BZip2 compressed data