i965: Use SET_FIELD to safety check our x/y offsets in blits.
authorEric Anholt <eric@anholt.net>
Mon, 23 Dec 2013 09:48:09 +0000 (01:48 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 9 Jan 2014 07:30:11 +0000 (15:30 +0800)
commit66524daf175950bd7266fc3cbb4125c24984a482
tree712a19c868a38bdc77a223aa1ba98de23448f13a
parent5d2e86924ebe7b520a5964e9c90c5bb7213c67cf
i965: Use SET_FIELD to safety check our x/y offsets in blits.

The earlier assert made sure that our math didn't exceed our bounds, but
this makes sure that we don't overflow from the high bits X into the low
bits of Y.  We've already put checks in intel_miptree_blit(), but I've
wanted to expand the type in our protoype from short to uint32_t, and we
could get in trouble with intel_emit_linear_blit() if we did.

v2: Add Ken's comment about the funny language extension used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> (v1)
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/intel_blit.c