diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 68e5b41dc7f2..11545ff90db6 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -984,6 +984,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
984 | struct intel_ring_buffer *ring; | 984 | struct intel_ring_buffer *ring; |
985 | u32 exec_start, exec_len; | 985 | u32 exec_start, exec_len; |
986 | u32 seqno; | 986 | u32 seqno; |
987 | u32 mask; | ||
987 | int ret, mode, i; | 988 | int ret, mode, i; |
988 | 989 | ||
989 | if (!i915_gem_check_execbuffer(args)) { | 990 | if (!i915_gem_check_execbuffer(args)) { |
@@ -1021,6 +1022,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
1021 | } | 1022 | } |
1022 | 1023 | ||
1023 | mode = args->flags & I915_EXEC_CONSTANTS_MASK; | 1024 | mode = args->flags & I915_EXEC_CONSTANTS_MASK; |
1025 | mask = I915_EXEC_CONSTANTS_MASK; | ||
1024 | switch (mode) { | 1026 | switch (mode) { |
1025 | case I915_EXEC_CONSTANTS_REL_GENERAL: | 1027 | case I915_EXEC_CONSTANTS_REL_GENERAL: |
1026 | case I915_EXEC_CONSTANTS_ABSOLUTE: | 1028 | case I915_EXEC_CONSTANTS_ABSOLUTE: |
@@ -1033,6 +1035,10 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
1033 | if (INTEL_INFO(dev)->gen > 5 && | 1035 | if (INTEL_INFO(dev)->gen > 5 && |
1034 | mode == I915_EXEC_CONSTANTS_REL_SURFACE) | 1036 | mode == I915_EXEC_CONSTANTS_REL_SURFACE) |
1035 | return -EINVAL; | 1037 | return -EINVAL; |
1038 | |||
1039 | /* The HW changed the meaning on this bit on gen6 */ | ||
1040 | if (INTEL_INFO(dev)->gen >= 6) | ||
1041 | mask &= ~I915_EXEC_CONSTANTS_REL_SURFACE; | ||
1036 | } | 1042 | } |
1037 | break; | 1043 | break; |
1038 | default: | 1044 | default: |
@@ -1172,8 +1178,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
1172 | intel_ring_emit(ring, MI_NOOP); | 1178 | intel_ring_emit(ring, MI_NOOP); |
1173 | intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1)); | 1179 | intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1)); |
1174 | intel_ring_emit(ring, INSTPM); | 1180 | intel_ring_emit(ring, INSTPM); |
1175 | intel_ring_emit(ring, | 1181 | intel_ring_emit(ring, mask << 16 | mode); |
1176 | I915_EXEC_CONSTANTS_MASK << 16 | mode); | ||
1177 | intel_ring_advance(ring); | 1182 | intel_ring_advance(ring); |
1178 | 1183 | ||
1179 | dev_priv->relative_constants_mode = mode; | 1184 | dev_priv->relative_constants_mode = mode; |