summaryrefslogtreecommitdiffstats
path: root/make/config/nativewindow
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-11-28 02:00:29 +0100
committerSven Gothel <[email protected]>2019-11-28 02:00:29 +0100
commit3e19c2267500c0c459e7dce8d2087387a56f3296 (patch)
tree1c6e2e64b7f5f5ee8d6178824dc6ff2e0a3bdbbe /make/config/nativewindow
parent976e89ff24da3b2cdf206e8ef8f222f54fb467de (diff)
Bug 1156 - Implement DRM/GBM Support for JOGL(EGL) and NEWT
Adding new classes DRMLib (gluegen of drm + gbm), DRMUtil and DRMMode GBMDummyUpstreamSurfaceHook to new package jogamp.nativewindow.drm, allowing full awareness of DRM + GBM within NativeWindow for JOGL + NEWT. DRMMode replaces the previous native code of collecting drmMode* attributes: active connector, used mode, encoder etc and also supports multiple active connectors. DRMUtil handles the global static drmFd (file descriptor), currently only the GNU/Linux DRM device is supported. GBMDummyUpstreamSurfaceHook provides a simple dummy GBM surface. NativeWindow provides the new nativewindow_drm.so and nativewindow-os-drm.jar, which are included in most 'all' jar packages. build property: setup.addNativeEGLGBM -> setup.addNativeDRMGBM Changes NativeWindowFactory: - TYPE_EGL_GBM -> TYPE_DRM_GBM while keeping the package ID of '.egl.gbm' for NEWT (using EGL) - Initializing DRMUtil at initialization Changes EGLDrawableFactory: - Using native GBM device for the default EGL display creation instead of EGL_DEFAULT_DISPLAY. This resolves issues as seen in Bug 1402, as well in cases w/o surfaceless support. - GL profile mapping uses surfaceless when available for GBM, otherwise uses createDummySurfaceImpl (dummy GBM surface via GBMDummyUpstreamSurfaceHook) - createDummySurfaceImpl uses a dummy GBM surface via GBMDummyUpstreamSurfaceHook - DesktopGL not available with GBM, see Bug 1401 NEWT's DRM + GBM + EGL Driver - Using DRMLib, DRMUtil and DRMMode, removed most native code but WindowDriver swapBuffer - ScreenDriver uses DRMMode, however currently only first connected CRT. - WindowDriver aligns position and size to screen, positions other than 0/0 causes DRM failure - WindowDriver reconfigure n/a NEWT TODO: - DRM Cursor support (mouse pointer) - Pointer event handling
Diffstat (limited to 'make/config/nativewindow')
-rw-r--r--make/config/nativewindow/drm-gbm-lib.cfg106
1 files changed, 106 insertions, 0 deletions
diff --git a/make/config/nativewindow/drm-gbm-lib.cfg b/make/config/nativewindow/drm-gbm-lib.cfg
new file mode 100644
index 000000000..ad1311ce1
--- /dev/null
+++ b/make/config/nativewindow/drm-gbm-lib.cfg
@@ -0,0 +1,106 @@
+# This .cfg file is used to generate the interface to the GLX routines
+# used internally by the X11GLContext implementation.
+Package jogamp.nativewindow.drm
+JavaClass DRMLib
+Style AllStatic
+
+HierarchicalNativeOutput false
+
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/drm
+
+# Imports needed by all glue code
+Import java.nio.*
+Import java.util.*
+
+# XID needs to be treated as a long for 32/64 bit compatibility
+Opaque boolean Bool
+Opaque long void *
+Opaque long gbm_device*;
+Opaque long gbm_bo*;
+Opaque long gbm_surface*;
+Opaque long union gbm_bo_handle;
+
+# IncludeAs CustomJavaCode X11Lib x11-CustomJavaCode.java
+
+ArgumentIsString drmOpen 0 1
+ArgumentIsString drmCheckModesettingSupported 0
+# ReturnsString XDisplayString
+# ReturnValueCapacity XRenderFindVisualFormat sizeof(XRenderPictFormat)
+
+ReturnedArrayLength drmModeRes.connectors getCount_connectors()
+ReturnedArrayLength drmModeRes.crtcs getCount_crtcs()
+ReturnedArrayLength drmModeRes.encoders getCount_encoders()
+ReturnedArrayLength drmModeConnector.modes getCount_modes()
+ReturnedArrayLength drmModeConnector.props getCount_props()
+ReturnedArrayLength drmModeConnector.prop_values getCount_props()
+ReturnedArrayLength drmModeConnector.encoders getCount_encoders()
+ReturnsString drmModeModeInfo.name
+
+IgnoreNot ^(drm|DRM_|gbm_|GBM_).+
+
+Ignore drmHandleEvent
+
+Ignore drmModeAtomicReq
+Ignore drmModeAtomicAlloc
+Ignore drmModeAtomicDuplicate
+Ignore drmModeAtomicMerge
+Ignore drmModeAtomicFree
+Ignore drmModeAtomicGetCursor
+Ignore drmModeAtomicSetCursor
+Ignore drmModeAtomicAddProperty
+Ignore drmModeAtomicCommit
+
+Ignore drmModeClip
+Ignore drmModeDirtyFB
+
+Ignore drmModeLesseeListRes
+Ignore drmModeListLessees
+Ignore drmModeGetLease
+Ignore drmModeObjectListRes
+
+Ignore drmModeObjectProperties
+Ignore drmModeObjectGetProperties
+Ignore drmModeFreeObjectProperties
+
+Ignore drmModePropertyBlobRes
+Ignore drmModeGetPropertyBlob
+Ignore drmModeFreePropertyBlob
+
+Ignore drmModePropertyRes
+Ignore drmModeGetProperty
+Ignore drmModeFreeProperty
+
+Ignore drmModePlane
+Ignore drmModeGetPlane
+Ignore drmModeFreePlane
+Ignore drmModePlaneRes
+Ignore drmModeGetPlaneResources
+Ignore drmModeFreePlaneResources
+
+Ignore GBM_BO_FORMAT.+
+Ignore gbm_bo_handle
+Ignore gbm_bo_get_handle
+Ignore gbm_bo_get_handle_for_plane
+Ignore gbm_bo_set_user_data
+
+ManuallyImplement drmOpenFile
+
+CustomJavaCode DRMLib public static final int DRM_MODE_TYPE_BUILTIN = (1<<0);
+# CustomJavaCode DRMLib public static final int DRM_MODE_TYPE_CLOCK_C = ((1<<1) | DRM_MODE_TYPE_BUILTIN);
+# CustomJavaCode DRMLib public static final int DRM_MODE_TYPE_CRTC_C = ((1<<2) | DRM_MODE_TYPE_BUILTIN);
+CustomJavaCode DRMLib public static final int DRM_MODE_TYPE_PREFERRED = (1<<3);
+# CustomJavaCode DRMLib public static final int DRM_MODE_TYPE_DEFAULT = (1<<4);
+# CustomJavaCode DRMLib public static final int DRM_MODE_TYPE_USERDEF = (1<<5);
+CustomJavaCode DRMLib public static final int DRM_MODE_TYPE_DRIVER = (1<<6);
+CustomJavaCode DRMLib public static native int drmOpenFile(String filename);
+
+CustomCCode #include <stdlib.h>
+CustomCCode #include <errno.h>
+CustomCCode #include <string.h>
+CustomCCode #include <fcntl.h>
+CustomCCode #include <inttypes.h>
+CustomCCode #include <xf86drm.h>
+CustomCCode #include <xf86drmMode.h>
+CustomCCode #include <gbm.h>
+