GitXplorerGitXplorer
d

gbm_es2_demo

public
62 stars
21 forks
4 issues

Commits

List of commits on branch master.
Unverified
6696df125b2e81e701413de80f297aa13b23a471

relieve compile warning

dds-hwang committed 6 years ago
Unverified
33c0c2b719422482293278b0e65cd2963144aa23

merge to main.cpp

dds-hwang committed 6 years ago
Unverified
893017a81a249583d73337ff83fa3d01a6b8af10

Move Run() to drm_modesetter

dds-hwang committed 6 years ago
Unverified
cf0e0ba52bb7fa71a3a6d5384f3ca3252431f4b9

cros: support cros build

dds-hwang committed 6 years ago
Verified
cf01502162278e14d98fb36480fabbf7e1e50d2e

Merge pull request #2 from joone/master

dds-hwang committed 7 years ago
Unverified
a53e73310941cfde4661e468d1b698370dd0a8bd

Add a demo written in Rust

committed 7 years ago

README

The README file for this repository.

GBM ES2 Demo

  • Example OpenGL ES2 demo using GBM and DRM (KMS) modesetting
  • This shows how ChromeOS renders GLES2 contents on the screen.
  • It uses OpenGL ES2/3 without X11 dependency, so it fits pretty good with the embedded devices world.

Alt text

Build

  • If you are on Ubuntu, first make sure you have the dependencies installed
> sudo apt-get install libgles2-mesa-dev libgbm-dev
> mkdir build; cd build
> cmake ../
> make

Run

  • I have successfully ran it on Ubuntu, ChromeOS and Yocto.

Ubuntu

  • Go to tty1 with Ctrl + Alt + F1
  • Kill gdm or lightdm because they are DRM master now. This demo has to be DRM master.
> sudo service lightdm stop
  • Run the demo
> gbm_es2_demo
or
> gbm_es2_demo -M # mmap test

Yocto

  • The easiest way to build embedded linux image is to use Yocto.
  • I make Yocto recipes to make standalone emebeded OpenGL ES2 demo image.
  • Check Yocto GBM ES2 Demo
  • Enjoy building Linux image from the scratch.

Demo detail

gbm_es2_demo

  • Show how to glue DRM, GBM and EGL
  • Show how to swap buffer and vsync
  • Show how to implement GLES2 app

gbm_es2_demo -M

  • Same to gbm_es2_demo except for updating cube surface using dma_buf mmap
  • It's very nice demo to show how Chromium zero-copy texture upload works. Chromium doesn't use glTexImage2D to update texture thank to new dma_buf mmap API. For more Chromium detail, check the chrome issue
  • After Linux kernel v4.6, you can use following code. (currently only Intel Architecture supports it)
  • Tiago Vignatti made this change in kernel.
  void* data = mmap(dma_buf_fd)
  update contents on |data|
  munmap(data)

Code style

> clang-format-5.0 -i `find . -name "*.cpp" -o -name "*.h"`

Reference