Because the GLRenderTarget and the GLVertexBuffer use the global
coordinate system, they are not ergonomic in render layers.
Assigning the device pixel ratio to GLRenderTarget and GLVertexBuffer is
an interesting api design choice too. Scaling is a window system
abstraction, which is absent in OpenGL or Vulkan. For example, it's not
possible to create an OpenGL texture with a scale factor of 2. It only
works with device pixels.
This change makes the GLRenderTarget and the GLVertexBuffer more
ergonomic for usages other than rendering the workspace by removing all
the global coordinate system and scaling stuff. That's the
responsibility of the users of those two classes.
In order to support layered rendering and tiled outputs KWin needs to be
able to split rendering of outputs into multiple surfaces. This commit
prepares the drm backend for that, by moving most of the code in EglGbmBackend
out to a EglGbmSurface class, which will later be used for overlay surfaces
and rendering to multiple connectors side by side.
In doing that, this commit also cleans up the code a bit, removes a lot of
now unnecessary multi-gpu stuff and potentially makes modesets a little
bit more efficient by re-using resources more often.
Currently, the Cursors::currentCursorChanged signal is wired to the
updateCursor() function which calls xcb_xfixes_hide_cursor() or
xcb_xfixes_show_cursor() depending if the cursor is hidden. However, the
currentCursorChanged signal can be emitted if the cursor changed, e.g. a
new pixmap attached, or its visibility status changes.
The zoom effect hides the pointer, but when user hovers ui elements, it
will most likely change and result in more than one xcb_xfixes_hide_cursor()
calls.
It appears like xcb_xfixes_hide_cursor() is implemented as a reference
counter, i.e. if xcb_xfixes_hide_cursor() is called two times, then you
must call xcb_xfixes_show_cursor() two times as well.
This change adds a dedicated signal to indicate whether the cursor is
hidden to avoid calling xcb_xfixes_hide_cursor() multiple times while
the screen is scaled.
BUG: 448537
They're error prone and don't really work for changing modes. Having
a current mode in DrmConnector also doesn't work well together with
the transactional style of how DrmPipeline operates
The implicit cast effectively rounds the value down, which make the
refresh rate be different from what KScreen actually wrote.
A better fix would be to use integers instead of floating point numbers
but that needs to happen in KScreen.
BUG: 448778
While in principle Mesa should already check if the buffer can be scanned
out, this may not always work. If we can't create a framebuffer object for
the buffer, fall back to compositing.
CCBUG: 448818
Encoders are not really relevant for the test result, except that one of
the encoders for the connector must be compatible with the crtc.
The kernel usually exposes only a single encoder per connector for this
reason, but if a driver exposes multiple then that means KWin will do a
lot more tests than is necessary.
In order to prevent that from happening, do fewer syscalls and simplify
code, only check supported encoders once per connector.
19c471405e7eb4b6026db24d776d205125dbc013 introduced a regression if
there are two gbm backend and the backend fail to choose drm format.
This fix does two things:
1. Current buffer format should not be reset after create new buffer,
otherwise current.format may just be empty after resetOutput.
2. force xrgb 8888 need to be set on the primary backend.
BUG: 448790
As the placeholder output gets added or removed in response to other outputs
getting enabled or disabled, the output list may change while iterating over
them and applying changes.
BUG: 448454
BUG: 448474
CCBUG: 448697
FIXED-IN: 5.24
As formats are per output and also checked on crtc changes, there
is no reason to restrict used formats to those that are supported
by all primary planes anymore.
When the crtcs get switched around between outputs, their primary
planes and thus the supported formats also get switched around. In
order to make sure that doesn't cause any problems, always check
whether or not the format+modifiers used are supported.
Userspace is expected to do a modeset and set link-status to good again,
if link-status gets bad. This is needed to prevent some black screen situations.
BUG: 448177
This adds support for reading values from a "Libinput/Defaults" group in
the input config file. This allows specifying global defaults for
devices, that are preferred over the libinput defaults. Because of the
cascading mechanisms of KConfig, this then allows distributions and
hardware vendors to supply system-wide defaults for devices.
Rather than an awkward combination of template functions, function
pointers and multiple calls to almost-the-same-but-not-entirely
functions, make ConfigData itself a template and use type erasure to
store them in the config map. This makes the data object aware of its
type and allows us to specialise the reading of config values through
template specialisation. It also removes the need for multiple
constructors and setters in the ConfigData object.
This change replaces abort() with Q_ASSERT and Q_UNREACHABLE() macros to
make kwin code base consistent. Besides that, Q_UNREACHABLE may
potentially provide the compiler more info that can be used to generate
more efficient machine code.