kopia lustrzana https://github.com/hoglet67/RGBtoHDMI
Add GPIO benchmark
rodzic
90ee1f8501
commit
37daa5ddde
|
@ -2136,11 +2136,19 @@ delay_loop:
|
|||
benchmarkRAM:
|
||||
push {r1-r12, lr}
|
||||
// RAM address in r0 returns with time in r0
|
||||
cmp r0, #0
|
||||
beq gpio_bench
|
||||
mov r1, r0
|
||||
add r2, r1, #4000
|
||||
preload_benchloop2:
|
||||
ldr r6, [r1], #4
|
||||
cmp r1, r2
|
||||
blt preload_benchloop2
|
||||
READ_CYCLE_COUNTER r4
|
||||
mov r3, #1024
|
||||
mov r3, #1000
|
||||
benchloop:
|
||||
mov r1, r0
|
||||
add r2, r1, #1024
|
||||
add r2, r1, #4000
|
||||
benchloop2:
|
||||
ldr r6, [r1], #4
|
||||
cmp r1, r2
|
||||
|
@ -2151,6 +2159,25 @@ benchloop2:
|
|||
subs r0, r5, r4
|
||||
rsbmi r0, r0, #1
|
||||
pop {r1-r12, pc}
|
||||
|
||||
gpio_bench:
|
||||
ldr r4, =GPLEV0
|
||||
READ_CYCLE_COUNTER r6
|
||||
mov r3, #1000
|
||||
gbenchloop:
|
||||
mov r1, #0
|
||||
gbenchloop2:
|
||||
ldr r8, [r4]
|
||||
add r1, r1, #1
|
||||
cmp r1, #1000
|
||||
blt gbenchloop2
|
||||
subs r3, r3, #1
|
||||
bne gbenchloop
|
||||
READ_CYCLE_COUNTER r7
|
||||
subs r0, r7, r6
|
||||
rsbmi r0, r0, #1
|
||||
pop {r1-r12, pc}
|
||||
|
||||
.ltorg
|
||||
|
||||
|
||||
|
|
|
@ -3089,7 +3089,9 @@ void rgb_to_hdmi_main() {
|
|||
init_framebuffer(capinfo);
|
||||
log_debug("Done setting up frame buffer");
|
||||
//log_info("Peripheral base = %08X", PERIPHERAL_BASE);
|
||||
log_info("RAM benchmark: Main memory = %d ns, Screen memory = %d ns", (int) ((double) benchmarkRAM(dummyscreen) * 1000 / cpuspeed), (int) ((double) benchmarkRAM((int) capinfo->fb) * 1000 / cpuspeed));
|
||||
|
||||
log_info("GPIO read = %d ns, Cached read = %d ns, Screen read = %d ns", (int)((double) benchmarkRAM(0) * 1000 / cpuspeed / 1000000 + 0.5),
|
||||
(int)((double) benchmarkRAM(0x2000000) * 1000 / cpuspeed / 1000000 + 0.5), (int)((double) benchmarkRAM((int) capinfo->fb) * 1000 / cpuspeed / 1000000 + 0.5));
|
||||
|
||||
geometry_get_fb_params(capinfo);
|
||||
capinfo->ncapture = ncapture;
|
||||
|
|
Ładowanie…
Reference in New Issue