diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 15 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm206/hw_fifo_gm206.h | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hw_fifo_gm20b.h | 4 |
4 files changed, 24 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 1a93d546..fc1978ed 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -330,6 +330,8 @@ int gr_gk20a_wait_idle(struct gk20a *g, unsigned long end_jiffies, | |||
330 | bool ctxsw_active; | 330 | bool ctxsw_active; |
331 | bool gr_busy; | 331 | bool gr_busy; |
332 | u32 gr_engine_id; | 332 | u32 gr_engine_id; |
333 | u32 engine_status; | ||
334 | bool ctx_status_invalid; | ||
333 | 335 | ||
334 | gk20a_dbg_fn(""); | 336 | gk20a_dbg_fn(""); |
335 | 337 | ||
@@ -343,14 +345,21 @@ int gr_gk20a_wait_idle(struct gk20a *g, unsigned long end_jiffies, | |||
343 | gr_enabled = gk20a_readl(g, mc_enable_r()) & | 345 | gr_enabled = gk20a_readl(g, mc_enable_r()) & |
344 | mc_enable_pgraph_enabled_f(); | 346 | mc_enable_pgraph_enabled_f(); |
345 | 347 | ||
346 | ctxsw_active = gk20a_readl(g, | 348 | engine_status = gk20a_readl(g, |
347 | fifo_engine_status_r(gr_engine_id)) & | 349 | fifo_engine_status_r(gr_engine_id)); |
350 | |||
351 | ctxsw_active = engine_status & | ||
348 | fifo_engine_status_ctxsw_in_progress_f(); | 352 | fifo_engine_status_ctxsw_in_progress_f(); |
349 | 353 | ||
354 | ctx_status_invalid = | ||
355 | (fifo_engine_status_ctx_status_v(engine_status) == | ||
356 | fifo_engine_status_ctx_status_invalid_v()); | ||
357 | |||
350 | gr_busy = gk20a_readl(g, gr_engine_status_r()) & | 358 | gr_busy = gk20a_readl(g, gr_engine_status_r()) & |
351 | gr_engine_status_value_busy_f(); | 359 | gr_engine_status_value_busy_f(); |
352 | 360 | ||
353 | if (!gr_enabled || (!gr_busy && !ctxsw_active)) { | 361 | if (!gr_enabled || ctx_status_invalid |
362 | || (!gr_busy && !ctxsw_active)) { | ||
354 | gk20a_dbg_fn("done"); | 363 | gk20a_dbg_fn("done"); |
355 | return 0; | 364 | return 0; |
356 | } | 365 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h b/drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h index c5c95cdf..4d54c89f 100644 --- a/drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h | |||
@@ -478,6 +478,10 @@ static inline u32 fifo_engine_status_ctx_status_v(u32 r) | |||
478 | { | 478 | { |
479 | return (r >> 13) & 0x7; | 479 | return (r >> 13) & 0x7; |
480 | } | 480 | } |
481 | static inline u32 fifo_engine_status_ctx_status_invalid_v(void) | ||
482 | { | ||
483 | return 0x00000000; | ||
484 | } | ||
481 | static inline u32 fifo_engine_status_ctx_status_valid_v(void) | 485 | static inline u32 fifo_engine_status_ctx_status_valid_v(void) |
482 | { | 486 | { |
483 | return 0x00000001; | 487 | return 0x00000001; |
diff --git a/drivers/gpu/nvgpu/gm206/hw_fifo_gm206.h b/drivers/gpu/nvgpu/gm206/hw_fifo_gm206.h index 56654124..19148b03 100644 --- a/drivers/gpu/nvgpu/gm206/hw_fifo_gm206.h +++ b/drivers/gpu/nvgpu/gm206/hw_fifo_gm206.h | |||
@@ -426,6 +426,10 @@ static inline u32 fifo_engine_status_ctx_status_v(u32 r) | |||
426 | { | 426 | { |
427 | return (r >> 13) & 0x7; | 427 | return (r >> 13) & 0x7; |
428 | } | 428 | } |
429 | static inline u32 fifo_engine_status_ctx_status_invalid_v(void) | ||
430 | { | ||
431 | return 0x00000000; | ||
432 | } | ||
429 | static inline u32 fifo_engine_status_ctx_status_valid_v(void) | 433 | static inline u32 fifo_engine_status_ctx_status_valid_v(void) |
430 | { | 434 | { |
431 | return 0x00000001; | 435 | return 0x00000001; |
diff --git a/drivers/gpu/nvgpu/gm20b/hw_fifo_gm20b.h b/drivers/gpu/nvgpu/gm20b/hw_fifo_gm20b.h index 01e01695..964f4bf9 100644 --- a/drivers/gpu/nvgpu/gm20b/hw_fifo_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/hw_fifo_gm20b.h | |||
@@ -430,6 +430,10 @@ static inline u32 fifo_engine_status_ctx_status_v(u32 r) | |||
430 | { | 430 | { |
431 | return (r >> 13) & 0x7; | 431 | return (r >> 13) & 0x7; |
432 | } | 432 | } |
433 | static inline u32 fifo_engine_status_ctx_status_invalid_v(void) | ||
434 | { | ||
435 | return 0x00000000; | ||
436 | } | ||
433 | static inline u32 fifo_engine_status_ctx_status_valid_v(void) | 437 | static inline u32 fifo_engine_status_ctx_status_valid_v(void) |
434 | { | 438 | { |
435 | return 0x00000001; | 439 | return 0x00000001; |