From: Sebastien Bourdeauducq Date: Mon, 6 May 2013 07:56:49 +0000 (+0200) Subject: software/videomixer: send to framebuffer X-Git-Tag: 24jan2021_ls180~2949 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f82a16f3a3dab2d4328a93078a52c05682a35874;p=litex.git software/videomixer: send to framebuffer --- diff --git a/software/videomixer/main.c b/software/videomixer/main.c index 7ae7e4f6..118e1291 100644 --- a/software/videomixer/main.c +++ b/software/videomixer/main.c @@ -3,10 +3,12 @@ #include #include +#include #include #include static int d0, d1, d2; +static unsigned int framebuffer[640*480] __attribute__((aligned(16))); static void print_status(void) { @@ -22,6 +24,17 @@ static void print_status(void) dvisampler0_resdetection_vres_read()); } +static void capture_fb(void) +{ + dvisampler0_dma_base_write((unsigned int)framebuffer); + dvisampler0_dma_length_write(sizeof(framebuffer)); + dvisampler0_dma_shoot_write(1); + + printf("waiting for DMA..."); + while(dvisampler0_dma_busy_read()); + printf("done\n"); +} + static void calibrate_delays(void) { dvisampler0_data0_cap_dly_ctl_write(DVISAMPLER_DELAY_CAL); @@ -119,6 +132,8 @@ static void vmix(void) adjust_phase(); counter = 0; } + if(readchar_nonblock() && (readchar() == 'c')) + capture_fb(); } printf("PLL unlocked\n"); } @@ -132,6 +147,8 @@ int main(void) puts("Minimal video mixer software built "__DATE__" "__TIME__"\n"); + fb_base_write((unsigned int)framebuffer); + fb_enable_write(1); vmix(); return 0;