2003-11-14 17:48:57 +01:00
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2006-02-10 23:00:30 +01:00
|
|
|
#include <string.h>
|
|
|
|
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "misc.h"
|
|
|
|
#include "os.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "dixstruct.h"
|
|
|
|
#include "resource.h"
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "extnsionst.h"
|
|
|
|
#include "servermd.h"
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/Xfuncproto.h>
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "xvdix.h"
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/XvMC.h>
|
|
|
|
#include <X11/extensions/Xvproto.h>
|
|
|
|
#include <X11/extensions/XvMCproto.h>
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "xvmcext.h"
|
2009-09-18 08:27:54 +02:00
|
|
|
#include "protocol-versions.h"
|
2004-11-23 18:29:47 +01:00
|
|
|
|
|
|
|
#ifdef HAS_XVMCSHM
|
|
|
|
#include <sys/ipc.h>
|
2004-11-24 10:07:58 +01:00
|
|
|
#include <sys/types.h>
|
2004-11-23 18:29:47 +01:00
|
|
|
#include <sys/shm.h>
|
|
|
|
#endif /* HAS_XVMCSHM */
|
|
|
|
|
|
|
|
|
2004-11-13 12:09:23 +01:00
|
|
|
|
|
|
|
#define DR_CLIENT_DRIVER_NAME_SIZE 48
|
2004-11-23 18:29:47 +01:00
|
|
|
#define DR_BUSID_SIZE 48
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
static DevPrivateKeyRec XvMCScreenKeyRec;
|
|
|
|
#define XvMCScreenKey (&XvMCScreenKeyRec)
|
|
|
|
static Bool XvMCInUse;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
unsigned long XvMCGeneration = 0;
|
|
|
|
|
|
|
|
int XvMCReqCode;
|
|
|
|
int XvMCEventBase;
|
|
|
|
|
|
|
|
unsigned long XvMCRTContext;
|
|
|
|
unsigned long XvMCRTSurface;
|
|
|
|
unsigned long XvMCRTSubpicture;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int num_adaptors;
|
|
|
|
XvMCAdaptorPtr adaptors;
|
|
|
|
CloseScreenProcPtr CloseScreen;
|
2004-11-13 12:09:23 +01:00
|
|
|
char clientDriverName[DR_CLIENT_DRIVER_NAME_SIZE];
|
|
|
|
char busID[DR_BUSID_SIZE];
|
|
|
|
int major;
|
|
|
|
int minor;
|
|
|
|
int patchLevel;
|
2003-11-14 17:48:57 +01:00
|
|
|
} XvMCScreenRec, *XvMCScreenPtr;
|
|
|
|
|
|
|
|
#define XVMC_GET_PRIVATE(pScreen) \
|
2007-08-28 15:28:25 +02:00
|
|
|
(XvMCScreenPtr)(dixLookupPrivate(&(pScreen)->devPrivates, XvMCScreenKey))
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
XvMCDestroyContextRes(pointer data, XID id)
|
|
|
|
{
|
|
|
|
XvMCContextPtr pContext = (XvMCContextPtr)data;
|
|
|
|
|
|
|
|
pContext->refcnt--;
|
|
|
|
|
|
|
|
if(!pContext->refcnt) {
|
|
|
|
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
|
|
|
|
(*pScreenPriv->adaptors[pContext->adapt_num].DestroyContext)(pContext);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pContext);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
XvMCDestroySurfaceRes(pointer data, XID id)
|
|
|
|
{
|
|
|
|
XvMCSurfacePtr pSurface = (XvMCSurfacePtr)data;
|
|
|
|
XvMCContextPtr pContext = pSurface->context;
|
|
|
|
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
|
|
|
|
|
|
|
|
(*pScreenPriv->adaptors[pContext->adapt_num].DestroySurface)(pSurface);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pSurface);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
XvMCDestroyContextRes((pointer)pContext, pContext->context_id);
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
XvMCDestroySubpictureRes(pointer data, XID id)
|
|
|
|
{
|
|
|
|
XvMCSubpicturePtr pSubpict = (XvMCSubpicturePtr)data;
|
|
|
|
XvMCContextPtr pContext = pSubpict->context;
|
|
|
|
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
|
|
|
|
|
|
|
|
(*pScreenPriv->adaptors[pContext->adapt_num].DestroySubpicture)(pSubpict);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pSubpict);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
XvMCDestroyContextRes((pointer)pContext, pContext->context_id);
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCQueryVersion(ClientPtr client)
|
|
|
|
{
|
|
|
|
xvmcQueryVersionReply rep;
|
|
|
|
/* REQUEST(xvmcQueryVersionReq); */
|
|
|
|
REQUEST_SIZE_MATCH(xvmcQueryVersionReq);
|
|
|
|
rep.type = X_Reply;
|
|
|
|
rep.sequenceNumber = client->sequence;
|
|
|
|
rep.length = 0;
|
2009-09-18 08:27:54 +02:00
|
|
|
rep.major = SERVER_XVMC_MAJOR_VERSION;
|
|
|
|
rep.minor = SERVER_XVMC_MINOR_VERSION;
|
2003-11-14 17:48:57 +01:00
|
|
|
WriteToClient(client, sizeof(xvmcQueryVersionReply), (char*)&rep);
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCListSurfaceTypes(ClientPtr client)
|
|
|
|
{
|
|
|
|
XvPortPtr pPort;
|
|
|
|
int i;
|
|
|
|
XvMCScreenPtr pScreenPriv;
|
|
|
|
xvmcListSurfaceTypesReply rep;
|
|
|
|
xvmcSurfaceInfo info;
|
|
|
|
XvMCAdaptorPtr adaptor = NULL;
|
|
|
|
XvMCSurfaceInfoPtr surface;
|
|
|
|
REQUEST(xvmcListSurfaceTypesReq);
|
|
|
|
REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
|
|
|
|
|
2009-04-29 07:04:37 +02:00
|
|
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
if(XvMCInUse) { /* any adaptors at all */
|
2003-11-14 17:48:57 +01:00
|
|
|
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
|
|
|
|
if((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
|
|
|
|
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
|
|
|
|
if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
|
|
|
|
adaptor = &(pScreenPriv->adaptors[i]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rep.type = X_Reply;
|
|
|
|
rep.sequenceNumber = client->sequence;
|
|
|
|
rep.num = (adaptor) ? adaptor->num_surfaces : 0;
|
2009-07-06 04:20:21 +02:00
|
|
|
rep.length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo));
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), (char*)&rep);
|
|
|
|
|
|
|
|
for(i = 0; i < rep.num; i++) {
|
|
|
|
surface = adaptor->surfaces[i];
|
|
|
|
info.surface_type_id = surface->surface_type_id;
|
|
|
|
info.chroma_format = surface->chroma_format;
|
|
|
|
info.max_width = surface->max_width;
|
|
|
|
info.max_height = surface->max_height;
|
|
|
|
info.subpicture_max_width = surface->subpicture_max_width;
|
|
|
|
info.subpicture_max_height = surface->subpicture_max_height;
|
|
|
|
info.mc_type = surface->mc_type;
|
|
|
|
info.flags = surface->flags;
|
|
|
|
WriteToClient(client, sizeof(xvmcSurfaceInfo), (char*)&info);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCCreateContext(ClientPtr client)
|
|
|
|
{
|
|
|
|
XvPortPtr pPort;
|
|
|
|
CARD32 *data = NULL;
|
|
|
|
int dwords = 0;
|
|
|
|
int i, result, adapt_num = -1;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
XvMCContextPtr pContext;
|
|
|
|
XvMCScreenPtr pScreenPriv;
|
|
|
|
XvMCAdaptorPtr adaptor = NULL;
|
|
|
|
XvMCSurfaceInfoPtr surface = NULL;
|
|
|
|
xvmcCreateContextReply rep;
|
|
|
|
REQUEST(xvmcCreateContextReq);
|
|
|
|
REQUEST_SIZE_MATCH(xvmcCreateContextReq);
|
|
|
|
|
2009-04-29 07:04:37 +02:00
|
|
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pScreen = pPort->pAdaptor->pScreen;
|
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
if(!XvMCInUse) /* no XvMC adaptors */
|
2003-11-14 17:48:57 +01:00
|
|
|
return BadMatch;
|
|
|
|
|
|
|
|
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
|
|
|
|
return BadMatch;
|
|
|
|
|
|
|
|
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
|
|
|
|
if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
|
|
|
|
adaptor = &(pScreenPriv->adaptors[i]);
|
|
|
|
adapt_num = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(adapt_num < 0) /* none this port */
|
|
|
|
return BadMatch;
|
|
|
|
|
|
|
|
for(i = 0; i < adaptor->num_surfaces; i++) {
|
|
|
|
if(adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) {
|
|
|
|
surface = adaptor->surfaces[i];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* adaptor doesn't support this suface_type_id */
|
|
|
|
if(!surface) return BadMatch;
|
|
|
|
|
|
|
|
|
|
|
|
if((stuff->width > surface->max_width) ||
|
|
|
|
(stuff->height > surface->max_height))
|
|
|
|
return BadValue;
|
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
if(!(pContext = malloc(sizeof(XvMCContextRec)))) {
|
2003-11-14 17:48:57 +01:00
|
|
|
return BadAlloc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pContext->pScreen = pScreen;
|
|
|
|
pContext->adapt_num = adapt_num;
|
|
|
|
pContext->context_id = stuff->context_id;
|
|
|
|
pContext->surface_type_id = stuff->surface_type_id;
|
|
|
|
pContext->width = stuff->width;
|
|
|
|
pContext->height = stuff->height;
|
|
|
|
pContext->flags = stuff->flags;
|
|
|
|
pContext->refcnt = 1;
|
|
|
|
|
|
|
|
result = (*adaptor->CreateContext)(pPort, pContext, &dwords, &data);
|
|
|
|
|
|
|
|
if(result != Success) {
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pContext);
|
2003-11-14 17:48:57 +01:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
rep.type = X_Reply;
|
|
|
|
rep.sequenceNumber = client->sequence;
|
|
|
|
rep.width_actual = pContext->width;
|
|
|
|
rep.height_actual = pContext->height;
|
|
|
|
rep.flags_return = pContext->flags;
|
|
|
|
rep.length = dwords;
|
|
|
|
|
|
|
|
WriteToClient(client, sizeof(xvmcCreateContextReply), (char*)&rep);
|
|
|
|
if(dwords)
|
|
|
|
WriteToClient(client, dwords << 2, (char*)data);
|
|
|
|
AddResource(pContext->context_id, XvMCRTContext, pContext);
|
|
|
|
|
2010-06-06 10:28:30 +02:00
|
|
|
free(data);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCDestroyContext(ClientPtr client)
|
|
|
|
{
|
2009-04-29 07:04:37 +02:00
|
|
|
pointer val;
|
|
|
|
int rc;
|
2003-11-14 17:48:57 +01:00
|
|
|
REQUEST(xvmcDestroyContextReq);
|
|
|
|
REQUEST_SIZE_MATCH(xvmcDestroyContextReq);
|
|
|
|
|
2009-04-29 07:04:37 +02:00
|
|
|
rc = dixLookupResourceByType(&val, stuff->context_id, XvMCRTContext,
|
|
|
|
client, DixDestroyAccess);
|
|
|
|
if (rc != Success)
|
2010-04-25 08:56:36 +02:00
|
|
|
return rc;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
FreeResource(stuff->context_id, RT_NONE);
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCCreateSurface(ClientPtr client)
|
|
|
|
{
|
|
|
|
CARD32 *data = NULL;
|
|
|
|
int dwords = 0;
|
|
|
|
int result;
|
|
|
|
XvMCContextPtr pContext;
|
|
|
|
XvMCSurfacePtr pSurface;
|
|
|
|
XvMCScreenPtr pScreenPriv;
|
|
|
|
xvmcCreateSurfaceReply rep;
|
|
|
|
REQUEST(xvmcCreateSurfaceReq);
|
|
|
|
REQUEST_SIZE_MATCH(xvmcCreateSurfaceReq);
|
|
|
|
|
2009-04-29 07:04:37 +02:00
|
|
|
result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id,
|
|
|
|
XvMCRTContext, client, DixUseAccess);
|
|
|
|
if (result != Success)
|
2010-04-25 08:56:36 +02:00
|
|
|
return result;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
|
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
if(!(pSurface = malloc(sizeof(XvMCSurfaceRec))))
|
2003-11-14 17:48:57 +01:00
|
|
|
return BadAlloc;
|
|
|
|
|
|
|
|
pSurface->surface_id = stuff->surface_id;
|
|
|
|
pSurface->surface_type_id = pContext->surface_type_id;
|
|
|
|
pSurface->context = pContext;
|
|
|
|
|
|
|
|
result = (*pScreenPriv->adaptors[pContext->adapt_num].CreateSurface)(
|
|
|
|
pSurface, &dwords, &data);
|
|
|
|
|
|
|
|
if(result != Success) {
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pSurface);
|
2003-11-14 17:48:57 +01:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
rep.type = X_Reply;
|
|
|
|
rep.sequenceNumber = client->sequence;
|
|
|
|
rep.length = dwords;
|
|
|
|
|
|
|
|
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), (char*)&rep);
|
|
|
|
if(dwords)
|
|
|
|
WriteToClient(client, dwords << 2, (char*)data);
|
|
|
|
AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
|
|
|
|
|
2010-06-06 10:28:30 +02:00
|
|
|
free(data);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pContext->refcnt++;
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCDestroySurface(ClientPtr client)
|
|
|
|
{
|
2009-04-29 07:04:37 +02:00
|
|
|
pointer val;
|
|
|
|
int rc;
|
2003-11-14 17:48:57 +01:00
|
|
|
REQUEST(xvmcDestroySurfaceReq);
|
|
|
|
REQUEST_SIZE_MATCH(xvmcDestroySurfaceReq);
|
|
|
|
|
2009-04-29 07:04:37 +02:00
|
|
|
rc = dixLookupResourceByType(&val, stuff->surface_id, XvMCRTSurface,
|
|
|
|
client, DixDestroyAccess);
|
|
|
|
if (rc != Success)
|
2010-04-25 08:56:36 +02:00
|
|
|
return rc;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
FreeResource(stuff->surface_id, RT_NONE);
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCCreateSubpicture(ClientPtr client)
|
|
|
|
{
|
|
|
|
Bool image_supported = FALSE;
|
|
|
|
CARD32 *data = NULL;
|
|
|
|
int i, result, dwords = 0;
|
|
|
|
XvMCContextPtr pContext;
|
|
|
|
XvMCSubpicturePtr pSubpicture;
|
|
|
|
XvMCScreenPtr pScreenPriv;
|
|
|
|
xvmcCreateSubpictureReply rep;
|
|
|
|
XvMCAdaptorPtr adaptor;
|
|
|
|
XvMCSurfaceInfoPtr surface = NULL;
|
|
|
|
REQUEST(xvmcCreateSubpictureReq);
|
|
|
|
REQUEST_SIZE_MATCH(xvmcCreateSubpictureReq);
|
|
|
|
|
2009-04-29 07:04:37 +02:00
|
|
|
result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id,
|
|
|
|
XvMCRTContext, client, DixUseAccess);
|
|
|
|
if (result != Success)
|
2010-04-25 08:56:36 +02:00
|
|
|
return result;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
|
|
|
|
|
|
|
|
adaptor = &(pScreenPriv->adaptors[pContext->adapt_num]);
|
|
|
|
|
|
|
|
/* find which surface this context supports */
|
|
|
|
for(i = 0; i < adaptor->num_surfaces; i++) {
|
|
|
|
if(adaptor->surfaces[i]->surface_type_id == pContext->surface_type_id){
|
|
|
|
surface = adaptor->surfaces[i];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!surface) return BadMatch;
|
|
|
|
|
|
|
|
/* make sure this surface supports that xvimage format */
|
|
|
|
if(!surface->compatible_subpictures) return BadMatch;
|
|
|
|
|
|
|
|
for(i = 0; i < surface->compatible_subpictures->num_xvimages; i++) {
|
|
|
|
if(surface->compatible_subpictures->xvimage_ids[i] == stuff->xvimage_id) {
|
|
|
|
image_supported = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!image_supported) return BadMatch;
|
|
|
|
|
|
|
|
/* make sure the size is OK */
|
|
|
|
if((stuff->width > surface->subpicture_max_width) ||
|
|
|
|
(stuff->height > surface->subpicture_max_height))
|
|
|
|
return BadValue;
|
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
if(!(pSubpicture = malloc(sizeof(XvMCSubpictureRec))))
|
2003-11-14 17:48:57 +01:00
|
|
|
return BadAlloc;
|
|
|
|
|
|
|
|
pSubpicture->subpicture_id = stuff->subpicture_id;
|
|
|
|
pSubpicture->xvimage_id = stuff->xvimage_id;
|
|
|
|
pSubpicture->width = stuff->width;
|
|
|
|
pSubpicture->height = stuff->height;
|
|
|
|
pSubpicture->num_palette_entries = 0; /* overwritten by DDX */
|
|
|
|
pSubpicture->entry_bytes = 0; /* overwritten by DDX */
|
|
|
|
pSubpicture->component_order[0] = 0; /* overwritten by DDX */
|
|
|
|
pSubpicture->component_order[1] = 0;
|
|
|
|
pSubpicture->component_order[2] = 0;
|
|
|
|
pSubpicture->component_order[3] = 0;
|
|
|
|
pSubpicture->context = pContext;
|
|
|
|
|
|
|
|
result = (*pScreenPriv->adaptors[pContext->adapt_num].CreateSubpicture)(
|
|
|
|
pSubpicture, &dwords, &data);
|
|
|
|
|
|
|
|
if(result != Success) {
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pSubpicture);
|
2003-11-14 17:48:57 +01:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
rep.type = X_Reply;
|
|
|
|
rep.sequenceNumber = client->sequence;
|
|
|
|
rep.width_actual = pSubpicture->width;
|
|
|
|
rep.height_actual = pSubpicture->height;
|
|
|
|
rep.num_palette_entries = pSubpicture->num_palette_entries;
|
|
|
|
rep.entry_bytes = pSubpicture->entry_bytes;
|
|
|
|
rep.component_order[0] = pSubpicture->component_order[0];
|
|
|
|
rep.component_order[1] = pSubpicture->component_order[1];
|
|
|
|
rep.component_order[2] = pSubpicture->component_order[2];
|
|
|
|
rep.component_order[3] = pSubpicture->component_order[3];
|
|
|
|
rep.length = dwords;
|
|
|
|
|
|
|
|
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), (char*)&rep);
|
|
|
|
if(dwords)
|
|
|
|
WriteToClient(client, dwords << 2, (char*)data);
|
|
|
|
AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
|
|
|
|
|
2010-06-06 10:28:30 +02:00
|
|
|
free(data);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pContext->refcnt++;
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCDestroySubpicture(ClientPtr client)
|
|
|
|
{
|
2009-04-29 07:04:37 +02:00
|
|
|
pointer val;
|
|
|
|
int rc;
|
2003-11-14 17:48:57 +01:00
|
|
|
REQUEST(xvmcDestroySubpictureReq);
|
|
|
|
REQUEST_SIZE_MATCH(xvmcDestroySubpictureReq);
|
|
|
|
|
2009-04-29 07:04:37 +02:00
|
|
|
rc = dixLookupResourceByType(&val, stuff->subpicture_id, XvMCRTSubpicture,
|
|
|
|
client, DixDestroyAccess);
|
|
|
|
if (rc != Success)
|
2010-04-25 08:56:36 +02:00
|
|
|
return rc;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
FreeResource(stuff->subpicture_id, RT_NONE);
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCListSubpictureTypes(ClientPtr client)
|
|
|
|
{
|
|
|
|
XvPortPtr pPort;
|
|
|
|
xvmcListSubpictureTypesReply rep;
|
|
|
|
XvMCScreenPtr pScreenPriv;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
XvMCAdaptorPtr adaptor = NULL;
|
|
|
|
XvMCSurfaceInfoPtr surface = NULL;
|
|
|
|
xvImageFormatInfo info;
|
|
|
|
XvImagePtr pImage;
|
|
|
|
int i, j;
|
|
|
|
REQUEST(xvmcListSubpictureTypesReq);
|
|
|
|
REQUEST_SIZE_MATCH(xvmcListSubpictureTypesReq);
|
|
|
|
|
2009-04-29 07:04:37 +02:00
|
|
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pScreen = pPort->pAdaptor->pScreen;
|
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
if(XvMCScreenKey == NULL) /* No XvMC adaptors */
|
2003-11-14 17:48:57 +01:00
|
|
|
return BadMatch;
|
|
|
|
|
|
|
|
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
|
|
|
return BadMatch; /* None this screen */
|
|
|
|
|
|
|
|
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
|
|
|
|
if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
|
|
|
|
adaptor = &(pScreenPriv->adaptors[i]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!adaptor) return BadMatch;
|
|
|
|
|
|
|
|
for(i = 0; i < adaptor->num_surfaces; i++) {
|
|
|
|
if(adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) {
|
|
|
|
surface = adaptor->surfaces[i];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!surface) return BadMatch;
|
|
|
|
|
|
|
|
rep.type = X_Reply;
|
|
|
|
rep.sequenceNumber = client->sequence;
|
|
|
|
rep.num = 0;
|
|
|
|
if(surface->compatible_subpictures)
|
|
|
|
rep.num = surface->compatible_subpictures->num_xvimages;
|
|
|
|
|
2009-07-06 04:20:21 +02:00
|
|
|
rep.length = bytes_to_int32(rep.num * sizeof(xvImageFormatInfo));
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), (char*)&rep);
|
|
|
|
|
|
|
|
for(i = 0; i < rep.num; i++) {
|
|
|
|
pImage = NULL;
|
|
|
|
for(j = 0; j < adaptor->num_subpictures; j++) {
|
|
|
|
if(surface->compatible_subpictures->xvimage_ids[i] ==
|
|
|
|
adaptor->subpictures[j]->id)
|
|
|
|
{
|
|
|
|
pImage = adaptor->subpictures[j];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!pImage) return BadImplementation;
|
|
|
|
|
|
|
|
info.id = pImage->id;
|
|
|
|
info.type = pImage->type;
|
|
|
|
info.byte_order = pImage->byte_order;
|
|
|
|
memcpy(&info.guid, pImage->guid, 16);
|
|
|
|
info.bpp = pImage->bits_per_pixel;
|
|
|
|
info.num_planes = pImage->num_planes;
|
|
|
|
info.depth = pImage->depth;
|
|
|
|
info.red_mask = pImage->red_mask;
|
|
|
|
info.green_mask = pImage->green_mask;
|
|
|
|
info.blue_mask = pImage->blue_mask;
|
|
|
|
info.format = pImage->format;
|
|
|
|
info.y_sample_bits = pImage->y_sample_bits;
|
|
|
|
info.u_sample_bits = pImage->u_sample_bits;
|
|
|
|
info.v_sample_bits = pImage->v_sample_bits;
|
|
|
|
info.horz_y_period = pImage->horz_y_period;
|
|
|
|
info.horz_u_period = pImage->horz_u_period;
|
|
|
|
info.horz_v_period = pImage->horz_v_period;
|
|
|
|
info.vert_y_period = pImage->vert_y_period;
|
|
|
|
info.vert_u_period = pImage->vert_u_period;
|
|
|
|
info.vert_v_period = pImage->vert_v_period;
|
|
|
|
memcpy(&info.comp_order, pImage->component_order, 32);
|
|
|
|
info.scanline_order = pImage->scanline_order;
|
|
|
|
WriteToClient(client, sizeof(xvImageFormatInfo), (char*)&info);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2004-11-13 12:09:23 +01:00
|
|
|
static int
|
|
|
|
ProcXvMCGetDRInfo(ClientPtr client)
|
|
|
|
{
|
|
|
|
xvmcGetDRInfoReply rep;
|
|
|
|
XvPortPtr pPort;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
XvMCScreenPtr pScreenPriv;
|
2004-11-23 18:29:47 +01:00
|
|
|
|
|
|
|
#ifdef HAS_XVMCSHM
|
2004-11-13 12:09:23 +01:00
|
|
|
volatile CARD32 *patternP;
|
2004-11-23 18:29:47 +01:00
|
|
|
#endif
|
2004-11-13 12:09:23 +01:00
|
|
|
|
|
|
|
REQUEST(xvmcGetDRInfoReq);
|
|
|
|
REQUEST_SIZE_MATCH(xvmcGetDRInfoReq);
|
|
|
|
|
2009-04-29 07:04:37 +02:00
|
|
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
2004-11-13 12:09:23 +01:00
|
|
|
|
|
|
|
pScreen = pPort->pAdaptor->pScreen;
|
|
|
|
pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
|
|
|
|
|
|
|
rep.type = X_Reply;
|
|
|
|
rep.sequenceNumber = client->sequence;
|
|
|
|
rep.major = pScreenPriv->major;
|
|
|
|
rep.minor = pScreenPriv->minor;
|
|
|
|
rep.patchLevel = pScreenPriv->patchLevel;
|
2009-07-06 04:20:21 +02:00
|
|
|
rep.nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1);
|
|
|
|
rep.busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1);
|
2004-11-13 12:09:23 +01:00
|
|
|
|
|
|
|
rep.length = rep.nameLen + rep.busIDLen;
|
|
|
|
rep.nameLen <<=2;
|
|
|
|
rep.busIDLen <<=2;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Read back to the client what she has put in the shared memory
|
|
|
|
* segment she prepared for us.
|
|
|
|
*/
|
|
|
|
|
2004-11-23 18:29:47 +01:00
|
|
|
rep.isLocal = 1;
|
|
|
|
#ifdef HAS_XVMCSHM
|
|
|
|
patternP = (CARD32 *)shmat( stuff->shmKey, NULL, SHM_RDONLY );
|
|
|
|
if ( -1 != (long) patternP) {
|
2007-11-21 06:29:31 +01:00
|
|
|
volatile CARD32 *patternC = patternP;
|
|
|
|
int i;
|
2004-11-13 12:09:23 +01:00
|
|
|
CARD32 magic = stuff->magic;
|
|
|
|
|
|
|
|
rep.isLocal = 1;
|
2004-11-23 18:29:47 +01:00
|
|
|
i = 1024 / sizeof(CARD32);
|
2004-11-13 12:09:23 +01:00
|
|
|
|
|
|
|
while ( i-- ) {
|
|
|
|
if (*patternC++ != magic) {
|
|
|
|
rep.isLocal = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
magic = ~magic;
|
|
|
|
}
|
2004-11-23 18:29:47 +01:00
|
|
|
shmdt( (char *)patternP );
|
2004-11-13 12:09:23 +01:00
|
|
|
}
|
2004-11-23 18:29:47 +01:00
|
|
|
#endif /* HAS_XVMCSHM */
|
|
|
|
|
2004-11-13 12:09:23 +01:00
|
|
|
WriteToClient(client, sizeof(xvmcGetDRInfoReply),
|
|
|
|
(char*)&rep);
|
|
|
|
if (rep.length) {
|
|
|
|
WriteToClient(client, rep.nameLen,
|
|
|
|
pScreenPriv->clientDriverName);
|
|
|
|
WriteToClient(client, rep.busIDLen,
|
|
|
|
pScreenPriv->busID);
|
|
|
|
}
|
|
|
|
return Success;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
int (*ProcXvMCVector[xvmcNumRequest])(ClientPtr) = {
|
|
|
|
ProcXvMCQueryVersion,
|
|
|
|
ProcXvMCListSurfaceTypes,
|
|
|
|
ProcXvMCCreateContext,
|
|
|
|
ProcXvMCDestroyContext,
|
|
|
|
ProcXvMCCreateSurface,
|
|
|
|
ProcXvMCDestroySurface,
|
|
|
|
ProcXvMCCreateSubpicture,
|
|
|
|
ProcXvMCDestroySubpicture,
|
2004-11-13 12:09:23 +01:00
|
|
|
ProcXvMCListSubpictureTypes,
|
|
|
|
ProcXvMCGetDRInfo
|
2003-11-14 17:48:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcXvMCDispatch (ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
|
|
|
|
|
|
|
if(stuff->data < xvmcNumRequest)
|
|
|
|
return (*ProcXvMCVector[stuff->data])(client);
|
|
|
|
else
|
|
|
|
return BadRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXvMCDispatch (ClientPtr client)
|
|
|
|
{
|
|
|
|
/* We only support local */
|
|
|
|
return BadImplementation;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2007-04-09 23:33:15 +02:00
|
|
|
XvMCExtensionInit(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
ExtensionEntry *extEntry;
|
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
if(XvMCScreenKey == NULL) /* nobody supports it */
|
2003-11-14 17:48:57 +01:00
|
|
|
return;
|
|
|
|
|
2009-12-03 02:43:01 +01:00
|
|
|
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes,
|
|
|
|
"XvMCRTContext")))
|
2003-11-14 17:48:57 +01:00
|
|
|
return;
|
|
|
|
|
2009-12-03 02:43:01 +01:00
|
|
|
if(!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes,
|
|
|
|
"XvMCRTSurface")))
|
2003-11-14 17:48:57 +01:00
|
|
|
return;
|
|
|
|
|
2009-12-03 02:43:01 +01:00
|
|
|
if(!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes,
|
|
|
|
"XvMCRTSubpicture")))
|
2003-11-14 17:48:57 +01:00
|
|
|
return;
|
|
|
|
|
|
|
|
extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors,
|
|
|
|
ProcXvMCDispatch, SProcXvMCDispatch,
|
2008-07-24 20:59:14 +02:00
|
|
|
NULL, StandardMinorOpcode);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
if(!extEntry) return;
|
|
|
|
|
|
|
|
XvMCReqCode = extEntry->base;
|
|
|
|
XvMCEventBase = extEntry->eventBase;
|
2010-04-25 08:56:36 +02:00
|
|
|
SetResourceTypeErrorValue(XvMCRTContext, extEntry->errorBase + XvMCBadContext);
|
|
|
|
SetResourceTypeErrorValue(XvMCRTSurface, extEntry->errorBase + XvMCBadSurface);
|
|
|
|
SetResourceTypeErrorValue(XvMCRTSubpicture, extEntry->errorBase + XvMCBadSubpicture);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
XvMCCloseScreen (int i, ScreenPtr pScreen)
|
|
|
|
{
|
|
|
|
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
|
|
|
|
|
|
|
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pScreenPriv);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
return (*pScreen->CloseScreen)(i, pScreen);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:48:57 +01:00
|
|
|
XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
|
|
|
|
{
|
|
|
|
XvMCScreenPtr pScreenPriv;
|
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
if (!dixRegisterPrivateKey(&XvMCScreenKeyRec, PRIVATE_SCREEN, 0))
|
|
|
|
return BadAlloc;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
if(!(pScreenPriv = malloc(sizeof(XvMCScreenRec))))
|
2003-11-14 17:48:57 +01:00
|
|
|
return BadAlloc;
|
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
|
|
|
pScreen->CloseScreen = XvMCCloseScreen;
|
|
|
|
|
|
|
|
pScreenPriv->num_adaptors = num;
|
|
|
|
pScreenPriv->adaptors = pAdapt;
|
2004-11-13 12:09:23 +01:00
|
|
|
pScreenPriv->clientDriverName[0] = 0;
|
|
|
|
pScreenPriv->busID[0] = 0;
|
|
|
|
pScreenPriv->major = 0;
|
|
|
|
pScreenPriv->minor = 0;
|
|
|
|
pScreenPriv->patchLevel = 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
XvMCInUse = TRUE;
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
XvImagePtr pImage = NULL;
|
|
|
|
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
|
|
|
|
XvMCScreenPtr pScreenPriv;
|
|
|
|
XvMCAdaptorPtr adaptor = NULL;
|
|
|
|
int i;
|
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
if(XvMCScreenKey == NULL) return NULL;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
|
|
|
|
if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
|
|
|
|
adaptor = &(pScreenPriv->adaptors[i]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!adaptor) return NULL;
|
|
|
|
|
|
|
|
for(i = 0; i < adaptor->num_subpictures; i++) {
|
|
|
|
if(adaptor->subpictures[i]->id == id) {
|
|
|
|
pImage = adaptor->subpictures[i];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return pImage;
|
|
|
|
}
|
2004-11-13 12:09:23 +01:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2004-11-13 12:09:23 +01:00
|
|
|
xf86XvMCRegisterDRInfo(ScreenPtr pScreen, char *name,
|
|
|
|
char *busID, int major, int minor,
|
|
|
|
int patchLevel)
|
|
|
|
{
|
|
|
|
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
|
|
|
strncpy(pScreenPriv->clientDriverName, name,
|
|
|
|
DR_CLIENT_DRIVER_NAME_SIZE);
|
|
|
|
strncpy(pScreenPriv->busID, busID, DR_BUSID_SIZE);
|
|
|
|
pScreenPriv->major = major;
|
|
|
|
pScreenPriv->minor = minor;
|
|
|
|
pScreenPriv->patchLevel = patchLevel;
|
|
|
|
pScreenPriv->clientDriverName[DR_CLIENT_DRIVER_NAME_SIZE-1] = 0;
|
|
|
|
pScreenPriv->busID[DR_BUSID_SIZE-1] = 0;
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|