Displaying 20 results from an estimated 56 matches for "userptr".
Did you mean:
user_ptr
2020 Aug 11
3
[PATCH] drm/nouveau/gem: Use vmemdup_user() rather than duplicating its implementation
...a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 81f111ad3f4f..7ef6221408af 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -587,15 +587,9 @@ u_memcpya(uint64_t user, unsigned nmemb, unsigned size)
void __user *userptr = (void __force __user *)(uintptr_t)user;
size *= nmemb;
-
- mem = kvmalloc(size, GFP_KERNEL);
- if (!mem)
- return ERR_PTR(-ENOMEM);
-
- if (copy_from_user(mem, userptr, size)) {
- u_free(mem);
- return ERR_PTR(-EFAULT);
- }
+ mem = vmemdup_user(userptr, size);
+ if (IS_ERR(mem))
+ return E...
2019 Aug 06
2
[PATCH 15/15] amdgpu: remove CONFIG_DRM_AMDGPU_USERPTR
...amd/amdgpu/amdgpu_ttm.h | 12 ------------
> >> 4 files changed, 2 insertions(+), 28 deletions(-)
> > Felix, was this an effort to avoid the arch restriction on hmm or
> > something? Also can't see why this was like this.
>
> This option predates KFD's support of userptrs, which in turn predates
> HMM. Radeon has the same kind of option, though it doesn't affect HMM in
> that case.
>
> Alex, Christian, can you think of a good reason to maintain userptr
> support as an option in amdgpu? I suspect it was originally meant as a
> way to allow kern...
2013 Sep 02
2
[PATCH] drm/nouveau: fix command submission to use vmalloc for big allocations
...veau_gem_pushbuf_validate(struct nouveau_channel *chan,
return 0;
}
+static inline void
+u_free(void *addr)
+{
+ if (!is_vmalloc_addr(addr))
+ kfree(addr);
+ else
+ vfree(addr);
+}
+
static inline void *
u_memcpya(uint64_t user, unsigned nmemb, unsigned size)
{
void *mem;
void __user *userptr = (void __force __user *)(uintptr_t)user;
- mem = kmalloc(nmemb * size, GFP_KERNEL);
+ if (nmemb > 256 * 1024 / size)
+ return ERR_PTR(-ENOMEM);
+
+ size *= nmemb;
+
+ mem = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
+ if (!mem)
+ mem = vmalloc(size);
if (!mem)
return ERR_PTR(-ENOMEM);...
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...size, size_t nmemb, void *opaque);
static size_t write_cb (char *ptr, size_t size, size_t nmemb, void *opaque);
static size_t read_cb (void *ptr, size_t size, size_t nmemb, void *opaque);
+static void lock_cb (CURL *handle, curl_lock_data data,
+ curl_lock_access access, void *userptr);
+static void unlock_cb (CURL *handle, curl_lock_data data,
+ void *userptr);
+
+/* These locks protect access to the curl share data. See:
+ * https://gist.github.com/bagder/7eccf74f8b6d70b5abefeb7f288dba9b
+ */
+static pthread_rwlock_t lockarray[CURL_LOCK_DATA_LAST];
+
+/*...
2019 Aug 06
2
[PATCH 15/15] amdgpu: remove CONFIG_DRM_AMDGPU_USERPTR
On Tue, Aug 06, 2019 at 07:05:53PM +0300, Christoph Hellwig wrote:
> The option is just used to select HMM mirror support and has a very
> confusing help text. Just pull in the HMM mirror code by default
> instead.
>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
> drivers/gpu/drm/Kconfig | 2 ++
> drivers/gpu/drm/amd/amdgpu/Kconfig
2013 Mar 21
0
[ANNOUNCE] xf86-video-intel 2.21.5
...ninitialized screen
Chris Wilson (33):
test: Try to exercise races between DRI2SwapBuffers and CloseWindow
sna/dri: Reorder assert to avoid NULL dereference
sna/dri: Free chained swaps upon CloseWindow
sna/dri: Free the event on the impossible error path
sna: Mark the userptr as a CPU mapping
sna: Only allocate addition space if we need pixel data
sna: Improve sna_copy_boxes DBG by printing the bo handles
sna: Apply the source offset to the transform when fixing up gradients
sna: Mark redirect proxies with a unique id
sna: Improve asserts t...
2019 Aug 07
1
[PATCH 15/15] amdgpu: remove CONFIG_DRM_AMDGPU_USERPTR
...12 ------------
>>>>> 4 files changed, 2 insertions(+), 28 deletions(-)
>>>> Felix, was this an effort to avoid the arch restriction on hmm or
>>>> something? Also can't see why this was like this.
>>> This option predates KFD's support of userptrs, which in turn predates
>>> HMM. Radeon has the same kind of option, though it doesn't affect HMM in
>>> that case.
>>>
>>> Alex, Christian, can you think of a good reason to maintain userptr
>>> support as an option in amdgpu? I suspect it was orig...
2013 Sep 04
0
[PATCH] drm/nouveau: fix command submission to use vmalloc for big allocations
...r)
> +{
> + if (!is_vmalloc_addr(addr))
> + kfree(addr);
> + else
> + vfree(addr);
> +}
> +
> static inline void *
> u_memcpya(uint64_t user, unsigned nmemb, unsigned size)
> {
> void *mem;
> void __user *userptr = (void __force __user *)(uintptr_t)user;
>
> - mem = kmalloc(nmemb * size, GFP_KERNEL);
> + if (nmemb > 256 * 1024 / size)
> + return ERR_PTR(-ENOMEM);
> +
> + size *= nmemb;
> +
> + mem = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
&g...
2023 Feb 22
2
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
I'm mainly posting this to the list as a back-up. It does work, it
does _not_ improve performance in any noticable way. However I'm
having lots of trouble getting HTTP/2 to work (with or without this
patch) and that's stopping me from testing anything properly.
Rich.
2019 Aug 06
0
[PATCH 15/15] amdgpu: remove CONFIG_DRM_AMDGPU_USERPTR
...ers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgpu/Kconfig
index 2e98c016cb47..c5c963164f5e 100644
--- a/drivers/gpu/drm/amd/amdgpu/Kconfig
+++ b/drivers/gpu/drm/amd/amdgpu/Kconfig
@@ -24,16 +24,6 @@ config DRM_AMDGPU_CIK
radeon.cik_support=0 amdgpu.cik_support=1
-config DRM_AMDGPU_USERPTR
- bool "Always enable userptr write support"
- depends on DRM_AMDGPU
- depends on MMU
- select HMM_MIRROR
- select MMU_NOTIFIER
- help
- This option selects CONFIG_HMM and CONFIG_HMM_MIRROR if it
- isn't already selected to enabled full userptr support.
-
config DRM_AMDGPU_GART_D...
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...void *opaque);
> static size_t write_cb (char *ptr, size_t size, size_t nmemb, void *opaque);
> static size_t read_cb (void *ptr, size_t size, size_t nmemb, void *opaque);
> +static void lock_cb (CURL *handle, curl_lock_data data,
> + curl_lock_access access, void *userptr);
> +static void unlock_cb (CURL *handle, curl_lock_data data,
> + void *userptr);
> +
> +/* These locks protect access to the curl share data. See:
> + * https://gist.github.com/bagder/7eccf74f8b6d70b5abefeb7f288dba9b
> + */
> +static pthread_rwlock_t lo...
2016 Mar 01
0
[ANNOUNCE] intel-gpu-tools 1.14
A new intel-gpu-tools quarterly release is available with the following
changes:
- New test: gem_create validate parameters for GEM_CREATE ioctl
(Ankitprasad Sharma)
- New test: gem_softpin exercise the userptr ioctl to create shared
buffers between CPU and GPU (Vinay Belgaumkar)
- New tests: prime_mmap_coherency/kms_mmap_write_crc cache coherency
tests (Tiago Vignatti)
- New test: prime_mmap mmap() on dma-buf fds (Rob Bradford)
- New test: gem_exec_reloc sanity check of execbuf-ioctl relocations (Chri...
2019 Aug 06
0
[PATCH 14/15] mm: make HMM_MIRROR an implicit option
...2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgpu/Kconfig
index f6e5c0282fc1..2e98c016cb47 100644
--- a/drivers/gpu/drm/amd/amdgpu/Kconfig
+++ b/drivers/gpu/drm/amd/amdgpu/Kconfig
@@ -27,7 +27,9 @@ config DRM_AMDGPU_CIK
config DRM_AMDGPU_USERPTR
bool "Always enable userptr write support"
depends on DRM_AMDGPU
- depends on HMM_MIRROR
+ depends on MMU
+ select HMM_MIRROR
+ select MMU_NOTIFIER
help
This option selects CONFIG_HMM and CONFIG_HMM_MIRROR if it
isn't already selected to enabled full userptr support.
dif...
2019 Aug 06
0
[PATCH 15/15] amdgpu: remove CONFIG_DRM_AMDGPU_USERPTR
...;> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 12 ------------
>> 4 files changed, 2 insertions(+), 28 deletions(-)
> Felix, was this an effort to avoid the arch restriction on hmm or
> something? Also can't see why this was like this.
This option predates KFD's support of userptrs, which in turn predates
HMM. Radeon has the same kind of option, though it doesn't affect HMM in
that case.
Alex, Christian, can you think of a good reason to maintain userptr
support as an option in amdgpu? I suspect it was originally meant as a
way to allow kernels with amdgpu without M...
2019 Aug 06
0
[PATCH 15/15] amdgpu: remove CONFIG_DRM_AMDGPU_USERPTR
...12 ------------
> > >> 4 files changed, 2 insertions(+), 28 deletions(-)
> > > Felix, was this an effort to avoid the arch restriction on hmm or
> > > something? Also can't see why this was like this.
> >
> > This option predates KFD's support of userptrs, which in turn predates
> > HMM. Radeon has the same kind of option, though it doesn't affect HMM in
> > that case.
> >
> > Alex, Christian, can you think of a good reason to maintain userptr
> > support as an option in amdgpu? I suspect it was originally meant as...
2020 Nov 12
0
[PATCH] drm/nouveau: Use vmemdup_user()
...d9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -591,14 +591,9 @@ u_memcpya(uint64_t user, unsigned nmemb, unsigned size)
size *= nmemb;
- mem = kvmalloc(size, GFP_KERNEL);
- if (!mem)
- return ERR_PTR(-ENOMEM);
-
- if (copy_from_user(mem, userptr, size)) {
- u_free(mem);
- return ERR_PTR(-EFAULT);
- }
+ mem = vmemdup_user(userptr, size);
+ if (IS_ERR(mem))
+ return ERR_CAST(mem);
return mem;
}
--
2.7.4
2013 Nov 12
6
[PATCH 1/7] drm/nouveau: fix m2mf copy to tiled gart
From: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Commit de7b7d59d54852c introduced tiled GART, but a linear copy is
still performed. This may result in errors on eviction, fix it by
checking tiling from memtype.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Cc: stable at vger.kernel.org #3.10+
---
drivers/gpu/drm/nouveau/nouveau_bo.c | 33
2015 May 07
0
[ANNOUNCE] libdrm 2.4.61
...r release
Chih-Wei Huang (3):
android: simplify the including rule of subdirs
android: get rid of LIBDRM_TOP
android: remove unnecessary TARGET_OUT_HEADERS variable
Chris Wilson (2):
mode: Retrieve only the current information for a Connector
intel: Delay testing for userptr until first use
Connor Behan (1):
xf86drm: Fix ioctl struct clearing in drmAgpEnable
Damien Lespiau (3):
RELEASING: Fix releasing instructions to match the latest release.sh
RELEASING: Fix the step numbering
RELEASING: Fix annouce typo
Daniel Kurtz (3):
proptest: in...
2019 Oct 29
2
[PATCH v2 12/15] drm/amdgpu: Call find_vma under mmap_sem
...)
> struct hmm_mirror *mirror = bo->mn ? &bo->mn->mirror : NULL;
> struct ttm_tt *ttm = bo->tbo.ttm;
> struct amdgpu_ttm_tt *gtt = (void *)ttm;
> - struct mm_struct *mm = gtt->usertask->mm;
> + struct mm_struct *mm;
> unsigned long start = gtt->userptr;
> struct vm_area_struct *vma;
> struct hmm_range *range;
> @@ -796,25 +797,14 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
> uint64_t *pfns;
> int r = 0;
>
> - if (!mm) /* Happens during process shutdown */
> - return -ESRCH...
2017 Oct 12
0
[ANNOUNCE] libdrm 2.4.84
...-
Hash: SHA1
libdrm 2.4.84 has been released.
Alex Deucher (1):
tests/amdgpu: add missing header to SOURCES
Andrey Grodzovsky (1):
amdgpu: Add deadlock detection test suit.
Anuj Phogat (1):
intel: Change a KBL pci id to GT2 from GT1.5
Christian König (1):
amdgpu: make userptr unit test more interesting
Dave Airlie (1):
headers: sync syncobj ioctl defines.
Eric Engestrom (1):
freedreno/kgsl: fix pointer-to-int cast
James Zhu (2):
tests/amdgpu: add new uvd enc support check
tests/amdgpu: fix uvd enc data corruption issue
Jan Vesely (1):
a...