Lines Matching refs:b

38 			   struct s5p_mfc_priv_buf *b)  in s5p_mfc_alloc_priv_buf()  argument
41 unsigned int count = b->size >> PAGE_SHIFT; in s5p_mfc_alloc_priv_buf()
45 mfc_debug(3, "Allocating priv: %zu\n", b->size); in s5p_mfc_alloc_priv_buf()
54 b->virt = dev->mem_virt + offset; in s5p_mfc_alloc_priv_buf()
55 b->dma = dev->mem_base + offset; in s5p_mfc_alloc_priv_buf()
60 b->ctx = mem_ctx; in s5p_mfc_alloc_priv_buf()
61 b->virt = dma_alloc_coherent(mem_dev, b->size, &b->dma, GFP_KERNEL); in s5p_mfc_alloc_priv_buf()
62 if (!b->virt) in s5p_mfc_alloc_priv_buf()
64 if (b->dma < base) { in s5p_mfc_alloc_priv_buf()
66 &b->dma, &base); in s5p_mfc_alloc_priv_buf()
67 dma_free_coherent(mem_dev, b->size, b->virt, b->dma); in s5p_mfc_alloc_priv_buf()
72 mfc_debug(3, "Allocated addr %p %pad\n", b->virt, &b->dma); in s5p_mfc_alloc_priv_buf()
75 mfc_err("Allocating private buffer of size %zu failed\n", b->size); in s5p_mfc_alloc_priv_buf()
80 struct s5p_mfc_priv_buf *b) in s5p_mfc_alloc_generic_buf() argument
84 mfc_debug(3, "Allocating generic buf: %zu\n", b->size); in s5p_mfc_alloc_generic_buf()
86 b->ctx = mem_ctx; in s5p_mfc_alloc_generic_buf()
87 b->virt = dma_alloc_coherent(mem_dev, b->size, &b->dma, GFP_KERNEL); in s5p_mfc_alloc_generic_buf()
88 if (!b->virt) in s5p_mfc_alloc_generic_buf()
91 mfc_debug(3, "Allocated addr %p %pad\n", b->virt, &b->dma); in s5p_mfc_alloc_generic_buf()
94 mfc_err("Allocating generic buffer of size %zu failed\n", b->size); in s5p_mfc_alloc_generic_buf()
99 struct s5p_mfc_priv_buf *b) in s5p_mfc_release_priv_buf() argument
102 unsigned int start = (b->dma - dev->mem_base) >> PAGE_SHIFT; in s5p_mfc_release_priv_buf()
103 unsigned int count = b->size >> PAGE_SHIFT; in s5p_mfc_release_priv_buf()
107 struct device *mem_dev = dev->mem_dev[b->ctx]; in s5p_mfc_release_priv_buf()
109 dma_free_coherent(mem_dev, b->size, b->virt, b->dma); in s5p_mfc_release_priv_buf()
111 b->virt = NULL; in s5p_mfc_release_priv_buf()
112 b->dma = 0; in s5p_mfc_release_priv_buf()
113 b->size = 0; in s5p_mfc_release_priv_buf()
117 struct s5p_mfc_priv_buf *b) in s5p_mfc_release_generic_buf() argument
119 struct device *mem_dev = dev->mem_dev[b->ctx]; in s5p_mfc_release_generic_buf()
120 dma_free_coherent(mem_dev, b->size, b->virt, b->dma); in s5p_mfc_release_generic_buf()
121 b->virt = NULL; in s5p_mfc_release_generic_buf()
122 b->dma = 0; in s5p_mfc_release_generic_buf()
123 b->size = 0; in s5p_mfc_release_generic_buf()