summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-01-31 14:11:12 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-01-31 14:11:12 +0100
commitc77b0937f290568604961fa0013691349c5fcf3b (patch)
tree6b30dd1f966d99631f72946bd6db9e02bb61ac83 /linux-core
parent47ee6237fe86a8621744bbd6cecb8b5e58848b05 (diff)
Add an fence_class_manager::last_queued_sequence member, since a
sequence number may actually turn up before the corresponding fence object has been queued on the ring. Fence drivers can use this member to determine whether a sequence number must be re-reported.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_fence.c7
-rw-r--r--linux-core/drm_objects.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/linux-core/drm_fence.c b/linux-core/drm_fence.c
index a852c63f..247bc0a4 100644
--- a/linux-core/drm_fence.c
+++ b/linux-core/drm_fence.c
@@ -129,8 +129,8 @@ void drm_fence_handler(struct drm_device *dev, uint32_t fence_class,
type |= fence->native_types;
relevant_type = type & fence->type;
- new_type = (fence->signaled_types | relevant_type) &
- ~fence->signaled_types;
+ new_type = (fence->signaled_types | relevant_type) ^
+ fence->signaled_types;
if (new_type) {
fence->signaled_types |= new_type;
@@ -450,6 +450,7 @@ int drm_fence_object_emit(struct drm_fence_object *fence, uint32_t fence_flags,
if (list_empty(&fc->ring))
fc->highest_waiting_sequence = sequence - 1;
list_add_tail(&fence->ring, &fc->ring);
+ fc->latest_queued_sequence = sequence;
write_unlock_irqrestore(&fm->lock, flags);
return 0;
}
@@ -554,8 +555,8 @@ void drm_fence_manager_init(struct drm_device *dev)
for (i = 0; i < fm->num_classes; ++i) {
fence_class = &fm->fence_class[i];
+ memset(fence_class, 0, sizeof(*fence_class));
INIT_LIST_HEAD(&fence_class->ring);
- fence_class->pending_flush = 0;
DRM_INIT_WAITQUEUE(&fence_class->fence_queue);
}
diff --git a/linux-core/drm_objects.h b/linux-core/drm_objects.h
index c35d900f..e43e8dfd 100644
--- a/linux-core/drm_objects.h
+++ b/linux-core/drm_objects.h
@@ -164,6 +164,7 @@ struct drm_fence_class_manager {
uint32_t waiting_types;
wait_queue_head_t fence_queue;
uint32_t highest_waiting_sequence;
+ uint32_t latest_queued_sequence;
};
struct drm_fence_manager {