]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drm/i915/bdw: Add a context and an engine pointers to the ringbuffer
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 11 Aug 2014 14:17:44 +0000 (16:17 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 11 Aug 2014 14:18:17 +0000 (16:18 +0200)
Any given ringbuffer is unequivocally tied to one context and one engine.
By setting the appropriate pointers to them, the ringbuffer struct holds
all the infromation you might need to submit a workload for processing,
Execlists style.

v2: Drop ring->ctx since that looks terribly ill-defined for legacy
ringbuffer submission.

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> (v1)
Acked-by: Damien Lespiau <damien.lespiau@intel.com> (v2)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_ringbuffer.h

index 0c80bb1f5420b522ee24bf8b3da0fdf3eeafcbf0..8f2d14da6228cc40078fc1882906ebab0aa3ce2e 100644 (file)
@@ -134,6 +134,7 @@ int intel_lr_context_deferred_create(struct intel_context *ctx,
                return ret;
        }
 
+       ringbuf->ring = ring;
        ringbuf->size = 32 * PAGE_SIZE;
        ringbuf->effective_size = ringbuf->size;
        ringbuf->head = 0;
index 064652034d7eaff5caac3c8b053d5708d39e2b07..c35f956ed6a07f3e1186397593eb0bc87ded8818 100644 (file)
@@ -1594,6 +1594,7 @@ static int intel_init_ring_buffer(struct drm_device *dev,
        INIT_LIST_HEAD(&ring->active_list);
        INIT_LIST_HEAD(&ring->request_list);
        ringbuf->size = 32 * PAGE_SIZE;
+       ringbuf->ring = ring;
        memset(ring->semaphore.sync_seqno, 0, sizeof(ring->semaphore.sync_seqno));
 
        init_waitqueue_head(&ring->irq_queue);
index 669cc7527f9a7ba48661dd13eb8e3a00a50cf581..fe9d9d9d3598e4753ab9c08f3e8e68bb224ad6ab 100644 (file)
@@ -90,6 +90,8 @@ struct intel_ringbuffer {
        struct drm_i915_gem_object *obj;
        void __iomem *virtual_start;
 
+       struct intel_engine_cs *ring;
+
        u32 head;
        u32 tail;
        int space;