st/nine: Use gallium caps to get if queries are supported.

Some queries need the driver to advertise a cap to be supported.
For example r300 doesn't support them.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: return S_FALSE instead of INVALIDCALL when in building query state

It is the same behaviour as wine has.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Queries: Fix D3DISSUE_END behaviour.

Issuing D3DISSUE_END should:
. reset previous queries if possible
. end the query

Previous behaviour wasn't calling end_query for
queries not needing D3DISSUE_BEGIN, no resetting
previous queries.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Queries: allow app to call GetData without Issuing first

Nine was allowing that behaviour, but was not filling the result.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Queries: always succeed for D3DQUERYTYPE_TIMESTAMP when flushing

This is the behaviour that Wine tests

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Queries: Always return D3D_OK when issuing with D3DISSUE_BEGIN

This is the behaviour that wine tests.

Signed-off-by: Axel Davy <axel.davy@ens.fr>