Skip to content
  • Alex Villacís Lasso's avatar
    renderer/native: Fallback to non-planar API if gbm_bo_get_handle_for_plane fails · f7af32a3
    Alex Villacís Lasso authored and Jonas Ådahl's avatar Jonas Ådahl committed
    Commit c0d9b08e replaced the old GBM API calls
    with the multi-plane GBM API. However, the call to gbm_bo_get_handle_for_plane
    fails for some DRI drivers (in particular i915). Due to missing error checks,
    the subsequent call to drmModeAddFB[2] fails and the screen output locks up.
    
    This commit adds the missing error checks and falls back to the old GBM API
    (non-planar) if necessary.
    
    v5: test success of gbm_bo_get_handle_for_plane instead of errno
    
    This commit adopts solution proposed by Daniel van Vugt to check the return
    value of gbm_bo_get_handle_for_plane on plane 0 and fall back to old
    non-planar method if the call fails. This removes the errno check (for
    ENOSYS) that could abort if mesa ever sets a different value.
    
    Related to: GNOME/mutter#127
    f7af32a3