2
* Copyright © 2012 Linaro Limited
3
* Copyright © 2013 Canonical Ltd
5
* This file is part of the glmark2 OpenGL (ES) 2.0 benchmark.
7
* glmark2 is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later
12
* glmark2 is distributed in the hope that it will be useful, but WITHOUT ANY
13
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
* You should have received a copy of the GNU General Public License along with
18
* glmark2. If not, see <http://www.gnu.org/licenses/>.
25
#ifndef GLMARK2_NATIVE_STATE_DRM_H_
26
#define GLMARK2_NATIVE_STATE_DRM_H_
28
#include "native-state.h"
33
#include <xf86drmMode.h>
35
class NativeStateDRM : public NativeState
49
~NativeStateDRM() { cleanup(); }
53
bool create_window(WindowProperties const& properties);
54
void* window(WindowProperties& properties);
67
static void page_flip_handler(int fd, unsigned int frame, unsigned int sec,
68
unsigned int usec, void* data);
69
static void fb_destroy_callback(gbm_bo* bo, void* data);
70
static void quit_handler(int signum);
71
static bool should_quit_;
73
DRMFBState* fb_get_from_bo(gbm_bo* bo);
79
drmModeRes* resources_;
80
drmModeConnector* connector_;
81
drmModeEncoder* encoder_;
83
drmModeModeInfo* mode_;
85
gbm_surface* surface_;
91
#endif /* GLMARK2_NATIVE_STATE_DRM_H_ */