minigbm: refactor to add unified resolve_format_and_use_flags helper

It makes more sense to resovle the format and use_flags together to
avoid duplicates.

Add the helper to vc4 and dumb_driver backends since that's missed
from prior frontend refactoring.

Split the resolve helper in virtgpu_virgl for the 3d and 2d paths to
make code logic cleaner.

BUG=b:199524294
TEST=CQ

Change-Id: I89b633ea484f0fc5bb9b4e0548cad017b9970cc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3200143
Tested-by: Yiwei Zhang <[email protected]>
Tested-by: Jason Macnak <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Reviewed-by: Jason Macnak <[email protected]>
Reviewed-by: Dominik Behr <[email protected]>
Commit-Queue: Yiwei Zhang <[email protected]>
16 files changed