Hi,
I would like to propose a patch for weston-imx to fix problem Weston backend-drm fails to propose mixed-mode state.
Problem
When play video with GStreamer in Weston with g2d renderer (on i.MX8QM), video view cannot be assigned to plane.
gst-launch-1.0 filesrc location=720p.mkv ! matroskademux \
! h264parse ! v4l2h264dec ! queue \
! waylandsink window-width=1280 window-height=720Expected result:
Video view can be assigned to overlay plane.
Actual result:
Weston "cannot propose mixed mode" and video view use renderer composition.
# weston-debug drm-backend
...
[repaint] could not build planes-only state, trying mixed
[state] cannot propose mixed mode for output HDMI-A-1 (0): previous fb has different size
...
[repaint] Using render-only state composition
[repaint] view 0xaaab0effb720 using renderer composition
Reason
- When drm_fb_addfb, fb width and height are not always aligned. However, when propose mixed-mode state, scanout fb is always compared to aligned output size with 'gbm_aligned' default to 64. In case modifier is not DRM_FORMAT_MOD_VIVANTE_SUPER_TILED, Weston will fail to try mixed-mode state, and no view can be assigned to plane.
- Align for width and height are not always same. If modifier is DRM_FORMAT_MOD_AMPHION_TILED, fb width will be aligned to 8 while height will be aligned to 256. However, drm_fb_get_gbm_alignment only returns a single value for both width and height.
Fix
- Change default value of 'gbm_aligned' to 1.
- Change drm_fb_get_gbm_alignment's return value to a struct, which contains separate values for align width and height.