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
259 cur = ainfo->cur; in nv3_iterate()
263 if (ainfo->gburst_size == 128) max_gfsize = GFIFO_SIZE_128; in nv3_iterate()
268 if (ainfo->vid_en) in nv3_iterate()
270 if (ainfo->wcvocc > ainfo->vocc) ainfo->wcvocc = ainfo->vocc; in nv3_iterate()
271 if (ainfo->wcvlwm > vlwm) ainfo->wcvlwm = vlwm ; in nv3_iterate()
272 ns = 1000000 * ainfo->vburst_size/(state->memory_width/8)/state->mclk_khz; in nv3_iterate()
273 vfsize = ns * ainfo->vdrain_rate / 1000000; in nv3_iterate()
274 vfsize = ainfo->wcvlwm - ainfo->vburst_size + vfsize; in nv3_iterate()
278 if (ainfo->wcmocc > ainfo->mocc) ainfo->wcmocc = ainfo->mocc; in nv3_iterate()
280 if (ainfo->gr_en) in nv3_iterate()
282 if (ainfo->wcglwm > glwm) ainfo->wcglwm = glwm ; in nv3_iterate()
283 if (ainfo->wcgocc > ainfo->gocc) ainfo->wcgocc = ainfo->gocc; in nv3_iterate()
284 ns = 1000000 * (ainfo->gburst_size/(state->memory_width/8))/state->mclk_khz; in nv3_iterate()
285 gfsize = (ns * (long) ainfo->gdrain_rate)/1000000; in nv3_iterate()
286 gfsize = ainfo->wcglwm - ainfo->gburst_size + gfsize; in nv3_iterate()
289 if (!state->gr_during_vid && ainfo->vid_en) in nv3_iterate()
290 if (ainfo->vid_en && (ainfo->vocc < 0) && !ainfo->vid_only_once) in nv3_iterate()
292 else if (ainfo->mocc < 0) in nv3_iterate()
294 else if (ainfo->gocc< ainfo->by_gfacc) in nv3_iterate()
297 else switch (ainfo->priority) in nv3_iterate()
300 if (ainfo->vid_en && ainfo->vocc<0 && !ainfo->vid_only_once) in nv3_iterate()
302 else if (ainfo->gr_en && ainfo->gocc<0 && !ainfo->gr_only_once) in nv3_iterate()
304 else if (ainfo->mocc<0) in nv3_iterate()
309 if (ainfo->gr_en && ainfo->gocc<0 && !ainfo->gr_only_once) in nv3_iterate()
311 else if (ainfo->vid_en && ainfo->vocc<0 && !ainfo->vid_only_once) in nv3_iterate()
313 else if (ainfo->mocc<0) in nv3_iterate()
318 if (ainfo->mocc<0) in nv3_iterate()
320 else if (ainfo->gr_en && ainfo->gocc<0 && !ainfo->gr_only_once) in nv3_iterate()
322 else if (ainfo->vid_en && ainfo->vocc<0 && !ainfo->vid_only_once) in nv3_iterate()
334 else if (ainfo->first_vacc) misses = vmisses; in nv3_iterate()
336 ainfo->first_vacc = 0; in nv3_iterate()
340 vlwm = ns * ainfo->vdrain_rate/ 1000000; in nv3_iterate()
341 vlwm = ainfo->vocc - vlwm; in nv3_iterate()
343 …ns = 1000000*(misses*state->mem_page_miss + ainfo->vburst_size)/(state->memory_width/8)/state->mcl… in nv3_iterate()
344 ainfo->vocc = ainfo->vocc + ainfo->vburst_size - ns*ainfo->vdrain_rate/1000000; in nv3_iterate()
345 ainfo->gocc = ainfo->gocc - ns*ainfo->gdrain_rate/1000000; in nv3_iterate()
346 ainfo->mocc = ainfo->mocc - ns*ainfo->mdrain_rate/1000000; in nv3_iterate()
350 else if (ainfo->first_gacc) misses = gmisses; in nv3_iterate()
352 ainfo->first_gacc = 0; in nv3_iterate()
356 glwm = ns * ainfo->gdrain_rate/1000000; in nv3_iterate()
357 glwm = ainfo->gocc - glwm; in nv3_iterate()
359 …ns = 1000000*(misses*state->mem_page_miss + ainfo->gburst_size/(state->memory_width/8))/state->mcl… in nv3_iterate()
360 ainfo->vocc = ainfo->vocc + 0 - ns*ainfo->vdrain_rate/1000000; in nv3_iterate()
361 ainfo->gocc = ainfo->gocc + ainfo->gburst_size - ns*ainfo->gdrain_rate/1000000; in nv3_iterate()
362 ainfo->mocc = ainfo->mocc + 0 - ns*ainfo->mdrain_rate/1000000; in nv3_iterate()
366 else if (ainfo->first_macc) misses = mmisses; in nv3_iterate()
368 ainfo->first_macc = 0; in nv3_iterate()
370 ainfo->vocc = ainfo->vocc + 0 - ns*ainfo->vdrain_rate/1000000; in nv3_iterate()
371 ainfo->gocc = ainfo->gocc + 0 - ns*ainfo->gdrain_rate/1000000; in nv3_iterate()
372 ainfo->mocc = ainfo->mocc + mburst_size - ns*ainfo->mdrain_rate/1000000; in nv3_iterate()
377 ainfo->converged = 0; in nv3_iterate()
380 ns = 1000000*ainfo->gburst_size/(state->memory_width/8)/state->mclk_khz; in nv3_iterate()
381 tmp = ns * ainfo->gdrain_rate/1000000; in nv3_iterate()
382 if (abs(ainfo->gburst_size) + ((abs(ainfo->wcglwm) + 16 ) & ~0x7) - tmp > max_gfsize) in nv3_iterate()
384 ainfo->converged = 0; in nv3_iterate()
387 ns = 1000000*ainfo->vburst_size/(state->memory_width/8)/state->mclk_khz; in nv3_iterate()
388 tmp = ns * ainfo->vdrain_rate/1000000; in nv3_iterate()
389 if (abs(ainfo->vburst_size) + (abs(ainfo->wcvlwm + 32) & ~0xf) - tmp> VFIFO_SIZE) in nv3_iterate()
391 ainfo->converged = 0; in nv3_iterate()
394 if (abs(ainfo->gocc) > max_gfsize) in nv3_iterate()
396 ainfo->converged = 0; in nv3_iterate()
399 if (abs(ainfo->vocc) > VFIFO_SIZE) in nv3_iterate()
401 ainfo->converged = 0; in nv3_iterate()
404 if (abs(ainfo->mocc) > MFIFO_SIZE) in nv3_iterate()
406 ainfo->converged = 0; in nv3_iterate()
411 ainfo->converged = 0; in nv3_iterate()
416 ainfo->converged = 0; in nv3_iterate()
421 ainfo->converged = 0; in nv3_iterate()
426 static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state, nv3_arb_info *ainfo) in nv3_arb() argument
440 ainfo->by_gfacc = gns*ainfo->gdrain_rate/1000000; in nv3_arb()
441 ainfo->wcmocc = 0; in nv3_arb()
442 ainfo->wcgocc = 0; in nv3_arb()
443 ainfo->wcvocc = 0; in nv3_arb()
444 ainfo->wcvlwm = 0; in nv3_arb()
445 ainfo->wcglwm = 0; in nv3_arb()
446 ainfo->engine_en = 1; in nv3_arb()
447 ainfo->converged = 1; in nv3_arb()
448 if (ainfo->engine_en) in nv3_arb()
451 ainfo->mocc = state->enable_mp ? 0-ens*ainfo->mdrain_rate/1000000 : 0; in nv3_arb()
452 ainfo->vocc = ainfo->vid_en ? 0-ens*ainfo->vdrain_rate/1000000 : 0; in nv3_arb()
453 ainfo->gocc = ainfo->gr_en ? 0-ens*ainfo->gdrain_rate/1000000 : 0; in nv3_arb()
454 ainfo->cur = ENGINE; in nv3_arb()
455 ainfo->first_vacc = 1; in nv3_arb()
456 ainfo->first_gacc = 1; in nv3_arb()
457 ainfo->first_macc = 1; in nv3_arb()
458 nv3_iterate(res_info, state,ainfo); in nv3_arb()
463 ainfo->mocc = state->enable_mp ? 0 : mburst_size - mns*ainfo->mdrain_rate/1000000; in nv3_arb()
464 ainfo->vocc = ainfo->vid_en ? 0 : 0- mns*ainfo->vdrain_rate/1000000; in nv3_arb()
465 ainfo->gocc = ainfo->gr_en ? 0: 0- mns*ainfo->gdrain_rate/1000000; in nv3_arb()
466 ainfo->cur = MPORT; in nv3_arb()
467 ainfo->first_vacc = 1; in nv3_arb()
468 ainfo->first_gacc = 1; in nv3_arb()
469 ainfo->first_macc = 0; in nv3_arb()
470 nv3_iterate(res_info, state,ainfo); in nv3_arb()
472 if (ainfo->gr_en) in nv3_arb()
474 ainfo->first_vacc = 1; in nv3_arb()
475 ainfo->first_gacc = 0; in nv3_arb()
476 ainfo->first_macc = 1; in nv3_arb()
477 …gns = 1000000*(gmisses*state->mem_page_miss + ainfo->gburst_size/(state->memory_width/8) + refresh… in nv3_arb()
478 ainfo->gocc = ainfo->gburst_size - gns*ainfo->gdrain_rate/1000000; in nv3_arb()
479 ainfo->vocc = ainfo->vid_en? 0-gns*ainfo->vdrain_rate/1000000 : 0; in nv3_arb()
480 ainfo->mocc = state->enable_mp ? 0-gns*ainfo->mdrain_rate/1000000: 0; in nv3_arb()
481 ainfo->cur = GRAPHICS; in nv3_arb()
482 nv3_iterate(res_info, state,ainfo); in nv3_arb()
484 if (ainfo->vid_en) in nv3_arb()
486 ainfo->first_vacc = 0; in nv3_arb()
487 ainfo->first_gacc = 1; in nv3_arb()
488 ainfo->first_macc = 1; in nv3_arb()
489 …vns = 1000000*(vmisses*state->mem_page_miss + ainfo->vburst_size/(state->memory_width/8) + refresh… in nv3_arb()
490 ainfo->vocc = ainfo->vburst_size - vns*ainfo->vdrain_rate/1000000; in nv3_arb()
491 ainfo->gocc = ainfo->gr_en? (0-vns*ainfo->gdrain_rate/1000000) : 0; in nv3_arb()
492 ainfo->mocc = state->enable_mp? 0-vns*ainfo->mdrain_rate/1000000 :0 ; in nv3_arb()
493 ainfo->cur = VIDEO; in nv3_arb()
494 nv3_iterate(res_info, state, ainfo); in nv3_arb()
496 if (ainfo->converged) in nv3_arb()
498 res_info->graphics_lwm = (int)abs(ainfo->wcglwm) + 16; in nv3_arb()
499 res_info->video_lwm = (int)abs(ainfo->wcvlwm) + 32; in nv3_arb()
500 res_info->graphics_burst_size = ainfo->gburst_size; in nv3_arb()
501 res_info->video_burst_size = ainfo->vburst_size; in nv3_arb()
502 res_info->graphics_hi_priority = (ainfo->priority == GRAPHICS); in nv3_arb()
503 res_info->media_hi_priority = (ainfo->priority == MPORT); in nv3_arb()
512 ainfo->converged = 0; in nv3_arb()
532 static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_arb_info *ainfo) in nv3_get_param() argument
543 ainfo->priority = p; in nv3_get_param()
544 ainfo->gburst_size = g; in nv3_get_param()
545 ainfo->vburst_size = v; in nv3_get_param()
546 done = nv3_arb(res_info, state,ainfo); in nv3_get_param()
566 nv3_arb_info ainfo; in nv3CalcArbitration() local
569 ainfo.gr_en = 1; in nv3CalcArbitration()
570 ainfo.vid_en = state->enable_video; in nv3CalcArbitration()
571 ainfo.vid_only_once = 0; in nv3CalcArbitration()
572 ainfo.gr_only_once = 0; in nv3CalcArbitration()
573 ainfo.gdrain_rate = (int) state->pclk_khz * (state->pix_bpp/8); in nv3CalcArbitration()
574 ainfo.vdrain_rate = (int) state->pclk_khz * 2; in nv3CalcArbitration()
576 ainfo.vdrain_rate = ainfo.vdrain_rate/state->video_scale; in nv3CalcArbitration()
577 ainfo.mdrain_rate = 33000; in nv3CalcArbitration()
581 ainfo.gr_only_once = 1; in nv3CalcArbitration()
582 ainfo.gr_en = 1; in nv3CalcArbitration()
583 ainfo.gdrain_rate = 0; in nv3CalcArbitration()
584 res_vid = nv3_get_param(res_info, state, &ainfo); in nv3CalcArbitration()
585 res_vid = ainfo.converged; in nv3CalcArbitration()
588 ainfo.vid_en = 1; in nv3CalcArbitration()
589 ainfo.vid_only_once = 1; in nv3CalcArbitration()
590 ainfo.gr_en = 1; in nv3CalcArbitration()
591 ainfo.gdrain_rate = (int) state->pclk_khz * (state->pix_bpp/8); in nv3CalcArbitration()
592 ainfo.vdrain_rate = 0; in nv3CalcArbitration()
593 res_gr = nv3_get_param(res_info, state, &ainfo); in nv3CalcArbitration()
594 res_gr = ainfo.converged; in nv3CalcArbitration()
601 if (!ainfo.gr_en) ainfo.gdrain_rate = 0; in nv3CalcArbitration()
602 if (!ainfo.vid_en) ainfo.vdrain_rate = 0; in nv3CalcArbitration()
603 res_gr = nv3_get_param(res_info, state, &ainfo); in nv3CalcArbitration()
604 res_info->valid = ainfo.converged; in nv3CalcArbitration()