Message ID | CAD025yR9Xd0G81WdLDxKyu-RVZPPJAUOKZ+0b5oKUxYOe7q_pQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
Hi Vikas, On 08/02/2013 12:10 PM, Vikas Sajjan wrote: > yeah, we could not allocate CMA region for FIMD, because the function > dma_declare_contiguous() needs "dev" as the first argument and we have > access to "dev" node only if it is NON-DT way of probing like the way > it is done in arch/arm/mach-davinci/devices-da8xx.c > But now, since the probing is through DT way, there is NO way ( Let me > know if something is newly added ) to call dma_declare_contiguous() > and reserve CMA region . See this patch series [1]. We have have been using this kind of bindings for assigning physically contiguous memory regions to the Exynos multimedia devices, instead of what's currently in mainline where same physical addresses are repeated in dts for various boards without much thought. And where custom device specific parsing code is required at arch side. $ git grep mfc\-[lr] arch/arm/boot/dts arch/arm/boot/dts/exynos4210-origen.dts: samsung,mfc-r = <0x43000000 0x800000>; arch/arm/boot/dts/exynos4210-origen.dts: samsung,mfc-l = <0x51000000 0x800000>; arch/arm/boot/dts/exynos4210-smdkv310.dts: samsung,mfc-r = <0x43000000 0x800000>; arch/arm/boot/dts/exynos4210-smdkv310.dts: samsung,mfc-l = <0x51000000 0x800000>; arch/arm/boot/dts/exynos4412-origen.dts: samsung,mfc-r = <0x43000000 0x800000>; arch/arm/boot/dts/exynos4412-origen.dts: samsung,mfc-l = <0x51000000 0x800000>; arch/arm/boot/dts/exynos4412-smdk4412.dts: samsung,mfc-r = <0x43000000 0x800000>; arch/arm/boot/dts/exynos4412-smdk4412.dts: samsung,mfc-l = <0x51000000 0x800000>; arch/arm/boot/dts/exynos5250-arndale.dts: samsung,mfc-r = <0x43000000 0x800000>; arch/arm/boot/dts/exynos5250-arndale.dts: samsung,mfc-l = <0x51000000 0x800000>; arch/arm/boot/dts/exynos5250-smdk5250.dts: samsung,mfc-r = <0x43000000 0x800000>; arch/arm/boot/dts/exynos5250-smdk5250.dts: samsung,mfc-l = <0x51000000 0x800000>; [1] http://www.spinics.net/lists/arm-kernel/msg263130.html Regards, Sylwester
Hi Sylwester, On 2 August 2013 16:28, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote: > Hi Vikas, > > On 08/02/2013 12:10 PM, Vikas Sajjan wrote: >> yeah, we could not allocate CMA region for FIMD, because the function >> dma_declare_contiguous() needs "dev" as the first argument and we have >> access to "dev" node only if it is NON-DT way of probing like the way >> it is done in arch/arm/mach-davinci/devices-da8xx.c >> But now, since the probing is through DT way, there is NO way ( Let me >> know if something is newly added ) to call dma_declare_contiguous() >> and reserve CMA region . > > See this patch series [1]. We have have been using this kind of bindings > for assigning physically contiguous memory regions to the Exynos > multimedia devices, instead of what's currently in mainline where same > physical addresses are repeated in dts for various boards without much > thought. And where custom device specific parsing code is required at > arch side. > > $ git grep mfc\-[lr] arch/arm/boot/dts > > arch/arm/boot/dts/exynos4210-origen.dts: samsung,mfc-r = <0x43000000 0x800000>; > arch/arm/boot/dts/exynos4210-origen.dts: samsung,mfc-l = <0x51000000 0x800000>; > arch/arm/boot/dts/exynos4210-smdkv310.dts: samsung,mfc-r = <0x43000000 0x800000>; > arch/arm/boot/dts/exynos4210-smdkv310.dts: samsung,mfc-l = <0x51000000 0x800000>; > arch/arm/boot/dts/exynos4412-origen.dts: samsung,mfc-r = <0x43000000 0x800000>; > arch/arm/boot/dts/exynos4412-origen.dts: samsung,mfc-l = <0x51000000 0x800000>; > arch/arm/boot/dts/exynos4412-smdk4412.dts: samsung,mfc-r = <0x43000000 0x800000>; > arch/arm/boot/dts/exynos4412-smdk4412.dts: samsung,mfc-l = <0x51000000 0x800000>; > arch/arm/boot/dts/exynos5250-arndale.dts: samsung,mfc-r = <0x43000000 0x800000>; > arch/arm/boot/dts/exynos5250-arndale.dts: samsung,mfc-l = <0x51000000 0x800000>; > arch/arm/boot/dts/exynos5250-smdk5250.dts: samsung,mfc-r = <0x43000000 0x800000>; > arch/arm/boot/dts/exynos5250-smdk5250.dts: samsung,mfc-l = <0x51000000 0x800000>; > > > [1] http://www.spinics.net/lists/arm-kernel/msg263130.html > Thanks, its good that now we have a new way to reserve CMA region. > Regards, > Sylwester
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index df43fa9..15de626 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -144,7 +144,6 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, struct platform_device *pdev = dev->platformdev; unsigned long size; int ret; DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d\n", sizes->surface_width, sizes->surface_height, @@ -167,16 +166,14 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, size = mode_cmd.pitches[0] * mode_cmd.height; - /* 0 means to allocate physically continuous memory */ - exynos_gem_obj = exynos_drm_gem_create(dev, 0, size); + exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG, size); if (IS_ERR(exynos_gem_obj)) { - ret = PTR_ERR(exynos_gem_obj); - goto err_release_framebuffer; + if(is_drm_iommu_supported(dev)) + exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_NONCONTIG, size); + if (IS_ERR(exynos_gem_obj)) { + ret = PTR_ERR(exynos_gem_obj); + goto err_release_framebuffer; + } + dev_warn("\n exynos_gem_obj for FB is allocated with non physically continuous + memory \n"); } > Thanks,