aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rpmsg/rpmsg_omx.c
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2011-08-06 22:56:41 -0500
committerIliyan Malchev <malchev@google.com>2011-08-11 15:00:46 -0700
commitab1b4697cedd861b82118a2fb1d58df5348d9d4a (patch)
tree19b3de69f5c5c7e832111460e268c1c6d3c2e3e6 /drivers/rpmsg/rpmsg_omx.c
parent3606ddbeb1c9203864fc06879c56351c402c6988 (diff)
downloadkernel_samsung_tuna-ab1b4697cedd861b82118a2fb1d58df5348d9d4a.zip
kernel_samsung_tuna-ab1b4697cedd861b82118a2fb1d58df5348d9d4a.tar.gz
kernel_samsung_tuna-ab1b4697cedd861b82118a2fb1d58df5348d9d4a.tar.bz2
rpmsg: omx: transmit remote processor virtual address
The rpmsg omx driver should convert the physical addresses into remote processor virtual addresses before transmitting them. Only TILER buffers are currently being sent, and the current code is functional since the physical address happens to be the same as virtual addresses on the ducati-side. TODO: use the actual rproc_pa_to_da function. Change-Id: I47db57ea01bfbb28666fd6afd276c07a0522fbc8 Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'drivers/rpmsg/rpmsg_omx.c')
-rw-r--r--drivers/rpmsg/rpmsg_omx.c45
1 files changed, 28 insertions, 17 deletions
diff --git a/drivers/rpmsg/rpmsg_omx.c b/drivers/rpmsg/rpmsg_omx.c
index e18bd62..9b1d66c 100644
--- a/drivers/rpmsg/rpmsg_omx.c
+++ b/drivers/rpmsg/rpmsg_omx.c
@@ -107,6 +107,8 @@ static LIST_HEAD(rpmsg_omx_services_list);
static u32 _rpmsg_omx_buffer_lookup(struct rpmsg_omx_instance *omx, long buffer)
{
+ phys_addr_t pa;
+ u32 va;
#ifdef CONFIG_ION_OMAP
struct ion_handle *handle;
ion_phys_addr_t paddr;
@@ -115,8 +117,10 @@ static u32 _rpmsg_omx_buffer_lookup(struct rpmsg_omx_instance *omx, long buffer)
/* is it an ion handle? */
handle = (struct ion_handle *)buffer;
- if (!ion_phys(omx->ion_client, handle, &paddr, &unused))
- return (u32)paddr;
+ if (!ion_phys(omx->ion_client, handle, &paddr, &unused)) {
+ pa = (phys_addr_t) paddr;
+ goto to_va;
+ }
#ifdef CONFIG_PVR_SGX
/* how about an sgx buffer wrapping an ion handle? */
@@ -124,12 +128,21 @@ static u32 _rpmsg_omx_buffer_lookup(struct rpmsg_omx_instance *omx, long buffer)
struct ion_client *pvr_ion_client;
fd = buffer;
handle = PVRSRVExportFDToIONHandle(fd, &pvr_ion_client);
- if (handle && !ion_phys(pvr_ion_client, handle, &paddr, &unused))
- return (u32)paddr;
+ if (handle &&
+ !ion_phys(pvr_ion_client, handle, &paddr, &unused)) {
+ pa = (phys_addr_t)paddr;
+ goto to_va;
+ }
}
#endif
#endif
- return tiler_virt2phys(buffer);
+ pa = (phys_addr_t) tiler_virt2phys(buffer);
+
+#ifdef CONFIG_ION_OMAP
+to_va:
+#endif
+ va = pa; /* TODO: return actual va */
+ return va;
}
static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
@@ -138,7 +151,7 @@ static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
long *buffer;
char *data;
enum rpc_omx_map_info_type maptype;
- u32 pa = 0;
+ u32 da = 0;
data = (char *)((struct omx_packet *)packet)->data;
maptype = *((enum rpc_omx_map_info_type *)data);
@@ -154,10 +167,9 @@ static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
offset = *(int *)((int)data + sizeof(maptype));
buffer = (long *)((int)data + offset);
- pa = _rpmsg_omx_buffer_lookup(omx, *buffer);
-
- if (pa) {
- *buffer = pa;
+ da = _rpmsg_omx_buffer_lookup(omx, *buffer);
+ if (da) {
+ *buffer = da;
ret = 0;
}
@@ -165,10 +177,9 @@ static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
buffer = (long *)((int)data + offset + sizeof(*buffer));
if (*buffer != 0) {
ret = -EIO;
- pa = _rpmsg_omx_buffer_lookup(omx, *buffer);
-
- if (pa) {
- *buffer = pa;
+ da = _rpmsg_omx_buffer_lookup(omx, *buffer);
+ if (da) {
+ *buffer = da;
ret = 0;
}
}
@@ -178,9 +189,9 @@ static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
buffer = (long *)((int)data + offset + 2*sizeof(*buffer));
if (*buffer != 0) {
ret = -EIO;
- pa = _rpmsg_omx_buffer_lookup(omx, *buffer);
- if (pa) {
- *buffer = pa;
+ da = _rpmsg_omx_buffer_lookup(omx, *buffer);
+ if (da) {
+ *buffer = da;
ret = 0;
}
}