i915: Protect macro argument for TEXTURE_SET()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 30 Jun 2014 15:42:31 +0000 (18:42 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 13 Nov 2014 17:13:27 +0000 (19:13 +0200)
TEXTURE_SET() is the only register macro that forgets to wrap the
argument evaluation in parens. Only simple integers are passed to this
macro so there's no bug but sitll it seems prudent to add the
parens.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
src/mesa/drivers/dri/i915/i830_reg.h

index e08cbe52a35590064fc255160a99bd40aeb20d43..d7ccc165a3b7903dd87ba15d5c057d6f8d572280 100644 (file)
 
 #define _3DSTATE_MAP_COORD_TRANSFORM   ((3<<29)|(0x1d<<24)|(0x8c<<16))
 #define DISABLE_TEX_TRANSFORM          (1<<28)
-#define TEXTURE_SET(x)                 (x<<29)
+#define TEXTURE_SET(x)                 ((x)<<29)
 
 #define _3DSTATE_VERTEX_TRANSFORM      ((3<<29)|(0x1d<<24)|(0x8b<<16))
 #define DISABLE_VIEWPORT_TRANSFORM     (1<<31)