Skip to content

Instantly share code, notes, and snippets.

Avatar

Jean Lorenz Hertel jlHertel

View GitHub Profile
@jlHertel
jlHertel / gbm_test.cpp
Created Sep 1, 2019
Test availability of MESA_query_driver with different platforms
View gbm_test.cpp
// Compile with g++ -o gbm_test.bin gbm_test.cpp -lgbm -lGL -lEGL -I/usr/include/libdrm -I/usr/include/EGL -ldrm
#include <iostream>
#include <xf86drm.h>
#include <fcntl.h>
#include <gbm.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <drm.h>
#include <string>
@jlHertel
jlHertel / test.cpp
Last active Aug 25, 2019
Segmentation Fault with MESA_query_driver example
View test.cpp
// Compile with: g++ -o test.bin test.cpp -lgbm -lGL -lEGL -I/usr/include/libdrm -I/usr/include/EGL -ldrm
#include <iostream>
#include <xf86drm.h>
#include <fcntl.h>
#include <gbm.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <drm.h>
typedef EGLDisplay *eglGetPlatformDisplayEXT_t (EGLenum platform, void *native_display, const EGLint *attrib_list);
@jlHertel
jlHertel / Class inheritance
Last active Dec 25, 2018
One possible way to implement the new EGL query
View Class inheritance
class QueryInterface {
public:
virtual std::list<DriverConfiguration> queryDriverConfigurationOptions(const Glib::ustring &locale) = 0;
virtual std::map<Glib::ustring, GPUInfo_ptr> enumerateDRIDevices(const Glib::ustring &locale) = 0;
};
class DriQuery : public QueryInterface {
/* code that already exists */