pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/xf86-video-intel xf86-video-intel: fix a segfault ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aa62f5251d7b
branches:  trunk
changeset: 375545:aa62f5251d7b
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Tue Mar 15 18:53:42 2022 +0000

description:
xf86-video-intel: fix a segfault w/ clang & update to git 20210115

pkgsrc changes:
- Apply patches for upstream issue 171:
  "xf86-video-intel: segfault when built with clang"
- Fix similar issues in some other places.

Upstream changes:
- sna: Always validate userptr upon creation
- sna/gen7: Avoid clear-residuals overhead on all gen7
- sna: Enable TearFree by default on recent HW
- sna: Defer fbGetWindowPixmap() for sna_composite
- Track ABI changes for ABI_VIDEODRV_VERSION 25.2
- sna/gen7: Prefer blitter for plain copies on Haswell

diffstat:

 x11/xf86-video-intel/Makefile                                   |    7 +-
 x11/xf86-video-intel/distinfo                                   |   16 +-
 x11/xf86-video-intel/patches/patch-src_sna_kgem.c               |  106 ++++++++++
 x11/xf86-video-intel/patches/patch-src_sna_kgem__debug.c        |   25 ++
 x11/xf86-video-intel/patches/patch-src_sna_sna__damage.c        |   25 ++
 x11/xf86-video-intel/patches/patch-src_sna_sna__display.c       |   88 ++++++++
 x11/xf86-video-intel/patches/patch-src_sna_sna__dri3.c          |   16 +
 x11/xf86-video-intel/patches/patch-src_sna_sna__present.c       |   25 ++
 x11/xf86-video-intel/patches/patch-src_uxa_intel__batchbuffer.c |   15 +
 x11/xf86-video-intel/patches/patch-src_uxa_intel__display.c     |   42 +++
 10 files changed, 357 insertions(+), 8 deletions(-)

diffs (truncated from 413 to 300 lines):

diff -r 6b96a3512457 -r aa62f5251d7b x11/xf86-video-intel/Makefile
--- a/x11/xf86-video-intel/Makefile     Tue Mar 15 18:27:03 2022 +0000
+++ b/x11/xf86-video-intel/Makefile     Tue Mar 15 18:53:42 2022 +0000
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.50 2022/01/09 13:46:40 tnn Exp $
+# $NetBSD: Makefile,v 1.51 2022/03/15 18:53:42 tnn Exp $
 
-PKGNAME=       xf86-video-intel-2.99.917.20200515
-COMMIT_ID=     5ca3ac1a90af177eb111a965e9b4dd8a27cc58fc
-PKGREVISION=   1
+PKGNAME=       xf86-video-intel-2.99.917.20210115
+COMMIT_ID=     31486f40f8e8f8923ca0799aea84b58799754564
 DISTNAME=      xf86-video-intel-${COMMIT_ID}
 CATEGORIES=    x11
 #MASTER_SITES= ${MASTER_SITE_XORG:=driver/}
diff -r 6b96a3512457 -r aa62f5251d7b x11/xf86-video-intel/distinfo
--- a/x11/xf86-video-intel/distinfo     Tue Mar 15 18:27:03 2022 +0000
+++ b/x11/xf86-video-intel/distinfo     Tue Mar 15 18:53:42 2022 +0000
@@ -1,8 +1,16 @@
-$NetBSD: distinfo,v 1.34 2021/10/26 11:34:42 nia Exp $
+$NetBSD: distinfo,v 1.35 2022/03/15 18:53:42 tnn Exp $
 
-BLAKE2s (xf86-video-intel-5ca3ac1a90af177eb111a965e9b4dd8a27cc58fc.tar.bz2) = 87539a7dc3e3fe5ea0ba2e8d21982f77a07d1d0d7c9d9fe20be37bf5c2d6484f
-SHA512 (xf86-video-intel-5ca3ac1a90af177eb111a965e9b4dd8a27cc58fc.tar.bz2) = 
29fea01332438ad7616bae56a926f5c6fa08f93f67c23a0bb38f775719f12b15fba5bcb096c0665948f80d3ff6b7c108f360e44aae008192ef6c9b21187b4bbb
-Size (xf86-video-intel-5ca3ac1a90af177eb111a965e9b4dd8a27cc58fc.tar.bz2) = 1250303 bytes
+BLAKE2s (xf86-video-intel-31486f40f8e8f8923ca0799aea84b58799754564.tar.bz2) = 65c61d6ed7c341e3d792d137562ad739cb622e002b2fcb3ae9494af63ad06724
+SHA512 (xf86-video-intel-31486f40f8e8f8923ca0799aea84b58799754564.tar.bz2) = 
41f51778309cf619a04a978c796bac6fa3b9cc150ea00f5684f9e046ef4f656ec64cb296f2dedfca2bd215d247988d0f842b3b519d6edcd74331ebc49339f316
+Size (xf86-video-intel-31486f40f8e8f8923ca0799aea84b58799754564.tar.bz2) = 1250745 bytes
 SHA1 (patch-src_intel__device.c) = e9a4420e11244b9ec552adb603c8e75cd28a8f57
 SHA1 (patch-src_legacy_i810_i810__dri.c) = fb963b994d51c9db48457106048226214a2d986c
