/alps/ipecamera

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to dma/nwl_loopback.c

  • Committer: Suren A. Chilingaryan
  • Date: 2011-12-12 04:45:35 UTC
  • Revision ID: csa@dside.dyndns.org-20111212044535-6no1q7g230i8uvlv
multithread preprocessing of ipecamera frames and code reorganization

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
 
67
67
double dma_nwl_benchmark(pcilib_dma_context_t *vctx, pcilib_dma_engine_addr_t dma, uintptr_t addr, size_t size, size_t iterations, pcilib_dma_direction_t direction) {
68
68
    int iter, i;
69
 
    int res;
70
69
    int err;
71
70
    size_t bytes, rbytes;
72
 
    uint32_t val;
73
71
    uint32_t *buf, *cmp;
74
72
    const char *error = NULL;
75
 
    pcilib_register_value_t regval;
76
73
    size_t packet_size, blocks;    
77
74
 
78
75
    size_t us = 0;
83
80
    pcilib_dma_engine_t readid = pcilib_find_dma_by_addr(ctx->pcilib, PCILIB_DMA_FROM_DEVICE, dma);
84
81
    pcilib_dma_engine_t writeid = pcilib_find_dma_by_addr(ctx->pcilib, PCILIB_DMA_TO_DEVICE, dma);
85
82
 
86
 
    char *read_base = ctx->engines[readid].base_addr;
87
 
    char *write_base = ctx->engines[writeid].base_addr;
88
 
 
89
83
    if (size%sizeof(uint32_t)) size = 1 + size / sizeof(uint32_t);
90
84
    else size /= sizeof(uint32_t);
91
85
 
214
208
        
215
209
#ifndef NWL_BUG_EXTRA_DATA
216
210
        if (direction == PCILIB_DMA_BIDIRECTIONAL) {
217
 
            res = memcmp(buf, cmp, size * sizeof(uint32_t));
218
 
            if (res) {
 
211
            if (memcmp(buf, cmp, size * sizeof(uint32_t))) {
219
212
                for (i = 0; i < size; i++)
220
213
                    if (buf[i] != cmp[i]) break;
221
214