2 #include <dix-config.h>
6 #include <X11/Xproto.h>
8 #include "Xext/xvdix_priv.h"
12 #include "dixstruct.h"
14 #include "scrnintstr.h"
15 #include "extnsionst.h"
16 #include "extinit_priv.h"
18 #include <X11/Xfuncproto.h>
19 #include <X11/extensions/XvMC.h>
20 #include <X11/extensions/Xvproto.h>
21 #include <X11/extensions/XvMCproto.h>
26 #include <sys/types.h>
28 #endif /* HAS_XVMCSHM */
30 #define SERVER_XVMC_MAJOR_VERSION 1
31 #define SERVER_XVMC_MINOR_VERSION 1
33 #define DR_CLIENT_DRIVER_NAME_SIZE 48
34 #define DR_BUSID_SIZE 48
36 static DevPrivateKeyRec XvMCScreenKeyRec
;
38 #define XvMCScreenKey (&XvMCScreenKeyRec)
39 static Bool XvMCInUse
;
44 static RESTYPE XvMCRTContext
;
45 static RESTYPE XvMCRTSurface
;
46 static RESTYPE XvMCRTSubpicture
;
50 XvMCAdaptorPtr adaptors
;
51 CloseScreenProcPtr CloseScreen
;
52 char clientDriverName
[DR_CLIENT_DRIVER_NAME_SIZE
];
53 char busID
[DR_BUSID_SIZE
];
57 } XvMCScreenRec
, *XvMCScreenPtr
;
59 #define XVMC_GET_PRIVATE(pScreen) \
60 (XvMCScreenPtr)(dixLookupPrivate(&(pScreen)->devPrivates, XvMCScreenKey))
63 XvMCDestroyContextRes(void *data
, XID id
)
65 XvMCContextPtr pContext
= (XvMCContextPtr
) data
;
69 if (!pContext
->refcnt
) {
70 XvMCScreenPtr pScreenPriv
= XVMC_GET_PRIVATE(pContext
->pScreen
);
72 (*pScreenPriv
->adaptors
[pContext
->adapt_num
].DestroyContext
) (pContext
);
80 XvMCDestroySurfaceRes(void *data
, XID id
)
82 XvMCSurfacePtr pSurface
= (XvMCSurfacePtr
) data
;
83 XvMCContextPtr pContext
= pSurface
->context
;
84 XvMCScreenPtr pScreenPriv
= XVMC_GET_PRIVATE(pContext
->pScreen
);
86 (*pScreenPriv
->adaptors
[pContext
->adapt_num
].DestroySurface
) (pSurface
);
89 XvMCDestroyContextRes((void *) pContext
, pContext
->context_id
);
95 XvMCDestroySubpictureRes(void *data
, XID id
)
97 XvMCSubpicturePtr pSubpict
= (XvMCSubpicturePtr
) data
;
98 XvMCContextPtr pContext
= pSubpict
->context
;
99 XvMCScreenPtr pScreenPriv
= XVMC_GET_PRIVATE(pContext
->pScreen
);
101 (*pScreenPriv
->adaptors
[pContext
->adapt_num
].DestroySubpicture
) (pSubpict
);
104 XvMCDestroyContextRes((void *) pContext
, pContext
->context_id
);
110 ProcXvMCQueryVersion(ClientPtr client
)
112 xvmcQueryVersionReply rep
= {
114 .sequenceNumber
= client
->sequence
,
116 .major
= SERVER_XVMC_MAJOR_VERSION
,
117 .minor
= SERVER_XVMC_MINOR_VERSION
120 /* REQUEST(xvmcQueryVersionReq); */
121 REQUEST_SIZE_MATCH(xvmcQueryVersionReq
);
123 WriteToClient(client
, sizeof(xvmcQueryVersionReply
), &rep
);
128 ProcXvMCListSurfaceTypes(ClientPtr client
)
132 XvMCScreenPtr pScreenPriv
;
133 xvmcListSurfaceTypesReply rep
;
134 xvmcSurfaceInfo info
;
135 XvMCAdaptorPtr adaptor
= NULL
;
136 XvMCSurfaceInfoPtr surface
;
139 REQUEST(xvmcListSurfaceTypesReq
);
140 REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq
);
142 VALIDATE_XV_PORT(stuff
->port
, pPort
, DixReadAccess
);
144 if (XvMCInUse
) { /* any adaptors at all */
145 ScreenPtr pScreen
= pPort
->pAdaptor
->pScreen
;
147 if ((pScreenPriv
= XVMC_GET_PRIVATE(pScreen
))) { /* any this screen */
148 for (i
= 0; i
< pScreenPriv
->num_adaptors
; i
++) {
149 if (pPort
->pAdaptor
== pScreenPriv
->adaptors
[i
].xv_adaptor
) {
150 adaptor
= &(pScreenPriv
->adaptors
[i
]);
157 num_surfaces
= (adaptor
) ? adaptor
->num_surfaces
: 0;
158 rep
= (xvmcListSurfaceTypesReply
) {
160 .sequenceNumber
= client
->sequence
,
162 .length
= bytes_to_int32(num_surfaces
* sizeof(xvmcSurfaceInfo
)),
165 WriteToClient(client
, sizeof(xvmcListSurfaceTypesReply
), &rep
);
167 for (i
= 0; i
< num_surfaces
; i
++) {
168 surface
= adaptor
->surfaces
[i
];
169 info
.surface_type_id
= surface
->surface_type_id
;
170 info
.chroma_format
= surface
->chroma_format
;
171 info
.max_width
= surface
->max_width
;
172 info
.max_height
= surface
->max_height
;
173 info
.subpicture_max_width
= surface
->subpicture_max_width
;
174 info
.subpicture_max_height
= surface
->subpicture_max_height
;
175 info
.mc_type
= surface
->mc_type
;
176 info
.flags
= surface
->flags
;
177 WriteToClient(client
, sizeof(xvmcSurfaceInfo
), &info
);
184 ProcXvMCCreateContext(ClientPtr client
)
189 int i
, result
, adapt_num
= -1;
191 XvMCContextPtr pContext
;
192 XvMCScreenPtr pScreenPriv
;
193 XvMCAdaptorPtr adaptor
= NULL
;
194 XvMCSurfaceInfoPtr surface
= NULL
;
195 xvmcCreateContextReply rep
;
197 REQUEST(xvmcCreateContextReq
);
198 REQUEST_SIZE_MATCH(xvmcCreateContextReq
);
200 VALIDATE_XV_PORT(stuff
->port
, pPort
, DixReadAccess
);
202 pScreen
= pPort
->pAdaptor
->pScreen
;
204 if (!XvMCInUse
) /* no XvMC adaptors */
207 if (!(pScreenPriv
= XVMC_GET_PRIVATE(pScreen
))) /* none this screen */
210 for (i
= 0; i
< pScreenPriv
->num_adaptors
; i
++) {
211 if (pPort
->pAdaptor
== pScreenPriv
->adaptors
[i
].xv_adaptor
) {
212 adaptor
= &(pScreenPriv
->adaptors
[i
]);
218 if (adapt_num
< 0) /* none this port */
221 for (i
= 0; i
< adaptor
->num_surfaces
; i
++) {
222 if (adaptor
->surfaces
[i
]->surface_type_id
== stuff
->surface_type_id
) {
223 surface
= adaptor
->surfaces
[i
];
228 /* adaptor doesn't support this suface_type_id */
232 if ((stuff
->width
> surface
->max_width
) ||
233 (stuff
->height
> surface
->max_height
))
236 if (!(pContext
= malloc(sizeof(XvMCContextRec
)))) {
240 pContext
->pScreen
= pScreen
;
241 pContext
->adapt_num
= adapt_num
;
242 pContext
->context_id
= stuff
->context_id
;
243 pContext
->surface_type_id
= stuff
->surface_type_id
;
244 pContext
->width
= stuff
->width
;
245 pContext
->height
= stuff
->height
;
246 pContext
->flags
= stuff
->flags
;
247 pContext
->refcnt
= 1;
249 result
= (*adaptor
->CreateContext
) (pPort
, pContext
, &dwords
, &data
);
251 if (result
!= Success
) {
255 if (!AddResource(pContext
->context_id
, XvMCRTContext
, pContext
)) {
260 rep
= (xvmcCreateContextReply
) {
262 .sequenceNumber
= client
->sequence
,
264 .width_actual
= pContext
->width
,
265 .height_actual
= pContext
->height
,
266 .flags_return
= pContext
->flags
269 WriteToClient(client
, sizeof(xvmcCreateContextReply
), &rep
);
271 WriteToClient(client
, dwords
<< 2, data
);
279 ProcXvMCDestroyContext(ClientPtr client
)
284 REQUEST(xvmcDestroyContextReq
);
285 REQUEST_SIZE_MATCH(xvmcDestroyContextReq
);
287 rc
= dixLookupResourceByType(&val
, stuff
->context_id
, XvMCRTContext
,
288 client
, DixDestroyAccess
);
292 FreeResource(stuff
->context_id
, X11_RESTYPE_NONE
);
298 ProcXvMCCreateSurface(ClientPtr client
)
303 XvMCContextPtr pContext
;
304 XvMCSurfacePtr pSurface
;
305 XvMCScreenPtr pScreenPriv
;
306 xvmcCreateSurfaceReply rep
;
308 REQUEST(xvmcCreateSurfaceReq
);
309 REQUEST_SIZE_MATCH(xvmcCreateSurfaceReq
);
311 result
= dixLookupResourceByType((void **) &pContext
, stuff
->context_id
,
312 XvMCRTContext
, client
, DixUseAccess
);
313 if (result
!= Success
)
316 pScreenPriv
= XVMC_GET_PRIVATE(pContext
->pScreen
);
318 if (!(pSurface
= malloc(sizeof(XvMCSurfaceRec
))))
321 pSurface
->surface_id
= stuff
->surface_id
;
322 pSurface
->surface_type_id
= pContext
->surface_type_id
;
323 pSurface
->context
= pContext
;
326 (*pScreenPriv
->adaptors
[pContext
->adapt_num
].CreateSurface
) (pSurface
,
330 if (result
!= Success
) {
334 if (!AddResource(pSurface
->surface_id
, XvMCRTSurface
, pSurface
)) {
339 rep
= (xvmcCreateSurfaceReply
) {
341 .sequenceNumber
= client
->sequence
,
345 WriteToClient(client
, sizeof(xvmcCreateSurfaceReply
), &rep
);
347 WriteToClient(client
, dwords
<< 2, data
);
357 ProcXvMCDestroySurface(ClientPtr client
)
362 REQUEST(xvmcDestroySurfaceReq
);
363 REQUEST_SIZE_MATCH(xvmcDestroySurfaceReq
);
365 rc
= dixLookupResourceByType(&val
, stuff
->surface_id
, XvMCRTSurface
,
366 client
, DixDestroyAccess
);
370 FreeResource(stuff
->surface_id
, X11_RESTYPE_NONE
);
376 ProcXvMCCreateSubpicture(ClientPtr client
)
378 Bool image_supported
= FALSE
;
380 int i
, result
, dwords
= 0;
381 XvMCContextPtr pContext
;
382 XvMCSubpicturePtr pSubpicture
;
383 XvMCScreenPtr pScreenPriv
;
384 xvmcCreateSubpictureReply rep
;
385 XvMCAdaptorPtr adaptor
;
386 XvMCSurfaceInfoPtr surface
= NULL
;
388 REQUEST(xvmcCreateSubpictureReq
);
389 REQUEST_SIZE_MATCH(xvmcCreateSubpictureReq
);
391 result
= dixLookupResourceByType((void **) &pContext
, stuff
->context_id
,
392 XvMCRTContext
, client
, DixUseAccess
);
393 if (result
!= Success
)
396 pScreenPriv
= XVMC_GET_PRIVATE(pContext
->pScreen
);
398 adaptor
= &(pScreenPriv
->adaptors
[pContext
->adapt_num
]);
400 /* find which surface this context supports */
401 for (i
= 0; i
< adaptor
->num_surfaces
; i
++) {
402 if (adaptor
->surfaces
[i
]->surface_type_id
== pContext
->surface_type_id
) {
403 surface
= adaptor
->surfaces
[i
];
411 /* make sure this surface supports that xvimage format */
412 if (!surface
->compatible_subpictures
)
415 for (i
= 0; i
< surface
->compatible_subpictures
->num_xvimages
; i
++) {
416 if (surface
->compatible_subpictures
->xvimage_ids
[i
] ==
418 image_supported
= TRUE
;
423 if (!image_supported
)
426 /* make sure the size is OK */
427 if ((stuff
->width
> surface
->subpicture_max_width
) ||
428 (stuff
->height
> surface
->subpicture_max_height
))
431 if (!(pSubpicture
= malloc(sizeof(XvMCSubpictureRec
))))
434 pSubpicture
->subpicture_id
= stuff
->subpicture_id
;
435 pSubpicture
->xvimage_id
= stuff
->xvimage_id
;
436 pSubpicture
->width
= stuff
->width
;
437 pSubpicture
->height
= stuff
->height
;
438 pSubpicture
->num_palette_entries
= 0; /* overwritten by DDX */
439 pSubpicture
->entry_bytes
= 0; /* overwritten by DDX */
440 pSubpicture
->component_order
[0] = 0; /* overwritten by DDX */
441 pSubpicture
->component_order
[1] = 0;
442 pSubpicture
->component_order
[2] = 0;
443 pSubpicture
->component_order
[3] = 0;
444 pSubpicture
->context
= pContext
;
447 (*pScreenPriv
->adaptors
[pContext
->adapt_num
].
448 CreateSubpicture
) (pSubpicture
, &dwords
, &data
);
450 if (result
!= Success
) {
454 if (!AddResource(pSubpicture
->subpicture_id
, XvMCRTSubpicture
, pSubpicture
)) {
459 rep
= (xvmcCreateSubpictureReply
) {
461 .sequenceNumber
= client
->sequence
,
463 .width_actual
= pSubpicture
->width
,
464 .height_actual
= pSubpicture
->height
,
465 .num_palette_entries
= pSubpicture
->num_palette_entries
,
466 .entry_bytes
= pSubpicture
->entry_bytes
,
467 .component_order
[0] = pSubpicture
->component_order
[0],
468 .component_order
[1] = pSubpicture
->component_order
[1],
469 .component_order
[2] = pSubpicture
->component_order
[2],
470 .component_order
[3] = pSubpicture
->component_order
[3]
473 WriteToClient(client
, sizeof(xvmcCreateSubpictureReply
), &rep
);
475 WriteToClient(client
, dwords
<< 2, data
);
485 ProcXvMCDestroySubpicture(ClientPtr client
)
490 REQUEST(xvmcDestroySubpictureReq
);
491 REQUEST_SIZE_MATCH(xvmcDestroySubpictureReq
);
493 rc
= dixLookupResourceByType(&val
, stuff
->subpicture_id
, XvMCRTSubpicture
,
494 client
, DixDestroyAccess
);
498 FreeResource(stuff
->subpicture_id
, X11_RESTYPE_NONE
);
504 ProcXvMCListSubpictureTypes(ClientPtr client
)
507 xvmcListSubpictureTypesReply rep
;
508 XvMCScreenPtr pScreenPriv
;
510 XvMCAdaptorPtr adaptor
= NULL
;
511 XvMCSurfaceInfoPtr surface
= NULL
;
512 xvImageFormatInfo info
;
516 REQUEST(xvmcListSubpictureTypesReq
);
517 REQUEST_SIZE_MATCH(xvmcListSubpictureTypesReq
);
519 VALIDATE_XV_PORT(stuff
->port
, pPort
, DixReadAccess
);
521 pScreen
= pPort
->pAdaptor
->pScreen
;
523 if (!dixPrivateKeyRegistered(XvMCScreenKey
))
524 return BadMatch
; /* No XvMC adaptors */
526 if (!(pScreenPriv
= XVMC_GET_PRIVATE(pScreen
)))
527 return BadMatch
; /* None this screen */
529 for (i
= 0; i
< pScreenPriv
->num_adaptors
; i
++) {
530 if (pPort
->pAdaptor
== pScreenPriv
->adaptors
[i
].xv_adaptor
) {
531 adaptor
= &(pScreenPriv
->adaptors
[i
]);
539 for (i
= 0; i
< adaptor
->num_surfaces
; i
++) {
540 if (adaptor
->surfaces
[i
]->surface_type_id
== stuff
->surface_type_id
) {
541 surface
= adaptor
->surfaces
[i
];
549 rep
= (xvmcListSubpictureTypesReply
) {
551 .sequenceNumber
= client
->sequence
,
554 if (surface
->compatible_subpictures
)
555 rep
.num
= surface
->compatible_subpictures
->num_xvimages
;
557 rep
.length
= bytes_to_int32(rep
.num
* sizeof(xvImageFormatInfo
));
559 WriteToClient(client
, sizeof(xvmcListSubpictureTypesReply
), &rep
);
561 for (i
= 0; i
< rep
.num
; i
++) {
563 for (j
= 0; j
< adaptor
->num_subpictures
; j
++) {
564 if (surface
->compatible_subpictures
->xvimage_ids
[i
] ==
565 adaptor
->subpictures
[j
]->id
) {
566 pImage
= adaptor
->subpictures
[j
];
571 return BadImplementation
;
573 info
.id
= pImage
->id
;
574 info
.type
= pImage
->type
;
575 info
.byte_order
= pImage
->byte_order
;
576 memcpy(&info
.guid
, pImage
->guid
, 16);
577 info
.bpp
= pImage
->bits_per_pixel
;
578 info
.num_planes
= pImage
->num_planes
;
579 info
.depth
= pImage
->depth
;
580 info
.red_mask
= pImage
->red_mask
;
581 info
.green_mask
= pImage
->green_mask
;
582 info
.blue_mask
= pImage
->blue_mask
;
583 info
.format
= pImage
->format
;
584 info
.y_sample_bits
= pImage
->y_sample_bits
;
585 info
.u_sample_bits
= pImage
->u_sample_bits
;
586 info
.v_sample_bits
= pImage
->v_sample_bits
;
587 info
.horz_y_period
= pImage
->horz_y_period
;
588 info
.horz_u_period
= pImage
->horz_u_period
;
589 info
.horz_v_period
= pImage
->horz_v_period
;
590 info
.vert_y_period
= pImage
->vert_y_period
;
591 info
.vert_u_period
= pImage
->vert_u_period
;
592 info
.vert_v_period
= pImage
->vert_v_period
;
593 memcpy(&info
.comp_order
, pImage
->component_order
, 32);
594 info
.scanline_order
= pImage
->scanline_order
;
595 WriteToClient(client
, sizeof(xvImageFormatInfo
), &info
);
602 ProcXvMCGetDRInfo(ClientPtr client
)
604 xvmcGetDRInfoReply rep
;
607 XvMCScreenPtr pScreenPriv
;
610 volatile CARD32
*patternP
;
613 REQUEST(xvmcGetDRInfoReq
);
614 REQUEST_SIZE_MATCH(xvmcGetDRInfoReq
);
616 VALIDATE_XV_PORT(stuff
->port
, pPort
, DixReadAccess
);
618 pScreen
= pPort
->pAdaptor
->pScreen
;
619 pScreenPriv
= XVMC_GET_PRIVATE(pScreen
);
621 rep
= (xvmcGetDRInfoReply
) {
623 .sequenceNumber
= client
->sequence
,
624 .major
= pScreenPriv
->major
,
625 .minor
= pScreenPriv
->minor
,
626 .patchLevel
= pScreenPriv
->patchLevel
,
627 .nameLen
= bytes_to_int32(strlen(pScreenPriv
->clientDriverName
) + 1),
628 .busIDLen
= bytes_to_int32(strlen(pScreenPriv
->busID
) + 1),
632 rep
.length
= rep
.nameLen
+ rep
.busIDLen
;
637 * Read back to the client what she has put in the shared memory
638 * segment she prepared for us.
642 patternP
= (CARD32
*) shmat(stuff
->shmKey
, NULL
, SHM_RDONLY
);
643 if (-1 != (long) patternP
) {
644 volatile CARD32
*patternC
= patternP
;
646 CARD32 magic
= stuff
->magic
;
649 i
= 1024 / sizeof(CARD32
);
652 if (*patternC
++ != magic
) {
658 shmdt((char *) patternP
);
660 #endif /* HAS_XVMCSHM */
662 WriteToClient(client
, sizeof(xvmcGetDRInfoReply
), &rep
);
664 WriteToClient(client
, rep
.nameLen
, pScreenPriv
->clientDriverName
);
665 WriteToClient(client
, rep
.busIDLen
, pScreenPriv
->busID
);
670 int (*ProcXvMCVector
[xvmcNumRequest
]) (ClientPtr
) = {
671 ProcXvMCQueryVersion
,
672 ProcXvMCListSurfaceTypes
,
673 ProcXvMCCreateContext
,
674 ProcXvMCDestroyContext
,
675 ProcXvMCCreateSurface
,
676 ProcXvMCDestroySurface
,
677 ProcXvMCCreateSubpicture
,
678 ProcXvMCDestroySubpicture
,
679 ProcXvMCListSubpictureTypes
, ProcXvMCGetDRInfo
};
682 ProcXvMCDispatch(ClientPtr client
)
686 if (stuff
->data
< xvmcNumRequest
)
687 return (*ProcXvMCVector
[stuff
->data
]) (client
);
693 SProcXvMCDispatch(ClientPtr client
)
695 /* We only support local */
696 return BadImplementation
;
700 XvMCExtensionInit(void)
702 ExtensionEntry
*extEntry
;
704 if (!dixPrivateKeyRegistered(XvMCScreenKey
))
707 if (!(XvMCRTContext
= CreateNewResourceType(XvMCDestroyContextRes
,
711 if (!(XvMCRTSurface
= CreateNewResourceType(XvMCDestroySurfaceRes
,
715 if (!(XvMCRTSubpicture
= CreateNewResourceType(XvMCDestroySubpictureRes
,
716 "XvMCRTSubpicture")))
719 extEntry
= AddExtension(XvMCName
, XvMCNumEvents
, XvMCNumErrors
,
720 ProcXvMCDispatch
, SProcXvMCDispatch
,
721 NULL
, StandardMinorOpcode
);
726 XvMCReqCode
= extEntry
->base
;
727 XvMCEventBase
= extEntry
->eventBase
;
728 SetResourceTypeErrorValue(XvMCRTContext
,
729 extEntry
->errorBase
+ XvMCBadContext
);
730 SetResourceTypeErrorValue(XvMCRTSurface
,
731 extEntry
->errorBase
+ XvMCBadSurface
);
732 SetResourceTypeErrorValue(XvMCRTSubpicture
,
733 extEntry
->errorBase
+ XvMCBadSubpicture
);
737 XvMCCloseScreen(ScreenPtr pScreen
)
739 XvMCScreenPtr pScreenPriv
= XVMC_GET_PRIVATE(pScreen
);
741 pScreen
->CloseScreen
= pScreenPriv
->CloseScreen
;
745 return (*pScreen
->CloseScreen
) (pScreen
);
749 XvMCScreenInit(ScreenPtr pScreen
, int num
, XvMCAdaptorPtr pAdapt
)
751 XvMCScreenPtr pScreenPriv
;
753 if (!dixRegisterPrivateKey(&XvMCScreenKeyRec
, PRIVATE_SCREEN
, 0))
756 if (!(pScreenPriv
= malloc(sizeof(XvMCScreenRec
))))
759 dixSetPrivate(&pScreen
->devPrivates
, XvMCScreenKey
, pScreenPriv
);
761 pScreenPriv
->CloseScreen
= pScreen
->CloseScreen
;
762 pScreen
->CloseScreen
= XvMCCloseScreen
;
764 pScreenPriv
->num_adaptors
= num
;
765 pScreenPriv
->adaptors
= pAdapt
;
766 pScreenPriv
->clientDriverName
[0] = 0;
767 pScreenPriv
->busID
[0] = 0;
768 pScreenPriv
->major
= 0;
769 pScreenPriv
->minor
= 0;
770 pScreenPriv
->patchLevel
= 0;
778 XvMCFindXvImage(XvPortPtr pPort
, CARD32 id
)
780 XvImagePtr pImage
= NULL
;
781 ScreenPtr pScreen
= pPort
->pAdaptor
->pScreen
;
782 XvMCScreenPtr pScreenPriv
;
783 XvMCAdaptorPtr adaptor
= NULL
;
786 if (!dixPrivateKeyRegistered(XvMCScreenKey
))
789 if (!(pScreenPriv
= XVMC_GET_PRIVATE(pScreen
)))
792 for (i
= 0; i
< pScreenPriv
->num_adaptors
; i
++) {
793 if (pPort
->pAdaptor
== pScreenPriv
->adaptors
[i
].xv_adaptor
) {
794 adaptor
= &(pScreenPriv
->adaptors
[i
]);
802 for (i
= 0; i
< adaptor
->num_subpictures
; i
++) {
803 if (adaptor
->subpictures
[i
]->id
== id
) {
804 pImage
= adaptor
->subpictures
[i
];
813 xf86XvMCRegisterDRInfo(ScreenPtr pScreen
, const char *name
,
814 const char *busID
, int major
, int minor
, int patchLevel
)
816 XvMCScreenPtr pScreenPriv
= XVMC_GET_PRIVATE(pScreen
);
818 strlcpy(pScreenPriv
->clientDriverName
, name
, DR_CLIENT_DRIVER_NAME_SIZE
);
819 strlcpy(pScreenPriv
->busID
, busID
, DR_BUSID_SIZE
);
820 pScreenPriv
->major
= major
;
821 pScreenPriv
->minor
= minor
;
822 pScreenPriv
->patchLevel
= patchLevel
;