1. 06 8月, 2014 2 次提交
    • D
      video/fbdev: Always built-in video= cmdline parsing · ea6763c1
      Daniel Vetter 提交于
      In drm/i915 we want to get at the video= cmdline modes even when we
      don't have fbdev support enabled, so that users can always override
      the kernel's initial mode selection.
      
      But that gives us a direct depency upon the parsing code in the fbdev
      subsystem. Since it's so little code just extract these 2 functions
      and always build them in.
      
      Whiel at it fix the checkpatch fail in this code.
      
      v2: Also move fb_mode_option. Spotted by the kbuild.
      
      v3: Review from Geert:
      - Keep the old copyright notice from fb_mem.c, although I have no
      idea what exactly applies.
      - Only compile this when needed.
      
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      
      --
      
      I prefer if we can merge this through drm-next since we'll use it
      there in follow-up patches.
      -Daniel
      ea6763c1
    • D
      drm: Don't grab an fb reference for the idr · 83f45fc3
      Daniel Vetter 提交于
      The current refcounting scheme is that the fb lookup idr also holds a
      reference. This works out nicely bacause thus far we've always
      explicitly cleaned up idr entries for framebuffers:
      - Userspace fbs get removed in the rmfb ioctl or when the drm file
        gets closed.
      - Kernel fbs (for fbdev emulation) get cleaned up by the driver code
        at module unload time.
      
      But now i915 also reconstructs the bios fbs for a smooth transition.
      And that fb is purely transitional and should get removed immmediately
      once all crtcs stop using it. Of course if the i915 fbdev code decides
      to reuse it as the main fbdev fb then it shouldn't be cleaned up, but
      in that case the fbdev code will grab it's own reference.
      
      The problem is now that we also want to register that takeover fb in
      the idr, so that userspace can do a smooth transition (animated maybe
      even!) itself. But currently we have no one who will clean up the idr
      reference once that fb isn't useful any more, and so essentially leak
      it.
      
      Fix this by no longer holding a full fb reference for the idr, but
      instead just have a weak reference using kref_get_unless_zero. But
      that requires us to synchronize and clean up with the idr and fb_lock
      in drm_framebuffer_free, so add that. It's a bit ugly that we have to
      unconditionally grab the fb_lock, but without that someone might creep
      through a race.
      
      This leak was caught by the fb leak check in drm_mode_config_cleanup.
      Originally the leak was introduced in
      
      commit 46f297fb
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Fri Mar 7 08:57:48 2014 -0800
      
          drm/i915: add plane_config fetching infrastructure v2
      
      Cc:  Jesse Barnes <jbarnes@virtuousgeek.org>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77511Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      83f45fc3
  2. 05 8月, 2014 13 次提交
    • D
      drm: Fix race when checking for fb in the generic kms obj lookup · 168c02ec
      Daniel Vetter 提交于
      In my review of
      
      commit 98f75de4
      Author: Rob Clark <robdclark@gmail.com>
      Date:   Fri May 30 11:37:03 2014 -0400
      
          drm: add object property typ
      
      I asked for a check to make sure that we never leak an fb from the
      generic mode object lookup since those have completely different
      lifetime rules. Rob added it, but outside of the idr mutex, which
      means that our dereference of obj->type can already chase free'd
      memory.
      
      Somehow I didn't spot this, so fix this asap.
      
      v2: Simplify the conditionals as suggested by Chris.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      168c02ec
    • C
      drm: Unlink dead file_priv from list of active files first · dff01de1
      Chris Wilson 提交于
      In order to prevent external observers walking the list of open DRM
      files from seeing an invalid drm_file_private in the process of being
      torndown, the first operation we need to take is to unlink the
      drm_file_private from that list.
      
      	general protection fault: 0000 [#1] PREEMPT SMP
      	Modules linked in: i915 i2c_algo_bit drm_kms_helper drm lpc_ich mfd_core nls_iso8859_1 i2c_hid video hid_generic usbhid hid e1000e ahci ptp libahci pps_core
      	CPU: 3 PID: 8220 Comm: cat Not tainted 3.16.0-rc6+ #4
      	Hardware name: Intel Corporation Shark Bay Client platform/WhiteTip Mountain 1, BIOS HSWLPTU1.86C.0119.R00.1303230105 03/23/2013
      	task: ffff8800219642c0 ti: ffff880047024000 task.ti: ffff880047024000
      	RIP: 0010:[<ffffffffa0137c70>]  [<ffffffffa0137c70>] per_file_stats+0x110/0x160 [i915]
      	RSP: 0018:ffff880047027d48  EFLAGS: 00010246
      	RAX: 6b6b6b6b6b6b6b6b RBX: ffff880047027e30 RCX: 0000000000000000
      	RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff88003a05cd00
      	RBP: ffff880047027d58 R08: 0000000000000001 R09: 0000000000000000
      	R10: ffff8800219642c0 R11: 0000000000000000 R12: ffff88003a05cd00
      	R13: 0000000000000000 R14: ffff88003a05cd00 R15: ffff880047027d88
      	FS:  00007f5f73a13740(0000) GS:ffff88014e380000(0000) knlGS:0000000000000000
      	CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      	CR2: 00000000023ff038 CR3: 0000000021a4b000 CR4: 00000000001407e0
      	Stack:
      	 0000000000000001 000000000000ffff ffff880047027dc8 ffffffff813438e4
      	 ffff880047027e30 ffffffffa0137b60 ffff880021a8af58 ffff880021a8f1a0
      	 ffff8800a2061fb0 ffff8800a2062048 ffff8800a2061fb0 ffff8800a1e23478
      	Call Trace:
      	 [<ffffffff813438e4>] idr_for_each+0xf4/0x180
      	 [<ffffffffa0137b60>] ? i915_gem_stolen_list_info+0x1f0/0x1f0 [i915]
      	 [<ffffffffa013a17a>] i915_gem_object_info+0x5ca/0x6a0 [i915]
      	 [<ffffffff81193ec5>] seq_read+0xf5/0x3a0
      	 [<ffffffff8116d950>] vfs_read+0x90/0x150
      	 [<ffffffff8116e509>] SyS_read+0x49/0xb0
      	 [<ffffffff815d8622>] tracesys+0xd0/0xd5
      	Code: 01 00 00 49 39 84 24 08 01 00 00 74 55 49 8b 84 24 b8 00 00 00 48 01 43 18 31 c0 5b 41 5c 5d c3 0f 1f 00 49 8b 44 24 08 4c 89 e7 <48> 8b 70 28 48 81 c6 48 80 00 00 e8 80 14 01 00 84 c0 74 bc 49
      	RIP  [<ffffffffa0137c70>] per_file_stats+0x110/0x160 [i915]
      	RSP <ffff880047027d48>
      Reported-by: N"Ursulin, Tvrtko" <tvrtko.ursulin@intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81712Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: "Ursulin, Tvrtko" <tvrtko.ursulin@intel.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      dff01de1
    • T
      drm/ttm: Pass GFP flags in order to avoid deadlock. · a91576d7
      Tetsuo Handa 提交于
      Commit 7dc19d5a "drivers: convert shrinkers to new count/scan API" added
      deadlock warnings that ttm_page_pool_free() and ttm_dma_page_pool_free()
      are currently doing GFP_KERNEL allocation.
      
      But these functions did not get updated to receive gfp_t argument.
      This patch explicitly passes sc->gfp_mask or GFP_KERNEL to these functions,
      and removes the deadlock warning.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: stable <stable@kernel.org> [2.6.35+]
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      a91576d7
    • T
      drm/ttm: Fix possible stack overflow by recursive shrinker calls. · 71336e01
      Tetsuo Handa 提交于
      While ttm_dma_pool_shrink_scan() tries to take mutex before doing GFP_KERNEL
      allocation, ttm_pool_shrink_scan() does not do it. This can result in stack
      overflow if kmalloc() in ttm_page_pool_free() triggered recursion due to
      memory pressure.
      
        shrink_slab()
        => ttm_pool_shrink_scan()
           => ttm_page_pool_free()
              => kmalloc(GFP_KERNEL)
                 => shrink_slab()
                    => ttm_pool_shrink_scan()
                       => ttm_page_pool_free()
                          => kmalloc(GFP_KERNEL)
      
      Change ttm_pool_shrink_scan() to do like ttm_dma_pool_shrink_scan() does.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: stable <stable@kernel.org> [2.6.35+]
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      71336e01
    • T
      drm/ttm: Use mutex_trylock() to avoid deadlock inside shrinker functions. · 22e71691
      Tetsuo Handa 提交于
      I can observe that RHEL7 environment stalls with 100% CPU usage when a
      certain type of memory pressure is given. While the shrinker functions
      are called by shrink_slab() before the OOM killer is triggered, the stall
      lasts for many minutes.
      
      One of reasons of this stall is that
      ttm_dma_pool_shrink_count()/ttm_dma_pool_shrink_scan() are called and
      are blocked at mutex_lock(&_manager->lock). GFP_KERNEL allocation with
      _manager->lock held causes someone (including kswapd) to deadlock when
      these functions are called due to memory pressure. This patch changes
      "mutex_lock();" to "if (!mutex_trylock()) return ...;" in order to
      avoid deadlock.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: stable <stable@kernel.org> [3.3+]
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      22e71691
    • T
      drm/ttm: Choose a pool to shrink correctly in ttm_dma_pool_shrink_scan(). · 46c2df68
      Tetsuo Handa 提交于
      We can use "unsigned int" instead of "atomic_t" by updating start_pool
      variable under _manager->lock. This patch will make it possible to avoid
      skipping when choosing a pool to shrink in round-robin style, after next
      patch changes mutex_lock(_manager->lock) to !mutex_trylock(_manager->lork).
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: stable <stable@kernel.org> [3.3+]
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      46c2df68
    • T
      drm/ttm: Fix possible division by 0 in ttm_dma_pool_shrink_scan(). · 11e504cc
      Tetsuo Handa 提交于
      list_empty(&_manager->pools) being false before taking _manager->lock
      does not guarantee that _manager->npools != 0 after taking _manager->lock
      because _manager->npools is updated under _manager->lock.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: stable <stable@kernel.org> [3.3+]
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      11e504cc
    • D
      drm/tda998x: update for new drm connector APIs. · 74cd62ea
      Dave Airlie 提交于
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      74cd62ea
    • D
      drm/sti: fix warning in build. · 8bb652eb
      Dave Airlie 提交于
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      8bb652eb
    • D
      Merge branch 'drm_kms_for_next-v8' of... · 96b1b971
      Dave Airlie 提交于
      Merge branch 'drm_kms_for_next-v8' of git://git.linaro.org/people/benjamin.gaignard/kernel into drm-next
      
      This series of patches add the support of DRM/KMS drivers for STMicroelectronics
      chipsets stih416 and stih407.
      
      Hardware is split in two main blocks: Compositor and TVout. Each of them
      includes specific hardware IPs and the display timing are controlled by a specific
      Video Timing Generator hardware IP (VTG).
      
      Compositor is made of the follow hardware IPs:
       - GDP (Generic Display Pipeline) which is an entry point for graphic (RGB)
         buffers
       - VDP (Video Diplay Pipeline) which is an entry point for video (YUV) buffers
       - HQVDP (High Quality Video Display Processor) that supports scaling,
         deinterlacing and some miscellaneous image quality improvements.
         It fetches the Video decoded buffers from memory, processes them and pushes
         them to the Compositor through a HW dedicated bus.
       - Mixer is responsible of mixing all the entries depending of their
         respective z-order and layout
      
      TVout is divided in 3 parts:
       - HDMI to generate HDMI signals, depending of chipset version HDMI phy can
         change.
       - HDA to generate signals for HD analog TV
       - VIP to control/switch data path coming from Compositor
      
      On stih416 compositor and Tvout are on different dies so a Video Trafic Advance
      inter-die Communication mechanism (VTAC) is needed.
      
      +---------------------------------------------+   +----------------------------------------+
      | +-------------------------------+   +----+  |   |  +----+   +--------------------------+ |
      | |                               |   |    |  |   |  |    |   |  +---------+     +----+  | |
      | | +----+              +------+  |   |    |  |   |  |    |   |  | VIP     |---->|HDMI|  | |
      | | |GPD +------------->|      |  |   |    |  |   |  |    |   |  |         |     +----+  | |
      | | +----+              |Mixer |--|-->|    |  |   |  |    |---|->| switcher|             | |
      | |                     |      |  |   |    |  |   |  |    |   |  |         |     +----+  | |
      | |                     |      |  |   |    |  |   |  |    |   |  |         |---->|HDA |  | |
      | |                     +------+  |   |VTAC|========>|VTAC|   |  +---------+     +----+  | |
      | |                               |   |    |  |   |  |    |   |                          | |
      | |         Compositor            |   |    |  |   |  |    |   |           TVout          | |
      | +-------------------------------+   |    |  |   |  |    |   +--------------------------+ |
      |                      ^              |    |  |   |  |    |             ^                  |
      |                      |              |    |  |   |  |    |             |                  |
      |               +--------------+      |    |  |   |  |    |      +-------------+           |
      |               | VTG (master) |----->|    |  |   |  |    |----->| VTG (slave) |           |
      |               +--------------+      +----+  |   |  +----+      +-------------+           |
      |Digital die                                  |   |                              Analog Die|
      +---------------------------------------------+   +----------------------------------------+
      
      On stih407 Compositor and Tvout are on the same die
      
      +-----------------------------------------------------------------+
      | +-------------------------------+  +--------------------------+ |
      | |                               |  |  +---------+     +----+  | |
      | | +----+              +------+  |  |  | VIP     |---->|HDMI|  | |
      | | |GPD +------------->|      |  |  |  |         |     +----+  | |
      | | +----+              |Mixer |--|--|->| switcher|             | |
      | | +----+   +-----+    |      |  |  |  |         |     +----+  | |
      | | |VDP +-->+HQVDP+--->|      |  |  |  |         |---->|HDA |  | |
      | | +----+   +-----+    +------+  |  |  +---------+     +----+  | |
      | |                               |  |                          | |
      | |         Compositor            |  |           TVout          | |
      | +-------------------------------+  +--------------------------+ |
      |                              ^        ^                         |
      |                              |        |                         |
      |                           +--------------+                      |
      |                           |     VTG      |                      |
      |                           +--------------+                      |
      |Digital die                                                      |
      +-----------------------------------------------------------------+
      
      In addition of the drivers for the IPs listed before a thin I2C driver (hdmiddc) is used
      by HDMI driver to retrieve EDID for monitor.
      
      To unify interfaces of GDP and VDP we create a "layer" interface called by
      compositor to control both GPD and VDP.
      
      Hardware have memory contraints (alignment, contiguous) so we use CMA drm helpers functions
      to allocate frame buffer.
      
      File naming convention is:
       - sti_* for IPs drivers
       - sti_drm_* for drm functions implementation.
      
      * 'drm_kms_for_next-v8' of git://git.linaro.org/people/benjamin.gaignard/kernel:
        drm: sti: Add DRM driver itself
        drm: sti: add Compositor
        drm: sti: add Mixer
        drm: sti: add VID layer
        drm: sti: add GDP layer
        drm: sti: add TVOut driver
        drm: sti: add HDA driver
        drm: sti: add HDMI driver
        drm: sti: add VTAC drivers
        drm: sti: add VTG driver
        drm: sti: add bindings for DRM driver
      96b1b971
    • D
      Merge branch 'tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox into drm-next · 920f9464
      Dave Airlie 提交于
      This builds upon the previous set of fixes which were pulled on 6th July.
      Included in this set are:
      - an update from Jean-Francois to add the missing reg documentation entry
        to the device tree documentation.
      - conversion of the tda998x driver to the component helpers.
      
      * 'tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox:
        drm/i2c: tda998x: add component support
        drm/i2c: tda998x: allow re-use of tda998x support code
        drm/i2c: tda998x: fix lack of required reg in DT documentation
      
      Conflicts:
      	drivers/gpu/drm/i2c/tda998x_drv.c
      920f9464
    • D
      Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next · eceb55a0
      Dave Airlie 提交于
      This time around we have a mix of new hw enablement (mdp5 v1.3 /
      apq8084), plus devicetree and various upstream changes (mostly
      adapting to CCF vs downstream clk driver differences) for mdp4 /
      apq8064.  With these drm/msm patches plus a few other small patchsets
      (from linaro qcom integration branch.. mostly stuff queued up for
      3.17) we have the inforce ifc6410 board working, with gpu.  Much nicer
      to work with than ancient vendor android branch :-)
      
      * 'msm-next' of git://people.freedesktop.org/~robclark/linux:
        drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo
        drm/msm/hdmi: enable lpm-mux if it is present
        drm/msm/mdp5: add support for MDP5 v1.3
        drm/msm: fix potential deadlock in gpu init
        drm/msm: use upstream iommu
        drm/msm: no mmu is only error if not using vram carveout
        drm/msm: fix BUG_ON() in error cleanup path
        drm/msm/mdp4: add mdp axi clk
        drm/msm: hdmi phy 8960 phy pll
        drm/msm: update generated headers
        drm/msm: DT support for 8960/8064 (v3)
        drm/msm: Implement msm drm fb_mmap callback function
        drm/msm: activate iommu support
        drm/msm: fix double struct_mutex acquire
      eceb55a0
    • D
      Merge tag 'v3.16' into drm-next · 5d42f82a
      Dave Airlie 提交于
      Linux 3.16
      
      backmerge requested by i915, nouveau and radeon authors
      
      Conflicts:
      	drivers/gpu/drm/i915/i915_gem_render_state.c
      	drivers/gpu/drm/i915/intel_drv.h
      5d42f82a
  3. 04 8月, 2014 25 次提交