From b492b1aac3d12683ccbc973b08b023ba0466cbec Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 14 Jul 2011 01:44:10 +0200 Subject: Support modifications of DMA engine and allow DMA customizations by Event engine --- ipecamera/image.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ipecamera/image.c') diff --git a/ipecamera/image.c b/ipecamera/image.c index bf5faf9..3d1056d 100644 --- a/ipecamera/image.c +++ b/ipecamera/image.c @@ -16,6 +16,8 @@ #include "model.h" #include "image.h" +#include "dma/nwl_dma.h" + #define IPECAMERA_SLEEP_TIME 250000 #define IPECAMERA_MAX_LINES 1088 #define IPECAMERA_DEFAULT_BUFFER_SIZE 10 @@ -171,6 +173,19 @@ void ipecamera_free(pcilib_context_t *vctx) { } } +pcilib_dma_context_t *ipecamera_init_dma(pcilib_context_t *vctx) { + ipecamera_t *ctx = (ipecamera_t*)vctx; + + pcilib_model_description_t *model_info = pcilib_get_model_description(ctx->pcilib); + if ((!model_info->dma_api)||(!model_info->dma_api->init)) { + pcilib_error("The DMA engine is not configured in model"); + return NULL; + } + + return model_info->dma_api->init(ctx->pcilib, PCILIB_DMA_MODIFICATION_DEFAULT, NULL); +} + + int ipecamera_set_buffer_size(ipecamera_t *ctx, int size) { if (ctx->started) { pcilib_error("Can't change buffer size while grabbing"); -- cgit v1.2.3