Displaying 2 results from an estimated 2 matches for "us_timeout".
Did you mean:
fs_timeout
2009 Aug 20
4
[PATCH 1/4] drm/nouveau: refactor nouveau_dma_wait()
...imeout == 0)
+ return -EBUSY;
+ }
+
+ WRITE_PUT(NOUVEAU_DMA_SKIPS);
+ chan->dma.cur = NOUVEAU_DMA_SKIPS;
+ chan->dma.put = NOUVEAU_DMA_SKIPS;
+ chan->dma.free = get - (NOUVEAU_DMA_SKIPS + 1);
+ return 0;
+}
+
int
nouveau_dma_wait(struct nouveau_channel *chan, int size)
{
- const int us_timeout = 100000;
+ int us_timeout = 100000;
uint32_t get;
- int ret = -EBUSY, i;
- for (i = 0; i < us_timeout; i++) {
+ for (; us_timeout; us_timeout--) {
if (!READ_GET(chan, &get)) {
DRM_UDELAY(1);
continue;
@@ -131,41 +160,18 @@ nouveau_dma_wait(struct nouveau_channel *chan, int si...
2009 Aug 21
4
[PATCH] drm/nouveau: rewrite nouveau_dma_wait()
...r the
+ * GPU has stalled or not
+ */
+ *get = val;
return false;
+ }
*get = (val - chan->pushbuf_base) >> 2;
return true;
@@ -123,54 +128,79 @@ READ_GET(struct nouveau_channel *chan, uint32_t *get)
int
nouveau_dma_wait(struct nouveau_channel *chan, int size)
{
- const int us_timeout = 100000;
- uint32_t get;
- int ret = -EBUSY, i;
+ uint32_t get, prev_get = 0, cnt = 0;
+ bool get_valid;
+
+ while (chan->dma.free < size) {
+ /* reset counter as long as GET is still advancing, this is
+ * to avoid misdetecting a GPU lockup if the GPU happens to
+ * just be processing...