st/dri: Fix frontbuffer rendering with DRI2
[mesa.git] / src / gallium / state_trackers / dri / dri_drawable.c
1 /**************************************************************************
2 *
3 * Copyright 2009, VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27 /*
28 * Author: Keith Whitwell <keithw@vmware.com>
29 * Author: Jakob Bornecrantz <wallbraker@gmail.com>
30 */
31
32 #include "dri_screen.h"
33 #include "dri_context.h"
34 #include "dri_drawable.h"
35
36 #include "pipe/p_context.h"
37 #include "pipe/p_screen.h"
38 #include "pipe/p_inlines.h"
39 #include "state_tracker/drm_api.h"
40 #include "state_tracker/dri1_api.h"
41 #include "state_tracker/st_public.h"
42 #include "state_tracker/st_context.h"
43 #include "state_tracker/st_cb_fbo.h"
44
45 #include "util/u_memory.h"
46
47 static struct pipe_surface *
48 dri_surface_from_handle(struct drm_api *api,
49 struct pipe_screen *screen,
50 unsigned handle,
51 enum pipe_format format,
52 unsigned width, unsigned height, unsigned pitch)
53 {
54 struct pipe_surface *surface = NULL;
55 struct pipe_texture *texture = NULL;
56 struct pipe_texture templat;
57 struct pipe_buffer *buf = NULL;
58
59 buf = api->buffer_from_handle(api, screen, "dri2 buffer", handle);
60 if (!buf)
61 return NULL;
62
63 memset(&templat, 0, sizeof(templat));
64 templat.tex_usage |= PIPE_TEXTURE_USAGE_RENDER_TARGET;
65 templat.target = PIPE_TEXTURE_2D;
66 templat.last_level = 0;
67 templat.depth[0] = 1;
68 templat.format = format;
69 templat.width[0] = width;
70 templat.height[0] = height;
71 pf_get_block(templat.format, &templat.block);
72
73 texture = screen->texture_blanket(screen, &templat, &pitch, buf);
74
75 /* we don't need the buffer from this point on */
76 pipe_buffer_reference(&buf, NULL);
77
78 if (!texture)
79 return NULL;
80
81 surface = screen->get_tex_surface(screen, texture, 0, 0, 0,
82 PIPE_BUFFER_USAGE_GPU_READ |
83 PIPE_BUFFER_USAGE_GPU_WRITE);
84
85 /* we don't need the texture from this point on */
86 pipe_texture_reference(&texture, NULL);
87 return surface;
88 }
89
90 /**
91 * This will be called a drawable is known to have been resized.
92 */
93 void
94 dri_get_buffers(__DRIdrawablePrivate * dPriv)
95 {
96
97 struct dri_drawable *drawable = dri_drawable(dPriv);
98 struct pipe_surface *surface = NULL;
99 struct pipe_screen *screen = dri_screen(drawable->sPriv)->pipe_screen;
100 __DRIbuffer *buffers = NULL;
101 __DRIscreen *dri_screen = drawable->sPriv;
102 __DRIdrawable *dri_drawable = drawable->dPriv;
103 struct drm_api *api = ((struct dri_screen*)(dri_screen->private))->api;
104 boolean have_depth = FALSE;
105 int i, count;
106
107 buffers = (*dri_screen->dri2.loader->getBuffers) (dri_drawable,
108 &dri_drawable->w,
109 &dri_drawable->h,
110 drawable->attachments,
111 drawable->
112 num_attachments, &count,
113 dri_drawable->
114 loaderPrivate);
115
116 if (buffers == NULL) {
117 return;
118 }
119
120 /* set one cliprect to cover the whole dri_drawable */
121 dri_drawable->x = 0;
122 dri_drawable->y = 0;
123 dri_drawable->backX = 0;
124 dri_drawable->backY = 0;
125 dri_drawable->numClipRects = 1;
126 dri_drawable->pClipRects[0].x1 = 0;
127 dri_drawable->pClipRects[0].y1 = 0;
128 dri_drawable->pClipRects[0].x2 = dri_drawable->w;
129 dri_drawable->pClipRects[0].y2 = dri_drawable->h;
130 dri_drawable->numBackClipRects = 1;
131 dri_drawable->pBackClipRects[0].x1 = 0;
132 dri_drawable->pBackClipRects[0].y1 = 0;
133 dri_drawable->pBackClipRects[0].x2 = dri_drawable->w;
134 dri_drawable->pBackClipRects[0].y2 = dri_drawable->h;
135
136 if (drawable->old_num == count &&
137 drawable->old_w == dri_drawable->w &&
138 drawable->old_h == dri_drawable->h &&
139 memcmp(drawable->old, buffers, sizeof(__DRIbuffer) * count) == 0) {
140 return;
141 } else {
142 drawable->old_num = count;
143 drawable->old_w = dri_drawable->w;
144 drawable->old_h = dri_drawable->h;
145 memcpy(drawable->old, buffers, sizeof(__DRIbuffer) * count);
146 }
147
148 for (i = 0; i < count; i++) {
149 enum pipe_format format = 0;
150 int index = 0;
151
152 switch (buffers[i].attachment) {
153 case __DRI_BUFFER_FRONT_LEFT:
154 continue;
155 case __DRI_BUFFER_FAKE_FRONT_LEFT:
156 index = ST_SURFACE_FRONT_LEFT;
157 format = drawable->color_format;
158 break;
159 case __DRI_BUFFER_BACK_LEFT:
160 index = ST_SURFACE_BACK_LEFT;
161 format = drawable->color_format;
162 break;
163 case __DRI_BUFFER_DEPTH:
164 index = ST_SURFACE_DEPTH;
165 format = drawable->depth_format;
166 break;
167 case __DRI_BUFFER_STENCIL:
168 index = ST_SURFACE_DEPTH;
169 format = drawable->stencil_format;
170 break;
171 case __DRI_BUFFER_ACCUM:
172 default:
173 assert(0);
174 }
175
176 if (index == ST_SURFACE_DEPTH) {
177 if (have_depth)
178 continue;
179 else
180 have_depth = TRUE;
181 }
182
183 surface = dri_surface_from_handle(api,
184 screen,
185 buffers[i].name,
186 format,
187 dri_drawable->w,
188 dri_drawable->h, buffers[i].pitch);
189
190 st_set_framebuffer_surface(drawable->stfb, index, surface);
191 pipe_surface_reference(&surface, NULL);
192 }
193 /* this needed, or else the state tracker fails to pick the new buffers */
194 st_resize_framebuffer(drawable->stfb, dri_drawable->w, dri_drawable->h);
195 }
196
197 /**
198 * These are used for GLX_EXT_texture_from_pixmap
199 */
200 void dri2_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
201 GLint format, __DRIdrawable *dPriv)
202 {
203 struct dri_drawable *drawable = dri_drawable(dPriv);
204 struct pipe_surface *ps;
205
206 dri_get_buffers(drawable->dPriv);
207 st_get_framebuffer_surface(drawable->stfb, ST_SURFACE_FRONT_LEFT, &ps);
208
209 st_bind_texture_surface(ps, target == GL_TEXTURE_2D ? ST_TEXTURE_2D :
210 ST_TEXTURE_RECT, 0,
211 format == GLX_TEXTURE_FORMAT_RGBA_EXT ?
212 PIPE_FORMAT_R8G8B8A8_UNORM : PIPE_FORMAT_R8G8B8X8_UNORM);
213 }
214
215 void dri2_set_tex_buffer(__DRIcontext *pDRICtx, GLint target,
216 __DRIdrawable *dPriv)
217 {
218 dri2_set_tex_buffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv);
219 }
220
221 void
222 dri_flush_frontbuffer(struct pipe_screen *screen,
223 struct pipe_surface *surf, void *context_private)
224 {
225 struct dri_context *ctx = (struct dri_context *)context_private;
226 struct dri_drawable *drawable = dri_drawable(ctx->dPriv);
227 __DRIdrawable *dri_drawable = ctx->dPriv;
228 __DRIscreen *dri_screen = ctx->sPriv;
229
230 /* XXX Does this function get called with DRI1? */
231
232 if (ctx->dPriv == NULL) {
233 debug_printf("%s: no drawable bound to context\n", __func__);
234 return;
235 }
236
237 (*dri_screen->dri2.loader->flushFrontBuffer)(dri_drawable,
238 dri_drawable->loaderPrivate);
239 }
240
241 /**
242 * This is called when we need to set up GL rendering to a new X window.
243 */
244 boolean
245 dri_create_buffer(__DRIscreenPrivate * sPriv,
246 __DRIdrawablePrivate * dPriv,
247 const __GLcontextModes * visual, boolean isPixmap)
248 {
249 struct dri_screen *screen = sPriv->private;
250 struct dri_drawable *drawable = NULL;
251 int i;
252
253 if (isPixmap)
254 goto fail; /* not implemented */
255
256 drawable = CALLOC_STRUCT(dri_drawable);
257 if (drawable == NULL)
258 goto fail;
259
260 drawable->color_format = (visual->redBits == 8) ?
261 PIPE_FORMAT_A8R8G8B8_UNORM : PIPE_FORMAT_R5G6B5_UNORM;
262
263 debug_printf("Red bits is %d\n", visual->redBits);
264
265 switch(visual->depthBits) {
266 default:
267 case 0:
268 debug_printf("Depth buffer 0.\n");
269 drawable->depth_format = PIPE_FORMAT_NONE;
270 break;
271 case 16:
272 debug_printf("Depth buffer 16.\n");
273 drawable->depth_format = PIPE_FORMAT_Z16_UNORM;
274 break;
275 case 24:
276 if (visual->stencilBits == 0) {
277 debug_printf("Depth buffer 24. Stencil 0.\n");
278 drawable->depth_format = (screen->d_depth_bits_last) ?
279 PIPE_FORMAT_X8Z24_UNORM:
280 PIPE_FORMAT_Z24X8_UNORM;
281 } else {
282 debug_printf("Combined depth stencil 24 / 8.\n");
283 drawable->depth_format = (screen->sd_depth_bits_last) ?
284 PIPE_FORMAT_S8Z24_UNORM:
285 PIPE_FORMAT_Z24S8_UNORM;
286 }
287 break;
288 }
289
290 switch(visual->stencilBits) {
291 default:
292 case 0:
293 drawable->stencil_format = PIPE_FORMAT_NONE;
294 break;
295 case 8:
296 drawable->stencil_format = (screen->sd_depth_bits_last) ?
297 PIPE_FORMAT_S8Z24_UNORM:
298 PIPE_FORMAT_Z24S8_UNORM;
299 break;
300 }
301
302 drawable->stfb = st_create_framebuffer(visual,
303 drawable->color_format,
304 drawable->depth_format,
305 drawable->stencil_format,
306 dPriv->w,
307 dPriv->h, (void *)drawable);
308 if (drawable->stfb == NULL)
309 goto fail;
310
311 drawable->sPriv = sPriv;
312 drawable->dPriv = dPriv;
313 dPriv->driverPrivate = (void *)drawable;
314
315 /* setup dri2 buffers information */
316 /* TODO incase of double buffer visual, delay fake creation */
317 i = 0;
318 drawable->attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
319 drawable->attachments[i++] = __DRI_BUFFER_FAKE_FRONT_LEFT;
320
321 if (visual->doubleBufferMode)
322 drawable->attachments[i++] = __DRI_BUFFER_BACK_LEFT;
323 if (visual->depthBits)
324 drawable->attachments[i++] = __DRI_BUFFER_DEPTH;
325 if (visual->stencilBits)
326 drawable->attachments[i++] = __DRI_BUFFER_STENCIL;
327 drawable->num_attachments = i;
328
329 drawable->desired_fences = 2;
330
331 return GL_TRUE;
332 fail:
333 FREE(drawable);
334 return GL_FALSE;
335 }
336
337 static struct pipe_fence_handle *
338 dri_swap_fences_pop_front(struct dri_drawable *draw)
339 {
340 struct pipe_screen *screen = dri_screen(draw->sPriv)->pipe_screen;
341 struct pipe_fence_handle *fence = NULL;
342
343 if (draw->cur_fences >= draw->desired_fences) {
344 screen->fence_reference(screen, &fence, draw->swap_fences[draw->tail]);
345 screen->fence_reference(screen, &draw->swap_fences[draw->tail++], NULL);
346 --draw->cur_fences;
347 draw->tail &= DRI_SWAP_FENCES_MASK;
348 }
349 return fence;
350 }
351
352 static void
353 dri_swap_fences_push_back(struct dri_drawable *draw,
354 struct pipe_fence_handle *fence)
355 {
356 struct pipe_screen *screen = dri_screen(draw->sPriv)->pipe_screen;
357
358 if (!fence)
359 return;
360
361 if (draw->cur_fences < DRI_SWAP_FENCES_MAX) {
362 draw->cur_fences++;
363 screen->fence_reference(screen, &draw->swap_fences[draw->head++],
364 fence);
365 draw->head &= DRI_SWAP_FENCES_MASK;
366 }
367 }
368
369 void
370 dri_destroy_buffer(__DRIdrawablePrivate * dPriv)
371 {
372 struct dri_drawable *drawable = dri_drawable(dPriv);
373 struct pipe_fence_handle *fence;
374 struct pipe_screen *screen = dri_screen(drawable->sPriv)->pipe_screen;
375
376 st_unreference_framebuffer(drawable->stfb);
377 drawable->desired_fences = 0;
378 while (drawable->cur_fences) {
379 fence = dri_swap_fences_pop_front(drawable);
380 screen->fence_reference(screen, &fence, NULL);
381 }
382
383 FREE(drawable);
384 }
385
386 static void
387 dri1_update_drawables_locked(struct dri_context *ctx,
388 __DRIdrawablePrivate * driDrawPriv,
389 __DRIdrawablePrivate * driReadPriv)
390 {
391 if (ctx->stLostLock) {
392 ctx->stLostLock = FALSE;
393 if (driDrawPriv == driReadPriv)
394 DRI_VALIDATE_DRAWABLE_INFO(ctx->sPriv, driDrawPriv);
395 else
396 DRI_VALIDATE_TWO_DRAWABLES_INFO(ctx->sPriv, driDrawPriv,
397 driReadPriv);
398 }
399 }
400
401 /**
402 * This ensures all contexts which bind to a drawable pick up the
403 * drawable change and signal new buffer state.
404 * Calling st_resize_framebuffer for each context may seem like overkill,
405 * but no new buffers will actually be allocated if the dimensions don't
406 * change.
407 */
408
409 static void
410 dri1_propagate_drawable_change(struct dri_context *ctx)
411 {
412 __DRIdrawablePrivate *dPriv = ctx->dPriv;
413 __DRIdrawablePrivate *rPriv = ctx->rPriv;
414 boolean flushed = FALSE;
415
416 if (dPriv && ctx->d_stamp != dPriv->lastStamp) {
417
418 st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
419 flushed = TRUE;
420 ctx->d_stamp = dPriv->lastStamp;
421 st_resize_framebuffer(dri_drawable(dPriv)->stfb, dPriv->w, dPriv->h);
422
423 }
424
425 if (rPriv && dPriv != rPriv && ctx->r_stamp != rPriv->lastStamp) {
426
427 if (!flushed)
428 st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
429 ctx->r_stamp = rPriv->lastStamp;
430 st_resize_framebuffer(dri_drawable(rPriv)->stfb, rPriv->w, rPriv->h);
431
432 } else if (rPriv && dPriv == rPriv) {
433
434 ctx->r_stamp = ctx->d_stamp;
435
436 }
437 }
438
439 void
440 dri1_update_drawables(struct dri_context *ctx,
441 struct dri_drawable *draw, struct dri_drawable *read)
442 {
443 dri_lock(ctx);
444 dri1_update_drawables_locked(ctx, draw->dPriv, read->dPriv);
445 dri_unlock(ctx);
446
447 dri1_propagate_drawable_change(ctx);
448 }
449
450 static INLINE boolean
451 dri1_intersect_src_bbox(struct drm_clip_rect *dst,
452 int dst_x,
453 int dst_y,
454 const struct drm_clip_rect *src,
455 const struct drm_clip_rect *bbox)
456 {
457 int xy1;
458 int xy2;
459
460 xy1 = ((int)src->x1 > (int)bbox->x1 + dst_x) ? src->x1 :
461 (int)bbox->x1 + dst_x;
462 xy2 = ((int)src->x2 < (int)bbox->x2 + dst_x) ? src->x2 :
463 (int)bbox->x2 + dst_x;
464 if (xy1 >= xy2 || xy1 < 0)
465 return FALSE;
466
467 dst->x1 = xy1;
468 dst->x2 = xy2;
469
470 xy1 = ((int)src->y1 > (int)bbox->y1 + dst_y) ? src->y1 :
471 (int)bbox->y1 + dst_y;
472 xy2 = ((int)src->y2 < (int)bbox->y2 + dst_y) ? src->y2 :
473 (int)bbox->y2 + dst_y;
474 if (xy1 >= xy2 || xy1 < 0)
475 return FALSE;
476
477 dst->y1 = xy1;
478 dst->y2 = xy2;
479 return TRUE;
480 }
481
482 static void
483 dri1_swap_copy(struct dri_context *ctx,
484 struct pipe_surface *dst,
485 struct pipe_surface *src,
486 __DRIdrawablePrivate * dPriv, const struct drm_clip_rect *bbox)
487 {
488 struct pipe_context *pipe = ctx->pipe;
489 struct drm_clip_rect clip;
490 struct drm_clip_rect *cur;
491 int i;
492
493 cur = dPriv->pClipRects;
494
495 for (i = 0; i < dPriv->numClipRects; ++i) {
496 if (dri1_intersect_src_bbox(&clip, dPriv->x, dPriv->y, cur++, bbox))
497 pipe->surface_copy(pipe, dst, clip.x1, clip.y1,
498 src,
499 (int)clip.x1 - dPriv->x,
500 (int)clip.y1 - dPriv->y,
501 clip.x2 - clip.x1, clip.y2 - clip.y1);
502 }
503 }
504
505 static void
506 dri1_copy_to_front(struct dri_context *ctx,
507 struct pipe_surface *surf,
508 __DRIdrawablePrivate * dPriv,
509 const struct drm_clip_rect *sub_box,
510 struct pipe_fence_handle **fence)
511 {
512 struct pipe_context *pipe = ctx->pipe;
513 boolean save_lost_lock;
514 uint cur_w;
515 uint cur_h;
516 struct drm_clip_rect bbox;
517 boolean visible = TRUE;
518
519 *fence = NULL;
520
521 dri_lock(ctx);
522 save_lost_lock = ctx->stLostLock;
523 dri1_update_drawables_locked(ctx, dPriv, dPriv);
524 st_get_framebuffer_dimensions(dri_drawable(dPriv)->stfb, &cur_w, &cur_h);
525
526 bbox.x1 = 0;
527 bbox.x2 = cur_w;
528 bbox.y1 = 0;
529 bbox.y2 = cur_h;
530
531 if (sub_box)
532 visible = dri1_intersect_src_bbox(&bbox, 0, 0, &bbox, sub_box);
533
534 if (visible && __dri1_api_hooks->present_locked) {
535
536 __dri1_api_hooks->present_locked(pipe,
537 surf,
538 dPriv->pClipRects,
539 dPriv->numClipRects,
540 dPriv->x, dPriv->y, &bbox, fence);
541
542 } else if (visible && __dri1_api_hooks->front_srf_locked) {
543
544 struct pipe_surface *front = __dri1_api_hooks->front_srf_locked(pipe);
545
546 if (front)
547 dri1_swap_copy(ctx, front, surf, dPriv, &bbox);
548
549 st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, fence);
550 }
551
552 ctx->stLostLock = save_lost_lock;
553
554 /**
555 * FIXME: Revisit this: Update drawables on copy_sub_buffer ?
556 */
557
558 if (!sub_box)
559 dri1_update_drawables_locked(ctx, ctx->dPriv, ctx->rPriv);
560
561 dri_unlock(ctx);
562 dri1_propagate_drawable_change(ctx);
563 }
564
565 void
566 dri1_flush_frontbuffer(struct pipe_screen *screen,
567 struct pipe_surface *surf, void *context_private)
568 {
569 struct dri_context *ctx = (struct dri_context *)context_private;
570 struct pipe_fence_handle *dummy_fence;
571
572 dri1_copy_to_front(ctx, surf, ctx->dPriv, NULL, &dummy_fence);
573 screen->fence_reference(screen, &dummy_fence, NULL);
574
575 /**
576 * FIXME: Do we need swap throttling here?
577 */
578 }
579
580 void
581 dri_swap_buffers(__DRIdrawablePrivate * dPriv)
582 {
583 struct dri_context *ctx;
584 struct pipe_surface *back_surf;
585 struct dri_drawable *draw = dri_drawable(dPriv);
586 struct pipe_screen *screen = dri_screen(draw->sPriv)->pipe_screen;
587 struct pipe_fence_handle *fence;
588 struct st_context *st = st_get_current();
589
590 assert(__dri1_api_hooks != NULL);
591
592 if (!st)
593 return; /* For now */
594
595 ctx = (struct dri_context *)st->pipe->priv;
596
597 st_get_framebuffer_surface(draw->stfb, ST_SURFACE_BACK_LEFT, &back_surf);
598 if (back_surf) {
599 st_notify_swapbuffers(draw->stfb);
600 st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
601 fence = dri_swap_fences_pop_front(draw);
602 if (fence) {
603 (void)screen->fence_finish(screen, fence, 0);
604 screen->fence_reference(screen, &fence, NULL);
605 }
606 dri1_copy_to_front(ctx, back_surf, dPriv, NULL, &fence);
607 dri_swap_fences_push_back(draw, fence);
608 screen->fence_reference(screen, &fence, NULL);
609 }
610 }
611
612 void
613 dri_copy_sub_buffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
614 {
615 struct pipe_screen *screen = dri_screen(dPriv->driScreenPriv)->pipe_screen;
616 struct drm_clip_rect sub_bbox;
617 struct dri_context *ctx;
618 struct pipe_surface *back_surf;
619 struct dri_drawable *draw = dri_drawable(dPriv);
620 struct pipe_fence_handle *dummy_fence;
621 struct st_context *st = st_get_current();
622
623 assert(__dri1_api_hooks != NULL);
624
625 if (!st)
626 return;
627
628 ctx = (struct dri_context *)st->pipe->priv;
629
630 sub_bbox.x1 = x;
631 sub_bbox.x2 = x + w;
632 sub_bbox.y1 = y;
633 sub_bbox.y2 = y + h;
634
635 st_get_framebuffer_surface(draw->stfb, ST_SURFACE_BACK_LEFT, &back_surf);
636 if (back_surf) {
637 st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
638 dri1_copy_to_front(ctx, back_surf, dPriv, &sub_bbox, &dummy_fence);
639 screen->fence_reference(screen, &dummy_fence, NULL);
640 }
641 }
642
643 /* vim: set sw=3 ts=8 sts=3 expandtab: */