Skip to content

Commit

Permalink
firmware: add encoder output throughput to status message
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Aug 19, 2015
1 parent 319166c commit a24fd68
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
26 changes: 15 additions & 11 deletions firmware/lm32/ci.c
Expand Up @@ -34,17 +34,17 @@ static void help_framebuffer0(char banner)
{
if(banner)
help_banner();
puts("framebuffer0 <source> - select framebuffer0 source and enable it");
puts("framebuffer0 off - disable framebuffer0");
puts("framebuffer0 <source> - select framebuffer0 source and enable it");
puts("framebuffer0 off - disable framebuffer0");
puts("");
}

static void help_framebuffer1(char banner)
{
if(banner)
help_banner();
puts("framebuffer1 <source> - select framebuffer1 source and enable it");
puts("framebuffer1 off - disable framebuffer1");
puts("framebuffer1 <source> - select framebuffer1 source and enable it");
puts("framebuffer1 off - disable framebuffer1");
puts("");
}

Expand Down Expand Up @@ -96,6 +96,7 @@ static void status_enable(void)
{
printf("Enabling status\n");
status_enabled = 1;
encoder_nwrites_clear_write(1);
}

static void status_disable(void)
Expand Down Expand Up @@ -141,13 +142,16 @@ static void status_service(void)

#ifdef ENCODER_BASE
printf("encoder: ");
if(encoder_enabled)
printf("%dx%d @ %dfps from video source %d, q: %d", processor_h_active,
processor_v_active,
encoder_fps,
processor_encoder_source,
encoder_quality);
else
if(encoder_enabled) {
printf("%dx%d @ %dfps (%dMbps) from video source %d (q: %d)",
processor_h_active,
processor_v_active,
encoder_fps,
encoder_nwrites_read()*8/1000000,
processor_encoder_source,
encoder_quality);
encoder_nwrites_clear_write(1);
} else
printf("off");
printf("\n");
#endif
Expand Down
11 changes: 11 additions & 0 deletions hdl/encoder/__init__.py
Expand Up @@ -56,8 +56,19 @@ def __init__(self, platform):
self.source = Source([("data", 8)])
self.bus = wishbone.Interface()

self._nwrites_clear = CSR()
self._nwrites = CSRStatus(32)

# # #

nwrites = self._nwrites.status
self.sync += \
If(self._nwrites_clear.re & self._nwrites_clear.r,
nwrites.eq(0)
).Elif(self.source.stb & self.source.ack,
nwrites.eq(nwrites + 1)
)

chroma_upsampler = YCbCr422to444()
self.submodules += chroma_upsampler
self.comb += [
Expand Down

0 comments on commit a24fd68

Please sign in to comment.