Skip to content

Commit

Permalink
graphics/mesa-devel: crash workaround for Intel GPUs after r553723
Browse files Browse the repository at this point in the history
While upstream issue is in userland driver FreeBSD kernel driver may
fail to handle it gracefully e.g.,

  $ sway
  $ mpv --hwdec=vaapi /path/to/file

  pid 12449 (sway), jid 0, uid 1234: exited on signal 11
  WARNING !drm_modeset_is_locked(&crtc->mutex) failed at drm-kmod-drm_v5.4.62_3/drivers/gpu/drm/drm_atomic_helper.c:621
  #0 0xffffffff81f3e833 at linux_dump_stack+0x23
  #1 0xffffffff81ea43e3 at drm_atomic_helper_check_modeset+0xb3
  #2 0xffffffff8259492c at intel_atomic_check+0x8c
  #3 0xffffffff81ea3379 at drm_atomic_check_only+0x3f9
  #4 0xffffffff81ea37c3 at drm_atomic_commit+0x13
  #5 0xffffffff81eb0c3f at drm_client_modeset_commit_atomic+0x1af
  #6 0xffffffff81eb093a at drm_client_modeset_commit_force+0x6a
  #7 0xffffffff81efa12a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
  #8 0xffffffff81ef2386 at vt_kms_postswitch+0x166
  #9 0xffffffff8076b66b at vt_window_switch+0x12b
  #10 0xffffffff807688ff at vtterm_cngrab+0x1f
  #11 0xffffffff80805a36 at cngrab+0x16
  #12 0xffffffff8086295c at vpanic+0xec
  #13 0xffffffff80862863 at panic+0x43
  #14 0xffffffff81f5d142 at dma_buf_poll+0x12
  #15 0xffffffff808d2959 at kern_poll+0x329
  #16 0xffffffff808d2620 at sys_poll+0x50
  #17 0xffffffff80b3353b at amd64_syscall+0xfb
  • Loading branch information
jbeich committed Oct 31, 2020
1 parent 7d114d0 commit 79c1f03
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions graphics/mesa-devel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
PORTNAME= mesa
DISTVERSION= 20.2-branchpoint-3613
DISTVERSIONSUFFIX= -g0a4c1db926c
PORTREVISION= 1
CATEGORIES= graphics
PKGNAMESUFFIX= -devel

Expand Down
45 changes: 45 additions & 0 deletions graphics/mesa-devel/files/patch-revert
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Revert https://gitlab.freedesktop.org/mesa/mesa/-/commit/13859c769f0e
due to https://gitlab.freedesktop.org/mesa/mesa/-/issues/3713

--- src/gallium/frontends/dri/dri2.c.orig 2020-10-31 00:18:11 UTC
+++ src/gallium/frontends/dri/dri2.c
@@ -1379,28 +1379,18 @@ static __DRIimage *
dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
{
__DRIimage *img;
- struct pipe_resource *tex = image->texture;
- int i;

if (plane < 0) {
return NULL;
} else if (plane > 0) {
uint64_t planes;
- if (dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_NPLANES, 0,
- &planes) &&
+ if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_NPLANES, 0,
+ &planes) ||
plane >= planes) {
return NULL;
}
}

- if (tex->next) {
- for (i = 0; i < plane; i++) {
- tex = tex->next;
- if (!tex)
- return NULL;
- }
- }
-
if (image->dri_components == 0) {
uint64_t modifier;
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_MODIFIER, 0,
@@ -1413,8 +1403,6 @@ dri2_from_planar(__DRIimage *image, int plane, void *l
img = dri2_dup_image(image, loaderPrivate);
if (img == NULL)
return NULL;
-
- pipe_resource_reference(&img->texture, tex);

if (img->texture->screen->resource_changed)
img->texture->screen->resource_changed(img->texture->screen,

0 comments on commit 79c1f03

Please sign in to comment.