Lines Matching refs:src

24 static int src_default_config_memrd(struct src *src);
25 static int src_default_config_memwr(struct src *src);
26 static int src_default_config_arcrw(struct src *src);
28 static int (*src_default_config[3])(struct src *) = {
34 static int src_set_state(struct src *src, unsigned int state) in src_set_state() argument
38 hw = src->rsc.hw; in src_set_state()
39 hw->src_set_state(src->rsc.ctrl_blk, state); in src_set_state()
44 static int src_set_bm(struct src *src, unsigned int bm) in src_set_bm() argument
48 hw = src->rsc.hw; in src_set_bm()
49 hw->src_set_bm(src->rsc.ctrl_blk, bm); in src_set_bm()
54 static int src_set_sf(struct src *src, unsigned int sf) in src_set_sf() argument
58 hw = src->rsc.hw; in src_set_sf()
59 hw->src_set_sf(src->rsc.ctrl_blk, sf); in src_set_sf()
64 static int src_set_pm(struct src *src, unsigned int pm) in src_set_pm() argument
68 hw = src->rsc.hw; in src_set_pm()
69 hw->src_set_pm(src->rsc.ctrl_blk, pm); in src_set_pm()
74 static int src_set_rom(struct src *src, unsigned int rom) in src_set_rom() argument
78 hw = src->rsc.hw; in src_set_rom()
79 hw->src_set_rom(src->rsc.ctrl_blk, rom); in src_set_rom()
84 static int src_set_vo(struct src *src, unsigned int vo) in src_set_vo() argument
88 hw = src->rsc.hw; in src_set_vo()
89 hw->src_set_vo(src->rsc.ctrl_blk, vo); in src_set_vo()
94 static int src_set_st(struct src *src, unsigned int st) in src_set_st() argument
98 hw = src->rsc.hw; in src_set_st()
99 hw->src_set_st(src->rsc.ctrl_blk, st); in src_set_st()
104 static int src_set_bp(struct src *src, unsigned int bp) in src_set_bp() argument
108 hw = src->rsc.hw; in src_set_bp()
109 hw->src_set_bp(src->rsc.ctrl_blk, bp); in src_set_bp()
114 static int src_set_cisz(struct src *src, unsigned int cisz) in src_set_cisz() argument
118 hw = src->rsc.hw; in src_set_cisz()
119 hw->src_set_cisz(src->rsc.ctrl_blk, cisz); in src_set_cisz()
124 static int src_set_ca(struct src *src, unsigned int ca) in src_set_ca() argument
128 hw = src->rsc.hw; in src_set_ca()
129 hw->src_set_ca(src->rsc.ctrl_blk, ca); in src_set_ca()
134 static int src_set_sa(struct src *src, unsigned int sa) in src_set_sa() argument
138 hw = src->rsc.hw; in src_set_sa()
139 hw->src_set_sa(src->rsc.ctrl_blk, sa); in src_set_sa()
144 static int src_set_la(struct src *src, unsigned int la) in src_set_la() argument
148 hw = src->rsc.hw; in src_set_la()
149 hw->src_set_la(src->rsc.ctrl_blk, la); in src_set_la()
154 static int src_set_pitch(struct src *src, unsigned int pitch) in src_set_pitch() argument
158 hw = src->rsc.hw; in src_set_pitch()
159 hw->src_set_pitch(src->rsc.ctrl_blk, pitch); in src_set_pitch()
164 static int src_set_clear_zbufs(struct src *src) in src_set_clear_zbufs() argument
168 hw = src->rsc.hw; in src_set_clear_zbufs()
169 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1); in src_set_clear_zbufs()
174 static int src_commit_write(struct src *src) in src_commit_write() argument
180 hw = src->rsc.hw; in src_commit_write()
181 src->rsc.ops->master(&src->rsc); in src_commit_write()
182 if (src->rsc.msr > 1) { in src_commit_write()
184 dirty = hw->src_get_dirty(src->rsc.ctrl_blk) & conj_mask; in src_commit_write()
186 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_commit_write()
187 src->rsc.ctrl_blk); in src_commit_write()
190 if (MEMWR == src->mode) in src_commit_write()
193 for (i = 1; i < src->rsc.msr; i++) { in src_commit_write()
194 src->rsc.ops->next_conj(&src->rsc); in src_commit_write()
195 hw->src_set_dirty(src->rsc.ctrl_blk, dirty); in src_commit_write()
196 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_commit_write()
197 src->rsc.ctrl_blk); in src_commit_write()
199 src->rsc.ops->master(&src->rsc); in src_commit_write()
204 static int src_get_ca(struct src *src) in src_get_ca() argument
208 hw = src->rsc.hw; in src_get_ca()
209 return hw->src_get_ca(hw, src->rsc.ops->index(&src->rsc), in src_get_ca()
210 src->rsc.ctrl_blk); in src_get_ca()
213 static int src_init(struct src *src) in src_init() argument
215 src_default_config[src->mode](src); in src_init()
220 static struct src *src_next_interleave(struct src *src) in src_next_interleave() argument
222 return src->intlv; in src_next_interleave()
225 static int src_default_config_memrd(struct src *src) in src_default_config_memrd() argument
227 struct hw *hw = src->rsc.hw; in src_default_config_memrd()
230 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF); in src_default_config_memrd()
231 hw->src_set_bm(src->rsc.ctrl_blk, 1); in src_default_config_memrd()
232 for (rsr = 0, msr = src->rsc.msr; msr > 1; msr >>= 1) in src_default_config_memrd()
235 hw->src_set_rsr(src->rsc.ctrl_blk, rsr); in src_default_config_memrd()
236 hw->src_set_sf(src->rsc.ctrl_blk, SRC_SF_S16); in src_default_config_memrd()
237 hw->src_set_wr(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
238 hw->src_set_pm(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
239 hw->src_set_rom(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
240 hw->src_set_vo(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
241 hw->src_set_st(src->rsc.ctrl_blk, 0); in src_default_config_memrd()
242 hw->src_set_ilsz(src->rsc.ctrl_blk, src->multi - 1); in src_default_config_memrd()
243 hw->src_set_cisz(src->rsc.ctrl_blk, 0x80); in src_default_config_memrd()
244 hw->src_set_sa(src->rsc.ctrl_blk, 0x0); in src_default_config_memrd()
245 hw->src_set_la(src->rsc.ctrl_blk, 0x1000); in src_default_config_memrd()
246 hw->src_set_ca(src->rsc.ctrl_blk, 0x80); in src_default_config_memrd()
247 hw->src_set_pitch(src->rsc.ctrl_blk, 0x1000000); in src_default_config_memrd()
248 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1); in src_default_config_memrd()
250 src->rsc.ops->master(&src->rsc); in src_default_config_memrd()
251 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_default_config_memrd()
252 src->rsc.ctrl_blk); in src_default_config_memrd()
254 for (msr = 1; msr < src->rsc.msr; msr++) { in src_default_config_memrd()
255 src->rsc.ops->next_conj(&src->rsc); in src_default_config_memrd()
256 hw->src_set_pitch(src->rsc.ctrl_blk, 0x1000000); in src_default_config_memrd()
257 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_default_config_memrd()
258 src->rsc.ctrl_blk); in src_default_config_memrd()
260 src->rsc.ops->master(&src->rsc); in src_default_config_memrd()
265 static int src_default_config_memwr(struct src *src) in src_default_config_memwr() argument
267 struct hw *hw = src->rsc.hw; in src_default_config_memwr()
269 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF); in src_default_config_memwr()
270 hw->src_set_bm(src->rsc.ctrl_blk, 1); in src_default_config_memwr()
271 hw->src_set_rsr(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
272 hw->src_set_sf(src->rsc.ctrl_blk, SRC_SF_S16); in src_default_config_memwr()
273 hw->src_set_wr(src->rsc.ctrl_blk, 1); in src_default_config_memwr()
274 hw->src_set_pm(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
275 hw->src_set_rom(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
276 hw->src_set_vo(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
277 hw->src_set_st(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
278 hw->src_set_ilsz(src->rsc.ctrl_blk, 0); in src_default_config_memwr()
279 hw->src_set_cisz(src->rsc.ctrl_blk, 0x80); in src_default_config_memwr()
280 hw->src_set_sa(src->rsc.ctrl_blk, 0x0); in src_default_config_memwr()
281 hw->src_set_la(src->rsc.ctrl_blk, 0x1000); in src_default_config_memwr()
282 hw->src_set_ca(src->rsc.ctrl_blk, 0x80); in src_default_config_memwr()
283 hw->src_set_pitch(src->rsc.ctrl_blk, 0x1000000); in src_default_config_memwr()
284 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1); in src_default_config_memwr()
286 src->rsc.ops->master(&src->rsc); in src_default_config_memwr()
287 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_default_config_memwr()
288 src->rsc.ctrl_blk); in src_default_config_memwr()
293 static int src_default_config_arcrw(struct src *src) in src_default_config_arcrw() argument
295 struct hw *hw = src->rsc.hw; in src_default_config_arcrw()
299 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF); in src_default_config_arcrw()
300 hw->src_set_bm(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
301 for (rsr = 0, msr = src->rsc.msr; msr > 1; msr >>= 1) in src_default_config_arcrw()
304 hw->src_set_rsr(src->rsc.ctrl_blk, rsr); in src_default_config_arcrw()
305 hw->src_set_sf(src->rsc.ctrl_blk, SRC_SF_F32); in src_default_config_arcrw()
306 hw->src_set_wr(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
307 hw->src_set_pm(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
308 hw->src_set_rom(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
309 hw->src_set_vo(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
310 hw->src_set_st(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
311 hw->src_set_ilsz(src->rsc.ctrl_blk, 0); in src_default_config_arcrw()
312 hw->src_set_cisz(src->rsc.ctrl_blk, 0x80); in src_default_config_arcrw()
313 hw->src_set_sa(src->rsc.ctrl_blk, 0x0); in src_default_config_arcrw()
315 hw->src_set_la(src->rsc.ctrl_blk, 0x1000); in src_default_config_arcrw()
317 hw->src_set_ca(src->rsc.ctrl_blk, 0x80); in src_default_config_arcrw()
318 hw->src_set_pitch(src->rsc.ctrl_blk, 0x1000000); in src_default_config_arcrw()
319 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1); in src_default_config_arcrw()
321 dirty = hw->src_get_dirty(src->rsc.ctrl_blk); in src_default_config_arcrw()
322 src->rsc.ops->master(&src->rsc); in src_default_config_arcrw()
323 for (msr = 0; msr < src->rsc.msr; msr++) { in src_default_config_arcrw()
324 hw->src_set_dirty(src->rsc.ctrl_blk, dirty); in src_default_config_arcrw()
325 hw->src_commit_write(hw, src->rsc.ops->index(&src->rsc), in src_default_config_arcrw()
326 src->rsc.ctrl_blk); in src_default_config_arcrw()
327 src->rsc.ops->next_conj(&src->rsc); in src_default_config_arcrw()
329 src->rsc.ops->master(&src->rsc); in src_default_config_arcrw()
356 src_rsc_init(struct src *src, u32 idx, in src_rsc_init() argument
361 struct src *p; in src_rsc_init()
364 for (i = 0, p = src; i < n; i++, p++) { in src_rsc_init()
392 static int src_rsc_uninit(struct src *src, struct src_mgr *mgr) in src_rsc_uninit() argument
395 struct src *p; in src_rsc_uninit()
397 n = (MEMRD == src->mode) ? src->multi : 1; in src_rsc_uninit()
398 for (i = 0, p = src; i < n; i++, p++) { in src_rsc_uninit()
412 get_src_rsc(struct src_mgr *mgr, const struct src_desc *desc, struct src **rsrc) in get_src_rsc()
416 struct src *src; in get_src_rsc() local
437 src = kcalloc(desc->multi, sizeof(*src), GFP_KERNEL); in get_src_rsc()
439 src = kzalloc(sizeof(*src), GFP_KERNEL); in get_src_rsc()
441 if (!src) { in get_src_rsc()
446 err = src_rsc_init(src, idx, desc, mgr); in get_src_rsc()
450 *rsrc = src; in get_src_rsc()
455 kfree(src); in get_src_rsc()
467 static int put_src_rsc(struct src_mgr *mgr, struct src *src) in put_src_rsc() argument
472 src->rsc.ops->master(&src->rsc); in put_src_rsc()
473 if (MEMRD == src->mode) in put_src_rsc()
474 mgr_put_resource(&mgr->mgr, src->multi, in put_src_rsc()
475 src->rsc.ops->index(&src->rsc)); in put_src_rsc()
477 mgr_put_resource(&mgr->mgr, 1, src->rsc.ops->index(&src->rsc)); in put_src_rsc()
480 src_rsc_uninit(src, mgr); in put_src_rsc()
481 kfree(src); in put_src_rsc()
486 static int src_enable_s(struct src_mgr *mgr, struct src *src) in src_enable_s() argument
491 src->rsc.ops->master(&src->rsc); in src_enable_s()
492 for (i = 0; i < src->rsc.msr; i++) { in src_enable_s()
494 src->rsc.ops->index(&src->rsc)); in src_enable_s()
495 src->rsc.ops->next_conj(&src->rsc); in src_enable_s()
497 src->rsc.ops->master(&src->rsc); in src_enable_s()
502 static int src_enable(struct src_mgr *mgr, struct src *src) in src_enable() argument
507 src->rsc.ops->master(&src->rsc); in src_enable()
508 for (i = 0; i < src->rsc.msr; i++) { in src_enable()
510 src->rsc.ops->index(&src->rsc)); in src_enable()
511 src->rsc.ops->next_conj(&src->rsc); in src_enable()
513 src->rsc.ops->master(&src->rsc); in src_enable()
518 static int src_disable(struct src_mgr *mgr, struct src *src) in src_disable() argument
523 src->rsc.ops->master(&src->rsc); in src_disable()
524 for (i = 0; i < src->rsc.msr; i++) { in src_disable()
526 src->rsc.ops->index(&src->rsc)); in src_disable()
527 src->rsc.ops->next_conj(&src->rsc); in src_disable()
529 src->rsc.ops->master(&src->rsc); in src_disable()
616 static int srcimp_map(struct srcimp *srcimp, struct src *src, struct rsc *input) in srcimp_map() argument
622 src->rsc.ops->master(&src->rsc); in srcimp_map()
629 entry->user = src->rsc.ops->index(&src->rsc); in srcimp_map()