1. 08 1月, 2014 1 次提交
    • J
      drm/msm: Fix link error with !MSM_IOMMU · 4c071c7b
      Joerg Roedel 提交于
      The DRM driver for MSM depends on symbols from the MSM
      IOMMU driver. Add this dependency to the Kconfig file.
      
      Fixes this comile error:
      
        Kernel: arch/arm/boot/zImage is ready
        ERROR: "msm_iommu_get_ctx" [drivers/gpu/drm/msm/msm.ko]
        undefined!
        make[2]: *** [__modpost] Error 1
      
      Cc: Rob Clark <robdclark@gmail.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      4c071c7b
  2. 31 12月, 2013 1 次提交
    • R
      ACPIPHP / radeon / nouveau: Fix VGA switcheroo problem related to hotplug · f244d8b6
      Rafael J. Wysocki 提交于
      The changes in the ACPI-based PCI hotplug (ACPIPHP) subsystem made
      during the 3.12 development cycle uncovered a problem with VGA
      switcheroo that on some systems, when the device-specific method
      (ATPX in the radeon case, _DSM in the nouveau case) is used to turn
      off the discrete graphics, the BIOS generates ACPI hotplug events for
      that device and those events cause ACPIPHP to attempt to remove the
      device from the system (they are events for a device that was present
      previously and is not present any more, so that's what should be done
      according to the spec).  Then, the system stops functioning correctly.
      
      Since the hotplug events in question were simply silently ignored
      previously, the least intrusive way to address that problem is to
      make ACPIPHP ignore them again.  For this purpose, introduce a new
      ACPI device flag, no_hotplug, and modify ACPIPHP to ignore hotplug
      events for PCI devices whose ACPI companions have that flag set.
      Next, make the radeon and nouveau switcheroo detection code set the
      no_hotplug flag for the discrete graphics' ACPI companion.
      
      Fixes: bbd34fcd (ACPI / hotplug / PCI: Register all devices under the given bridge)
      References: https://bugzilla.kernel.org/show_bug.cgi?id=61891
      References: https://bugzilla.kernel.org/show_bug.cgi?id=64891Reported-and-tested-by: NMike Lothian <mike@fireburn.co.uk>
      Reported-and-tested-by: <madcatx@atlas.cz>
      Reported-and-tested-by: NJoaquín Aramendía <samsagax@gmail.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Dave Airlie <airlied@linux.ie>
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: 3.12+ <stable@vger.kernel.org> # 3.12+
      f244d8b6
  3. 24 12月, 2013 3 次提交
  4. 23 12月, 2013 5 次提交
  5. 20 12月, 2013 1 次提交
  6. 18 12月, 2013 1 次提交
  7. 17 12月, 2013 5 次提交
  8. 16 12月, 2013 2 次提交
    • I
      drm/nouveau: only runtime suspend by default in optimus configuration · b25b4427
      Ilia Mirkin 提交于
      The intent was to only enable it by default for optimus, e.g. see the
      runtime_idle callback. The suspend callback may be called directly, e.g.
      as a result of nouveau_crtc_set_config.
      Reported-by: NStefan Lippers-Hollmann <s.l-h@gmx.de>
      Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
      Tested-by: NStefan Lippers-Hollmann <s.l-h@gmx.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b25b4427
    • S
      radeon_pm: fix oops in hwmon_attributes_visible() and radeon_hwmon_show_temp_thresh() · e4158f1b
      Sergey Senozhatsky 提交于
      Since commit ec39f64b ("drm/radeon/dpm: Convert to use
      devm_hwmon_register_with_groups") radeon_hwmon_init() is using
      hwmon_device_register_with_groups(), which sets `rdev' as a device
      private driver_data, while hwmon_attributes_visible() and
      radeon_hwmon_show_temp_thresh() are still waiting for `drm_device'.
      
      Fix them by using dev_get_drvdata(), in order to avoid this oops:
      
        BUG: unable to handle kernel paging request at 0000000000001e28
        IP: [<ffffffffa02ae8b4>] hwmon_attributes_visible+0x18/0x3d [radeon]
        PGD 15057e067 PUD 151a8e067 PMD 0
        Oops: 0000 [#1] PREEMPT SMP
        Call Trace:
          internal_create_group+0x114/0x1d9
          sysfs_create_group+0xe/0x10
          sysfs_create_groups+0x22/0x5f
          device_add+0x34f/0x501
          device_register+0x15/0x18
          hwmon_device_register_with_groups+0xb5/0xed
          radeon_hwmon_init+0x56/0x7c [radeon]
          radeon_pm_init+0x134/0x7e5 [radeon]
          radeon_modeset_init+0x75f/0x8ed [radeon]
          radeon_driver_load_kms+0xc6/0x187 [radeon]
          drm_dev_register+0xf9/0x1b4 [drm]
          drm_get_pci_dev+0x98/0x129 [drm]
          radeon_pci_probe+0xa3/0xac [radeon]
          pci_device_probe+0x6e/0xcf
          driver_probe_device+0x98/0x1c4
          __driver_attach+0x5c/0x7e
          bus_for_each_dev+0x7b/0x85
          driver_attach+0x19/0x1b
          bus_add_driver+0x104/0x1ce
          driver_register+0x89/0xc5
          __pci_register_driver+0x58/0x5b
          drm_pci_init+0x86/0xea [drm]
          radeon_init+0x97/0x1000 [radeon]
          do_one_initcall+0x7f/0x117
          load_module+0x1583/0x1bb4
          SyS_init_module+0xa0/0xaf
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Alexander Deucher <Alexander.Deucher@amd.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e4158f1b
  9. 14 12月, 2013 2 次提交
    • P
      drm/i915: get a PC8 reference when enabling the power well · be3d26b0
      Paulo Zanoni 提交于
      In the current code, at haswell_modeset_global_resources, first we
      decide if we want to enable/disable the power well, then we decide if
      we want to enable/disable PC8. On the case where we're enabling PC8
      this works fine, but on the case where we disable PC8 due to a non-eDP
      monitor being enabled, we first enable the power well and then disable
      PC8. Although wrong, this doesn't seem to be causing any problems now,
      and we don't even see anything in dmesg. But the patches for runtime
      D3 turn this problem into a real bug, so we need to fix it.
      
      This fixes the "modeset-non-lpsp" subtest from the "pm_pc8" test from
      intel-gpu-tools.
      
      v2: - Rebase (i915_disable_power_well).
      v3: - More reabase.
      v4: - Rebase on top of -fixes instead of -nightly.
      
      This is commit d62292c8 in -next, but
      we need it in -fixes to address Dave's report.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Reported-by: NDave Jones <davej@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      be3d26b0
    • P
      drm/i915: change CRTC assertion on LCPLL disable · 96b40268
      Paulo Zanoni 提交于
      Currently, PC8 is enabled at modeset_global_resources, which is called
      after intel_modeset_update_state. Due to this, there's a small race
      condition on the case where we start enabling PC8, then do a modeset
      while PC8 is still being enabled. The racing condition triggers a WARN
      because intel_modeset_update_state will mark the CRTC as enabled, then
      the thread that's still enabling PC8 might look at the data structure
      and think that PC8 is being enabled while a pipe is enabled. Despite
      the WARN, this is not really a bug since we'll wait for the
      PC8-enabling thread to finish when we call modeset_global_resources.
      
      The spec says the CRTC cannot be enabled when we disable LCPLL, so we
      had a check for crtc->base.enabled. If we change to crtc->active we
      will still prevent disabling LCPLL while the CRTC is enabled, and we
      will also prevent the WARN above.
      
      This is a replacement for the previous patch named
          "drm/i915: get/put PC8 when we get/put a CRTC"
      
      Testcase: igt/pm_pc8/modeset-lpsp-stress-no-wait
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      (cherry picked from commit 798183c5
      from -next due to Dave's report.)
      Reported-by: NDave Jones <davej@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      96b40268
  10. 13 12月, 2013 6 次提交
  11. 12 12月, 2013 3 次提交
    • A
      drm/radeon: Fix sideport problems on certain RS690 boards · 8333f0fe
      Alex Deucher 提交于
      Some RS690 boards with 64MB of sideport memory show up as
      having 128MB sideport + 256MB of UMA.  In this case,
      just skip the sideport memory and use UMA.  This fixes
      rendering corruption and should improve performance.
      
      bug:
      https://bugs.freedesktop.org/show_bug.cgi?id=35457Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      8333f0fe
    • C
      drm/i915: Fix erroneous dereference of batch_obj inside reset_status · 4db080f9
      Chris Wilson 提交于
      As the rings may be processed and their requests deallocated in a
      different order to the natural retirement during a reset,
      
      /* Whilst this request exists, batch_obj will be on the
       * active_list, and so will hold the active reference. Only when this
       * request is retired will the the batch_obj be moved onto the
       * inactive_list and lose its active reference. Hence we do not need
       * to explicitly hold another reference here.
       */
      
      is violated, and the batch_obj may be dereferenced after it had been
      freed on another ring. This can be simply avoided by processing the
      status update prior to deallocating any requests.
      
      Fixes regression (a possible OOPS following a GPU hang) from
      commit aa60c664
      Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Date:   Wed Jun 12 15:13:20 2013 +0300
      
          drm/i915: find guilty batch buffer on ring resets
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      [danvet: Add the code comment Chris supplied.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4db080f9
    • C
      drm/i915: Prevent double unref following alloc failure during execbuffer · 9ae9ab52
      Chris Wilson 提交于
      Whilst looking up the objects required for an execbuffer, an untimely
      allocation failure in creating the vma results in the object being
      unreferenced from two lists. The ownership during the lookup is meant to
      be moved from the list of objects being looked to the vma, and this
      double unreference upon error results in a use-after-free.
      
      Fixes regression from
      commit 27173f1f
      Author: Ben Widawsky <ben@bwidawsk.net>
      Date:   Wed Aug 14 11:38:36 2013 +0200
      
          drm/i915: Convert execbuf code to use vmas
      
      Based on the fix by Ben Widawsky.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: stable@vger.kernel.org
      [danvet: Bikeshed the crucial comment above the ownership transfer as
      discussed on irc.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9ae9ab52
  12. 11 12月, 2013 5 次提交
  13. 10 12月, 2013 1 次提交
  14. 09 12月, 2013 1 次提交
  15. 06 12月, 2013 2 次提交
    • D
      drm/i915: Fix use-after-free in do_switch · acc240d4
      Daniel Vetter 提交于
      So apparently under ridiculous amounts of memory pressure we can get
      into trouble in do_switch when we try to move the old hw context
      backing storage object onto the active lists.
      
      With list debugging enabled that usually results in us chasing a
      poisoned pointer - which means we've hit upon a vma that has been
      removed from all lrus with list_del (and then deallocated, so it's a
      real use-after free).
      
      Ian Lister has done some great callchain chasing and noticed that we
      can reenter do_switch:
      
      i915_gem_do_execbuffer()
      
      i915_switch_context()
      
      do_switch()
         from = ring->last_context;
         i915_gem_object_pin()
      
            i915_gem_object_bind_to_gtt()
               ret = drm_mm_insert_node_in_range_generic();
               // If the above call fails then it will try i915_gem_evict_something()
               // If that fails it will call i915_gem_evict_everything() ...
      	 i915_gem_evict_everything()
      	    i915_gpu_idle()
      	       i915_switch_context(DEFAULT_CONTEXT)
      
      Like with everything else where the shrinker or eviction code can
      invalidate pointers we need to reload relevant state.
      
      Note that there's no need to recheck whether a context switch is still
      required because:
      
      - Doing a switch to the same context is harmless (besides wasting a
        bit of energy).
      
      - This can only happen with the default context. But since that one's
        pinned we'll never call down into evict_everything under normal
        circumstances. Note that there's a little driver bringup fun
        involved namely that we could recourse into do_switch for the
        initial switch. Atm we're fine since we assign the context pointer
        only after the call to do_switch at driver load or resume time. And
        in the gpu reset case we skip the entire setup sequence (which might
        be a bug on its own, but definitely not this one here).
      
      Cc'ing stable since apparently ChromeOS guys are seeing this in the
      wild (and not just on artificial stress tests), see the reference.
      
      Note that in upstream code doesn't calle evict_everything directly
      from evict_something, that's an extension in this product branch. But
      we can still hit upon this bug (and apparently we do, see the linked
      backtraces). I've noticed this while trying to construct a testcase
      for this bug and utterly failed to provoke it. It looks like we need
      to driver the system squarly into the lowmem wall and provoke the
      shrinker to evict the context object by doing the last-ditch
      evict_everything call.
      
      Aside: There's currently no means to get a badly-fragmenting hw
      context object away from a bad spot in the upstream code. We should
      fix this by at least adding some code to evict_something to handle hw
      contexts.
      
      References: https://code.google.com/p/chromium/issues/detail?id=248191Reported-by: NIan Lister <ian.lister@intel.com>
      Cc: Ian Lister <ian.lister@intel.com>
      Cc: stable@vger.kernel.org
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Cc: Stéphane Marchesin <marcheu@chromium.org>
      Cc: Bloomfield, Jon <jon.bloomfield@intel.com>
      Tested-by: NRafael Barbalho <rafael.barbalho@intel.com>
      Reviewed-by: NIan Lister <ian.lister@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      acc240d4
    • D
      drm/i915: fix pm init ordering · f742a552
      Daniel Vetter 提交于
      Shovel a bit more of the the code into the setup function, and call
      it earlier. Otherwise lockdep is unhappy since we cancel the delayed
      resume work before it's initialized.
      
      While at it also shovel the pc8 setup code into the same functions.
      I wanted to also ditch the header declaration of the hws pc8 functions,
      but for unfathomable reasons that stuff is in intel_display.c instead
      of intel_pm.c.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71980Tested-by: NGuo Jinxian <jinxianx.guo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f742a552
  16. 05 12月, 2013 1 次提交