summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp
diff options
context:
space:
mode:
authorHiroyuki Ishii <ishii.hiroyuki002@jp.panasonic.com>2021-06-29 17:13:03 +0900
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2021-11-01 20:08:45 +0000
commita9ff714186334bce8fba9e7ebbbfbf50f05ba9db (patch)
tree8d124121e40402bcede13efddfc04a16ba1b24bc /meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp
parent9e79df7d3603ed49ff26f3ead447ad9d873a3395 (diff)
qt5: Fix timer leak in qtwayland to avoid animations being sluggish
With long-running qt applications which have fluid animations in wayland environment, the animation becomes obviously sluggish because massive amount of memcpy() is called through a constructor being placed in a loop in QTimerInfoList::timerInsert() function. This is caused by a timer-index leak bug of qtwayland, which is already reported to the qt project as following ticket. https://bugreports.qt.io/browse/QTBUG-79838 Unfortunately QTBUG-79838 is still open because maintenance of non-commercial version of qt5 is already stopped. However, we've confirmed that the patch attached to that ticket works fine except for that part of it is no longer needed due to the deletion of the code. So let's apply only effective part of it. Bug-AGL: SPEC-3991 Signed-off-by: Hiroyuki Ishii <ishii.hiroyuki002@jp.panasonic.com> Change-Id: Ib148b81aabb98e8df10c1414cdbfe26f7ddf09a6 Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26466 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26759 Reviewed-by: Scott Murray <scott.murray@konsulko.com> Reviewed-by: Naoto YAMAGUCHI <naoto.yamaguchi@aisin.co.jp>
Diffstat (limited to 'meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp')
0 files changed, 0 insertions, 0 deletions
2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Copyright (C) 2015, 2016 "IoT.bzh"
 * Author "Romain Forlot" <romain.forlot@iot.bzh>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *	 http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <sys/time.h>
#include <stdint.h>

/// @brief return epoch in milliseconds
///
/// @return long long int epoch in milliseconds
typedef long long int (*time_function_t)();

long long int system_time_us();
long long int system_time_ms();
long long int system_time_s();


/// @brief A frequency counting clock.
/// Utility class allowing some time function.
class frequency_clock_t
{
private:
	float unit_; ///< unit_ - multiplicator to make operation to be in the right unit (milli, micro, nano, etc)
	float frequency_; ///< the clock frequency in Hz.
	uint64_t last_tick_; ///< the last time (in microseconds since epoch) that the clock ticked.
	time_function_t time_function_; ///<  a function returning current time

public:
	frequency_clock_t();
	explicit frequency_clock_t(float frequency);
	frequency_clock_t(float frequency, uint64_t last_tick, time_function_t time_function);

	float get_frequency() const;
	const struct timeval get_timeval_from_period() const;

	float frequency_to_period() const;
	bool started();
	time_function_t get_time_function();
	bool elapsed(bool stagger);

	uint64_t get_last_tick() const;
	void tick(uint64_t timestamp);
};