1. 01 10月, 2013 14 次提交
    • V
      drm/i915: Move power well init earlier during driver load · a1485320
      Ville Syrjälä 提交于
      intel_modeset_init() will already attempt to disable VGA. In order to do
      that, it needs the power well to be on. So move the power well init
      to happen before intel_modeset_init() during driver load.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a1485320
    • V
      drm/i915: Redisable VGA before the modeset on resume · 7d0bc1ea
      Ville Syrjälä 提交于
      The VGA plane needs to be disabled before we start doing any
      modeset operations on resume.
      
      This should also guarantee that the power well will be enabled
      when we call i915_redisable_vga() since it gets explicitly powered on
      during resume, and will get powered back off during the modeset
      operation if no longer needed.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7d0bc1ea
    • V
      drm/i915: Fix unclaimed register access due to delayed VGA memory disable · ce352550
      Ville Syrjälä 提交于
      VGA registers live inside the power well on HSW, so in order to write
      the VGA MSR register we need the power well to be on.
      
      We really must write to the register to properly clear the
      VGA_MSR_MEM_EN enable bit, even if all VGA registers get zeroed when
      the power well is down. It seems that the implicit zeroing done by
      the power well is not enough to propagate the VGA_MSR_MEM_EN bit to
      whomever is actually responsible for the memory decode ranges.
      
      If we leave VGA memory decode enabled, and then turn off the power well,
      all VGA memory reads will return zeroes. But if we first disable VGA
      memory deocde and then turn off the power well, VGA memory reads
      return all ones, indicating that the access wasn't claimed by anyone.
      For the vga arbiter to function correctly the IGD must not claim the
      VGA memory accesses.
      
      Previously we were doing the VGA_MSR register access while the power well
      was excplicitly powered up during driver init. But ever since
      
       commit 6e1b4fda
       Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
       Date:   Thu Sep 5 20:40:52 2013 +0300
      
          drm/i915: Delay disabling of VGA memory until vgacon->fbcon handoff is done
      
      we delay the VGA memory disable until fbcon has initialized, and so
      there's a possibility that the power well got turned off during the
      fbcon modeset. Also vgacon_save_screen() will need the power well to be
      on to be able to read the VGA memory.
      
      So immediately after enabling the power well during init grab a refence
      for VGA purposes, and after all the VGA handling is done, release it.
      
      v2: Add intel_display_power_put() for the num_pipes==0 case
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Fix up the patch wiggle screw-up that I've done and which
      Paulo catched. Also polish spelling in the patch headline.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ce352550
    • D
      drm/i915: Rip out SUPPORTS_EDP · 6fca55b1
      Daniel Vetter 提交于
      It only controls the setting of the vbt.edp_support variable, which in
      turn only controls one debug output plus can also force-disable the
      lvds output.
      
      Since the value only restricted this logic to mobile ilk there's the
      slight risk that this will break lvds on desktop ilk or on snb/ivb
      platforms. But with the vbt it's better when we know what's going on
      here, so let's rip it out and see what happens.
      
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6fca55b1
    • P
      drm/i915: don't init DP or HDMI when not supported by DDI port · 311a2094
      Paulo Zanoni 提交于
      There's no reason to init a DP connector if the encoder just supports
      HDMI: we'll just waste hundreds and hundreds of cycles trying to do DP
      AUX transactions to detect if there's something there. Same goes for a
      DP connector that doesn't support HDMI, but I'm not sure these
      actually exist.
      
      v2: - Use bit fields
          - Remove useless identation level
          - Replace DRM_ERROR with DRM_DEBUG_KMS
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v1)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      311a2094
    • P
      drm/i915: add some assertions about VBT DDI port types · 554d6af5
      Paulo Zanoni 提交于
      Our code makes a lot of assumptions regarding what each DDI port
      actually supports, and the VBT should tell us what is really happening
      in the hardware. So parse the information provided by the VBT and
      check if any of our assumptions is wrong.
      
      Our driver also has a history of not really trusting the VBT, so a
      WARN here could mean that:
       a) our coding assumptions are wrong
       b) the VBT is wrong
       c) we're incorrectly parsing the VBT
       d) the checks are wrong
      
      But I really hope we won't ever trigger any of those WARNs.
      
      v2: Don't check the redundant "Capabilities" field from byte 24 since
          it doesn't seem to be used.
      v3: Rebase
      v4: Replace WARN with DRM_DEBUG_KMS
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v2)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      554d6af5
    • P
      drm/i915: check the DDC and AUX bits of the VBT on DDI machines · 6bf19e7c
      Paulo Zanoni 提交于
      Our code currently assumes that port X will use the DP AUX channel X
      and the DDC pin X. The VBT should tell us how things are mapped, so
      add some WARNs in case we discover our assumptions are wrong (or in
      case the VBT is just wrong, which is also perfectly possible).
      
      Why would someone wire port B to AUX C and DDC D?
      
      v2: Rebase
      v3: Convert WARNs to DRM_DEBUG_KMS
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v1)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6bf19e7c
    • P
      drm/i915: use the HDMI DDI buffer translations from VBT · 6acab15a
      Paulo Zanoni 提交于
      We currently use the recommended values from BSpec, but the VBT
      specifies the correct value to use for the hardware we have, so use
      it. We also fall back to the recommended value in case we can't find
      the VBT.
      
      In addition, this code also provides some infrastructure to parse more
      information about the DDI ports. There's a lot more information we
      could extract and use in the future.
      
      v2: - Move some code to init_vbt_defaults.
      v3: - Rebase
          - Clarify the "DVO Port" matching code
      v4: - Use I915_MAX_PORTS
          - Change the HAS_DDI checks
          - Replace DRM_ERROR with DRM_DEBUG_KMS
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6acab15a
    • P
      drm/i915: VBT's child_device_config changes over time · 768f69c9
      Paulo Zanoni 提交于
      We currently treat the child_device_config as a simple struct, but
      this is not correct: new BDB versions change the meaning of some
      offsets, so the struct needs to be adjusted for each version.
      
      Since there are too many changes (today we're in version 170!), making
      a big versioned union would be too complicated, so child_device_config
      is now a union of 3 things: (i) a "raw" byte array that's safe to use
      anywhere; (ii)  an "old" structure that's the one we've been using and
      should be safe to keep in the SDVO and TV code; and (iii) a "common"
      structure that should contain only fields that are common for all the
      known VBT versions.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      768f69c9
    • C
      drm/i915: Do not unlock upon error in i915_gem_idle() · f7403347
      Chris Wilson 提交于
      We never took the lock ourselves and all callers expect the struct_mutex
      to be locked upon return (be it success or error), thereore dropping the
      lock along the error paths looks to be a vestigial error from
      
      commit db1b76ca
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Jul 9 16:51:37 2013 +0200
      
          drm/i915: don't frob mm.suspended when not using ums
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f7403347
    • D
      drm/i915: Use unsigned for overflow checks in execbuf · b205ca57
      Daniel Vetter 提交于
      There's actually no real risk since we already check for stricter
      constraints earlier (using UINT_MAX / sizeof (struct
      drm_i915_gem_exec_object2) as the limit). But in eb_create we use
      signed integers, which steals a factor of 2. Luckily struct
      drm_i915_gem_exec_object2 for this to not matter.
      
      Still, be consistent and use unsigned integers.
      
      Similar use unsinged integers when checking for overflows in the
      relocation entry processing.
      
      I've also added a new subtests to igt/gem_reloc_overflow to also
      test for overflowing args->buffer_count values.
      
      v2: Give the variables again tighter scope to make it clear that the
      computation is purely local and doesn't leak out to the 2nd block.
      Requested by Chris Wilson.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b205ca57
    • D
      drm/i915: Ditch INTELFB_CONN_LIMIT · 955382f3
      Daniel Vetter 提交于
      And the gratious overallocation of crtcs. Seems to go back to the ums
      days of yonder ...
      
      We also still need it to make the fbdev emulation happy, but I don't
      think there's really a need. Especially since the current fbdev
      emulation doesn't actually support cloning.
      
      v2: Use sizeof(*pointer) pattern (Jani).
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      955382f3
    • D
      drm/i915: Use kcalloc more · a1e22653
      Daniel Vetter 提交于
      No buffer overflows here, but better safe than sorry.
      
      v2:
      - Fixup the sizeof conversion, I've missed the pointer deref (Jani).
      - Drop the redundant GFP_ZERO, kcalloc alreads memsets (Jani).
      - Use kmalloc_array for the execbuf fastpath to avoid the memset
        (Chris). I've opted to leave all other conversions as-is since they
        aren't in a fastpath and dealing with cleared memory instead of
        random garbage is just generally nicer.
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      [danvet: Drop the contentious kmalloc_array hunk in execbuf.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a1e22653
    • D
      drm/i915: use pointer = k[cmz...]alloc(sizeof(*pointer), ...) pattern · b14c5679
      Daniel Vetter 提交于
      Done while reviewing all our allocations for fubar. Also a few errant
      cases of lacking () for the sizeof operator - just a bit of OCD.
      
      I've left out all the conversions that also should use kcalloc from
      this patch  (it's only 2).
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b14c5679
  2. 29 9月, 2013 1 次提交
    • Y
      PCI: Workaround missing pci_set_master in pci drivers · f41f064c
      Yinghai Lu 提交于
      Ben Herrenschmidt found that commit 928bea96 ("PCI: Delay enabling
      bridges until they're needed") breaks PCI in some powerpc environments.
      
      The reason is that the PCIe port driver will call pci_enable_device() on
      the bridge, so the device is enabled, but skips pci_set_master because
      pcie_port_auto and no acpi on powerpc.
      
      Because of that, pci_enable_bridge() later on (called as a result of the
      child device driver doing pci_enable_device) will see the bridge as
      already enabled and will not call pci_set_master() on it.
      
      Fixed by add checking in pci_enable_bridge, and call pci_set_master
      if driver skip that.
      
      That will make the code more robot and wade off problem for missing
      pci_set_master in drivers.
      Reported-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f41f064c
  3. 28 9月, 2013 9 次提交
    • J
      i2c: ismt: initialize DMA buffer · bf416910
      James Ralston 提交于
      This patch adds code to initialize the DMA buffer to compensate for
      possible hardware data corruption.
      Signed-off-by: NJames Ralston <james.d.ralston@intel.com>
      [wsa: changed to use 'sizeof']
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      bf416910
    • R
      drm/msm: use drm_gem_dumb_destroy helper · 30600a90
      Rob Clark 提交于
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      30600a90
    • R
      drm/msm: deal with mach/iommu.h removal · 33b55963
      Rob Clark 提交于
      We still need an API exported by msm iommu driver (but not visible in
      any public header anymore).  For now, just declare the prototype
      ourselves, but when msm iommu driver provides a better option, use that
      instead.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      33b55963
    • J
      drm/msm: Remove iommu include from mdp4_kms.c · c55d1c41
      Joerg Roedel 提交于
      The include file has been removed and the file does not
      need it anyway, so remove it. Fixes a compile error.
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      c55d1c41
    • T
      drm/msm: Odd PTR_ERR usage · e4826a94
      Thomas Meyer 提交于
      The variable priv->kms is not initialized yet.
      
      Found by "scripts/coccinelle/tests/odd_ptr_err.cocci".
      PTR_ERR should access the value just tested by IS_ERR.
      Signed-off-by: NThomas Meyer <thomas@m3y3r.de>
      e4826a94
    • C
      i2c: designware: 10-bit addressing mode enabling if I2C_DYNAMIC_TAR_UPDATE is set · bd63ace4
      Chew, Chiau Ee 提交于
      According to Designware I2C spec, if I2C_DYNAMIC_TAR_UPDATE is set to 1,
      the 10-bit addressing mode is controlled by IC_10BITADDR_MASTER bit of
      IC_TAR register instead of IC_CON register. The IC_10BITADDR_MASTER
      in IC_CON register becomes read-only copy. Since I2C_DYNAMIC_TAR_UPDATE
      value can't be detected from hardware register, so we will always set the
      IC_10BITADDR_MASTER bit in both IC_CON and IC_TAR register whenever 10-bit
      addresing mode is requested by user application.
      Signed-off-by: NChew, Chiau Ee <chiau.ee.chew@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      bd63ace4
    • T
      i2c: mv64xxx: Do not use writel_relaxed() · 85b3a935
      Thierry Reding 提交于
      The driver is used on PowerPC which don't provide writel_relaxed(). This
      breaks the c2k and prpmc2800 default configurations. To fix the build,
      turn the calls to writel_relaxed() into writel(). The impacts for ARM
      should be minimal.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      85b3a935
    • T
      i2c: mv64xxx: Fix some build warnings · c1a99467
      Thierry Reding 提交于
      Some functions and variables are only used if the configuration selects
      HAVE_CLK. Protect them with a corresponding #ifdef CONFIG_HAVE_CLK block
      to avoid compiler warnings.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      [wsa: added marker to #endif]
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      c1a99467
    • K
      i2c: s3c2410: fix clk_disable/clk_unprepare WARNings · 15336913
      Kim Phillips 提交于
      commit d16933b3 "i2c: s3c2410: Move
      location of clk_prepare_enable() call in probe function" refactored
      clk_enable and clk_disable calls yet neglected to remove the
      clk_disable_unprepare call in the module's remove().
      
      It helps remove warnings on an arndale during unbind:
      
      echo 12c90000.i2c > /sys/bus/platform/devices/12c90000.i2c/driver/unbind
      
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 2548 at drivers/clk/clk.c:842 clk_disable+0x18/0x24()
      Modules linked in:
      CPU: 0 PID: 2548 Comm: bash Not tainted 3.11.0-next-20130916-00003-gf4bddbc #6
      [<c0014d48>] (unwind_backtrace+0x0/0xf8) from [<c00117d0>] (show_stack+0x10/0x14)
      [<c00117d0>] (show_stack+0x10/0x14) from [<c0361be8>] (dump_stack+0x6c/0xac)
      [<c0361be8>] (dump_stack+0x6c/0xac) from [<c001d864>] (warn_slowpath_common+0x64/0x88)
      [<c001d864>] (warn_slowpath_common+0x64/0x88) from [<c001d8a4>] (warn_slowpath_null+0x1c/0x24)
      [<c001d8a4>] (warn_slowpath_null+0x1c/0x24) from [<c02c4a64>] (clk_disable+0x18/0x24)
      [<c02c4a64>] (clk_disable+0x18/0x24) from [<c028d0b0>] (s3c24xx_i2c_remove+0x28/0x70)
      [<c028d0b0>] (s3c24xx_i2c_remove+0x28/0x70) from [<c0217a10>] (platform_drv_remove+0x18/0x1c)
      [<c0217a10>] (platform_drv_remove+0x18/0x1c) from [<c0216358>] (__device_release_driver+0x58/0xb4)
      [<c0216358>] (__device_release_driver+0x58/0xb4) from [<c02163d0>] (device_release_driver+0x1c/0x28)
      [<c02163d0>] (device_release_driver+0x1c/0x28) from [<c02153c0>] (unbind_store+0x58/0x90)
      [<c02153c0>] (unbind_store+0x58/0x90) from [<c0214c90>] (drv_attr_store+0x20/0x2c)
      [<c0214c90>] (drv_attr_store+0x20/0x2c) from [<c01032c0>] (sysfs_write_file+0x168/0x198)
      [<c01032c0>] (sysfs_write_file+0x168/0x198) from [<c00ae1c0>] (vfs_write+0xb0/0x194)
      [<c00ae1c0>] (vfs_write+0xb0/0x194) from [<c00ae594>] (SyS_write+0x3c/0x70)
      [<c00ae594>] (SyS_write+0x3c/0x70) from [<c000e3e0>] (ret_fast_syscall+0x0/0x30)
      ---[ end trace 4c9f9403066f57a6 ]---
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 2548 at drivers/clk/clk.c:751 clk_unprepare+0x14/0x1c()
      Modules linked in:
      CPU: 0 PID: 2548 Comm: bash Tainted: G        W    3.11.0-next-20130916-00003-gf4bddbc #6
      [<c0014d48>] (unwind_backtrace+0x0/0xf8) from [<c00117d0>] (show_stack+0x10/0x14)
      [<c00117d0>] (show_stack+0x10/0x14) from [<c0361be8>] (dump_stack+0x6c/0xac)
      [<c0361be8>] (dump_stack+0x6c/0xac) from [<c001d864>] (warn_slowpath_common+0x64/0x88)
      [<c001d864>] (warn_slowpath_common+0x64/0x88) from [<c001d8a4>] (warn_slowpath_null+0x1c/0x24)
      [<c001d8a4>] (warn_slowpath_null+0x1c/0x24) from [<c02c5834>] (clk_unprepare+0x14/0x1c)
      [<c02c5834>] (clk_unprepare+0x14/0x1c) from [<c028d0b8>] (s3c24xx_i2c_remove+0x30/0x70)
      [<c028d0b8>] (s3c24xx_i2c_remove+0x30/0x70) from [<c0217a10>] (platform_drv_remove+0x18/0x1c)
      [<c0217a10>] (platform_drv_remove+0x18/0x1c) from [<c0216358>] (__device_release_driver+0x58/0xb4)
      [<c0216358>] (__device_release_driver+0x58/0xb4) from [<c02163d0>] (device_release_driver+0x1c/0x28)
      [<c02163d0>] (device_release_driver+0x1c/0x28) from [<c02153c0>] (unbind_store+0x58/0x90)
      [<c02153c0>] (unbind_store+0x58/0x90) from [<c0214c90>] (drv_attr_store+0x20/0x2c)
      [<c0214c90>] (drv_attr_store+0x20/0x2c) from [<c01032c0>] (sysfs_write_file+0x168/0x198)
      [<c01032c0>] (sysfs_write_file+0x168/0x198) from [<c00ae1c0>] (vfs_write+0xb0/0x194)
      [<c00ae1c0>] (vfs_write+0xb0/0x194) from [<c00ae594>] (SyS_write+0x3c/0x70)
      [<c00ae594>] (SyS_write+0x3c/0x70) from [<c000e3e0>] (ret_fast_syscall+0x0/0x30)
      ---[ end trace 4c9f9403066f57a7 ]---
      Signed-off-by: NKim Phillips <kim.phillips@linaro.org>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      15336913
  4. 27 9月, 2013 11 次提交
  5. 26 9月, 2013 5 次提交