diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-22 06:50:11 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-25 10:03:22 -0500 |
commit | 312817a39f17dbb4de000165b5b724e3728cd91c (patch) | |
tree | 30a279343f39e7e4c56bfb428b1becb41e9a9c77 /drivers/gpu/drm/i915/i915_gem.c | |
parent | c6642782b988e907bb50767eab50042f4947e163 (diff) |
drm/i915: Only save and restore fences for UMS
With KMS, we can simply relinquish the fence when we idle the GPU and
reassign it upon first use.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 1e9cf2bf9ba4..939c9e34ce96 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1905,11 +1905,22 @@ static void i915_gem_reset_ring_lists(struct drm_i915_private *dev_priv, | |||
1905 | } | 1905 | } |
1906 | } | 1906 | } |
1907 | 1907 | ||
1908 | static void i915_gem_reset_fences(struct drm_device *dev) | ||
1909 | { | ||
1910 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1911 | int i; | ||
1912 | |||
1913 | for (i = 0; i < 16; i++) { | ||
1914 | struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i]; | ||
1915 | if (reg->obj) | ||
1916 | i915_gem_clear_fence_reg(reg->obj); | ||
1917 | } | ||
1918 | } | ||
1919 | |||
1908 | void i915_gem_reset(struct drm_device *dev) | 1920 | void i915_gem_reset(struct drm_device *dev) |
1909 | { | 1921 | { |
1910 | struct drm_i915_private *dev_priv = dev->dev_private; | 1922 | struct drm_i915_private *dev_priv = dev->dev_private; |
1911 | struct drm_i915_gem_object *obj; | 1923 | struct drm_i915_gem_object *obj; |
1912 | int i; | ||
1913 | 1924 | ||
1914 | i915_gem_reset_ring_lists(dev_priv, &dev_priv->render_ring); | 1925 | i915_gem_reset_ring_lists(dev_priv, &dev_priv->render_ring); |
1915 | i915_gem_reset_ring_lists(dev_priv, &dev_priv->bsd_ring); | 1926 | i915_gem_reset_ring_lists(dev_priv, &dev_priv->bsd_ring); |
@@ -1940,15 +1951,7 @@ void i915_gem_reset(struct drm_device *dev) | |||
1940 | } | 1951 | } |
1941 | 1952 | ||
1942 | /* The fence registers are invalidated so clear them out */ | 1953 | /* The fence registers are invalidated so clear them out */ |
1943 | for (i = 0; i < 16; i++) { | 1954 | i915_gem_reset_fences(dev); |
1944 | struct drm_i915_fence_reg *reg; | ||
1945 | |||
1946 | reg = &dev_priv->fence_regs[i]; | ||
1947 | if (!reg->obj) | ||
1948 | continue; | ||
1949 | |||
1950 | i915_gem_clear_fence_reg(reg->obj); | ||
1951 | } | ||
1952 | } | 1955 | } |
1953 | 1956 | ||
1954 | /** | 1957 | /** |
@@ -4706,6 +4709,8 @@ i915_gem_idle(struct drm_device *dev) | |||
4706 | } | 4709 | } |
4707 | } | 4710 | } |
4708 | 4711 | ||
4712 | i915_gem_reset_fences(dev); | ||
4713 | |||
4709 | /* Hack! Don't let anybody do execbuf while we don't control the chip. | 4714 | /* Hack! Don't let anybody do execbuf while we don't control the chip. |
4710 | * We need to replace this with a semaphore, or something. | 4715 | * We need to replace this with a semaphore, or something. |
4711 | * And not confound mm.suspended! | 4716 | * And not confound mm.suspended! |