1. 27 1月, 2015 1 次提交
  2. 13 1月, 2015 6 次提交
    • V
      drm/i915: Don't register HDMI connectors for eDP ports on VLV/CHV · d2182a66
      Ville Syrjälä 提交于
      If we determine that a specific port is eDP, don't register the HDMI
      connector/encoder for it. The reason being that we want to disable
      HPD interrupts for eDP ports when the display is off, but the presence
      of the extra HDMI connector would demand the HPD interrupt to remain
      enabled all the time.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d2182a66
    • M
      drm/i915: Drop unused position fields (v2) · 53a366b9
      Matt Roper 提交于
      The userspace-requested plane coordinates are now always available via
      plane->state.base (and the i915-adjusted values are stored in
      plane->state), so we no longer use the coordinate fields in intel_plane
      and can drop them.
      
      Also, note that the error case for pageflip calls update_plane() to
      program the values from plane->state; it's simpler to just call
      intel_plane_restore() which does the same thing.
      
      v2: Replace manual update_plane() with intel_plane_restore() in pageflip
          error handler.
      
      Reviewed-by(v1): Bob Paauwe <bob.j.paauwe@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      53a366b9
    • M
      drm/i915: Move to atomic plane helpers (v9) · ea2c67bb
      Matt Roper 提交于
      Switch plane handling to use the atomic plane helpers.  This means that
      rather than provide our own implementations of .update_plane() and
      .disable_plane(), we expose the lower-level check/prepare/commit/cleanup
      entrypoints and let the DRM core implement update/disable for us using
      those entrypoints.
      
      The other main change that falls out of this patch is that our
      drm_plane's will now always have a valid plane->state that contains the
      relevant plane state (initial state is allocated at plane creation).
      The base drm_plane_state pointed to holds the requested source/dest
      coordinates, and the subclassed intel_plane_state holds the adjusted
      values that our driver actually uses.
      
      v2:
       - Renamed file from intel_atomic.c to intel_atomic_plane.c (Daniel)
       - Fix a copy/paste comment mistake (Bob)
      
      v3:
       - Use prepare/cleanup functions that we've already factored out
       - Use newly refactored pre_commit/commit/post_commit to avoid sleeping
         during vblank evasion
      
      v4:
       - Rebase to latest di-nightly requires adding an 'old_state' parameter
         to atomic_update;
      
      v5:
       - Must have botched a rebase somewhere and lost some work.  Restore
         state 'dirty' flag to let begin/end code know which planes to
         run the pre_commit/post_commit hooks for.  This would have actually
         shown up as broken in the next commit rather than this one.
      
      v6:
       - Squash kerneldoc patch into this one.
       - Previous patches have now already taken care of most of the
         infrastructure that used to be in this patch.  All we're adding here
         now is some thin wrappers.
      
      v7:
       - Check return of intel_plane_duplicate_state() for allocation
         failures.
      
      v8:
       - Drop unused drm_plane_state -> intel_plane_state cast.  (Ander)
       - Squash in actual transition to plane helpers.  Significant
         refactoring earlier in the patchset has made the combined
         prep+transition much easier to swallow than it was in earlier
         iterations. (Ander)
      
      v9:
       - s/track_fbs/disabled_planes/ in the atomic crtc flags.  The only fb's
         we need to update frontbuffer tracking for are those on a plane about
         to be disabled (since the atomic helpers never call prepare_fb() when
         disabling a plane), so the new name more accurately describes what
         we're actually tracking.
      
      Testcase: igt/kms_plane
      Testcase: igt/kms_universal_plane
      Testcase: igt/kms_cursor_crc
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ea2c67bb
    • M
      drm/i915: Clarify sprite plane function names (v4) · 4a3b8769
      Matt Roper 提交于
      A few of the sprite-related function names in i915 are very similar
      (e.g., intel_enable_planes() vs intel_crtc_enable_planes()) and don't
      make it clear whether they only operate on sprite planes, or whether
      they also apply to all universal plane types.  Rename a few functions to
      be more consistent with our function naming for primary/cursor planes or
      to clarify that they apply specifically to sprite planes:
      
       - s/intel_disable_planes/intel_disable_sprite_planes/
       - s/intel_enable_planes/intel_enable_sprite_planes/
      
      Also, drop the sprite-specific intel_destroy_plane() and just use
      the type-agnostic intel_plane_destroy() function.  The extra 'disable'
      call that intel_destroy_plane() did is unnecessary since the plane will
      already be disabled due to framebuffer destruction by the point it gets
      called.
      
      v2: Earlier consolidation patches have reduced the number of functions
          we need to rename here.
      
      v3: Also rename intel_plane_funcs vtable to intel_sprite_plane_funcs
          for consistency with primary/cursor.  (Ander)
      
      v4: Convert comment for intel_plane_destroy() to kerneldoc now that it
          is no longer a static function.  (Ander)
      
      Reviewed-by(v1): Bob Paauwe <bob.j.paauwe@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4a3b8769
    • M
      drm/i915: Move vblank evasion to commit (v4) · c34c9ee4
      Matt Roper 提交于
      Move the vblank evasion up from the low-level, hw-specific
      update_plane() handlers to the general plane commit operation.
      Everything inside commit should now be non-sleeping, so this brings us
      closer to how vblank evasion will behave once we move over to atomic.
      
      v2:
       - Restore lost intel_crtc->active check on vblank evasion
      
      v3:
       - Replace assert_pipe_enabled() in intel_disable_primary_hw_plane()
         with an intel_crtc->active test; it turns out assert_pipe_enabled()
         grabs some mutexes and can sleep, which we can't do with interrupts
         disabled.
      
      v4:
       - Equivalent to v2; v3 change is now squashed into an earlier patch
         of the series.  (Ander).
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c34c9ee4
    • M
      drm/i915: Refactor work that can sleep out of commit (v7) · 32b7eeec
      Matt Roper 提交于
      Once we integrate our work into the atomic pipeline, plane commit
      operations will need to happen with interrupts disabled, due to vblank
      evasion.  Our commit functions today include sleepable work, so those
      operations need to be split out and run either before or after the
      atomic register programming.
      
      The solution here calculates which of those operations will need to be
      performed during the 'check' phase and sets flags in an intel_crtc
      sub-struct.  New intel_begin_crtc_commit() and
      intel_finish_crtc_commit() functions are added before and after the
      actual register programming; these will eventually be called from the
      atomic plane helper's .atomic_begin() and .atomic_end() entrypoints.
      
      v2: Fix broken sprite code split
      
      v3: Make the pre/post commit work crtc-based to match how we eventually
          want this to be called from the atomic plane helpers.
      
      v4: Some platforms that haven't had their watermark code reworked were
          waiting for vblank, then calling update_sprite_watermarks in their
          platform-specific disable code.  These also need to be flagged out
          of the critical section.
      
      v5: Sprite plane test for primary show/hide should just set the flag to
          wait for pending flips, not actually perform the wait.  (Ander)
      
      v6:
       - Rebase onto latest di-nightly; picks up an important runtime PM fix.
       - Handle 'wait_for_flips' flag in intel_begin_crtc_commit(). (Ander)
       - Use wait_for_flips flag for primary plane update rather than
         performing the wait in the check routine.
       - Added kerneldoc to pre_disable/post_enable functions that are no
         longer static.  (Ander)
       - Replace assert_pipe_enabled() in intel_disable_primary_hw_plane()
         with an intel_crtc->active test; it turns out assert_pipe_enabled()
         grabs some mutexes and can sleep, which we can't do with interrupts
         disabled.
      
      v7:
       - Check for fb != NULL when deciding whether the sprite plane hides the
         primary plane during a sprite update.  (PRTS)
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      32b7eeec
  3. 12 1月, 2015 1 次提交
  4. 08 1月, 2015 1 次提交
    • D
      drm/i915: Push vblank enable/disable past encoder->enable/disable · f9b61ff6
      Daniel Vetter 提交于
      It is platform/output depenedent when exactly the pipe will start
      running. Sometimes we just need the (cpu) pipe enabled, in other cases
      the pch transcoder is enough and in yet other cases the (DP) port is
      sending the frame start signal.
      
      In a perfect world we'd put the drm_crtc_vblank_on call exactly where
      the pipe starts running, but due to cloning and similar things this
      will get messy. And the current approach of picking the most
      conservative place for all combinations also doesn't work since that
      results in legit vblank waits (in encoder->enable hooks, e.g. the 2
      vblank waits for sdvo) failing.
      
      Completely going back to the old world before
      
      commit 51e31d49
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Mon Sep 15 12:36:02 2014 +0200
      
          drm/i915: Use generic vblank wait
      
      isn't great either since screaming when the vblank wait work because
      the pipe is off is kinda nice.
      
      Pick a compromise and move the drm_crtc_vblank_on right before the
      encoder->enable call. This is a lie on some outputs/platforms, but
      after the ->enable callback the pipe is guaranteed to run everywhere.
      So not that bad really. Suggested by Ville.
      
      v2: Same treatment for drm_crtc_vblank_off and encoder->disable: I've
      missed the ibx pipe B select w/a, which also has a vblank wait in the
      disable function (while the pipe is obviously still running).
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      f9b61ff6
  5. 18 12月, 2014 2 次提交
    • V
      Revert "drm/i915: Preserve VGACNTR bits from the BIOS" · 01f5a626
      Ville Syrjälä 提交于
      The VGA_2X_MODE bit apparently affects the display even when the VGA
      plane is disabled. The bit will set by the BIOS when the panel width
      is at least 1280 pixels. So by preserving the bit from the BIOS we
      end up with corrupted display on machines with such high res panels.
      I only have 1024x768 panels on my gen2 machines so never ran into
      this problem.
      
      The original reason for preserving the VGACNTR register was to make
      my 830 survive S3 with acpi_sleep=s3_bios option. However after
      further 830 fixes that option is no longer needed to make S3 work
      and preserving VGACNTR doesn't seem to be necessary without it,
      so we can just revert the entire patch.
      
      This reverts
      commit 69769f9a
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Fri Aug 15 01:22:08 2014 +0300
      
          drm/i915: Preserve VGACNTR bits from the BIOS
      
      Cc: Bruno Prémont <bonbons@linux-vserver.org>
      Cc: stable@vger.kernel.org
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87171Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      01f5a626
    • M
      drm/i915: Hold runtime PM during plane commit · 140fd38d
      Matt Roper 提交于
      During plane operations, we read/write some registers that only operate
      properly if we're not runtime suspended.  At the moment we're not
      holding the runtime PM reference across the whole plane operation, so
      there's a potential for problems.
      
      This issue was already partially addressed by commit
      
              commit d6dd6843
              Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
              Date:   Fri Aug 15 15:59:32 2014 -0300
      
                  drm/i915: fix plane/cursor handling when runtime suspended
      
      which took care of holding the runtime PM reference during the pin and
      fence operations for plane updates.  However there are still a few
      actual plane registers that we also need to hold the runtime PM
      reference for.  Recent refactoring patches in preparation for atomic
      have rearranged the code and made it increasingly likely that the
      hardware will have time to suspend between the pin/fence operation and
      the actual register writes. Examples of such registers are the stuff
      touched by ivb_get_colorkey.
      
      The solution here grabs the runtime PM reference around the 'commit'
      operation for planes, which should cover all the relevant register
      reads/writes.
      
      Note that this has only been exposed with
      
      commit 6beb8c23
      Author: Matt Roper <matthew.d.roper@intel.com>
      Date:   Mon Dec 1 15:40:14 2014 -0800
      
          drm/i915: Consolidate plane 'prepare' functions (v2)
      
      so doesn't need to be ported to 3.19.
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87180Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Testcase: igt/pm-rpm/legacy-planes
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Augment commit message with information Paulo supplied.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      140fd38d
  6. 16 12月, 2014 1 次提交
    • R
      drm/i915: tame the chattermouth (v2) · e2c719b7
      Rob Clark 提交于
      Many distro's have mechanism in place to collect and automatically file
      bugs for failed WARN()s.  And since i915 has a lot of hw state sanity
      checks which result in WARN(), it generates quite a lot of noise which
      is somewhat disconcerting to the end user.
      
      Separate out the internal hw-is-in-the-state-I-expected checks into
      I915_STATE_WARN()s and allow configuration via i915.verbose_checks module
      param about whether this will generate a full blown stacktrace or just
      DRM_ERROR().  The new moduleparam defaults to true, so by default there
      is no change in behavior.  And even when disabled, you will still get
      an error message logged.
      
      v2: paint the macro names blue, clarify that the default behavior
          remains the same as before
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Acked-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e2c719b7
  7. 15 12月, 2014 1 次提交
    • D
      drm/i915: Use BUILD_BUG if possible in the i915 WARN_ON · 5f77eeb0
      Daniel Vetter 提交于
      Faster feedback to errors is always better. This is inspired by the
      addition to WARN_ONs to mask/enable helpers for registers to make sure
      callers have the arguments ordered correctly: Pretty much always the
      arguments are static.
      
      We use WARN_ON(1) a lot in default switch statements though where we
      should always handle all cases. So add a new macro specifically for
      that.
      
      The idea to use __builtin_constant_p is from Chris Wilson.
      
      v2: Use the ({}) gcc-ism to avoid the static inline, suggested by
      Dave. My first attempt used __cond as the temp var, which is the same
      used by BUILD_BUG_ON, but with inverted sense. Hilarity ensued, so
      sprinkle i915 into the name.
      
      Also use a temporary variable to only evaluate the condition once,
      suggested by Damien.
      
      v3: It's crazy but apparently 32bit gcc can't compile out the
      BUILD_BUG_ON in a lot of cases and just falls over. I have no idea
      why, but until clue grows just disable this nifty idea on 32bit
      builds. Reported by 0-day builder.
      
      v4: Got it all wrong, apparently its the gcc version. We need 4.9+.
      Now reported by Imre.
      
      v5: Chris suggested to add the case to MISSING_CASE for speedier
      debug.
      
      v6: Even some gcc 4.9 versions don't see through the maze, so give up
      for now. Keep the skeleton and MISSING_CASE stuff though.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      5f77eeb0
  8. 11 12月, 2014 1 次提交
  9. 08 12月, 2014 1 次提交
  10. 06 12月, 2014 11 次提交
  11. 05 12月, 2014 1 次提交
  12. 03 12月, 2014 13 次提交