1. 14 10月, 2016 2 次提交
  2. 07 9月, 2016 1 次提交
    • L
      drm/i915/skl: Don't try to update plane watermarks if they haven't changed · ccebc23b
      Lyude 提交于
      i915 sometimes needs to disable planes in the middle of an atomic
      commit, and then reenable them later in the same commit. Because of
      this, we can't make the assumption that the state of the plane actually
      changed. Since the state of the plane hasn't actually changed, neither
      have it's watermarks. And if the watermarks hasn't changed then we
      haven't populated skl_results with anything, which means we'll end up
      zeroing out a plane's watermarks in the middle of the atomic commit
      without restoring them later.
      
      Simple reproduction recipe:
       - Get a SKL laptop, launch any kind of X session
       - Get two extra monitors
       - Keep hotplugging both displays (so that the display configuration
         jumps from 1 active pipe to 3 active pipes and back)
       - Eventually underrun
      
      Changes since v1:
       - Fix incorrect use of "it's"
      Changes since v2:
       - Add reproduction recipe
      Signed-off-by: NLyude <cpaul@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Fixes: 62e0fb88 ("drm/i915/skl: Update plane watermarks atomically during plane updates")
      Signed-off-by: NLyude <cpaul@redhat.com>
      Testcase: kms_plane
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1472488288-27280-1-git-send-email-cpaul@redhat.com
      Cc: drm-intel-fixes@lists.freedesktop.org
      ccebc23b
  3. 23 8月, 2016 1 次提交
    • L
      drm/i915/skl: Update plane watermarks atomically during plane updates · 62e0fb88
      Lyude 提交于
      Thanks to Ville for suggesting this as a potential solution to pipe
      underruns on Skylake.
      
      On Skylake all of the registers for configuring planes, including the
      registers for configuring their watermarks, are double buffered. New
      values written to them won't take effect until said registers are
      "armed", which is done by writing to the PLANE_SURF (or in the case of
      cursor planes, the CURBASE register) register.
      
      With this in mind, up until now we've been updating watermarks on skl
      like this:
      
        non-modeset {
         - calculate (during atomic check phase)
         - finish_atomic_commit:
           - intel_pre_plane_update:
              - intel_update_watermarks()
           - {vblank happens; new watermarks + old plane values => underrun }
           - drm_atomic_helper_commit_planes_on_crtc:
              - start vblank evasion
              - write new plane registers
              - end vblank evasion
        }
      
        or
      
        modeset {
         - calculate (during atomic check phase)
         - finish_atomic_commit:
           - crtc_enable:
              - intel_update_watermarks()
           - {vblank happens; new watermarks + old plane values => underrun }
           - drm_atomic_helper_commit_planes_on_crtc:
              - start vblank evasion
              - write new plane registers
              - end vblank evasion
        }
      
      Now we update watermarks atomically like this:
      
        non-modeset {
         - calculate (during atomic check phase)
         - finish_atomic_commit:
           - intel_pre_plane_update:
              - intel_update_watermarks() (wm values aren't written yet)
           - drm_atomic_helper_commit_planes_on_crtc:
              - start vblank evasion
              - write new plane registers
              - write new wm values
              - end vblank evasion
        }
      
        modeset {
         - calculate (during atomic check phase)
         - finish_atomic_commit:
           - crtc_enable:
              - intel_update_watermarks() (actual wm values aren't written
                yet)
           - drm_atomic_helper_commit_planes_on_crtc:
              - start vblank evasion
              - write new plane registers
      	- write new wm values
              - end vblank evasion
        }
      
      So this patch moves all of the watermark writes into the right place;
      inside of the vblank evasion where we update all of the registers for
      each plane. While this patch doesn't fix everything, it does allow us to
      update the watermark values in the way the hardware expects us to.
      
      Changes since original patch series:
       - Remove mutex_lock/mutex_unlock since they don't do anything and we're
         not touching global state
       - Move skl_write_cursor_wm/skl_write_plane_wm functions into
         intel_pm.c, make externally visible
       - Add skl_write_plane_wm calls to skl_update_plane
       - Fix conditional for for loop in skl_write_plane_wm (level < max_level
         should be level <= max_level)
       - Make diagram in commit more accurate to what's actually happening
       - Add Fixes:
      
      Changes since v1:
       - Use IS_GEN9() instead of IS_SKYLAKE() since these fixes apply to more
         then just Skylake
       - Update description to make it clear this patch doesn't fix everything
       - Check if pipes were actually changed before writing watermarks
      
      Changes since v2:
       - Write PIPE_WM_LINETIME during vblank evasion
      
      Changes since v3:
       - Rebase against new SAGV patch changes
      
      Changes since v4:
       - Add a parameter to choose what skl_wm_values struct to use when
         writing new plane watermarks
      
      Changes since v5:
       - Remove cursor ddb entry write in skl_write_cursor_wm(), defer until
         patch 6
       - Write WM_LINETIME in intel_begin_crtc_commit()
      
      Changes since v6:
       - Remove redundant dirty_pipes check in skl_write_plane_wm (we check
         this in all places where we call this function, and it was supposed
         to have been removed earlier anyway)
       - In i9xx_update_cursor(), use dev_priv->info.gen >= 9 instead of
         IS_GEN9(dev_priv). We do this everywhere else and I'd imagine this
         needs to be done for gen10 as well
      
      Changes since v7:
       - Fix rebase fail (unused variable obj)
       - Make struct skl_wm_values *wm const
       - Fix indenting
       - Use INTEL_GEN() instead of dev_priv->info.gen
      
      Changes since v8:
       - Don't forget calls to skl_write_plane_wm() when disabling planes
       - Use INTEL_GEN(), not INTEL_INFO()->gen in intel_begin_crtc_commit()
      
      Fixes: 2d41c0b5 ("drm/i915/skl: SKL Watermark Computation")
      Signed-off-by: NLyude <cpaul@redhat.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Cc: stable@vger.kernel.org
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1471884608-10671-1-git-send-email-cpaul@redhat.com
      Link: http://patchwork.freedesktop.org/patch/msgid/1471884608-10671-1-git-send-email-cpaul@redhat.com
      62e0fb88
  4. 11 8月, 2016 6 次提交
  5. 09 8月, 2016 3 次提交
  6. 05 8月, 2016 2 次提交
  7. 03 8月, 2016 1 次提交
  8. 04 7月, 2016 1 次提交
  9. 16 6月, 2016 1 次提交
  10. 30 5月, 2016 1 次提交
  11. 19 5月, 2016 2 次提交
  12. 13 5月, 2016 1 次提交
  13. 02 4月, 2016 1 次提交
  14. 01 3月, 2016 2 次提交
  15. 29 1月, 2016 2 次提交
  16. 14 1月, 2016 4 次提交
  17. 07 1月, 2016 2 次提交
  18. 11 12月, 2015 1 次提交
    • V
      drm: Pass 'name' to drm_universal_plane_init() · b0b3b795
      Ville Syrjälä 提交于
      Done with coccinelle for the most part. It choked on
      msm/mdp/mdp5/mdp5_plane.c like so:
      "BAD:!!!!!  enum drm_plane_type type;"
      No idea how to deal with that, so I just fixed that up
      by hand.
      
      Also it thinks '...' is part of the semantic patch, so I put an
      'int DOTDOTDOT' placeholder in its place and got rid of it with
      sed afterwards.
      
      I didn't convert drm_plane_init() since passing the varargs through
      would mean either cpp macros or va_list, and I figured we don't
      care about these legacy functions enough to warrant the extra pain.
      
      @@
      typedef uint32_t;
      identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
      @@
       int drm_universal_plane_init(struct drm_device *dev,
                                    struct drm_plane *plane,
                                    unsigned long possible_crtcs,
                                    const struct drm_plane_funcs *funcs,
                                    const uint32_t *formats,
                                    unsigned int format_count,
                                    enum drm_plane_type type
      +                             ,const char *name, int DOTDOTDOT
                                    )
      { ... }
      
      @@
      identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
      @@
       int drm_universal_plane_init(struct drm_device *dev,
                                    struct drm_plane *plane,
                                    unsigned long possible_crtcs,
                                    const struct drm_plane_funcs *funcs,
                                    const uint32_t *formats,
                                    unsigned int format_count,
                                    enum drm_plane_type type
      +                             ,const char *name, int DOTDOTDOT
                                    );
      
      @@
      expression E1, E2, E3, E4, E5, E6, E7;
      @@
       drm_universal_plane_init(E1, E2, E3, E4, E5, E6, E7
      +                         ,NULL
                                )
      
      v2: Split crtc and plane changes apart
          Pass NUL for no-name instead of ""
          Leave drm_plane_init() alone
      v3: Add ', or NULL...' to @name kernel doc (Jani)
          Annotate the function with __printf() attribute (Jani)
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449670795-2853-1-git-send-email-ville.syrjala@linux.intel.com
      b0b3b795
  19. 10 12月, 2015 1 次提交
  20. 24 11月, 2015 1 次提交
  21. 10 11月, 2015 1 次提交
  22. 22 10月, 2015 1 次提交
  23. 19 10月, 2015 1 次提交
  24. 16 10月, 2015 1 次提交