[PATCH] drm/exynos: fix gem buffer allocation type checking

Prathyush K prathyush at chromium.org
Thu Dec 27 03:28:03 PST 2012


On Thu, Dec 27, 2012 at 4:27 PM, Inki Dae <inki.dae at samsung.com> wrote:

> This patch fixes gem buffer allocation type checking.
> EXYNOS_BO_CONTIG has 0 so the checking should be fixed
> to 'if (!(flags & EXYNOS_BO_NONCONTIG))'
>
> Signed-off-by: Inki Dae <inki.dae at samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_buf.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_buf.c
> b/drivers/gpu/drm/exynos/exynos_drm_buf.c
> index 74592d1..911f7fd 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_buf.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_buf.c
> @@ -38,7 +38,7 @@ static int lowlevel_buffer_allocate(struct drm_device
> *dev,
>          * region will be allocated else physically contiguous
>          * as possible.
>          */
> -       if (flags & EXYNOS_BO_CONTIG)
> +       if (!(flags & EXYNOS_BO_NONCONTIG))
>                 dma_set_attr(DMA_ATTR_FORCE_CONTIGUOUS, &buf->dma_attrs);
>
>
Hi Mr. Dae,

If iommu is supported, we would have called arm_iommu_attach_device.
So dma_alloc_attrs will always call arm_iommu_alloc_attrs.

If iommu is not supported, dma_alloc_attrs will call arm_dma_alloc which
will
anyway allocate a contiguous buffer if possible.

With this code, we are forcing the root framebuffer (fbdev) to be
contiguous since fbdev
allocation does not pass noncontig flag.

Why do we need to force the allocation of a contiguous buffer when iommu is
supported?

Regards,
Prathyush


>         /*
> --
> 1.7.4.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20121227/99de06c0/attachment.html>


More information about the dri-devel mailing list