[PATCH] drm/exynos: Add fallback option to get non physically contiguous memory for gem_dumb_create

Vikas Sajjan vikas.sajjan at linaro.org
Mon Aug 26 20:04:49 PDT 2013


Thanks.

On 27 August 2013 08:14, Inki Dae <inki.dae at samsung.com> wrote:
> Applied.
>
> Thanks,
> Inki Dae
>
>> -----Original Message-----
>> From: Vikas Sajjan [mailto:vikas.sajjan at linaro.org]
>> Sent: Friday, August 23, 2013 3:35 PM
>> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com
>> Cc: kgene.kim at samsung.com; s.nawrocki at samsung.com; robdclark at gmail.com;
>> tomasz.figa at gmail.com; laurent.pinchart at ideasonboard.com;
>> patches at linaro.org; linaro-dev at lists.linaro.org
>> Subject: [PATCH] drm/exynos: Add fallback option to get non physically
>> contiguous memory for gem_dumb_create
>>
>> 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 at linaro.org>
>> Signed-off-by: Arun Kumar <arun.kk at samsung.com>
>> ---
>>  drivers/gpu/drm/exynos/exynos_drm_gem.c |   13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> b/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> index 2eabe1a..66d1b40 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> @@ -17,6 +17,7 @@
>>  #include "exynos_drm_drv.h"
>>  #include "exynos_drm_gem.h"
>>  #include "exynos_drm_buf.h"
>> +#include "exynos_drm_iommu.h"
>>
>>  static unsigned int convert_to_vm_err_msg(int msg)
>>  {
>> @@ -666,6 +667,18 @@ int exynos_drm_gem_dumb_create(struct drm_file
>> *file_priv,
>>
>>       exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG |
>>                                               EXYNOS_BO_WC, args->size);
>> +     /*
>> +      * If physically contiguous memory allocation fails and if IOMMU is
>> +      * supported then try to get buffer from non physically contiguous
>> +      * memory area.
>> +      */
>> +     if (IS_ERR(exynos_gem_obj) && is_drm_iommu_supported(dev)) {
>> +             dev_warn(dev->dev, "contiguous FB allocation failed, falling
>> back to non-contiguous\n");
>> +             exynos_gem_obj = exynos_drm_gem_create(dev,
>> +                                     EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC,
>> +                                     args->size);
>> +     }
>> +
>>       if (IS_ERR(exynos_gem_obj))
>>               return PTR_ERR(exynos_gem_obj);
>>
>> --
>> 1.7.9.5
>



-- 
Thanks and Regards
 Vikas Sajjan


More information about the dri-devel mailing list