diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-14 01:44:10 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-14 01:44:10 +0200 |
commit | b492b1aac3d12683ccbc973b08b023ba0466cbec (patch) | |
tree | 09f6d3d0cc3725b62a5c9210220e14316b737622 /ipecamera | |
parent | 9f17f71885344d93b16fdc17458aa28ba350a480 (diff) | |
download | pcitool-b492b1aac3d12683ccbc973b08b023ba0466cbec.tar.gz pcitool-b492b1aac3d12683ccbc973b08b023ba0466cbec.tar.bz2 pcitool-b492b1aac3d12683ccbc973b08b023ba0466cbec.tar.xz pcitool-b492b1aac3d12683ccbc973b08b023ba0466cbec.zip |
Support modifications of DMA engine and allow DMA customizations by Event engine
Diffstat (limited to 'ipecamera')
-rw-r--r-- | ipecamera/image.c | 15 | ||||
-rw-r--r-- | ipecamera/image.h | 1 | ||||
-rw-r--r-- | ipecamera/model.h | 3 |
3 files changed, 18 insertions, 1 deletions
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"); diff --git a/ipecamera/image.h b/ipecamera/image.h index 6863d09..4bac673 100644 --- a/ipecamera/image.h +++ b/ipecamera/image.h @@ -18,6 +18,7 @@ pcilib_event_id_t ipecamera_next_event(pcilib_context_t *ctx, pcilib_event_t eve void* ipecamera_get(pcilib_context_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t arg_size, void *arg, size_t *size); int ipecamera_return(pcilib_context_t *ctx, pcilib_event_id_t event_id); +pcilib_dma_context_t *ipecamera_init_dma(pcilib_context_t *ctx); #endif /* _IPECAMERA_IMAGE_H */ diff --git a/ipecamera/model.h b/ipecamera/model.h index da0ac12..a460dde 100644 --- a/ipecamera/model.h +++ b/ipecamera/model.h @@ -109,7 +109,8 @@ pcilib_event_api_description_t ipecamera_image_api = { ipecamera_next_event, ipecamera_get, - ipecamera_return + ipecamera_return, + ipecamera_init_dma }; #else extern pcilib_event_api_description_t ipecamera_image_api; |