Commit 975c343f authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp: drop highmem var/arg from the hmm code

highmem is always false, drop it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-31-hdegoede@redhat.comReviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 4cc20c9c
...@@ -130,7 +130,6 @@ struct hmm_buffer_object { ...@@ -130,7 +130,6 @@ struct hmm_buffer_object {
struct mutex mutex; struct mutex mutex;
enum hmm_bo_type type; enum hmm_bo_type type;
struct hmm_page_object *page_obj; /* physical pages */ struct hmm_page_object *page_obj; /* physical pages */
int from_highmem;
int mmap_count; int mmap_count;
int status; int status;
int mem_type; int mem_type;
...@@ -214,13 +213,12 @@ void hmm_bo_unref(struct hmm_buffer_object *bo); ...@@ -214,13 +213,12 @@ void hmm_bo_unref(struct hmm_buffer_object *bo);
int hmm_bo_allocated(struct hmm_buffer_object *bo); int hmm_bo_allocated(struct hmm_buffer_object *bo);
/* /*
* allocate/free physical pages for the bo. will try to alloc mem * Allocate/Free physical pages for the bo. Type indicates if the
* from highmem if from_highmem is set, and type indicate that the
* pages will be allocated by using video driver (for share buffer) * pages will be allocated by using video driver (for share buffer)
* or by ISP driver itself. * or by ISP driver itself.
*/ */
int hmm_bo_alloc_pages(struct hmm_buffer_object *bo, int hmm_bo_alloc_pages(struct hmm_buffer_object *bo,
enum hmm_bo_type type, int from_highmem, enum hmm_bo_type type,
const void __user *userptr); const void __user *userptr);
void hmm_bo_free_pages(struct hmm_buffer_object *bo); void hmm_bo_free_pages(struct hmm_buffer_object *bo);
int hmm_bo_page_allocated(struct hmm_buffer_object *bo); int hmm_bo_page_allocated(struct hmm_buffer_object *bo);
......
...@@ -192,7 +192,7 @@ static ia_css_ptr __hmm_alloc(size_t bytes, enum hmm_bo_type type, const void __ ...@@ -192,7 +192,7 @@ static ia_css_ptr __hmm_alloc(size_t bytes, enum hmm_bo_type type, const void __
} }
/* Allocate pages for memory */ /* Allocate pages for memory */
ret = hmm_bo_alloc_pages(bo, type, false, userptr); ret = hmm_bo_alloc_pages(bo, type, userptr);
if (ret) { if (ret) {
dev_err(atomisp_dev, "hmm_bo_alloc_pages failed.\n"); dev_err(atomisp_dev, "hmm_bo_alloc_pages failed.\n");
goto alloc_page_err; goto alloc_page_err;
......
...@@ -650,8 +650,7 @@ static void free_private_bo_pages(struct hmm_buffer_object *bo, ...@@ -650,8 +650,7 @@ static void free_private_bo_pages(struct hmm_buffer_object *bo,
} }
/*Allocate pages which will be used only by ISP*/ /*Allocate pages which will be used only by ISP*/
static int alloc_private_pages(struct hmm_buffer_object *bo, static int alloc_private_pages(struct hmm_buffer_object *bo)
int from_highmem)
{ {
int ret; int ret;
unsigned int pgnr, order, blk_pgnr, alloc_pgnr; unsigned int pgnr, order, blk_pgnr, alloc_pgnr;
...@@ -662,9 +661,6 @@ static int alloc_private_pages(struct hmm_buffer_object *bo, ...@@ -662,9 +661,6 @@ static int alloc_private_pages(struct hmm_buffer_object *bo,
bool reduce_order = false; bool reduce_order = false;
bool lack_mem = true; bool lack_mem = true;
if (from_highmem)
gfp |= __GFP_HIGHMEM;
pgnr = bo->pgnr; pgnr = bo->pgnr;
bo->page_obj = kmalloc_array(pgnr, sizeof(struct hmm_page_object), bo->page_obj = kmalloc_array(pgnr, sizeof(struct hmm_page_object),
...@@ -881,9 +877,6 @@ static int alloc_user_pages(struct hmm_buffer_object *bo, ...@@ -881,9 +877,6 @@ static int alloc_user_pages(struct hmm_buffer_object *bo,
* type indicate where are the pages from. currently we have 3 types * type indicate where are the pages from. currently we have 3 types
* of memory: HMM_BO_PRIVATE, HMM_BO_USER, HMM_BO_SHARE. * of memory: HMM_BO_PRIVATE, HMM_BO_USER, HMM_BO_SHARE.
* *
* from_highmem is only valid when type is HMM_BO_PRIVATE, it will
* try to alloc memory from highmem if from_highmem is set.
*
* userptr is only valid when type is HMM_BO_USER, it indicates * userptr is only valid when type is HMM_BO_USER, it indicates
* the start address from user space task. * the start address from user space task.
* *
...@@ -891,7 +884,7 @@ static int alloc_user_pages(struct hmm_buffer_object *bo, ...@@ -891,7 +884,7 @@ static int alloc_user_pages(struct hmm_buffer_object *bo,
* HMM_BO_SHARE. * HMM_BO_SHARE.
*/ */
int hmm_bo_alloc_pages(struct hmm_buffer_object *bo, int hmm_bo_alloc_pages(struct hmm_buffer_object *bo,
enum hmm_bo_type type, int from_highmem, enum hmm_bo_type type,
const void __user *userptr) const void __user *userptr)
{ {
int ret = -EINVAL; int ret = -EINVAL;
...@@ -906,7 +899,7 @@ int hmm_bo_alloc_pages(struct hmm_buffer_object *bo, ...@@ -906,7 +899,7 @@ int hmm_bo_alloc_pages(struct hmm_buffer_object *bo,
* add HMM_BO_USER type * add HMM_BO_USER type
*/ */
if (type == HMM_BO_PRIVATE) { if (type == HMM_BO_PRIVATE) {
ret = alloc_private_pages(bo, from_highmem); ret = alloc_private_pages(bo);
} else if (type == HMM_BO_USER) { } else if (type == HMM_BO_USER) {
ret = alloc_user_pages(bo, userptr); ret = alloc_user_pages(bo, userptr);
} else { } else {
......
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