Project
Loading...
Searching...
No Matches
GPUDisplayFrontendWayland.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef GPUDISPLAYFRONTENDWAYLAND_H
16#define GPUDISPLAYFRONTENDWAYLAND_H
17
18#include "GPUDisplayFrontend.h"
19#include <wayland-client.h>
20#include "xdg-shell-client-protocol.h"
21#include "fractional-scale-client-protocol.h"
22#include <vector>
23#include <string>
24
25struct zxdg_decoration_manager_v1;
26struct wp_viewporter;
27struct wp_viewport;
28struct wp_cursor_shape_manager_v1;
29struct wp_cursor_shape_device_v1;
30struct zxdg_toplevel_decoration_v1;
31struct xkb_context;
32struct xkb_keymap;
33struct xkb_state;
34
35namespace o2::gpu
36{
38{
39 public:
41 ~GPUDisplayFrontendWayland() override = default;
42
43 void SwitchFullscreen(bool set) override;
44 void ToggleMaximized(bool set) override;
45 void SetVSync(bool enable) override;
46 void getSize(int32_t& width, int32_t& height) override;
47 float getDisplayScale() const override { return mScale; }
48 float getRefreshRate() override;
49 int32_t getVulkanSurface(void* instance, void* surface) override;
50 uint32_t getReqVulkanExtensions(const char**& p) override;
51
52 private:
53 int32_t FrontendMain() override;
54 void handlePointerButton(uint32_t button, bool pressed); // In GPUDisplayFrontendWaylandEv.cxx, which needs the evdev button codes
56 void updateScale(); // Scale from wp_fractional_scale_v1, else integer wl_surface.preferred_buffer_scale, or max scale of the outputs the surface is on (older compositors)
57 void updateSize(); // Physical size = logical size * scale, resizes the scene if changed
58 void reportError(const char* where); // Print the Wayland display error (protocol error with interface and object, or errno) after a call returned -1
59 void handleKeyRepeat(); // Call HandleKey for the held key according to wl_keyboard.repeat_info
60 void applyScroll(); // Apply scroll events of one wl_pointer.frame: high-resolution wheel (120 = 1 notch = 100 mMouseWheel units) if available, otherwise continuous axis (touchpad, ~15 units per notch)
61
62 struct OutputInfo {
63 wl_output* output;
64 uint32_t globalName;
66 int32_t scale = 1;
67 std::string name;
68 int32_t refresh = 0; // mHz, current mode
69 };
70 OutputInfo* findOutput(wl_output* output);
71
72 wl_display* mWayland = nullptr;
73 wl_registry* mRegistry = nullptr;
74
75 wl_compositor* mCompositor = nullptr;
76 wl_seat* mSeat = nullptr;
77 wl_pointer* mPointer = nullptr;
78 wl_keyboard* mKeyboard = nullptr;
79 xdg_wm_base* mXdgBase = nullptr;
80
81 wl_surface* mSurface = nullptr;
82 xdg_surface* mXdgSurface = nullptr;
83 xdg_toplevel* mXdgToplevel = nullptr;
84
85 wl_registry_listener mRegistryListener{};
86 wl_seat_listener mSeatListener{};
87 wl_pointer_listener mPointerListener{};
88 wl_keyboard_listener mKeyboardListener{};
89 wl_output_listener mOutputListener{};
90 wl_surface_listener mSurfaceListener{};
91 xdg_wm_base_listener mXdgWmBaseListener{};
92 xdg_surface_listener mXdgSurfaceListener{};
93 xdg_toplevel_listener mXdgToplevelListener{};
94 wp_fractional_scale_v1_listener mFractionalScaleListener{};
95
96 std::vector<OutputInfo> mOutputs;
97 std::vector<wl_output*> mSurfaceOutputs; // Outputs the surface is on, most recently entered last
98 uint32_t mSeatVersion = 0;
99
100 xkb_context* mXKBcontext = nullptr;
101 xkb_keymap* mXKBkeymap = nullptr;
102 xkb_state* mXKBstate = nullptr;
103
104 zxdg_decoration_manager_v1* mDecManager = nullptr;
105 zxdg_toplevel_decoration_v1* mXdgDecoration = nullptr;
106
107 wp_viewporter* mViewporter = nullptr; // Fractional scaling (if both are available): buffer scale 1, buffer at physical size, viewport destination = logical size
108 wp_fractional_scale_manager_v1* mFractionalScaleManager = nullptr;
109 wp_cursor_shape_manager_v1* mCursorShapeManager = nullptr; // Sets the default cursor on pointer enter, otherwise the cursor image is undefined
110 wp_cursor_shape_device_v1* mCursorShapeDevice = nullptr;
111 wp_viewport* mViewport = nullptr;
112 wp_fractional_scale_v1* mFractionalScale = nullptr;
113
114 int32_t mWidthRequested = 0;
115 int32_t mHeightRequested = 0;
116 int32_t mWidthLogical = INIT_WIDTH;
117 int32_t mHeightLogical = INIT_HEIGHT;
118 int32_t mWidthWindowed = INIT_WIDTH; // Last size when neither maximized nor fullscreen
119 int32_t mHeightWindowed = INIT_HEIGHT;
120 bool mStateFullScreenOrMaximized = false;
121 int32_t mBoundsWidth = 0;
122 int32_t mBoundsHeight = 0;
123 double mScale = 1; // Physical pixels per logical pixel
124 int32_t mPreferredScale = 0; // Integer scale from wl_surface.preferred_buffer_scale, 0 = not sent by compositor
125 uint32_t mFractionalScale120 = 0; // Scale * 120 from wp_fractional_scale_v1, 0 = not sent yet
126 bool mSuspended = false;
127 bool mCanFullscreen = true;
128 bool mCanMaximize = true;
129
130 int32_t mRepeatRate = 0; // Keys per second, 0 = no repeat
131 int32_t mRepeatDelay = 0; // ms before the first repeat
132 int64_t mRepeatKeyCode = -1; // Evdev key code of the held key to repeat, -1 = none
133 int32_t mRepeatSymbol = 0;
134 std::chrono::steady_clock::time_point mRepeatNext;
135
136 double mAxisValue = 0; // Accumulated scroll values of one wl_pointer.frame
137 int32_t mAxisValue120 = 0;
138 bool mHasAxisValue120 = false;
139};
140GPUDisplayFrontend* createGPUDisplayFrontendWayland();
141} // namespace o2::gpu
142
143#endif
unsigned int uint32_t
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
SurfaceTrackState state
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
uint32_t version
Definition RawData.h:8
const Acts::Surface * surface
StringRef key
~GPUDisplayFrontendWayland() override=default
int32_t getVulkanSurface(void *instance, void *surface) override
void getSize(int32_t &width, int32_t &height) override
uint32_t getReqVulkanExtensions(const char **&p) override
static constexpr int32_t INIT_WIDTH
static constexpr int32_t INIT_HEIGHT
GLuint const GLchar * name
Definition glcorearb.h:781
GLint GLsizei GLsizei height
Definition glcorearb.h:270
GLint GLsizei width
Definition glcorearb.h:270
GPUDisplayFrontend * createGPUDisplayFrontendWayland()