{
unsigned int pgnr;
struct hmm_buffer_object *bo;
- bool cached = attrs & ATOMISP_MAP_FLAG_CACHED;
int ret;
/*
}
/* Allocate pages for memory */
- ret = hmm_bo_alloc_pages(bo, type, from_highmem, userptr, cached);
+ ret = hmm_bo_alloc_pages(bo, type, from_highmem, userptr);
if (ret) {
dev_err(atomisp_dev, "hmm_bo_alloc_pages failed.\n");
goto alloc_page_err;
}
dev_dbg(atomisp_dev,
- "%s: pages: 0x%08x (%zu bytes), type: %d from highmem %d, user ptr %p, cached %d\n",
- __func__, bo->start, bytes, type, from_highmem, userptr, cached);
+ "%s: pages: 0x%08x (%zu bytes), type: %d from highmem %d, user ptr %p\n",
+ __func__, bo->start, bytes, type, from_highmem, userptr);
return bo->start;
/*Allocate pages which will be used only by ISP*/
static int alloc_private_pages(struct hmm_buffer_object *bo,
- int from_highmem,
- bool cached)
+ int from_highmem)
{
int ret;
unsigned int pgnr, order, blk_pgnr, alloc_pgnr;
} else {
blk_pgnr = order_to_nr(order);
- if (!cached) {
- /*
- * set memory to uncacheable -- UC_MINUS
- */
- ret = set_pages_uc(pages, blk_pgnr);
- if (ret) {
- dev_err(atomisp_dev,
- "set page uncacheablefailed.\n");
+ /*
+ * set memory to uncacheable -- UC_MINUS
+ */
+ ret = set_pages_uc(pages, blk_pgnr);
+ if (ret) {
+ dev_err(atomisp_dev,
+ "set page uncacheablefailed.\n");
- __free_pages(pages, order);
+ __free_pages(pages, order);
- goto cleanup;
- }
+ goto cleanup;
}
for (j = 0; j < blk_pgnr; j++, i++) {
* Convert user space virtual address into pages list
*/
static int alloc_user_pages(struct hmm_buffer_object *bo,
- const void __user *userptr, bool cached)
+ const void __user *userptr)
{
int page_nr;
int i;
*/
int hmm_bo_alloc_pages(struct hmm_buffer_object *bo,
enum hmm_bo_type type, int from_highmem,
- const void __user *userptr, bool cached)
+ const void __user *userptr)
{
int ret = -EINVAL;
* add HMM_BO_USER type
*/
if (type == HMM_BO_PRIVATE) {
- ret = alloc_private_pages(bo, from_highmem, cached);
+ ret = alloc_private_pages(bo, from_highmem);
} else if (type == HMM_BO_USER) {
- ret = alloc_user_pages(bo, userptr, cached);
+ ret = alloc_user_pages(bo, userptr);
} else {
dev_err(atomisp_dev, "invalid buffer type.\n");
ret = -EINVAL;