iris: glClear with FBO imported from DMA-BUF doesn't work
System information
System: Host: localhost.localdomain Kernel: 5.6.2-301.fc32.x86_64 x86_64 bits: 64 compiler: gcc v: 10.0.1
Console: N/A Distro: Fedora release 32 (Thirty Two)
CPU: Topology: Quad Core model: Intel Core i5-8350U bits: 64 type: MT MCP arch: Kaby Lake rev: A
L1 cache: 256 KiB L2 cache: 6144 KiB L3 cache: 6000 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 30399
Speed: 800 MHz min/max: 400/3600 MHz Core speeds (MHz): 1: 800 2: 801 3: 800 4: 801 5: 800 6: 800 7: 800
8: 800
Graphics: Device-1: Intel UHD Graphics 620 vendor: Lenovo driver: i915 v: kernel bus ID: 00:02.0
chip ID: 8086:5917
Device-2: IMC Networks Integrated Camera type: USB driver: uvcvideo bus ID: 1-8:2 chip ID: 13d3:584b
Display: server: X.org 1.20.8 driver: modesetting FAILED: fbdev,intel,vesa
Message: Advanced graphics data unavailable for root.
Description
- Create a DMA-BUF with
gbm_bo_create
- Import it into EGL as an EGLImage
- Create a RBO backed by the EGLImage, then create an FBO from that RBO
- Bind to the FBO, set the viewport, and call
glClearColor
+glClear
to paint the buffer red - Submit the DMA-BUF to KMS for display
Expected: the output is red. However with iris the output is black or scrambled. This only affects glClear
, drawing textures works fine.
All of this can be reproduced by running examples/simple
in a TTY from this wlroots branch: https://github.com/swaywm/wlroots/pull/2240
Works fine with i965 (and other drivers).