[PATCH] exynos-drm: Fix display manager failing to start without IOMMU problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix exynos_drm_gem_create_ioctl() attempts to allocate non-contiguous GEM
memory without IOMMU. In this case, there is no point in attempting to
allocate non-contiguous memory, only to return error during the next step
from exynos_drm_framebuffer_init() which leads to display manager failing
to start.

Check if non-contiguous GEM memory is requested without IOMMU. If so,
allocate contiguous GEM memory to help display manager start.

Signed-off-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/exynos/exynos_drm_gem.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 4c4cb0e..4719116 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -266,6 +266,20 @@ int exynos_drm_gem_create_ioctl(struct drm_device *dev, void *data,
 	struct exynos_drm_gem *exynos_gem;
 	int ret;
 
+	/*
+	 * Check if non-contiguous GEM memory is requested without IOMMU.
+	 * If so, allocate contiguous GEM memory.
+	 *
+	 * There is no point in attempting to allocate non-contiguous memory,
+	 * only to return error from exynos_drm_framebuffer_init() which leads
+	 * to display manager failing to start.
+	*/
+	if (!is_drm_iommu_supported(dev) &&
+	    (args->flags & EXYNOS_BO_NONCONTIG)) {
+		args->flags &= ~EXYNOS_BO_NONCONTIG;
+		args->flags |= EXYNOS_BO_CONTIG;
+	}
+
 	exynos_gem = exynos_drm_gem_create(dev, args->flags, args->size);
 	if (IS_ERR(exynos_gem))
 		return PTR_ERR(exynos_gem);
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux