mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-08 00:29:36 -04:00
media: atomisp: add hmm_create_from_userdata() helper
Most hmm_alloc() callers want BO_PRIVATE type memory. Add a hmm_create_from_userdata() helper for other cases so that the hmm_alloc() calls for all the callers who don't want this can be simplied. Link: https://lore.kernel.org/linux-media/20220615205037.16549-29-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:
committed by
Mauro Carvalho Chehab
parent
a9796c7b47
commit
ceff4bdb60
@@ -39,6 +39,7 @@ void hmm_cleanup(void);
|
||||
ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
|
||||
int from_highmem, const void __user *userptr,
|
||||
const uint16_t attrs);
|
||||
ia_css_ptr hmm_create_from_userdata(size_t bytes, const void __user *userptr);
|
||||
void hmm_free(ia_css_ptr ptr);
|
||||
int hmm_load(ia_css_ptr virt, void *data, unsigned int bytes);
|
||||
int hmm_store(ia_css_ptr virt, const void *data, unsigned int bytes);
|
||||
|
||||
@@ -221,6 +221,11 @@ ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
|
||||
return 0;
|
||||
}
|
||||
|
||||
ia_css_ptr hmm_create_from_userdata(size_t bytes, const void __user *userptr)
|
||||
{
|
||||
return hmm_alloc(bytes, HMM_BO_USER, 0, userptr, 0);
|
||||
}
|
||||
|
||||
void hmm_free(ia_css_ptr virt)
|
||||
{
|
||||
struct hmm_buffer_object *bo;
|
||||
|
||||
@@ -171,7 +171,7 @@ int ia_css_frame_map(struct ia_css_frame **frame,
|
||||
goto error;
|
||||
}
|
||||
|
||||
me->data = hmm_alloc(me->data_bytes, HMM_BO_USER, 0, data, 0);
|
||||
me->data = hmm_create_from_userdata(me->data_bytes, data);
|
||||
if (me->data == mmgr_NULL)
|
||||
err = -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user