summaryrefslogtreecommitdiff
path: root/src/sna/kgem.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-27 21:50:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-27 22:12:01 +0100
commit96a921487ef00db03a12bec7b0821410d6b74c31 (patch)
treeafb11c140fde31a8e8c163b9648ce5b4ea08e889 /src/sna/kgem.h
parent26c731efc2048663b6a19a7ed7db0e94243ab30f (diff)
sna: Track outstanding requests per-ring
In order to properly track when the GPU is idle, we need to account for the completion order that may differ on architectures like SandyBridge with multiple mostly independent rings. Reported-by: Clemens Eisserer <linuxhippy@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54127 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.h')
-rw-r--r--src/sna/kgem.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 3bf01525..a72fe42d 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -97,6 +97,7 @@ struct kgem_request {
struct list list;
struct kgem_bo *bo;
struct list buffers;
+ int ring;
};
enum {
@@ -126,8 +127,10 @@ struct kgem {
struct list inactive[NUM_CACHE_BUCKETS];
struct list snoop;
struct list batch_buffers, active_buffers;
- struct list requests;
+
+ struct list requests[2];
struct kgem_request *next_request;
+ uint32_t num_requests;
struct {
struct list inactive[NUM_CACHE_BUCKETS];
@@ -261,14 +264,13 @@ bool kgem_retire(struct kgem *kgem);
bool __kgem_is_idle(struct kgem *kgem);
static inline bool kgem_is_idle(struct kgem *kgem)
{
- if (list_is_empty(&kgem->requests)) {
+ if (kgem->num_requests == 0) {
DBG(("%s: no outstanding requests\n", __FUNCTION__));
return true;
}
return __kgem_is_idle(kgem);
}
-struct kgem_bo *kgem_get_last_request(struct kgem *kgem);
void _kgem_submit(struct kgem *kgem);
static inline void kgem_submit(struct kgem *kgem)