1. 15 Nov, 2016 3 commits
    • Rob Clark's avatar
      drm: don't let crtc_ww_class leak out · 35cf0350
      Rob Clark authored
      kbuild spotted this error, with drm/msm patches that add a new
      modeset-lock in the driver and driver built as a module:
      
        ERROR: "crtc_ww_class" [drivers/gpu/drm/msm/msm.ko] undefined!
      
      Really the only reason for crtc_ww_class not being internal to
      drm_modeset_lock.c is that drm_modeset_lock_init() was static-inline
      (for no particularly good reason).
      
      Fix that, and move crtc_ww_class into drm_modeset_lock.c.
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479163257-18703-1-git-send-email-robdclark@gmail.com
      35cf0350
    • Chris Wilson's avatar
      dma-buf: Use fence_get_rcu_safe() for retrieving the exclusive fence · 6bfec6d9
      Chris Wilson authored
      The current code is subject to a race where we may try to acquire a
      reference on a stale fence:
      
      [13703.335118] WARNING: CPU: 1 PID: 14975 at ./include/linux/kref.h:46 i915_gem_object_wait+0x1a3/0x1c0
      [13703.335184] Modules linked in:
      [13703.335202] CPU: 1 PID: 14975 Comm: gem_concurrent_ Not tainted 4.9.0-rc4+ #26
      [13703.335216] Hardware name:                  /        , BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
      [13703.335233]  ffffc90002f5bcc8 ffffffff812807de 0000000000000000 0000000000000000
      [13703.335257]  ffffc90002f5bd08 ffffffff81073811 0000002e80000000 ffff88026bf7c780
      [13703.335279]  7fffffffffffffff 0000000000000001 ffff88027045a550 ffff88026bf7c780
      [13703.335301] Call Trace:
      [13703.335316]  [<ffffffff812807de>] dump_stack+0x4d/0x6f
      [13703.335331]  [<ffffffff81073811>] __warn+0xc1/0xe0
      [13703.335343]  [<ffffffff810738e8>] warn_slowpath_null+0x18/0x20
      [13703.335355]  [<ffffffff813ac443>] i915_gem_object_wait+0x1a3/0x1c0
      [13703.335367]  [<ffffffff813ae8ec>] i915_gem_set_domain_ioctl+0xcc/0x330
      [13703.335386]  [<ffffffff813534ab>] drm_ioctl+0x1cb/0x410
      [13703.335400]  [<ffffffff813ae820>] ? i915_gem_obj_prepare_shmem_write+0x1d0/0x1d0
      [13703.335416]  [<ffffffff8135359b>] ? drm_ioctl+0x2bb/0x410
      [13703.335429]  [<ffffffff8117d32f>] do_vfs_ioctl+0x8f/0x5c0
      [13703.335442]  [<ffffffff8117d89c>] SyS_ioctl+0x3c/0x70
      [13703.335456]  [<ffffffff815a07a4>] entry_SYSCALL_64_fastpath+0x17/0x98
      [13703.335558] ---[ end trace fd24176416ba6981 ]---
      [13703.382778] general protection fault: 0000 [#1] SMP
      [13703.382802] Modules linked in:
      [13703.382816] CPU: 1 PID: 14967 Comm: gem_concurrent_ Tainted: G        W       4.9.0-rc4+ #26
      [13703.382828] Hardware name:                  /        , BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
      [13703.382841] task: ffff880275458000 task.stack: ffffc90002f18000
      [13703.382849] RIP: 0010:[<ffffffff813b3534>]  [<ffffffff813b3534>] i915_gem_request_retire+0x2b4/0x320
      [13703.382870] RSP: 0018:ffffc90002f1bbc8  EFLAGS: 00010293
      [13703.382878] RAX: dead000000000200 RBX: ffff88026bf7dce8 RCX: dead000000000100
      [13703.382887] RDX: dead000000000100 RSI: ffff88026bf7c930 RDI: ffff88026bf7dd00
      [13703.382897] RBP: ffffc90002f1bbf8 R08: 00000000ffffffff R09: ffff88026b89a000
      [13703.382905] R10: 0000000000000001 R11: ffff88026bbe8fe0 R12: ffff88026bf7c000
      [13703.382913] R13: ffff880275af8000 R14: ffff88026bf7c180 R15: dead000000000200
      [13703.382922] FS:  00007f89e787d740(0000) GS:ffff88027fd00000(0000) knlGS:0000000000000000
      [13703.382934] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [13703.382942] CR2: 00007f9053d2e000 CR3: 000000026d414000 CR4: 00000000001006e0
      [13703.382951] Stack:
      [13703.382958]  ffff880275413000 ffffc90002f1bde8 ffff880275af8000 ffff880274e8a600
      [13703.382976]  ffff880276a06000 ffffc90002f1bde8 ffffc90002f1bc38 ffffffff813b48c5
      [13703.382995]  ffffc90002f1bc00 ffffc90002f1bde8 ffff88026972a440 0000000000000000
      [13703.383021] Call Trace:
      [13703.383032]  [<ffffffff813b48c5>] i915_gem_request_alloc+0xa5/0x350
      [13703.383043]  [<ffffffff813a17c3>] i915_gem_do_execbuffer.isra.41+0x7b3/0x18b0
      [13703.383055]  [<ffffffff813b144c>] ? i915_gem_object_get_sg+0x25c/0x2b0
      [13703.383065]  [<ffffffff813b1d4d>] ? i915_gem_object_get_page+0x1d/0x50
      [13703.383076]  [<ffffffff813b28cc>] ? i915_gem_pwrite_ioctl+0x66c/0x6d0
      [13703.383086]  [<ffffffff813a2c25>] i915_gem_execbuffer2+0x95/0x1e0
      [13703.383096]  [<ffffffff813534ab>] drm_ioctl+0x1cb/0x410
      [13703.383105]  [<ffffffff813a2b90>] ? i915_gem_execbuffer+0x2d0/0x2d0
      [13703.383117]  [<ffffffff810c3df0>] ? hrtimer_start_range_ns+0x1a0/0x310
      [13703.383128]  [<ffffffff8117d32f>] do_vfs_ioctl+0x8f/0x5c0
      [13703.383140]  [<ffffffff810c60e8>] ? SyS_timer_settime+0x118/0x1a0
      [13703.383150]  [<ffffffff8117d89c>] SyS_ioctl+0x3c/0x70
      [13703.383162]  [<ffffffff815a07a4>] entry_SYSCALL_64_fastpath+0x17/0x98
      [13703.383172] Code: 49 39 c6 48 8d 70 e8 48 8d 5f e8 75 16 eb 47 48 8d 43 18 48 8b 53 18 48 89 de 49 39 c6 48 8d 5a e8 74 33 48 8b 56 08 48 8b 46 10 <48> 89 42 08 48 89 10 f6 46 38 01 48 89 4e 08 4c 89 7e 10 74 cf
      [13703.383557] RIP  [<ffffffff813b3534>] i915_gem_request_retire+0x2b4/0x320
      [13703.383570]  RSP <ffffc90002f1bbc8>
      [13703.383586] ---[ end trace fd24176416ba6982 ]---
      
      This is fixed by using the kref_get_unless_zero() as a full memory
      barrier to validate the fence is still the current exclusive fence before
      returning it back to the caller. (Note the fix only requires using
      dma_fence_get_rcu() and correct handling, but we may as well use the
      helper rather than inline equivalent code.)
      
      Note: Issue can only be hit with the i915 driver.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Sumit Semwal <sumit.semwal@linaro.org
      Fixes: d07f0e59 ("drm/i915: Move GEM activity tracking into a common struct reservation_object")
      Reviewed-by: Christian König <christian.koenig@amd.com>.
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161114115540.31155-1-chris@chris-wilson.co.uk
      6bfec6d9
    • Marek Vasut's avatar
      drm/imx: Switch to drm_fb_cma_prepare_fb() helper · 782ea2a4
      Marek Vasut authored
      Remove the common code from the driver and use the
      drm_fb_cma_prepare_fb() helper instead.
      Moveover, call the helper from prepare_fb() plane hook .
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Lucas Stach <l.stach@pengutronix.de>
      Reviewed-by: default avatarLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161114100732.3446-2-marex@denx.de
      Link: http://patchwork.freedesktop.org/patch/msgid/1476451342-146510-1-git-send-email-dvyukov@google.com
      782ea2a4
  2. 14 Nov, 2016 20 commits
  3. 13 Nov, 2016 1 commit
    • Julia Lawall's avatar
      drm/sun4i: constify component_ops structures · dfeb693d
      Julia Lawall authored
      These component_ops structures are only used as the second argument to
      component_add and component_del, which are declared as const, so the
      structures can be declared as const as well.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r disable optional_qualifier@
      identifier i;
      position p;
      @@
      
      static struct component_ops i@p = { ... };
      
      @ok1@
      identifier r.i;
      expression e1;
      position p;
      @@
      
      component_add(e1,&i@p)
      
      @ok2@
      identifier r.i;
      expression e1;
      position p;
      @@
      
      component_del(e1, &i@p)
      
      @bad@
      position p != {r.p,ok1.p,ok2.p};
      identifier r.i;
      struct component_ops e;
      @@
      
      e@i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.i;
      @@
      
      static
      +const
       struct component_ops i = { ... };
      // </smpl>
      
      The result of the size command before the change is (arm):
      
         text       data         bss     dec      hex filename
         5266        236           8    5510     1586 sun4i_backend.o
         6393        236           8    6637     19ed sun4i_tcon.o
         3700        368           8    4076      fec sun4i_tv.o
         1668        108           0    1776      6f0 sun6i_drc.o
      
      and after the change:
      
         text       data         bss     dec     hex filename
         5274        228           8    5510    1586 sun4i_backend.o
         6401        228           8    6637    19ed sun4i_tcon.o
         3708        360           8    4076     fec sun4i_tv.o
         1676        100           0    1776     6f0 sun6i_drc.o
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1478971198-3659-1-git-send-email-Julia.Lawall@lip6.fr
      dfeb693d
  4. 12 Nov, 2016 1 commit
  5. 11 Nov, 2016 3 commits
  6. 10 Nov, 2016 4 commits
    • Dave Airlie's avatar
      Merge tag 'dw-hdmi-next-2016-09-19' of git://git.pengutronix.de/git/pza/linux into drm-next · 90233ee5
      Dave Airlie authored
      dw-hdmi i2c master controller
      
      - add support for the HDMI I2C master controller, for boards that
        can have their DDC pins connected only to the HDMI TX directly.
      
      * tag 'dw-hdmi-next-2016-09-19' of git://git.pengutronix.de/git/pza/linux:
        drm: bridge/dw_hdmi: add dw hdmi i2c bus adapter support
        drm: dw_hdmi: use of_get_i2c_adapter_by_node interface
      90233ee5
    • Dave Airlie's avatar
      Merge tag 'imx-drm-next-2016-11-10' of git://git.pengutronix.de/git/pza/linux into drm-next · 628d1655
      Dave Airlie authored
      imx-drm plane update cleanup, YUV formats
      
      - request modeset if plane offsets changed, only the plane base
        address can be changed without disabling the plane IDMAC channel.
      - cleanup of plane atomic_update
      - remove unused ipu_cpmem_set_yuv_planar function
      - support YUV 4:4:4, 4:2:2, NV12 and NV16 plane formats
      - not only mask interrupts during irq init, also clear them
      - remove a legacy check from imx-ldb
      - add support to set the CSI downsizing bits
      - silence an obnoxious warning during modeset
      
      * tag 'imx-drm-next-2016-11-10' of git://git.pengutronix.de/git/pza/linux:
        gpu: ipu-di: silence videomode logspam
        gpu: ipu-v3: add ipu_csi_set_downsize
        drm/imx: imx-ldb: remove unnecessary double disable check
        gpu: ipu-v3: initially clear all interrupts
        drm/imx: ipuv3-plane: add support for YUV 4:2:2 and 4:4:4, NV12, and NV16 formats
        gpu: ipu-v3: add YUV 4:4:4 support
        gpu: ipu-cpmem: remove unused ipu_cpmem_set_yuv_planar function
        drm/imx: ipuv3-plane: let drm_plane_state_to_ubo/vbo handle chroma subsampling other than 4:2:0
        drm/imx: ipuv3-plane: merge ipu_plane_atomic_set_base into atomic_update
        drm/imx: ipuv3-plane: request modeset if plane offsets changed
      628d1655
    • Dave Airlie's avatar
      Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next · 3e91168a
      Dave Airlie authored
      - better atomic state debugging from Rob
      - fence prep from gustavo
      - sumits flushed out his backlog of pending dma-buf/fence patches from
        various people
      - drm_mm leak debugging plus trying to appease Kconfig (Chris)
      - a few misc things all over
      
      * tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel: (35 commits)
        drm: Make DRM_DEBUG_MM depend on STACKTRACE_SUPPORT
        drm/i915: Restrict DRM_DEBUG_MM automatic selection
        drm: Restrict stackdepot usage to builtin drm.ko
        drm/msm: module param to dump state on error irq
        drm/msm/mdp5: add atomic_print_state support
        drm/atomic: add debugfs file to dump out atomic state
        drm/atomic: add new drm_debug bit to dump atomic state
        drm: add helpers to go from plane state to drm_rect
        drm: add helper for printing to log or seq_file
        drm: helper macros to print composite types
        reservation: revert "wait only with non-zero timeout specified (v3)" v2
        drm/ttm: fix ttm_bo_wait
        dma-buf/fence: revert "don't wait when specified timeout is zero" (v2)
        dma-buf/fence: make timeout handling in fence_default_wait consistent (v2)
        drm/amdgpu: add the interface of waiting multiple fences (v4)
        dma-buf: return index of the first signaled fence (v2)
        MAINTAINERS: update Sync File Framework files
        dma-buf/sw_sync: put fence reference from the fence creation
        dma-buf/sw_sync: mark sync_timeline_create() static
        drm: Add stackdepot include for DRM_DEBUG_MM
        ...
      3e91168a
    • Dave Airlie's avatar
      Merge tag 'drm-intel-next-2016-11-08' of git://anongit.freedesktop.org/git/drm-intel into drm-next · db8feb69
      Dave Airlie authored
      - gpu idling rework for s/r (Imre)
      - vlv mappable scanout fix
      - speed up probing in resume (Lyude)
      - dp audio workarounds for gen9 (Dhinakaran)
      - more conversion to using dev_priv internally (Ville)
      - more gen9+ wm fixes and cleanups (Maarten)
      - shrinker cleanup&fixes (Chris)
      - reorg plane init code (Ville)
      - implement support for multiple timelines (prep work for scheduler)
        from Chris and all
      - untangle dev->struct_mutex locking as prep for multiple timelines
        (Chris)
      - refactor bxt phy code and collect it all in intel_dpio_phy.c (Ander)
      - another gvt with bugfixes all over from Zhenyu
      - piles of lspcon fixes from Imre
      - 90/270 rotation fixes (Ville)
      - guc log buffer support (Akash+Sagar)
      - fbc fixes from Paulo
      - untangle rpm vs. tiling-fences/mmaps (Chris)
      - fix atomic commit to wait on the right fences (Daniel Stone)
      
      * tag 'drm-intel-next-2016-11-08' of git://anongit.freedesktop.org/git/drm-intel: (181 commits)
        drm/i915: Update DRIVER_DATE to 20161108
        drm/i915: Mark CPU cache as dirty when used for rendering
        drm/i915: Add assert for no pending GPU requests during suspend/resume in LR mode
        drm/i915: Make sure engines are idle during GPU idling in LR mode
        drm/i915: Avoid early GPU idling due to race with new request
        drm/i915: Avoid early GPU idling due to already pending idle work
        drm/i915: Limit Valleyview and earlier to only using mappable scanout
        drm/i915: Round tile chunks up for constructing partial VMAs
        drm/i915: Remove the vma from the object list upon close
        drm/i915: Reinit polling before hpd when resuming
        drm/i915: Remove redundant reprobe in i915_drm_resume
        drm/i915/dp: Extend BDW DP audio workaround to GEN9 platforms
        drm/i915/dp: BDW cdclk fix for DP audio
        drm/i915: Fix pages pin counting around swizzle quirk
        drm/i915: Fix test on inputs for vma_compare()
        drm/i915/guc: Cache the client mapping
        drm/i915: Tidy slab cache allocations
        drm/i915: Introduce HAS_64BIT_RELOC
        drm/i915: Show the execlist queue in debugfs/i915_engine_info
        drm/i915: Unify global_list into global_link
        ...
      db8feb69
  7. 09 Nov, 2016 4 commits
  8. 08 Nov, 2016 4 commits