• Home
  • Raw
  • Download

Lines Matching refs:ainfo

242 static int nv3_iterate(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_arb_info *ainfo)  in nv3_iterate()  argument
260 cur = ainfo->cur; in nv3_iterate()
264 if (ainfo->gburst_size == 128) max_gfsize = GFIFO_SIZE_128; in nv3_iterate()
269 if (ainfo->vid_en) in nv3_iterate()
271 if (ainfo->wcvocc > ainfo->vocc) ainfo->wcvocc = ainfo->vocc; in nv3_iterate()
272 if (ainfo->wcvlwm > vlwm) ainfo->wcvlwm = vlwm ; in nv3_iterate()
273 ns = 1000000 * ainfo->vburst_size/(state->memory_width/8)/state->mclk_khz; in nv3_iterate()
274 vfsize = ns * ainfo->vdrain_rate / 1000000; in nv3_iterate()
275 vfsize = ainfo->wcvlwm - ainfo->vburst_size + vfsize; in nv3_iterate()
279 if (ainfo->wcmocc > ainfo->mocc) ainfo->wcmocc = ainfo->mocc; in nv3_iterate()
281 if (ainfo->gr_en) in nv3_iterate()
283 if (ainfo->wcglwm > glwm) ainfo->wcglwm = glwm ; in nv3_iterate()
284 if (ainfo->wcgocc > ainfo->gocc) ainfo->wcgocc = ainfo->gocc; in nv3_iterate()
285 ns = 1000000 * (ainfo->gburst_size/(state->memory_width/8))/state->mclk_khz; in nv3_iterate()
286 gfsize = (ns * (long) ainfo->gdrain_rate)/1000000; in nv3_iterate()
287 gfsize = ainfo->wcglwm - ainfo->gburst_size + gfsize; in nv3_iterate()
290 if (!state->gr_during_vid && ainfo->vid_en) in nv3_iterate()
291 if (ainfo->vid_en && (ainfo->vocc < 0) && !ainfo->vid_only_once) in nv3_iterate()
293 else if (ainfo->mocc < 0) in nv3_iterate()
295 else if (ainfo->gocc< ainfo->by_gfacc) in nv3_iterate()
298 else switch (ainfo->priority) in nv3_iterate()
301 if (ainfo->vid_en && ainfo->vocc<0 && !ainfo->vid_only_once) in nv3_iterate()
303 else if (ainfo->gr_en && ainfo->gocc<0 && !ainfo->gr_only_once) in nv3_iterate()
305 else if (ainfo->mocc<0) in nv3_iterate()
310 if (ainfo->gr_en && ainfo->gocc<0 && !ainfo->gr_only_once) in nv3_iterate()
312 else if (ainfo->vid_en && ainfo->vocc<0 && !ainfo->vid_only_once) in nv3_iterate()
314 else if (ainfo->mocc<0) in nv3_iterate()
319 if (ainfo->mocc<0) in nv3_iterate()
321 else if (ainfo->gr_en && ainfo->gocc<0 && !ainfo->gr_only_once) in nv3_iterate()
323 else if (ainfo->vid_en && ainfo->vocc<0 && !ainfo->vid_only_once) in nv3_iterate()
335 else if (ainfo->first_vacc) misses = vmisses; in nv3_iterate()
337 ainfo->first_vacc = 0; in nv3_iterate()
341 vlwm = ns * ainfo->vdrain_rate/ 1000000; in nv3_iterate()
342 vlwm = ainfo->vocc - vlwm; in nv3_iterate()
344 …ns = 1000000*(misses*state->mem_page_miss + ainfo->vburst_size)/(state->memory_width/8)/state->mcl… in nv3_iterate()
345 ainfo->vocc = ainfo->vocc + ainfo->vburst_size - ns*ainfo->vdrain_rate/1000000; in nv3_iterate()
346 ainfo->gocc = ainfo->gocc - ns*ainfo->gdrain_rate/1000000; in nv3_iterate()
347 ainfo->mocc = ainfo->mocc - ns*ainfo->mdrain_rate/1000000; in nv3_iterate()
351 else if (ainfo->first_gacc) misses = gmisses; in nv3_iterate()
353 ainfo->first_gacc = 0; in nv3_iterate()
357 glwm = ns * ainfo->gdrain_rate/1000000; in nv3_iterate()
358 glwm = ainfo->gocc - glwm; in nv3_iterate()
360 …ns = 1000000*(misses*state->mem_page_miss + ainfo->gburst_size/(state->memory_width/8))/state->mcl… in nv3_iterate()
361 ainfo->vocc = ainfo->vocc + 0 - ns*ainfo->vdrain_rate/1000000; in nv3_iterate()
362 ainfo->gocc = ainfo->gocc + ainfo->gburst_size - ns*ainfo->gdrain_rate/1000000; in nv3_iterate()
363 ainfo->mocc = ainfo->mocc + 0 - ns*ainfo->mdrain_rate/1000000; in nv3_iterate()
367 else if (ainfo->first_macc) misses = mmisses; in nv3_iterate()
369 ainfo->first_macc = 0; in nv3_iterate()
371 ainfo->vocc = ainfo->vocc + 0 - ns*ainfo->vdrain_rate/1000000; in nv3_iterate()
372 ainfo->gocc = ainfo->gocc + 0 - ns*ainfo->gdrain_rate/1000000; in nv3_iterate()
373 ainfo->mocc = ainfo->mocc + mburst_size - ns*ainfo->mdrain_rate/1000000; in nv3_iterate()
378 ainfo->converged = 0; in nv3_iterate()
381 ns = 1000000*ainfo->gburst_size/(state->memory_width/8)/state->mclk_khz; in nv3_iterate()
382 tmp = ns * ainfo->gdrain_rate/1000000; in nv3_iterate()
383 if (abs(ainfo->gburst_size) + ((abs(ainfo->wcglwm) + 16 ) & ~0x7) - tmp > max_gfsize) in nv3_iterate()
385 ainfo->converged = 0; in nv3_iterate()
388 ns = 1000000*ainfo->vburst_size/(state->memory_width/8)/state->mclk_khz; in nv3_iterate()
389 tmp = ns * ainfo->vdrain_rate/1000000; in nv3_iterate()
390 if (abs(ainfo->vburst_size) + (abs(ainfo->wcvlwm + 32) & ~0xf) - tmp> VFIFO_SIZE) in nv3_iterate()
392 ainfo->converged = 0; in nv3_iterate()
395 if (abs(ainfo->gocc) > max_gfsize) in nv3_iterate()
397 ainfo->converged = 0; in nv3_iterate()
400 if (abs(ainfo->vocc) > VFIFO_SIZE) in nv3_iterate()
402 ainfo->converged = 0; in nv3_iterate()
405 if (abs(ainfo->mocc) > MFIFO_SIZE) in nv3_iterate()
407 ainfo->converged = 0; in nv3_iterate()
412 ainfo->converged = 0; in nv3_iterate()
417 ainfo->converged = 0; in nv3_iterate()
422 ainfo->converged = 0; in nv3_iterate()
427 static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state, nv3_arb_info *ainfo) in nv3_arb() argument
441 ainfo->by_gfacc = gns*ainfo->gdrain_rate/1000000; in nv3_arb()
442 ainfo->wcmocc = 0; in nv3_arb()
443 ainfo->wcgocc = 0; in nv3_arb()
444 ainfo->wcvocc = 0; in nv3_arb()
445 ainfo->wcvlwm = 0; in nv3_arb()
446 ainfo->wcglwm = 0; in nv3_arb()
447 ainfo->engine_en = 1; in nv3_arb()
448 ainfo->converged = 1; in nv3_arb()
449 if (ainfo->engine_en) in nv3_arb()
452 ainfo->mocc = state->enable_mp ? 0-ens*ainfo->mdrain_rate/1000000 : 0; in nv3_arb()
453 ainfo->vocc = ainfo->vid_en ? 0-ens*ainfo->vdrain_rate/1000000 : 0; in nv3_arb()
454 ainfo->gocc = ainfo->gr_en ? 0-ens*ainfo->gdrain_rate/1000000 : 0; in nv3_arb()
455 ainfo->cur = ENGINE; in nv3_arb()
456 ainfo->first_vacc = 1; in nv3_arb()
457 ainfo->first_gacc = 1; in nv3_arb()
458 ainfo->first_macc = 1; in nv3_arb()
459 nv3_iterate(res_info, state,ainfo); in nv3_arb()
464 ainfo->mocc = state->enable_mp ? 0 : mburst_size - mns*ainfo->mdrain_rate/1000000; in nv3_arb()
465 ainfo->vocc = ainfo->vid_en ? 0 : 0- mns*ainfo->vdrain_rate/1000000; in nv3_arb()
466 ainfo->gocc = ainfo->gr_en ? 0: 0- mns*ainfo->gdrain_rate/1000000; in nv3_arb()
467 ainfo->cur = MPORT; in nv3_arb()
468 ainfo->first_vacc = 1; in nv3_arb()
469 ainfo->first_gacc = 1; in nv3_arb()
470 ainfo->first_macc = 0; in nv3_arb()
471 nv3_iterate(res_info, state,ainfo); in nv3_arb()
473 if (ainfo->gr_en) in nv3_arb()
475 ainfo->first_vacc = 1; in nv3_arb()
476 ainfo->first_gacc = 0; in nv3_arb()
477 ainfo->first_macc = 1; in nv3_arb()
478 …gns = 1000000*(gmisses*state->mem_page_miss + ainfo->gburst_size/(state->memory_width/8) + refresh… in nv3_arb()
479 ainfo->gocc = ainfo->gburst_size - gns*ainfo->gdrain_rate/1000000; in nv3_arb()
480 ainfo->vocc = ainfo->vid_en? 0-gns*ainfo->vdrain_rate/1000000 : 0; in nv3_arb()
481 ainfo->mocc = state->enable_mp ? 0-gns*ainfo->mdrain_rate/1000000: 0; in nv3_arb()
482 ainfo->cur = GRAPHICS; in nv3_arb()
483 nv3_iterate(res_info, state,ainfo); in nv3_arb()
485 if (ainfo->vid_en) in nv3_arb()
487 ainfo->first_vacc = 0; in nv3_arb()
488 ainfo->first_gacc = 1; in nv3_arb()
489 ainfo->first_macc = 1; in nv3_arb()
490 …vns = 1000000*(vmisses*state->mem_page_miss + ainfo->vburst_size/(state->memory_width/8) + refresh… in nv3_arb()
491 ainfo->vocc = ainfo->vburst_size - vns*ainfo->vdrain_rate/1000000; in nv3_arb()
492 ainfo->gocc = ainfo->gr_en? (0-vns*ainfo->gdrain_rate/1000000) : 0; in nv3_arb()
493 ainfo->mocc = state->enable_mp? 0-vns*ainfo->mdrain_rate/1000000 :0 ; in nv3_arb()
494 ainfo->cur = VIDEO; in nv3_arb()
495 nv3_iterate(res_info, state, ainfo); in nv3_arb()
497 if (ainfo->converged) in nv3_arb()
499 res_info->graphics_lwm = (int)abs(ainfo->wcglwm) + 16; in nv3_arb()
500 res_info->video_lwm = (int)abs(ainfo->wcvlwm) + 32; in nv3_arb()
501 res_info->graphics_burst_size = ainfo->gburst_size; in nv3_arb()
502 res_info->video_burst_size = ainfo->vburst_size; in nv3_arb()
503 res_info->graphics_hi_priority = (ainfo->priority == GRAPHICS); in nv3_arb()
504 res_info->media_hi_priority = (ainfo->priority == MPORT); in nv3_arb()
513 ainfo->converged = 0; in nv3_arb()
533 static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_arb_info *ainfo) in nv3_get_param() argument
544 ainfo->priority = p; in nv3_get_param()
545 ainfo->gburst_size = g; in nv3_get_param()
546 ainfo->vburst_size = v; in nv3_get_param()
547 done = nv3_arb(res_info, state,ainfo); in nv3_get_param()
567 nv3_arb_info ainfo; in nv3CalcArbitration() local
570 ainfo.gr_en = 1; in nv3CalcArbitration()
571 ainfo.vid_en = state->enable_video; in nv3CalcArbitration()
572 ainfo.vid_only_once = 0; in nv3CalcArbitration()
573 ainfo.gr_only_once = 0; in nv3CalcArbitration()
574 ainfo.gdrain_rate = (int) state->pclk_khz * (state->pix_bpp/8); in nv3CalcArbitration()
575 ainfo.vdrain_rate = (int) state->pclk_khz * 2; in nv3CalcArbitration()
577 ainfo.vdrain_rate = ainfo.vdrain_rate/state->video_scale; in nv3CalcArbitration()
578 ainfo.mdrain_rate = 33000; in nv3CalcArbitration()
582 ainfo.gr_only_once = 1; in nv3CalcArbitration()
583 ainfo.gr_en = 1; in nv3CalcArbitration()
584 ainfo.gdrain_rate = 0; in nv3CalcArbitration()
585 res_vid = nv3_get_param(res_info, state, &ainfo); in nv3CalcArbitration()
586 res_vid = ainfo.converged; in nv3CalcArbitration()
589 ainfo.vid_en = 1; in nv3CalcArbitration()
590 ainfo.vid_only_once = 1; in nv3CalcArbitration()
591 ainfo.gr_en = 1; in nv3CalcArbitration()
592 ainfo.gdrain_rate = (int) state->pclk_khz * (state->pix_bpp/8); in nv3CalcArbitration()
593 ainfo.vdrain_rate = 0; in nv3CalcArbitration()
594 res_gr = nv3_get_param(res_info, state, &ainfo); in nv3CalcArbitration()
595 res_gr = ainfo.converged; in nv3CalcArbitration()
602 if (!ainfo.gr_en) ainfo.gdrain_rate = 0; in nv3CalcArbitration()
603 if (!ainfo.vid_en) ainfo.vdrain_rate = 0; in nv3CalcArbitration()
604 res_gr = nv3_get_param(res_info, state, &ainfo); in nv3CalcArbitration()
605 res_info->valid = ainfo.converged; in nv3CalcArbitration()