1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

Merge branch 'internal'

This commit is contained in:
none 2021-03-01 13:06:05 +01:00
commit 476a105de7

View File

@ -281,9 +281,9 @@ static int dma_alloc(struct pci_dev *pdev, struct ddb_dma *dma, int dir)
for (i = 0; i < dma->num; i++) { for (i = 0; i < dma->num; i++) {
if (alt_dma) { if (alt_dma) {
#if (KERNEL_VERSION(4, 13, 0) > LINUX_VERSION_CODE) #if (KERNEL_VERSION(4, 13, 0) > LINUX_VERSION_CODE)
dma->vbuf[i] = kmalloc(dma->size, __GFP_REPEAT); dma->vbuf[i] = kzalloc(dma->size, __GFP_REPEAT);
#else #else
dma->vbuf[i] = kmalloc(dma->size, __GFP_RETRY_MAYFAIL); dma->vbuf[i] = kzalloc(dma->size, __GFP_RETRY_MAYFAIL);
#endif #endif
if (!dma->vbuf[i]) if (!dma->vbuf[i])
return -ENOMEM; return -ENOMEM;
@ -301,10 +301,12 @@ static int dma_alloc(struct pci_dev *pdev, struct ddb_dma *dma, int dir)
dma->vbuf[i] = dma_alloc_coherent(&pdev->dev, dma->vbuf[i] = dma_alloc_coherent(&pdev->dev,
dma->size, dma->size,
&dma->pbuf[i], &dma->pbuf[i],
GFP_KERNEL); GFP_KERNEL | __GFP_ZERO);
if (!dma->vbuf[i]) if (!dma->vbuf[i])
return -ENOMEM; return -ENOMEM;
} }
if (((u64)dma->vbuf[i] & 0xfff))
dev_err(&pdev->dev, "DMA memory at %px not aligned!\n", dma->vbuf[i]);
} }
return 0; return 0;
} }
@ -2305,7 +2307,7 @@ static void input_write_dvb(struct ddb_input *input,
dma2->vbuf[dma->cbuf], dma2->vbuf[dma->cbuf],
dma2->size); dma2->size);
} else { } else {
if (dma2->vbuf[dma->cbuf][0] != 0x47) { if (dma2->unaligned || (dma2->vbuf[dma->cbuf][0] != 0x47)) {
if (!dma2->unaligned) { if (!dma2->unaligned) {
dma2->unaligned++; dma2->unaligned++;
dev_warn(dev->dev, "Input %u dma buffer unaligned, " dev_warn(dev->dev, "Input %u dma buffer unaligned, "
@ -2313,7 +2315,7 @@ static void input_write_dvb(struct ddb_input *input,
input->nr); input->nr);
print_hex_dump(KERN_INFO, "TS: ", DUMP_PREFIX_OFFSET, 32, 1, print_hex_dump(KERN_INFO, "TS: ", DUMP_PREFIX_OFFSET, 32, 1,
dma2->vbuf[dma->cbuf], dma2->vbuf[dma->cbuf],
256, false); 512, false);
} }
dvb_dmx_swfilter(&dvb->demux, dvb_dmx_swfilter(&dvb->demux,
dma2->vbuf[dma->cbuf], dma2->vbuf[dma->cbuf],