aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
authorZou Nan hai <nanhai.zou@intel.com>2010-05-20 21:08:56 -0400
committerEric Anholt <eric@anholt.net>2010-05-26 16:42:11 -0400
commit852835f343146a82a528c3b712b373661d4fa17a (patch)
tree07626a99af8f4b400f4e8616aea885c9f73a118a /drivers/gpu/drm/i915/i915_drv.h
parent8187a2b70e34c727a06617441f74f202b6fefaf9 (diff)
drm/i915: convert some gem structures to per-ring V2
The active list and request list move into the ringbuffer structure, so each can track its active objects in the order they are in that ring. The flushing list does not, as it doesn't matter which ring caused data to end up in the render cache. Objects gain a pointer to the ring they are active on (if any). Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> Signed-off-by: Xiang Hai hao <haihao.xiang@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h39
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6bb7933d49d..3f35989ba74 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -505,18 +505,7 @@ typedef struct drm_i915_private {
505 */ 505 */
506 struct list_head shrink_list; 506 struct list_head shrink_list;
507 507
508 /**
509 * List of objects currently involved in rendering from the
510 * ringbuffer.
511 *
512 * Includes buffers having the contents of their GPU caches
513 * flushed, not necessarily primitives. last_rendering_seqno
514 * represents when the rendering involved will be completed.
515 *
516 * A reference is held on the buffer while on this list.
517 */
518 spinlock_t active_list_lock; 508 spinlock_t active_list_lock;
519 struct list_head active_list;
520 509
521 /** 510 /**
522 * List of objects which are not in the ringbuffer but which 511 * List of objects which are not in the ringbuffer but which
@@ -554,12 +543,6 @@ typedef struct drm_i915_private {
554 struct list_head fence_list; 543 struct list_head fence_list;
555 544
556 /** 545 /**
557 * List of breadcrumbs associated with GPU requests currently
558 * outstanding.
559 */
560 struct list_head request_list;
561
562 /**
563 * We leave the user IRQ off as much as possible, 546 * We leave the user IRQ off as much as possible,
564 * but this means that requests will finish and never 547 * but this means that requests will finish and never
565 * be retired once the system goes idle. Set a timer to 548 * be retired once the system goes idle. Set a timer to
@@ -683,6 +666,9 @@ struct drm_i915_gem_object {
683 */ 666 */
684 uint32_t gtt_offset; 667 uint32_t gtt_offset;
685 668
669 /* Which ring is refering to is this object */
670 struct intel_ring_buffer *ring;
671
686 /** 672 /**
687 * Fake offset for use by mmap(2) 673 * Fake offset for use by mmap(2)
688 */ 674 */
@@ -756,6 +742,9 @@ struct drm_i915_gem_object {
756 * an emission time with seqnos for tracking how far ahead of the GPU we are. 742 * an emission time with seqnos for tracking how far ahead of the GPU we are.
757 */ 743 */
758struct drm_i915_gem_request { 744struct drm_i915_gem_request {
745 /** On Which ring this request was generated */
746 struct intel_ring_buffer *ring;
747
759 /** GEM sequence number associated with this request. */ 748 /** GEM sequence number associated with this request. */
760 uint32_t seqno; 749 uint32_t seqno;
761 750
@@ -916,11 +905,13 @@ void i915_gem_object_unpin(struct drm_gem_object *obj);
916int i915_gem_object_unbind(struct drm_gem_object *obj); 905int i915_gem_object_unbind(struct drm_gem_object *obj);
917void i915_gem_release_mmap(struct drm_gem_object *obj); 906void i915_gem_release_mmap(struct drm_gem_object *obj);
918void i915_gem_lastclose(struct drm_device *dev); 907void i915_gem_lastclose(struct drm_device *dev);
919uint32_t i915_get_gem_seqno(struct drm_device *dev); 908uint32_t i915_get_gem_seqno(struct drm_device *dev,
909 struct intel_ring_buffer *ring);
920bool i915_seqno_passed(uint32_t seq1, uint32_t seq2); 910bool i915_seqno_passed(uint32_t seq1, uint32_t seq2);
921int i915_gem_object_get_fence_reg(struct drm_gem_object *obj); 911int i915_gem_object_get_fence_reg(struct drm_gem_object *obj);
922int i915_gem_object_put_fence_reg(struct drm_gem_object *obj); 912int i915_gem_object_put_fence_reg(struct drm_gem_object *obj);
923void i915_gem_retire_requests(struct drm_device *dev); 913void i915_gem_retire_requests(struct drm_device *dev,
914 struct intel_ring_buffer *ring);
924void i915_gem_retire_work_handler(struct work_struct *work); 915void i915_gem_retire_work_handler(struct work_struct *work);
925void i915_gem_clflush_object(struct drm_gem_object *obj); 916void i915_gem_clflush_object(struct drm_gem_object *obj);
926int i915_gem_object_set_domain(struct drm_gem_object *obj, 917int i915_gem_object_set_domain(struct drm_gem_object *obj,
@@ -931,9 +922,13 @@ void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
931int i915_gem_do_init(struct drm_device *dev, unsigned long start, 922int i915_gem_do_init(struct drm_device *dev, unsigned long start,
932 unsigned long end); 923 unsigned long end);
933int i915_gem_idle(struct drm_device *dev); 924int i915_gem_idle(struct drm_device *dev);
934uint32_t i915_add_request(struct drm_device *dev, struct drm_file *file_priv, 925uint32_t i915_add_request(struct drm_device *dev,
935 uint32_t flush_domains); 926 struct drm_file *file_priv,
936int i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible); 927 uint32_t flush_domains,
928 struct intel_ring_buffer *ring);
929int i915_do_wait_request(struct drm_device *dev,
930 uint32_t seqno, int interruptible,
931 struct intel_ring_buffer *ring);
937int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); 932int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
938int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, 933int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj,
939 int write); 934 int write);