Skip to content

Instantly share code, notes, and snippets.

View jlHertel's full-sized avatar

Jean Lorenz Hertel jlHertel

View GitHub Profile
@jlHertel
jlHertel / gbm_test.cpp
Created September 1, 2019 10:47
Test availability of MESA_query_driver with different platforms
// 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 August 25, 2019 17:48
Segmentation Fault with MESA_query_driver example
// 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 December 25, 2018 15:00
One possible way to implement the new EGL query
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 */