summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-06-15 21:50:27 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-07-08 16:33:20 +0100
commit975c343f857a3145f24e3630107a43be1ee9e433 (patch)
treeb9dc4ca388f37527beb036541a641f52d73778bd /drivers/staging/media/atomisp
parent4cc20c9cdd0d8c3479626c35e6db0af1a5dfd681 (diff)
downloadlinux-975c343f857a3145f24e3630107a43be1ee9e433.tar.bz2
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>
Diffstat (limited to 'drivers/staging/media/atomisp')
-rw-r--r--drivers/staging/media/atomisp/include/hmm/hmm_bo.h6
-rw-r--r--drivers/staging/media/atomisp/pci/hmm/hmm.c2
-rw-r--r--drivers/staging/media/atomisp/pci/hmm/hmm_bo.c13
3 files changed, 6 insertions, 15 deletions
diff --git a/drivers/staging/media/atomisp/include/hmm/hmm_bo.h b/drivers/staging/media/atomisp/include/hmm/hmm_bo.h
index 44eb4d3039f5..5ed83e1aaa79 100644
--- a/drivers/staging/media/atomisp/include/hmm/hmm_bo.h
+++ b/drivers/staging/media/atomisp/include/hmm/hmm_bo.h
@@ -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);
diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm.c b/drivers/staging/media/atomisp/pci/hmm/hmm.c
index a5d725908052..84a52514df16 100644
--- a/drivers/staging/media/atomisp/pci/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/hmm/hmm.c
@@ -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;
diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
index 357f34fb7aef..a6b7f2b6247f 100644
--- a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
@@ -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 {