Lines Matching refs:src
28 static int src_default_config_memrd(struct src *src);
29 static int src_default_config_memwr(struct src *src);
30 static int src_default_config_arcrw(struct src *src);
32 static int (*src_default_config[3])(struct src *) = {
38 static int src_set_state(struct src *src, unsigned int state) in src_set_state() argument
42 hw = src->rsc.hw; in src_set_state()
43 hw->src_set_state(src->rsc.ctrl_blk, state); in src_set_state()
48 static int src_set_bm(struct src *src, unsigned int bm) in src_set_bm() argument
52 hw = src->rsc.hw; in src_set_bm()
53 hw->src_set_bm(src->rsc.ctrl_blk, bm); in src_set_bm()
58 static int src_set_sf(struct src *src, unsigned int sf) in src_set_sf() argument
62 hw = src->rsc.hw; in src_set_sf()
63 hw->src_set_sf(src->rsc.ctrl_blk, sf); in src_set_sf()
68 static int src_set_pm(struct src *src, unsigned int pm) in src_set_pm() argument
72 hw = src->rsc.hw; in src_set_pm()
73 hw->src_set_pm(src->rsc.ctrl_blk, pm); in src_set_pm()
78 static int src_set_rom(struct src *src, unsigned int rom) in src_set_rom() argument
82 hw = src->rsc.hw; in src_set_rom()
83 hw->src_set_rom(src->rsc.ctrl_blk, rom); in src_set_rom()
88 static int src_set_vo(struct src *src, unsigned int vo) in src_set_vo() argument
92 hw = src->rsc.hw; in src_set_vo()
93 hw->src_set_vo(src->rsc.ctrl_blk, vo); in src_set_vo()
98 static int src_set_st(struct src *src, unsigned int st) in src_set_st() argument
102 hw = src->rsc.hw; in src_set_st()
103 hw->src_set_st(src->rsc.ctrl_blk, st); in src_set_st()
108 static int src_set_bp(struct src *src, unsigned int bp) in src_set_bp() argument
112 hw = src->rsc.hw; in src_set_bp()
113 hw->src_set_bp(src->rsc.ctrl_blk, bp); in src_set_bp()
118 static int src_set_cisz(struct src *src, unsigned int cisz) in src_set_cisz() argument
122 hw = src->rsc.hw; in src_set_cisz()
123 hw->src_set_cisz(src->rsc.ctrl_blk, cisz); in src_set_cisz()
128 static int src_set_ca(struct src *src, unsigned int ca) in src_set_ca() argument
132 hw = src->rsc.hw; in src_set_ca()
133 hw->src_set_ca(src->rsc.ctrl_blk, ca); in src_set_ca()
138 static int src_set_sa(struct src *src, unsigned int sa) in src_set_sa() argument
142 hw = src->rsc.hw; in src_set_sa()
143 hw->src_set_sa(src->rsc.ctrl_blk, sa); in src_set_sa()
148 static int src_set_la(struct src *src, unsigned int la) in src_set_la() argument
152 hw = src->rsc.hw; in src_set_la()
153 hw->src_set_la(src->rsc.ctrl_blk, la); in src_set_la()
158 static int src_set_pitch(struct src *src, unsigned int pitch) in src_set_pitch() argument
162 hw = src->rsc.hw; in src_set_pitch()
163 hw->src_set_pitch(src->rsc.ctrl_blk, pitch); in src_set_pitch()
168 static int src_set_clear_zbufs(struct src *src) in src_set_clear_zbufs() argument
172 hw = src->rsc.hw; in src_set_clear_zbufs()
173 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1); in src_set_clear_zbufs()
178 static int src_commit_write(struct src *src) in src_commit_write() argument
184 hw = src->rsc.hw; in src_commit_write()
185 src->rsc.ops->master(&src->rsc); in src_commit_write()
186 if (src->rsc.msr > 1) { in src_commit_write()
188 dirty = hw->src_get_dirty(src->rsc.ctrl_blk) & conj_mask; in src_commit_write()
190 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_commit_write()
191 src->rsc.ctrl_blk); in src_commit_write()
194 if (MEMWR == src->mode) in src_commit_write()
197 for (i = 1; i < src->rsc.msr; i++) { in src_commit_write()
198 src->rsc.ops->next_conj(&src->rsc); in src_commit_write()
199 hw->src_set_dirty(src->rsc.ctrl_blk, dirty); in src_commit_write()
200 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_commit_write()
201 src->rsc.ctrl_blk); in src_commit_write()
203 src->rsc.ops->master(&src->rsc); in src_commit_write()
208 static int src_get_ca(struct src *src) in src_get_ca() argument
212 hw = src->rsc.hw; in src_get_ca()
213 return hw->src_get_ca(hw, src->rsc.ops->index(&src->rsc), in src_get_ca()
214 src->rsc.ctrl_blk); in src_get_ca()
217 static int src_init(struct src *src) in src_init() argument
219 src_default_config[src->mode](src); in src_init()
224 static struct src *src_next_interleave(struct src *src) in src_next_interleave() argument
226 return src->intlv; in src_next_interleave()
229 static int src_default_config_memrd(struct src *src) in src_default_config_memrd() argument
231 struct hw *hw = src->rsc.hw; in src_default_config_memrd()
234 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF); in src_default_config_memrd()
235 hw->src_set_bm(src->rsc.ctrl_blk, 1); in src_default_config_memrd()
236 for (rsr = 0, msr = src->rsc.msr; msr > 1; msr >>= 1) in src_default_config_memrd()
239 hw->src_set_rsr(src->rsc.ctrl_blk, rsr); in src_default_config_memrd()
240 hw->src_set_sf(src->rsc.ctrl_blk, SRC_SF_S16); in src_default_config_memrd()
241 hw->src_set_wr(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
242 hw->src_set_pm(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
243 hw->src_set_rom(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
244 hw->src_set_vo(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
245 hw->src_set_st(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
246 hw->src_set_ilsz(src->rsc.ctrl_blk, src->multi - 1); in src_default_config_memrd()
247 hw->src_set_cisz(src->rsc.ctrl_blk, 0x80); in src_default_config_memrd()
248 hw->src_set_sa(src->rsc.ctrl_blk, 0x0); in src_default_config_memrd()
249 hw->src_set_la(src->rsc.ctrl_blk, 0x1000); in src_default_config_memrd()
250 hw->src_set_ca(src->rsc.ctrl_blk, 0x80); in src_default_config_memrd()
251 hw->src_set_pitch(src->rsc.ctrl_blk, 0x1000000); in src_default_config_memrd()
252 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1); in src_default_config_memrd()
254 src->rsc.ops->master(&src->rsc); in src_default_config_memrd()
255 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_default_config_memrd()
256 src->rsc.ctrl_blk); in src_default_config_memrd()
258 for (msr = 1; msr < src->rsc.msr; msr++) { in src_default_config_memrd()
259 src->rsc.ops->next_conj(&src->rsc); in src_default_config_memrd()
260 hw->src_set_pitch(src->rsc.ctrl_blk, 0x1000000); in src_default_config_memrd()
261 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_default_config_memrd()
262 src->rsc.ctrl_blk); in src_default_config_memrd()
264 src->rsc.ops->master(&src->rsc); in src_default_config_memrd()
269 static int src_default_config_memwr(struct src *src) in src_default_config_memwr() argument
271 struct hw *hw = src->rsc.hw; in src_default_config_memwr()
273 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF); in src_default_config_memwr()
274 hw->src_set_bm(src->rsc.ctrl_blk, 1); in src_default_config_memwr()
275 hw->src_set_rsr(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
276 hw->src_set_sf(src->rsc.ctrl_blk, SRC_SF_S16); in src_default_config_memwr()
277 hw->src_set_wr(src->rsc.ctrl_blk, 1); in src_default_config_memwr()
278 hw->src_set_pm(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
279 hw->src_set_rom(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
280 hw->src_set_vo(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
281 hw->src_set_st(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
282 hw->src_set_ilsz(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
283 hw->src_set_cisz(src->rsc.ctrl_blk, 0x80); in src_default_config_memwr()
284 hw->src_set_sa(src->rsc.ctrl_blk, 0x0); in src_default_config_memwr()
285 hw->src_set_la(src->rsc.ctrl_blk, 0x1000); in src_default_config_memwr()
286 hw->src_set_ca(src->rsc.ctrl_blk, 0x80); in src_default_config_memwr()
287 hw->src_set_pitch(src->rsc.ctrl_blk, 0x1000000); in src_default_config_memwr()
288 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1); in src_default_config_memwr()
290 src->rsc.ops->master(&src->rsc); in src_default_config_memwr()
291 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_default_config_memwr()
292 src->rsc.ctrl_blk); in src_default_config_memwr()
297 static int src_default_config_arcrw(struct src *src) in src_default_config_arcrw() argument
299 struct hw *hw = src->rsc.hw; in src_default_config_arcrw()
303 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF); in src_default_config_arcrw()
304 hw->src_set_bm(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
305 for (rsr = 0, msr = src->rsc.msr; msr > 1; msr >>= 1) in src_default_config_arcrw()
308 hw->src_set_rsr(src->rsc.ctrl_blk, rsr); in src_default_config_arcrw()
309 hw->src_set_sf(src->rsc.ctrl_blk, SRC_SF_F32); in src_default_config_arcrw()
310 hw->src_set_wr(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
311 hw->src_set_pm(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
312 hw->src_set_rom(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
313 hw->src_set_vo(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
314 hw->src_set_st(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
315 hw->src_set_ilsz(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
316 hw->src_set_cisz(src->rsc.ctrl_blk, 0x80); in src_default_config_arcrw()
317 hw->src_set_sa(src->rsc.ctrl_blk, 0x0); in src_default_config_arcrw()
319 hw->src_set_la(src->rsc.ctrl_blk, 0x1000); in src_default_config_arcrw()
321 hw->src_set_ca(src->rsc.ctrl_blk, 0x80); in src_default_config_arcrw()
322 hw->src_set_pitch(src->rsc.ctrl_blk, 0x1000000); in src_default_config_arcrw()
323 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1); in src_default_config_arcrw()
325 dirty = hw->src_get_dirty(src->rsc.ctrl_blk); in src_default_config_arcrw()
326 src->rsc.ops->master(&src->rsc); in src_default_config_arcrw()
327 for (msr = 0; msr < src->rsc.msr; msr++) { in src_default_config_arcrw()
328 hw->src_set_dirty(src->rsc.ctrl_blk, dirty); in src_default_config_arcrw()
329 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_default_config_arcrw()
330 src->rsc.ctrl_blk); in src_default_config_arcrw()
331 src->rsc.ops->next_conj(&src->rsc); in src_default_config_arcrw()
333 src->rsc.ops->master(&src->rsc); in src_default_config_arcrw()
360 src_rsc_init(struct src *src, u32 idx, in src_rsc_init() argument
365 struct src *p; in src_rsc_init()
368 for (i = 0, p = src; i < n; i++, p++) { in src_rsc_init()
396 static int src_rsc_uninit(struct src *src, struct src_mgr *mgr) in src_rsc_uninit() argument
399 struct src *p; in src_rsc_uninit()
401 n = (MEMRD == src->mode) ? src->multi : 1; in src_rsc_uninit()
402 for (i = 0, p = src; i < n; i++, p++) { in src_rsc_uninit()
416 get_src_rsc(struct src_mgr *mgr, const struct src_desc *desc, struct src **rsrc) in get_src_rsc()
420 struct src *src; in get_src_rsc() local
441 src = kcalloc(desc->multi, sizeof(*src), GFP_KERNEL); in get_src_rsc()
443 src = kzalloc(sizeof(*src), GFP_KERNEL); in get_src_rsc()
445 if (!src) { in get_src_rsc()
450 err = src_rsc_init(src, idx, desc, mgr); in get_src_rsc()
454 *rsrc = src; in get_src_rsc()
459 kfree(src); in get_src_rsc()
471 static int put_src_rsc(struct src_mgr *mgr, struct src *src) in put_src_rsc() argument
476 src->rsc.ops->master(&src->rsc); in put_src_rsc()
477 if (MEMRD == src->mode) in put_src_rsc()
478 mgr_put_resource(&mgr->mgr, src->multi, in put_src_rsc()
479 src->rsc.ops->index(&src->rsc)); in put_src_rsc()
481 mgr_put_resource(&mgr->mgr, 1, src->rsc.ops->index(&src->rsc)); in put_src_rsc()
484 src_rsc_uninit(src, mgr); in put_src_rsc()
485 kfree(src); in put_src_rsc()
490 static int src_enable_s(struct src_mgr *mgr, struct src *src) in src_enable_s() argument
495 src->rsc.ops->master(&src->rsc); in src_enable_s()
496 for (i = 0; i < src->rsc.msr; i++) { in src_enable_s()
498 src->rsc.ops->index(&src->rsc)); in src_enable_s()
499 src->rsc.ops->next_conj(&src->rsc); in src_enable_s()
501 src->rsc.ops->master(&src->rsc); in src_enable_s()
506 static int src_enable(struct src_mgr *mgr, struct src *src) in src_enable() argument
511 src->rsc.ops->master(&src->rsc); in src_enable()
512 for (i = 0; i < src->rsc.msr; i++) { in src_enable()
514 src->rsc.ops->index(&src->rsc)); in src_enable()
515 src->rsc.ops->next_conj(&src->rsc); in src_enable()
517 src->rsc.ops->master(&src->rsc); in src_enable()
522 static int src_disable(struct src_mgr *mgr, struct src *src) in src_disable() argument
527 src->rsc.ops->master(&src->rsc); in src_disable()
528 for (i = 0; i < src->rsc.msr; i++) { in src_disable()
530 src->rsc.ops->index(&src->rsc)); in src_disable()
531 src->rsc.ops->next_conj(&src->rsc); in src_disable()
533 src->rsc.ops->master(&src->rsc); in src_disable()
621 static int srcimp_map(struct srcimp *srcimp, struct src *src, struct rsc *input) in srcimp_map() argument
627 src->rsc.ops->master(&src->rsc); in srcimp_map()
634 entry->user = src->rsc.ops->index(&src->rsc); in srcimp_map()