Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: ti: vpe: Re-introduce multi-instance and multi-client support

vpdma_update_dma_addr() was originally added to support multi-instance and
multi-client in vpdma. However it was dropped as it was unused.

We are adding support for TI VIP. Some devices may have multiple VIP
instances each with its own VPDMA engine. Within VIP, two slices can use a
single VPDMA engine simultaneously. So support for multi instances and
multiple clients is needed. Hence reintroduce multi-instance and
multi-client support. Also add kernel doc and switch to GPL version of
EXPORT_SYMBOL.

This reverts commit 9314891df119442a6ec1518b3d872c330e2bf1a1.

Signed-off-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Yemike Abhilash Chandra and committed by
Hans Verkuil
4011e67a 36eab90d

+51
+48
drivers/media/platform/ti/vpe/vpdma.c
··· 552 552 553 553 static void dump_dtd(struct vpdma_dtd *dtd); 554 554 555 + /** 556 + * vpdma_update_dma_addr() - update DMA address in a descriptor 557 + * @vpdma: VPDMA device context 558 + * @list: vpdma desc list to which we add this descriptor 559 + * @dma_addr: new DMA address to program into the descriptor 560 + * @write_dtd: descriptor pointer used to compute write-back address 561 + * @drop: if true, set the drop bit in the write descriptor 562 + * @idx: index of the descriptor in the list to update 563 + * 564 + * Updates dma addresses of the descriptor at @idx in @list. 565 + * This allows reusing an existing descriptor list with a new buffer 566 + * address, instead of rebuilding the list, which is needed when 567 + * multiple clients share the same VPDMA engine. The list buffer is 568 + * unmapped before the update and remapped after. 569 + */ 570 + void vpdma_update_dma_addr(struct vpdma_data *vpdma, 571 + struct vpdma_desc_list *list, 572 + dma_addr_t dma_addr, 573 + void *write_dtd, int drop, int idx) 574 + { 575 + struct vpdma_dtd *dtd = list->buf.addr; 576 + dma_addr_t write_desc_addr; 577 + int offset; 578 + 579 + dtd += idx; 580 + vpdma_unmap_desc_buf(vpdma, &list->buf); 581 + 582 + dtd->start_addr = dma_addr; 583 + 584 + /* Calculate write address from the offset of write_dtd from start 585 + * of the list->buf 586 + */ 587 + offset = (void *)write_dtd - list->buf.addr; 588 + write_desc_addr = list->buf.dma_addr + offset; 589 + 590 + if (drop) 591 + dtd->desc_write_addr = dtd_desc_write_addr(write_desc_addr, 592 + 1, 1, 0); 593 + else 594 + dtd->desc_write_addr = dtd_desc_write_addr(write_desc_addr, 595 + 1, 0, 0); 596 + 597 + vpdma_map_desc_buf(vpdma, &list->buf); 598 + 599 + dump_dtd(dtd); 600 + } 601 + EXPORT_SYMBOL_GPL(vpdma_update_dma_addr); 602 + 555 603 void vpdma_set_max_size(struct vpdma_data *vpdma, int reg_addr, 556 604 u32 width, u32 height) 557 605 {
+3
drivers/media/platform/ti/vpe/vpdma.h
··· 222 222 int vpdma_submit_descs(struct vpdma_data *vpdma, struct vpdma_desc_list *list, 223 223 int list_num); 224 224 bool vpdma_list_busy(struct vpdma_data *vpdma, int list_num); 225 + void vpdma_update_dma_addr(struct vpdma_data *vpdma, 226 + struct vpdma_desc_list *list, dma_addr_t dma_addr, 227 + void *write_dtd, int drop, int idx); 225 228 226 229 /* VPDMA hardware list funcs */ 227 230 int vpdma_hwlist_alloc(struct vpdma_data *vpdma, void *priv);