diff options
author | Vikas Sajjan <vikas.sajjan@linaro.org> | 2013-08-23 02:35:06 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2013-09-05 00:43:45 -0400 |
commit | 3fec4532d112a4b8427ded6725a7f00d75023886 (patch) | |
tree | 3d66d8de6c6831786e6a7ba4509a85c077db8fa0 /drivers/gpu/drm/exynos | |
parent | 562ad9f4a3e3870f4e3f00aac8277c49032bd6eb (diff) |
drm/exynos: Consider fallback option to allocation fail
To address the case where physically contiguous memory
MAY NOT be a mandatory requirement for framebuffer for
the application calling exynos_drm_gem_dumb_create,
the patch adds a feature to get non physically contiguous
memory for framebuffer, if physically contiguous memory
allocation fails and if IOMMU is supported.
Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
Signed-off-by: Arun Kumar <arun.kk@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 862f1d9a2ecb..49f9cd232757 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include "exynos_drm_drv.h" | 18 | #include "exynos_drm_drv.h" |
19 | #include "exynos_drm_gem.h" | 19 | #include "exynos_drm_gem.h" |
20 | #include "exynos_drm_buf.h" | 20 | #include "exynos_drm_buf.h" |
21 | #include "exynos_drm_iommu.h" | ||
21 | 22 | ||
22 | static unsigned int convert_to_vm_err_msg(int msg) | 23 | static unsigned int convert_to_vm_err_msg(int msg) |
23 | { | 24 | { |
@@ -666,6 +667,18 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, | |||
666 | 667 | ||
667 | exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG | | 668 | exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG | |
668 | EXYNOS_BO_WC, args->size); | 669 | EXYNOS_BO_WC, args->size); |
670 | /* | ||
671 | * If physically contiguous memory allocation fails and if IOMMU is | ||
672 | * supported then try to get buffer from non physically contiguous | ||
673 | * memory area. | ||
674 | */ | ||
675 | if (IS_ERR(exynos_gem_obj) && is_drm_iommu_supported(dev)) { | ||
676 | dev_warn(dev->dev, "contiguous FB allocation failed, falling back to non-contiguous\n"); | ||
677 | exynos_gem_obj = exynos_drm_gem_create(dev, | ||
678 | EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC, | ||
679 | args->size); | ||
680 | } | ||
681 | |||
669 | if (IS_ERR(exynos_gem_obj)) | 682 | if (IS_ERR(exynos_gem_obj)) |
670 | return PTR_ERR(exynos_gem_obj); | 683 | return PTR_ERR(exynos_gem_obj); |
671 | 684 | ||