mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-03 10:40:34 +02:00
intel/ds: Modify rejection threshold to scale with requested sample period
Previously, we only checked if the hardware duration was greater than the requested sample period by 1000 ns. This can lead the hardware duration to be rejected and use the next cycle, which is double the size of the current duration. At larger requested sample size, this can mean getting a hardware duration of 1.7 ms for a requested sample period of 1 ms. To fix this, we'll scale the check so that it uses 67% of the requested sample period as the reject threshold. This way, if the hardware duration is below 67%, it's guaranteed to be within 100%-133% of the requested sample period on the next hardware interval. Signed-off-by: Casey Bowman <casey.g.bowman@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40735>
This commit is contained in:
parent
0bf3aaedb1
commit
007be58ade
1 changed files with 7 additions and 1 deletions
|
|
@ -182,7 +182,13 @@ void IntelDriver::disable_perfcnt()
|
|||
/// @return True if the duration is at least close to the sampling period
|
||||
static bool close_enough(uint64_t duration, uint64_t sampling_period)
|
||||
{
|
||||
return duration > sampling_period - 1000;
|
||||
/* If the duration isn't greater than 67% of the request, we will use
|
||||
* the next hw sampling period, which will be double the current duration.
|
||||
* That value will fall somewhere between 100%-133%, guaranteeing a duration
|
||||
* that falls closer to the requested sampling period overall, while scaling
|
||||
* to accomodate relatively larger requested sample periods.
|
||||
*/
|
||||
return duration > sampling_period * 0.67;
|
||||
}
|
||||
|
||||
/// @brief Transforms the raw data received in from the driver into records
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue