On 4 February 2016 at 17:10, Rui Matos <tiagoma...@gmail.com> wrote: > This should be both more efficient and avoid the file descriptor > exhaustion issue that can happen with shm buffers if we're asked to > realize more cursors than the file descriptor limit. > > Signed-off-by: Rui Matos <tiagoma...@gmail.com> > --- > > On Sat, Dec 5, 2015 at 1:30 AM, Kristian Høgsberg <k...@bitplanet.net> wrote: >> Nice work. I think it would be about the same amount of work to do >> this for shm pixmaps instead of cursors. That way, an application that >> creates a lot of small pixmaps on shm-Xwayland (non-glamor) will also >> not crash the server either. > > I looked into doing this for a bit but it seemed very wasteful in > terms of memory usage with this simple allocation algorithm. I fear > the fragmentation after a little while would be pretty bad. At least > with cursors only we know that they're sized all in the same order of > magnitude but for pixmaps in general I think we'd need a smarter > algorithm and a good handful of heuristics. > > So, I decided to instead work on adding support for wl_drm cursor > buffers which nicely sidesteps all those issues. Unfortunately, with > this patch and on intel hardware where the hw cursor size isn't 64x64, > compositors have to fallback to "software" cursors, importing the > buffer as an EGLImage since mesa has this size hardcoded in > > http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/dri/i965/intel_screen.c#n621 > > which prevents compositors from importing the gbm bo. > > Rui > > hw/xwayland/xwayland-cursor.c | 156 > ++++++++++++++++++++++++++++++++++++------ > hw/xwayland/xwayland.c | 6 +- > 2 files changed, 138 insertions(+), 24 deletions(-) > > diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c > index 76729db..7f2aa9a 100644 > --- a/hw/xwayland/xwayland-cursor.c > +++ b/hw/xwayland/xwayland-cursor.c > @@ -28,7 +28,27 @@ > > #include <mipointer.h> > > +#ifdef GLAMOR_HAS_GBM > +#define MESA_EGL_NO_X11_HEADERS > +#include <drm/drm.h> Please don't include the kernel UAPI header - it is not guaranteed to be present. I.e. drop the drm/ prefix and, if needed, bump the libdrm requirement in configure.ac and/or define any symbols.
Thanks Emil _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel