How to make Opengl render on virtual framebuffer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Opengl render on virtual framebuffer

166 Views
huangjacky
Contributor III

Hi All:

I have built the vfb driver as module, below is the command of insmod driver sequence.

insmod fb_sys_fops.ko
insmod syscopyarea.ko
insmod sysfillrect.ko
insmod sysimgblt.ko
insmod vfb.ko vfb_enable=1 videomemorysize=3686400

my display resolution is 1280x720-32bpp, so I modify the fb_videomode in vfb.c as below:

static const struct fb_videomode vfb_default1 = {
.refresh = 60,
.xres = 1280,
.yres = 720,
.pixclock = 13426,
.left_margin = 192,
.right_margin = 64,
.upper_margin = 22,
.lower_margin = 1,
.hsync_len = 136,
.vsync_len = 3,
.vmode = FB_VMODE_NONINTERLACED,
};
 
if (!fb_find_mode(&info->var, info, mode_option,
NULL, 0, &vfb_default1, 32)){
fb_err(info, "Unable to find usable video mode.\n");
retval = -EINVAL;
goto err1;
}
 
after insmod the vfb driver, I got /dev/fb8 
 
however, when my test program run the code:
            eglNativeDisplayType = fbGetDisplayByIndex(8);
 
I got the error and kernel panic as below:
my question is how to use Opengles render on virtual frame buffer.
 
********************************************************************************************

[ 74.713232] Probing I2c client @ 0x6a on I2C bus #0.
[ 74.718074] Generic camera I2c driver added successfully.
[ 74.723301] Probing I2c client @ 0x40 on I2C bus #0.
[ 74.728356] Probing I2c client @ 0x5d on I2C bus #0.
[ 1] fbdev_GetDisplayByIndex(400): set prefetch failed
width: 1280 height: 720
vObj.num 60672
floorTexture 1
camTexture 2
[ 75.722366] Internal error: undefined instruction: 0 [#1] SMP
[ 75.727758] Modules linked in: vfb sysimgblt sysfillrect syscopyarea fb_sys_fops viulite(O) jpegdcd(O) h264dcd(O) h264enc(O) fdma(O) seq(O) cam(O) csi(O) oal_driver(O) apex(O) sja1105pqrs(O) nxp galco)
[ 75.745968] CPU: 1 PID: -13223110 Comm: fhL�dfJ�ra.elf Tainted: G O 4.14.34-rt27+g5d76987 #4
[ 75.755499] Hardware name: Freescale S32V234 (DT)
[ 75.760183] task: ffffffc07a82a400 task.stack: ffffff800dfe0000
[ 75.766157] PC is at gckKERNEL_OpenUserData+0x70/0xa0 [galcore]
[ 75.772042] LR is at _ProcessUserCommandBufferList.constprop.5+0x54/0x278 [galcore]
[ 75.773219] Unable to handle kernel paging request at virtual address 617956ff5f7955
[ 75.773220] Mem abort info:
[ 75.773223] Exception class = DABT (current EL), IL = 32 bits
[ 75.773225] SET = 0, FnV = 0
[ 75.773226] EA = 0, S1PTW = 0
[ 75.773227] Data abort info:
[ 75.773229] ISV = 0, ISS = 0x00000004
[ 75.773231] CM = 0, WnR = 0
[ 75.773233] [00617956ff5f7955] address between user and kernel address ranges
[ 75.818878] pc : [<ffffff800060dee0>] lr : [<ffffff80006120d4>] pstate: a0000145
[ 75.826246] sp : ffffff800dfe37c0
[ 75.829541] x29: ffffff800dfe37c0 x28: ffffffc07a82a400
[ 75.834830] x27: ffffff8008601000 x26: 000000000000001d
[ 75.840118] x25: 0000000000000124 x24: 000000003da39490
[ 75.845407] x23: ffffff800dfe3db8 x22: ffffffc07b3c9c00
[ 75.850696] x21: 000000003da39490 x20: ffffff800dfe3878
[ 75.855985] x19: ffffff800dfe3890 x18: 0000007fbbe85298
[ 75.861273] x17: 0000007fbd14ed70 x16: ffffff80081983f0
[ 75.866562] x15: 0000007fbbeb79fc x14: 000000003da38980
[ 75.871851] x13: 000000003da395e0 x12: 0000007fbbd4a654
[ 75.877139] x11: 0000007fb176f970 x10: 000000003da38980
[ 75.882428] x9 : 0000000000000000 x8 : 0000007fbbd4a664
[ 75.887717] x7 : 0000000000000000 x6 : 000000003da39490
[ 75.893005] x5 : ffffff800dfe3878 x4 : 0000000000000098
[ 75.898294] x3 : 000000003da39490 x2 : ffffff800dfe3890
[ 75.903583] x1 : 0000000000000001 x0 : ffffffc07b73d200
[ 75.908873] Process fhL�dfJ�ra.elf (pid: -13223110, stack limit = 0xffffff800dfe0000)
[ 75.916675] Call trace:
[ 75.919104] Exception stack(0xffffff800dfe3680 to 0xffffff800dfe37c0)
[ 75.925521] 3680: ffffffc07b73d200 0000000000000001 ffffff800dfe3890 000000003da39490
[ 75.933324] 36a0: 0000000000000098 ffffff800dfe3878 000000003da39490 0000000000000000
[ 75.941126] 36c0: 0000007fbbd4a664 0000000000000000 000000003da38980 0000007fb176f970
[ 75.948929] 36e0: 0000007fbbd4a654 000000003da395e0 000000003da38980 0000007fbbeb79fc
[ 75.956733] 3700: ffffff80081983f0 0000007fbd14ed70 0000007fbbe85298 ffffff800dfe3890
[ 75.964536] 3720: ffffff800dfe3878 000000003da39490 ffffffc07b3c9c00 ffffff800dfe3db8
[ 75.972339] 3740: 000000003da39490 0000000000000124 000000000000001d ffffff8008601000
[ 75.980142] 3760: ffffffc07a82a400 ffffff800dfe37c0 ffffff80006120d4 ffffff800dfe37c0
[ 75.987945] 3780: ffffff800060dee0 00000000a0000145 ffffffc07acd8380 ffffffc07df9f760
[ 75.995748] 37a0: 0000007fffffffff ffffffc07df9f700 ffffff800dfe37c0 ffffff800060dee0
[ 76.003617] [<ffffff800060dee0>] gckKERNEL_OpenUserData+0x70/0xa0 [galcore]
[ 76.010553] [<ffffff80006120d4>] _ProcessUserCommandBufferList.constprop.5+0x54/0x278 [galcore]
[ 76.019223] [<ffffff8000612cdc>] gckCOMMAND_Commit+0x5c/0xb78 [galcore]
[ 76.025812] [<ffffff800061127c>] gckKERNEL_Dispatch+0xe6c/0x1420 [galcore]
[ 76.032661] [<ffffff8000611974>] gckDEVICE_Dispatch+0x144/0x158 [galcore]
[ 76.039423] [<ffffff800060afd8>] drv_ioctl+0xf0/0x1c8 [galcore]
[ 76.045257] [<ffffff8008197c2c>] do_vfs_ioctl+0xa4/0x868
[ 76.050542] [<ffffff800819847c>] SyS_ioctl+0x8c/0xa0
[ 76.055482] Exception stack(0xffffff800dfe3ec0 to 0xffffff800dfe4000)
[ 76.061900] 3ec0: 0000000000000011 0000000000007530 0000007fb176f750 0000000000000190
[ 76.069703] 3ee0: 0000007fb176f7e0 0000000000000190 000000003da0b5f0 0000000000000000
[ 76.077506] 3f00: 000000000000001d 00000000ffffff00 0000007fac000cc0 0000000000000002
[ 76.085309] 3f20: 0000007fac0635e4 000000003df4df0c 0000007fbbe85298 0000007fbbeb79fc
[ 76.093112] 3f40: 0000007fbbe9aca8 0000007fbd14ed70 0000007fbbe85298 0000000000002710
[ 76.100915] 3f60: 0000000000007530 0000007fbbeb7868 0000007fb176f7e0 0000007fb176f750
[ 76.108718] 3f80: 0000000000000190 0000000000000000 0000007fb1770290 0000007fb176f7e0
[ 76.116521] 3fa0: 0000007fbdcb8000 0000007fb176f700 0000007fbbe8036c 0000007fb176f700
[ 76.124324] 3fc0: 0000007fbd14ed7c 0000000020000000 0000000000000011 000000000000001d
[ 76.132126] 3fe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 76.139931] [<ffffff8008083040>] el0_svc_naked+0x34/0x38
[ 76.145220] Code: ff383f3e ff383f3e ff39403f ff39403f (ff39403f)
[ 76.151287] ---[ end trace 6c8beec140fabd96 ]---
[ 76.155881] Internal error: Oops: 96000004 [#2] SMP
[ 76.155883] Unable to handle kernel paging request at virtual address 405b56ff415a56
[ 76.155887] Mem abort info:
[ 76.155889] Exception class = DABT (current EL), IL = 32 bits
[ 76.155891] SET = 0, FnV = 0
[ 76.155892] EA = 0, S1PTW = 0
[ 76.155893] Data abort info:
[ 76.155895] ISV = 0, ISS = 0x00000004
[ 76.155896] CM = 0, WnR = 0
[ 76.155898] [00405b56ff415a56] address between user and kernel address ranges
[ 76.200011] Modules linked in: vfb sysimgblt sysfillrect syscopyarea fb_sys_fops viulite(O) jpegdcd(O) h264dcd(O) h264enc(O) fdma(O) seq(O) cam(O) csi(O) oal_driver(O) apex(O) sja1105pqrs(O) nxp galco)
[ 76.218221] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G D O 4.14.34-rt27+g5d76987 #4
[ 76.226627] Hardware name: Freescale S32V234 (DT)
[ 76.231310] task: ffffff80087fe600 task.stack: ffffff80087f0000
[ 76.237210] PC is at linflex_timer_func+0x2c/0xe0
[ 76.241889] LR is at linflex_timer_func+0x28/0xe0
[ 76.246569] pc : [<ffffff800838d84c>] lr : [<ffffff800838d848>] pstate: 00000145
[ 76.253937] sp : ffffff8008003db0
[ 76.257232] x29: ffffff8008003db0 x28: 0000000000000020
[ 76.262521] x27: ffffff80087f5190 x26: 0000000000000001
[ 76.267810] x25: ffffff80087f5180 x24: 0000000000000100
[ 76.273098] x23: ffffff80087fe600 x22: ff637855ff627855
[ 76.278387] x21: ffffffc07a8caa18 x20: 0000000000000100
[ 76.283676] x19: ffffffc07a8ca818 x18: 0000000000000000
[ 76.288964] x17: 0000007fbd14da68 x16: ffffff800819b0f0
[ 76.294253] x15: 0000000000000016 x14: 0000000000000000
[ 76.299542] x13: ffffffc07df8b760 x12: 0000000000000000
[ 76.304830] x11: 0000000000000001 x10: ffffff8008003ea0
[ 76.310119] x9 : ffffffc07df85870 x8 : 0000000000000000
[ 76.315408] x7 : 0000000000000006 x6 : 0000000000000040
[ 76.320696] x5 : 0000000000000040 x4 : 000000001fffe4a0
[ 76.325985] x3 : 0000000000000000 x2 : 0000000000000000
[ 76.331274] x1 : ffffffc07a8ca818 x0 : ff617956ff5f7955
[ 76.336564] Process swapper/0 (pid: 0, stack limit = 0xffffff80087f0000)
[ 76.343238] Call trace:
[ 76.345668] Exception stack(0xffffff8008003c70 to 0xffffff8008003db0)
[ 76.352084] 3c60: ff617956ff5f7955 ffffffc07a8ca818
[ 76.359887] 3c80: 0000000000000000 0000000000000000 000000001fffe4a0 0000000000000040
[ 76.367691] 3ca0: 0000000000000040 0000000000000006 0000000000000000 ffffffc07df85870
[ 76.375494] 3cc0: ffffff8008003ea0 0000000000000001 0000000000000000 ffffffc07df8b760
[ 76.383296] 3ce0: 0000000000000000 0000000000000016 ffffff800819b0f0 0000007fbd14da68
[ 76.391099] 3d00: 0000000000000000 ffffffc07a8ca818 0000000000000100 ffffffc07a8caa18
[ 76.398903] 3d20: ff637855ff627855 ffffff80087fe600 0000000000000100 ffffff80087f5180
[ 76.406706] 3d40: 0000000000000001 ffffff80087f5190 0000000000000020 ffffff8008003db0
[ 76.414509] 3d60: ffffff800838d848 ffffff8008003db0 ffffff800838d84c 0000000000000145
[ 76.422312] 3d80: ffffff8008003db0 ffffff800838d848 0000007fffffffff 0000000000000000
[ 76.430113] 3da0: ffffff8008003db0 ffffff800838d84c
[ 76.434971] [<ffffff800838d84c>] linflex_timer_func+0x2c/0xe0
[ 76.440694] [<ffffff80080f2d6c>] call_timer_fn.isra.4+0x24/0x80
[ 76.446588] [<ffffff80080f2e64>] expire_timers+0x9c/0xb0
[ 76.451876] [<ffffff80080f2f00>] run_timer_softirq+0x88/0x158
[ 76.457598] [<ffffff80080811b8>] __do_softirq+0x110/0x238
[ 76.462975] [<ffffff80080a12b0>] irq_exit+0xc8/0x100
[ 76.467917] [<ffffff80080e0240>] __handle_domain_irq+0x60/0xb8
[ 76.473724] [<ffffff8008080ed0>] gic_handle_irq+0x58/0xb0
[ 76.479099] Exception stack(0xffffff80087f3de0 to 0xffffff80087f3f20)
[ 76.485516] 3de0: 0000000000000020 ffffff80087dc785 00000040757a9000 0000000000029d08
[ 76.493319] 3e00: 0000000000000000 ffffff80087f3f20 00000040757a9000 0000000000000001
[ 76.501122] 3e20: ffffff80087fef60 00000000000001c0 0000000000000900 0000000000000000
[ 76.508925] 3e40: 0000000000000001 ffffffc07df8b760 0000000000000000 0000000000000000
[ 76.516728] 3e60: ffffff800819b0f0 0000007fbd14da68 0000000000000000 ffffff80087d9010
[ 76.524531] 3e80: ffffff80087f89b4 ffffff80087f8928 ffffff80087fe600 ffffff80087fe600
[ 76.532334] 3ea0: ffffff80087d0028 00000000fffaf968 0000000000000000 00000000fff6c9a0
[ 76.540137] 3ec0: 0000000080790018 ffffff80087f3f20 ffffff800808486c ffffff80087f3f20
[ 76.547940] 3ee0: ffffff8008084870 0000000060000145 00000000fffaf968 0000000000000000
[ 76.555743] 3f00: ffffffffffffffff ffffff800885b000 ffffff80087f3f20 ffffff8008084870
[ 76.563546] [<ffffff8008082930>] el1_irq+0xb0/0x140
[ 76.568402] [<ffffff8008084870>] arch_cpu_idle+0x10/0x18
[ 76.573691] [<ffffff80080d57d0>] do_idle+0xd8/0x110
[ 76.578545] [<ffffff80080d5960>] cpu_startup_entry+0x20/0x28
[ 76.584183] [<ffffff80085f24c4>] rest_init+0xac/0xb8
[ 76.589124] [<ffffff8008790b70>] start_kernel+0x384/0x398
[ 76.594498] Code: aa1503e0 f9405a76 97f5931f f940da60 (f9400001)
[ 76.600565] ---[ end trace 6c8beec140fabd97 ]---
[ 76.605161] Kernel panic - not syncing: Fatal exception in interrupt
[ 76.611491] SMP: stopping secondary CPUs
[ 77.635847] SMP: failed to stop secondary CPUs 0-1
[ 77.640276] Kernel Offset: disabled
[ 77.643744] CPU features: 0x0802004
[ 77.647210] Memory Limit: none
[ 77.650248] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
[ 77.657377] Unable to handle kernel paging request at virtual address ffffff800d483ea0
[ 77.665244] Mem abort info:
[ 77.668019] Exception class = DABT (current EL), IL = 32 bits
[ 77.673914] SET = 0, FnV = 0
[ 77.676949] EA = 0, S1PTW = 0
[ 77.680070] Data abort info:
[ 77.682931] ISV = 0, ISS = 0x00000007
[ 77.686746] CM = 0, WnR = 0
[ 77.689695] swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff800889b000
[ 77.696457] [ffffff800d483ea0] *pgd=00000000fdffe803, *pud=00000000fdffe803, *pmd=00000000faac2003, *pte=ffd7d8daffd6d8da

 

 
0 Kudos
2 Replies

161 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello huangjacky,

 

Which processor are you using? with BSP version? Your code runs well on MX6Q on L4.19.35 BSP.

 

Regards

 

0 Kudos

158 Views
huangjacky
Contributor III
Hi Bio_TICFSL: the Log is printed by S32V, bsp18_kernel_4.14.34. my code is work well on MX6Q with /dev/fb0, but not test for vfb I just porting the code from MX6Q to S32V and render to vfb.
0 Kudos