aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRahul Sharma <Rahul.Sharma@samsung.com>2014-05-07 07:51:29 -0400
committerInki Dae <daeinki@gmail.com>2014-06-01 13:07:09 -0400
commit122beea84bb90236b1ae545f08267af58591c21b (patch)
tree8fc2768de2a2e7426f6ff33299ca18f0b705fd51 /drivers/gpu
parente2a562dce87c34c44b1981dea31f93b0eb50614c (diff)
drm/exynos: allocate non-contigous buffers when iommu is enabled
Allow to allocate non-contigous buffers when iommu is enabled. Currently, it tries to allocates contigous buffer which consistently fail for large buffers and then fall back to non contigous. Apart from being slow, this implementation is also very noisy and fills the screen with alloc fail logs. Signed-off-by: Rahul Sharma <Rahul.Sharma@samsung.com> Reviewed-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gem.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 42d2904d88c7..163a054922cb 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -612,22 +612,20 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
612 args->pitch = args->width * ((args->bpp + 7) / 8); 612 args->pitch = args->width * ((args->bpp + 7) / 8);
613 args->size = args->pitch * args->height; 613 args->size = args->pitch * args->height;
614 614
615 exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG | 615 if (is_drm_iommu_supported(dev)) {
616 EXYNOS_BO_WC, args->size); 616 exynos_gem_obj = exynos_drm_gem_create(dev,
617 /* 617 EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC,
618 * If physically contiguous memory allocation fails and if IOMMU is 618 args->size);
619 * supported then try to get buffer from non physically contiguous 619 } else {
620 * memory area.
621 */
622 if (IS_ERR(exynos_gem_obj) && is_drm_iommu_supported(dev)) {
623 dev_warn(dev->dev, "contiguous FB allocation failed, falling back to non-contiguous\n");
624 exynos_gem_obj = exynos_drm_gem_create(dev, 620 exynos_gem_obj = exynos_drm_gem_create(dev,
625 EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC, 621 EXYNOS_BO_CONTIG | EXYNOS_BO_WC,
626 args->size); 622 args->size);
627 } 623 }
628 624
629 if (IS_ERR(exynos_gem_obj)) 625 if (IS_ERR(exynos_gem_obj)) {
626 dev_warn(dev->dev, "FB allocation failed.\n");
630 return PTR_ERR(exynos_gem_obj); 627 return PTR_ERR(exynos_gem_obj);
628 }
631 629
632 ret = exynos_drm_gem_handle_create(&exynos_gem_obj->base, file_priv, 630 ret = exynos_drm_gem_handle_create(&exynos_gem_obj->base, file_priv,
633 &args->handle); 631 &args->handle);