Skip to content

Commit

Permalink
Merge tag 'drm-misc-fixes-2020-03-26' of git://anongit.freedesktop.or…
Browse files Browse the repository at this point in the history
…g/drm/drm-misc into drm-fixes

drm-misc-fixes for v5.6:
- SG fixes for prime, radeon and amdgpu.

Signed-off-by: Dave Airlie <[email protected]>

From: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
airlied committed Mar 27, 2020
2 parents 16fbf79 + 47f7826 commit 5117c36
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)
/* Map SG to device */
r = -ENOMEM;
nents = dma_map_sg(adev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
if (nents != ttm->sg->nents)
if (nents == 0)
goto release_sg;

/* convert SG to linear array of pages and dma addresses */
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_prime.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,

index = 0;
for_each_sg(sgt->sgl, sg, sgt->nents, count) {
len = sg->length;
len = sg_dma_len(sg);
page = sg_page(sg);
addr = sg_dma_address(sg);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/radeon_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static int radeon_ttm_tt_pin_userptr(struct ttm_tt *ttm)

r = -ENOMEM;
nents = dma_map_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
if (nents != ttm->sg->nents)
if (nents == 0)
goto release_sg;

drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
Expand Down

0 comments on commit 5117c36

Please sign in to comment.