Commit 351d8916 authored by idr's avatar idr
Browse files

Replace drmHandle, drmContext, drmDrawable, drmMagic and related types with

drm_handle_t, drm_context_t, drm_drawable_t, drm_magic_t.
parent bf4bb37f
......@@ -176,7 +176,7 @@ Bool XF86DRIQueryDirectRenderingCapable(dpy, screen, isCapable)
Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
Display* dpy;
int screen;
drmHandlePtr hSAREA;
drm_handle_t * hSAREA;
char **busIdString;
{
XExtDisplayInfo *info = find_display (dpy);
......@@ -200,7 +200,7 @@ Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
*hSAREA = rep.hSAREALow;
#ifdef LONG64
*hSAREA |= ((drmHandle)rep.hSAREAHigh) << 32;
*hSAREA |= ((drm_handle_t)rep.hSAREAHigh) << 32;
#endif
if (rep.length) {
......@@ -224,7 +224,7 @@ Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
Bool XF86DRIAuthConnection(dpy, screen, magic)
Display* dpy;
int screen;
drmMagic magic;
drm_magic_t magic;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIAuthConnectionReq *req;
......@@ -329,7 +329,7 @@ Bool XF86DRICreateContextWithConfig(dpy, screen, configID, context, hHWContext)
int screen;
int configID;
XID* context;
drmContextPtr hHWContext;
drm_context_t * hHWContext;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRICreateContextReply rep;
......@@ -364,7 +364,7 @@ Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext)
int screen;
Visual* visual;
XID* context;
drmContextPtr hHWContext;
drm_context_t * hHWContext;
{
return XF86DRICreateContextWithConfig( dpy, screen, visual->visualid,
context, hHWContext );
......@@ -397,7 +397,7 @@ Bool XF86DRICreateDrawable(dpy, screen, drawable, hHWDrawable)
Display* dpy;
int screen;
Drawable drawable;
drmDrawablePtr hHWDrawable;
drm_drawable_t * hHWDrawable;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRICreateDrawableReply rep;
......@@ -537,7 +537,7 @@ Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer,
fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate)
Display* dpy;
int screen;
drmHandlePtr hFrameBuffer;
drm_handle_t * hFrameBuffer;
int* fbOrigin;
int* fbSize;
int* fbStride;
......@@ -565,7 +565,7 @@ Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer,
*hFrameBuffer = rep.hFrameBufferLow;
#ifdef LONG64
*hFrameBuffer |= ((drmHandle)rep.hFrameBufferHigh) << 32;
*hFrameBuffer |= ((drm_handle_t)rep.hFrameBufferHigh) << 32;
#endif
*fbOrigin = rep.framebufferOrigin;
......
......@@ -728,7 +728,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
CreateNewScreenFunc createNewScreen)
{
__DRIscreenPrivate *psp = NULL;
drmHandle hSAREA;
drm_handle_t hSAREA;
drmAddress pSAREA;
char *BusID;
__DRIversion ddx_version;
......@@ -758,7 +758,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
err_extra = strerror( -fd );
if (fd >= 0) {
drmMagic magic;
drm_magic_t magic;
err_msg = "drmGetMagic";
err_extra = NULL;
......@@ -792,7 +792,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
&ddx_version.minor,
&ddx_version.patch,
&driverName)) {
drmHandle hFB;
drm_handle_t hFB;
int junk;
/* No longer needed. */
......
......@@ -67,143 +67,48 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
_XFUNCPROTOBEGIN
Bool XF86DRIQueryExtension(
#if NeedFunctionPrototypes
Display* /* dpy */,
int* /* event_base */,
int* /* error_base */
#endif
);
Bool XF86DRIQueryVersion(
#if NeedFunctionPrototypes
Display* /* dpy */,
int* /* majorVersion */,
int* /* minorVersion */,
int* /* patchVersion */
#endif
);
Bool XF86DRIQueryDirectRenderingCapable(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
Bool* /* isCapable */
#endif
);
Bool XF86DRIOpenConnection(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
drmHandlePtr /* hSAREA */,
char** /* busIDString */
#endif
);
Bool XF86DRIAuthConnection(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
drmMagic /* magic */
#endif
);
Bool XF86DRICloseConnection(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */
#endif
);
Bool XF86DRIGetClientDriverName(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
int* /* ddxDriverMajorVersion */,
int* /* ddxDriverMinorVersion */,
int* /* ddxDriverPatchVersion */,
char** /* clientDriverName */
#endif
);
Bool XF86DRICreateContext(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
Visual* /* visual */,
XID* /* ptr to returned context id */,
drmContextPtr /* hHWContext */
#endif
);
Bool XF86DRICreateContextWithConfig(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
int /* visual ID / fbconfig ID */,
XID* /* ptr to returned context id */,
drmContextPtr /* hHWContext */
#endif
);
Bool XF86DRIDestroyContext(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
XID /* context id */
#endif
);
Bool XF86DRICreateDrawable(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
Drawable /* drawable */,
drmDrawablePtr /* hHWDrawable */
#endif
);
Bool XF86DRIDestroyDrawable(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
Drawable /* drawable */
#endif
);
Bool XF86DRIGetDrawableInfo(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
Drawable /* drawable */,
unsigned int* /* index */,
unsigned int* /* stamp */,
int* /* X */,
int* /* Y */,
int* /* W */,
int* /* H */,
int* /* numClipRects */,
drm_clip_rect_t **,/* pClipRects */
int* /* backX */,
int* /* backY */,
int* /* numBackClipRects */,
drm_clip_rect_t ** /* pBackClipRects */
#endif
);
Bool XF86DRIGetDeviceInfo(
#if NeedFunctionPrototypes
Display* /* dpy */,
int /* screen */,
drmHandlePtr /* hFrameBuffer */,
int* /* fbOrigin */,
int* /* fbSize */,
int* /* fbStride */,
int* /* devPrivateSize */,
void** /* pDevPrivate */
#endif
);
Bool XF86DRIQueryExtension( Display *dpy, int *event_base, int *error_base );
Bool XF86DRIQueryVersion( Display *dpy, int *majorVersion, int *minorVersion,
int *patchVersion );
Bool XF86DRIQueryDirectRenderingCapable( Display *dpy, int screen,
Bool *isCapable );
Bool XF86DRIOpenConnection( Display *dpy, int screen, drm_handle_t *hSAREA,
char **busIDString );
Bool XF86DRIAuthConnection( Display *dpy, int screen, drm_magic_t magic );
Bool XF86DRICloseConnection( Display *dpy, int screen );
Bool XF86DRIGetClientDriverName( Display *dpy, int screen,
int *ddxDriverMajorVersion, int *ddxDriverMinorVersion,
int *ddxDriverPatchVersion, char **clientDriverName );
Bool XF86DRICreateContext( Display *dpy, int screen, Visual *visual,
XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
Bool XF86DRICreateContextWithConfig( Display *dpy, int screen, int configID,
XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
Bool XF86DRIDestroyContext( Display *dpy, int screen, XID context_id );
Bool XF86DRICreateDrawable( Display *dpy, int screen, Drawable drawable,
drm_drawable_t *hHWDrawable );
Bool XF86DRIDestroyDrawable( Display *dpy, int screen, Drawable drawable );
Bool XF86DRIGetDrawableInfo( Display *dpy, int screen, Drawable drawable,
unsigned int *index, unsigned int *stamp,
int *X, int *Y, int *W, int *H,
int *numClipRects, drm_clip_rect_t ** pClipRects,
int *backX, int *backY,
int *numBackClipRects, drm_clip_rect_t **pBackClipRects );
Bool XF86DRIGetDeviceInfo( Display *dpy, int screen,
drm_handle_t *hFrameBuffer, int *fbOrigin, int *fbSize,
int *fbStride, int *devPrivateSize, void **pDevPrivate );
_XFUNCPROTOEND
......
......@@ -227,7 +227,7 @@ Status XvMCCreateContext(Display *display, XvPortID port,
context->flags = (unsigned long)magic;
/*
Pass control to the X server to create a drmContext for us and
Pass control to the X server to create a drm_context_t for us and
validate the with/height and flags.
*/
if((ret = _xvmc_create_context(display, context, &priv_count, &priv_data))) {
......@@ -237,7 +237,7 @@ Status XvMCCreateContext(Display *display, XvPortID port,
/*
X server returns a structure like this:
drmContext
drm_context_t
fbBase
OverlayOffset
OverlaySize
......@@ -411,7 +411,7 @@ Status XvMCDestroyContext(Display *display, XvMCContext *context) {
I810_UNLOCK(pI810XvMC);
}
/* Pass Control to the X server to destroy the drmContext */
/* Pass Control to the X server to destroy the drm_context_t */
_xvmc_destroy_context(display, context);
i810_free_privContext(pI810XvMC);
......
......@@ -86,7 +86,7 @@ typedef struct _i810OverlayRec {
// i810XvMCDrmMap: Holds the data about the DRM maps
***************************************************************************/
typedef struct _i810XvMCDrmMap {
drmHandle offset;
drm_handle_t offset;
drmAddress address;
unsigned int size;
} i810XvMCDrmMap, *i810XvMCDrmMapPtr;
......@@ -100,7 +100,7 @@ typedef struct _i810XvMCContext {
i810XvMCDrmMap overlay;
i810XvMCDrmMap surfaces;
drmBufMapPtr dmabufs; /* Data structure to hold available dma buffers */
drmContext drmcontext;
drm_context_t drmcontext;
unsigned int last_render;
unsigned int last_flip;
unsigned short ref;
......@@ -144,7 +144,7 @@ typedef struct _i810XvMCSurface {
unsigned int last_flip;
unsigned int second_field; /* Flags a surface that is only half done */
drmAddress data;
drmHandle offset;
drm_handle_t offset;
unsigned int offsets[3];
i810XvMCContext *privContext;
} i810XvMCSurface;
......@@ -164,7 +164,7 @@ typedef struct _i810XvMCSubpicture {
unsigned int last_render;
unsigned int last_flip;
drmAddress data;
drmHandle offset;
drm_handle_t offset;
unsigned int offsets[1];
unsigned char palette[3][16];
i810XvMCContext *privContext;
......
......@@ -113,7 +113,7 @@ Bool
DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
{
DRIScreenPrivPtr pDRIPriv;
drmContextPtr reserved;
drm_context_t * reserved;
int reserved_count;
int i, fd, drmWasAvailable;
Bool xineramaInCore = FALSE;
......@@ -294,7 +294,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
pDRIPriv->hSAREA, pDRIPriv->pSAREA);
if (drmAddMap( pDRIPriv->drmFD,
(drmHandle)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress,
(drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress,
pDRIPriv->pDriverInfo->frameBufferSize,
DRM_FRAME_BUFFER,
0,
......@@ -483,7 +483,7 @@ DRICloseScreen(ScreenPtr pScreen)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
DRIInfoPtr pDRIInfo;
drmContextPtr reserved;
drm_context_t * reserved;
int reserved_count;
if (pDRIPriv && pDRIPriv->directRenderingSupport) {
......@@ -634,7 +634,7 @@ DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable)
}
Bool
DRIOpenConnection(ScreenPtr pScreen, drmHandlePtr hSAREA, char **busIdString)
DRIOpenConnection(ScreenPtr pScreen, drm_handle_t * hSAREA, char **busIdString)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
......@@ -645,7 +645,7 @@ DRIOpenConnection(ScreenPtr pScreen, drmHandlePtr hSAREA, char **busIdString)
}
Bool
DRIAuthConnection(ScreenPtr pScreen, drmMagic magic)
DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
......@@ -679,18 +679,18 @@ DRIGetClientDriverName(ScreenPtr pScreen,
/* DRICreateContextPriv and DRICreateContextPrivFromHandle are helper
functions that layer on drmCreateContext and drmAddContextTag.
DRICreateContextPriv always creates a kernel drmContext and then calls
DRICreateContextPriv always creates a kernel drm_context_t and then calls
DRICreateContextPrivFromHandle to create a DRIContextPriv structure for
DRI tracking. For the SIGIO handler, the drmContext is associated with
DRI tracking. For the SIGIO handler, the drm_context_t is associated with
DRIContextPrivPtr. Any special flags are stored in the DRIContextPriv
area and are passed to the kernel (if necessary).
DRICreateContextPriv returns a pointer to newly allocated
DRIContextPriv, and returns the kernel drmContext in pHWContext. */
DRIContextPriv, and returns the kernel drm_context_t in pHWContext. */
DRIContextPrivPtr
DRICreateContextPriv(ScreenPtr pScreen,
drmContextPtr pHWContext,
drm_context_t * pHWContext,
DRIContextFlags flags)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
......@@ -704,7 +704,7 @@ DRICreateContextPriv(ScreenPtr pScreen,
DRIContextPrivPtr
DRICreateContextPrivFromHandle(ScreenPtr pScreen,
drmContext hHWContext,
drm_context_t hHWContext,
DRIContextFlags flags)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
......@@ -840,7 +840,7 @@ DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv)
Bool
DRICreateContext(ScreenPtr pScreen, VisualPtr visual,
XID context, drmContextPtr pHWContext)
XID context, drm_context_t * pHWContext)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
__GLXscreenInfo *pGLXScreen = &__glXActiveScreens[pScreen->myNum];
......@@ -987,7 +987,7 @@ DRITransitionTo2d(ScreenPtr pScreen)
Bool
DRICreateDrawable(ScreenPtr pScreen, Drawable id,
DrawablePtr pDrawable, drmDrawablePtr hHWDrawable)
DrawablePtr pDrawable, drm_drawable_t * hHWDrawable)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
DRIDrawablePrivPtr pDRIDrawablePriv;
......@@ -1004,7 +1004,7 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id,
return FALSE;
}
/* Only create a drmDrawable once */
/* Only create a drm_drawable_t once */
if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) {
xfree(pDRIDrawablePriv);
return FALSE;
......@@ -1281,7 +1281,7 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
Bool
DRIGetDeviceInfo(ScreenPtr pScreen,
drmHandlePtr hFrameBuffer,
drm_handle_t * hFrameBuffer,
int* fbOrigin,
int* fbSize,
int* fbStride,
......@@ -1929,7 +1929,7 @@ DRIGetSAREAPrivate(ScreenPtr pScreen)
return (void *)(((char*)pDRIPriv->pSAREA)+sizeof(XF86DRISAREARec));
}
drmContext
drm_context_t
DRIGetContext(ScreenPtr pScreen)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
......
......@@ -105,11 +105,11 @@ typedef struct {
*/
Bool (*CreateContext)(ScreenPtr pScreen,
VisualPtr visual,
drmContext hHWContext,
drm_context_t hHWContext,
void* pVisualConfigPriv,
DRIContextType context);
void (*DestroyContext)(ScreenPtr pScreen,
drmContext hHWContext,
drm_context_t hHWContext,
DRIContextType context);
void (*SwapContext)(ScreenPtr pScreen,
DRISyncType syncType,
......@@ -175,10 +175,10 @@ extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
Bool *isCapable);
extern Bool DRIOpenConnection(ScreenPtr pScreen,
drmHandlePtr hSAREA,
drm_handle_t * hSAREA,
char **busIdString);
extern Bool DRIAuthConnection(ScreenPtr pScreen, drmMagic magic);
extern Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic);
extern Bool DRICloseConnection(ScreenPtr pScreen);
......@@ -191,7 +191,7 @@ extern Bool DRIGetClientDriverName(ScreenPtr pScreen,
extern Bool DRICreateContext(ScreenPtr pScreen,
VisualPtr visual,
XID context,
drmContextPtr pHWContext);
drm_context_t * pHWContext);
extern Bool DRIDestroyContext(ScreenPtr pScreen, XID context);
......@@ -200,7 +200,7 @@ extern Bool DRIContextPrivDelete(pointer pResource, XID id);
extern Bool DRICreateDrawable(ScreenPtr pScreen,
Drawable id,
DrawablePtr pDrawable,
drmDrawablePtr hHWDrawable);
drm_drawable_t * hHWDrawable);
extern Bool DRIDestroyDrawable(ScreenPtr pScreen,
Drawable id,
......@@ -225,7 +225,7 @@ extern Bool DRIGetDrawableInfo(ScreenPtr pScreen,
drm_clip_rect_t ** pBackClipRects);
extern Bool DRIGetDeviceInfo(ScreenPtr pScreen,
drmHandlePtr hFrameBuffer,
drm_handle_t * hFrameBuffer,
int* fbOrigin,
int* fbSize,
int* fbStride,
......@@ -298,16 +298,16 @@ extern unsigned int DRIGetDrawableStamp(ScreenPtr pScreen,
CARD32 drawable_index);
extern DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen,
drmContextPtr pHWContext,
drm_context_t * pHWContext,
DRIContextFlags flags);
extern DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen,
drmContext hHWContext,
drm_context_t hHWContext,
DRIContextFlags flags);
extern Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv);
extern drmContext DRIGetContext(ScreenPtr pScreen);
extern drm_context_t DRIGetContext(ScreenPtr pScreen);
extern void DRIQueryVersion(int *majorVersion,
int *minorVersion,
......
......@@ -50,7 +50,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
typedef struct _DRIDrawablePrivRec
{
drmDrawable hwDrawable;
drm_drawable_t hwDrawable;
int drawableIndex;
ScreenPtr pScreen;
int refCount;
......@@ -58,7 +58,7 @@ typedef struct _DRIDrawablePrivRec
struct _DRIContextPrivRec
{
drmContext hwContext;
drm_context_t hwContext;
ScreenPtr pScreen;
Bool valid3D;
DRIContextFlags flags;
......@@ -78,10 +78,10 @@ typedef struct _DRIScreenPrivRec
{
Bool directRenderingSupport;
int drmFD; /* File descriptor for /dev/video/? */
drmHandle hSAREA; /* Handle to SAREA, for mapping */
drm_handle_t hSAREA; /* Handle to SAREA, for mapping */
XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */
drmHandle hFrameBuffer; /* Handle to framebuffer, for mapping */
drmContext myContext; /* DDX Driver's context */
drm_handle_t hFrameBuffer; /* Handle to framebuffer, for mapping */
drm_context_t myContext; /* DDX Driver's context */
DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */
DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
void** hiddenContextStore; /* hidden X context */
......
......@@ -88,7 +88,7 @@ typedef struct _XF86DRISAREA {
drmLock drawable_lock;
XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
XF86DRISAREAFrameRec frame;
drmContext dummy_context;
drm_context_t dummy_context;
} XF86DRISAREARec, *XF86DRISAREAPtr;
#endif
......@@ -184,7 +184,7 @@ ProcXF86DRIOpenConnection(
)
{
xXF86DRIOpenConnectionReply rep;
drmHandle hSAREA;
drm_handle_t hSAREA;
char* busIdString;
REQUEST(xXF86DRIOpenConnectionReq);
......@@ -340,7 +340,7 @@ ProcXF86DRICreateContext(
if (!DRICreateContext( pScreen,
visual,
stuff->context,
(drmContextPtr)&rep.hHWContext)) {
(drm_context_t *)&rep.hHWContext)) {
return BadValue;
}
......@@ -397,7 +397,7 @@ ProcXF86DRICreateDrawable(
if (!DRICreateDrawable( screenInfo.screens[stuff->screen],
(Drawable)stuff->drawable,
pDrawable,
(drmDrawablePtr)&rep.hHWDrawable)) {
(drm_drawable_t *)&rep.hHWDrawable)) {
return BadValue;
}
......@@ -522,7 +522,7 @@ ProcXF86DRIGetDeviceInfo(
)
{
xXF86DRIGetDeviceInfoReply rep;
drmHandle hFrameBuffer;
drm_handle_t hFrameBuffer;
void *pDevPrivate;
REQUEST(xXF86DRIGetDeviceInfoReq);
......
......@@ -261,7 +261,7 @@ static Bool ATIInitVisualConfigs( ScreenPtr pScreen )
/* Create the ATI-specific context information */
static Bool ATICreateContext( ScreenPtr pScreen, VisualPtr visual,
drmContext hwContext, void *pVisualConfigPriv,
drm_context_t hwContext, void *pVisualConfigPriv,