Ravenports generated: 13 Aug 2023 17:55
[ravenports.git] / bucket_7F / xorg-driver-video-intel
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               xorg-driver-video-intel
4 VERSION=                2.99.917.923
5 EPOCH=                  1
6 KEYWORDS=               x11_drivers
7 VARIANTS=               standard
8 SDESC[standard]=        X.org legacy driver for Intel graphic chipsets
9 HOMEPAGE=               https://www.x.org/
10 CONTACT=                nobody
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/archive/
14 DISTFILE[1]=            b74b67f0f321875492968f7097b9d6e82a66d7df.tar.bz2:main
15 DF_INDEX=               1
16 SPKGS[standard]=        single
17
18 OPTIONS_AVAILABLE=      SNA UXA XVMC
19 OPTIONS_STANDARD=       SNA UXA XVMC
20 OPTGROUP_RADIO=         ACCEL
21 OPTDESCR[ACCEL]=        Default AccelMethod (if not specified in xorg.conf)
22 OPTGROUP[ACCEL]=        SNA UXA
23 OPT_ON[all]=            UXA XVMC
24
25 NOT_FOR_ARCH=           aarch64
26
27 BUILD_DEPENDS=          libdrm:dev:standard
28                         xorg-server:dev:standard
29 BUILDRUN_DEPENDS=       libdrm:primary:standard
30                         xorg-server:primary:standard
31
32 USES=                   mesa libtool cpe autoreconf
33 XORG_COMPONENTS=        xorgproto x11 xfont2 xvmc xcb
34
35 DISTNAME=               xf86-video-intel-b74b67f0f321875492968f7097b9d6e82a66d7df
36
37 LICENSE=                MIT:single
38 LICENSE_FILE=           MIT:{{WRKSRC}}/COPYING
39 LICENSE_SCHEME=         solo
40
41 CPE_PRODUCT=            xf86-video-intel
42 CPE_VENDOR=             x
43 FPC_EQUIVALENT=         x11-drivers/xf86-video-intel
44
45 MUST_CONFIGURE=         gnu
46 CONFIGURE_ARGS=         --disable-udev
47                         --disable-tools
48                         --enable-dri
49                         --enable-dri2
50                         --enable-dri3
51                         --with-builderstring="2.99.917.923"
52 CONFIGURE_ENV=          ac_cv_header_sys_sysinfo_h=no
53
54 INSTALL_TARGET=         install-strip
55
56 CFLAGS=                 -Wunused-but-set-variable
57
58 [XVMC].DESCRIPTION=                     X11 XvMC video extension support
59 [XVMC].CONFIGURE_ENABLE_BOTH=           xvmc
60 [XVMC].XORG_COMPONENTS_ON=              x11
61                                         xcb
62                                         xvmc
63                                         xcb-util
64
65 [SNA].DESCRIPTION=                      SandyBridge's New Acceleration
66 [SNA].CONFIGURE_ARGS_ON=                --with-default-accel=sna
67
68 [UXA].DESCRIPTION=                      Unified Acceleration Architecture
69 [UXA].CONFIGURE_ARGS_ON=                --with-default-accel=uxa
70
71 pre-configure:
72         # Broken by political correctness
73         ${SED} -i.PC \
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
78
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
84
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:
89
90         i810/i810e/i810-dc100,i815,
91         i830M,845G,852GM,855GM,865G,
92         915G/GM,945G/GM/GME,946GZ
93         G/GM/GME/Q965,
94         G/Q33,G/Q35,G41,G/Q43,G/GM/Q45
95         PineView-M (Atom N400 series)
96         PineView-D (Atom D400/D500 series)
97         Intel(R) HD Graphics,
98         Intel(R) Iris(TM) Graphics,
99         Intel(R) Iris(TM) Pro Graphics.
100
101
102 [FILE:127:distinfo]
103 cc4855308af8eedd414c60f0638ef19e1b695e83f9dc1d62146cdab3d5915aba      1250201 b74b67f0f321875492968f7097b9d6e82a66d7df.tar.bz2
104
105
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
109 lib/
110  libI810XvMC.so
111  libI810XvMC.so.1
112  libI810XvMC.so.1.0.0
113  libIntelXvMC.so
114  libIntelXvMC.so.1
115  libIntelXvMC.so.1.0.0
116 lib/xorg/modules/drivers/intel_drv.so
117 share/man/man4/intel.4.gz
118
119
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) {
123                                             ^~~
124 dri3-swap.c:117:45: note: expanded from macro 'list_for_each_entry'
125     for (pos = __container_of((head)->next, pos, member);               \
126                                             ^~~
127 dri3-swap.c:114:41: note: expanded from macro '__container_of'
128     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
129                                         ^~~~~~
130 dri3-swap.c:236:22: note: initialize the variable 'tmp' to silence this warning
131                         struct buffer *tmp, *b = NULL;
132                                           ^
133                                            = NULL
134
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);
139         do {
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) {
144                                 if (!tmp->busy) {
145                                         b = tmp;
146
147
148 [FILE:3970:patches/patch-hyphen]
149 Add hyphen to RANDR output names for consistency with modesetting(4x)
150
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
154  
155  unsigned sna_crtc_count_sprites(xf86CrtcPtr crtc)
156  {
157 -       struct plane *sprite;
158 +       struct plane *sprite = NULL;
159         unsigned count;
160  
161         count = 0;
162 @@ -479,7 +479,7 @@ unsigned sna_crtc_count_sprites(xf86Crtc
163  
164  static struct plane *lookup_sprite(struct sna_crtc *crtc, unsigned idx)
165  {
166 -       struct plane *sprite;
167 +       struct plane *sprite = NULL;
168  
169         list_for_each_entry(sprite, &crtc->sprites, link)
170                 if (idx-- == 0)
171 @@ -1727,7 +1727,7 @@ static bool wait_for_shadow(struct sna *
172  
173         if ((flags & MOVE_WRITE) == 0) {
174                 if ((flags & __MOVE_SCANOUT) == 0) {
175 -                       struct sna_crtc *crtc;
176 +                       struct sna_crtc *crtc = NULL;
177  
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 *
181  
182         flip_active = sna->mode.flip_active;
183         if (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)
191  {
192         struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
193 -       struct plane *sprite, *sn;
194 +       struct plane *sprite = NULL, *sn;
195  
196         if (sna_crtc == NULL)
197                 return;
198 @@ -3652,7 +3652,7 @@ bool sna_has_sprite_format(struct sna *s
199  
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;
204  
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;
213  
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)
218  {
219         struct local_mode_set_plane s;
220 -       struct plane *plane;
221 +       struct plane *plane = NULL;
222  
223         if (crtc->primary.id == 0)
224                 return false;
225 @@ -8774,7 +8774,7 @@ void sna_mode_reset(struct sna *sna)
226  
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;
231  
232                 assert(sna_crtc != NULL);
233  
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
237  void
238  intel_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), void *match_data)
239  {
240 -       struct intel_drm_queue *q;
241 +       struct intel_drm_queue *q = NULL;
242  
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 (
246  void
247  intel_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq)
248  {
249 -       struct intel_drm_queue *q;
250 +       struct intel_drm_queue *q = NULL;
251  
252         list_for_each_entry(q, &intel_drm_queue, list) {
253                 if (q->seq == seq) {
254 @@ -1905,7 +1905,7 @@ intel_drm_abort_seq(ScrnInfoPtr scrn, ui
255  static void
256  intel_drm_abort_scrn(ScrnInfoPtr scrn)
257  {
258 -       struct intel_drm_queue *q, *tmp;
259 +       struct intel_drm_queue *q = NULL, *tmp;
260  
261         list_for_each_entry_safe(q, tmp, &intel_drm_queue, list) {
262                 if (q->scrn == scrn)
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)
265  {
266         uint32_t user_data = (intptr_t)user_ptr;
267 -       struct intel_drm_queue *q;
268 +       struct intel_drm_queue *q = NULL;
269  
270         list_for_each_entry(q, &intel_drm_queue, list) {
271                 if (q->seq == user_data) {
272
273
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
277
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)
283                         return "i915";
284 +               else if (sna->kgem.gen < 0100)
285 +                       return "crocus";
286                 else
287 -                       return "i965";
288 +                       return "iris";
289         }
290  
291         return s;
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)
297                         return "i915";
298 +               else if (INTEL_INFO(intel)->gen < 0100)
299 +                       return "crocus";
300                 else
301 -                       return "i965";
302 +                       return "iris";
303         }
304  
305         return s;
306
307
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.
311
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
315  }
316  
317  static const char *kernel_module_names[] ={
318 +       "i915kms",
319         "i915",
320         NULL,
321  };
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);
325  
326 +#if defined(__DragonFly__)
327 +       /* assume modesetting for i915, allow multiple loads and no fbcon */
328 +       load_i915_kernel_module();
329 +#else
330         ret = drmCheckModesettingSupported(id);
331         if (ret) {
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");
336         }
337 +#endif
338  
339         return fd_set_nonblock(drmOpen(NULL, id));
340  }
341
342
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) {
346                             ^~
347 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
348     for (pos = __container_of((head)->next, pos, member);               \
349                                             ^~~
350 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
351     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
352                                         ^~~~~~
353 kgem.c:2849:20: note: initialize the variable 'bo' to silence this warning
354         struct kgem_bo *bo, *first = NULL;
355                           ^
356                            = 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) {
359                                  ^~
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),               \
362                                             ^~~
363 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
364     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
365                                         ^~~~~~
366 kgem.c:3115:20: note: initialize the variable 'bo' to silence this warning
367         struct kgem_bo *bo, *next;
368                           ^
369                            = NULL
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) {
372                                  ^~
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),               \
375                                             ^~~
376 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
377     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
378                                         ^~~~~~
379 kgem.c:3425:20: note: initialize the variable 'bo' to silence this warning
380         struct kgem_bo *bo, *next;
381                           ^
382                            = NULL
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) {
385                                  ^~
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),               \
388                                             ^~~
389 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
390     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
391                                         ^~~~~~
392 kgem.c:3539:24: note: initialize the variable 'bo' to silence this warning
393         struct kgem_buffer *bo, *next;
394                               ^
395                                = NULL
396 kgem.c:3930:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
397         list_for_each_entry(bo, list, list) {
398                             ^~
399 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
400     for (pos = __container_of((head)->next, pos, member);               \
401                                             ^~~
402 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
403     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
404                                         ^~~~~~
405 kgem.c:3928:20: note: initialize the variable 'bo' to silence this warning
406         struct kgem_bo *bo;
407                           ^
408                            = NULL
409 kgem.c:4670:23: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
410                 list_for_each_entry(bo, cache, vma) {
411                                     ^~
412 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
413     for (pos = __container_of((head)->next, pos, member);               \
414                                             ^~~
415 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
416     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
417                                         ^~~~~~
418 kgem.c:4576:20: note: initialize the variable 'bo' to silence this warning
419         struct kgem_bo *bo, *first = NULL;
420                           ^
421                            = 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) {
424                                             ^~
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);               \
427                                             ^~~
428 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
429     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
430                                         ^~~~~~
431 kgem.c:5380:20: note: initialize the variable 'bo' to silence this warning
432         struct kgem_bo *bo;
433                           ^
434                            = NULL
435 kgem.c:7225:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
436         list_for_each_entry(bo, buffers, request) {
437                             ^~
438 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
439     for (pos = __container_of((head)->next, pos, member);               \
440                                             ^~~
441 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
442     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
443                                         ^~~~~~
444 kgem.c:7223:20: note: initialize the variable 'bo' to silence this warning
445         struct kgem_bo *bo;
446                           ^
447                            = NULL
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) {
450                             ^~
451 ../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
452     for (pos = __container_of((head)->next, pos, member);               \
453                                             ^~~
454 ../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
455     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
456                                         ^~~~~~
457 kgem.c:7503:24: note: initialize the variable 'bo' to silence this warning
458         struct kgem_buffer *bo;
459                               ^
460                                = NULL
461
462 --- src/intel_list.h.orig       2021-01-15 20:59:05 UTC
463 +++ src/intel_list.h
464 @@ -325,12 +325,12 @@ list_is_empty(const struct list *head)
465   *
466   */
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))
472  
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))
479  
480 @@ -342,7 +342,7 @@ list_is_empty(const struct list *head)
481   * See list_for_each_entry for more details.
482   */
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))
489
490
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 $
493
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.
497
498 November 2013 patch from NetBSD xsrc:
499 http://mail-index.netbsd.org/source-changes/2013/11/14/msg049188.html
500
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))
505                pboxNext--;
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;
515 +               }
516 +           } else {
517 +              pptTmp = pptSrc + (pboxTmp - pbox);
518 +              while (pboxTmp <= pboxBase) {
519 +                 *pboxNew1++ = *pboxTmp++;
520 +                 *pptNew1++ = *pptTmp++;
521 +              }
522             }
523             pboxBase = pboxNext;
524          }
525
526
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
530
531 --- src/sna/kgem.c.orig 2021-01-15 20:59:05 UTC
532 +++ src/sna/kgem.c
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
539 +#else
540  #define DBG_NO_LLC 0
541 +#endif
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)
547  {
548         struct drm_i915_gem_execbuffer2 execbuf;
549 +       int ret;
550  
551         memset(&execbuf, 0, sizeof(execbuf));
552         execbuf.buffer_count = 1;
553  
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);
558 +#ifdef __FreeBSD__
559 +       /* XXX FreeBSD returns ENOENT instead of EFAULT. */
560 +       if (ret == -ENOENT)
561 +               return true;
562 +#endif
563 +       return ret == -EFAULT;
564  }
565  
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)
570  {
571 -       struct kgem_bo *bo, *first = NULL;
572 +       struct kgem_bo *bo = NULL, *first = NULL;
573  
574         DBG(("%s: num_pages=%d, flags=%x\n", __FUNCTION__, num_pages, flags));
575  
576 @@ -3127,7 +3136,7 @@ void kgem_retire__buffers(struct kgem *k
577  
578  static bool kgem_retire__flushing(struct kgem *kgem)
579  {
580 -       struct kgem_bo *bo, *next;
581 +       struct kgem_bo *bo = NULL, *next;
582         bool retired = false;
583  
584         list_for_each_entry_safe(bo, next, &kgem->flushing, request) {
585 @@ -3425,7 +3434,7 @@ static void kgem_commit__check_reloc(str
586  #ifndef NDEBUG
587  static void kgem_commit__check_buffers(struct kgem *kgem)
588  {
589 -       struct kgem_buffer *bo;
590 +       struct kgem_buffer *bo = NULL;
591  
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)
596  {
597         struct kgem_request *rq = kgem->next_request;
598 -       struct kgem_bo *bo, *next;
599 +       struct kgem_bo *bo = NULL, *next;
600  
601         kgem_commit__check_reloc(kgem);
602  
603 @@ -3551,7 +3560,7 @@ static void kgem_close_inactive(struct k
604  
605  static void kgem_finish_buffers(struct kgem *kgem)
606  {
607 -       struct kgem_buffer *bo, *next;
608 +       struct kgem_buffer *bo = NULL, *next;
609  
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
613  
614  static struct kgem_bo *first_available(struct kgem *kgem, struct list *list)
615  {
616 -       struct kgem_bo *bo;
617 +       struct kgem_bo *bo = NULL;
618  
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);
623  
624                 for (i = 0; i < kgem->nexec; i++) {
625 -                       struct kgem_bo *bo, *found = NULL;
626 +                       struct kgem_bo *bo = NULL, *found = NULL;
627  
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)
633  {
634 -       struct kgem_bo *bo, *first = NULL;
635 +       struct kgem_bo *bo = NULL, *first = NULL;
636         bool use_active = (flags & CREATE_INACTIVE) == 0;
637         struct list *cache;
638  
639 @@ -5392,7 +5401,7 @@ struct kgem_bo *kgem_create_2d(struct kg
640                                uint32_t flags)
641  {
642         struct list *cache;
643 -       struct kgem_bo *bo;
644 +       struct kgem_bo *bo = NULL;
645         uint32_t pitch, tiled_height, size;
646         uint32_t handle;
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)
650  {
651         struct list * const buffers = &kgem->next_request->buffers;
652 -       struct kgem_bo *bo;
653 +       struct kgem_bo *bo = NULL;
654  
655         list_for_each_entry(bo, buffers, request) {
656                 if (!bo->gpu_dirty)
657 @@ -7525,7 +7534,7 @@ struct kgem_bo *kgem_create_buffer(struc
658                                    uint32_t size, uint32_t flags,
659                                    void **ret)
660  {
661 -       struct kgem_buffer *bo;
662 +       struct kgem_buffer *bo = NULL;
663         unsigned offset, alloc;
664         struct kgem_bo *old;
665  
666
667
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 $
670
671 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
672 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
673
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)
679  {
680 -       struct kgem_bo *bo;
681 +       struct kgem_bo *bo = NULL;
682  
683         if (reloc == NULL)
684                 return NULL;
685 @@ -86,7 +86,7 @@ static int kgem_debug_handle_is_fenced(s
686  
687  static int kgem_debug_handle_tiling(struct kgem *kgem, uint32_t handle)
688  {
689 -       struct kgem_bo *bo;
690 +       struct kgem_bo *bo = NULL;
691  
692         list_for_each_entry(bo, &kgem->next_request->buffers, request)
693                 if (bo->target_handle == handle)
694
695
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 $
698
699 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
700 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
701
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
705         int n, nboxes;
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;
710  
711         assert(damage->mode != DAMAGE_ALL);
712         assert(damage->dirty);
713 @@ -1808,7 +1808,7 @@ void _sna_damage_debug_get_region(struct
714  {
715         int n, nboxes;
716         BoxPtr boxes;
717 -       struct sna_damage_box *iter;
718 +       struct sna_damage_box *iter = NULL;
719  
720         RegionCopy(r, &damage->region);
721         if (!damage->dirty)
722
723
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 $
726
727 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
728 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
729
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
733  {
734         struct sna *sna = to_sna_from_screen(screen);
735         PixmapPtr pixmap;
736 -       struct sna_pixmap *priv;
737 +       struct sna_pixmap *priv = NULL;
738         struct kgem_bo *bo;
739  
740         DBG(("%s(fd=%d, width=%d, height=%d, stride=%d, depth=%d, bpp=%d)\n",
741
742
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 $
745
746 https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
747 https://gitlab.freedesktop.org/E5ten/xf86-video-intel/-/commit/a92ccaf05efe8f11b3c5cd217d48ad3cf4caa090
748
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)
753  {
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;
758  
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)
762  {
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;
767         struct list *q;
768  
769
770
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
774 @@ -59,7 +59,7 @@
775  #include "intel_options.h"
776  
777  #include <xf86xv.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>
782  #ifdef __OpenBSD__
783 @@ -67,6 +67,9 @@
784  #else
785  #define bswap_32 bswap32
786  #endif
787 +#elif defined(__sun)
788 +#include <sys/byteorder.h>
789 +#define bswap_32 BSWAP_32
790  #else
791  #include <byteswap.h>
792  #endif
793
794
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 $
797
798 Similar to https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/171
799
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)
804  {
805         intel_screen_private *intel = intel_get_screen_private(scrn);
806 -       struct intel_uxa_pixmap *priv;
807 +       struct intel_uxa_pixmap *priv = NULL;
808  
809         list_for_each_entry(priv, &intel->batch_pixmaps, batch)
810                 priv->dirty = 0;
811
812
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)
816                                     ^
817 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
818     for (pos = __container_of((head)->next, pos, member);               \
819                                             ^~~
820 present-speed.c:112:41: note: expanded from macro '__container_of'
821     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
822                                         ^~~~~~
823 present-speed.c:297:19: note: initialize the variable 'b' to silence this warning
824                 struct buffer *b;
825                                 ^
826                                  = NULL
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;
830                         ~~~~~~~~~~~~~~~^~~
831 present-speed.c:231:24: note: uninitialized use occurs here
832                         list_for_each_entry(tmp, &mru, link) {
833                                             ^~~
834 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
835     for (pos = __container_of((head)->next, pos, member);               \
836                                             ^~~
837 present-speed.c:112:41: note: expanded from macro '__container_of'
838     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
839                                         ^~~~~~
840 present-speed.c:229:22: note: initialize the variable 'tmp' to silence this warning
841                         struct buffer *tmp, *b = NULL;
842                                           ^
843                                            = 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)
846                                             ^
847 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
848     for (pos = __container_of((head)->next, pos, member);               \
849                                             ^~~
850 present-speed.c:112:41: note: expanded from macro '__container_of'
851     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
852                                         ^~~~~~
853 present-speed.c:537:20: note: initialize the variable 'b' to silence this warning
854                         struct buffer *b;
855                                         ^
856                                          = NULL
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;
860                         ~~~~~~~~~~~~~~~^~~
861 present-speed.c:469:24: note: uninitialized use occurs here
862                         list_for_each_entry(tmp, &pp[i].mru, link) {
863                                             ^~~
864 present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
865     for (pos = __container_of((head)->next, pos, member);               \
866                                             ^~~
867 present-speed.c:112:41: note: expanded from macro '__container_of'
868     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
869                                         ^~~~~~
870 present-speed.c:467:22: note: initialize the variable 'tmp' to silence this warning
871                         struct buffer *tmp, *b = NULL;
872                                           ^
873                                            = NULL
874
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);
879         do {
880                 for (n = 0; n < 1000; n++) {
881 -                       struct buffer *tmp, *b = NULL;
882 +                       struct buffer *tmp = NULL, *b = NULL;
883  retry:
884                         list_for_each_entry(tmp, &mru, link) {
885                                 if (tmp->fence.xid)
886 @@ -294,7 +294,7 @@ retry:
887         } while (end.tv_sec < start.tv_sec + 10);
888  
889         if (options & DRI3) {
890 -               struct buffer *b;
891 +               struct buffer *b = NULL;
892                 XID pixmap;
893  
894                 pixmap = xcb_generate_id(c);
895 @@ -464,7 +464,7 @@ static void perpixel(Display *dpy,
896         clock_gettime(CLOCK_MONOTONIC, &start);
897         do {
898                 for (i = 0; i < sz; i++) {
899 -                       struct buffer *tmp, *b = NULL;
900 +                       struct buffer *tmp = NULL, *b = NULL;
901  retry:
902                         list_for_each_entry(tmp, &pp[i].mru, link) {
903                                 if (tmp->fence.xid)
904 @@ -534,7 +534,7 @@ retry:
905         for (i = 0; i < sz; i++) {
906                 if (options & DRI3) {
907                         int depth = DefaultDepth(dpy, DefaultScreen(dpy));
908 -                       struct buffer *b;
909 +                       struct buffer *b = NULL;
910                         XID pixmap;
911  
912                         pixmap = xcb_generate_id(c);
913
914
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
918 @@ -29,6 +29,9 @@
919  #include "config.h"
920  #endif
921  
922 +#define _WITH_GETLINE  /* to expose getline() in stdio.h on FreeBSD */
923 +#include <stdio.h>     /* for getline() */
924 +
925  #include "sna.h"
926  
927  #include <unistd.h>
928