diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2017-11-22 08:14:47 -0500 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2017-12-06 19:32:02 -0500 |
commit | 120a264f9c2782682027d931d83dcbd22e01da80 (patch) | |
tree | 046616c05f4cdd368eb352751d5e28ba181facb4 /drivers | |
parent | 89452d4ab20745002e50ecf90979708f1ce1d077 (diff) |
drm/exynos: gem: Drop NONCONTIG flag for buffers allocated without IOMMU
When no IOMMU is available, all GEM buffers allocated by Exynos DRM driver
are contiguous, because of the underlying dma_alloc_attrs() function
provides only such buffers. In such case it makes no sense to keep
BO_NONCONTIG flag for the allocated GEM buffers. This allows to avoid
failures for buffer contiguity checks in the subsequent operations on GEM
objects.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
CC: stable@vger.kernel.org # v4.4+
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index ef35bc23bb36..11cc01b47bc0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c | |||
@@ -247,6 +247,15 @@ struct exynos_drm_gem *exynos_drm_gem_create(struct drm_device *dev, | |||
247 | if (IS_ERR(exynos_gem)) | 247 | if (IS_ERR(exynos_gem)) |
248 | return exynos_gem; | 248 | return exynos_gem; |
249 | 249 | ||
250 | if (!is_drm_iommu_supported(dev) && (flags & EXYNOS_BO_NONCONTIG)) { | ||
251 | /* | ||
252 | * when no IOMMU is available, all allocated buffers are | ||
253 | * contiguous anyway, so drop EXYNOS_BO_NONCONTIG flag | ||
254 | */ | ||
255 | flags &= ~EXYNOS_BO_NONCONTIG; | ||
256 | DRM_WARN("Non-contiguous allocation is not supported without IOMMU, falling back to contiguous buffer\n"); | ||
257 | } | ||
258 | |||
250 | /* set memory type and cache attribute from user side. */ | 259 | /* set memory type and cache attribute from user side. */ |
251 | exynos_gem->flags = flags; | 260 | exynos_gem->flags = flags; |
252 | 261 | ||