1 #ifndef EGLDRI_INCLUDED
2 #define EGLDRI_INCLUDED
7 #include "egldisplay.h"
9 #include "eglsurface.h"
10 #include "eglcontext.h"
13 #include "drm_sarea.h"
16 * dri display-specific driver class derived from _EGLDisplay
18 typedef struct dri_display
20 _EGLDisplay Base
; /**< base class */
22 int drmFD
; /**< \brief DRM device file descriptor */
24 unsigned long hFrameBuffer
;
34 unsigned int serverContext
; /**< \brief DRM context only active on server */
35 unsigned long FBStart
; /**< \brief physical address of the framebuffer */
36 void *driverClientMsg
;
37 int driverClientMsgSize
;
42 __DRIscreen driScreen
;
48 * dri driver-specific screen class derived from _EGLScreen
50 typedef struct dri_screen
53 char fb
[NAME_MAX
]; /** the screen name, like "fb0" */
58 * dri driver-specific surface class derived from _EGLSurface
60 typedef struct dri_surface
62 _EGLSurface Base
; /* base class/object */
63 __DRIdrawable drawable
;
68 * dri driver-specific context class derived from _EGLContext
70 typedef struct dri_context
72 _EGLContext Base
; /* base class/object */
73 __DRIcontext driContext
; /**< \brief context dependent methods */
78 static inline driDisplay
*
79 Lookup_driDisplay(EGLDisplay dpy
)
81 _EGLDisplay
*d
= _eglLookupDisplay(dpy
);
82 return (driDisplay
*) d
;
86 static inline driScreen
*
87 Lookup_driScreen(EGLDisplay dpy
, EGLScreenMESA screen
)
89 _EGLScreen
*s
= _eglLookupScreen(dpy
, screen
);
90 return (driScreen
*) s
;
94 static inline driContext
*
95 Lookup_driContext(EGLContext ctx
)
97 _EGLContext
*c
= _eglLookupContext(ctx
);
98 return (driContext
*) c
;
102 static inline driSurface
*
103 Lookup_driSurface(EGLSurface surf
)
105 _EGLSurface
*s
= _eglLookupSurface(surf
);
106 return (driSurface
*) s
;
109 extern void _eglDRIInitDriverFallbacks(_EGLDriver
*drv
);
110 extern EGLBoolean
_eglDRIShowScreenSurfaceMESA(_EGLDriver
*drv
, EGLDisplay dpy
, EGLScreenMESA screen
, EGLSurface surface
, EGLModeMESA m
);
111 extern EGLBoolean
_eglDRIInitialize(_EGLDriver
*drv
, EGLDisplay dpy
, EGLint
*major
, EGLint
*minor
);
112 extern EGLBoolean
_eglDRIGetDisplayInfo(driDisplay
*dpy
);
113 extern EGLBoolean
_eglDRICreateDisplay(driDisplay
*dpy
, __DRIframebuffer
*framebuffer
);
114 extern EGLBoolean
_eglDRICreateScreens(driDisplay
*dpy
);
116 #endif /* EGLDRI_INCLUDED */