i965: Use ffs() for sample counting in gen7_surface_msaa_bits().
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 10 Feb 2014 19:06:03 +0000 (11:06 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 19 Feb 2014 23:35:53 +0000 (15:35 -0800)
commit6eeae17c02267c57ba3f9f2ace6252fb50dbc9ec
tree470309866edbe57c0054c78975327fdff5ce0869
parent2ed5824a5d5400d1534139d2bda9858b95b67234
i965: Use ffs() for sample counting in gen7_surface_msaa_bits().

The enumerations are just log2(num_samples) shifted by 3, which we can
easily compute via ffs().

This also makes it reusable for Broadwell, which has 2x MSAA.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c