Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions tests/check_egl_platform_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,27 @@ def main():
raise RuntimeError("Need a /dev/dri/renderD* device to do rendering")
if len(cards) > 1:
print("Note, using first card: %s" % (cards[0]))
with open(cards[0], "w") as f:
gbm = ctypes.CDLL("libgbm.so.1") # On Ubuntu, package libgbm1
dev = gbm.gbm_create_device(f.fileno())
dpy = platform_base.eglGetPlatformDisplayEXT(
platform_gbm.EGL_PLATFORM_GBM_MESA, ctypes.c_void_p(dev), ctypes.c_void_p(0)
)
print(dpy)
if EGL_1_5.eglGetPlatformDisplay:
dpy = EGL_1_5.eglGetPlatformDisplay(
platform_gbm.EGL_PLATFORM_GBM_MESA,
ctypes.c_void_p(dev),
ctypes.c_void_p(0),
try:
with open(cards[0], "w") as f:
gbm = ctypes.CDLL("libgbm.so.1") # On Ubuntu, package libgbm1
dev = gbm.gbm_create_device(f.fileno())
dpy = platform_base.eglGetPlatformDisplayEXT(
platform_gbm.EGL_PLATFORM_GBM_MESA, ctypes.c_void_p(dev), ctypes.c_void_p(0)
)
print(dpy)
else:
print("No EGL_1_5 implementation")
print('OK')
if EGL_1_5.eglGetPlatformDisplay:
dpy = EGL_1_5.eglGetPlatformDisplay(
platform_gbm.EGL_PLATFORM_GBM_MESA,
ctypes.c_void_p(dev),
ctypes.c_void_p(0),
)
print(dpy)
else:
print("No EGL_1_5 implementation")
except PermissionError as error:
print('SKIP')
raise RuntimeError(str(error)) from error
print('OK')


if __name__ == "__main__":
Expand Down