glxsync - explicit frame synchronization sample implementation

2021-12-29 Thread Michael Clark

Dear Mesa Developers,

I have been using GLFW for tiny cross-platform OpenGL demos for some 
time but something that has really been bothering me are the visual 
artifacts when resizing windows. Over the last year or so I have made 
multiple attempts at solving this issue, digging progressively deeper 
each time, until spending the last month researching compositor 
synchronization protocols, reading compositor code, and writing this 
demo as a prelude to figuring out how one might fix this issue in GLFW 
or even Chrome.


I decided that first it might be a good idea to come up with the 
simplest possible isolated example comprising of a near complete 
solution without the unnecessary complexity of layering for all of the 
cross-platform abstractions. It seems to me despite the ease this can be 
solved with Wayland EGL, it is still useful, primarily for wider 
compatibility, to be able to package X11 GLX applications, which is the 
window system that I typically use when targeting Linux with GLFW.


That brings me to _glxsync_ which is an attempt at creating a minimally 
correct implementation of explicit frame synchronization using X11, GLX, 
XSync and the latest compositor synchronization protocols [1,2], tested 
to work with mutter and GNOME on Xorg or Xwayland.


- https://github.com/michaeljclark/glxsync/

_glxsync_ is an X Windows OpenGL demo app using GLX and XSync extended 
frame synchronization responding to synchronization requests from the 
compositor in response to configuration changes for window resizes. The 
demo updates extended synchronization counters before and after frames 
to signal to the compositor that rendering is in progress so that 
buffers read by the compositor are complete and matches the size in 
configuration change events. It also has rudimentary congestion control.


_glxsync_ depends on the following X11 window system atoms:

- _NET_WM_SYNC_REQUEST
- _NET_WM_SYNC_REQUEST_COUNTER
- _NET_WM_FRAME_DRAWN
- _NET_WM_FRAME_TIMINGS
- _NET_WM_PING

_glxsync_ *does not* yet implement the following extensions:

- _NET_WM_SYNC_FENCES
- _NET_WM_MOVERESIZE

_glxsync_ depends on the following libraries: _X11, Xext, GLX, GL_.

I have to say there were numerous subtle issues that I found while 
testing this code on Ubuntu 21.10 XWayland with an Intel Mesa graphics 
stack and Ubuntu 20.04 LTS Xorg with the NVIDIA proprietary graphics 
stack, so I have no idea how it will fly with other drivers and am very 
interested in feedback. There really is not much sample code that I 
could find that addresses this issue.


I found the Intel driver particularly finicky and there are some very 
carefully placed XFlush calls *before* frame renders, and XSync calls 
during congestion. There are also the beginnings of adaptive frame rate 
using frame times and render timings stored in a circular buffer. That 
said, there is no advanced adaptive frame rate logic beyond detecting 
circumstances that can lead to tears with a back-off to the measured 
short term average frame rate from statistics, and some logic to delay 
frames when there are collisions with Expose events.


There is also some rudimentary tracing infrastructure and some carefully 
placed calls to poll, XEventsQueued(d, QueuedAlready), XEventsQueued(d, 
QueuedAfterReading) to avoid blocking in XNextEvent at all costs. I 
found it necessary to add a heuristic to avoid frame submission until 
receiving frame timings from the compositor. Intuitively one might think 
this makes the loop synchronous, but with the NVIDIA driver, it appears 
the heuristic still allows multiple frames to be submitted in advance. 
It is certainly finicky to debug. There is a --no-sync option to 
simulate the absence of compositor synchronization as a testing aid.


There is very little back-pressure signaling to the client beyond the 
ability to observe timings and serial numbers in frame drawn and frame 
timing messages. It worries me that I need very careful placement of 
XFlush and XSync to make the demo work so I would really appreciate 
feedback if I am doing it wrong. There is some interesting potential for 
control loops when using stats for adaptive frame rate, so I have not 
yet attempted any sophisticated congestion control algorithm.


