2 #ifndef _EGL_TRACKER_H_
3 #define _EGL_TRACKER_H_
8 #include "eglcontext.h"
9 #include "egldisplay.h"
10 #include "egldriver.h"
11 #include "eglglobals.h"
13 #include "eglscreen.h"
14 #include "eglsurface.h"
17 #include "xf86drmMode.h"
19 #include "pipe/p_compiler.h"
21 #include "state_tracker/st_public.h"
23 #define MAX_SCREENS 16
40 struct pipe_winsys
*winsys
;
41 struct pipe_screen
*screen
;
48 drmVersionPtr version
;
53 struct drm_screen
*screens
[MAX_SCREENS
];
59 _EGLSurface base
; /* base class/object */
66 struct st_framebuffer
*stfb
;
72 struct drm_context
*user
;
73 struct drm_screen
*screen
;
81 _EGLContext base
; /* base class/object */
85 struct pipe_context
*pipe
;
86 struct st_context
*st
;
97 struct pipe_texture
*tex
;
98 struct pipe_surface
*surface
;
111 /* currently only support one connector */
112 drmModeConnectorPtr connector
;
113 uint32_t connectorID
;
116 drmModePropertyPtr dpms
;
118 /* Has this screen been shown */
121 /* Surface that is currently attached to this screen */
122 struct drm_surface
*surf
;
128 /* crtc and mode used */
129 /*drmModeCrtcPtr crtc;*/
132 drmModeModeInfoPtr mode
;
136 static INLINE
struct drm_device
*
137 lookup_drm_device(_EGLDisplay
*d
)
139 return (struct drm_device
*) d
->DriverData
;
143 static INLINE
struct drm_context
*
144 lookup_drm_context(_EGLContext
*c
)
146 return (struct drm_context
*) c
;
150 static INLINE
struct drm_surface
*
151 lookup_drm_surface(_EGLSurface
*s
)
153 return (struct drm_surface
*) s
;
156 static INLINE
struct drm_screen
*
157 lookup_drm_screen(_EGLScreen
*s
)
159 return (struct drm_screen
*) s
;
166 void drm_visual_modes_destroy(__GLcontextModes
*modes
);
167 __GLcontextModes
* drm_visual_modes_create(unsigned count
, size_t minimum_size
);
168 __GLcontextModes
* drm_visual_from_config(_EGLConfig
*conf
);
175 void drm_takedown_shown_screen(_EGLDisplay
*dpy
, struct drm_screen
*screen
);
179 * All function exported to the egl side.
182 EGLBoolean
drm_initialize(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLint
*major
, EGLint
*minor
);
183 EGLBoolean
drm_terminate(_EGLDriver
*drv
, _EGLDisplay
*dpy
);
184 _EGLContext
*drm_create_context(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, _EGLContext
*share_list
, const EGLint
*attrib_list
);
185 EGLBoolean
drm_destroy_context(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLContext
*context
);
186 _EGLSurface
*drm_create_window_surface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, NativeWindowType window
, const EGLint
*attrib_list
);
187 _EGLSurface
*drm_create_pixmap_surface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, NativePixmapType pixmap
, const EGLint
*attrib_list
);
188 _EGLSurface
*drm_create_pbuffer_surface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, const EGLint
*attrib_list
);
189 _EGLSurface
*drm_create_screen_surface_mesa(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, const EGLint
*attrib_list
);
190 EGLBoolean
drm_show_screen_surface_mesa(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLScreen
*screen
, _EGLSurface
*surface
, _EGLMode
*mode
);
191 EGLBoolean
drm_destroy_surface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*surface
);
192 EGLBoolean
drm_make_current(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*draw
, _EGLSurface
*read
, _EGLContext
*context
);
193 EGLBoolean
drm_swap_buffers(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*draw
);