Mir
display_report.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 
20 #ifndef MIR_REPORT_LOGGING_DISPLAY_REPORTER_H_
21 #define MIR_REPORT_LOGGING_DISPLAY_REPORTER_H_
22 
24 #include "mir/time/clock.h"
25 
26 #include <unordered_map>
27 #include <memory>
28 #include <mutex>
29 
30 namespace mir
31 {
32 namespace logging
33 {
34 class Logger;
35 }
36 namespace report
37 {
38 namespace logging
39 {
40 
42 {
43  public:
44 
45  static const char* component();
46 
48  std::shared_ptr<mir::logging::Logger> const& logger,
49  std::shared_ptr<time::Clock> const& clock);
50 
51  virtual ~DisplayReport();
52 
53  virtual void report_successful_setup_of_native_resources() override;
57  virtual void report_successful_display_construction() override;
58  virtual void report_vsync(unsigned int display_id) override;
59  virtual void report_drm_master_failure(int error) override;
60  virtual void report_vt_switch_away_failure() override;
61  virtual void report_vt_switch_back_failure() override;
62  virtual void report_egl_configuration(EGLDisplay disp, EGLConfig cfg) override;
63 
64  protected:
65  DisplayReport(DisplayReport const&) = delete;
66  DisplayReport& operator=(DisplayReport const&) = delete;
67 
68  private:
69  std::shared_ptr<mir::logging::Logger> const logger;
70  std::shared_ptr<time::Clock> const clock;
71  std::mutex vsync_event_mutex;
72  mir::time::Timestamp last_report;
73  std::unordered_map<unsigned int, unsigned int> event_map;
74 };
75 }
76 }
77 }
78 
79 #endif /* MIR_REPORT_LOGGING_DISPLAY_REPORTER_H_ */
Definition: display_report.h:29
All things Mir.
Definition: atomic_callback.h:25
std::chrono::steady_clock::time_point Timestamp
Definition: types.h:29
virtual void report_vsync(unsigned int display_id) override
virtual void report_egl_configuration(EGLDisplay disp, EGLConfig cfg) override
virtual void report_successful_drm_mode_set_crtc_on_construction() override
virtual void report_vt_switch_back_failure() override
virtual void report_successful_setup_of_native_resources() override
virtual void report_successful_display_construction() override
virtual void report_drm_master_failure(int error) override
Definition: display_report.h:41
virtual void report_vt_switch_away_failure() override
virtual void report_successful_egl_make_current_on_construction() override
virtual void report_successful_egl_buffer_swap_on_construction() override
static const char * component()
Definition: display_report.cpp:41
error
Definition: connector_report_tp.h:60
DisplayReport & operator=(DisplayReport const &)=delete

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015