Commit 08674e98 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

atomisp: remove hmm_load/store/clear indirections

We have a layer of un-needed wrapping here that can go. In addition there are
some functions that don't exist and one that isn't used which can also go.
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f5a6ddaa
...@@ -2922,7 +2922,7 @@ int atomisp_get_metadata(struct atomisp_sub_device *asd, int flag, ...@@ -2922,7 +2922,7 @@ int atomisp_get_metadata(struct atomisp_sub_device *asd, int flag,
md_buf->md_vptr, md_buf->md_vptr,
stream_info->metadata_info.size); stream_info->metadata_info.size);
} else { } else {
hrt_isp_css_mm_load(md_buf->metadata->address, hmm_load(md_buf->metadata->address,
asd->params.metadata_user[md_type], asd->params.metadata_user[md_type],
stream_info->metadata_info.size); stream_info->metadata_info.size);
...@@ -3005,7 +3005,7 @@ int atomisp_get_metadata_by_type(struct atomisp_sub_device *asd, int flag, ...@@ -3005,7 +3005,7 @@ int atomisp_get_metadata_by_type(struct atomisp_sub_device *asd, int flag,
md_buf->md_vptr, md_buf->md_vptr,
stream_info->metadata_info.size); stream_info->metadata_info.size);
} else { } else {
hrt_isp_css_mm_load(md_buf->metadata->address, hmm_load(md_buf->metadata->address,
asd->params.metadata_user[md_type], asd->params.metadata_user[md_type],
stream_info->metadata_info.size); stream_info->metadata_info.size);
......
...@@ -1144,11 +1144,11 @@ static int remove_pad_from_frame(struct atomisp_device *isp, ...@@ -1144,11 +1144,11 @@ static int remove_pad_from_frame(struct atomisp_device *isp,
load += ISP_LEFT_PAD; load += ISP_LEFT_PAD;
for (i = 0; i < height; i++) { for (i = 0; i < height; i++) {
ret = hrt_isp_css_mm_load(load, buffer, width*sizeof(load)); ret = hmm_load(load, buffer, width*sizeof(load));
if (ret < 0) if (ret < 0)
goto remove_pad_error; goto remove_pad_error;
ret = hrt_isp_css_mm_store(store, buffer, width*sizeof(store)); ret = hmm_store(store, buffer, width*sizeof(store));
if (ret < 0) if (ret < 0)
goto remove_pad_error; goto remove_pad_error;
......
...@@ -52,22 +52,23 @@ mmgr_calloc(const size_t N, const size_t size) ...@@ -52,22 +52,23 @@ mmgr_calloc(const size_t N, const size_t size)
return mmgr_alloc_attr(size * N, MMGR_ATTRIBUTE_CLEARED); return mmgr_alloc_attr(size * N, MMGR_ATTRIBUTE_CLEARED);
} }
void void mmgr_clear(hrt_vaddress vaddr, const size_t size)
mmgr_clear(hrt_vaddress vaddr, const size_t size)
{ {
hrt_isp_css_mm_set(vaddr, 0, size); if (vaddr)
hmm_set(vaddr, 0, size);
} }
void void mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size)
mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size)
{ {
hrt_isp_css_mm_load(vaddr, data, size); if (vaddr && data)
hmm_load(vaddr, data, size);
} }
void void
mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size) mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size)
{ {
hrt_isp_css_mm_store(vaddr, data, size); if (vaddr && data)
hmm_store(vaddr, data, size);
} }
hrt_vaddress hrt_vaddress
......
...@@ -28,28 +28,6 @@ ...@@ -28,28 +28,6 @@
#define __page_align(size) (((size) + (PAGE_SIZE-1)) & (~(PAGE_SIZE-1))) #define __page_align(size) (((size) + (PAGE_SIZE-1)) & (~(PAGE_SIZE-1)))
int hrt_isp_css_mm_set(ia_css_ptr virt_addr, int c, size_t bytes)
{
if (virt_addr)
return hmm_set(virt_addr, c, bytes);
return -EFAULT;
}
int hrt_isp_css_mm_load(ia_css_ptr virt_addr, void *data, size_t bytes)
{
if (virt_addr && data)
return hmm_load(virt_addr, data, bytes);
return -EFAULT;
}
int hrt_isp_css_mm_store(ia_css_ptr virt_addr, const void *data, size_t bytes)
{
if (virt_addr && data)
return hmm_store(virt_addr, data, bytes);
return -EFAULT;
}
static void *my_userptr; static void *my_userptr;
static unsigned my_num_pages; static unsigned my_num_pages;
static enum hrt_userptr_type my_usr_type; static enum hrt_userptr_type my_usr_type;
...@@ -149,8 +127,3 @@ ia_css_ptr hrt_isp_css_mm_calloc_cached(size_t bytes) ...@@ -149,8 +127,3 @@ ia_css_ptr hrt_isp_css_mm_calloc_cached(size_t bytes)
return ptr; return ptr;
} }
phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr)
{
return hmm_virt_to_phys(virt_addr);
}
...@@ -44,8 +44,6 @@ struct hrt_userbuffer_attr { ...@@ -44,8 +44,6 @@ struct hrt_userbuffer_attr {
void hrt_isp_css_mm_set_user_ptr(void *userptr, void hrt_isp_css_mm_set_user_ptr(void *userptr,
unsigned int num_pages, enum hrt_userptr_type); unsigned int num_pages, enum hrt_userptr_type);
int hrt_isp_css_mm_set(ia_css_ptr virt_addr, int c, size_t bytes);
/* Allocate memory, returns a virtual address */ /* Allocate memory, returns a virtual address */
ia_css_ptr hrt_isp_css_mm_alloc(size_t bytes); ia_css_ptr hrt_isp_css_mm_alloc(size_t bytes);
ia_css_ptr hrt_isp_css_mm_alloc_user_ptr(size_t bytes, void *userptr, ia_css_ptr hrt_isp_css_mm_alloc_user_ptr(size_t bytes, void *userptr,
...@@ -59,22 +57,4 @@ ia_css_ptr hrt_isp_css_mm_alloc_cached(size_t bytes); ...@@ -59,22 +57,4 @@ ia_css_ptr hrt_isp_css_mm_alloc_cached(size_t bytes);
ia_css_ptr hrt_isp_css_mm_calloc(size_t bytes); ia_css_ptr hrt_isp_css_mm_calloc(size_t bytes);
ia_css_ptr hrt_isp_css_mm_calloc_cached(size_t bytes); ia_css_ptr hrt_isp_css_mm_calloc_cached(size_t bytes);
/* Store data to a virtual address */
int hrt_isp_css_mm_load(ia_css_ptr virt_addr, void *data, size_t bytes);
/* Load data from a virtual address */
int hrt_isp_css_mm_store(ia_css_ptr virt_addr, const void *data, size_t bytes);
int hrt_isp_css_mm_load_int(ia_css_ptr virt_addr, int *data);
int hrt_isp_css_mm_load_short(ia_css_ptr virt_addr, short *data);
int hrt_isp_css_mm_load_char(ia_css_ptr virt_addr, char *data);
int hrt_isp_css_mm_store_char(ia_css_ptr virt_addr, char data);
int hrt_isp_css_mm_store_short(ia_css_ptr virt_addr, short data);
int hrt_isp_css_mm_store_int(ia_css_ptr virt_addr, int data);
/* translate a virtual to a physical address, used to program
the display driver on the FPGA system */
phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr);
#endif /* _hive_isp_css_mm_hrt_h_ */ #endif /* _hive_isp_css_mm_hrt_h_ */
...@@ -89,15 +89,15 @@ void mmgr_clear( ...@@ -89,15 +89,15 @@ void mmgr_clear(
ia_css_ptr vaddr, ia_css_ptr vaddr,
const size_t size) const size_t size)
{ {
hrt_isp_css_mm_set(vaddr, 0, size); hmm_set(vaddr, 0, size);
} }
void mmgr_load(const ia_css_ptr vaddr, void *data, const size_t size) void mmgr_load(const ia_css_ptr vaddr, void *data, const size_t size)
{ {
hrt_isp_css_mm_load(vaddr, data, size); hmm_load(vaddr, data, size);
} }
void mmgr_store(const ia_css_ptr vaddr, const void *data, const size_t size) void mmgr_store(const ia_css_ptr vaddr, const void *data, const size_t size)
{ {
hrt_isp_css_mm_store(vaddr, data, size); hmm_store(vaddr, data, size);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment