// Demo for check the dmabuf is reday
static bool isDmaBufFdReadable(int fd) {
struct pollfd pollFd;
pollFd.fd = fd;
pollFd.events = POLLIN;
pollFd.revents = 0;
int ret = poll(&pollFd, 1, 0);
if (ret <= 0) {
return false;
}
return (pollFd.revents & (POLLIN | POLLERR | POLLNVAL)) != 0;
}
See also
https://zamundaaa.github.io/wayland/2023/08/29/getting-rid-of-cursor-stutter.htmlAnd see also: https://blogs.gnome.org/shell-dev/2023/03/30/ensuring-steady-frame-rates-with-gpu-intensive-clients/