MMFMWK-7970 [8qxp] g2d support VPU tiled format.
g2d compositor support VPU tiled format.
Signed-off-by: Song Bing <bing.song@nxp.com>
diff --git a/plugins/compositor/gstimxcompositor.c b/plugins/compositor/gstimxcompositor.c
index 7aa41aa..e714f2a 100755
--- a/plugins/compositor/gstimxcompositor.c
+++ b/plugins/compositor/gstimxcompositor.c
@@ -120,6 +120,8 @@
#include <string.h>
#include <gst/allocators/gstdmabuf.h>
+#include <gst/allocators/gstdmabufmeta.h>
+#include <libdrm/drm_fourcc.h>
#include <gst/allocators/gstallocatorphymem.h>
#include <gst/allocators/gstphymemmeta.h>
#ifdef USE_ION
@@ -1146,6 +1148,8 @@
{
GstVideoAggregatorPad *ppad = (GstVideoAggregatorPad *)pad;
guint i, n_mem;
+ GstDmabufMeta *dmabuf_meta;
+ gint64 drm_modifier = 0;
src->info.fmt = GST_VIDEO_INFO_FORMAT(&(ppad->aggregated_frame->info));
src->info.w = ppad->aggregated_frame->info.width +
@@ -1154,6 +1158,15 @@
pad->align.padding_top + pad->align.padding_bottom;
src->info.stride = ppad->aggregated_frame->info.stride[0];
+ dmabuf_meta = gst_buffer_get_dmabuf_meta (ppad->aggregated_frame->buffer);
+ if (dmabuf_meta)
+ drm_modifier = dmabuf_meta->drm_modifier;
+
+ GST_INFO_OBJECT (pad, "buffer modifier type %d", drm_modifier);
+
+ if (drm_modifier == DRM_FORMAT_MOD_AMPHION_TILED)
+ src->info.tile_type = IMX_2D_TILE_AMHPION;
+
GST_LOG_OBJECT (pad, "Input: %s, %dx%d(%d), crop(%d,%d,%d,%d)",
GST_VIDEO_FORMAT_INFO_NAME(ppad->aggregated_frame->info.finfo),
src->info.w, src->info.h, src->info.stride,