media: atomisp: drop highmem var/arg from the hmm code
authorHans de Goede <hdegoede@redhat.com>
Wed, 15 Jun 2022 20:50:27 +0000 (21:50 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 15:33:20 +0000 (16:33 +0100)
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>
drivers/staging/media/atomisp/include/hmm/hmm_bo.h
drivers/staging/media/atomisp/pci/hmm/hmm.c
drivers/staging/media/atomisp/pci/hmm/hmm_bo.c

index 44eb4d3039f57ef4686407ffa66fe6f502b14480..5ed83e1aaa79e734b604e1fc82d4d7a3295d3c28 100644 (file)
@@ -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);
index a5d725908052da742b36ebc6b58c82758c61202a..84a52514df16456e7d162e381531000c6713b12a 100644 (file)
@@ -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;
index 357f34fb7aef2ea34aa8d96722309c699d29cc04..a6b7f2b6247f517aa675ad6c7aea78c5ac099895 100644 (file)
@@ -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 {