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
35 _EGLDriver base
; /* base class/object */
42 struct pipe_winsys
*winsys
;
43 struct pipe_screen
*screen
;
50 drmVersionPtr version
;
55 struct drm_screen
*screens
[MAX_SCREENS
];
61 _EGLSurface base
; /* base class/object */
68 struct st_framebuffer
*stfb
;
74 struct drm_context
*user
;
75 struct drm_screen
*screen
;
83 _EGLContext base
; /* base class/object */
87 struct pipe_context
*pipe
;
88 struct st_context
*st
;
99 struct pipe_buffer
*buffer
;
100 struct pipe_texture
*tex
;
101 struct pipe_surface
*surface
;
114 /* currently only support one connector */
115 drmModeConnectorPtr connector
;
116 uint32_t connectorID
;
119 drmModePropertyPtr dpms
;
121 /* Has this screen been shown */
124 /* Surface that is currently attached to this screen */
125 struct drm_surface
*surf
;
131 /* crtc and mode used */
132 /*drmModeCrtcPtr crtc;*/
135 drmModeModeInfoPtr mode
;
139 static INLINE
struct drm_context
*
140 lookup_drm_context(EGLContext context
)
142 _EGLContext
*c
= _eglLookupContext(context
);
143 return (struct drm_context
*) c
;
147 static INLINE
struct drm_surface
*
148 lookup_drm_surface(EGLSurface surface
)
150 _EGLSurface
*s
= _eglLookupSurface(surface
);
151 return (struct drm_surface
*) s
;
154 static INLINE
struct drm_screen
*
155 lookup_drm_screen(EGLDisplay dpy
, EGLScreenMESA screen
)
157 _EGLScreen
*s
= _eglLookupScreen(dpy
, screen
);
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(_EGLDriver
*drv
, 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 config
, 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 config
, NativeWindowType window
, const EGLint
*attrib_list
);
186 EGLSurface
drm_create_pixmap_surface(_EGLDriver
*drv
, EGLDisplay dpy
, EGLConfig config
, NativePixmapType pixmap
, const EGLint
*attrib_list
);
187 EGLSurface
drm_create_pbuffer_surface(_EGLDriver
*drv
, EGLDisplay dpy
, EGLConfig config
, const EGLint
*attrib_list
);
188 EGLSurface
drm_create_screen_surface_mesa(_EGLDriver
*drv
, EGLDisplay dpy
, EGLConfig cfg
, const EGLint
*attrib_list
);
189 EGLBoolean
drm_show_screen_surface_mesa(_EGLDriver
*drv
, EGLDisplay dpy
, EGLScreenMESA screen
, EGLSurface surface
, EGLModeMESA m
);
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
);