gallium: add pipe_screen::get_driver_query_group_info v2

This will be used to get groups of queries required by
GL_AMD_performance_monitor.

V2:
 - add doc to src/gallium/docs/source/screen.rst
 - s/pipe_context/pipe_screen in the commit msg
 - improve commit message

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
gallium: add a group_id field to pipe_driver_query_info v2

V2:
 - make group_id the last field of this struct, this fixes
 drivers which use pipe_driver_query_info like radeon

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
gallium: add util_get_driver_query_group_info

This generic function will be used to get groups of queries.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
gallium: add is_percentage and is_float fields to pipe_driver_query_info

This will be used by GL_AMD_performance_monitor.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
gallium: Add a f32 field to pipe_query_result

This will be used for the GL_FLOAT counter type of
AMD_performance_monitor.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
gallium: replace pipe_driver_query_info::max_value by a union v2

This allows to return different numeric types for queries.

V2:
 - use float instead of double

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
gallium: make pipe_context::begin_query return a boolean

This can be used to check if a query is unable to start.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
mesa/st: implement GL_AMD_performance_monitor v4

This is based on the original patch of Christoph Bumiller.
(source: http://people.freedesktop.org/~chrisbmr/perfmon.diff)

Drivers must implement get_driver_query_group_info and
get_driver_query_info in order to enable this extension.

V2: (Samuel Pitoiset)
 - fix compilation
 - improve the original code
 - rewrite some parts of the original code

V3:
 - do not use pipe_driver_query_info::min_value which is always set to 0

V4:
 - only enable AMD_performance_monitor if the driver implements
 pipe_screen::get_driver_query_group_info and get_driver_query_info

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
svga: implement pipe_screen::get_driver_query_group_info v3

This enables GL_AMD_performance_monitor for svga.

V2:
 - s/pipe_context/pipe_screen in the commit msg

V3:
 - use util_get_driver_query_group_info

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
freedreno: implement pipe_screen::get_driver_query_group_info v3

This enables GL_AMD_performance_monitor for freedreno.

V2:
 - s/pipe_context/pipe_screen in the commit msg

V3:
 - use util_get_driver_query_group_info

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
radeon: implement pipe_screen::get_driver_query_group_info v3

This enables GL_AMD_performance_monitor for radeon.

V2:
 - s/pipe_context/pipe_screen in the commit msg

V3:
 - use util_get_driver_query_group_info

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
nvc0: implement pipe_screen::get_driver_query_group_info v2

This enables GL_AMD_performance_monitor for nvc0.

V2:
 - use util_get_driver_query_group_info

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
docs: mark GL_AMD_performance_monitor for the 10.3 release

GL_AMD_performance_monitor is supported by nvc0, svga, freedreno and
radeon.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
nvc0: expose driver queries with two groups

This adds a new group for MP performance counters and requires
to write our own implementation of get_driver_query_group_info.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
nvc0: make begin_query return false when all MP counters are used v2

V2:
 - do not return immediately after nvc0_mp_pm_query_end() in
 order to set the current state of the given query

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>