1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= xorg-driver-video-intel
8 SDESC[standard]= X.org legacy driver for Intel graphic chipsets
9 HOMEPAGE= https://www.x.org/
13 SITES[main]= https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/archive/
14 DISTFILE[1]= b74b67f0f321875492968f7097b9d6e82a66d7df.tar.bz2:main
16 SPKGS[standard]= single
18 OPTIONS_AVAILABLE= SNA UXA XVMC
19 OPTIONS_STANDARD= SNA UXA XVMC
21 OPTDESCR[ACCEL]= Default AccelMethod (if not specified in xorg.conf)
22 OPTGROUP[ACCEL]= SNA UXA
27 BUILD_DEPENDS= libdrm:dev:standard
28 xorg-server:dev:standard
29 BUILDRUN_DEPENDS= libdrm:primary:standard
30 xorg-server:primary:standard
32 USES= mesa libtool cpe autoreconf
33 XORG_COMPONENTS= xorgproto x11 xfont2 xvmc xcb
35 DISTNAME= xf86-video-intel-b74b67f0f321875492968f7097b9d6e82a66d7df
38 LICENSE_FILE= MIT:{{WRKSRC}}/COPYING
41 CPE_PRODUCT= xf86-video-intel
43 FPC_EQUIVALENT= x11-drivers/xf86-video-intel
46 CONFIGURE_ARGS= --disable-udev
51 --with-builderstring="2.99.917.923"
52 CONFIGURE_ENV= ac_cv_header_sys_sysinfo_h=no
54 INSTALL_TARGET= install-strip
56 CFLAGS= -Wunused-but-set-variable
58 [XVMC].DESCRIPTION= X11 XvMC video extension support
59 [XVMC].CONFIGURE_ENABLE_BOTH= xvmc
60 [XVMC].XORG_COMPONENTS_ON= x11
65 [SNA].DESCRIPTION= SandyBridge's New Acceleration
66 [SNA].CONFIGURE_ARGS_ON= --with-default-accel=sna
68 [UXA].DESCRIPTION= Unified Acceleration Architecture
69 [UXA].CONFIGURE_ARGS_ON= --with-default-accel=uxa
72 # Broken by political correctness
74 -e 's|slave_dst|secondary_dst|g' \
75 -e 's|master_pixmap|primary_pixmap|g' \
76 ${WRKSRC}/src/sna/sna_accel.c \
77 ${WRKSRC}/src/uxa/intel_driver.c
79 pre-configure-dragonfly:
80 # Prefer to use dfly specific sigjmp_buf for less errors
81 ${REINPLACE_CMD} -e 's|jmp_buf |sigjmp_buf |g' \
82 ${WRKSRC}/src/sna/sna.h \
83 ${WRKSRC}/src/sna/sna_accel.c
85 [FILE:531:descriptions/desc.single]
86 The xf86-video-intel module is an open-source 2D graphics driver for
87 the X Window System as implemented by X.org. It supports a variety of
88 Intel graphics chipsets including:
90 i810/i810e/i810-dc100,i815,
91 i830M,845G,852GM,855GM,865G,
92 915G/GM,945G/GM/GME,946GZ
94 G/Q33,G/Q35,G41,G/Q43,G/GM/Q45
95 PineView-M (Atom N400 series)
96 PineView-D (Atom D400/D500 series)
98 Intel(R) Iris(TM) Graphics,
99 Intel(R) Iris(TM) Pro Graphics.
103 cc4855308af8eedd414c60f0638ef19e1b695e83f9dc1d62146cdab3d5915aba 1250201 b74b67f0f321875492968f7097b9d6e82a66d7df.tar.bz2
106 [FILE:324:manifests/plist.single]
107 %%ONLY-LINUX%%libexec/xf86-video-intel-backlight-helper
108 %%ONLY-LINUX%%share/polkit-1/actions/org.x.xf86-video-intel.backlight-helper.policy
115 libIntelXvMC.so.1.0.0
116 lib/xorg/modules/drivers/intel_drv.so
117 share/man/man4/intel.4.gz
120 [FILE:1201:patches/patch-benchmarks_dri3-swap.c]
121 dri3-swap.c:237:24: error: variable 'tmp' is uninitialized when used here [-Werror,-Wuninitialized]
122 list_for_each_entry(tmp, &mru, link) {
124 dri3-swap.c:117:45: note: expanded from macro 'list_for_each_entry'
125 for (pos = __container_of((head)->next, pos, member); \
127 dri3-swap.c:114:41: note: expanded from macro '__container_of'
128 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
130 dri3-swap.c:236:22: note: initialize the variable 'tmp' to silence this warning
131 struct buffer *tmp, *b = NULL;
135 --- benchmarks/dri3-swap.c.orig 2021-01-15 20:59:05 UTC
136 +++ benchmarks/dri3-swap.c
137 @@ -233,7 +233,7 @@ static void run(Display *dpy, Window win
138 clock_gettime(CLOCK_MONOTONIC, &start);
140 for (n = 0; n < 1000; n++) {
141 - struct buffer *tmp, *b = NULL;
142 + struct buffer *tmp = NULL, *b = NULL;
143 list_for_each_entry(tmp, &mru, link) {
148 [FILE:3970:patches/patch-hyphen]
149 Add hyphen to RANDR output names for consistency with modesetting(4x)
151 --- src/sna/sna_display.c.orig 2021-01-15 20:59:05 UTC
152 +++ src/sna/sna_display.c
153 @@ -467,7 +467,7 @@ static inline uint32_t fb_id(struct kgem
155 unsigned sna_crtc_count_sprites(xf86CrtcPtr crtc)
157 - struct plane *sprite;
158 + struct plane *sprite = NULL;
162 @@ -479,7 +479,7 @@ unsigned sna_crtc_count_sprites(xf86Crtc
164 static struct plane *lookup_sprite(struct sna_crtc *crtc, unsigned idx)
166 - struct plane *sprite;
167 + struct plane *sprite = NULL;
169 list_for_each_entry(sprite, &crtc->sprites, link)
171 @@ -1727,7 +1727,7 @@ static bool wait_for_shadow(struct sna *
173 if ((flags & MOVE_WRITE) == 0) {
174 if ((flags & __MOVE_SCANOUT) == 0) {
175 - struct sna_crtc *crtc;
176 + struct sna_crtc *crtc = NULL;
178 list_for_each_entry(crtc, &sna->mode.shadow_crtc, shadow_link) {
179 if (overlap(&sna->mode.shadow_region.extents,
180 @@ -1768,7 +1768,7 @@ static bool wait_for_shadow(struct sna *
182 flip_active = sna->mode.flip_active;
184 - struct sna_crtc *crtc;
185 + struct sna_crtc *crtc = NULL;
186 list_for_each_entry(crtc, &sna->mode.shadow_crtc, shadow_link)
187 flip_active -= crtc->flip_pending;
188 DBG(("%s: %d flips still pending, shadow flip_active=%d\n",
189 @@ -3263,7 +3263,7 @@ static void
190 sna_crtc_destroy(xf86CrtcPtr crtc)
192 struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
193 - struct plane *sprite, *sn;
194 + struct plane *sprite = NULL, *sn;
196 if (sna_crtc == NULL)
198 @@ -3652,7 +3652,7 @@ bool sna_has_sprite_format(struct sna *s
200 for (i = 0; i < sna->mode.num_real_crtc; i++) {
201 struct sna_crtc *sna_crtc = to_sna_crtc(config->crtc[i]);
202 - struct plane *plane;
203 + struct plane *plane = NULL;
205 list_for_each_entry(plane, &sna_crtc->sprites, link) {
206 struct local_mode_get_plane p;
207 @@ -8639,7 +8639,7 @@ sna_mode_disable_secondary_planes(struct
208 for (c = 0; c < sna->mode.num_real_crtc; c++) {
209 xf86CrtcPtr crtc = config->crtc[c];
210 struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
211 - struct plane *plane;
212 + struct plane *plane = NULL;
214 list_for_each_entry(plane, &sna_crtc->sprites, link) {
215 struct local_mode_get_plane p;
216 @@ -8737,7 +8737,7 @@ static bool
217 sna_crtc_hide_planes(struct sna *sna, struct sna_crtc *crtc)
219 struct local_mode_set_plane s;
220 - struct plane *plane;
221 + struct plane *plane = NULL;
223 if (crtc->primary.id == 0)
225 @@ -8774,7 +8774,7 @@ void sna_mode_reset(struct sna *sna)
227 for (i = 0; i < sna->mode.num_real_crtc; i++) {
228 struct sna_crtc *sna_crtc = to_sna_crtc(config->crtc[i]);
229 - struct plane *plane;
230 + struct plane *plane = NULL;
232 assert(sna_crtc != NULL);
234 --- src/uxa/intel_display.c.orig 2021-01-15 20:59:05 UTC
235 +++ src/uxa/intel_display.c
236 @@ -1872,7 +1872,7 @@ intel_drm_abort_one(struct intel_drm_que
238 intel_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), void *match_data)
240 - struct intel_drm_queue *q;
241 + struct intel_drm_queue *q = NULL;
243 list_for_each_entry(q, &intel_drm_queue, list) {
244 if (match(q->data, match_data)) {
245 @@ -1888,7 +1888,7 @@ intel_drm_abort(ScrnInfoPtr scrn, Bool (
247 intel_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq)
249 - struct intel_drm_queue *q;
250 + struct intel_drm_queue *q = NULL;
252 list_for_each_entry(q, &intel_drm_queue, list) {
254 @@ -1905,7 +1905,7 @@ intel_drm_abort_seq(ScrnInfoPtr scrn, ui
256 intel_drm_abort_scrn(ScrnInfoPtr scrn)
258 - struct intel_drm_queue *q, *tmp;
259 + struct intel_drm_queue *q = NULL, *tmp;
261 list_for_each_entry_safe(q, tmp, &intel_drm_queue, list) {
263 @@ -1994,7 +1994,7 @@ static void
264 intel_drm_handler(int fd, uint32_t frame, uint32_t sec, uint32_t usec, void *user_ptr)
266 uint32_t user_data = (intptr_t)user_ptr;
267 - struct intel_drm_queue *q;
268 + struct intel_drm_queue *q = NULL;
270 list_for_each_entry(q, &intel_drm_queue, list) {
271 if (q->seq == user_data) {
274 [FILE:894:patches/patch-prefer-iris]
275 Chase https://gitlab.freedesktop.org/mesa/mesa/-/commit/adaa3583f507
276 Chase https://gitlab.freedesktop.org/mesa/mesa/-/commit/cdde031ac2c8
278 --- src/sna/sna_dri2.c.orig 2021-01-15 20:59:05 UTC
279 +++ src/sna/sna_dri2.c
280 @@ -3707,8 +3707,10 @@ static const char *dri_driver_name(struct sna *sna)
281 return has_i830_dri() ? "i830" : "i915";
282 else if (sna->kgem.gen < 040)
284 + else if (sna->kgem.gen < 0100)
292 --- src/uxa/intel_dri.c.orig 2021-01-15 20:59:05 UTC
293 +++ src/uxa/intel_dri.c
294 @@ -1540,8 +1540,10 @@ static const char *dri_driver_name(intel_screen_privat
295 return has_i830_dri() ? "i830" : "i915";
296 else if (INTEL_INFO(intel)->gen < 040)
298 + else if (INTEL_INFO(intel)->gen < 0100)
308 [FILE:955:patches/patch-src_intel__device.c]
309 i915 requires KMS, so FreeBSD uses suffix to distinguish drm1 and drm2 drivers.
310 drm-kmod kept the same name at the cost of conflict with in-base drm2.
312 --- src/intel_device.c.orig 2021-01-15 20:59:05 UTC
313 +++ src/intel_device.c
314 @@ -204,6 +204,7 @@ static inline struct intel_device *intel
317 static const char *kernel_module_names[] ={
322 @@ -424,6 +425,10 @@ static int __intel_open_device__legacy(c
323 "pci:%04x:%02x:%02x.%d",
324 pci->domain, pci->bus, pci->dev, pci->func);
326 +#if defined(__DragonFly__)
327 + /* assume modesetting for i915, allow multiple loads and no fbcon */
328 + load_i915_kernel_module();
330 ret = drmCheckModesettingSupported(id);
332 if (load_i915_kernel_module() == 0)
333 @@ -433,6 +438,7 @@ static int __intel_open_device__legacy(c
334 /* Be nice to the user and load fbcon too */
335 (void)xf86LoadKernelModule("fbcon");
339 return fd_set_nonblock(drmOpen(NULL, id));
343 [FILE:8142:patches/patch-src_intel__list.h]
344 kgem.c:2864:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
345 list_for_each_entry(bo, &kgem->snoop, list) {
347 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
348 for (pos = __container_of((head)->next, pos, member); \
350 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
351 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
353 kgem.c:2849:20: note: initialize the variable 'bo' to silence this warning
354 struct kgem_bo *bo, *first = NULL;
357 kgem.c:3118:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
358 list_for_each_entry_safe(bo, next, &kgem->flushing, request) {
360 ../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
361 for (pos = __container_of((head)->next, pos, member), \
363 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
364 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
366 kgem.c:3115:20: note: initialize the variable 'bo' to silence this warning
367 struct kgem_bo *bo, *next;
370 kgem.c:3429:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
371 list_for_each_entry_safe(bo, next, &rq->buffers, request) {
373 ../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
374 for (pos = __container_of((head)->next, pos, member), \
376 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
377 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
379 kgem.c:3425:20: note: initialize the variable 'bo' to silence this warning
380 struct kgem_bo *bo, *next;
383 kgem.c:3541:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
384 list_for_each_entry_safe(bo, next, &kgem->batch_buffers, base.list) {
386 ../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
387 for (pos = __container_of((head)->next, pos, member), \
389 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
390 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
392 kgem.c:3539:24: note: initialize the variable 'bo' to silence this warning
393 struct kgem_buffer *bo, *next;
396 kgem.c:3930:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
397 list_for_each_entry(bo, list, list) {
399 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
400 for (pos = __container_of((head)->next, pos, member); \
402 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
403 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
405 kgem.c:3928:20: note: initialize the variable 'bo' to silence this warning
409 kgem.c:4670:23: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
410 list_for_each_entry(bo, cache, vma) {
412 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
413 for (pos = __container_of((head)->next, pos, member); \
415 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
416 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
418 kgem.c:4576:20: note: initialize the variable 'bo' to silence this warning
419 struct kgem_bo *bo, *first = NULL;
422 kgem.c:5411:31: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
423 list_for_each_entry_reverse(bo, &kgem->scanout, list) {
425 ../../src/intel_list.h:333:45: note: expanded from macro 'list_for_each_entry_reverse'
426 for (pos = __container_of((head)->prev, pos, member); \
428 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
429 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
431 kgem.c:5380:20: note: initialize the variable 'bo' to silence this warning
435 kgem.c:7225:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
436 list_for_each_entry(bo, buffers, request) {
438 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
439 for (pos = __container_of((head)->next, pos, member); \
441 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
442 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
444 kgem.c:7223:20: note: initialize the variable 'bo' to silence this warning
448 kgem.c:7517:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
449 list_for_each_entry(bo, &kgem->batch_buffers, base.list) {
451 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
452 for (pos = __container_of((head)->next, pos, member); \
454 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
455 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
457 kgem.c:7503:24: note: initialize the variable 'bo' to silence this warning
458 struct kgem_buffer *bo;
462 --- src/intel_list.h.orig 2021-01-15 20:59:05 UTC
464 @@ -325,12 +325,12 @@ list_is_empty(const struct list *head)
467 #define list_for_each_entry(pos, head, member) \
468 - for (pos = __container_of((head)->next, pos, member); \
469 + for (pos = NULL, pos = __container_of((head)->next, pos, member); \
470 &pos->member != (head); \
471 pos = __container_of(pos->member.next, pos, member))
473 -#define list_for_each_entry_reverse(pos, head, member) \
474 - for (pos = __container_of((head)->prev, pos, member); \
475 +#define list_for_each_entry_reverse(pos, head, member) \
476 + for (pos = NULL, pos = __container_of((head)->prev, pos, member); \
477 &pos->member != (head); \
478 pos = __container_of(pos->member.prev, pos, member))
480 @@ -342,7 +342,7 @@ list_is_empty(const struct list *head)
481 * See list_for_each_entry for more details.
483 #define list_for_each_entry_safe(pos, tmp, head, member) \
484 - for (pos = __container_of((head)->next, pos, member), \
485 + for (pos = NULL, pos = __container_of((head)->next, pos, member), \
486 tmp = __container_of(pos->member.next, pos, member); \
487 &pos->member != (head); \
488 pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
491 [FILE:1144:patches/patch-src_legacy_i810_i810__dri.c]
492 $NetBSD: patch-src_legacy_i810_i810__dri.c,v 1.1 2015/04/20 13:39:00 khorben Exp $
494 CID 1107540: Make the code safe avoiding random stack access. In
495 the first loop where there is a singleton point to pptSrc, only
496 access that singleton, no matter what.
498 November 2013 patch from NetBSD xsrc:
499 http://mail-index.netbsd.org/source-changes/2013/11/14/msg049188.html
501 --- src/legacy/i810/i810_dri.c.orig 2021-01-15 20:59:05 UTC
502 +++ src/legacy/i810/i810_dri.c
503 @@ -1104,10 +1104,17 @@ I810DRIMoveBuffers(WindowPtr pParent, DD
504 while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
506 pboxTmp = pboxNext + 1;
507 - pptTmp = pptSrc + (pboxTmp - pbox);
508 - while (pboxTmp <= pboxBase) {
509 - *pboxNew1++ = *pboxTmp++;
510 - *pptNew1++ = *pptTmp++;
511 + if (pptSrc == &ptOldOrg) {
512 + if (pboxTmp <= pboxBase) {
513 + *pboxNew1++ = *pboxTmp;
514 + *pptNew1++ = *pptSrc;
517 + pptTmp = pptSrc + (pboxTmp - pbox);
518 + while (pboxTmp <= pboxBase) {
519 + *pboxNew1++ = *pboxTmp++;
520 + *pptNew1++ = *pptTmp++;
527 [FILE:4511:patches/patch-src_sna_kgem.c]
528 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
529 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
531 --- src/sna/kgem.c.orig 2021-01-15 20:59:05 UTC
533 @@ -71,7 +71,11 @@ search_snoop_cache(struct kgem *kgem, un
534 #define DBG_NO_USERPTR 0
535 #define DBG_NO_UNSYNCHRONIZED_USERPTR 0
536 #define DBG_NO_COHERENT_MMAP_GTT 0
537 +#if defined __DragonFly__
538 +#define DBG_NO_LLC 1
542 #define DBG_NO_SEMAPHORES 0
543 #define DBG_NO_MADV 0
544 #define DBG_NO_UPLOAD_CACHE 0
545 @@ -1189,13 +1193,18 @@ static int gem_param(struct kgem *kgem,
546 static bool test_has_execbuffer2(struct kgem *kgem)
548 struct drm_i915_gem_execbuffer2 execbuf;
551 memset(&execbuf, 0, sizeof(execbuf));
552 execbuf.buffer_count = 1;
554 - return do_ioctl(kgem->fd,
555 - DRM_IOCTL_I915_GEM_EXECBUFFER2,
556 - &execbuf) == -EFAULT;
557 + ret = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf);
559 + /* XXX FreeBSD returns ENOENT instead of EFAULT. */
560 + if (ret == -ENOENT)
563 + return ret == -EFAULT;
566 static bool test_has_no_reloc(struct kgem *kgem)
567 @@ -2861,7 +2870,7 @@ static bool kgem_bo_move_to_cache(struct
568 static struct kgem_bo *
569 search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
571 - struct kgem_bo *bo, *first = NULL;
572 + struct kgem_bo *bo = NULL, *first = NULL;
574 DBG(("%s: num_pages=%d, flags=%x\n", __FUNCTION__, num_pages, flags));
576 @@ -3127,7 +3136,7 @@ void kgem_retire__buffers(struct kgem *k
578 static bool kgem_retire__flushing(struct kgem *kgem)
580 - struct kgem_bo *bo, *next;
581 + struct kgem_bo *bo = NULL, *next;
582 bool retired = false;
584 list_for_each_entry_safe(bo, next, &kgem->flushing, request) {
585 @@ -3425,7 +3434,7 @@ static void kgem_commit__check_reloc(str
587 static void kgem_commit__check_buffers(struct kgem *kgem)
589 - struct kgem_buffer *bo;
590 + struct kgem_buffer *bo = NULL;
592 list_for_each_entry(bo, &kgem->active_buffers, base.list)
593 assert(bo->base.exec == NULL);
594 @@ -3437,7 +3446,7 @@ static void kgem_commit__check_buffers(s
595 static void kgem_commit(struct kgem *kgem)
597 struct kgem_request *rq = kgem->next_request;
598 - struct kgem_bo *bo, *next;
599 + struct kgem_bo *bo = NULL, *next;
601 kgem_commit__check_reloc(kgem);
603 @@ -3551,7 +3560,7 @@ static void kgem_close_inactive(struct k
605 static void kgem_finish_buffers(struct kgem *kgem)
607 - struct kgem_buffer *bo, *next;
608 + struct kgem_buffer *bo = NULL, *next;
610 list_for_each_entry_safe(bo, next, &kgem->batch_buffers, base.list) {
611 DBG(("%s: buffer handle=%d, used=%d, exec?=%d, write=%d, mmapped=%s, refcnt=%d\n",
612 @@ -3940,7 +3949,7 @@ static int compact_batch_surface(struct
614 static struct kgem_bo *first_available(struct kgem *kgem, struct list *list)
616 - struct kgem_bo *bo;
617 + struct kgem_bo *bo = NULL;
619 list_for_each_entry(bo, list, list) {
620 assert(bo->refcnt > 0);
621 @@ -4224,7 +4233,7 @@ void _kgem_submit(struct kgem *kgem)
622 kgem->nreloc, kgem->nexec, kgem->nfence, kgem->aperture, kgem->aperture_fenced, kgem->aperture_high, kgem->aperture_total, -ret);
624 for (i = 0; i < kgem->nexec; i++) {
625 - struct kgem_bo *bo, *found = NULL;
626 + struct kgem_bo *bo = NULL, *found = NULL;
628 list_for_each_entry(bo, &kgem->next_request->buffers, request) {
629 if (bo->handle == kgem->exec[i].handle) {
630 @@ -4588,7 +4597,7 @@ bool kgem_cleanup_cache(struct kgem *kge
631 static struct kgem_bo *
632 search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
634 - struct kgem_bo *bo, *first = NULL;
635 + struct kgem_bo *bo = NULL, *first = NULL;
636 bool use_active = (flags & CREATE_INACTIVE) == 0;
639 @@ -5392,7 +5401,7 @@ struct kgem_bo *kgem_create_2d(struct kg
643 - struct kgem_bo *bo;
644 + struct kgem_bo *bo = NULL;
645 uint32_t pitch, tiled_height, size;
647 int i, bucket, retry;
648 @@ -7245,7 +7254,7 @@ void kgem_bo_sync__gtt(struct kgem *kgem
649 void kgem_clear_dirty(struct kgem *kgem)
651 struct list * const buffers = &kgem->next_request->buffers;
652 - struct kgem_bo *bo;
653 + struct kgem_bo *bo = NULL;
655 list_for_each_entry(bo, buffers, request) {
657 @@ -7525,7 +7534,7 @@ struct kgem_bo *kgem_create_buffer(struc
658 uint32_t size, uint32_t flags,
661 - struct kgem_buffer *bo;
662 + struct kgem_buffer *bo = NULL;
663 unsigned offset, alloc;
668 [FILE:856:patches/patch-src_sna_kgem__debug.c]
669 $NetBSD: patch-src_sna_kgem__debug.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
671 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
672 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
674 --- src/sna/kgem_debug.c.orig 2021-01-15 20:59:05 UTC
675 +++ src/sna/kgem_debug.c
676 @@ -56,7 +56,7 @@ struct kgem_bo *
677 kgem_debug_get_bo_for_reloc_entry(struct kgem *kgem,
678 struct drm_i915_gem_relocation_entry *reloc)
680 - struct kgem_bo *bo;
681 + struct kgem_bo *bo = NULL;
685 @@ -86,7 +86,7 @@ static int kgem_debug_handle_is_fenced(s
687 static int kgem_debug_handle_tiling(struct kgem *kgem, uint32_t handle)
689 - struct kgem_bo *bo;
690 + struct kgem_bo *bo = NULL;
692 list_for_each_entry(bo, &kgem->next_request->buffers, request)
693 if (bo->target_handle == handle)
696 [FILE:851:patches/patch-src_sna_sna__damage.c]
697 $NetBSD: patch-src_sna_sna__damage.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
699 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
700 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
702 --- src/sna/sna_damage.c.orig 2021-01-15 20:59:05 UTC
703 +++ src/sna/sna_damage.c
704 @@ -215,7 +215,7 @@ static void __sna_damage_reduce(struct s
706 BoxPtr boxes, free_boxes = NULL;
707 pixman_region16_t *region = &damage->region;
708 - struct sna_damage_box *iter;
709 + struct sna_damage_box *iter = NULL;
711 assert(damage->mode != DAMAGE_ALL);
712 assert(damage->dirty);
713 @@ -1808,7 +1808,7 @@ void _sna_damage_debug_get_region(struct
717 - struct sna_damage_box *iter;
718 + struct sna_damage_box *iter = NULL;
720 RegionCopy(r, &damage->region);
724 [FILE:614:patches/patch-src_sna_sna__dri3.c]
725 $NetBSD: patch-src_sna_sna__dri3.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
727 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
728 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
730 --- src/sna/sna_dri3.c.orig 2021-01-15 20:59:05 UTC
731 +++ src/sna/sna_dri3.c
732 @@ -175,7 +175,7 @@ static PixmapPtr sna_dri3_pixmap_from_fd
734 struct sna *sna = to_sna_from_screen(screen);
736 - struct sna_pixmap *priv;
737 + struct sna_pixmap *priv = NULL;
740 DBG(("%s(fd=%d, width=%d, height=%d, stride=%d, depth=%d, bpp=%d)\n",
743 [FILE:977:patches/patch-src_sna_sna__present.c]
744 $NetBSD: patch-src_sna_sna__present.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
746 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
747 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
749 --- src/sna/sna_present.c.orig 2021-01-15 20:59:05 UTC
750 +++ src/sna/sna_present.c
751 @@ -376,7 +376,7 @@ sna_present_get_crtc(WindowPtr window)
752 static void add_keepalive(struct sna *sna, xf86CrtcPtr crtc, uint64_t msc)
754 struct list *q = sna_crtc_vblank_queue(crtc);
755 - struct sna_present_event *info, *tmp;
756 + struct sna_present_event *info, *tmp = NULL;
757 union drm_wait_vblank vbl;
759 list_for_each_entry(tmp, q, link) {
760 @@ -480,7 +480,7 @@ static int
761 sna_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc)
763 struct sna *sna = to_sna_from_screen(crtc->pScreen);
764 - struct sna_present_event *info, *tmp;
765 + struct sna_present_event *info, *tmp = NULL;
766 const struct ust_msc *swap;
771 [FILE:561:patches/patch-src_sna_sna__video.c]
772 --- src/sna/sna_video.c.orig 2021-01-15 20:59:05 UTC
773 +++ src/sna/sna_video.c
775 #include "intel_options.h"
778 -#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
779 +#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
780 #include <sys/types.h>
781 #include <sys/endian.h>
785 #define bswap_32 bswap32
787 +#elif defined(__sun)
788 +#include <sys/byteorder.h>
789 +#define bswap_32 BSWAP_32
791 #include <byteswap.h>
795 [FILE:592:patches/patch-src_uxa_intel__batchbuffer.c]
796 $NetBSD: patch-src_uxa_intel__batchbuffer.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
798 Similar to https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
800 --- src/uxa/intel_batchbuffer.c.orig 2021-01-15 20:59:05 UTC
801 +++ src/uxa/intel_batchbuffer.c
802 @@ -142,7 +142,7 @@ void intel_batch_teardown(ScrnInfoPtr sc
803 static void intel_batch_do_flush(ScrnInfoPtr scrn)
805 intel_screen_private *intel = intel_get_screen_private(scrn);
806 - struct intel_uxa_pixmap *priv;
807 + struct intel_uxa_pixmap *priv = NULL;
809 list_for_each_entry(priv, &intel->batch_pixmaps, batch)
813 [FILE:4751:patches/patch-test_present-speed.c]
814 present-speed.c:317:23: error: variable 'b' is uninitialized when used here [-Werror,-Wuninitialized]
815 list_for_each_entry(b, &mru, link)
817 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
818 for (pos = __container_of((head)->next, pos, member); \
820 present-speed.c:112:41: note: expanded from macro '__container_of'
821 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
823 present-speed.c:297:19: note: initialize the variable 'b' to silence this warning
827 present-speed.c:229:19: error: variable 'tmp' is used uninitialized whenever its declaration is reached
828 [-Werror,-Wsometimes-uninitialized]
829 struct buffer *tmp, *b = NULL;
831 present-speed.c:231:24: note: uninitialized use occurs here
832 list_for_each_entry(tmp, &mru, link) {
834 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
835 for (pos = __container_of((head)->next, pos, member); \
837 present-speed.c:112:41: note: expanded from macro '__container_of'
838 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
840 present-speed.c:229:22: note: initialize the variable 'tmp' to silence this warning
841 struct buffer *tmp, *b = NULL;
844 present-speed.c:557:24: error: variable 'b' is uninitialized when used here [-Werror,-Wuninitialized]
845 list_for_each_entry(b, &pp[i].mru, link)
847 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
848 for (pos = __container_of((head)->next, pos, member); \
850 present-speed.c:112:41: note: expanded from macro '__container_of'
851 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
853 present-speed.c:537:20: note: initialize the variable 'b' to silence this warning
857 present-speed.c:467:19: error: variable 'tmp' is used uninitialized whenever its declaration is reached
858 [-Werror,-Wsometimes-uninitialized]
859 struct buffer *tmp, *b = NULL;
861 present-speed.c:469:24: note: uninitialized use occurs here
862 list_for_each_entry(tmp, &pp[i].mru, link) {
864 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
865 for (pos = __container_of((head)->next, pos, member); \
867 present-speed.c:112:41: note: expanded from macro '__container_of'
868 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
870 present-speed.c:467:22: note: initialize the variable 'tmp' to silence this warning
871 struct buffer *tmp, *b = NULL;
875 --- test/present-speed.c.orig 2021-01-15 20:59:05 UTC
876 +++ test/present-speed.c
877 @@ -226,7 +226,7 @@ static void run(Display *dpy, Window win
878 clock_gettime(CLOCK_MONOTONIC, &start);
880 for (n = 0; n < 1000; n++) {
881 - struct buffer *tmp, *b = NULL;
882 + struct buffer *tmp = NULL, *b = NULL;
884 list_for_each_entry(tmp, &mru, link) {
886 @@ -294,7 +294,7 @@ retry:
887 } while (end.tv_sec < start.tv_sec + 10);
889 if (options & DRI3) {
891 + struct buffer *b = NULL;
894 pixmap = xcb_generate_id(c);
895 @@ -464,7 +464,7 @@ static void perpixel(Display *dpy,
896 clock_gettime(CLOCK_MONOTONIC, &start);
898 for (i = 0; i < sz; i++) {
899 - struct buffer *tmp, *b = NULL;
900 + struct buffer *tmp = NULL, *b = NULL;
902 list_for_each_entry(tmp, &pp[i].mru, link) {
904 @@ -534,7 +534,7 @@ retry:
905 for (i = 0; i < sz; i++) {
906 if (options & DRI3) {
907 int depth = DefaultDepth(dpy, DefaultScreen(dpy));
909 + struct buffer *b = NULL;
912 pixmap = xcb_generate_id(c);
915 [FILE:284:dragonfly/patch-src_sna_sna__threads.c]
916 --- src/sna/sna_threads.c.orig 2018-12-03 09:01:25 UTC
917 +++ src/sna/sna_threads.c
922 +#define _WITH_GETLINE /* to expose getline() in stdio.h on FreeBSD */
923 +#include <stdio.h> /* for getline() */