+SHA1 (patch-src_sna_kgem.c) = 669367b8e80d9a0c17548ccc1d742982075995df
+SHA1 (patch-src_sna_kgem__debug.c) = f82b9426ff8ce77ce632d59c829f657582bc9edf
+SHA1 (patch-src_sna_sna__damage.c) = dec2e635f24423b9da678b54d843cb6689fa380c
+SHA1 (patch-src_sna_sna__display.c) = 3274fdd5b7c9046226c5d76a8fea0366e225759c
+SHA1 (patch-src_sna_sna__dri3.c) = 2136a92314f25501bb1d710fcf8dcbbd49c7ac0a
+SHA1 (patch-src_sna_sna__present.c) = 5154bf06b807e7997b9e3f10c87a5dbfc5a2d3e2
 SHA1 (patch-src_sna_sna__video.c) = 2771938849a475fc8c346dce0251000932add3de
+SHA1 (patch-src_uxa_intel__batchbuffer.c) = f345d69b7ba8618012f3d990375d2d7077a0f338
+SHA1 (patch-src_uxa_intel__display.c) = 499966e9f8a255a2f20729d5723101ab7cb52f12
diff -r 6b96a3512457 -r aa62f5251d7b x11/xf86-video-intel/patches/patch-src_sna_kgem.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xf86-video-intel/patches/patch-src_sna_kgem.c Tue Mar 15 18:53:42 2022 +0000
@@ -0,0 +1,106 @@
+$NetBSD: patch-src_sna_kgem.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
+
+https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
+https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
+
+--- src/sna/kgem.c.orig        2021-01-15 20:59:05.000000000 +0000
++++ src/sna/kgem.c
+@@ -2861,7 +2861,7 @@ static bool kgem_bo_move_to_cache(struct
+ static struct kgem_bo *
+ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
+ {
+-      struct kgem_bo *bo, *first = NULL;
++      struct kgem_bo *bo = NULL, *first = NULL;
+ 
+       DBG(("%s: num_pages=%d, flags=%x\n", __FUNCTION__, num_pages, flags));
+ 
+@@ -3127,7 +3127,7 @@ void kgem_retire__buffers(struct kgem *k
+ 
+ static bool kgem_retire__flushing(struct kgem *kgem)
+ {
+-      struct kgem_bo *bo, *next;
++      struct kgem_bo *bo = NULL, *next;
+       bool retired = false;
+ 
+       list_for_each_entry_safe(bo, next, &kgem->flushing, request) {
+@@ -3425,7 +3425,7 @@ static void kgem_commit__check_reloc(str
+ #ifndef NDEBUG
+ static void kgem_commit__check_buffers(struct kgem *kgem)
+ {
+-      struct kgem_buffer *bo;
++      struct kgem_buffer *bo = NULL;
+ 
+       list_for_each_entry(bo, &kgem->active_buffers, base.list)
+               assert(bo->base.exec == NULL);
+@@ -3437,7 +3437,7 @@ static void kgem_commit__check_buffers(s
+ static void kgem_commit(struct kgem *kgem)
+ {
+       struct kgem_request *rq = kgem->next_request;
+-      struct kgem_bo *bo, *next;
++      struct kgem_bo *bo = NULL, *next;
+ 
+       kgem_commit__check_reloc(kgem);
+ 
+@@ -3551,7 +3551,7 @@ static void kgem_close_inactive(struct k
+ 
+ static void kgem_finish_buffers(struct kgem *kgem)
+ {
+-      struct kgem_buffer *bo, *next;
++      struct kgem_buffer *bo = NULL, *next;
+ 
+       list_for_each_entry_safe(bo, next, &kgem->batch_buffers, base.list) {
+               DBG(("%s: buffer handle=%d, used=%d, exec?=%d, write=%d, mmapped=%s, refcnt=%d\n",
+@@ -3940,7 +3940,7 @@ static int compact_batch_surface(struct 
+ 
+ static struct kgem_bo *first_available(struct kgem *kgem, struct list *list)
+ {
+-      struct kgem_bo *bo;
++      struct kgem_bo *bo = NULL;
+ 
+       list_for_each_entry(bo, list, list) {
+               assert(bo->refcnt > 0);
+@@ -4224,7 +4224,7 @@ void _kgem_submit(struct kgem *kgem)
+                      kgem->nreloc, kgem->nexec, kgem->nfence, kgem->aperture, kgem->aperture_fenced, kgem->aperture_high, kgem->aperture_total, -ret);
+ 
+               for (i = 0; i < kgem->nexec; i++) {
+-                      struct kgem_bo *bo, *found = NULL;
++                      struct kgem_bo *bo = NULL, *found = NULL;
+ 
+                       list_for_each_entry(bo, &kgem->next_request->buffers, request) {
+                               if (bo->handle == kgem->exec[i].handle) {
+@@ -4588,7 +4588,7 @@ bool kgem_cleanup_cache(struct kgem *kge
+ static struct kgem_bo *
+ search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
+ {
+-      struct kgem_bo *bo, *first = NULL;
++      struct kgem_bo *bo = NULL, *first = NULL;
+       bool use_active = (flags & CREATE_INACTIVE) == 0;
+       struct list *cache;
+ 
+@@ -5392,7 +5392,7 @@ struct kgem_bo *kgem_create_2d(struct kg
+                              uint32_t flags)
+ {
+       struct list *cache;
+-      struct kgem_bo *bo;
++      struct kgem_bo *bo = NULL;
+       uint32_t pitch, tiled_height, size;
+       uint32_t handle;
+       int i, bucket, retry;
+@@ -7245,7 +7245,7 @@ void kgem_bo_sync__gtt(struct kgem *kgem
+ void kgem_clear_dirty(struct kgem *kgem)
+ {
+       struct list * const buffers = &kgem->next_request->buffers;
+-      struct kgem_bo *bo;
++      struct kgem_bo *bo = NULL;
+ 
+       list_for_each_entry(bo, buffers, request) {
+               if (!bo->gpu_dirty)
+@@ -7525,7 +7525,7 @@ struct kgem_bo *kgem_create_buffer(struc
+                                  uint32_t size, uint32_t flags,
+                                  void **ret)
+ {
+-      struct kgem_buffer *bo;
++      struct kgem_buffer *bo = NULL;
+       unsigned offset, alloc;
+       struct kgem_bo *old;
+ 
diff -r 6b96a3512457 -r aa62f5251d7b x11/xf86-video-intel/patches/patch-src_sna_kgem__debug.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xf86-video-intel/patches/patch-src_sna_kgem__debug.c  Tue Mar 15 18:53:42 2022 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_sna_kgem__debug.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
+
+https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
+https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
+
+--- src/sna/kgem_debug.c.orig  2021-01-15 20:59:05.000000000 +0000
++++ src/sna/kgem_debug.c
+@@ -56,7 +56,7 @@ struct kgem_bo *
+ kgem_debug_get_bo_for_reloc_entry(struct kgem *kgem,
+                                 struct drm_i915_gem_relocation_entry *reloc)
+ {
+-      struct kgem_bo *bo;
++      struct kgem_bo *bo = NULL;
+ 
+       if (reloc == NULL)
+               return NULL;
+@@ -86,7 +86,7 @@ static int kgem_debug_handle_is_fenced(s
+ 
+ static int kgem_debug_handle_tiling(struct kgem *kgem, uint32_t handle)
+ {
+-      struct kgem_bo *bo;
++      struct kgem_bo *bo = NULL;
+ 
+       list_for_each_entry(bo, &kgem->next_request->buffers, request)
+               if (bo->target_handle == handle)
diff -r 6b96a3512457 -r aa62f5251d7b x11/xf86-video-intel/patches/patch-src_sna_sna__damage.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xf86-video-intel/patches/patch-src_sna_sna__damage.c  Tue Mar 15 18:53:42 2022 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_sna_sna__damage.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
+
+https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
+https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
+
+--- src/sna/sna_damage.c.orig  2021-01-15 20:59:05.000000000 +0000
++++ src/sna/sna_damage.c
+@@ -215,7 +215,7 @@ static void __sna_damage_reduce(struct s
+       int n, nboxes;
+       BoxPtr boxes, free_boxes = NULL;
+       pixman_region16_t *region = &damage->region;
+-      struct sna_damage_box *iter;
++      struct sna_damage_box *iter = NULL;
+ 
+       assert(damage->mode != DAMAGE_ALL);
+       assert(damage->dirty);
+@@ -1808,7 +1808,7 @@ void _sna_damage_debug_get_region(struct
+ {
+       int n, nboxes;
+       BoxPtr boxes;
+-      struct sna_damage_box *iter;
++      struct sna_damage_box *iter = NULL;
+ 
+       RegionCopy(r, &damage->region);
+       if (!damage->dirty)
diff -r 6b96a3512457 -r aa62f5251d7b x11/xf86-video-intel/patches/patch-src_sna_sna__display.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xf86-video-intel/patches/patch-src_sna_sna__display.c Tue Mar 15 18:53:42 2022 +0000
@@ -0,0 +1,88 @@
+$NetBSD: patch-src_sna_sna__display.c,v 1.3 2022/03/15 18:53:42 tnn Exp $
+
+https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
+https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
+
+--- src/sna/sna_display.c.orig 2021-01-15 20:59:05.000000000 +0000
++++ src/sna/sna_display.c
+@@ -467,7 +467,7 @@ static inline uint32_t fb_id(struct kgem
+ 
+ unsigned sna_crtc_count_sprites(xf86CrtcPtr crtc)
+ {
+-      struct plane *sprite;
++      struct plane *sprite = NULL;
+       unsigned count;
+ 
+       count = 0;
+@@ -479,7 +479,7 @@ unsigned sna_crtc_count_sprites(xf86Crtc
+ 
+ static struct plane *lookup_sprite(struct sna_crtc *crtc, unsigned idx)
+ {
+-      struct plane *sprite;
++      struct plane *sprite = NULL;
+ 
+       list_for_each_entry(sprite, &crtc->sprites, link)
+               if (idx-- == 0)
+@@ -1727,7 +1727,7 @@ static bool wait_for_shadow(struct sna *
+ 
+       if ((flags & MOVE_WRITE) == 0) {
+               if ((flags & __MOVE_SCANOUT) == 0) {
+-                      struct sna_crtc *crtc;
++                      struct sna_crtc *crtc = NULL;
+ 
+                       list_for_each_entry(crtc, &sna->mode.shadow_crtc, shadow_link) {
+                               if (overlap(&sna->mode.shadow_region.extents,
+@@ -1768,7 +1768,7 @@ static bool wait_for_shadow(struct sna *
+ 
+       flip_active = sna->mode.flip_active;
+       if (flip_active) {
+-              struct sna_crtc *crtc;
++              struct sna_crtc *crtc = NULL;
+               list_for_each_entry(crtc, &sna->mode.shadow_crtc, shadow_link)
+                       flip_active -= crtc->flip_pending;
+               DBG(("%s: %d flips still pending, shadow flip_active=%d\n",
+@@ -3263,7 +3263,7 @@ static void
+ sna_crtc_destroy(xf86CrtcPtr crtc)
+ {
+       struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+-      struct plane *sprite, *sn;
++      struct plane *sprite = NULL, *sn;
+ 
+       if (sna_crtc == NULL)
+               return;
+@@ -3652,7 +3652,7 @@ bool sna_has_sprite_format(struct sna *s
+ 
+       for (i = 0; i < sna->mode.num_real_crtc; i++) {
+               struct sna_crtc *sna_crtc = to_sna_crtc(config->crtc[i]);
+-              struct plane *plane;
++              struct plane *plane = NULL;
+ 
+               list_for_each_entry(plane, &sna_crtc->sprites, link) {
+                       struct local_mode_get_plane p;
+@@ -8639,7 +8639,7 @@ sna_mode_disable_secondary_planes(struct
+       for (c = 0; c < sna->mode.num_real_crtc; c++) {
+               xf86CrtcPtr crtc = config->crtc[c];
+               struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+-              struct plane *plane;
++              struct plane *plane = NULL;
+ 
+               list_for_each_entry(plane, &sna_crtc->sprites, link) {
+                       struct local_mode_get_plane p;
+@@ -8737,7 +8737,7 @@ static bool
+ sna_crtc_hide_planes(struct sna *sna, struct sna_crtc *crtc)
+ {
+       struct local_mode_set_plane s;
+-      struct plane *plane;
++      struct plane *plane = NULL;
+ 
+       if (crtc->primary.id == 0)
+               return false;
+@@ -8774,7 +8774,7 @@ void sna_mode_reset(struct sna *sna)
+ 
+       for (i = 0; i < sna->mode.num_real_crtc; i++) {
+               struct sna_crtc *sna_crtc = to_sna_crtc(config->crtc[i]);
+-              struct plane *plane;
++              struct plane *plane = NULL;
+ 
+               assert(sna_crtc != NULL);
+ 
diff -r 6b96a3512457 -r aa62f5251d7b x11/xf86-video-intel/patches/patch-src_sna_sna__dri3.c



Home | Main Index | Thread Index | Old Index