Skip to content

Commit 4a2a798

Browse files
authored
Merge branch 'yshui:next' into next
2 parents 8efe470 + fdc5080 commit 4a2a798

File tree

5 files changed

+64
-52
lines changed

5 files changed

+64
-52
lines changed

man/picom.1.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ OPTIONS
185185
Blur background of windows when the window frame is not opaque. Implies *--blur-background*. Bad in performance, with driver-dependent behavior. The name may change.
186186

187187
*--blur-background-fixed*::
188-
Use fixed blur strength rather than adjusting according to window opacity.
188+
Use fixed blur strength for a window during fading. This only applies to the *--fading* option, and will be a no-op if animation scripts are used.
189189

190190
*--blur-kern* _MATRIX_::
191191
Specify the blur convolution kernel, with the following format:

src/backend/gl/egl.c

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static backend_t *egl_init(session_t *ps, xcb_window_t target) {
154154
eglext_init(gd->display);
155155
init_backend_base(&gd->gl.base, ps);
156156
gd->gl.base.ops = egl_ops;
157-
if (!eglext.has_EGL_KHR_image_pixmap) {
157+
if (!eglext.has_KHR_image_pixmap) {
158158
log_error("EGL_KHR_image_pixmap not available.");
159159
goto end;
160160
}
@@ -190,9 +190,14 @@ static backend_t *egl_init(session_t *ps, xcb_window_t target) {
190190
goto end;
191191
}
192192

193-
gd->ctx = eglCreateContext(gd->display, config, NULL, NULL);
193+
gd->ctx = eglCreateContext(
194+
gd->display, config, NULL,
195+
(EGLint[]){EGL_CONTEXT_MAJOR_VERSION, 3, EGL_CONTEXT_MINOR_VERSION, 3,
196+
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
197+
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY,
198+
EGL_LOSE_CONTEXT_ON_RESET, EGL_NONE});
194199
if (gd->ctx == EGL_NO_CONTEXT) {
195-
log_error("Failed to get EGL context.");
200+
log_error("Failed to get EGL context: %#x", eglGetError());
196201
goto end;
197202
}
198203

@@ -292,7 +297,7 @@ static bool egl_present(backend_t *base) {
292297
}
293298

294299
static int egl_buffer_age(backend_t *base) {
295-
if (!eglext.has_EGL_EXT_buffer_age) {
300+
if (!eglext.has_EXT_buffer_age) {
296301
return -1;
297302
}
298303

@@ -309,9 +314,11 @@ static void egl_diagnostics(backend_t *base) {
309314
auto egl_vendor = eglQueryString(gd->display, EGL_VENDOR);
310315
printf("* Driver vendors:\n");
311316
printf(" * EGL: %s\n", egl_vendor);
312-
if (eglext.has_EGL_MESA_query_driver) {
317+
#ifdef EGL_MESA_query_driver
318+
if (eglext.has_MESA_query_driver) {
313319
printf(" * EGL driver: %s\n", eglGetDisplayDriverName(gd->display));
314320
}
321+
#endif
315322
printf(" * GL: %s\n", glGetString(GL_VENDOR));
316323

317324
auto gl_renderer = (const char *)glGetString(GL_RENDERER);
@@ -334,7 +341,7 @@ static void egl_diagnostics(backend_t *base) {
334341
}
335342

336343
static int egl_max_buffer_age(backend_t *base attr_unused) {
337-
if (!eglext.has_EGL_EXT_buffer_age) {
344+
if (!eglext.has_EXT_buffer_age) {
338345
return 0;
339346
}
340347

@@ -390,17 +397,15 @@ void eglext_init(EGLDisplay dpy) {
390397
return;
391398
}
392399
eglext.initialized = true;
393-
#define check_ext(name) \
394-
eglext.has_##name = epoxy_has_egl_extension(dpy, #name); \
395-
log_info("Extension " #name " - %s", eglext.has_##name ? "present" : "absent")
400+
#define X(name) \
401+
eglext.has_##name = epoxy_has_egl_extension(dpy, "EGL_" #name); \
402+
log_info("EGL extension " #name " - %s", eglext.has_##name ? "present" : "absent");
396403

397-
check_ext(EGL_EXT_buffer_age);
398-
check_ext(EGL_EXT_create_context_robustness);
399-
check_ext(EGL_KHR_image_pixmap);
404+
EGL_EXTS;
400405
#ifdef EGL_MESA_query_driver
401-
check_ext(EGL_MESA_query_driver);
406+
X(MESA_query_driver);
402407
#endif
403-
#undef check_ext
408+
#undef X
404409
}
405410

406411
BACKEND_ENTRYPOINT(egl_register) {

src/backend/gl/egl.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@
77
#include <xcb/render.h>
88
#include <xcb/xcb.h>
99

10+
#define EGL_EXTS \
11+
X(EXT_buffer_age) \
12+
X(EXT_create_context_robustness) \
13+
X(KHR_image_pixmap)
14+
1015
struct eglext_info {
1116
bool initialized;
12-
bool has_EGL_MESA_query_driver;
13-
bool has_EGL_EXT_buffer_age;
14-
bool has_EGL_EXT_create_context_robustness;
15-
bool has_EGL_KHR_image_pixmap;
17+
18+
#ifdef EGL_MESA_query_driver
19+
bool has_MESA_query_driver;
20+
#endif
21+
#define X(x) bool has_##x;
22+
EGL_EXTS
23+
#undef X
1624
};
1725

1826
extern struct eglext_info eglext;

src/backend/gl/glx.c

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ static void *glx_decouple_user_data(backend_t *base attr_unused, void *ud attr_u
203203

204204
static bool glx_set_swap_interval(int interval, Display *dpy, GLXDrawable drawable) {
205205
bool vsync_enabled = false;
206-
if (glxext.has_GLX_MESA_swap_control) {
206+
if (glxext.has_MESA_swap_control) {
207207
vsync_enabled = (glXSwapIntervalMESA((uint)interval) == 0);
208208
}
209-
if (!vsync_enabled && glxext.has_GLX_SGI_swap_control) {
209+
if (!vsync_enabled && glxext.has_SGI_swap_control) {
210210
vsync_enabled = (glXSwapIntervalSGI(interval) == 0);
211211
}
212-
if (!vsync_enabled && glxext.has_GLX_EXT_swap_control) {
212+
if (!vsync_enabled && glxext.has_EXT_swap_control) {
213213
// glXSwapIntervalEXT doesn't return if it's successful
214214
glXSwapIntervalEXT(dpy, drawable, interval);
215215
vsync_enabled = true;
@@ -264,12 +264,12 @@ static backend_t *glx_init(session_t *ps, xcb_window_t target) {
264264
goto end;
265265
}
266266

267-
if (!glxext.has_GLX_EXT_texture_from_pixmap) {
267+
if (!glxext.has_EXT_texture_from_pixmap) {
268268
log_error("GLX_EXT_texture_from_pixmap is not supported by your driver");
269269
goto end;
270270
}
271271

272-
if (!glxext.has_GLX_ARB_create_context) {
272+
if (!glxext.has_ARB_create_context) {
273273
log_error("GLX_ARB_create_context is not supported by your driver");
274274
goto end;
275275
}
@@ -295,7 +295,7 @@ static backend_t *glx_init(session_t *ps, xcb_window_t target) {
295295
0,
296296
0,
297297
0};
298-
if (glxext.has_GLX_ARB_create_context_robustness) {
298+
if (glxext.has_ARB_create_context_robustness) {
299299
attributes[6] = GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB;
300300
attributes[7] = GLX_LOSE_CONTEXT_ON_RESET_ARB;
301301
}
@@ -456,7 +456,7 @@ static bool glx_present(backend_t *base) {
456456
}
457457

458458
static int glx_buffer_age(backend_t *base) {
459-
if (!glxext.has_GLX_EXT_buffer_age) {
459+
if (!glxext.has_EXT_buffer_age) {
460460
return -1;
461461
}
462462

@@ -486,7 +486,7 @@ static void glx_diagnostics(backend_t *base) {
486486
}
487487

488488
#ifdef GLX_MESA_query_renderer
489-
if (glxext.has_GLX_MESA_query_renderer) {
489+
if (glxext.has_MESA_query_renderer) {
490490
unsigned int accelerated = 0;
491491
glXQueryCurrentRendererIntegerMESA(GLX_RENDERER_ACCELERATED_MESA, &accelerated);
492492
printf("* Accelerated: %d\n", accelerated);
@@ -557,23 +557,15 @@ void glxext_init(Display *dpy, int screen) {
557557
return;
558558
}
559559
glxext.initialized = true;
560-
#define check_ext(name) \
561-
glxext.has_##name = epoxy_has_glx_extension(dpy, screen, #name); \
562-
log_info("Extension " #name " - %s", glxext.has_##name ? "present" : "absent")
563-
564-
check_ext(GLX_SGI_video_sync);
565-
check_ext(GLX_SGI_swap_control);
566-
check_ext(GLX_OML_sync_control);
567-
check_ext(GLX_MESA_swap_control);
568-
check_ext(GLX_EXT_swap_control);
569-
check_ext(GLX_EXT_texture_from_pixmap);
570-
check_ext(GLX_ARB_create_context);
571-
check_ext(GLX_EXT_buffer_age);
572-
check_ext(GLX_ARB_create_context_robustness);
560+
#define X(name) \
561+
glxext.has_##name = epoxy_has_glx_extension(dpy, screen, "GLX_" #name); \
562+
log_info("GLX extension " #name " - %s", glxext.has_##name ? "present" : "absent");
563+
564+
GLX_EXTS;
573565
#ifdef GLX_MESA_query_renderer
574-
check_ext(GLX_MESA_query_renderer);
566+
X(MESA_query_renderer);
575567
#endif
576-
#undef check_ext
568+
#undef X
577569
}
578570

579571
BACKEND_ENTRYPOINT(glx_register) {

src/backend/gl/glx.h

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,25 @@ struct glx_fbconfig_info {
2020
bool glx_find_fbconfig(struct x_connection *c, struct xvisual_info m,
2121
struct glx_fbconfig_info *info);
2222

23+
#define GLX_EXTS \
24+
X(SGI_video_sync) \
25+
X(SGI_swap_control) \
26+
X(OML_sync_control) \
27+
X(MESA_swap_control) \
28+
X(EXT_swap_control) \
29+
X(EXT_texture_from_pixmap) \
30+
X(ARB_create_context) \
31+
X(EXT_buffer_age) \
32+
X(ARB_create_context_robustness)
33+
2334
struct glxext_info {
2435
bool initialized;
25-
bool has_GLX_SGI_video_sync;
26-
bool has_GLX_SGI_swap_control;
27-
bool has_GLX_OML_sync_control;
28-
bool has_GLX_MESA_swap_control;
29-
bool has_GLX_EXT_swap_control;
30-
bool has_GLX_EXT_texture_from_pixmap;
31-
bool has_GLX_ARB_create_context;
32-
bool has_GLX_EXT_buffer_age;
33-
bool has_GLX_MESA_query_renderer;
34-
bool has_GLX_ARB_create_context_robustness;
36+
#define X(name) bool has_##name;
37+
GLX_EXTS
38+
#undef X
39+
#ifdef GLX_MESA_query_renderer
40+
bool has_MESA_query_renderer;
41+
#endif
3542
};
3643

3744
extern struct glxext_info glxext;

0 commit comments

Comments
 (0)