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.com Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
4cc20c9cdd
commit
975c343f85
|
@ -130,7 +130,6 @@ struct hmm_buffer_object {
|
|||
struct mutex mutex;
|
||||
enum hmm_bo_type type;
|
||||
struct hmm_page_object *page_obj; /* physical pages */
|
||||
int from_highmem;
|
||||
int mmap_count;
|
||||
int status;
|
||||
int mem_type;
|
||||
|
@ -214,13 +213,12 @@ void hmm_bo_unref(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
|
||||
* from highmem if from_highmem is set, and type indicate that the
|
||||
* Allocate/Free physical pages for the bo. Type indicates if the
|
||||
* pages will be allocated by using video driver (for share buffer)
|
||||
* or by ISP driver itself.
|
||||
*/
|
||||
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);
|
||||
void hmm_bo_free_pages(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 __
|
|||
}
|
||||
|
||||
/* Allocate pages for memory */
|
||||
ret = hmm_bo_alloc_pages(bo, type, false, userptr);
|
||||
ret = hmm_bo_alloc_pages(bo, type, userptr);
|
||||
if (ret) {
|
||||
dev_err(atomisp_dev, "hmm_bo_alloc_pages failed.\n");
|
||||
goto alloc_page_err;
|
||||
|
|
|
@ -650,8 +650,7 @@ static void free_private_bo_pages(struct hmm_buffer_object *bo,
|
|||
}
|
||||
|
||||
/*Allocate pages which will be used only by ISP*/
|
||||
static int alloc_private_pages(struct hmm_buffer_object *bo,
|
||||
int from_highmem)
|
||||
static int alloc_private_pages(struct hmm_buffer_object *bo)
|
||||
{
|
||||
int ret;
|
||||
unsigned int pgnr, order, blk_pgnr, alloc_pgnr;
|
||||
|
@ -662,9 +661,6 @@ static int alloc_private_pages(struct hmm_buffer_object *bo,
|
|||
bool reduce_order = false;
|
||||
bool lack_mem = true;
|
||||
|
||||
if (from_highmem)
|
||||
gfp |= __GFP_HIGHMEM;
|
||||
|
||||
pgnr = bo->pgnr;
|
||||
|
||||
bo->page_obj = kmalloc_array(pgnr, sizeof(struct hmm_page_object),
|
||||
|
@ -881,9 +877,6 @@ out_of_mem:
|
|||
* type indicate where are the pages from. currently we have 3 types
|
||||
* 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
|
||||
* the start address from user space task.
|
||||
*
|
||||
|
@ -891,7 +884,7 @@ out_of_mem:
|
|||
* HMM_BO_SHARE.
|
||||
*/
|
||||
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)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
|
@ -906,7 +899,7 @@ int hmm_bo_alloc_pages(struct hmm_buffer_object *bo,
|
|||
* add HMM_BO_USER type
|
||||
*/
|
||||
if (type == HMM_BO_PRIVATE) {
|
||||
ret = alloc_private_pages(bo, from_highmem);
|
||||
ret = alloc_private_pages(bo);
|
||||
} else if (type == HMM_BO_USER) {
|
||||
ret = alloc_user_pages(bo, userptr);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue