file mxsfb.c file driver for iMX287 Framebuffer Driver have issues to initialize memory more than 4MB for more number of SCREENS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

file mxsfb.c file driver for iMX287 Framebuffer Driver have issues to initialize memory more than 4MB for more number of SCREENS

2,479 Views
Bhuvaneshsubram
Contributor II

Hi,

Driver is working great for 800x480 with bpp 32 and also with two screens, But for my requirement I need more number of SCREENS so I increased the MACRO which is defined NUM_SCREENS to 5.

so the DMA memory allocation requirement went like this below:

Width x Height x bpp x NUM_SCREENS = in Bytes

800*480*4*5 = 7.5MB

which was failing while booting when initializing the LCD, I have copied the trace of it where it got failed.

I got to understand that DMA memory allocation is limited to 4MB can anybody suggest something to get this extented to 8MB so that I can have more screens?

[    1.050000] ------------[ cut here ]------------

[    1.050000] WARNING: at mm/page_alloc.c:1968 __alloc_pages_nodemask+0x170/0x564()

[    1.060000] Backtrace:

[    1.060000] [<c0040468>] (dump_backtrace+0x0/0x114) from [<c03a6d8c>] (dump_stack+0x18/0x1c)

[    1.070000]  r7:00000009 r6:000007b0 r5:c00a1ca8 r4:00000000

[    1.080000] [<c03a6d74>] (dump_stack+0x0/0x1c) from [<c005b178>] (warn_slowpath_common+0x50/0x68)

[    1.080000] [<c005b128>] (warn_slowpath_common+0x0/0x68) from [<c005b1b4>] (warn_slowpath_null+0x24/0x2c)

[    1.090000]  r9:00000000 r8:00000000 r7:c7c26000 r6:c04a8d24 r5:0000000b

[    1.100000] r4:c04d21d8

[    1.100000] [<c005b190>] (warn_slowpath_null+0x0/0x2c) from [<c00a1ca8>] (__alloc_pages_nodemask+0x170/0x564)

[    1.110000] [<c00a1b38>] (__alloc_pages_nodemask+0x0/0x564) from [<c00417c4>] (__dma_alloc+0xfc/0x2b4)

[    1.120000] [<c00416c8>] (__dma_alloc+0x0/0x2b4) from [<c00419a4>] (dma_alloc_writecombine+0x28/0x34)

[    1.130000] [<c004197c>] (dma_alloc_writecombine+0x0/0x34) from [<c03a4eb8>] (mxsfb_probe+0x24c/0x814)

[    1.140000] [<c03a4c6c>] (mxsfb_probe+0x0/0x814) from [<c0235854>] (platform_drv_probe+0x1c/0x20)

[    1.150000] [<c0235838>] (platform_drv_probe+0x0/0x20) from [<c02344e0>] (driver_probe_device+0x1b4/0x358)

[    1.160000] [<c023432c>] (driver_probe_device+0x0/0x358) from [<c02346ec>] (__driver_attach+0x68/0x8c)

[    1.170000]  r7:00000000 r6:c0497fa4 r5:c047f81c r4:c047f7e8

[    1.180000] [<c0234684>] (__driver_attach+0x0/0x8c) from [<c0233980>] (bus_for_each_dev+0x54/0x94)

[    1.190000]  r7:00000000 r6:c0234684 r5:c7c27ef0 r4:c0497fa4

[    1.190000] [<c023392c>] (bus_for_each_dev+0x0/0x94) from [<c0234114>] (driver_attach+0x20/0x28)

[    1.200000]  r7:00000000 r6:c0498cc0 r5:c76160c0 r4:c0497fa4

[    1.210000] [<c02340f4>] (driver_attach+0x0/0x28) from [<c0233144>] (bus_add_driver+0x100/0x288)

[    1.210000] [<c0233044>] (bus_add_driver+0x0/0x288) from [<c0234a28>] (driver_register+0xb4/0x144)

[    1.220000] [<c0234974>] (driver_register+0x0/0x144) from [<c0235cdc>] (platform_driver_register+0x4c/0x60)

[    1.230000]  r9:00000000 r8:00000000 r7:00000013 r6:00000001 r5:c0028f24

[    1.240000] r4:c001d2c0

[    1.240000] [<c0235c90>] (platform_driver_register+0x0/0x60) from [<c001d2d4>] (mxsfb_init+0x14/0x1c)

[    1.250000] [<c001d2c0>] (mxsfb_init+0x0/0x1c) from [<c003c3ac>] (do_one_initcall+0x64/0x1cc)

[    1.260000] [<c003c348>] (do_one_initcall+0x0/0x1cc) from [<c0008484>] (kernel_init+0xb4/0x170)

[    1.270000]  r9:00000000 r8:00000000 r7:00000013 r6:c005eacc r5:c0028f24

[    1.280000] r4:c0028df0

[    1.280000] [<c00083d0>] (kernel_init+0x0/0x170) from [<c005eacc>] (do_exit+0x0/0x688)

[    1.290000]  r5:c00083d0 r4:00000000

[    1.290000] ---[ end trace dec6997083161631 ]---

[    1.300000] mxs-fb: probe of mxs-fb.0 failed with error -12

Tags (3)
0 Kudos
9 Replies

1,063 Views
MarekVasut
Senior Contributor I

What kernel version is that ?

0 Kudos

1,063 Views
Bhuvaneshsubram
Contributor II

Linux Kernel version 2.6.35

0 Kudos

1,063 Views
Bhuvaneshsubram
Contributor II

In latest version I see lot of modifications in that file and freescale have NOT given any patch for that LCDIF to this linux version (i.e. 2.6.35)

0 Kudos

1,063 Views
GraceH
Senior Contributor II

That is not the issue of frame buffer drive. That is because the DMA zone is not big enough.

You can increase DMA_ZONE_SIZE in the kernel.

./ltib -m config   choose config the kernel

./ltib -p kernel -f   enter linux kernel configuration menu , system type -> Freescale i.MXS implementations -> DMA memory zone size, change 16 to 32

Grace

0 Kudos

1,063 Views
Bhuvaneshsubram
Contributor II

I had tried making DMA_ZONE_SIZE to 32MB but still it was breaking the LOG which is posted was having 32MB config-ed for DMA_ZONE_SIZE

0 Kudos

1,063 Views
GraceH
Senior Contributor II

#define CONFIG_FORCE_MAX_ZONEORDER 12

By default, MAX_ORDER is 11 which means the biggest memory chunk is: PAGE_SIZE * 2 ^( FORCE_MAX_ZONEORDER - 1)

= 4K * 1 K = 4M.

Grace

0 Kudos

1,063 Views
Bhuvaneshsubram
Contributor II

Hi GraceSi,

#define CONFIG_FORCE_MAX_ZONEORDER 12 where is it defined in imx28 platform I didnot find in devconfig file


Any way increasing MAX_ORDER to 13 which was 11 worked great I got DMA allocation for 5 screens now I believe now I can extend my DMA memory request till 16MB now. Thanks for your support


But I have one question getting it worked will this MAX_ORDER to 13 will have any side effect to any other parts of program or is it all configurable



0 Kudos

1,063 Views
GraceH
Senior Contributor II

CONFIG_FORCE_MAX_ZONEORDER is not defined in MX28.  If CONFIG_FORCE_MAX_ZONEORDER is defined, MAX_ORDER will be the value of CONFIG_FORCE_MAX_ZONEORDER, otherwise the default value 11 will be used for MAX_ORDER,

You can add  CONFIG_FORCE_MAX_ZONEORDER=12 in imx28evk_defconfig, reconfigure it, then

"#define CONFIG_FORCE_MAX_ZONEORDER 12" will be auto added to head file linux/include/generated/autoconf.h

MAX_ORDER is configurable according to the memory usage. If contiguous physical memory of big chunk is needed by the kernel, you need increase it. 

Grace

0 Kudos

1,063 Views
Bhuvaneshsubram
Contributor II

Hi Grace,

This helped to expand the contiguous physical memory required by kernel for DMA transfers and graphics in iMX287 platform. Thanks for your support.

Summary:

Tried to achieve more than 4MB RAM space for graphics to have more number of screens defined in mxsfb.c in linux 2.6.35 which comes with 2012 LTIB BSP.

Changes Need to add  CONFIG_FORCE_MAX_ZONEORDER=13 in imx28evk_defconfig to extend it to 16MB previously MAX_ORDER was getting set to 11 as default which was allocating only 4MB.

Any body searching on DMA, PXP for graphics, LCDIF for more number of screens will make this change useful to you get more memory allocated.

Thanks,

Bhuvanesh S

0 Kudos