[waffle] [PATCH 00/10] null platform WIP
Frank Henigman
fjhenigman at google.com
Mon Mar 30 12:12:40 PDT 2015
This patch set adds a new platform: WAFFLE_PLATFORM_NULL.
This platform uses EGL_PLATFORM_NULL, KHR_surfaceless_context,
EXT_image_dma_buf_import and gbm.
In this platform a waffle window contains gbm buffers and sets up
rendering into them via dmabuf, EGLImage and GL framebuffer.
These details are hidden from the user so the platform works exactly
like other waffle platforms.
It is also possible to show the gbm buffers on screen via DRM/KMS.
Development ongoing at https://github.com/fjhenigman/waffle/tree/null.
The version here is tagged "null1" on github.
Prerequisites:
- Mesa with gles2, intel, gbm (mesa gbm or minigbm) and these patches:
https://raw.githubusercontent.com/fjhenigman/waffle/mesa/0001-egl-dri2-implement-platform_null.patch
https://raw.githubusercontent.com/fjhenigman/waffle/mesa/10.3-i965-remove-read-only-restriction-of-imported-buffer.patch
This is work in progress and numerous issues remain:
- display is upside down
- glBindFramebuffer(0) will not have the desired effect as the waffle
window uses non-zero framebuffers
- seems this can only be fixed for apps that use waffle to look up their
GL functions - by returning a wrapper to intercept glBindFramebuffer
- only GLES2 supported
- only double buffering supported
- only tested with Mesa/i965, and only on a couple simple Chrome OS tests
- should try a piglit run
- tested almost entirely with minigbm, barely with mesa gbm
- display works on i915 only
- i915-specific code is hard-wired - no graceful failure on other hardware
- minigbm might be a good place to stick hardware-specific code
- if we still want display for the GBM platform, we should try to share
display code with it
- errors are checked but some could be reported more informatively
- should fail gracefully in case of missing extensions
Questions:
- instead of copying gbm buffers for display, can we use GL to draw a quad
using the source buffer as a texture?
- can we then use render nodes to render to texture, and a master node only
to mode set and render to displayed buffer?
- this would make it simple to invert the currently upside down picture
- this could reduce or eliminate hardware-specific code
- can we do this in a separate context so as not to step on user's context?
- should we load libdrm dynamically?
- should internal names have a wnull_ prefix for consistency with wegl and wgbm?
- why the leading 'w?'
- should we save/restore mode/crtc?
- seems vt doesn't come back after program exits, though it does after
changing to different vt and back
- how about a naming convention for selecting cards and connectors with
the argument to waffle_display_connect()?
- can/should we require waffle_window_show() be called before
waffle_make_current()?
- would like know to if and how the window is going to be shown before
allocating buffers
Patches 1-7 contain no new platform functionality. They mostly make it
easier to implement the new platform.
Patches 8-9 just add 'null' to the list of platforms in wflinfo and gl_basic.
Patch 10 contains all of the new platform.
Frank Henigman (10):
wegl: enable deriving from wegl_context
gbm: make platform friendlier to derived classes
gbm: make wgbm_get_default_fd_for_pattern public
wegl: fix wegl_util.h includes and declarations
wegl: add EGL image create/destroy
gbm: wegl_display ok in wgbm_config_get_gbm_format
waffle: add full screen window request
wflinfo: add 'null' platform
gl_basic: add 'null' platform
waffle: add 'null' platform
LICENSE.txt | 5 +
Options.cmake | 8 +
cmake/Modules/WaffleDefineCompilerFlags.cmake | 4 +
cmake/Modules/WaffleFindDependencies.cmake | 3 +
.../Modules/WafflePrintConfigurationSummary.cmake | 3 +
examples/gl_basic.c | 1 +
include/CMakeLists.txt | 1 +
include/waffle/waffle.h | 14 +
include/waffle/waffle_null.h | 65 +++
src/utils/wflinfo.c | 3 +-
src/waffle/CMakeLists.txt | 19 +
src/waffle/api/waffle_init.c | 11 +
src/waffle/api/waffle_window.c | 69 +--
src/waffle/core/wcore_util.c | 1 +
src/waffle/egl/wegl_context.c | 79 ++-
src/waffle/egl/wegl_context.h | 10 +-
src/waffle/egl/wegl_platform.c | 9 +-
src/waffle/egl/wegl_platform.h | 4 +
src/waffle/egl/wegl_util.h | 5 +-
src/waffle/gbm/wgbm_config.c | 4 +-
src/waffle/gbm/wgbm_display.c | 2 +-
src/waffle/gbm/wgbm_display.h | 3 +
src/waffle/gbm/wgbm_platform.c | 58 +-
src/waffle/gbm/wgbm_platform.h | 51 +-
src/waffle/glx/glx_window.c | 12 +-
src/waffle/null/wnull_context.c | 87 +++
src/waffle/null/wnull_context.h | 62 ++
src/waffle/null/wnull_display.c | 631 +++++++++++++++++++++
src/waffle/null/wnull_display.h | 93 +++
src/waffle/null/wnull_platform.c | 103 ++++
src/waffle/null/wnull_platform.h | 10 +
src/waffle/null/wnull_window.c | 495 ++++++++++++++++
src/waffle/null/wnull_window.h | 44 ++
src/waffle/xegl/xegl_window.c | 13 +-
34 files changed, 1871 insertions(+), 111 deletions(-)
create mode 100644 include/waffle/waffle_null.h
create mode 100644 src/waffle/null/wnull_context.c
create mode 100644 src/waffle/null/wnull_context.h
create mode 100644 src/waffle/null/wnull_display.c
create mode 100644 src/waffle/null/wnull_display.h
create mode 100644 src/waffle/null/wnull_platform.c
create mode 100644 src/waffle/null/wnull_platform.h
create mode 100644 src/waffle/null/wnull_window.c
create mode 100644 src/waffle/null/wnull_window.h
--
2.2.0.rc0.207.ga3a616c
More information about the waffle
mailing list