kmssink: align fb width to 8 and height to 256
dpu drm driver did atomic check for this alignment.
upstream status: imx specific
Signed-off-by: Haihua Hu <jared.hu@nxp.com>
diff --git a/sys/kms/gstkmsallocator.c b/sys/kms/gstkmsallocator.c
index 552ce5a..2258e58 100644
--- a/sys/kms/gstkmsallocator.c
+++ b/sys/kms/gstkmsallocator.c
@@ -34,6 +34,7 @@
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
+#include <drm_fourcc.h>
/* it needs to be below because is internal to libdrm */
#include <drm.h>
@@ -466,6 +467,12 @@
GST_DEBUG_OBJECT (alloc, "bo handles: %d, %d, %d, %d", bo_handles[0],
bo_handles[1], bo_handles[2], bo_handles[3]);
+ if (drm_modifier == DRM_FORMAT_MOD_AMPHION_TILED) {
+ /* for qxp, dpu need fb width align to 8
+ * and height align to 256 */
+ w = GST_ROUND_UP_8 (w);
+ h = GST_ROUND_UP_N (h, 256);
+ }
if (drm_modifier) {
ret = drmModeAddFB2WithModifiers (alloc->priv->fd, w, h, fmt, bo_handles, pitches,