1. 02 Nov, 2017 1 commit
    • Martin Flöser's avatar
      [platforms/drm] Rotate screen if requested from KScreen · b2d8bbec
      Martin Flöser authored
      Summary:
      This change hooks up the drm plane rotate with the rotation requests
      from KScreen. Our requests support more than what KScreen exposes in the
      UI, that is all the flipped variants. I do not really understand what
      the flip means, so this is not implemented yet.
      
      Furthermore this only implements the visual rotation and not the input
      rotation. This means mouse movement and touch input is currently broken
      on a rotated screen.
      
      Please note that the hardware I used seems to not support the vertical
      rotation. I'm not sure whether my code works. On my system it just
      results in atomic commit errors and we need to go back to a previous
      working state. This is not yet implemented. I need to test the vertical
      rotation on my notebook, which should (in theory) support it.
      
      Reviewers: #kwin, #plasma, subdiff, sebas
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8594
      b2d8bbec
  2. 01 Nov, 2017 1 commit
  3. 31 Oct, 2017 1 commit
    • Martin Flöser's avatar
      [drm] Implement changing of modes · 33a4cf40
      Martin Flöser authored
      Summary:
      This change hooks up the bits for changing the mode when a request to
      change mode from kscreen is received. This includes:
       * setting new mode in DrmOutput
       * creating new buffers in SceneQPainter backend
       * creating new GbmSurface in SceneOpenGL backend
      
      Room for improvement:
       * detect whether the new mode works and go back to old one if it fails
      
      Test Plan:
      Started both a QPainter/OpenGL session. Used kcmshell5 kscreen
      to modify the resolution. Saw that it got applied, maximized a window to
      verify it's correct. Changed back to original resolution. Verified it looked
      good by maximizing a window.
      
      Reviewers: #kwin, #plasma, subdiff, sebas
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8398
      33a4cf40
  4. 19 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Add physicalSize to the Screens API · 02d3daf2
      Martin Flöser authored
      Summary:
      Allows to share the implementation in a better way and is a requirement
      to get the Screen implementation in the QPA plugin to be based on
      KWin::Screens instead of KWayland::Output.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8344
      02d3daf2
  5. 24 Sep, 2017 1 commit
  6. 18 Sep, 2017 1 commit
    • David Edmundson's avatar
      Don't scale cursor hotspot differently to cursor · 4238218b
      David Edmundson authored
      Summary:
      In the DRM plugin the cursor is currently is drawn at the native size
      given.
      Therefore we don't want to scale the icon offset as that leads to it
      being drawn every so slightly off-sync.
      
      BUG: 384769
      Fixed-in: 5.11.0
      
      Test Plan:
      Kate now selects lines based on the middle of the cursor, not the top left.
      I'd previously gotten so used to it, I hadn't realised it was actually a bug  :/
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7868
      4238218b
  7. 29 Jul, 2017 1 commit
  8. 14 Jul, 2017 1 commit
    • Roman Gilg's avatar
      [platforms/drm] Delete buffer on all errors in present · d4423186
      Roman Gilg authored
      Summary:
      When returning early in DrmOutput::present() because of some error KWin
      didn't delete the proposed buffer, therefore not releasing the surface
      lock of the GBM buffer to the EGL surface.
      
      This patch makes sure that on any error in present we cleanup the proposed
      DrmBuffer.
      
      Reviewers: #kwin
      
      Subscribers: #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6660
      d4423186
  9. 09 May, 2017 3 commits
    • Roman Gilg's avatar
      [DRM plugin] Correct Atomic Mode Setting · d15cb526
      Roman Gilg authored
      This patch makes the AMS execution path work with the new DrmCrtc and
      DrmBuffer structure and solves major issues about:
      * VT switching
      * DPMS
      * Hot plugging
      * Logout
      * Memory leaks
      
      Test Plan:
      Tested with Gl and QPainter.
      
      Reviewers: #kwin
      
      Subscribers: kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D5191
      d15cb526
    • Roman Gilg's avatar
      [DRM plugin] Reorganize DrmBuffer · efedddd9
      Roman Gilg authored
      Split off GBM based buffers to a separate file, which gets only included,
      when GBM is available.
      
      Note, that this also removes the gbmCallback, since already before this
      patch we did delete the buffers always without it.
      
      The plan is to later use this file for via GBM directly imported Wayland
      buffers as well.
      
      Test Plan:
      Tested with Gl and QPainter backends.
      
      Reviewers: #kwin
      
      Subscribers: kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D5179
      efedddd9
    • Roman Gilg's avatar
      [DRM plugin] Remember static kernel objects, amplify use of DrmCrtc · a0571ccf
      Roman Gilg authored
      To get an image from KWin to the screen in the DRM pipeline we combine a CRTC,
      an encoder and a connector. These objects are static in the sense, that they
      represent real hardware on the graphics card, which doesn't change in a
      session. See here for more details:
      https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms.html
      
      Until now we used DrmOutput as the main representation for such an active
      rendering pipeline. I.e. it gets created and destroyed on hot plug events of
      displays. On the other side we had no fixed representation of the static kernel
      objects throughout the lifetime of KWin. This has several disadvantages:
      * We always need to query all available static objects on an hot plug event.
      * We can't manipulate the frame buffer of a CRTC after an output has been
        disconnected
      * Adding functionality for driving multiple displays on a single CRTC (i.e.
        cloning) would be difficult
      * We can't destroy the last frame buffer on display disconnect because the CRTC
        still accesses it and have therefore a memory leak on every display disconnect
      
      This patch  solves these issues by storing representations of all available CRTC
      and Connector objects in DrmBackend on init via DrmCrtc and DrmConnector
      instances. On an hotplug event these vectors are looped for a fitting CRTC and
      Connector combinations. Buffer handling is moved to the respective CRTC
      instance. All changes in overview:
      * Query all available CRTCs and Connectors and save for subsequent hotplug
        events
      * Fix logic errors in `queryResources()`
      * Move framebuffers, buffer flip and blank logic in DrmCrtc
      * Remove `restoreSaved()`. It isn't necessary and is dangerous if the old
        framebuffer was deleted in the meantime. Also could reveal sensitive user
        info from old session.
      
      Test Plan:
      Login, logout, VT switching, connect and disconnect external monitor, energy
      saving mode.
      
      Reviewers: #kwin
      
      Subscribers: kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D5118
      a0571ccf
  10. 29 Mar, 2017 2 commits
    • David Edmundson's avatar
      drm cursor scaling · add93b3e
      David Edmundson authored
      Summary:
      Cursors are drawn low level, so need to go from global compositor space
      to device space
      (multiplied by the out scale)
      
      Test Plan: Elements interacted underneath where the mouse was
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D3499
      add93b3e
    • David Edmundson's avatar
      Add scaling to DRM backend · 0dac5d6b
      David Edmundson authored
      Test Plan:
      For the first time, actually plugged in my high DPI laptop.
      Tested both 1x and 2x windows on 2 real displays one high DPI, one normal
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D3498
      0dac5d6b
  11. 17 Mar, 2017 1 commit
    • Roman Gilg's avatar
      [DrmBackend] Straighten out EGL surface buffer release logic on page flip · a347d009
      Roman Gilg authored
      The logic on page flips was inconsistent in the sense, that it should never
      release a GBM buffer before it's not used (i.e. viewable on the display)
      anymore. This happened unintended until now (on page flip we never really
      did something useful in the else statement, because if we're here it's not
      a GBM buffer anyway).
      
      With this patch we:
      * delete on page flips always only the old buffer, which is not used anymore
      * release the buffer earlier on interrupts like display disconnect in order
        to be able to destroy the EGL context
      
      Test Plan:
      Tested in non atomic mode (atomic mode is obsolete right now until my other
      WIP patch D4539 is ready to be merged): Login, logout, suspend, normal use.
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D5060
      a347d009
  12. 15 Nov, 2016 1 commit
    • Marco Martin's avatar
      add connector name to screen model · c304c0a6
      Marco Martin authored
      Summary:
      to uniquely identify screens (in QScreen::name()) add the conenctor
      name and id (such as HDMI-A-1) to the model identification
      
      Test Plan: tested a full plasma session
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: graesslin, plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D3341
      c304c0a6
  13. 31 Aug, 2016 1 commit
  14. 13 Jul, 2016 1 commit
    • Martin Flöser's avatar
      [platforms/drm] Properly handle case that mapping the blank buffer fails · cd9a0afa
      Martin Flöser authored
      Summary:
      If it's not possible to create a buffer to blank the output, KWin won't
      be able to render to the output. In that case the output should not be
      added to the list of outputs.
      
      To support this DrmOutput::blank and DrmOutput::init return bool to
      indicate whether they succeeded. DrmBackend handles this situation and
      doesn't add the output to the list of outputs if init failed.
      
      If after init there are no outputs KWin is in a state where it won't
      be functional. Thus the platform emits the initFailed signal to
      terminate.
      
      BUG: 365242
      FIXED-IN: 5.7.2
      
      Test Plan: No hardware to reproduce the condition
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2135
      cd9a0afa
  15. 14 Jun, 2016 1 commit
    • Martin Flöser's avatar
      [platforms/drm] Apply new global position on DrmOutput for a changeset · f5b83d18
      Martin Flöser authored
      Summary:
      When we get a configuration request, we also need to update the global
      position on the DrmOutput, otherwise Wayland will know about the new
      position, but KWin internally does not.
      
      In addition we also need to trigger the changed signal on KWin::Screens,
      so that internally code can react on the change.
      
      With this change configuring layout of connected screens in KScreen
      does work also in KWin.
      
      Reviewers: #kwin, #plasma_on_wayland, sebas
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D1858
      f5b83d18
  16. 22 Apr, 2016 1 commit
  17. 13 Apr, 2016 1 commit
  18. 12 Apr, 2016 1 commit
    • Martin Flöser's avatar
      Move backends/ to plugins/platforms/ · 2bff9097
      Martin Flöser authored
      Summary:
      Source code reorganization:
      The base class AbstractBackend got renamed to Platform, thus the
      "backends" are "platforms" now. As they are plugins they should go
      together with other KWin plugins which are nowadays in the folder
      plugins.
      
      So new location is plugins/platforms/
      
      Reviewers: #plasma, sebas
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1353
      2bff9097
  19. 21 Mar, 2016 1 commit
    • Sebastian Kügler's avatar
      Split drm_backend.{h,cpp} into separate files · 629cc701
      Sebastian Kügler authored
      Summary:
      This changes splits up the monster file containing different types used
      in the DRM backend into separate files per class:
      
      - drm_backend.{h,cpp}
      - drm_buffer.{h,cpp}
      - drm_inputeventfilter.{h,cpp}
      - drm_output.{h,cpp}
      - drm_pointer.h
      
      No actual code changes other than build fixes.
      
      Clean up headers in the split files.
      
      Test Plan: Builds with GBM enabled
      
      Reviewers: graesslin
      
      Reviewed By: graesslin
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1168
      629cc701