dri: use _checked variants of xcb requests
Requests with no reply will report errors by default to the event loop, which then usually cause the not very useful log like this to be printed: X Error of failed request: BadAlloc (insufficient resources for operation) Major opcode of failed request: 149 () Minor opcode of failed request: 2 Serial number of failed request: 33 Current serial number in output stream: 34 This commit introduce some helpers to handle the xcb errors in Mesa, and be able to report errors properly. For instance the same error will now log: MESA: error: dri3_alloc_render_buffer:1634 xcb_dri3_pixmap_from_buffer[s] failed MESA: error: X error: 11 It's not fixing the underlying issue, but at least now tests like "glx-visuals-stencil -pixmap" and "glx-visuals-depth pixmap" fail properly. cc: mesa-stable Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33036>
This commit is contained in:
committed by
Marge Bot
parent
b307951648
commit
910c18df6c
@@ -1,5 +1,7 @@
|
||||
glx@glx-make-current,Fail
|
||||
glx@glx-multi-window-single-context,Fail
|
||||
glx@glx-visuals-depth -pixmap,Fail
|
||||
glx@glx-visuals-stencil -pixmap,Fail
|
||||
glx@glx-swap-event_async,Fail
|
||||
glx@glx-swap-pixmap-bad,Fail
|
||||
glx@glx_arb_create_context_no_error@no error,Fail
|
||||
|
||||
@@ -5,13 +5,6 @@ spec@arb_shader_draw_parameters@drawid-single-draw-display-list
|
||||
spec@egl_chromium_sync_control@conformance
|
||||
spec@egl_chromium_sync_control@conformance@eglGetSyncValuesCHROMIUM_msc_and_sbc_test
|
||||
|
||||
# With X11 -> Wayland: Crash -> Flake/Fail
|
||||
glx@glx-visuals-depth
|
||||
glx@glx-visuals-depth -pixmap
|
||||
glx@glx-visuals-stencil -pixmap
|
||||
|
||||
# segfault in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/48721664
|
||||
glx@glx-visuals-stencil
|
||||
# ci-collate: Issue found in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/49445712
|
||||
glx@glx-multithread-texture
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
glx@glx-multi-window-single-context,Fail
|
||||
glx@glx-swap-pixmap-bad,Fail
|
||||
glx@glx-visuals-depth -pixmap,Fail
|
||||
glx@glx-visuals-stencil -pixmap,Fail
|
||||
glx@glx_arb_create_context_no_error@no error,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.0@rasterpos,Fail
|
||||
|
||||
@@ -8,10 +8,6 @@ spec@egl_chromium_sync_control@conformance@eglGetSyncValuesCHROMIUM_msc_and_sbc_
|
||||
# Flaky with a Fail result since the piglit fix made it stop crashing.
|
||||
glx@glx-make-current
|
||||
|
||||
# With X11 -> Wayland: Crash -> Flake/Fail
|
||||
glx@glx-visuals-stencil -pixmap
|
||||
glx@glx-visuals-depth -pixmap
|
||||
|
||||
# OQ flakes/fails started with no perceivable pattern around 2023-12-13
|
||||
dEQP-GLES3.functional.occlusion_query..*
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# piglit failures
|
||||
glx@glx-make-current,Fail
|
||||
glx@glx-multi-window-single-context,Fail
|
||||
glx@glx-visuals-depth -pixmap,Crash
|
||||
glx@glx-visuals-stencil -pixmap,Crash
|
||||
glx@glx-visuals-depth -pixmap,Fail
|
||||
glx@glx-visuals-stencil -pixmap,Fail
|
||||
glx@glx_arb_create_context_no_error@no error,Fail
|
||||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# piglit failures
|
||||
glx@glx-multithread-texture,Fail
|
||||
glx@glx-visuals-depth -pixmap,Crash
|
||||
glx@glx-visuals-stencil -pixmap,Crash
|
||||
glx@glx-visuals-depth -pixmap,Fail
|
||||
glx@glx-visuals-stencil -pixmap,Fail
|
||||
glx@glx-make-current,Fail
|
||||
glx@glx-multi-window-single-context,Fail
|
||||
glx@glx-swap-event_interval,Fail
|
||||
|
||||
|
@@ -8,7 +8,8 @@ glx@glx-multi-window-single-context,Fail
|
||||
glx@glx-swap-event_interval,Fail
|
||||
glx@glx_arb_create_context_no_error@no error,Fail
|
||||
glx@glx_ext_no_config_context@no fbconfig,Fail
|
||||
glx@glx-visuals-depth -pixmap,Crash
|
||||
glx@glx-visuals-depth -pixmap,Fail
|
||||
glx@glx-visuals-stencil -pixmap,Fail
|
||||
spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail
|
||||
spec@!opengl 1.1@line-smooth-stipple,Fail
|
||||
spec@arb_pipeline_statistics_query@arb_pipeline_statistics_query-frag,Fail
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# piglit failures
|
||||
glx@glx-make-current,Fail
|
||||
glx@glx-multi-window-single-context,Fail
|
||||
glx@glx-visuals-depth -pixmap,Crash
|
||||
glx@glx-visuals-stencil -pixmap,Crash
|
||||
glx@glx-visuals-depth -pixmap,Fail
|
||||
glx@glx-visuals-stencil -pixmap,Fail
|
||||
glx@glx_arb_create_context_no_error@no error,Fail
|
||||
glx@glx_ext_import_context@free context,Fail
|
||||
glx@glx_ext_import_context@get context id,Fail
|
||||
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "loader_dri_helper.h"
|
||||
#include "loader_dri3_helper.h"
|
||||
#include "pipe/p_screen.h"
|
||||
#include "util/log.h"
|
||||
#include "util/macros.h"
|
||||
#include "util/simple_mtx.h"
|
||||
#include "drm-uapi/drm_fourcc.h"
|
||||
@@ -78,6 +79,26 @@ get_screen_for_root(xcb_connection_t *conn, xcb_window_t root)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Error checking helpers for xcb_ functions. Use it to avoid late
|
||||
* error handling
|
||||
*/
|
||||
__attribute__((format(printf, 3, 4)))
|
||||
static bool _check_xcb_error(xcb_connection_t *conn, xcb_void_cookie_t cookie, const char *fmt, ...) {
|
||||
xcb_generic_error_t *error;
|
||||
|
||||
if ((error = xcb_request_check(conn, cookie))) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
mesa_loge_v(fmt, args);
|
||||
mesa_loge("X error: %d\n", error->error_code);
|
||||
va_end(args);
|
||||
free(error);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#define check_xcb_error(cookie, name) _check_xcb_error(draw->conn, cookie, "%s:%d %s failed", __func__, __LINE__, name)
|
||||
|
||||
static xcb_visualtype_t *
|
||||
get_xcb_visualtype_for_depth(struct loader_dri3_drawable *draw, int depth)
|
||||
{
|
||||
@@ -1575,38 +1596,44 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int fourcc,
|
||||
}
|
||||
|
||||
pixmap = xcb_generate_id(draw->conn);
|
||||
|
||||
xcb_void_cookie_t cookie_pix, cookie_fence;
|
||||
#ifdef HAVE_X11_DRM
|
||||
if (draw->multiplanes_available &&
|
||||
buffer->modifier != DRM_FORMAT_MOD_INVALID) {
|
||||
xcb_dri3_pixmap_from_buffers(draw->conn,
|
||||
pixmap,
|
||||
draw->window,
|
||||
num_planes,
|
||||
width, height,
|
||||
buffer->strides[0], buffer->offsets[0],
|
||||
buffer->strides[1], buffer->offsets[1],
|
||||
buffer->strides[2], buffer->offsets[2],
|
||||
buffer->strides[3], buffer->offsets[3],
|
||||
depth, buffer->cpp * 8,
|
||||
buffer->modifier,
|
||||
buffer_fds);
|
||||
cookie_pix = xcb_dri3_pixmap_from_buffers_checked(draw->conn,
|
||||
pixmap,
|
||||
draw->window,
|
||||
num_planes,
|
||||
width, height,
|
||||
buffer->strides[0], buffer->offsets[0],
|
||||
buffer->strides[1], buffer->offsets[1],
|
||||
buffer->strides[2], buffer->offsets[2],
|
||||
buffer->strides[3], buffer->offsets[3],
|
||||
depth, buffer->cpp * 8,
|
||||
buffer->modifier,
|
||||
buffer_fds);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
xcb_dri3_pixmap_from_buffer(draw->conn,
|
||||
pixmap,
|
||||
draw->drawable,
|
||||
buffer->size,
|
||||
width, height, buffer->strides[0],
|
||||
depth, buffer->cpp * 8,
|
||||
buffer_fds[0]);
|
||||
cookie_pix = xcb_dri3_pixmap_from_buffer_checked(draw->conn,
|
||||
pixmap,
|
||||
draw->drawable,
|
||||
buffer->size,
|
||||
width, height, buffer->strides[0],
|
||||
depth, buffer->cpp * 8,
|
||||
buffer_fds[0]);
|
||||
}
|
||||
|
||||
xcb_dri3_fence_from_fd(draw->conn,
|
||||
pixmap,
|
||||
(sync_fence = xcb_generate_id(draw->conn)),
|
||||
false,
|
||||
fence_fd);
|
||||
cookie_fence = xcb_dri3_fence_from_fd_checked(draw->conn,
|
||||
pixmap,
|
||||
(sync_fence = xcb_generate_id(draw->conn)),
|
||||
false,
|
||||
fence_fd);
|
||||
/* Group error checking to limit round-trips. */
|
||||
if (!check_xcb_error(cookie_pix, "xcb_dri3_pixmap_from_buffer[s]"))
|
||||
goto no_buffer_attrib;
|
||||
if (!check_xcb_error(cookie_fence, "xcb_dri3_fence_from_fd"))
|
||||
goto no_buffer_attrib;
|
||||
|
||||
buffer->pixmap = pixmap;
|
||||
buffer->own_pixmap = true;
|
||||
@@ -1904,6 +1931,7 @@ dri3_get_pixmap_buffer(struct dri_drawable *driDrawable, unsigned int fourcc,
|
||||
int buf_id = loader_dri3_pixmap_buf_id(buffer_type);
|
||||
struct loader_dri3_buffer *buffer = draw->buffers[buf_id];
|
||||
xcb_drawable_t pixmap;
|
||||
xcb_void_cookie_t cookie;
|
||||
xcb_sync_fence_t sync_fence;
|
||||
struct xshmfence *shm_fence;
|
||||
int width;
|
||||
@@ -1938,11 +1966,14 @@ dri3_get_pixmap_buffer(struct dri_drawable *driDrawable, unsigned int fourcc,
|
||||
cur_screen = draw->dri_screen_render_gpu;
|
||||
}
|
||||
|
||||
xcb_dri3_fence_from_fd(draw->conn,
|
||||
pixmap,
|
||||
(sync_fence = xcb_generate_id(draw->conn)),
|
||||
false,
|
||||
fence_fd);
|
||||
cookie = xcb_dri3_fence_from_fd_checked(draw->conn,
|
||||
pixmap,
|
||||
(sync_fence = xcb_generate_id(draw->conn)),
|
||||
false,
|
||||
fence_fd);
|
||||
if (!check_xcb_error(cookie, "xcb_dri3_fence_from_fd"))
|
||||
goto no_image;
|
||||
|
||||
buffer->image = loader_dri3_get_pixmap_buffer(draw->conn, pixmap, cur_screen, fourcc,
|
||||
draw->multiplanes_available, &width, &height, buffer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user