drm/mediatek: Stop iterating dma addresses when sg_dma_len() == 0
authorAnand K Mistry <amistry@chromium.org>
Mon, 20 Apr 2020 06:08:34 +0000 (16:08 +1000)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Wed, 20 May 2020 16:10:08 +0000 (00:10 +0800)
commit9a67bc4aac82d18132e8a5677926f05d43e44e77
treeedd0bd1b54812bee275e4be3582b2cc9fac066e8
parent424a3a706aac4ec70de4414f5bce62c09a3d76e1
drm/mediatek: Stop iterating dma addresses when sg_dma_len() == 0

If dma_map_sg() merges pages when creating the mapping, only the first
entries will have a valid sg_dma_address() and sg_dma_len(), followed by
entries with sg_dma_len() == 0.

Signed-off-by: Anand K Mistry <amistry@google.com>
Signed-off-by: Anand K Mistry <amistry@chromium.org>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_gem.c