1. 04 Oct, 2016 6 commits
    • Mario Kleiner's avatar
      drm/radeon: Prevent races on pre DCE4 between flip submission and completion. · 363926dc
      Mario Kleiner authored
      Pre DCE4 hw doesn't have reliable pageflip completion
      interrupts, so instead polling for flip completion is
      used from within the vblank irq handler to complete
      page flips.
      
      This causes a race if pageflip ioctl is called close to
      vblank:
      
      1. pageflip ioctl queues execution of radeon_flip_work_func.
      
      2. vblank irq fires, radeon_crtc_handle_vblank checks for
         flip_status == FLIP_SUBMITTED finds none, no-ops.
      
      3. radeon_flip_work_func runs inside vblank, decides to
         set flip_status == FLIP_SUBMITTED and programs the
         flip into hw.
      
      4. hw executes flip immediately (because in vblank), but
         as 2 already happened, the flip completion routine only
         emits the flip completion event one refresh later ->
         wrong vblank count/timestamp for completion and no
         performance gain, as instead of delaying the flip until
         next vblank, we now delay the next flip by 1 refresh
         while waiting for the delayed flip completion event.
      
      Given we often don't gain anything due to this race, but
      lose precision, prevent the programmed flip from executing
      in vblank on pre DCE4 asics to avoid this race.
      
      On pre-AVIVO hw we can't program the hw for edge-triggered
      flips, they always execute anywhere in vblank. Therefore delay
      the actual flip programming until after vblank on pre-AVIVO.
      Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      363926dc
    • Mario Kleiner's avatar
      drm/radeon: Slightly more robust flip completion handling for < DCE-4 · 73d4c23f
      Mario Kleiner authored
      Pre DCE4 hardware doesn't have (reliable) pageflip completion
      irqs, therefore we have to use the old polling method for flip
      completion handling in vblank irq.
      
      As vblank irqs fire a bit before start of vblank (when the
      linebuffer fifo read position reaches end of scanout), we
      have some fudge for flip completion handling in the last
      lines of active scanout. Old code assumed the threshold to
      be 99% of active scanout height, a ballpark estimate which
      worked ok. Since we know since a while how to calculate the
      actual threshold from linebuffer size, lets make use of it
      to get a more accurate threshold.
      
      This completion path is still prone to some races in corner
      cases, especially on pre-AVIVO hardware, so document them
      a bit better in the code comments.
      Acked-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      73d4c23f
    • Laszlo Ersek's avatar
      drm: virtio: reinstate drm_virtio_set_busid() · c2cbc38b
      Laszlo Ersek authored
      Before commit a3257256 ("drm: Lobotomize set_busid nonsense for !pci
      drivers"), several DRM drivers for platform devices used to expose an
      explicit "drm_driver.set_busid" callback, invariably backed by
      drm_platform_set_busid().
      
      Commit a3257256 removed drm_platform_set_busid(), along with the
      referring .set_busid field initializations. This was justified because
      interchangeable functionality had been implemented in drm_dev_alloc() /
      drm_dev_init(), which DRM_IOCTL_SET_VERSION would rely on going forward.
      
      However, commit a3257256 also removed drm_virtio_set_busid(), for
      which the same consolidation was not appropriate: this .set_busid callback
      had been implemented with drm_pci_set_busid(), and not
      drm_platform_set_busid(). The error regressed Xorg/xserver on QEMU's
      "virtio-vga" card; the drmGetBusid() function from libdrm would no longer
      return stable PCI identifiers like "pci:0000:00:02.0", but rather unstable
      platform ones like "virtio0".
      
      Reinstate drm_virtio_set_busid() with judicious use of
      
        git checkout -p a3257256^ -- drivers/gpu/drm/virtio
      
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Emil Velikov <emil.l.velikov@gmail.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Joachim Frieben <jfrieben@hotmail.com>
      Cc: stable@vger.kernel.org # v4.8
      Reported-by: default avatarJoachim Frieben <jfrieben@hotmail.com>
      Fixes: a3257256
      Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1366842Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      c2cbc38b
    • Daniel Vetter's avatar
      drm: Undo damage to page_flip_ioctl · 2adb29b1
      Daniel Vetter authored
      I screwed up rebasing of my patch in
      
      commit 43968d7b
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Wed Sep 21 10:59:24 2016 +0200
      
          drm: Extract drm_plane.[hc]
      
      which meant on error paths drm_crtc_vblank_put could be called without
      a get, leading to an underrun of the refcount.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98020Reported-and-tested-by: default avatarAndy Furniss <adf.lists@gmail.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Michel Dänzer <michel@daenzer.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161003082827.11586-1-daniel.vetter@ffwll.chSigned-off-by: default avatarDave Airlie <airlied@redhat.com>
      2adb29b1
    • Chris Wilson's avatar
      drm: Restore lost drm_framebuffer_unreference in drm_mode_page_flip_ioctl · e86fa21b
      Chris Wilson authored
      Commit 43968d7b ("drm: Extract drm_plane.[hc]") was not the simple
      cut'n'paste we presumed, somehow it introduced a leak of the page flip
      target's framebuffer.
      
      Fixes: 43968d7b ("drm: Extract drm_plane.[hc]")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20160928222500.11827-1-chris@chris-wilson.co.ukSigned-off-by: default avatarDave Airlie <airlied@redhat.com>
      e86fa21b
    • Dave Airlie's avatar
      Merge branch 'exynos-drm-next' of... · f5dce665
      Dave Airlie authored
      Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
      
      This pull request includes,
          - Code refactoring on HDMI DDC and PHY.
          - Regression fixup on deadlock issue with G2D pm integration.
          - Fixup on page fault issue with wait_for_vblank mechianism specific to Exynos drm.
          - And some cleanups.
      
      * 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
        drm/exynos: g2d: simplify g2d_free_runqueue_node()
        drm/exynos: g2d: use autosuspend mode for PM runtime
        drm/exynos: g2d: wait for engine to finish
        drm/exynos: g2d: remove runqueue nodes in g2d_{close,remove}()
        drm/exynos: g2d: move PM management to runqueue worker
        Revert "drm/exynos: g2d: fix system and runtime pm integration"
        drm/exynos: use drm core to handle page-flip event
        drm/exynos: mark exynos_dp_crtc_clock_enable() static
        drm/exynos/fimd: add clock rate checking
        drm/exynos: fix pending update handling
        drm/exynos/vidi: use timer for vblanks instead of sleeping worker
        drm/exynos: g2d: beautify probing message
        drm/exynos: mixer: simplify loop in vp_win_reset()
        drm/exynos: mixer: convert booleans to flags in mixer context
        gpu: drm: exynos_hdmi: Remove duplicate initialization of regulator bulk consumer
        gpu: drm: exynos_hdmi: Move PHY logic into single function
        gpu: drm: exynos_hdmi: Move DDC logic into single function
      f5dce665
  2. 30 Sep, 2016 20 commits
  3. 28 Sep, 2016 14 commits