a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/*
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * Copyright (c) 2001 by The XFree86 Project, Inc.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync *
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * Permission is hereby granted, free of charge, to any person obtaining a
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * copy of this software and associated documentation files (the "Software"),
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * to deal in the Software without restriction, including without limitation
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * and/or sell copies of the Software, and to permit persons to whom the
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * Software is furnished to do so, subject to the following conditions:
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync *
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * The above copyright notice and this permission notice shall be included in
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * all copies or substantial portions of the Software.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync *
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * OTHER DEALINGS IN THE SOFTWARE.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync *
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * Except as contained in this notice, the name of the copyright holder(s)
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * and author(s) shall not be used in advertising or otherwise to promote
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * the sale, use or other dealings in this Software without prior written
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * authorization from the copyright holder(s) and author(s).
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#ifndef _XF86XVMC_H
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#define _XF86XVMC_H
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#include "xvmcext.h"
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#include "xf86xv.h"
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef struct {
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int num_xvimages;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int *xvimage_ids; /* reference the subpictures in the XF86MCAdaptorRec */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync} XF86MCImageIDList;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef struct {
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int surface_type_id; /* Driver generated. Must be unique on the port */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int chroma_format;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int color_description; /* no longer used */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync unsigned short max_width;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync unsigned short max_height;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync unsigned short subpicture_max_width;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync unsigned short subpicture_max_height;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int mc_type;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int flags;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XF86MCImageIDList *compatible_subpictures; /* can be null, if none */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync} XF86MCSurfaceInfoRec, *XF86MCSurfaceInfoPtr;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/*
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCCreateContextProc
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync DIX will fill everything out in the context except the driver_priv.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync The port_priv holds the private data specified for the port when
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync Xv was initialized by the driver.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync The driver may store whatever it wants in driver_priv and edit
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync the width, height and flags. If the driver wants to return something
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync to the client it can allocate space in priv and specify the number
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync of 32 bit words in num_priv. This must be dynamically allocated
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync space because DIX will free it after it passes it to the client.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync*/
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef int (*xf86XvMCCreateContextProcPtr) (ScrnInfoPtr pScrn,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XvMCContextPtr context,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int *num_priv, CARD32 **priv);
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef void (*xf86XvMCDestroyContextProcPtr) (ScrnInfoPtr pScrn,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XvMCContextPtr context);
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/*
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCCreateSurfaceProc
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync DIX will fill everything out in the surface except the driver_priv.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync The driver may store whatever it wants in driver_priv. The driver
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync may pass data back to the client in the same manner as the
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCCreateContextProc.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync*/
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef int (*xf86XvMCCreateSurfaceProcPtr) (ScrnInfoPtr pScrn,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XvMCSurfacePtr surface,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int *num_priv, CARD32 **priv);
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef void (*xf86XvMCDestroySurfaceProcPtr) (ScrnInfoPtr pScrn,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XvMCSurfacePtr surface);
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/*
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCCreateSubpictureProc
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync DIX will fill everything out in the subpicture except the driver_priv,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync num_palette_entries, entry_bytes and component_order. The driver may
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync store whatever it wants in driver_priv and edit the width and height.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync If it is a paletted subpicture the driver needs to fill out the
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync num_palette_entries, entry_bytes and component_order. These are
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync not communicated to the client until the time the surface is
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync created.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync The driver may pass data back to the client in the same manner as the
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCCreateContextProc.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync*/
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef int (*xf86XvMCCreateSubpictureProcPtr) (ScrnInfoPtr pScrn,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XvMCSubpicturePtr subpicture,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int *num_priv, CARD32 **priv);
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef void (*xf86XvMCDestroySubpictureProcPtr) (ScrnInfoPtr pScrn,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XvMCSubpicturePtr subpicture);
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef struct {
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync char *name;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int num_surfaces;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XF86MCSurfaceInfoPtr *surfaces;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int num_subpictures;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XF86ImagePtr *subpictures;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCCreateContextProcPtr CreateContext;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCDestroyContextProcPtr DestroyContext;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCCreateSurfaceProcPtr CreateSurface;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCDestroySurfaceProcPtr DestroySurface;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCCreateSubpictureProcPtr CreateSubpicture;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCDestroySubpictureProcPtr DestroySubpicture;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync} XF86MCAdaptorRec, *XF86MCAdaptorPtr;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/*
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync xf86XvMCScreenInit
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync Unlike Xv, the adaptor data is not copied from this structure.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync This structure's data is used so it must stick around for the
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync life of the server. Note that it's an array of pointers not
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync an array of structures.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync*/
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncextern _X_EXPORT Bool xf86XvMCScreenInit(ScreenPtr pScreen,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int num_adaptors,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XF86MCAdaptorPtr * adaptors);
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncextern _X_EXPORT XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec(void);
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncextern _X_EXPORT void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor);
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#endif /* _XF86XVMC_H */