Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5f70bdc authored by Arun Menon's avatar Arun Menon Committed by Jorge Solano Altamirano
Browse files

msm: vidc: do not expose smem apis directly to kernel clients



All the smem apis will be exposed through msm vidc
layer.

Change-Id: I495fb1097cca5bf429cb8e5cab104485f415036f
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent 5c5a3763
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@
#include <linux/timer.h>
#include <mach/iommu_domains.h>
#include <media/msm_vidc.h>
#include <media/msm_smem.h>
#include "dvbdev.h"
#include "mpq_adapter.h"
#include "mpq_stream_buffer.h"
@@ -509,7 +508,7 @@ static int mpq_v4l2_queue_input_buffer(
	plane[0].data_offset = pbinfo->offset;
	buf.m.planes = plane;
	if (pbinfo->handle) {
		rc = msm_smem_cache_operations(v4l2_inst->mem_client,
		rc = msm_vidc_smem_cache_operations(v4l2_inst->vidc_inst,
			pbinfo->handle, SMEM_CACHE_CLEAN);
		if (rc)
			ERR("[%s] Failed to clean caches: %d\n", __func__, rc);
@@ -622,7 +621,7 @@ static int mpq_v4l2_deque_output_buffer(
	v4l2_inst->buf_info[CAPTURE_PORT][buf.index].bytesused =
		buf.m.planes[0].bytesused;
	if (v4l2_inst->buf_info[CAPTURE_PORT][buf.index].handle) {
		rc = msm_smem_cache_operations(v4l2_inst->mem_client,
		rc = msm_vidc_smem_cache_operations(v4l2_inst->vidc_inst,
			v4l2_inst->buf_info[CAPTURE_PORT][buf.index].handle,
			SMEM_CACHE_INVALIDATE);
		if (rc)
@@ -670,7 +669,7 @@ static int mpq_v4l2_prepare_buffer(
	}
	buf.m.planes = plane;
	if (pbinfo->handle) {
		rc = msm_smem_cache_operations(v4l2_inst->mem_client,
		rc = msm_vidc_smem_cache_operations(v4l2_inst->vidc_inst,
			pbinfo->handle, SMEM_CACHE_CLEAN);
		if (rc)
			ERR("[%s]Failed to clean caches: %d\n", __func__, rc);
@@ -706,7 +705,7 @@ static int mpq_translate_from_dvb_buf(
		pbinfo->buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
	else
		pbinfo->buf_type =  V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
	handle = msm_smem_user_to_kernel(v4l2_inst->mem_client,
	handle = msm_vidc_smem_user_to_kernel(v4l2_inst->vidc_inst,
				pbinfo->fd, pbinfo->buf_offset,
				(port_num == OUTPUT_PORT) ?
				HAL_BUFFER_OUTPUT : HAL_BUFFER_INPUT);
@@ -1487,8 +1486,7 @@ static int mpq_dvb_open_v4l2(
		DBG("Enum fmt: description: %s, fmt: %x, flags = %x\n",
			fdesc.description, fdesc.pixelformat, fdesc.flags);
	}
	v4l2_inst->mem_client = msm_smem_new_client(SMEM_ION,
		msm_vidc_get_resources(v4l2_inst->vidc_inst));
	v4l2_inst->mem_client = msm_vidc_smem_get_client(v4l2_inst->vidc_inst);
	if (!v4l2_inst->mem_client) {
		ERR("Failed to create SMEM Client\n");
		rc = -ENOMEM;
@@ -1538,8 +1536,6 @@ static int mpq_dvb_close_v4l2(
				v4l2_inst->buf_info[OUTPUT_PORT][0].handle);
		}
	}
	DBG("Close MSM MEM Client\n");
	msm_smem_delete_client(v4l2_inst->mem_client);
	DBG("Close MSM VIDC Decoder\n");
	rc = msm_vidc_close(v4l2_inst->vidc_inst);
	DBG("MSM VIDC Decoder Closed\n");
+2 −8
Original line number Diff line number Diff line
@@ -12,8 +12,9 @@
 */

#include <linux/slab.h>
#include <linux/msm_ion.h>
#include <linux/types.h>
#include <mach/iommu_domains.h>
#include <media/msm_smem.h>
#include "msm_vidc_resources.h"
#include "msm_vidc_debug.h"

@@ -320,7 +321,6 @@ struct msm_smem *msm_smem_user_to_kernel(void *clt, int fd, u32 offset,
	}
	return mem;
}
EXPORT_SYMBOL(msm_smem_user_to_kernel);

static int ion_cache_operations(struct smem_client *client,
	struct msm_smem *mem, enum smem_cache_ops cache_op)
@@ -393,7 +393,6 @@ int msm_smem_cache_operations(void *clt, struct msm_smem *mem,
	}
	return rc;
}
EXPORT_SYMBOL(msm_smem_cache_operations);

void *msm_smem_new_client(enum smem_type mtype,
		void *platform_resources)
@@ -422,7 +421,6 @@ void *msm_smem_new_client(enum smem_type mtype,
	}
	return client;
}
EXPORT_SYMBOL(msm_smem_new_client);

struct msm_smem *msm_smem_alloc(void *clt, size_t size, u32 align, u32 flags,
		enum hal_buffer buffer_type, int map_kernel)
@@ -462,7 +460,6 @@ struct msm_smem *msm_smem_alloc(void *clt, size_t size, u32 align, u32 flags,
	}
	return mem;
}
EXPORT_SYMBOL(msm_smem_alloc);

void msm_smem_free(void *clt, struct msm_smem *mem)
{
@@ -481,7 +478,6 @@ void msm_smem_free(void *clt, struct msm_smem *mem)
	}
	kfree(mem);
};
EXPORT_SYMBOL(msm_smem_free);

void msm_smem_delete_client(void *clt)
{
@@ -500,7 +496,6 @@ void msm_smem_delete_client(void *clt)
	}
	kfree(client);
}
EXPORT_SYMBOL(msm_smem_delete_client);

int msm_smem_get_domain_partition(void *clt, u32 flags, enum hal_buffer
		buffer_type, int *domain_num, int *partition_num)
@@ -539,5 +534,4 @@ int msm_smem_get_domain_partition(void *clt, u32 flags, enum hal_buffer
			*domain_num, *partition_num);
	return 0;
}
EXPORT_SYMBOL(msm_smem_get_domain_partition);
+0 −1
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@

#include <linux/slab.h>
#include <mach/scm.h>
#include <media/msm_smem.h>
#include "msm_vidc_internal.h"
#include "msm_vidc_common.h"
#include "vidc_hfi_api.h"
+0 −2
Original line number Diff line number Diff line
@@ -11,8 +11,6 @@
 *
 */
#include <linux/slab.h>
#include <media/msm_smem.h>

#include "msm_vidc_internal.h"
#include "msm_vidc_common.h"
#include "vidc_hfi_api.h"
+0 −13
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <media/msm_vidc.h>
#include <media/msm_smem.h>
#include "msm_vidc_internal.h"
#include "msm_vidc_debug.h"
#include "msm_vdec.h"
@@ -97,18 +96,6 @@ int msm_vidc_get_iommu_domain_partition(void *instance, u32 flags,
}
EXPORT_SYMBOL(msm_vidc_get_iommu_domain_partition);

void *msm_vidc_get_resources(void *instance)
{
	struct msm_vidc_inst *inst = instance;
	struct msm_vidc_platform_resources *res = NULL;

	if (inst != NULL && inst->core != NULL)
		res = &inst->core->resources;

	return res;
}
EXPORT_SYMBOL(msm_vidc_get_resources);

int msm_vidc_querycap(void *instance, struct v4l2_capability *cap)
{
	struct msm_vidc_inst *inst = instance;
Loading