Reland "Use shared memory to send images to X server"
This is a reland of a752710d Original change's description: > Use shared memory to send images to X server > > When playing back a 1440p 60fps video without hardware acceleration, ~15% of > frames would be dropped. With this change, I'm not getting any dropped frames. > > Background: > The bottleneck is in SoftwareOutputDeviceX11::EndPaint, which (for 4K video) was > taking ~0.06s per frame, which was limiting the output to ~15fps. It was taking > so long because we were sending each frame to the X server over the wire. With > the shared memory approach from the above CL, SoftwareOutputDeviceX11::EndPaint > takes only ~0.00002s. > > Summary of changes: > * Switch usage of XPutImage() to XShmPutImage() when possible. > * Shm segment is recycled across frames. > * Segment has a 1.5x growth policy to give windows room to resize without > having to reallocate for each frame. > * Segment has space for 2 frames. It was experimentally found that bumping > this up to 3 didn't give significant gains. > * X server sends a completion event when XShmPutImage() is finished, so we > cannot recycle the memory until getting this event. > * Event processing happens on the GPU main thread, but processing needs to > happen on the compositor thread, so forwarding the event is necessary. This > is implemented in XShmImagePool. > > BUG=991633 > > Change-Id: Ia7782cb9e21d0a93d3250c118e4ba76025354e40 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1693737 > Commit-Queue: Thomas Anderson <thomasanderson@chromium.org> > Reviewed-by: kylechar <kylechar@chromium.org> > Reviewed-by: Robert Kroeger <rjkroege@chromium.org> > Reviewed-by: Kenneth Russell <kbr@chromium.org> > Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org> > Cr-Commit-Position: refs/heads/master@{#691321} R=jorgelo TBR=rjkroege,kbr,kylechar Bug: 991633 Change-Id: Id0533ea8ba4de45ca2242ee979197798a818826d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1775500Reviewed-by:Thomas Anderson <thomasanderson@chromium.org> Reviewed-by:
Jorge Lucangeli Obes <jorgelo@chromium.org> Auto-Submit: Thomas Anderson <thomasanderson@chromium.org> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org> Cr-Commit-Position: refs/heads/master@{#693202}
Showing
Please register or sign in to comment