diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-01-24 01:42:51 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-01-24 01:42:51 +0000 |
commit | 173fbc7305fa4138ad4290d08da9667d1ba83bd0 (patch) | |
tree | 6b99ca1cf3a465d64fda2d42a92cb45657bd197e | |
parent | 5b69a3ec15cebc10ee299a41d50464d34952565c (diff) |
drm/i915: fix up ring cleanup for the i830/i845 CS tlb w/a
From Daniel Vetter
cf9f2fc81448a358349320311ccb25bb6016749f in ubuntu 3.8
aaf8a5167291b65e9116cb8736d862965b57c13a in mainline linux
-rw-r--r-- | sys/dev/pci/drm/i915/intel_ringbuffer.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/pci/drm/i915/intel_ringbuffer.c b/sys/dev/pci/drm/i915/intel_ringbuffer.c index 704516d31f1..6fac19ce006 100644 --- a/sys/dev/pci/drm/i915/intel_ringbuffer.c +++ b/sys/dev/pci/drm/i915/intel_ringbuffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_ringbuffer.c,v 1.16 2014/01/22 04:04:53 kettenis Exp $ */ +/* $OpenBSD: intel_ringbuffer.c,v 1.17 2014/01/24 01:42:50 jsg Exp $ */ /* * Copyright © 2008-2010 Intel Corporation * @@ -502,9 +502,6 @@ cleanup_pipe_control(struct intel_ring_buffer *ring) struct pipe_control *pc = ring->private; struct drm_i915_gem_object *obj; - if (!ring->private) - return; - obj = pc->obj; uvm_unmap(kernel_map, (vaddr_t)pc->cpu_page, @@ -513,7 +510,6 @@ cleanup_pipe_control(struct intel_ring_buffer *ring) drm_gem_object_unreference(&obj->base); kfree(pc); - ring->private = NULL; } static int init_render_ring(struct intel_ring_buffer *ring) @@ -584,7 +580,10 @@ static void render_ring_cleanup(struct intel_ring_buffer *ring) if (HAS_BROKEN_CS_TLB(dev)) drm_gem_object_unreference(to_gem_object(ring->private)); - cleanup_pipe_control(ring); + if (INTEL_INFO(dev)->gen >= 5) + cleanup_pipe_control(ring); + + ring->private = NULL; } static void |