[Mesa-dev] [PATCH 1/2] clover: Call end_query before getting timestamp result

Niels Ole Salscheider niels_ole at salscheider-online.de
Wed Jul 16 14:11:54 PDT 2014


On Wednesday 16 July 2014, 16:49:08, Tom Stellard wrote:
> Also change the wait parameter from false to true.
> ---
> 
> I'm really not sure what is correct here, but this patch fixes event
> profiling on SI.

I think you should call end_query in the constructor right after the call to 
create_query. That is because you want the corresponding packet to be emited 
as soon as the query is created and not when you are interested in the results 
(i. e. when the corresponding event has occured).

>  src/gallium/state_trackers/clover/core/timestamp.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/state_trackers/clover/core/timestamp.cpp
> b/src/gallium/state_trackers/clover/core/timestamp.cpp index
> 481c4f9..a6edaf6 100644
> --- a/src/gallium/state_trackers/clover/core/timestamp.cpp
> +++ b/src/gallium/state_trackers/clover/core/timestamp.cpp
> @@ -47,7 +47,8 @@ cl_ulong
>  timestamp::query::operator()() const {
>     pipe_query_result result;
> 
> -   if (!q().pipe->get_query_result(q().pipe, _query, false, &result))
> +   q().pipe->end_query(q().pipe, _query);
> +   if (!q().pipe->get_query_result(q().pipe, _query, true, &result))
>        throw error(CL_PROFILING_INFO_NOT_AVAILABLE);
> 
>     return result.u64;
> --
> 1.8.1.5
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list