1. 28 1月, 2014 1 次提交
    • J
      drm/i915: move module parameters into a struct, in a new file · d330a953
      Jani Nikula 提交于
      With 20+ module parameters, I think referring to them via a struct
      improves clarity over just having a bunch of globals. While at it, move
      the parameter initialization and definitions into a new file
      i915_params.c to reduce clutter in i915_drv.c.
      
      Apart from the ill-named i915_enable_rc6, i915_enable_fbc and
      i915_enable_ppgtt parameters, for which we lose the "i915_" prefix
      internally, the module parameters now look the same both on the kernel
      command line and in code. For example, "i915.modeset".
      
      The downsides of the change are losing static on a couple of variables
      and not having the initialization and module_param_named() right next to
      each other. On the other hand, all module parameters are now defined in
      one place at i915_params.c. Plus you can do this to find all module
      parameter references:
      
      $ git grep "i915\." -- drivers/gpu/drm/i915
      
      v2:
      - move the definitions into a new file
      - s/i915_params/i915/
      - make i915_try_reset i915.reset, for consistency
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d330a953
  2. 25 1月, 2014 2 次提交
  3. 22 1月, 2014 3 次提交
  4. 18 12月, 2013 2 次提交
    • B
      drm/i915: Use multiple VMs -- the point of no return · 7e0d96bc
      Ben Widawsky 提交于
      As with processes which run on the CPU, the goal of multiple VMs is to
      provide process isolation. Specific to GEN, there is also the ability to
      map more objects per process (2GB each instead of 2Gb-2k total).
      
      For the most part, all the pipes have been laid, and all we need to do
      is remove asserts and actually start changing address spaces with the
      context switch. Since prior to this we've converted the setting of the
      page tables to a streamed version, this is quite easy.
      
      One important thing to point out (since it'd been hotly contested) is
      that with this patch, every context created will have it's own address
      space (provided the HW can do it).
      
      v2: Disable BDW on rebase
      
      NOTE: I tried to make this commit as small as possible. I needed one
      place where I could "turn everything on" and that is here. It could be
      split into finer commits, but I didn't really see much point.
      
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7e0d96bc
    • D
      drm: kill DRIVER_REQUIRE_AGP · 24986ee0
      Daniel Vetter 提交于
      Only the two intel drivers need this and they can easily check for
      working agp support in their driver ->load callbacks.
      
      This is the only reason why agp initialization could fail, so allows
      us to rip out a bit of error handling code in the next patch.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      24986ee0
  5. 17 12月, 2013 1 次提交
  6. 14 12月, 2013 2 次提交
  7. 12 12月, 2013 1 次提交
  8. 11 12月, 2013 2 次提交
    • P
      drm/i915: do adapter power state notification at runtime PM · cd2e9e90
      Paulo Zanoni 提交于
      Now that we are actually setting the device to the D3 state, we should
      issue the notification.
      
      The opregion spec says we should send the message before the adapter
      is about to be placed in a lower power state, and after the adapter is
      placed in a higher power state.
      
      Jani originally wrote a similar patch for PC8, but then we discovered
      that we were not really changing the PCI D states when
      enabling/disabling PC8, so we had to postpone his patch.
      
      v2: - Improve commit message, explaining the expected state.
      
      v3: - Rebase.
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Credits-to: Jani Nikula <jani.nikula@intel.com>
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v2)
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cd2e9e90
    • P
      drm/i915: add initial Runtime PM functions · 8a187455
      Paulo Zanoni 提交于
      This patch adds the initial infrastructure to allow a Runtime PM
      implementation that sets the device to its D3 state. The patch just
      adds the necessary callbacks and the initial infrastructure.
      
      We still don't have any platform that actually uses this
      infrastructure, we still don't call get/put in all the places we need
      to, and we don't have any function to save/restore the state of the
      registers. This is not a problem since no platform uses the code added
      by this patch. We have a few people simultaneously working on runtime
      PM, so this initial code could help everybody make their plans.
      
      V2: - Move some functions to intel_pm.c
          - Remove useless pm_runtime_allow() call at init
          - Remove useless pm_runtime_mark_last_busy() call at get
          - Use pm_runtime_get_sync() instead of 2 calls
          - Add a WARN to check if we're really awake
      
      V3: - Rebase.
      
      V4: - Don't need to call pci_{save,restore}_state and
            pci_set_power_sate, since they're already called by the PCI
            layer
          - Remove wrong pm_runtime_enable() call at init_runtime_pm
      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>
      8a187455
  9. 04 12月, 2013 1 次提交
    • C
      drm/i915: Do not clobber config status after a forced restore of hw state · edd5b133
      Chris Wilson 提交于
      We call intel_modeset_setup_hw_state() along two paths, driver
      load/resume and after a lid event notification. During initialisation of
      the driver, it is imperative that we reset the config state. This
      correctly sets up the initial connector statuses and prepares the
      hardware for a thorough probing. However, during a lid event, we only
      want to undo the damage caused by the bios by resetting our last known
      mode. In this cirumstance, we do not want to clobber our desired state.
      
      In order to try and keep sanity between the config state and our own
      tracking, do the drm_mode_config_reset() first along the load/resume
      paths before reading out the hw state and apply any definite known
      corrections.
      
      v2: "As discussed on irc I don't think we should force the connector
      state to anything here: Imo connector->status should reflect what we
      believe to be the true output connection state, whereas connector->encoder
      reflects whether this connector is wired up to a pipe. And since we no
      longer reject modeset on disconnected connectors and never nuked the pipe
      if the connector gets disconnected there's no reason for that - such policy
      is userspace's job.
      
      This regression has been introduced in
      
      commit 2e938892
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Oct 11 20:08:24 2012 +0200
      
          drm/i915/crt: explicitly set up HOTPLUG_BITS on resume"
      so sayeth Daniel.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: stable@vger.kernel.org (v3.8 and later)
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      edd5b133
  10. 27 11月, 2013 1 次提交
  11. 26 11月, 2013 1 次提交
  12. 25 11月, 2013 1 次提交
  13. 21 11月, 2013 1 次提交
  14. 14 11月, 2013 3 次提交
    • D
      drm/i915: Deprecated UMS support · b30324ad
      Daniel Vetter 提交于
      It's been 5 years since kms support was merged and roughly 4 years
      since UMS support was ripped out from userspace drivers.
      
      Thus far it's not been a big burden to keep the ums paths alive, and
      we've made some good progress in better separating it from the kms
      code by sprinkling DRIVER_MODESET checks all over the place.
      
      But now that the drm demidlayering is within reach this changes. I
      want to make the driver loading code more robust using devres.c and
      other cool tricks. But that doesn't work with ums due to the
      shadow-attach trick. Which means we either
      a) need to split out a complete ums codebase like radeon has
      b) kill it for good.
      
      The 2nd option is obviously much less work than the first, so I think
      it's time to test the waters and see how many people out there still
      use ums.
      
      I've decided that silently failing to initialize the driver (and not
      e.g. failing to load the module) is the right thing. That way we
      should only get reports from users that actually care about some ums
      features (like accelerated gl or support for secondary outputs).
      Everyone else will just fall back to the vesa X driver.
      
      For developers there's a small info level dmesg output.
      
      The plan is to drop this Kconfig option after 3.16 (so gives us 2 full
      releases) and then start killing code for real 2-3 releases
      afterwards. That should be more than enough time for users to pipe up.
      
      Of course if anyone does we need to revisit this plan and maybe go
      with option a) above.
      
      Also enable the KMS support by default in Kconfig and polish the help
      texts a bit.
      
      v2: Add the missing hunk of actual code changes. Oops. (Ville)
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Dave Airlie <airlied@gmail.com>
      Acked-by: NDave Airlie <airlied@gmail.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b30324ad
    • D
      drm/i915: Kill legeacy AGP for gen3 kms · 3bb6ce66
      Daniel Vetter 提交于
      Thus far we've tried to carefully work around the fact that old
      userspace relied on the AGP-backed legacy buffer mapping ioctls for a
      bit too long. But it's really horribly, and now some new users for it
      started to show up again:
      
      http://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg45547.html
      
      This uses drmAgpSize to figure out the GTT size, which is both the
      wrong thing to inquire and also might force us to keep this crap
      around for another few years.
      
      So I want to stop this particular zombie from raising ever again. Now
      it's only been 4 years since XvMC was fixed for gen3, so a bit early
      by the usual rules. But since Linus explicitly said that an ABI
      breakage only counts if someone actually observes it I want to tempt
      fate an accelarate the demise of AGP.
      
      We probably need to wait 2-3 kernel releases with this shipping until
      we go on a killing spree code-wise.
      
      v2: Remove intel_agp_enabled since it's unused (Ville).
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Dave Airlie <airlied@gmail.com>
      Acked-by: NDave Airlie <airlied@gmail.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3bb6ce66
    • D
      drm/i915: Make AGP=n work even on gen3 · ea8eea73
      Daniel Vetter 提交于
      Most platforms din't hit this condition, but if we want to allow
      building without agp we should also make this allowed on gen3.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ea8eea73
  15. 12 11月, 2013 1 次提交
  16. 09 11月, 2013 6 次提交
  17. 07 11月, 2013 1 次提交
  18. 30 10月, 2013 1 次提交
    • I
      drm/i915: rename i915_init_power_well to init_power_domains_init · ddb642fb
      Imre Deak 提交于
      Similarly rename the other related functions in the power domain
      interface.
      
      Higher level driver code calling these functions knows only about power
      domains, not the underlying power wells which may be different on
      different platforms. Also these functions really init/cleanup/resume
      power domains and only through that all related power wells, so rename
      them accordingly.
      
      Note that I left i915_{request,release}_power_well as is, since that
      really changes the state only of a single power well (and is HSW
      specific). It should also get a better name once we make it more
      generic by controlling things through a new audio power domain.
      
      v4:
      - use intel prefix instead of i915 everywhere (Paulo)
      - use a $prefix_$block_$action format (Daniel)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ddb642fb
  19. 28 10月, 2013 1 次提交
    • I
      drm/i915: use power get/put instead of set for power on after init · baa70707
      Imre Deak 提交于
      Currently we make sure that all power domains are enabled during driver
      init and turn off unneded ones only after the first modeset. Similarly
      during suspend we enable all power domains, which will remain on through
      the following resume until the first modeset.
      
      This logic is supported by intel_set_power_well() in the power domain
      framework. It would be nice to simplify the API, so that we only have
      get/put functions and make it more explicit on the higher level how this
      "power well on during init" logic works. This will make it also easier
      if in the future we want to shorten the time the power wells are on.
      
      For this add a new device private flag tracking whether we have the
      power wells on because of init/suspend and use only
      intel_display_power_get()/put(). As nothing else uses
      intel_set_power_well() we can remove it.
      
      This also fixes
      
      commit 6efdf354
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Wed Oct 16 17:25:52 2013 +0300
      
          drm/i915: enable only the needed power domains during modeset
      
      where removing intel_set_power_well() resulted in not releasing the
      reference on the power well that was taken during init and thus leaving
      the power well on all the time. Regression reported by Paulo.
      
      v2:
      - move the init_power_on flag to the power_domains struct (Daniel)
      
      v3:
      - add note about this being a regression fix too (Paulo)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      baa70707
  20. 18 10月, 2013 1 次提交
    • B
      drm/i915: Disable GGTT PTEs on GEN6+ suspend · 828c7908
      Ben Widawsky 提交于
      Once the machine gets to a certain point in the suspend process, we
      expect the GPU to be idle. If it is not, we might corrupt memory.
      Empirically (with an early version of this patch) we have seen this is
      not the case. We cannot currently explain why the latent GPU writes
      occur.
      
      In the technical sense, this patch is a workaround in that we have an
      issue we can't explain, and the patch indirectly solves the issue.
      However, it's really better than a workaround because we understand why
      it works, and it really should be a safe thing to do in all cases.
      
      The noticeable effect other than the debug messages would be an increase
      in the suspend time. I have not measure how expensive it actually is.
      
      I think it would be good to spend further time to root cause why we're
      seeing these latent writes, but it shouldn't preclude preventing the
      fallout.
      
      NOTE: It should be safe (and makes some sense IMO) to also keep the
      VALID bit unset on resume when we clear_range(). I've opted not to do
      this as properly clearing those bits at some later point would be extra
      work.
      
      v2: Fix bugzilla link
      
      Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=65496
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59321Tested-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Tested-By: NTodd Previte <tprevite@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      828c7908
  21. 17 10月, 2013 1 次提交
    • C
      drm/i915: Disable all GEM timers and work on unload · 45c5f202
      Chris Wilson 提交于
      We have two once very similar functions, i915_gpu_idle() and
      i915_gem_idle(). The former is used as the lower level operation to
      flush work on the GPU, whereas the latter is the high level interface to
      flush the GEM bookkeeping in addition to flushing the GPU. As such
      i915_gem_idle() also clears out the request and activity lists and
      cancels the delayed work. This is what we need for unloading the driver,
      unfortunately we called i915_gpu_idle() instead.
      
      In the process, make sure that when cancelling the delayed work and
      timer, which is synchronous, that we do not hold any locks to prevent a
      deadlock if the work item is already waiting upon the mutex. This
      requires us to push the mutex down from the caller to i915_gem_idle().
      
      v2: s/i915_gem_idle/i915_gem_suspend/
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70334Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: xunx.fang@intel.com
      [danvet: Only set ums.suspended for !kms as discussed earlier. Chris
      noticed that this slipped through.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      45c5f202
  22. 16 10月, 2013 2 次提交
    • B
      drm/i915: Replace has_bsd/blt/vebox with a mask · 73ae478c
      Ben Widawsky 提交于
      I've sent this patch several times for various reasons. It essentially
      cleans up a lot of code where we need to do something per ring, and want
      to query whether or not the ring exists on that hardware.
      
      It has various uses coming up, but for now it shouldn't be too
      offensive.
      
      v2: Big conflict resolution on Damien's DEV_INFO_FOR_EACH stuff
      
      v3: Resolved vebox addition
      
      v4: Rebased after months of disuse. Also made failed ringbuffer init
      cleaner.
      
      v5: Remove the init cleaner from v4. There is a better way to do it.
      (Chris)
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      73ae478c
    • B
      drm/i915: Do a fuller init after reset · 3d57e5bd
      Ben Widawsky 提交于
      I had this lying around from he original PPGTT series, and thought we
      might try to get it in by itself.
      
      It's convenient to just call i915_gem_init_hw at reset because we'll be
      adding new things to that function, and having just one function to call
      instead of reimplementing it in two places is nice.
      
      In order to accommodate we cleanup ringbuffers in order to bring them
      back up cleanly. Optionally, we could also teardown/re initialize the
      default context but this was causing some problems on reset which I
      wasn't able to fully debug, and is unnecessary with the previous context
      init/enable split.
      
      This essentially reverts:
      commit 8e88a2bd
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Jun 19 18:40:00 2012 +0200
      
          drm/i915: don't call modeset_init_hw in i915_reset
      
      It seems to work for me on ILK now. Perhaps it's due to:
      commit 8a5c2ae7
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Thu Mar 28 13:57:19 2013 -0700
      
          drm/i915: fix ILK GPU reset for render
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3d57e5bd
  23. 10 10月, 2013 1 次提交
  24. 09 10月, 2013 1 次提交
    • D
      drm: kill ->gem_init_object() and friends · 16eb5f43
      David Herrmann 提交于
      All drivers embed gem-objects into their own buffer objects. There is no
      reason to keep drm_gem_object_alloc(), gem->driver_private and
      ->gem_init_object() anymore.
      
      New drivers are highly encouraged to do the same. There is no benefit in
      allocating gem-objects separately.
      
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Ben Skeggs <skeggsb@gmail.com>
      Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      16eb5f43
  25. 01 10月, 2013 2 次提交