On Mon, Mar 30, 2020 at 9:18 AM Marek Szyprowski
wrote:
> Today I've noticed that this patch went to final v5.6 without even a day
> of testing in linux-next, so v5.6 is broken on Exynos and probably a few
> other ARM archs, which rely on the drm_prime_sg_to_page_addr_arrays
> function.
>
> Best
On Mon, Mar 30, 2020 at 9:18 AM Marek Szyprowski
wrote:
> Today I've noticed that this patch went to final v5.6 without even a day
> of testing in linux-next, so v5.6 is broken on Exynos and probably a few
> other ARM archs, which rely on the drm_prime_sg_to_page_addr_arrays
> function.
>
> Best r
On Mon, Mar 30, 2020 at 9:18 AM Marek Szyprowski
wrote:
> Today I've noticed that this patch went to final v5.6 without even a day
> of testing in linux-next, so v5.6 is broken on Exynos and probably a few
> other ARM archs, which rely on the drm_prime_sg_to_page_addr_arrays
> function.
>
> Best r
sed when
accessing addr and len rather than sg->address and sg->length.
Maybe it would be worth splitting this out into 2 functions to avoid
potential issues with the above use case ?
Regards,
Shane Francis
___
dri-devel mailing list
dri-devel@list
mentation it
is not instantly
clear why you would be mapping the pages in this way.
Would probably prevent someone in the future making the same mistake I
did while updating
this code.
Regards,
Shane Francis
___
dri-devel mailing list
dri-devel@lists.f
On Fri, Mar 27, 2020 at 8:24 AM Marek Szyprowski
wrote:
>
> Scatterlist elements contains both pages and DMA addresses, but in general,
> one cannot assume 1:1 relation between them. The sg->length is the size of
> the physical memory chunk described by sg->page, while sg_dma_length(sg) is
> the s
> >-Original Message-
> >From: dri-devel On Behalf Of
> >Shane Francis
> >Sent: Wednesday, March 25, 2020 5:08 AM
> >To: dri-devel@lists.freedesktop.org
> >Cc: airl...@linux.ie; linux-ker...@vger.kernel.org; bigbeesh...@gmail.com;
> >amd-gfx-req
Calls to dma_map_sg may return segments / entries than requested
if they fall on page bounderies. The old implementation did not
support this use case.
Signed-off-by: Shane Francis
---
drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a
Calls to dma_map_sg may return segments / entries than requested
if they fall on page bounderies. The old implementation did not
support this use case.
Signed-off-by: Shane Francis
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a
As dma_map_sg can reorganize scatter-gather lists in a
way that can cause some later segments to be empty we should
always use the sg_dma_len macro to fetch the actual length.
This could now be 0 and not need to be mapped to a page or
address array
Signed-off-by: Shane Francis
---
drivers/gpu
I have verified this fixes the above on kernel 5.5 and 5.5rc using an
AMD Vega 64 GPU
Shane Francis (3):
drm/prime: use dma length macro when mapping sg to arrays
drm/amdgpu: fix scatter-gather mapping with user pages
drm/radeon: fix scatter-gather mapping with user pages
drivers/gpu/drm/amd/
As dma_map_sg can reorganize scatter-gather lists in a
way that can cause some later segments to be empty we should
always use the sg_dma_len macro to fetch the actual length.
This could now be 0 and not need to be mapped to a page or
address array
Signed-off-by: Shane Francis
---
drivers/gpu
The sg_dma_len macro is representative of the length of the sg item
after dma_map_sg
Example Crash :
> [drm:amdgpu_ttm_backend_bind [amdgpu]] *ERROR* failed to pin userptr
This happens in OpenCL applications, causing them to crash or hang, on
either amdgpu-pro or ROCm OpenCL implementations
Shane F
Calls to dma_map_sg may return segments / entries than requested
if they fall on page bounderies. The old implementation did not
support this use case.
Signed-off-by: Shane Francis
---
drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a
Calls to dma_map_sg may return segments / entries than requested
if they fall on page bounderies. The old implementation did not
support this use case.
Signed-off-by: Shane Francis
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a
mapping
Signed-off-by: Shane Francis
---
drivers/gpu/drm/drm_prime.c | 71 -
include/drm/drm_prime.h | 5 +++
2 files changed, 67 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 86d9b0e45c8c
Calls to dma_map_sg may return segments / entries than requested
if they fall on page bounderies. The old implementation did not
support this use case.
Signed-off-by: Shane Francis
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff
Calls to dma_map_sg may return segments / entries than requested
if they fall on page bounderies. The old implementation did not
support this use case.
Signed-off-by: Shane Francis
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff
Calls to dma_map_sg may return segments / entries than requested
if they fall on page bounderies. The old implementation did not
support this use case.
Signed-off-by: Shane Francis
---
drivers/gpu/drm/radeon/radeon_ttm.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a
mapping
Signed-off-by: Shane Francis
---
drivers/gpu/drm/drm_prime.c | 71 -
include/drm/drm_prime.h | 5 +++
2 files changed, 67 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 86d9b0e45c8c
the segment length
via the correct dma macro
Shane Francis (3):
drm/prime: correct logic for mapping sg to arrays
drm/amdgpu: fix scatter-gather mapping with user pages
drm/radeon: fix scatter-gather mapping with user pages
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 +--
drivers/gpu/drm
hat seems to use the same logic
for
user pages.
Regards : Shane Francis
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
via the correct dma macro
Shane Francis (2):
drm/prime: correct logic for mapping sg to arrays
drm/amdgpu: fix scatter-gather mapping with user pages
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 +--
drivers/gpu/drm/drm_prime.c | 71 +
include/drm
Calls to dma_map_sg may return segments / entries than requested
if they fall on page bounderies. The old implementation did not
support this use case.
Signed-off-by: Shane Francis
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff
mapping
Signed-off-by: Shane Francis
---
drivers/gpu/drm/drm_prime.c | 71 -
include/drm/drm_prime.h | 5 +++
2 files changed, 67 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 86d9b0e45c8c
25 matches
Mail list logo