This change adds behavior to pad the requested buffer size when the
BO_USE_CURSOR flag is set. This change is required due to restrictions
on cursor planes with the i915 driver, where a buffer must be of a
particular size in order to be committed to a cursor plane. The exact
requirements can be queried from the DRM_CAP_CURSOR_{WIDTH|HEIGHT}
properties, which if provided, will specify a known acceptable cursor
buffer size. After this change, if the BO_USE_CURSOR flag is set and the
requested size is less than indicated capability, the resulting buffer
will be padded according to the difference.
Bug: b/378461707 , b/388014686
Change-Id: I451421cc784d1e3fdc83eb4e9762d6f0f4caea7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6282179
Tested-by: Andrew Wolfers <aswolfers@chromium.org>
Reviewed-by: Lina Versace <linyaa@google.com>
Commit-Queue: Andrew Wolfers <aswolfers@chromium.org>