Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
yshui committed Nov 11, 2018
2 parents a34dfd3 + a61b877 commit 57368e0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 42 deletions.
6 changes: 0 additions & 6 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1638,9 +1638,6 @@ vsync_deinit(session_t *ps);
*/
///@{

void
xr_glx_sync(session_t *ps, Drawable d, XSyncFence *pfence);

/**
* Free a GLX texture.
*/
Expand Down Expand Up @@ -1761,9 +1758,6 @@ xr_sync(session_t *ps, Drawable d, XSyncFence *pfence) {
if (*pfence)
XSyncResetFence(ps->dpy, *pfence);
}
#ifdef OPENGL
xr_glx_sync(ps, d, pfence);
#endif
}

/** @name DBus handling
Expand Down
26 changes: 26 additions & 0 deletions src/compton.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include <ctype.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <xcb/randr.h>
#include <xcb/present.h>
#include <xcb/damage.h>
Expand All @@ -28,6 +30,8 @@
#include "config.h"
#include "diagnostic.h"

#define auto __auto_type

static void
finish_destroy_win(session_t *ps, win **_w);

Expand Down Expand Up @@ -3236,6 +3240,28 @@ ev_handle(session_t *ps, xcb_generic_event_t *ev) {
}
#endif

// Check if a custom XEvent constructor was registered in xlib for this event
// type, and call it discarding the constructed XEvent if any. XESetWireToEvent
// might be used by libraries to intercept messages from the X server e.g. the
// OpenGL lib waiting for DRI2 events.

// XXX This exists to workaround compton issue #33, #34, #47
// For even more details, see:
// https://bugs.freedesktop.org/show_bug.cgi?id=35945
// https://lists.freedesktop.org/archives/xcb/2011-November/007337.html
auto proc = XESetWireToEvent(ps->dpy, ev->response_type, 0);
if (proc) {
XESetWireToEvent(ps->dpy, ev->response_type, proc);
XEvent dummy;

// Stop Xlib from complaining about lost sequence numbers.
// proc might also just be Xlib internal event processing functions, and
// because they probably won't see all X replies, they will complain about
// missing sequence numbers.
ev->sequence = LastKnownRequestProcessed(ps->dpy);
proc(ps->dpy, &dummy, (xEvent *)ev);
}

// XXX redraw needs to be more fine grained
queue_redraw(ps);

Expand Down
6 changes: 6 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ parse_conv_kern_lst(session_t *ps, const char *src, xcb_render_fixed_t **dest, i
return false;
}

if (i > 1) {
printf_errf("(): You are seeing this message because your are using multipass\n"
"blur. Please report an issue to us so we know multipass blur is actually been used.\n"
"Otherwise it might be removed in future releases");
}

if (*pc) {
printf_errf("(): Too many blur kernels!");
return false;
Expand Down
36 changes: 0 additions & 36 deletions src/opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,23 +185,6 @@ get_visualinfo_from_visual(session_t *ps, xcb_visualid_t visual) {
return XGetVisualInfo(ps->dpy, VisualIDMask, &vreq, &nitems);
}

void
xr_glx_sync(session_t *ps, Drawable d, XSyncFence *pfence) {
if (*pfence) {
// GLsync sync = ps->psglx->glFenceSyncProc(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
GLsync sync = ps->psglx->glImportSyncEXT(GL_SYNC_X11_FENCE_EXT, *pfence, 0);
/* GLenum ret = ps->psglx->glClientWaitSyncProc(sync, GL_SYNC_FLUSH_COMMANDS_BIT,
1000);
assert(GL_CONDITION_SATISFIED == ret); */
XSyncTriggerFence(ps->dpy, *pfence);
XFlush(ps->dpy);
ps->psglx->glWaitSyncProc(sync, 0, GL_TIMEOUT_IGNORED);
// ps->psglx->glDeleteSyncProc(sync);
// XSyncResetFence(ps->dpy, *pfence);
}
glx_check_err(ps);
}

#ifdef DEBUG_GLX_DEBUG_CONTEXT
static inline GLXFBConfig
get_fbconfig_from_visualinfo(session_t *ps, const XVisualInfo *visualinfo) {
Expand Down Expand Up @@ -378,25 +361,6 @@ glx_init(session_t *ps, bool need_render) {
printf_errf("(): Failed to acquire glXBindTexImageEXT() / glXReleaseTexImageEXT().");
goto glx_init_end;
}

psglx->glFenceSyncProc = (f_FenceSync)
glXGetProcAddress((const GLubyte *) "glFenceSync");
psglx->glIsSyncProc = (f_IsSync)
glXGetProcAddress((const GLubyte *) "glIsSync");
psglx->glDeleteSyncProc = (f_DeleteSync)
glXGetProcAddress((const GLubyte *) "glDeleteSync");
psglx->glClientWaitSyncProc = (f_ClientWaitSync)
glXGetProcAddress((const GLubyte *) "glClientWaitSync");
psglx->glWaitSyncProc = (f_WaitSync)
glXGetProcAddress((const GLubyte *) "glWaitSync");
psglx->glImportSyncEXT = (f_ImportSyncEXT)
glXGetProcAddress((const GLubyte *) "glImportSyncEXT");
if (!psglx->glFenceSyncProc || !psglx->glIsSyncProc || !psglx->glDeleteSyncProc
|| !psglx->glClientWaitSyncProc || !psglx->glWaitSyncProc
|| !psglx->glImportSyncEXT) {
printf_errf("(): Failed to acquire GLX sync functions.");
goto glx_init_end;
}
}

// Acquire FBConfigs
Expand Down

0 comments on commit 57368e0

Please sign in to comment.