1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= xorg-driver-video-intel
9 SDESC[standard]= X.org legacy driver for Intel graphic chipsets
10 HOMEPAGE= https://www.x.org/
14 SITES[main]= https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/archive/
15 DISTFILE[1]= 31486f40f8e8f8923ca0799aea84b58799754564.tar.bz2:main
17 SPKGS[standard]= single
19 OPTIONS_AVAILABLE= SNA UXA XVMC
20 OPTIONS_STANDARD= SNA UXA XVMC
22 OPTDESCR[ACCEL]= Default AccelMethod (if not specified in xorg.conf)
23 OPTGROUP[ACCEL]= SNA UXA
28 BUILDRUN_DEPENDS= xorg-server:single:standard
29 libdrm:single:standard
31 USES= mesa libtool cpe autoreconf
32 XORG_COMPONENTS= xorgproto pciaccess pixman
34 DISTNAME= xf86-video-intel-31486f40f8e8f8923ca0799aea84b58799754564
37 LICENSE_FILE= MIT:{{WRKSRC}}/COPYING
40 CPE_PRODUCT= xf86-video-intel
42 FPC_EQUIVALENT= x11-drivers/xf86-video-intel
45 CONFIGURE_ARGS= --disable-udev
50 --with-builderstring="2.99.917.916"
51 CONFIGURE_ENV= ac_cv_header_sys_sysinfo_h=no
53 INSTALL_TARGET= install-strip
55 CFLAGS= -Wunused-but-set-variable
57 [XVMC].DESCRIPTION= X11 XvMC video extension support
58 [XVMC].BUILDRUN_DEPENDS_ON= xorg-xcb-util:single:standard
59 [XVMC].CONFIGURE_ENABLE_BOTH= xvmc
60 [XVMC].XORG_COMPONENTS_ON= x11
64 [SNA].DESCRIPTION= SandyBridge's New Acceleration
65 [SNA].CONFIGURE_ARGS_ON= --with-default-accel=sna
67 [UXA].DESCRIPTION= Unified Acceleration Architecture
68 [UXA].CONFIGURE_ARGS_ON= --with-default-accel=uxa
71 # Broken by political correctness
73 -e 's|slave_dst|secondary_dst|g' \
74 -e 's|master_pixmap|primary_pixmap|g' \
75 ${WRKSRC}/src/sna/sna_accel.c \
76 ${WRKSRC}/src/uxa/intel_driver.c
78 pre-configure-dragonfly:
79 # Prefer to use dfly specific sigjmp_buf for less errors
80 ${REINPLACE_CMD} -e 's|jmp_buf |sigjmp_buf |g' \
81 ${WRKSRC}/src/sna/sna.h \
82 ${WRKSRC}/src/sna/sna_accel.c
84 [FILE:531:descriptions/desc.single]
85 The xf86-video-intel module is an open-source 2D graphics driver for
86 the X Window System as implemented by X.org. It supports a variety of
87 Intel graphics chipsets including:
89 i810/i810e/i810-dc100,i815,
90 i830M,845G,852GM,855GM,865G,
91 915G/GM,945G/GM/GME,946GZ
93 G/Q33,G/Q35,G41,G/Q43,G/GM/Q45
94 PineView-M (Atom N400 series)
95 PineView-D (Atom D400/D500 series)
97 Intel(R) Iris(TM) Graphics,
98 Intel(R) Iris(TM) Pro Graphics.
102 e47eb678c681d80df138e897ee27c79f9b42e3517d55b1f0684e9a70361c8218 1250745 31486f40f8e8f8923ca0799aea84b58799754564.tar.bz2
105 [FILE:324:manifests/plist.single]
106 %%ONLY-LINUX%%libexec/xf86-video-intel-backlight-helper
107 %%ONLY-LINUX%%share/polkit-1/actions/org.x.xf86-video-intel.backlight-helper.policy
114 libIntelXvMC.so.1.0.0
115 lib/xorg/modules/drivers/intel_drv.so
116 share/man/man4/intel.4.gz
119 [FILE:1201:patches/patch-benchmarks_dri3-swap.c]
120 dri3-swap.c:237:24: error: variable 'tmp' is uninitialized when used here [-Werror,-Wuninitialized]
121 list_for_each_entry(tmp, &mru, link) {
123 dri3-swap.c:117:45: note: expanded from macro 'list_for_each_entry'
124 for (pos = __container_of((head)->next, pos, member); \
126 dri3-swap.c:114:41: note: expanded from macro '__container_of'
127 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
129 dri3-swap.c:236:22: note: initialize the variable 'tmp' to silence this warning
130 struct buffer *tmp, *b = NULL;
134 --- benchmarks/dri3-swap.c.orig 2021-01-15 20:59:05 UTC
135 +++ benchmarks/dri3-swap.c
136 @@ -233,7 +233,7 @@ static void run(Display *dpy, Window win
137 clock_gettime(CLOCK_MONOTONIC, &start);
139 for (n = 0; n < 1000; n++) {
140 - struct buffer *tmp, *b = NULL;
141 + struct buffer *tmp = NULL, *b = NULL;
142 list_for_each_entry(tmp, &mru, link) {
147 [FILE:3970:patches/patch-hyphen]
148 Add hyphen to RANDR output names for consistency with modesetting(4x)
150 --- src/sna/sna_display.c.orig 2021-01-15 20:59:05 UTC
151 +++ src/sna/sna_display.c
152 @@ -467,7 +467,7 @@ static inline uint32_t fb_id(struct kgem
154 unsigned sna_crtc_count_sprites(xf86CrtcPtr crtc)
156 - struct plane *sprite;
157 + struct plane *sprite = NULL;
161 @@ -479,7 +479,7 @@ unsigned sna_crtc_count_sprites(xf86Crtc
163 static struct plane *lookup_sprite(struct sna_crtc *crtc, unsigned idx)
165 - struct plane *sprite;
166 + struct plane *sprite = NULL;
168 list_for_each_entry(sprite, &crtc->sprites, link)
170 @@ -1727,7 +1727,7 @@ static bool wait_for_shadow(struct sna *
172 if ((flags & MOVE_WRITE) == 0) {
173 if ((flags & __MOVE_SCANOUT) == 0) {
174 - struct sna_crtc *crtc;
175 + struct sna_crtc *crtc = NULL;
177 list_for_each_entry(crtc, &sna->mode.shadow_crtc, shadow_link) {
178 if (overlap(&sna->mode.shadow_region.extents,
179 @@ -1768,7 +1768,7 @@ static bool wait_for_shadow(struct sna *
181 flip_active = sna->mode.flip_active;
183 - struct sna_crtc *crtc;
184 + struct sna_crtc *crtc = NULL;
185 list_for_each_entry(crtc, &sna->mode.shadow_crtc, shadow_link)
186 flip_active -= crtc->flip_pending;
187 DBG(("%s: %d flips still pending, shadow flip_active=%d\n",
188 @@ -3263,7 +3263,7 @@ static void
189 sna_crtc_destroy(xf86CrtcPtr crtc)
191 struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
192 - struct plane *sprite, *sn;
193 + struct plane *sprite = NULL, *sn;
195 if (sna_crtc == NULL)
197 @@ -3652,7 +3652,7 @@ bool sna_has_sprite_format(struct sna *s
199 for (i = 0; i < sna->mode.num_real_crtc; i++) {
200 struct sna_crtc *sna_crtc = to_sna_crtc(config->crtc[i]);
201 - struct plane *plane;
202 + struct plane *plane = NULL;
204 list_for_each_entry(plane, &sna_crtc->sprites, link) {
205 struct local_mode_get_plane p;
206 @@ -8639,7 +8639,7 @@ sna_mode_disable_secondary_planes(struct
207 for (c = 0; c < sna->mode.num_real_crtc; c++) {
208 xf86CrtcPtr crtc = config->crtc[c];
209 struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
210 - struct plane *plane;
211 + struct plane *plane = NULL;
213 list_for_each_entry(plane, &sna_crtc->sprites, link) {
214 struct local_mode_get_plane p;
215 @@ -8737,7 +8737,7 @@ static bool
216 sna_crtc_hide_planes(struct sna *sna, struct sna_crtc *crtc)
218 struct local_mode_set_plane s;
219 - struct plane *plane;
220 + struct plane *plane = NULL;
222 if (crtc->primary.id == 0)
224 @@ -8774,7 +8774,7 @@ void sna_mode_reset(struct sna *sna)
226 for (i = 0; i < sna->mode.num_real_crtc; i++) {
227 struct sna_crtc *sna_crtc = to_sna_crtc(config->crtc[i]);
228 - struct plane *plane;
229 + struct plane *plane = NULL;
231 assert(sna_crtc != NULL);
233 --- src/uxa/intel_display.c.orig 2021-01-15 20:59:05 UTC
234 +++ src/uxa/intel_display.c
235 @@ -1872,7 +1872,7 @@ intel_drm_abort_one(struct intel_drm_que
237 intel_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), void *match_data)
239 - struct intel_drm_queue *q;
240 + struct intel_drm_queue *q = NULL;
242 list_for_each_entry(q, &intel_drm_queue, list) {
243 if (match(q->data, match_data)) {
244 @@ -1888,7 +1888,7 @@ intel_drm_abort(ScrnInfoPtr scrn, Bool (
246 intel_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq)
248 - struct intel_drm_queue *q;
249 + struct intel_drm_queue *q = NULL;
251 list_for_each_entry(q, &intel_drm_queue, list) {
253 @@ -1905,7 +1905,7 @@ intel_drm_abort_seq(ScrnInfoPtr scrn, ui
255 intel_drm_abort_scrn(ScrnInfoPtr scrn)
257 - struct intel_drm_queue *q, *tmp;
258 + struct intel_drm_queue *q = NULL, *tmp;
260 list_for_each_entry_safe(q, tmp, &intel_drm_queue, list) {
262 @@ -1994,7 +1994,7 @@ static void
263 intel_drm_handler(int fd, uint32_t frame, uint32_t sec, uint32_t usec, void *user_ptr)
265 uint32_t user_data = (intptr_t)user_ptr;
266 - struct intel_drm_queue *q;
267 + struct intel_drm_queue *q = NULL;
269 list_for_each_entry(q, &intel_drm_queue, list) {
270 if (q->seq == user_data) {
273 [FILE:774:patches/patch-prefer-iris]
274 Chase https://gitlab.freedesktop.org/mesa/mesa/-/commit/adaa3583f507
276 --- src/sna/sna_dri2.c.orig 2021-01-15 20:59:05 UTC
277 +++ src/sna/sna_dri2.c
278 @@ -3707,8 +3707,10 @@ static const char *dri_driver_name(struc
279 return has_i830_dri() ? "i830" : "i915";
280 else if (sna->kgem.gen < 040)
283 + else if (sna->kgem.gen < 0100)
290 --- src/uxa/intel_dri.c.orig 2021-01-15 20:59:05 UTC
291 +++ src/uxa/intel_dri.c
292 @@ -1540,8 +1540,10 @@ static const char *dri_driver_name(intel
293 return has_i830_dri() ? "i830" : "i915";
294 else if (INTEL_INFO(intel)->gen < 040)
297 + else if (INTEL_INFO(intel)->gen < 0100)
306 [FILE:955:patches/patch-src_intel__device.c]
307 i915 requires KMS, so FreeBSD uses suffix to distinguish drm1 and drm2 drivers.
308 drm-kmod kept the same name at the cost of conflict with in-base drm2.
310 --- src/intel_device.c.orig 2021-01-15 20:59:05 UTC
311 +++ src/intel_device.c
312 @@ -204,6 +204,7 @@ static inline struct intel_device *intel
315 static const char *kernel_module_names[] ={
320 @@ -424,6 +425,10 @@ static int __intel_open_device__legacy(c
321 "pci:%04x:%02x:%02x.%d",
322 pci->domain, pci->bus, pci->dev, pci->func);
324 +#if defined(__DragonFly__)
325 + /* assume modesetting for i915, allow multiple loads and no fbcon */
326 + load_i915_kernel_module();
328 ret = drmCheckModesettingSupported(id);
330 if (load_i915_kernel_module() == 0)
331 @@ -433,6 +438,7 @@ static int __intel_open_device__legacy(c
332 /* Be nice to the user and load fbcon too */
333 (void)xf86LoadKernelModule("fbcon");
337 return fd_set_nonblock(drmOpen(NULL, id));
341 [FILE:8142:patches/patch-src_intel__list.h]
342 kgem.c:2864:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
343 list_for_each_entry(bo, &kgem->snoop, list) {
345 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
346 for (pos = __container_of((head)->next, pos, member); \
348 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
349 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
351 kgem.c:2849:20: note: initialize the variable 'bo' to silence this warning
352 struct kgem_bo *bo, *first = NULL;
355 kgem.c:3118:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
356 list_for_each_entry_safe(bo, next, &kgem->flushing, request) {
358 ../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
359 for (pos = __container_of((head)->next, pos, member), \
361 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
362 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
364 kgem.c:3115:20: note: initialize the variable 'bo' to silence this warning
365 struct kgem_bo *bo, *next;
368 kgem.c:3429:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
369 list_for_each_entry_safe(bo, next, &rq->buffers, request) {
371 ../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
372 for (pos = __container_of((head)->next, pos, member), \
374 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
375 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
377 kgem.c:3425:20: note: initialize the variable 'bo' to silence this warning
378 struct kgem_bo *bo, *next;
381 kgem.c:3541:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
382 list_for_each_entry_safe(bo, next, &kgem->batch_buffers, base.list) {
384 ../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
385 for (pos = __container_of((head)->next, pos, member), \
387 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
388 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
390 kgem.c:3539:24: note: initialize the variable 'bo' to silence this warning
391 struct kgem_buffer *bo, *next;
394 kgem.c:3930:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
395 list_for_each_entry(bo, list, list) {
397 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
398 for (pos = __container_of((head)->next, pos, member); \
400 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
401 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
403 kgem.c:3928:20: note: initialize the variable 'bo' to silence this warning
407 kgem.c:4670:23: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
408 list_for_each_entry(bo, cache, vma) {
410 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
411 for (pos = __container_of((head)->next, pos, member); \
413 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
414 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
416 kgem.c:4576:20: note: initialize the variable 'bo' to silence this warning
417 struct kgem_bo *bo, *first = NULL;
420 kgem.c:5411:31: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
421 list_for_each_entry_reverse(bo, &kgem->scanout, list) {
423 ../../src/intel_list.h:333:45: note: expanded from macro 'list_for_each_entry_reverse'
424 for (pos = __container_of((head)->prev, pos, member); \
426 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
427 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
429 kgem.c:5380:20: note: initialize the variable 'bo' to silence this warning
433 kgem.c:7225:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
434 list_for_each_entry(bo, buffers, request) {
436 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
437 for (pos = __container_of((head)->next, pos, member); \
439 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
440 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
442 kgem.c:7223:20: note: initialize the variable 'bo' to silence this warning
446 kgem.c:7517:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
447 list_for_each_entry(bo, &kgem->batch_buffers, base.list) {
449 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
450 for (pos = __container_of((head)->next, pos, member); \
452 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
453 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
455 kgem.c:7503:24: note: initialize the variable 'bo' to silence this warning
456 struct kgem_buffer *bo;
460 --- src/intel_list.h.orig 2021-01-15 20:59:05 UTC
462 @@ -325,12 +325,12 @@ list_is_empty(const struct list *head)
465 #define list_for_each_entry(pos, head, member) \
466 - for (pos = __container_of((head)->next, pos, member); \
467 + for (pos = NULL, pos = __container_of((head)->next, pos, member); \
468 &pos->member != (head); \
469 pos = __container_of(pos->member.next, pos, member))
471 -#define list_for_each_entry_reverse(pos, head, member) \
472 - for (pos = __container_of((head)->prev, pos, member); \
473 +#define list_for_each_entry_reverse(pos, head, member) \
474 + for (pos = NULL, pos = __container_of((head)->prev, pos, member); \
475 &pos->member != (head); \
476 pos = __container_of(pos->member.prev, pos, member))
478 @@ -342,7 +342,7 @@ list_is_empty(const struct list *head)
479 * See list_for_each_entry for more details.
481 #define list_for_each_entry_safe(pos, tmp, head, member) \
482 - for (pos = __container_of((head)->next, pos, member), \
483 + for (pos = NULL, pos = __container_of((head)->next, pos, member), \
484 tmp = __container_of(pos->member.next, pos, member); \
485 &pos->member != (head); \
486 pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
489 [FILE:1144:patches/patch-src_legacy_i810_i810__dri.c]
490 $NetBSD: patch-src_legacy_i810_i810__dri.c,v 1.1 2015/04/20 13:39:00 khorben Exp $
492 CID 1107540: Make the code safe avoiding random stack access. In
493 the first loop where there is a singleton point to pptSrc, only
494 access that singleton, no matter what.
496 November 2013 patch from NetBSD xsrc:
497 http://mail-index.netbsd.org/source-changes/2013/11/14/msg049188.html
499 --- src/legacy/i810/i810_dri.c.orig 2021-01-15 20:59:05 UTC
500 +++ src/legacy/i810/i810_dri.c
501 @@ -1104,10 +1104,17 @@ I810DRIMoveBuffers(WindowPtr pParent, DD
502 while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
504 pboxTmp = pboxNext + 1;
505 - pptTmp = pptSrc + (pboxTmp - pbox);
506 - while (pboxTmp <= pboxBase) {
507 - *pboxNew1++ = *pboxTmp++;
508 - *pptNew1++ = *pptTmp++;
509 + if (pptSrc == &ptOldOrg) {
510 + if (pboxTmp <= pboxBase) {
511 + *pboxNew1++ = *pboxTmp;
512 + *pptNew1++ = *pptSrc;
515 + pptTmp = pptSrc + (pboxTmp - pbox);
516 + while (pboxTmp <= pboxBase) {
517 + *pboxNew1++ = *pboxTmp++;
518 + *pptNew1++ = *pptTmp++;
525 [FILE:4511:patches/patch-src_sna_kgem.c]
526 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
527 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
529 --- src/sna/kgem.c.orig 2021-01-15 20:59:05 UTC
531 @@ -71,7 +71,11 @@ search_snoop_cache(struct kgem *kgem, un
532 #define DBG_NO_USERPTR 0
533 #define DBG_NO_UNSYNCHRONIZED_USERPTR 0
534 #define DBG_NO_COHERENT_MMAP_GTT 0
535 +#if defined __DragonFly__
536 +#define DBG_NO_LLC 1
540 #define DBG_NO_SEMAPHORES 0
541 #define DBG_NO_MADV 0
542 #define DBG_NO_UPLOAD_CACHE 0
543 @@ -1189,13 +1193,18 @@ static int gem_param(struct kgem *kgem,
544 static bool test_has_execbuffer2(struct kgem *kgem)
546 struct drm_i915_gem_execbuffer2 execbuf;
549 memset(&execbuf, 0, sizeof(execbuf));
550 execbuf.buffer_count = 1;
552 - return do_ioctl(kgem->fd,
553 - DRM_IOCTL_I915_GEM_EXECBUFFER2,
554 - &execbuf) == -EFAULT;
555 + ret = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf);
557 + /* XXX FreeBSD returns ENOENT instead of EFAULT. */
558 + if (ret == -ENOENT)
561 + return ret == -EFAULT;
564 static bool test_has_no_reloc(struct kgem *kgem)
565 @@ -2861,7 +2870,7 @@ static bool kgem_bo_move_to_cache(struct
566 static struct kgem_bo *
567 search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
569 - struct kgem_bo *bo, *first = NULL;
570 + struct kgem_bo *bo = NULL, *first = NULL;
572 DBG(("%s: num_pages=%d, flags=%x\n", __FUNCTION__, num_pages, flags));
574 @@ -3127,7 +3136,7 @@ void kgem_retire__buffers(struct kgem *k
576 static bool kgem_retire__flushing(struct kgem *kgem)
578 - struct kgem_bo *bo, *next;
579 + struct kgem_bo *bo = NULL, *next;
580 bool retired = false;
582 list_for_each_entry_safe(bo, next, &kgem->flushing, request) {
583 @@ -3425,7 +3434,7 @@ static void kgem_commit__check_reloc(str
585 static void kgem_commit__check_buffers(struct kgem *kgem)
587 - struct kgem_buffer *bo;
588 + struct kgem_buffer *bo = NULL;
590 list_for_each_entry(bo, &kgem->active_buffers, base.list)
591 assert(bo->base.exec == NULL);
592 @@ -3437,7 +3446,7 @@ static void kgem_commit__check_buffers(s
593 static void kgem_commit(struct kgem *kgem)
595 struct kgem_request *rq = kgem->next_request;
596 - struct kgem_bo *bo, *next;
597 + struct kgem_bo *bo = NULL, *next;
599 kgem_commit__check_reloc(kgem);
601 @@ -3551,7 +3560,7 @@ static void kgem_close_inactive(struct k
603 static void kgem_finish_buffers(struct kgem *kgem)
605 - struct kgem_buffer *bo, *next;
606 + struct kgem_buffer *bo = NULL, *next;
608 list_for_each_entry_safe(bo, next, &kgem->batch_buffers, base.list) {
609 DBG(("%s: buffer handle=%d, used=%d, exec?=%d, write=%d, mmapped=%s, refcnt=%d\n",
610 @@ -3940,7 +3949,7 @@ static int compact_batch_surface(struct
612 static struct kgem_bo *first_available(struct kgem *kgem, struct list *list)
614 - struct kgem_bo *bo;
615 + struct kgem_bo *bo = NULL;
617 list_for_each_entry(bo, list, list) {
618 assert(bo->refcnt > 0);
619 @@ -4224,7 +4233,7 @@ void _kgem_submit(struct kgem *kgem)
620 kgem->nreloc, kgem->nexec, kgem->nfence, kgem->aperture, kgem->aperture_fenced, kgem->aperture_high, kgem->aperture_total, -ret);
622 for (i = 0; i < kgem->nexec; i++) {
623 - struct kgem_bo *bo, *found = NULL;
624 + struct kgem_bo *bo = NULL, *found = NULL;
626 list_for_each_entry(bo, &kgem->next_request->buffers, request) {
627 if (bo->handle == kgem->exec[i].handle) {
628 @@ -4588,7 +4597,7 @@ bool kgem_cleanup_cache(struct kgem *kge
629 static struct kgem_bo *
630 search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
632 - struct kgem_bo *bo, *first = NULL;
633 + struct kgem_bo *bo = NULL, *first = NULL;
634 bool use_active = (flags & CREATE_INACTIVE) == 0;
637 @@ -5392,7 +5401,7 @@ struct kgem_bo *kgem_create_2d(struct kg
641 - struct kgem_bo *bo;
642 + struct kgem_bo *bo = NULL;
643 uint32_t pitch, tiled_height, size;
645 int i, bucket, retry;
646 @@ -7245,7 +7254,7 @@ void kgem_bo_sync__gtt(struct kgem *kgem
647 void kgem_clear_dirty(struct kgem *kgem)
649 struct list * const buffers = &kgem->next_request->buffers;
650 - struct kgem_bo *bo;
651 + struct kgem_bo *bo = NULL;
653 list_for_each_entry(bo, buffers, request) {
655 @@ -7525,7 +7534,7 @@ struct kgem_bo *kgem_create_buffer(struc
656 uint32_t size, uint32_t flags,
659 - struct kgem_buffer *bo;
660 + struct kgem_buffer *bo = NULL;
661 unsigned offset, alloc;
666 [FILE:856:patches/patch-src_sna_kgem__debug.c]
667 $NetBSD: patch-src_sna_kgem__debug.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
669 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
670 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
672 --- src/sna/kgem_debug.c.orig 2021-01-15 20:59:05 UTC
673 +++ src/sna/kgem_debug.c
674 @@ -56,7 +56,7 @@ struct kgem_bo *
675 kgem_debug_get_bo_for_reloc_entry(struct kgem *kgem,
676 struct drm_i915_gem_relocation_entry *reloc)
678 - struct kgem_bo *bo;
679 + struct kgem_bo *bo = NULL;
683 @@ -86,7 +86,7 @@ static int kgem_debug_handle_is_fenced(s
685 static int kgem_debug_handle_tiling(struct kgem *kgem, uint32_t handle)
687 - struct kgem_bo *bo;
688 + struct kgem_bo *bo = NULL;
690 list_for_each_entry(bo, &kgem->next_request->buffers, request)
691 if (bo->target_handle == handle)
694 [FILE:851:patches/patch-src_sna_sna__damage.c]
695 $NetBSD: patch-src_sna_sna__damage.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
697 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
698 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
700 --- src/sna/sna_damage.c.orig 2021-01-15 20:59:05 UTC
701 +++ src/sna/sna_damage.c
702 @@ -215,7 +215,7 @@ static void __sna_damage_reduce(struct s
704 BoxPtr boxes, free_boxes = NULL;
705 pixman_region16_t *region = &damage->region;
706 - struct sna_damage_box *iter;
707 + struct sna_damage_box *iter = NULL;
709 assert(damage->mode != DAMAGE_ALL);
710 assert(damage->dirty);
711 @@ -1808,7 +1808,7 @@ void _sna_damage_debug_get_region(struct
715 - struct sna_damage_box *iter;
716 + struct sna_damage_box *iter = NULL;
718 RegionCopy(r, &damage->region);
722 [FILE:614:patches/patch-src_sna_sna__dri3.c]
723 $NetBSD: patch-src_sna_sna__dri3.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
725 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
726 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
728 --- src/sna/sna_dri3.c.orig 2021-01-15 20:59:05 UTC
729 +++ src/sna/sna_dri3.c
730 @@ -175,7 +175,7 @@ static PixmapPtr sna_dri3_pixmap_from_fd
732 struct sna *sna = to_sna_from_screen(screen);
734 - struct sna_pixmap *priv;
735 + struct sna_pixmap *priv = NULL;
738 DBG(("%s(fd=%d, width=%d, height=%d, stride=%d, depth=%d, bpp=%d)\n",
741 [FILE:977:patches/patch-src_sna_sna__present.c]
742 $NetBSD: patch-src_sna_sna__present.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
744 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
745 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
747 --- src/sna/sna_present.c.orig 2021-01-15 20:59:05 UTC
748 +++ src/sna/sna_present.c
749 @@ -376,7 +376,7 @@ sna_present_get_crtc(WindowPtr window)
750 static void add_keepalive(struct sna *sna, xf86CrtcPtr crtc, uint64_t msc)
752 struct list *q = sna_crtc_vblank_queue(crtc);
753 - struct sna_present_event *info, *tmp;
754 + struct sna_present_event *info, *tmp = NULL;
755 union drm_wait_vblank vbl;
757 list_for_each_entry(tmp, q, link) {
758 @@ -480,7 +480,7 @@ static int
759 sna_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc)
761 struct sna *sna = to_sna_from_screen(crtc->pScreen);
762 - struct sna_present_event *info, *tmp;
763 + struct sna_present_event *info, *tmp = NULL;
764 const struct ust_msc *swap;
769 [FILE:561:patches/patch-src_sna_sna__video.c]
770 --- src/sna/sna_video.c.orig 2021-01-15 20:59:05 UTC
771 +++ src/sna/sna_video.c
773 #include "intel_options.h"
776 -#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
777 +#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
778 #include <sys/types.h>
779 #include <sys/endian.h>
783 #define bswap_32 bswap32
785 +#elif defined(__sun)
786 +#include <sys/byteorder.h>
787 +#define bswap_32 BSWAP_32
789 #include <byteswap.h>
793 [FILE:592:patches/patch-src_uxa_intel__batchbuffer.c]
794 $NetBSD: patch-src_uxa_intel__batchbuffer.c,v 1.1 2022/03/15 18:53:42 tnn Exp $
796 Similar to https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
798 --- src/uxa/intel_batchbuffer.c.orig 2021-01-15 20:59:05 UTC
799 +++ src/uxa/intel_batchbuffer.c
800 @@ -142,7 +142,7 @@ void intel_batch_teardown(ScrnInfoPtr sc
801 static void intel_batch_do_flush(ScrnInfoPtr scrn)
803 intel_screen_private *intel = intel_get_screen_private(scrn);
804 - struct intel_uxa_pixmap *priv;
805 + struct intel_uxa_pixmap *priv = NULL;
807 list_for_each_entry(priv, &intel->batch_pixmaps, batch)
811 [FILE:4751:patches/patch-test_present-speed.c]
812 present-speed.c:317:23: error: variable 'b' is uninitialized when used here [-Werror,-Wuninitialized]
813 list_for_each_entry(b, &mru, link)
815 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
816 for (pos = __container_of((head)->next, pos, member); \
818 present-speed.c:112:41: note: expanded from macro '__container_of'
819 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
821 present-speed.c:297:19: note: initialize the variable 'b' to silence this warning
825 present-speed.c:229:19: error: variable 'tmp' is used uninitialized whenever its declaration is reached
826 [-Werror,-Wsometimes-uninitialized]
827 struct buffer *tmp, *b = NULL;
829 present-speed.c:231:24: note: uninitialized use occurs here
830 list_for_each_entry(tmp, &mru, link) {
832 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
833 for (pos = __container_of((head)->next, pos, member); \
835 present-speed.c:112:41: note: expanded from macro '__container_of'
836 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
838 present-speed.c:229:22: note: initialize the variable 'tmp' to silence this warning
839 struct buffer *tmp, *b = NULL;
842 present-speed.c:557:24: error: variable 'b' is uninitialized when used here [-Werror,-Wuninitialized]
843 list_for_each_entry(b, &pp[i].mru, link)
845 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
846 for (pos = __container_of((head)->next, pos, member); \
848 present-speed.c:112:41: note: expanded from macro '__container_of'
849 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
851 present-speed.c:537:20: note: initialize the variable 'b' to silence this warning
855 present-speed.c:467:19: error: variable 'tmp' is used uninitialized whenever its declaration is reached
856 [-Werror,-Wsometimes-uninitialized]
857 struct buffer *tmp, *b = NULL;
859 present-speed.c:469:24: note: uninitialized use occurs here
860 list_for_each_entry(tmp, &pp[i].mru, link) {
862 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
863 for (pos = __container_of((head)->next, pos, member); \
865 present-speed.c:112:41: note: expanded from macro '__container_of'
866 (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
868 present-speed.c:467:22: note: initialize the variable 'tmp' to silence this warning
869 struct buffer *tmp, *b = NULL;
873 --- test/present-speed.c.orig 2021-01-15 20:59:05 UTC
874 +++ test/present-speed.c
875 @@ -226,7 +226,7 @@ static void run(Display *dpy, Window win
876 clock_gettime(CLOCK_MONOTONIC, &start);
878 for (n = 0; n < 1000; n++) {
879 - struct buffer *tmp, *b = NULL;
880 + struct buffer *tmp = NULL, *b = NULL;
882 list_for_each_entry(tmp, &mru, link) {
884 @@ -294,7 +294,7 @@ retry:
885 } while (end.tv_sec < start.tv_sec + 10);
887 if (options & DRI3) {
889 + struct buffer *b = NULL;
892 pixmap = xcb_generate_id(c);
893 @@ -464,7 +464,7 @@ static void perpixel(Display *dpy,
894 clock_gettime(CLOCK_MONOTONIC, &start);
896 for (i = 0; i < sz; i++) {
897 - struct buffer *tmp, *b = NULL;
898 + struct buffer *tmp = NULL, *b = NULL;
900 list_for_each_entry(tmp, &pp[i].mru, link) {
902 @@ -534,7 +534,7 @@ retry:
903 for (i = 0; i < sz; i++) {
904 if (options & DRI3) {
905 int depth = DefaultDepth(dpy, DefaultScreen(dpy));
907 + struct buffer *b = NULL;
910 pixmap = xcb_generate_id(c);
913 [FILE:284:dragonfly/patch-src_sna_sna__threads.c]
914 --- src/sna/sna_threads.c.orig 2018-12-03 09:01:25 UTC
915 +++ src/sna/sna_threads.c
920 +#define _WITH_GETLINE /* to expose getline() in stdio.h on FreeBSD */
921 +#include <stdio.h> /* for getline() */