Lines Matching refs:b

41 			   struct s5p_mfc_priv_buf *b)  in s5p_mfc_alloc_priv_buf()  argument
44 unsigned int count = b->size >> PAGE_SHIFT; in s5p_mfc_alloc_priv_buf()
48 mfc_debug(3, "Allocating priv: %zu\n", b->size); in s5p_mfc_alloc_priv_buf()
57 b->virt = dev->mem_virt + offset; in s5p_mfc_alloc_priv_buf()
58 b->dma = dev->mem_base + offset; in s5p_mfc_alloc_priv_buf()
63 b->ctx = mem_ctx; in s5p_mfc_alloc_priv_buf()
64 b->virt = dma_alloc_coherent(mem_dev, b->size, &b->dma, GFP_KERNEL); in s5p_mfc_alloc_priv_buf()
65 if (!b->virt) in s5p_mfc_alloc_priv_buf()
67 if (b->dma < base) { in s5p_mfc_alloc_priv_buf()
69 &b->dma, &base); in s5p_mfc_alloc_priv_buf()
70 dma_free_coherent(mem_dev, b->size, b->virt, b->dma); in s5p_mfc_alloc_priv_buf()
75 mfc_debug(3, "Allocated addr %p %pad\n", b->virt, &b->dma); in s5p_mfc_alloc_priv_buf()
78 mfc_err("Allocating private buffer of size %zu failed\n", b->size); in s5p_mfc_alloc_priv_buf()
83 struct s5p_mfc_priv_buf *b) in s5p_mfc_alloc_generic_buf() argument
87 mfc_debug(3, "Allocating generic buf: %zu\n", b->size); in s5p_mfc_alloc_generic_buf()
89 b->ctx = mem_ctx; in s5p_mfc_alloc_generic_buf()
90 b->virt = dma_alloc_coherent(mem_dev, b->size, &b->dma, GFP_KERNEL); in s5p_mfc_alloc_generic_buf()
91 if (!b->virt) in s5p_mfc_alloc_generic_buf()
94 mfc_debug(3, "Allocated addr %p %pad\n", b->virt, &b->dma); in s5p_mfc_alloc_generic_buf()
97 mfc_err("Allocating generic buffer of size %zu failed\n", b->size); in s5p_mfc_alloc_generic_buf()
102 struct s5p_mfc_priv_buf *b) in s5p_mfc_release_priv_buf() argument
105 unsigned int start = (b->dma - dev->mem_base) >> PAGE_SHIFT; in s5p_mfc_release_priv_buf()
106 unsigned int count = b->size >> PAGE_SHIFT; in s5p_mfc_release_priv_buf()
110 struct device *mem_dev = dev->mem_dev[b->ctx]; in s5p_mfc_release_priv_buf()
112 dma_free_coherent(mem_dev, b->size, b->virt, b->dma); in s5p_mfc_release_priv_buf()
114 b->virt = NULL; in s5p_mfc_release_priv_buf()
115 b->dma = 0; in s5p_mfc_release_priv_buf()
116 b->size = 0; in s5p_mfc_release_priv_buf()
120 struct s5p_mfc_priv_buf *b) in s5p_mfc_release_generic_buf() argument
122 struct device *mem_dev = dev->mem_dev[b->ctx]; in s5p_mfc_release_generic_buf()
123 dma_free_coherent(mem_dev, b->size, b->virt, b->dma); in s5p_mfc_release_generic_buf()
124 b->virt = NULL; in s5p_mfc_release_generic_buf()
125 b->dma = 0; in s5p_mfc_release_generic_buf()
126 b->size = 0; in s5p_mfc_release_generic_buf()