In any case I am sharing this code with the hopes that folk can help 
with testing. I was thinking to make a patch for GLFW but this was a 
first step. I would really appreciate if folks could help test on 
different drivers such as nouveau and amdgpu as I don't have access to 
them. The code is currently released under the PLEASE LICENSE which is 
practically public domain with one exception, but I am not disinclined 
towards releasing it under an MIT license if it were found to be a 
useful sample to add to the mesa demos.


Is there a place in mesa-demos for a frame synchronization demo? I see 
glsync. Is there a compositor sync example that I may have missed? I can 
imagine with the addition of WM_MOVERESIZE it could 

Gmail/GitLab email filtering script

2021-12-29 Thread Matt Turner
In case it's useful for anyone, I've written a Google Apps Script that
allows me to filter notification emails based on X-GitLab headers.
It's available here
(https://github.com/mattst88/gmail-gitlab-filtering) and I'd be happy
to hear if it's useful for you.

Thanks,
Matt


[ANNOUNCE] mesa 21.3.3

2021-12-29 Thread Eric Engestrom
Hello everyone,

The third bugfix release, 21.3.3, is now available, containing
a majority of AMD fixes, mostly r300.

Please report any issue here:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/new

The next bugfix release is due in two weeks, on January 12th.

Cheers,
  Eric

---

Alyssa Rosenzweig (2):
  pan/indirect_draw: Don't upload garbage UBO
  panfrost: Fix Secondary Shader field

Bas Nieuwenhuizen (2):
  radv: Use correct buffer size for query pool result copies.
  radv: Skip wait timeline ioctl with 0 handles.

Daniel Schürmann (2):
  aco/optimizer: fix fneg modifier propagation on VOP3P
  aco/ra: fix get_reg_for_operand() in case of stride mismatches

Emma Anholt (7):
  r300: Fix mis-optimization turning -1 - x into 1 - x.
  r300: Move the instruction filter for r500_transform_IF() to the top.
  r300: Ensure that immediates have matching negate flags too.
  r300: Also consider ALU condition modifiers for loop DCE.
  r300: Disable loop unrolling on r500.
  r300/vs: Allocate temps we see a use as a source, too.
  r300/vs: Fix flow control processing just after an endloop.

Eric Engestrom (4):
  .pick_status.json: Update to 4942e108909bbe0f53ec5fd52a3c7ae14c60abe6
  .pick_status.json: Mark d49d092259829ad9e33d0d9fc8eef9759d9fe56e as 
denominated
  docs: add release notes for 21.3.3
  VERSION: bump for 21.3.3

Francisco Jerez (1):
  intel/fs: Add physical fall-through CFG edge for unconditional BREAK 
instruction.

Jason Ekstrand (1):
  vulkan/log: Don't assert on non-client-visible objects

Jesse Natalie (1):
  microsoft/compiler: Implement inot

Liviu Prodea (1):
  swr: Fix MSVC build

Rob Clark (2):
  freedreno/ir3: Handle instr->address when cloning
  freedreno/computerator: Fix @buf header

Samuel Pitoiset (1):
  radv: re-apply "Do not access set layout during vkCmdBindDescriptorSets."

Tapani Pälli (1):
  glsl: fix invariant qualifer usage and matching rule for GLSL 4.20

Timur Kristóf (2):
  aco/optimizer_postRA: Fix combining DPP into VALU.
  aco/optimizer_postRA: Fix applying VCC to branches.

Vinson Lee (1):
  panfrost: Avoid double unlock.

git tag: mesa-21.3.3

https://mesa.freedesktop.org/archive/mesa-21.3.3.tar.xz
SHA256: ad7f4613ea7c5d08d9fcb5025270199e6ceb9aa99fd72ee572b70342240a8121  
mesa-21.3.3.tar.xz
SHA512: 
0263d75435f8c16d40eba3eae29bf372e8994816718deec153c582a17c4dd6ef1c67b3236ed31e63f98bf4e1089fac5cfafae9fb84d3e1fa919b274f43e7e673
  mesa-21.3.3.tar.xz
PGP:  https://mesa.freedesktop.org/archive/mesa-21.3.3.tar.xz.sig



signature.asc
Description: PGP signature