1. 21 Jun, 2016 3 commits
    • Daniel Vetter's avatar
      drm: Lobotomize set_busid nonsense for !pci drivers · a3257256
      Daniel Vetter authored
      
      We already have a fallback in place to fill out the unique from
      dev->unique, which is set to something reasonable in drm_dev_alloc.
      
      Which means we only need to have a special set_busid for pci devices,
      to be able to care the backwards compat code for drm 1.1 around, which
      libdrm still needs.
      
      While developing and testing this patch things blew up in really
      interesting ways, and the code is rather confusing in naming things
      between the kernel code, ioctl #defines and libdrm. For the next brave
      dragon slayer, document all this madness properly in the userspace
      interface section of gpu.tmpl.
      
      v2: Make drm_dev_set_unique static and update kerneldoc.
      
      v3: Entire rewrite, plus document what's going on for posterity in the
      gpu docbook uapi section.
      
      v4: Drop accidental amdgpu hunk (Emil).
      
      v5: Drop accidental omapdrm vblank counter change (Emil).
      
      v6: Rebase on top of the sphinx conversion.
      
      Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
      Cc: Emil Velikov <emil.l.velikov@gmail.com>
      Tested-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (virt_gpu)
      Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      a3257256
    • Daniel Vetter's avatar
      drm: Don't call drm_dev_set_unique from platform drivers · a742946a
      Daniel Vetter authored
      Since
      
      commit e112e593
      
      
      Author: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
      Date:   Fri Dec 11 11:20:28 2015 +0100
      
          drm: use dev_name as default unique name in drm_dev_alloc()
      
      we're using a reasonable default which should work for everyone. Only
      mtk, rcar-du and sun4i are affected, and as kms-only drivers without
      any rendering support no one should ever care about the unique name
      
      v2: Rebase on top of mediatek.
      
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Emil Velikov <emil.l.velikov@gmail.com>
      Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Acked-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1466499262-18717-5-git-send-email-daniel.vetter@ffwll.ch
      a742946a
    • Daniel Vetter's avatar
      drm: Move master pointer from drm_minor to drm_device · 95c081c1
      Daniel Vetter authored
      There can only be one current master, and it's for the overall device.
      Render/control minors don't support master-based auth at all.
      
      This simplifies the master logic a lot, at least in my eyes: All these
      additional pointer chases are just confusing.
      
      While doing the conversion I spotted some locking fail:
      - drm_lock/drm_auth check dev->master without holding the
        master_mutex. This is fallout from
      
        commit c996fd0b
      
      
        Author: Thomas Hellstrom <thellstrom@vmware.com>
        Date:   Tue Feb 25 19:57:44 2014 +0100
      
            drm: Protect the master management with a drm_device::master_mutex v3
      
        but I honestly don't care one bit about those old legacy drivers
        using this.
      
      - debugfs name info should just grab master_mutex.
      
      - And the fbdev helper looked at it to figure out whether someone is
        using KMS. We just need a consistent value, so READ_ONCE. Aside: We
        should probably check if anyone has opened a control node too, but I
        guess current userspace doesn't really do that yet.
      
      v2: Balance locking, reported by Julia.
      
      v3: Rebase on top of Chris' oops fixes.
      
      Cc: Julia Lawall <julia.lawall@lip6.fr>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
      Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (v2)
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1466499262-18717-1-git-send-email-daniel.vetter@ffwll.ch
      95c081c1
  2. 17 Jun, 2016 1 commit
  3. 16 Jun, 2016 2 commits
  4. 13 Jun, 2016 3 commits
  5. 10 Jun, 2016 1 commit
  6. 09 Jun, 2016 2 commits
  7. 02 Jun, 2016 2 commits
  8. 24 May, 2016 1 commit
  9. 20 May, 2016 1 commit
    • Daniel Vetter's avatar
      drm: Nuke ->vblank_disable_allowed · fcee5906
      Daniel Vetter authored
      This was added in
      
      commit 0a3e67a4
      
      
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Tue Sep 30 12:14:26 2008 -0700
      
          drm: Rework vblank-wait handling to allow interrupt reduction.
      
      to stay backwards-compatible with old UMS code that didn't even tell
      the kernel when it did a modeset, so that the kernel could
      save/restore vblank counters. At worst this means vblanks will be
      somewhat funky on a setup that very likely no one still runs.
      
      So let's just nuke it.
      
      Plan B would be to set it unconditionally in drm_vblank_init for kms
      drivers, instead of in each driver separately. So if this patch breaks
      anything please only restore the hunks in drmP.h and drm_irq.c, plus
      add a check for DRIVER_MODESET in drm_vblank_init.
      
      Stumbled over this in a discussion on irc with Chris.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Mark Yao <mark.yao@rock-chips.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Acked-by: default avatarLiviu Dudau <Liviu.Dudau@arm.com>
      Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Tested-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      fcee5906
  10. 19 May, 2016 1 commit
    • Maarten Lankhorst's avatar
      drm/core: Add drm_accurate_vblank_count, v5. · af61d5ce
      Maarten Lankhorst authored
      
      This function is useful for gen2 intel devices which have no frame
      counter, but need a way to determine the current vblank count without
      racing with the vblank interrupt handler.
      
      intel_pipe_update_start checks if no vblank interrupt will occur
      during vblank evasion, but cannot check whether the vblank handler has
      run to completion. This function uses the timestamps to determine
      when the last vblank has happened, and interpolates from there.
      
      Changes since v1:
      - Take vblank_time_lock and don't use drm_vblank_count_and_time.
      Changes since v2:
      - Don't return time of last vblank.
      Changes since v3:
      - Change pipe to unsigned int. (Ville)
      - Remove unused documentation for tv_ret. (kbuild)
      Changes since v4:
      - Add warning to docs when the function is useful.
      - Add a WARN_ON when get_vblank_timestamp is unavailable.
      - Use drm_vblank_count.
      
      Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> #v4
      Acked-by: David Airlie <airlied@linux.ie> #irc, v4
      Link: http://patchwork.freedesktop.org/patch/msgid/1463490484-19540-2-git-send-email-maarten.lankhorst@linux.intel.com
      
      Reviewed-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      af61d5ce
  11. 04 May, 2016 1 commit
    • Daniel Vetter's avatar
      drm/gem: support BO freeing without dev->struct_mutex · 9f0ba539
      Daniel Vetter authored
      
      Finally all the core gem and a lot of drivers are entirely free of
      dev->struct_mutex depencies, and we can start to have an entirely
      lockless unref path.
      
      To make sure that no one who touches the core code accidentally breaks
      existing drivers which still require dev->struct_mutex I've made the
      might_lock check unconditional.
      
      While at it de-inline the ref/unref functions, they've become a bit
      too big.
      
      v2: Make it not leak like a sieve.
      
      v3: Review from Lucas:
      - drop != NULL in pointer checks.
      - fixup copypasted kerneldoc to actually match the functions.
      
      v4:
      Add __drm_gem_object_unreference as a fastpath helper for drivers who
      abolished dev->struct_mutex, requested by Chris.
      
      v5: Fix silly mistake in drm_gem_object_unreference_unlocked caught by
      intel-gfx CI - I checked for gem_free_object instead of
      gem_free_object_unlocked ...
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Lucas Stach <l.stach@pengutronix.de>
      Reviewed-by: Lucas Stach <l.stach@pengutronix.de> (v3)
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v4)
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1462178451-1765-1-git-send-email-daniel.vetter@ffwll.ch
      9f0ba539
  12. 27 Apr, 2016 1 commit
  13. 14 Apr, 2016 1 commit
  14. 08 Feb, 2016 2 commits
  15. 25 Jan, 2016 3 commits
  16. 21 Dec, 2015 1 commit
  17. 15 Dec, 2015 1 commit
  18. 08 Dec, 2015 1 commit
  19. 04 Dec, 2015 2 commits
    • Daniel Vetter's avatar
      drm/nouveau: Fix pre-nv50 pageflip events (v4) · bbc8764f
      Daniel Vetter authored
      Apparently pre-nv50 pageflip events happen before the actual vblank
      period. Therefore that functionality got semi-disabled in
      
      commit af4870e4
      Author: Mario Kleiner <mario.kleiner.de@gmail.com>
      Date:   Tue May 13 00:42:08 2014 +0200
      
          drm/nouveau/kms/nv04-nv40: fix pageflip events via special case.
      
      Unfortunately that hack got uprooted in
      
      commit cc1ef118
      Author: Thierry Reding <treding@nvidia.com>
      Date:   Wed Aug 12 17:00:31 2015 +0200
      
          drm/irq: Make pipe unsigned and name consistent
      
      Triggering a warning when trying to sample the vblank timestamp for a
      non-existing pipe. There's a few ways to fix this:
      
      - Open-code the old behaviour, which just enshrines this slight
        breakage of the userspace ABI.
      
      - Revert Mario's commit and again inflict broken timestamps, again not
        pretty.
      
      - Fix this for real by delaying the pageflip TS until the next vblank
        interrupt, thereby making it accurate.
      
      This patch implements the third option. Since having a page flip
      interrupt that happens when the pageflip gets armed and not when it
      completes in the next vblank seems to be fairly common (older i915 hw
      works very similarly) create a new helper to arm vblank events for
      such drivers.
      
      v2 (Mario Kleiner):
      - Fix function prototypes in drmP.h
      - Add missing vblank_put() for pageflip completion without
        pageflip event.
      - Initialize sequence number for queued pageflip event to avoid
        trouble in drm_handle_vblank_events().
      - Remove dead code and spelling fix.
      
      v3 (Mario Kleiner):
      - Add a signed-off-by and cc stable tag per Ilja's advice.
      
      v4 (Thierry Reding):
      - Fix kerneldoc typo, discovered by Michel Dänzer
      - Rearrange tags and changelog
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=106431
      
      
      Cc: Thierry Reding <treding@nvidia.com>
      Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
      Acked-by: default avatarBen Skeggs <bskeggs@redhat.com>
      Cc: Ilia Mirkin <imirkin@alum.mit.edu>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Cc: stable@vger.kernel.org # v4.3
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      bbc8764f
    • Thomas Hellstrom's avatar
      drm: Fix an unwanted master inheritance v2 · a0af2e53
      Thomas Hellstrom authored
      
      A client calling drmSetMaster() using a file descriptor that was opened
      when another client was master would inherit the latter client's master
      object and all its authenticated clients.
      
      This is unwanted behaviour, and when this happens, instead allocate a
      brand new master object for the client calling drmSetMaster().
      
      Fixes a BUG() throw in vmw_master_set().
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      a0af2e53
  20. 26 Nov, 2015 1 commit
  21. 25 Nov, 2015 1 commit
  22. 07 Nov, 2015 1 commit
  23. 16 Oct, 2015 1 commit
    • Ville Syrjälä's avatar
      drm: Add DRM_DEBUG_VBL() · 235fabe0
      Ville Syrjälä authored
      
      Add a new debug class for _verbose_ debug message from the vblank code.
      That is message we spew out potentially for every vblank interrupt.
      Thierry already got annoyed at the spew, and now I managed to lock up
      my box with these debug prints (seems serial console + a few debug
      prints every vblank aren't a good combination).
      
      Or should I maybe call it DRM_DEBUG_IRQ?
      
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      235fabe0
  24. 07 Oct, 2015 1 commit
  25. 06 Oct, 2015 1 commit
    • Thierry Reding's avatar
      drm/irq: Use unsigned int pipe in public API · 88e72717
      Thierry Reding authored
      This continues the pattern started in commit cc1ef118
      
       ("drm/irq:
      Make pipe unsigned and name consistent"). This is applied to the public
      APIs and driver callbacks, so pretty much all drivers need to be updated
      to match the new prototypes.
      
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Jianwei Wang <jianwei.wang.chn@gmail.com>
      Cc: Alison Wang <alison.wang@freescale.com>
      Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Mark Yao <mark.yao@rock-chips.com>
      Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
      Cc: Vincent Abriou <vincent.abriou@st.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      88e72717
  26. 30 Sep, 2015 1 commit
  27. 24 Sep, 2015 3 commits