camera: Store the data offsets for each planes.

- When the user queues a buffer, store the data offset
  along with the address offset which is already stored.
  data offset indicates the offset of the data in the
  buffer.
- Use this offset when the physical address of the
  buffer is configured to VFE.
- Depending on the number of planes present in the
  buffer, store either the y, cbr offset or the
  offset of each plane.

Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
diff --git a/drivers/media/video/videobuf2-msm-mem.c b/drivers/media/video/videobuf2-msm-mem.c
index 74debe1..d765244 100644
--- a/drivers/media/video/videobuf2-msm-mem.c
+++ b/drivers/media/video/videobuf2-msm-mem.c
@@ -124,10 +124,16 @@
 	kfree(mem);
 }
 int videobuf2_pmem_contig_mmap_get(struct videobuf2_contig_pmem *mem,
-					uint32_t offset, int path)
+				struct videobuf2_msm_offset *offset,
+				enum videobuf2_buffer_type buffer_type,
+				int path)
 {
-	mem->offset = offset;
-	mem->buffer_type = path;
+	if (offset)
+		mem->offset = *offset;
+	else
+		memset(&mem->offset, 0, sizeof(struct videobuf2_msm_offset));
+	mem->buffer_type = buffer_type;
+	mem->path = path;
 	return 0;
 }
 EXPORT_SYMBOL_GPL(videobuf2_pmem_contig_mmap_get);
@@ -143,7 +149,8 @@
  * Returns 0 if successful.
  */
 int videobuf2_pmem_contig_user_get(struct videobuf2_contig_pmem *mem,
-					uint32_t offset,
+					struct videobuf2_msm_offset *offset,
+					enum videobuf2_buffer_type buffer_type,
 					uint32_t addr_offset, int path)
 {
 	unsigned long kvstart;
@@ -161,8 +168,12 @@
 					__func__, (int)mem->vaddr, rc);
 		return rc;
 	}
-	mem->offset = offset;
-	mem->buffer_type = path;
+	if (offset)
+		mem->offset = *offset;
+	else
+		memset(&mem->offset, 0, sizeof(struct videobuf2_msm_offset));
+	mem->path = path;
+	mem->buffer_type = buffer_type;
 	flags = MSM_SUBSYSTEM_MAP_IOVA;
 	mem->subsys_id = MSM_SUBSYSTEM_CAMERA;
 	mem->msm_buffer = msm_subsystem_map_buffer(mem->phyaddr, len,