summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.h
diff options
context:
space:
mode:
authorOscar Mateo2014-05-22 15:13:34 +0200
committerDaniel Vetter2014-05-22 23:02:16 +0200
commit8ee149756e4fbaf4462cf3f7377456ec5fff8b63 (patch)
tree13eedaf2b463f0cf21d76cfa559e087ac2fb3647 /drivers/gpu/drm/i915/intel_ringbuffer.h
parentdrm/i915: s/intel_ring_buffer/intel_engine_cs (diff)
downloadkernel-qcow2-linux-8ee149756e4fbaf4462cf3f7377456ec5fff8b63.tar.gz
kernel-qcow2-linux-8ee149756e4fbaf4462cf3f7377456ec5fff8b63.tar.xz
kernel-qcow2-linux-8ee149756e4fbaf4462cf3f7377456ec5fff8b63.zip
drm/i915: Split the ringbuffers from the rings (1/3)
As advanced by the previous patch, the ringbuffers and the engine command streamers belong in different structs. This is so because, while they used to be tightly coupled together, the new Logical Ring Contexts (LRC for short) have a ringbuffer each. In legacy code, we will use the buffer* pointer inside each ring to get to the pertaining ringbuffer (the actual switch will be done in the next patch). In the new Execlists code, this pointer will be NULL and we will use instead the one inside the context instead. Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 7027473c59d8..a0ac668319d4 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -58,6 +58,27 @@ struct intel_ring_hangcheck {
bool deadlock;
};
+struct intel_ringbuffer {
+ struct drm_i915_gem_object *obj;
+ void __iomem *virtual_start;
+
+ u32 head;
+ u32 tail;
+ int space;
+ int size;
+ int effective_size;
+
+ /** We track the position of the requests in the ring buffer, and
+ * when each is retired we increment last_retired_head as the GPU
+ * must have finished processing the request and so we know we
+ * can advance the ringbuffer up to that position.
+ *
+ * last_retired_head is set to -1 after the value is consumed so
+ * we can detect new retirements.
+ */
+ u32 last_retired_head;
+};
+
struct intel_engine_cs {
const char *name;
enum intel_ring_id {
@@ -73,6 +94,7 @@ struct intel_engine_cs {
void __iomem *virtual_start;
struct drm_device *dev;
struct drm_i915_gem_object *obj;
+ struct intel_ringbuffer *buffer;
u32 head;
u32 tail;
@@ -217,7 +239,7 @@ struct intel_engine_cs {
static inline bool
intel_ring_initialized(struct intel_engine_cs *ring)
{
- return ring->obj != NULL;
+ return ring->buffer && ring->obj;
}
static inline unsigned