/* Delay based on GPU time (ie. PTIMER). * * Will return -ETIMEDOUT unless the loop was terminated with 'break', * where it will return the number of nanoseconds taken instead. * * NVKM_DELAY can be passed for 'cond' to disable the timeout warning, * which is useful for unconditional delay loops.
*/ #define NVKM_DELAY _warn = false; #define nvkm_nsec(d,n,cond...) ({ \ struct nvkm_timer_wait _wait; \ bool _warn = true; \
s64 _taken = 0; \
\
nvkm_timer_wait_init((d), (n), &_wait); \ do { \
cond \
} while ((_taken = nvkm_timer_wait_test(&_wait)) >= 0); \
\ if (_warn && _taken < 0) \
dev_WARN(_wait.tmr->subdev.device->dev, "timeout\n"); \
_taken; \
}) #define nvkm_usec(d, u, cond...) nvkm_nsec((d), (u) * 1000ULL, ##cond) #define nvkm_msec(d, m, cond...) nvkm_usec((d), (m) * 1000ULL, ##cond)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.