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_screen
*screen
;
80 _EGLContext base
; /* base class/object */
84 struct pipe_context
*pipe
;
85 struct st_context
*st
;
96 struct pipe_texture
*tex
;
97 struct pipe_surface
*surface
;
110 /* currently only support one connector */
111 drmModeConnectorPtr connector
;
112 uint32_t connectorID
;
115 drmModePropertyPtr dpms
;
117 /* Has this screen been shown */
120 /* Surface that is currently attached to this screen */
121 struct drm_surface
*surf
;
127 /* crtc and mode used */
128 /*drmModeCrtcPtr crtc;*/
131 drmModeModeInfoPtr mode
;
135 static INLINE
struct drm_device
*
136 lookup_drm_device(_EGLDisplay
*d
)
138 return (struct drm_device
*) d
->DriverData
;
142 static INLINE
struct drm_context
*
143 lookup_drm_context(_EGLContext
*c
)
145 return (struct drm_context
*) c
;
149 static INLINE
struct drm_surface
*
150 lookup_drm_surface(_EGLSurface
*s
)
152 return (struct drm_surface
*) s
;
155 static INLINE
struct drm_screen
*
156 lookup_drm_screen(_EGLScreen
*s
)
158 return (struct drm_screen
*) s
;
165 void drm_visual_modes_destroy(__GLcontextModes
*modes
);
166 __GLcontextModes
* drm_visual_modes_create(unsigned count
, size_t minimum_size
);
167 __GLcontextModes
* drm_visual_from_config(_EGLConfig
*conf
);
174 void drm_takedown_shown_screen(_EGLDisplay
*dpy
, struct drm_screen
*screen
);
178 * All function exported to the egl side.
181 EGLBoolean
drm_initialize(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLint
*major
, EGLint
*minor
);
182 EGLBoolean
drm_terminate(_EGLDriver
*drv
, _EGLDisplay
*dpy
);
183 _EGLContext
*drm_create_context(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, _EGLContext
*share_list
, const EGLint
*attrib_list
);
184 EGLBoolean
drm_destroy_context(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLContext
*context
);
185 _EGLSurface
*drm_create_window_surface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, NativeWindowType window
, const EGLint
*attrib_list
);
186 _EGLSurface
*drm_create_pixmap_surface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, NativePixmapType pixmap
, const EGLint
*attrib_list
);
187 _EGLSurface
*drm_create_pbuffer_surface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, const EGLint
*attrib_list
);
188 _EGLSurface
*drm_create_screen_surface_mesa(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, const EGLint
*attrib_list
);
189 EGLBoolean
drm_show_screen_surface_mesa(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLScreen
*screen
, _EGLSurface
*surface
, _EGLMode
*mode
);
190 EGLBoolean
drm_destroy_surface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*surface
);
191 EGLBoolean
drm_make_current(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*draw
, _EGLSurface
*read
, _EGLContext
*context
);
192 EGLBoolean
drm_swap_buffers(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*draw
);