1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**************************************************************************
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright 2010 LunarG, Inc.
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * All Rights Reserved.
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining a
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * copy of this software and associated documentation files (the
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * "Software"), to deal in the Software without restriction, including
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * without limitation the rights to use, copy, modify, merge, publish,
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * distribute, sub license, and/or sell copies of the Software, and to
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * permit persons to whom the Software is furnished to do so, subject to
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the following conditions:
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice (including the
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * next paragraph) shall be included in all copies or substantial portions
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * of the Software.
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * DEALINGS IN THE SOFTWARE.
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org **************************************************************************/
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef EGLSCREEN_INCLUDED
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define EGLSCREEN_INCLUDED
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "egltypedefs.h"
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifdef EGL_MESA_screen_surface
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _EGL_SCREEN_MAX_MODES 16
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Per-screen information.
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Note that an EGL screen doesn't have a size.  A screen may be set to
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * one of several display modes (width/height/scanrate).  The screen
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * then displays a drawing surface.  The drawing surface must be at least
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * as large as the display mode's resolution.  If it's larger, the
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * OriginX and OriginY fields control what part of the surface is visible
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * on the screen.
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct _egl_screen
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   _EGLDisplay *Display;
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   EGLScreenMESA Handle; /* The public/opaque handle which names this object */
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   _EGLMode *CurrentMode;
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   _EGLSurface *CurrentSurface;
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   EGLint OriginX, OriginY; /**< Origin of scan-out region w.r.t. surface */
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   EGLint StepX, StepY;     /**< Screen position/origin granularity */
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   EGLint NumModes;
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   _EGLMode *Modes;  /**< array [NumModes] */
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgPUBLIC void
71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_eglInitScreen(_EGLScreen *screen, _EGLDisplay *dpy, EGLint num_modes);
72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgPUBLIC EGLScreenMESA
75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_eglLinkScreen(_EGLScreen *screen);
76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern _EGLScreen *
79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_eglLookupScreen(EGLScreenMESA screen, _EGLDisplay *dpy);
80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**
83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Return the handle of a linked screen.
84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic INLINE EGLScreenMESA
86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_eglGetScreenHandle(_EGLScreen *screen)
87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   return (screen) ? screen->Handle : (EGLScreenMESA) 0;
89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern EGLBoolean
93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_eglGetScreensMESA(_EGLDriver *drv, _EGLDisplay *dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern EGLBoolean
97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_eglScreenPositionMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, EGLint x, EGLint y);
98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern EGLBoolean
101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_eglQueryScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy,
102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           _EGLScreen *scrn, _EGLSurface **surface);
103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern EGLBoolean
106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_eglQueryScreenModeMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, _EGLMode **m);
107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern EGLBoolean
110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_eglQueryScreenMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, EGLint attribute, EGLint *value);
111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif /* EGL_MESA_screen_surface */
114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif /* EGLSCREEN_INCLUDED */
117