secmem: CF1 add func copy paddr data to handle [2/2]

PD#OTT-40373

Problem:
vmx buffer manage

Solution:
1.ca/ta add support
2.gst secmem alloc add support

Verify:
S905X4

Change-Id: Ia618439aab263514089e59be4021629dd5b4717d
Signed-off-by: yichen.li <yichen.li@amlogic.com>
diff --git a/gst-aml-drm-plugins-1.0/src/secmem/gstsecmemallocator.c b/gst-aml-drm-plugins-1.0/src/secmem/gstsecmemallocator.c
index 6084b3a..46545f5 100644
--- a/gst-aml-drm-plugins-1.0/src/secmem/gstsecmemallocator.c
+++ b/gst-aml-drm-plugins-1.0/src/secmem/gstsecmemallocator.c
@@ -280,6 +280,20 @@
 }
 
 gboolean
+gst_secmem_fillbypaddr(GstMemory *mem, uint32_t src_paddr)
+{
+    uint32_t ret;
+    uint32_t handle;
+    handle = gst_secmem_memory_get_handle(mem);
+    g_return_val_if_fail(handle != 0, FALSE);
+    GST_INFO("mem->size %d", mem->size);
+    GstSecmemAllocator *self = GST_SECMEM_ALLOCATOR (mem->allocator);
+    ret = Secure_V2_MemFillByPaddr(self->sess, handle, src_paddr, mem->size);
+    g_return_val_if_fail(ret == 0, FALSE);
+    return TRUE;
+}
+
+gboolean
 gst_secmem_copybyhandle(GstMemory *mem, uint32_t src_handle, uint32_t range, uint32_t dst_offset[], uint32_t src_offset[], uint32_t size[])
 {
     uint32_t ret;
diff --git a/gst-aml-drm-plugins-1.0/src/secmem/gstsecmemallocator.h b/gst-aml-drm-plugins-1.0/src/secmem/gstsecmemallocator.h
index 592f426..f6e8255 100644
--- a/gst-aml-drm-plugins-1.0/src/secmem/gstsecmemallocator.h
+++ b/gst-aml-drm-plugins-1.0/src/secmem/gstsecmemallocator.h
@@ -75,6 +75,7 @@
 GstAllocator *  gst_secmem_allocator_new_ex (uint8_t decoder_format, uint32_t reserved);
 gboolean        gst_is_secmem_memory (GstMemory *mem);
 gboolean        gst_secmem_fill(GstMemory *mem, uint32_t offset, uint8_t *buffer, uint32_t length);
+gboolean        gst_secmem_fillbypaddr(GstMemory *mem, uint32_t src_paddr);
 gboolean        gst_secmem_copybyhandle(GstMemory *mem, uint32_t dst_handle, uint32_t range, uint32_t dst_offset[], uint32_t src_offset[], uint32_t size[]);
 gboolean        gst_secmem_store_csd(GstMemory *mem, uint8_t *buffer, uint32_t length);
 gboolean        gst_secmem_prepend_csd(GstMemory *mem);