Commit db53a302 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Refine tracepoints

A lot of minor tweaks to fix the tracepoints, improve the outputting for
ftrace, and to generally make the tracepoints useful again. It is a start
and enough to begin identifying performance issues and gaps in our
coverage.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent d9bc7e9f
...@@ -2004,7 +2004,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -2004,7 +2004,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
spin_lock_init(&dev_priv->irq_lock); spin_lock_init(&dev_priv->irq_lock);
spin_lock_init(&dev_priv->error_lock); spin_lock_init(&dev_priv->error_lock);
dev_priv->trace_irq_seqno = 0;
ret = drm_vblank_init(dev, I915_NUM_PIPE); ret = drm_vblank_init(dev, I915_NUM_PIPE);
if (ret) if (ret)
......
...@@ -76,10 +76,7 @@ enum plane { ...@@ -76,10 +76,7 @@ enum plane {
#define DRIVER_PATCHLEVEL 0 #define DRIVER_PATCHLEVEL 0
#define WATCH_COHERENCY 0 #define WATCH_COHERENCY 0
#define WATCH_EXEC 0
#define WATCH_RELOC 0
#define WATCH_LISTS 0 #define WATCH_LISTS 0
#define WATCH_PWRITE 0
#define I915_GEM_PHYS_CURSOR_0 1 #define I915_GEM_PHYS_CURSOR_0 1
#define I915_GEM_PHYS_CURSOR_1 2 #define I915_GEM_PHYS_CURSOR_1 2
...@@ -289,7 +286,6 @@ typedef struct drm_i915_private { ...@@ -289,7 +286,6 @@ typedef struct drm_i915_private {
int page_flipping; int page_flipping;
atomic_t irq_received; atomic_t irq_received;
u32 trace_irq_seqno;
/* protects the irq masks */ /* protects the irq masks */
spinlock_t irq_lock; spinlock_t irq_lock;
...@@ -1001,7 +997,6 @@ extern int i915_irq_emit(struct drm_device *dev, void *data, ...@@ -1001,7 +997,6 @@ extern int i915_irq_emit(struct drm_device *dev, void *data,
struct drm_file *file_priv); struct drm_file *file_priv);
extern int i915_irq_wait(struct drm_device *dev, void *data, extern int i915_irq_wait(struct drm_device *dev, void *data,
struct drm_file *file_priv); struct drm_file *file_priv);
void i915_trace_irq_get(struct drm_device *dev, u32 seqno);
extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS);
extern void i915_driver_irq_preinstall(struct drm_device * dev); extern void i915_driver_irq_preinstall(struct drm_device * dev);
...@@ -1095,8 +1090,7 @@ int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, ...@@ -1095,8 +1090,7 @@ int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv); struct drm_file *file_priv);
void i915_gem_load(struct drm_device *dev); void i915_gem_load(struct drm_device *dev);
int i915_gem_init_object(struct drm_gem_object *obj); int i915_gem_init_object(struct drm_gem_object *obj);
int __must_check i915_gem_flush_ring(struct drm_device *dev, int __must_check i915_gem_flush_ring(struct intel_ring_buffer *ring,
struct intel_ring_buffer *ring,
uint32_t invalidate_domains, uint32_t invalidate_domains,
uint32_t flush_domains); uint32_t flush_domains);
struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev, struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
...@@ -1127,10 +1121,9 @@ i915_seqno_passed(uint32_t seq1, uint32_t seq2) ...@@ -1127,10 +1121,9 @@ i915_seqno_passed(uint32_t seq1, uint32_t seq2)
} }
static inline u32 static inline u32
i915_gem_next_request_seqno(struct drm_device *dev, i915_gem_next_request_seqno(struct intel_ring_buffer *ring)
struct intel_ring_buffer *ring)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = ring->dev->dev_private;
return ring->outstanding_lazy_request = dev_priv->next_seqno; return ring->outstanding_lazy_request = dev_priv->next_seqno;
} }
...@@ -1155,14 +1148,12 @@ void i915_gem_do_init(struct drm_device *dev, ...@@ -1155,14 +1148,12 @@ void i915_gem_do_init(struct drm_device *dev,
unsigned long end); unsigned long end);
int __must_check i915_gpu_idle(struct drm_device *dev); int __must_check i915_gpu_idle(struct drm_device *dev);
int __must_check i915_gem_idle(struct drm_device *dev); int __must_check i915_gem_idle(struct drm_device *dev);
int __must_check i915_add_request(struct drm_device *dev, int __must_check i915_add_request(struct intel_ring_buffer *ring,
struct drm_file *file_priv, struct drm_file *file,
struct drm_i915_gem_request *request, struct drm_i915_gem_request *request);
struct intel_ring_buffer *ring); int __must_check i915_wait_request(struct intel_ring_buffer *ring,
int __must_check i915_do_wait_request(struct drm_device *dev, uint32_t seqno,
uint32_t seqno, bool interruptible);
bool interruptible,
struct intel_ring_buffer *ring);
int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
int __must_check int __must_check
i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj,
...@@ -1311,7 +1302,7 @@ extern void intel_display_print_error_state(struct seq_file *m, ...@@ -1311,7 +1302,7 @@ extern void intel_display_print_error_state(struct seq_file *m,
#define __i915_read(x, y) \ #define __i915_read(x, y) \
static inline u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \ static inline u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \
u##x val = read##y(dev_priv->regs + reg); \ u##x val = read##y(dev_priv->regs + reg); \
trace_i915_reg_rw('R', reg, val, sizeof(val)); \ trace_i915_reg_rw(false, reg, val, sizeof(val)); \
return val; \ return val; \
} }
__i915_read(8, b) __i915_read(8, b)
...@@ -1322,7 +1313,7 @@ __i915_read(64, q) ...@@ -1322,7 +1313,7 @@ __i915_read(64, q)
#define __i915_write(x, y) \ #define __i915_write(x, y) \
static inline void i915_write##x(struct drm_i915_private *dev_priv, u32 reg, u##x val) { \ static inline void i915_write##x(struct drm_i915_private *dev_priv, u32 reg, u##x val) { \
trace_i915_reg_rw('W', reg, val, sizeof(val)); \ trace_i915_reg_rw(true, reg, val, sizeof(val)); \
write##y(val, dev_priv->regs + reg); \ write##y(val, dev_priv->regs + reg); \
} }
__i915_write(8, b) __i915_write(8, b)
...@@ -1371,25 +1362,4 @@ static inline u32 i915_safe_read(struct drm_i915_private *dev_priv, u32 reg) ...@@ -1371,25 +1362,4 @@ static inline u32 i915_safe_read(struct drm_i915_private *dev_priv, u32 reg)
return val; return val;
} }
static inline void
i915_write(struct drm_i915_private *dev_priv, u32 reg, u64 val, int len)
{
/* Trace down the write operation before the real write */
trace_i915_reg_rw('W', reg, val, len);
switch (len) {
case 8:
writeq(val, dev_priv->regs + reg);
break;
case 4:
writel(val, dev_priv->regs + reg);
break;
case 2:
writew(val, dev_priv->regs + reg);
break;
case 1:
writeb(val, dev_priv->regs + reg);
break;
}
}
#endif #endif
This diff is collapsed.
...@@ -134,51 +134,6 @@ i915_verify_lists(struct drm_device *dev) ...@@ -134,51 +134,6 @@ i915_verify_lists(struct drm_device *dev)
} }
#endif /* WATCH_INACTIVE */ #endif /* WATCH_INACTIVE */
#if WATCH_EXEC | WATCH_PWRITE
static void
i915_gem_dump_page(struct page *page, uint32_t start, uint32_t end,
uint32_t bias, uint32_t mark)
{
uint32_t *mem = kmap_atomic(page, KM_USER0);
int i;
for (i = start; i < end; i += 4)
DRM_INFO("%08x: %08x%s\n",
(int) (bias + i), mem[i / 4],
(bias + i == mark) ? " ********" : "");
kunmap_atomic(mem, KM_USER0);
/* give syslog time to catch up */
msleep(1);
}
void
i915_gem_dump_object(struct drm_i915_gem_object *obj, int len,
const char *where, uint32_t mark)
{
int page;
DRM_INFO("%s: object at offset %08x\n", where, obj->gtt_offset);
for (page = 0; page < (len + PAGE_SIZE-1) / PAGE_SIZE; page++) {
int page_len, chunk, chunk_len;
page_len = len - page * PAGE_SIZE;
if (page_len > PAGE_SIZE)
page_len = PAGE_SIZE;
for (chunk = 0; chunk < page_len; chunk += 128) {
chunk_len = page_len - chunk;
if (chunk_len > 128)
chunk_len = 128;
i915_gem_dump_page(obj->pages[page],
chunk, chunk + chunk_len,
obj->gtt_offset +
page * PAGE_SIZE,
mark);
}
}
}
#endif
#if WATCH_COHERENCY #if WATCH_COHERENCY
void void
i915_gem_object_check_coherency(struct drm_i915_gem_object *obj, int handle) i915_gem_object_check_coherency(struct drm_i915_gem_object *obj, int handle)
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "drm.h" #include "drm.h"
#include "i915_drv.h" #include "i915_drv.h"
#include "i915_drm.h" #include "i915_drm.h"
#include "i915_trace.h"
static bool static bool
mark_free(struct drm_i915_gem_object *obj, struct list_head *unwind) mark_free(struct drm_i915_gem_object *obj, struct list_head *unwind)
...@@ -63,6 +64,8 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, ...@@ -63,6 +64,8 @@ i915_gem_evict_something(struct drm_device *dev, int min_size,
return 0; return 0;
} }
trace_i915_gem_evict(dev, min_size, alignment, mappable);
/* /*
* The goal is to evict objects and amalgamate space in LRU order. * The goal is to evict objects and amalgamate space in LRU order.
* The oldest idle objects reside on the inactive list, which is in * The oldest idle objects reside on the inactive list, which is in
...@@ -189,6 +192,8 @@ i915_gem_evict_everything(struct drm_device *dev, bool purgeable_only) ...@@ -189,6 +192,8 @@ i915_gem_evict_everything(struct drm_device *dev, bool purgeable_only)
if (lists_empty) if (lists_empty)
return -ENOSPC; return -ENOSPC;
trace_i915_gem_evict_everything(dev, purgeable_only);
/* Flush everything (on to the inactive lists) and evict */ /* Flush everything (on to the inactive lists) and evict */
ret = i915_gpu_idle(dev); ret = i915_gpu_idle(dev);
if (ret) if (ret)
......
...@@ -282,21 +282,6 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj, ...@@ -282,21 +282,6 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
target_offset = to_intel_bo(target_obj)->gtt_offset; target_offset = to_intel_bo(target_obj)->gtt_offset;
#if WATCH_RELOC
DRM_INFO("%s: obj %p offset %08x target %d "
"read %08x write %08x gtt %08x "
"presumed %08x delta %08x\n",
__func__,
obj,
(int) reloc->offset,
(int) reloc->target_handle,
(int) reloc->read_domains,
(int) reloc->write_domain,
(int) target_offset,
(int) reloc->presumed_offset,
reloc->delta);
#endif
/* The target buffer should have appeared before us in the /* The target buffer should have appeared before us in the
* exec_object list, so it should have a GTT space bound by now. * exec_object list, so it should have a GTT space bound by now.
*/ */
...@@ -747,8 +732,7 @@ i915_gem_execbuffer_flush(struct drm_device *dev, ...@@ -747,8 +732,7 @@ i915_gem_execbuffer_flush(struct drm_device *dev,
if ((flush_domains | invalidate_domains) & I915_GEM_GPU_DOMAINS) { if ((flush_domains | invalidate_domains) & I915_GEM_GPU_DOMAINS) {
for (i = 0; i < I915_NUM_RINGS; i++) for (i = 0; i < I915_NUM_RINGS; i++)
if (flush_rings & (1 << i)) { if (flush_rings & (1 << i)) {
ret = i915_gem_flush_ring(dev, ret = i915_gem_flush_ring(&dev_priv->ring[i],
&dev_priv->ring[i],
invalidate_domains, invalidate_domains,
flush_domains); flush_domains);
if (ret) if (ret)
...@@ -787,7 +771,7 @@ i915_gem_execbuffer_sync_rings(struct drm_i915_gem_object *obj, ...@@ -787,7 +771,7 @@ i915_gem_execbuffer_sync_rings(struct drm_i915_gem_object *obj,
if (request == NULL) if (request == NULL)
return -ENOMEM; return -ENOMEM;
ret = i915_add_request(obj->base.dev, NULL, request, from); ret = i915_add_request(from, NULL, request);
if (ret) { if (ret) {
kfree(request); kfree(request);
return ret; return ret;
...@@ -815,12 +799,6 @@ i915_gem_execbuffer_move_to_gpu(struct intel_ring_buffer *ring, ...@@ -815,12 +799,6 @@ i915_gem_execbuffer_move_to_gpu(struct intel_ring_buffer *ring,
i915_gem_object_set_to_gpu_domain(obj, ring, &cd); i915_gem_object_set_to_gpu_domain(obj, ring, &cd);
if (cd.invalidate_domains | cd.flush_domains) { if (cd.invalidate_domains | cd.flush_domains) {
#if WATCH_EXEC
DRM_INFO("%s: invalidate_domains %08x flush_domains %08x\n",
__func__,
cd.invalidate_domains,
cd.flush_domains);
#endif
ret = i915_gem_execbuffer_flush(ring->dev, ret = i915_gem_execbuffer_flush(ring->dev,
cd.invalidate_domains, cd.invalidate_domains,
cd.flush_domains, cd.flush_domains,
...@@ -924,6 +902,10 @@ i915_gem_execbuffer_move_to_active(struct list_head *objects, ...@@ -924,6 +902,10 @@ i915_gem_execbuffer_move_to_active(struct list_head *objects,
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
list_for_each_entry(obj, objects, exec_list) { list_for_each_entry(obj, objects, exec_list) {
u32 old_read = obj->base.read_domains;
u32 old_write = obj->base.write_domain;
obj->base.read_domains = obj->base.pending_read_domains; obj->base.read_domains = obj->base.pending_read_domains;
obj->base.write_domain = obj->base.pending_write_domain; obj->base.write_domain = obj->base.pending_write_domain;
obj->fenced_gpu_access = obj->pending_fenced_gpu_access; obj->fenced_gpu_access = obj->pending_fenced_gpu_access;
...@@ -937,9 +919,7 @@ i915_gem_execbuffer_move_to_active(struct list_head *objects, ...@@ -937,9 +919,7 @@ i915_gem_execbuffer_move_to_active(struct list_head *objects,
intel_mark_busy(ring->dev, obj); intel_mark_busy(ring->dev, obj);
} }
trace_i915_gem_object_change_domain(obj, trace_i915_gem_object_change_domain(obj, old_read, old_write);
obj->base.read_domains,
obj->base.write_domain);
} }
} }
...@@ -961,14 +941,14 @@ i915_gem_execbuffer_retire_commands(struct drm_device *dev, ...@@ -961,14 +941,14 @@ i915_gem_execbuffer_retire_commands(struct drm_device *dev,
if (INTEL_INFO(dev)->gen >= 4) if (INTEL_INFO(dev)->gen >= 4)
invalidate |= I915_GEM_DOMAIN_SAMPLER; invalidate |= I915_GEM_DOMAIN_SAMPLER;
if (ring->flush(ring, invalidate, 0)) { if (ring->flush(ring, invalidate, 0)) {
i915_gem_next_request_seqno(dev, ring); i915_gem_next_request_seqno(ring);
return; return;
} }
/* Add a breadcrumb for the completion of the batch buffer */ /* Add a breadcrumb for the completion of the batch buffer */
request = kzalloc(sizeof(*request), GFP_KERNEL); request = kzalloc(sizeof(*request), GFP_KERNEL);
if (request == NULL || i915_add_request(dev, file, request, ring)) { if (request == NULL || i915_add_request(ring, file, request)) {
i915_gem_next_request_seqno(dev, ring); i915_gem_next_request_seqno(ring);
kfree(request); kfree(request);
} }
} }
...@@ -998,10 +978,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -998,10 +978,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
if (ret) if (ret)
return ret; return ret;
#if WATCH_EXEC
DRM_INFO("buffers_ptr %d buffer_count %d len %08x\n",
(int) args->buffers_ptr, args->buffer_count, args->batch_len);
#endif
switch (args->flags & I915_EXEC_RING_MASK) { switch (args->flags & I915_EXEC_RING_MASK) {
case I915_EXEC_DEFAULT: case I915_EXEC_DEFAULT:
case I915_EXEC_RENDER: case I915_EXEC_RENDER:
...@@ -1172,7 +1148,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -1172,7 +1148,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
if (ret) if (ret)
goto err; goto err;
seqno = i915_gem_next_request_seqno(dev, ring); seqno = i915_gem_next_request_seqno(ring);
for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++) { for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++) {
if (seqno < ring->sync_seqno[i]) { if (seqno < ring->sync_seqno[i]) {
/* The GPU can not handle its semaphore value wrapping, /* The GPU can not handle its semaphore value wrapping,
...@@ -1187,6 +1163,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -1187,6 +1163,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
} }
} }
trace_i915_gem_ring_dispatch(ring, seqno);
exec_start = batch_obj->gtt_offset + args->batch_start_offset; exec_start = batch_obj->gtt_offset + args->batch_start_offset;
exec_len = args->batch_len; exec_len = args->batch_len;
if (cliprects) { if (cliprects) {
...@@ -1243,11 +1221,6 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, ...@@ -1243,11 +1221,6 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
struct drm_i915_gem_exec_object2 *exec2_list = NULL; struct drm_i915_gem_exec_object2 *exec2_list = NULL;
int ret, i; int ret, i;
#if WATCH_EXEC
DRM_INFO("buffers_ptr %d buffer_count %d len %08x\n",
(int) args->buffers_ptr, args->buffer_count, args->batch_len);
#endif
if (args->buffer_count < 1) { if (args->buffer_count < 1) {
DRM_ERROR("execbuf with %d buffers\n", args->buffer_count); DRM_ERROR("execbuf with %d buffers\n", args->buffer_count);
return -EINVAL; return -EINVAL;
...@@ -1328,11 +1301,6 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data, ...@@ -1328,11 +1301,6 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
struct drm_i915_gem_exec_object2 *exec2_list = NULL; struct drm_i915_gem_exec_object2 *exec2_list = NULL;
int ret; int ret;
#if WATCH_EXEC
DRM_INFO("buffers_ptr %d buffer_count %d len %08x\n",
(int) args->buffers_ptr, args->buffer_count, args->batch_len);
#endif
if (args->buffer_count < 1) { if (args->buffer_count < 1) {
DRM_ERROR("execbuf2 with %d buffers\n", args->buffer_count); DRM_ERROR("execbuf2 with %d buffers\n", args->buffer_count);
return -EINVAL; return -EINVAL;
......
...@@ -365,7 +365,7 @@ static void notify_ring(struct drm_device *dev, ...@@ -365,7 +365,7 @@ static void notify_ring(struct drm_device *dev,
return; return;
seqno = ring->get_seqno(ring); seqno = ring->get_seqno(ring);
trace_i915_gem_request_complete(dev, seqno); trace_i915_gem_request_complete(ring, seqno);
ring->irq_seqno = seqno; ring->irq_seqno = seqno;
wake_up_all(&ring->irq_queue); wake_up_all(&ring->irq_queue);
...@@ -1273,16 +1273,6 @@ static int i915_emit_irq(struct drm_device * dev) ...@@ -1273,16 +1273,6 @@ static int i915_emit_irq(struct drm_device * dev)
return dev_priv->counter; return dev_priv->counter;
} }
void i915_trace_irq_get(struct drm_device *dev, u32 seqno)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
struct intel_ring_buffer *ring = LP_RING(dev_priv);
if (dev_priv->trace_irq_seqno == 0 &&
ring->irq_get(ring))
dev_priv->trace_irq_seqno = seqno;
}
static int i915_wait_irq(struct drm_device * dev, int irq_nr) static int i915_wait_irq(struct drm_device * dev, int irq_nr)
{ {
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
......
This diff is collapsed.
...@@ -221,16 +221,15 @@ static int intel_overlay_do_wait_request(struct intel_overlay *overlay, ...@@ -221,16 +221,15 @@ static int intel_overlay_do_wait_request(struct intel_overlay *overlay,
int ret; int ret;
BUG_ON(overlay->last_flip_req); BUG_ON(overlay->last_flip_req);
ret = i915_add_request(dev, NULL, request, LP_RING(dev_priv)); ret = i915_add_request(LP_RING(dev_priv), NULL, request);
if (ret) { if (ret) {
kfree(request); kfree(request);
return ret; return ret;
} }
overlay->last_flip_req = request->seqno; overlay->last_flip_req = request->seqno;
overlay->flip_tail = tail; overlay->flip_tail = tail;
ret = i915_do_wait_request(dev, ret = i915_wait_request(LP_RING(dev_priv),
overlay->last_flip_req, true, overlay->last_flip_req, true);
LP_RING(dev_priv));
if (ret) if (ret)
return ret; return ret;
...@@ -364,7 +363,7 @@ static int intel_overlay_continue(struct intel_overlay *overlay, ...@@ -364,7 +363,7 @@ static int intel_overlay_continue(struct intel_overlay *overlay,
OUT_RING(flip_addr); OUT_RING(flip_addr);
ADVANCE_LP_RING(); ADVANCE_LP_RING();
ret = i915_add_request(dev, NULL, request, LP_RING(dev_priv)); ret = i915_add_request(LP_RING(dev_priv), NULL, request);
if (ret) { if (ret) {
kfree(request); kfree(request);
return ret; return ret;
...@@ -453,8 +452,8 @@ static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay, ...@@ -453,8 +452,8 @@ static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay,
if (overlay->last_flip_req == 0) if (overlay->last_flip_req == 0)
return 0; return 0;
ret = i915_do_wait_request(dev, overlay->last_flip_req, ret = i915_wait_request(LP_RING(dev_priv),
interruptible, LP_RING(dev_priv)); overlay->last_flip_req, interruptible);
if (ret) if (ret)
return ret; return ret;
......
...@@ -62,18 +62,9 @@ render_ring_flush(struct intel_ring_buffer *ring, ...@@ -62,18 +62,9 @@ render_ring_flush(struct intel_ring_buffer *ring,
u32 flush_domains) u32 flush_domains)
{ {
struct drm_device *dev = ring->dev; struct drm_device *dev = ring->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
u32 cmd; u32 cmd;
int ret; int ret;
#if WATCH_EXEC
DRM_INFO("%s: invalidate %08x flush %08x\n", __func__,
invalidate_domains, flush_domains);
#endif
trace_i915_gem_request_flush(dev, dev_priv->next_seqno,
invalidate_domains, flush_domains);
if ((invalidate_domains | flush_domains) & I915_GEM_GPU_DOMAINS) { if ((invalidate_domains | flush_domains) & I915_GEM_GPU_DOMAINS) {
/* /*
* read/write caches: * read/write caches:
...@@ -122,9 +113,6 @@ render_ring_flush(struct intel_ring_buffer *ring, ...@@ -122,9 +113,6 @@ render_ring_flush(struct intel_ring_buffer *ring,
(IS_G4X(dev) || IS_GEN5(dev))) (IS_G4X(dev) || IS_GEN5(dev)))
cmd |= MI_INVALIDATE_ISP; cmd |= MI_INVALIDATE_ISP;
#if WATCH_EXEC
DRM_INFO("%s: queue flush %08x to ring\n", __func__, cmd);
#endif
ret = intel_ring_begin(ring, 2); ret = intel_ring_begin(ring, 2);
if (ret) if (ret)
return ret; return ret;
...@@ -714,11 +702,8 @@ render_ring_dispatch_execbuffer(struct intel_ring_buffer *ring, ...@@ -714,11 +702,8 @@ render_ring_dispatch_execbuffer(struct intel_ring_buffer *ring,
u32 offset, u32 len) u32 offset, u32 len)
{ {
struct drm_device *dev = ring->dev; struct drm_device *dev = ring->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
int ret; int ret;
trace_i915_gem_request_submit(dev, dev_priv->next_seqno + 1);
if (IS_I830(dev) || IS_845G(dev)) { if (IS_I830(dev) || IS_845G(dev)) {
ret = intel_ring_begin(ring, 4); ret = intel_ring_begin(ring, 4);
if (ret) if (ret)
...@@ -953,13 +938,13 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n) ...@@ -953,13 +938,13 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n)
return 0; return 0;
} }
trace_i915_ring_wait_begin (dev); trace_i915_ring_wait_begin(ring);
end = jiffies + 3 * HZ; end = jiffies + 3 * HZ;
do { do {
ring->head = I915_READ_HEAD(ring); ring->head = I915_READ_HEAD(ring);
ring->space = ring_space(ring); ring->space = ring_space(ring);
if (ring->space >= n) { if (ring->space >= n) {
trace_i915_ring_wait_end(dev); trace_i915_ring_wait_end(ring);
return 0; return 0;
} }
...@@ -973,7 +958,7 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n) ...@@ -973,7 +958,7 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n)
if (atomic_read(&dev_priv->mm.wedged)) if (atomic_read(&dev_priv->mm.wedged))
return -EAGAIN; return -EAGAIN;
} while (!time_after(jiffies, end)); } while (!time_after(jiffies, end));
trace_i915_ring_wait_end (dev); trace_i915_ring_wait_end(ring);
return -EBUSY; return -EBUSY;
} }
......
...@@ -58,6 +58,7 @@ struct intel_ring_buffer { ...@@ -58,6 +58,7 @@ struct intel_ring_buffer {
u32 irq_refcount; u32 irq_refcount;
u32 irq_mask; u32 irq_mask;
u32 irq_seqno; /* last seq seem at irq time */ u32 irq_seqno; /* last seq seem at irq time */
u32 trace_irq_seqno;
u32 waiting_seqno; u32 waiting_seqno;
u32 sync_seqno[I915_NUM_RINGS-1]; u32 sync_seqno[I915_NUM_RINGS-1];
bool __must_check (*irq_get)(struct intel_ring_buffer *ring); bool __must_check (*irq_get)(struct intel_ring_buffer *ring);
...@@ -186,6 +187,12 @@ int intel_init_blt_ring_buffer(struct drm_device *dev); ...@@ -186,6 +187,12 @@ int intel_init_blt_ring_buffer(struct drm_device *dev);
u32 intel_ring_get_active_head(struct intel_ring_buffer *ring); u32 intel_ring_get_active_head(struct intel_ring_buffer *ring);
void intel_ring_setup_status_page(struct intel_ring_buffer *ring); void intel_ring_setup_status_page(struct intel_ring_buffer *ring);
static inline void i915_trace_irq_get(struct intel_ring_buffer *ring, u32 seqno)
{
if (ring->trace_irq_seqno == 0 && ring->irq_get(ring))
ring->trace_irq_seqno = seqno;
}
/* DRI warts */ /* DRI warts */
int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size); int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment