[g3dvl] rework fence handling and add r600g workaround
[mesa.git] / src / gallium / state_trackers / xorg / xvmc / surface.c
1 /**************************************************************************
2 *
3 * Copyright 2009 Younes Manton.
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 TUNGSTEN GRAPHICS 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 #include <assert.h>
29 #include <stdio.h>
30
31 #include <X11/Xlibint.h>
32
33 #include <pipe/p_video_context.h>
34 #include <pipe/p_video_state.h>
35 #include <pipe/p_state.h>
36
37 #include <util/u_inlines.h>
38 #include <util/u_memory.h>
39 #include <util/u_math.h>
40
41 #include <vl_winsys.h>
42
43 #include "xvmc_private.h"
44
45 static const unsigned const_empty_block_mask_420[3][2][2] = {
46 { { 0x20, 0x10 }, { 0x08, 0x04 } },
47 { { 0x02, 0x02 }, { 0x02, 0x02 } },
48 { { 0x01, 0x01 }, { 0x01, 0x01 } }
49 };
50
51 static enum pipe_mpeg12_picture_type PictureToPipe(int xvmc_pic)
52 {
53 switch (xvmc_pic) {
54 case XVMC_TOP_FIELD:
55 return PIPE_MPEG12_PICTURE_TYPE_FIELD_TOP;
56 case XVMC_BOTTOM_FIELD:
57 return PIPE_MPEG12_PICTURE_TYPE_FIELD_BOTTOM;
58 case XVMC_FRAME_PICTURE:
59 return PIPE_MPEG12_PICTURE_TYPE_FRAME;
60 default:
61 assert(0);
62 }
63
64 XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized picture type 0x%08X.\n", xvmc_pic);
65
66 return -1;
67 }
68
69 static inline void
70 MacroBlockTypeToPipeWeights(const XvMCMacroBlock *xvmc_mb, unsigned weights[2])
71 {
72 assert(xvmc_mb);
73
74 switch (xvmc_mb->macroblock_type & (XVMC_MB_TYPE_MOTION_FORWARD | XVMC_MB_TYPE_MOTION_BACKWARD)) {
75 case XVMC_MB_TYPE_MOTION_FORWARD:
76 weights[0] = PIPE_VIDEO_MV_WEIGHT_MAX;
77 weights[1] = PIPE_VIDEO_MV_WEIGHT_MIN;
78 break;
79
80 case (XVMC_MB_TYPE_MOTION_FORWARD | XVMC_MB_TYPE_MOTION_BACKWARD):
81 weights[0] = PIPE_VIDEO_MV_WEIGHT_HALF;
82 weights[1] = PIPE_VIDEO_MV_WEIGHT_HALF;
83 break;
84
85 case XVMC_MB_TYPE_MOTION_BACKWARD:
86 weights[0] = PIPE_VIDEO_MV_WEIGHT_MIN;
87 weights[1] = PIPE_VIDEO_MV_WEIGHT_MAX;
88 break;
89
90 default:
91 /* workaround for xines xxmc video out plugin */
92 if (!(xvmc_mb->macroblock_type & ~XVMC_MB_TYPE_PATTERN)) {
93 weights[0] = PIPE_VIDEO_MV_WEIGHT_MAX;
94 weights[1] = PIPE_VIDEO_MV_WEIGHT_MIN;
95 } else {
96 weights[0] = PIPE_VIDEO_MV_WEIGHT_MIN;
97 weights[1] = PIPE_VIDEO_MV_WEIGHT_MIN;
98 }
99 break;
100 }
101 }
102
103 static inline struct pipe_motionvector
104 MotionVectorToPipe(const XvMCMacroBlock *xvmc_mb, unsigned vector,
105 unsigned field_select_mask, unsigned weight)
106 {
107 struct pipe_motionvector mv;
108
109 assert(xvmc_mb);
110
111 switch (xvmc_mb->motion_type) {
112 case XVMC_PREDICTION_FRAME:
113 mv.top.x = xvmc_mb->PMV[0][vector][0];
114 mv.top.y = xvmc_mb->PMV[0][vector][1];
115 mv.top.field_select = PIPE_VIDEO_FRAME;
116 mv.top.weight = weight;
117
118 mv.bottom.x = xvmc_mb->PMV[0][vector][0];
119 mv.bottom.y = xvmc_mb->PMV[0][vector][1];
120 mv.bottom.weight = weight;
121 mv.bottom.field_select = PIPE_VIDEO_FRAME;
122 break;
123
124 case XVMC_PREDICTION_FIELD:
125 mv.top.x = xvmc_mb->PMV[0][vector][0];
126 mv.top.y = xvmc_mb->PMV[0][vector][1];
127 mv.top.field_select = (xvmc_mb->motion_vertical_field_select & field_select_mask) ?
128 PIPE_VIDEO_BOTTOM_FIELD : PIPE_VIDEO_TOP_FIELD;
129 mv.top.weight = weight;
130
131 mv.bottom.x = xvmc_mb->PMV[1][vector][0];
132 mv.bottom.y = xvmc_mb->PMV[1][vector][1];
133 mv.bottom.field_select = (xvmc_mb->motion_vertical_field_select & (field_select_mask << 2)) ?
134 PIPE_VIDEO_BOTTOM_FIELD : PIPE_VIDEO_TOP_FIELD;
135 mv.bottom.weight = weight;
136 break;
137
138 default: // TODO: Support DUALPRIME and 16x8
139 break;
140 }
141
142 return mv;
143 }
144
145 static inline void
146 UploadYcbcrBlocks(XvMCSurfacePrivate *surface,
147 const XvMCMacroBlock *xvmc_mb,
148 const XvMCBlockArray *xvmc_blocks)
149 {
150 enum pipe_mpeg12_dct_intra intra;
151 enum pipe_mpeg12_dct_type coding;
152
153 unsigned tb, x, y;
154 short *blocks;
155
156 assert(surface);
157 assert(xvmc_mb);
158
159 intra = xvmc_mb->macroblock_type & XVMC_MB_TYPE_INTRA ?
160 PIPE_MPEG12_DCT_INTRA : PIPE_MPEG12_DCT_DELTA;
161
162 coding = xvmc_mb->dct_type == XVMC_DCT_TYPE_FIELD ?
163 PIPE_MPEG12_DCT_TYPE_FIELD : PIPE_MPEG12_DCT_TYPE_FRAME;
164
165 blocks = xvmc_blocks->blocks + xvmc_mb->index * BLOCK_SIZE_SAMPLES;
166
167 for (y = 0; y < 2; ++y) {
168 for (x = 0; x < 2; ++x, ++tb) {
169 if (xvmc_mb->coded_block_pattern & const_empty_block_mask_420[0][y][x]) {
170
171 struct pipe_ycbcr_block *stream = surface->ycbcr[0].stream;
172 stream->x = xvmc_mb->x * 2 + x;
173 stream->y = xvmc_mb->y * 2 + y;
174 stream->intra = intra;
175 stream->coding = coding;
176
177 memcpy(surface->ycbcr[0].buffer, blocks, BLOCK_SIZE_BYTES);
178
179 surface->ycbcr[0].num_blocks_added++;
180 surface->ycbcr[0].stream++;
181 surface->ycbcr[0].buffer += BLOCK_SIZE_SAMPLES;
182 blocks += BLOCK_SIZE_SAMPLES;
183 }
184 }
185 }
186
187 /* TODO: Implement 422, 444 */
188 //assert(ctx->base.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
189
190 for (tb = 1; tb < 3; ++tb) {
191 if (xvmc_mb->coded_block_pattern & const_empty_block_mask_420[tb][0][0]) {
192
193 struct pipe_ycbcr_block *stream = surface->ycbcr[tb].stream;
194 stream->x = xvmc_mb->x;
195 stream->y = xvmc_mb->y;
196 stream->intra = intra;
197 stream->coding = PIPE_MPEG12_DCT_TYPE_FRAME;
198
199 memcpy(surface->ycbcr[tb].buffer, blocks, BLOCK_SIZE_BYTES);
200
201 surface->ycbcr[tb].num_blocks_added++;
202 surface->ycbcr[tb].stream++;
203 surface->ycbcr[tb].buffer += BLOCK_SIZE_SAMPLES;
204 blocks += BLOCK_SIZE_SAMPLES;
205 }
206 }
207
208 }
209
210 static void
211 MacroBlocksToPipe(XvMCSurfacePrivate *surface,
212 unsigned int xvmc_picture_structure,
213 const XvMCMacroBlock *xvmc_mb,
214 const XvMCBlockArray *xvmc_blocks,
215 unsigned int num_macroblocks)
216 {
217 unsigned int i, j;
218
219 assert(xvmc_mb);
220 assert(xvmc_blocks);
221 assert(num_macroblocks);
222
223 for (i = 0; i < num_macroblocks; ++i) {
224 unsigned mv_pos = xvmc_mb->x + surface->mv_stride * xvmc_mb->y;
225 unsigned mv_weights[2];
226
227 UploadYcbcrBlocks(surface, xvmc_mb, xvmc_blocks);
228
229 MacroBlockTypeToPipeWeights(xvmc_mb, mv_weights);
230
231 for (j = 0; j < 2; ++j) {
232 if (!surface->ref[j].mv) continue;
233
234 surface->ref[j].mv[mv_pos] = MotionVectorToPipe
235 (
236 xvmc_mb, j,
237 j ? XVMC_SELECT_FIRST_BACKWARD : XVMC_SELECT_FIRST_FORWARD,
238 mv_weights[j]
239 );
240 }
241
242 ++xvmc_mb;
243 }
244 }
245
246 static void
247 unmap_and_flush_surface(XvMCSurfacePrivate *surface)
248 {
249 struct pipe_video_buffer *ref_frames[2];
250 XvMCContextPrivate *context_priv;
251 unsigned i, num_ycbcr_blocks[3];
252
253 assert(surface);
254
255 context_priv = surface->context->privData;
256
257 for ( i = 0; i < 2; ++i ) {
258 if (surface->ref[i].surface) {
259 XvMCSurfacePrivate *ref = surface->ref[i].surface->privData;
260
261 assert(ref);
262
263 unmap_and_flush_surface(ref);
264 surface->ref[i].surface = NULL;
265 ref_frames[i] = ref->video_buffer;
266 } else {
267 ref_frames[i] = NULL;
268 }
269 }
270
271 if (surface->mapped) {
272 surface->decode_buffer->unmap(surface->decode_buffer);
273 for (i = 0; i < 3; ++i)
274 num_ycbcr_blocks[i] = surface->ycbcr[i].num_blocks_added;
275 context_priv->decoder->flush_buffer(surface->decode_buffer,
276 num_ycbcr_blocks,
277 ref_frames,
278 surface->video_buffer);
279 surface->mapped = 0;
280 }
281 }
282
283 PUBLIC
284 Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surface)
285 {
286 XvMCContextPrivate *context_priv;
287 struct pipe_video_context *vpipe;
288 XvMCSurfacePrivate *surface_priv;
289
290 XVMC_MSG(XVMC_TRACE, "[XvMC] Creating surface %p.\n", surface);
291
292 assert(dpy);
293
294 if (!context)
295 return XvMCBadContext;
296 if (!surface)
297 return XvMCBadSurface;
298
299 context_priv = context->privData;
300 vpipe = context_priv->vctx->vpipe;
301
302 surface_priv = CALLOC(1, sizeof(XvMCSurfacePrivate));
303 if (!surface_priv)
304 return BadAlloc;
305
306 surface_priv->decode_buffer = context_priv->decoder->create_buffer(context_priv->decoder);
307 surface_priv->mv_stride = surface_priv->decode_buffer->get_mv_stream_stride(surface_priv->decode_buffer);
308 surface_priv->video_buffer = vpipe->create_buffer(vpipe, PIPE_FORMAT_NV12,
309 context_priv->decoder->chroma_format,
310 context_priv->decoder->width,
311 context_priv->decoder->height);
312 surface_priv->context = context;
313
314 surface->surface_id = XAllocID(dpy);
315 surface->context_id = context->context_id;
316 surface->surface_type_id = context->surface_type_id;
317 surface->width = context->width;
318 surface->height = context->height;
319 surface->privData = surface_priv;
320
321 SyncHandle();
322
323 XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p created.\n", surface);
324
325 return Success;
326 }
327
328 PUBLIC
329 Status XvMCRenderSurface(Display *dpy, XvMCContext *context, unsigned int picture_structure,
330 XvMCSurface *target_surface, XvMCSurface *past_surface, XvMCSurface *future_surface,
331 unsigned int flags, unsigned int num_macroblocks, unsigned int first_macroblock,
332 XvMCMacroBlockArray *macroblocks, XvMCBlockArray *blocks
333 )
334 {
335 struct pipe_video_context *vpipe;
336 struct pipe_video_decode_buffer *t_buffer;
337
338 XvMCContextPrivate *context_priv;
339 XvMCSurfacePrivate *target_surface_priv;
340 XvMCSurfacePrivate *past_surface_priv;
341 XvMCSurfacePrivate *future_surface_priv;
342 XvMCMacroBlock *xvmc_mb;
343
344 unsigned i;
345
346 XVMC_MSG(XVMC_TRACE, "[XvMC] Rendering to surface %p, with past %p and future %p\n",
347 target_surface, past_surface, future_surface);
348
349 assert(dpy);
350
351 if (!context || !context->privData)
352 return XvMCBadContext;
353 if (!target_surface || !target_surface->privData)
354 return XvMCBadSurface;
355
356 if (picture_structure != XVMC_TOP_FIELD &&
357 picture_structure != XVMC_BOTTOM_FIELD &&
358 picture_structure != XVMC_FRAME_PICTURE)
359 return BadValue;
360 /* Bkwd pred equivalent to fwd (past && !future) */
361 if (future_surface && !past_surface)
362 return BadMatch;
363
364 assert(context->context_id == target_surface->context_id);
365 assert(!past_surface || context->context_id == past_surface->context_id);
366 assert(!future_surface || context->context_id == future_surface->context_id);
367
368 assert(macroblocks);
369 assert(blocks);
370
371 assert(macroblocks->context_id == context->context_id);
372 assert(blocks->context_id == context->context_id);
373
374 assert(flags == 0 || flags == XVMC_SECOND_FIELD);
375
376 target_surface_priv = target_surface->privData;
377 past_surface_priv = past_surface ? past_surface->privData : NULL;
378 future_surface_priv = future_surface ? future_surface->privData : NULL;
379
380 assert(target_surface_priv->context == context);
381 assert(!past_surface || past_surface_priv->context == context);
382 assert(!future_surface || future_surface_priv->context == context);
383
384 context_priv = context->privData;
385 vpipe = context_priv->vctx->vpipe;
386
387 t_buffer = target_surface_priv->decode_buffer;
388
389 // enshure that all reference frames are flushed
390 // not really nessasary, but speeds ups rendering
391 if (past_surface)
392 unmap_and_flush_surface(past_surface->privData);
393
394 if (future_surface)
395 unmap_and_flush_surface(future_surface->privData);
396
397 xvmc_mb = macroblocks->macro_blocks + first_macroblock;
398
399 /* If the surface we're rendering hasn't changed the ref frames shouldn't change. */
400 if (target_surface_priv->mapped && (
401 target_surface_priv->ref[0].surface != past_surface ||
402 target_surface_priv->ref[1].surface != future_surface ||
403 (xvmc_mb->x == 0 && xvmc_mb->y == 0))) {
404
405 // If they change anyway we need to clear our surface
406 unmap_and_flush_surface(target_surface_priv);
407 }
408
409 if (!target_surface_priv->mapped) {
410 t_buffer->map(t_buffer);
411
412 for (i = 0; i < 3; ++i) {
413 target_surface_priv->ycbcr[i].num_blocks_added = 0;
414 target_surface_priv->ycbcr[i].stream = t_buffer->get_ycbcr_stream(t_buffer, i);
415 target_surface_priv->ycbcr[i].buffer = t_buffer->get_ycbcr_buffer(t_buffer, i);
416 }
417
418 for (i = 0; i < 2; ++i) {
419 target_surface_priv->ref[i].surface = i == 0 ? past_surface : future_surface;
420
421 if (target_surface_priv->ref[i].surface)
422 target_surface_priv->ref[i].mv = t_buffer->get_mv_stream(t_buffer, i);
423 else
424 target_surface_priv->ref[i].mv = NULL;
425 }
426
427 target_surface_priv->mapped = 1;
428 }
429
430 MacroBlocksToPipe(target_surface_priv, picture_structure, xvmc_mb, blocks, num_macroblocks);
431
432 XVMC_MSG(XVMC_TRACE, "[XvMC] Submitted surface %p for rendering.\n", target_surface);
433
434 return Success;
435 }
436
437 PUBLIC
438 Status XvMCFlushSurface(Display *dpy, XvMCSurface *surface)
439 {
440 assert(dpy);
441
442 if (!surface)
443 return XvMCBadSurface;
444
445 // don't call flush here, because this is usually
446 // called once for every slice instead of every frame
447
448 XVMC_MSG(XVMC_TRACE, "[XvMC] Flushing surface %p\n", surface);
449
450 return Success;
451 }
452
453 PUBLIC
454 Status XvMCSyncSurface(Display *dpy, XvMCSurface *surface)
455 {
456 assert(dpy);
457
458 if (!surface)
459 return XvMCBadSurface;
460
461 XVMC_MSG(XVMC_TRACE, "[XvMC] Syncing surface %p\n", surface);
462
463 return Success;
464 }
465
466 PUBLIC
467 Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
468 short srcx, short srcy, unsigned short srcw, unsigned short srch,
469 short destx, short desty, unsigned short destw, unsigned short desth,
470 int flags)
471 {
472 static int dump_window = -1;
473
474 struct pipe_video_context *vpipe;
475 struct pipe_video_compositor *compositor;
476
477 XvMCSurfacePrivate *surface_priv;
478 XvMCContextPrivate *context_priv;
479 XvMCSubpicturePrivate *subpicture_priv;
480 XvMCContext *context;
481 struct pipe_video_rect src_rect = {srcx, srcy, srcw, srch};
482 struct pipe_video_rect dst_rect = {destx, desty, destw, desth};
483 struct pipe_surface *drawable_surface;
484
485 XVMC_MSG(XVMC_TRACE, "[XvMC] Displaying surface %p.\n", surface);
486
487 assert(dpy);
488
489 if (!surface || !surface->privData)
490 return XvMCBadSurface;
491
492 surface_priv = surface->privData;
493 context = surface_priv->context;
494 context_priv = context->privData;
495
496 drawable_surface = vl_drawable_surface_get(context_priv->vctx, drawable);
497 if (!drawable_surface)
498 return BadDrawable;
499
500 assert(flags == XVMC_TOP_FIELD || flags == XVMC_BOTTOM_FIELD || flags == XVMC_FRAME_PICTURE);
501 assert(srcx + srcw - 1 < surface->width);
502 assert(srcy + srch - 1 < surface->height);
503 /*
504 * Some apps (mplayer) hit these asserts because they call
505 * this function after the window has been resized by the WM
506 * but before they've handled the corresponding XEvent and
507 * know about the new dimensions. The output should be clipped
508 * until the app updates destw and desth.
509 */
510 /*
511 assert(destx + destw - 1 < drawable_surface->width);
512 assert(desty + desth - 1 < drawable_surface->height);
513 */
514
515 subpicture_priv = surface_priv->subpicture ? surface_priv->subpicture->privData : NULL;
516 vpipe = context_priv->vctx->vpipe;
517 compositor = context_priv->compositor;
518
519 unmap_and_flush_surface(surface_priv);
520
521 compositor->clear_layers(compositor);
522 compositor->set_buffer_layer(compositor, 0, surface_priv->video_buffer, &src_rect, NULL);
523
524 if (subpicture_priv) {
525 XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p has subpicture %p.\n", surface, surface_priv->subpicture);
526
527 assert(subpicture_priv->surface == surface);
528
529 if (subpicture_priv->palette)
530 compositor->set_palette_layer(compositor, 1, subpicture_priv->sampler, subpicture_priv->palette,
531 &subpicture_priv->src_rect, &subpicture_priv->dst_rect);
532 else
533 compositor->set_rgba_layer(compositor, 1, subpicture_priv->sampler, &src_rect, &dst_rect);
534
535 surface_priv->subpicture = NULL;
536 subpicture_priv->surface = NULL;
537 }
538
539 // Workaround for r600g, there seems to be a bug in the fence refcounting code
540 vpipe->screen->fence_reference(vpipe->screen, &surface_priv->fence, NULL);
541
542 compositor->render_picture(compositor, PictureToPipe(flags), drawable_surface, &dst_rect, &surface_priv->fence);
543
544 XVMC_MSG(XVMC_TRACE, "[XvMC] Submitted surface %p for display. Pushing to front buffer.\n", surface);
545
546 vpipe->screen->flush_frontbuffer
547 (
548 vpipe->screen,
549 drawable_surface->texture,
550 0, 0,
551 vl_contextprivate_get(context_priv->vctx, drawable_surface)
552 );
553
554 pipe_surface_reference(&drawable_surface, NULL);
555
556 if(dump_window == -1) {
557 dump_window = debug_get_num_option("XVMC_DUMP", 0);
558 }
559
560 if(dump_window) {
561 static unsigned int framenum = 0;
562 char cmd[256];
563
564 sprintf(cmd, "xwd -id %d -out xvmc_frame_%08d.xwd", (int)drawable, ++framenum);
565 if (system(cmd) != 0)
566 XVMC_MSG(XVMC_ERR, "[XvMC] Dumping surface %p failed.\n", surface);
567 }
568
569 XVMC_MSG(XVMC_TRACE, "[XvMC] Pushed surface %p to front buffer.\n", surface);
570
571 return Success;
572 }
573
574 PUBLIC
575 Status XvMCGetSurfaceStatus(Display *dpy, XvMCSurface *surface, int *status)
576 {
577 struct pipe_video_context *vpipe;
578 XvMCSurfacePrivate *surface_priv;
579 XvMCContextPrivate *context_priv;
580
581 assert(dpy);
582
583 if (!surface)
584 return XvMCBadSurface;
585
586 assert(status);
587
588 surface_priv = surface->privData;
589 context_priv = surface_priv->context->privData;
590 vpipe = context_priv->vctx->vpipe;
591
592 *status = 0;
593
594 if (surface_priv->fence)
595 if (!vpipe->screen->fence_signalled(vpipe->screen, surface_priv->fence))
596 *status |= XVMC_RENDERING;
597
598 return Success;
599 }
600
601 PUBLIC
602 Status XvMCDestroySurface(Display *dpy, XvMCSurface *surface)
603 {
604 XvMCSurfacePrivate *surface_priv;
605
606 XVMC_MSG(XVMC_TRACE, "[XvMC] Destroying surface %p.\n", surface);
607
608 assert(dpy);
609
610 if (!surface || !surface->privData)
611 return XvMCBadSurface;
612
613 surface_priv = surface->privData;
614 surface_priv->decode_buffer->destroy(surface_priv->decode_buffer);
615 surface_priv->video_buffer->destroy(surface_priv->video_buffer);
616 FREE(surface_priv);
617 surface->privData = NULL;
618
619 XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p destroyed.\n", surface);
620
621 return Success;
622 }
623
624 PUBLIC
625 Status XvMCHideSurface(Display *dpy, XvMCSurface *surface)
626 {
627 assert(dpy);
628
629 if (!surface || !surface->privData)
630 return XvMCBadSurface;
631
632 /* No op, only for overlaid rendering */
633
634 return Success;
635 }