1. 04 4月, 2020 5 次提交
  2. 28 3月, 2020 4 次提交
  3. 26 3月, 2020 3 次提交
  4. 20 3月, 2020 1 次提交
    • V
      drm/i915: Fix crtc nv12 etc. plane bitmasks for DPMS off · cb1824bb
      Ville Syrjälä 提交于
      We only consider crtc_state->enable when initially calculating plane
      visibility. Later on we try to override the plane's state to invisible
      if the crtc is in DPMS off state (crtc_state->active==false).
      Unfortunately the code doing that only updates the plane_state.visible
      flag and the crtc_state.active_planes bimask, but forgets to update
      some of the other plane bitmasks stored in the crtc_state. Namely
      crtc_state.nv12_planes is left set up based on the original visibility
      check which makes icl_check_nv12_planes() pick a slave plane for the
      flagged plane in the bitmask. Later on we hit the watermark code
      which sees a plane with a slave assigned and it then makes the
      logical assumption that the master plane must itself be visible.
      Since the master's plane_state.visible flag was already cleared
      we get a WARN.
      
      Fix the problem by clearing all the plane bitmasks for DPMS off.
      This is more or less the wrong approach and instead we should
      calculate all the plane related state purely based crtc_state->enable
      (to guarantee that the subsequent DPMS on can't fail). However in
      the past we definitely had some roadblocks to making that happen.
      Not sure how many are left these days, but let's stick to the current
      approach since it's a much simpler fix to the immediate problem
      (the WARN).
      
      v2: Keep the visible=false, it's important (Rodrigo)
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200318174515.31637-1-ville.syrjala@linux.intel.comReviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      cb1824bb
  5. 03 3月, 2020 3 次提交
  6. 02 3月, 2020 1 次提交
  7. 28 2月, 2020 2 次提交
  8. 27 2月, 2020 1 次提交
  9. 26 2月, 2020 5 次提交
  10. 23 2月, 2020 2 次提交
    • P
      drm/i915/display/display: Make WARN* drm specific where drm_device ptr is available · e57291c2
      Pankaj Bharadiya 提交于
      drm specific WARN* calls include device information in the
      backtrace, so we know what device the warnings originate from.
      
      Covert all the calls of WARN* with device specific drm_WARN*
      variants in functions where drm_device or drm_i915_private struct
      pointer is readily available.
      
      The conversion was done automatically with below coccinelle semantic
      patch. checkpatch errors/warnings are fixed manually.
      
      @rule1@
      identifier func, T;
      @@
      func(...) {
      ...
      struct drm_device *T = ...;
      <...
      (
      -WARN(
      +drm_WARN(T,
      ...)
      |
      -WARN_ON(
      +drm_WARN_ON(T,
      ...)
      |
      -WARN_ONCE(
      +drm_WARN_ONCE(T,
      ...)
      |
      -WARN_ON_ONCE(
      +drm_WARN_ON_ONCE(T,
      ...)
      )
      ...>
      }
      
      @rule2@
      identifier func, T;
      @@
      func(struct drm_device *T,...) {
      <...
      (
      -WARN(
      +drm_WARN(T,
      ...)
      |
      -WARN_ON(
      +drm_WARN_ON(T,
      ...)
      |
      -WARN_ONCE(
      +drm_WARN_ONCE(T,
      ...)
      |
      -WARN_ON_ONCE(
      +drm_WARN_ON_ONCE(T,
      ...)
      )
      ...>
      }
      
      @rule3@
      identifier func, T;
      @@
      func(...) {
      ...
      struct drm_i915_private *T = ...;
      <+...
      (
      -WARN(
      +drm_WARN(&T->drm,
      ...)
      |
      -WARN_ON(
      +drm_WARN_ON(&T->drm,
      ...)
      |
      -WARN_ONCE(
      +drm_WARN_ONCE(&T->drm,
      ...)
      |
      -WARN_ON_ONCE(
      +drm_WARN_ON_ONCE(&T->drm,
      ...)
      )
      ...+>
      }
      
      @rule4@
      identifier func, T;
      @@
      func(struct drm_i915_private *T,...) {
      <+...
      (
      -WARN(
      +drm_WARN(&T->drm,
      ...)
      |
      -WARN_ON(
      +drm_WARN_ON(&T->drm,
      ...)
      |
      -WARN_ONCE(
      +drm_WARN_ONCE(&T->drm,
      ...)
      |
      -WARN_ON_ONCE(
      +drm_WARN_ON_ONCE(&T->drm,
      ...)
      )
      ...+>
      }
      Signed-off-by: NPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200220165507.16823-4-pankaj.laxminarayan.bharadiya@intel.com
      e57291c2
    • K
      drm/i915: Distribute switch variables for initialization · 2713eb41
      Kees Cook 提交于
      Variables declared in a switch statement before any case statements
      cannot be automatically initialized with compiler instrumentation (as
      they are not part of any execution flow). With GCC's proposed automatic
      stack variable initialization feature, this triggers a warning (and they
      don't get initialized). Clang's automatic stack variable initialization
      (via CONFIG_INIT_STACK_ALL=y) doesn't throw a warning, but it also
      doesn't initialize such variables[1]. Note that these warnings (or silent
      skipping) happen before the dead-store elimination optimization phase,
      so even when the automatic initializations are later elided in favor of
      direct initializations, the warnings remain.
      
      To avoid these problems, move such variables into the "case" where
      they're used or lift them up into the main function body.
      
      drivers/gpu/drm/i915/display/intel_display.c: In function ‘check_digital_port_conflicts’:
      drivers/gpu/drm/i915/display/intel_display.c:12963:17: warning: statement will never be executed [-Wswitch-unreachable]
      12963 |    unsigned int port_mask;
            |                 ^~~~~~~~~
      
      drivers/gpu/drm/i915/intel_pm.c: In function ‘vlv_get_fifo_size’:
      drivers/gpu/drm/i915/intel_pm.c:474:7: warning: statement will never be executed [-Wswitch-unreachable]
        474 |   u32 dsparb, dsparb2, dsparb3;
            |       ^~~~~~
      drivers/gpu/drm/i915/intel_pm.c: In function ‘vlv_atomic_update_fifo’:
      drivers/gpu/drm/i915/intel_pm.c:1997:7: warning: statement will never be executed [-Wswitch-unreachable]
       1997 |   u32 dsparb, dsparb2, dsparb3;
            |       ^~~~~~
      
      [1] https://bugs.llvm.org/show_bug.cgi?id=44916Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/202002201602.92CADF7D@keescook
      2713eb41
  11. 21 2月, 2020 1 次提交
  12. 20 2月, 2020 3 次提交
  13. 19 2月, 2020 1 次提交
  14. 16 2月, 2020 2 次提交
  15. 12 2月, 2020 1 次提交
  16. 10 2月, 2020 2 次提交
  17. 06 2月, 2020 3 次提交
    • S
      drm/i915: Manipulate DBuf slices properly · 0f0f9aee
      Stanislav Lisovskiy 提交于
      Start manipulating DBuf slices as a mask,
      but not as a total number, as current approach
      doesn't give us full control on all combinations
      of slices, which we might need(like enabling S2
      only can't enabled by setting enabled_slices=1).
      
      Removed wrong code from intel_get_ddb_size as
      it doesn't match to BSpec. For now still just
      use DBuf slice until proper algorithm is implemented.
      
      Other minor code refactoring to get prepared
      for major DBuf assignment changes landed:
      - As now enabled slices contain a mask
        we still need some value which should
        reflect how much DBuf slices are supported
        by the platform, now device info contains
        num_supported_dbuf_slices.
      - Removed unneeded assertion as we are now
        manipulating slices in a more proper way.
      
      v2: Start using enabled_slices in dev_priv
      
      v3: "enabled_slices" is now "enabled_dbuf_slices_mask",
          as this now sits in dev_priv independently.
      
      v4: - Fixed debug print formatting to hex(Matt Roper)
          - Optimized dbuf slice updates to be used only
            if slice union is different from current conf(Matt Roper)
          - Fixed some functions to be static(Matt Roper)
          - Created a parameterized version for DBUF_CTL to
            simplify DBuf programming cycle(Matt Roper)
          - Removed unrequred field from GEN10_FEATURES(Matt Roper)
      
      v5: - Removed redundant programming dbuf slices helper(Ville Syrjälä)
          - Started to use parameterized loop for hw readout to get slices
            (Ville Syrjälä)
          - Added back assertion checking amount of DBUF slices enabled
            after DC states 5/6 transition, also added new assertion
            as starting from ICL DMC seems to restore the last DBuf
            power state set, rather than power up all dbuf slices
            as assertion was previously expecting(Ville Syrjälä)
      
      v6: - Now using enum for DBuf slices in this patch (Ville Syrjälä)
          - Removed gen11_assert_dbuf_enabled and put gen9_assert_dbuf_enabled
            back, as we really need to have a single unified assert here
            however currently enabling always slice 1 is enforced by BSpec,
            so we will have to OR enabled slices mask with 1 in order
            to be consistent with BSpec, that way we can unify that
            assertion and against the actual state from the driver, but
            not some hardcoded value.(concluded with Ville)
          - Remove parameterized DBUF_CTL version, to extract it to another
            patch.(Ville Syrjälä)
      v7:
          - Removed unneeded hardcoded return value for older gens from
            intel_enabled_dbuf_slices_mask - this now is handled in a
            unified manner since device info anyway returns max dbuf slices
            as 1 for older platforms(Matthew Roper)
          - Now using INTEL_INFO(dev_priv)->num_supported_dbuf_slices instead
            of intel_dbuf_max_slices function as it is trivial(Matthew Roper)
      
      v8: - Fixed icl_dbuf_disable to disable all dbufs still(Ville Syrjälä)
      
      v9: - Renamed _DBUF_CTL_S to DBUF_CTL_S(Ville Syrjälä)
          - Now using power_domain mutex to protect from race condition, which
            can occur because intel_dbuf_slices_update might be running in
            parallel to gen9_dc_off_power_well_enable being called from
            intel_dp_detect for instance, which causes assertion triggered by
            race condition, as gen9_assert_dbuf_enabled might preempt this
            when registers were already updated, while dev_priv was not.
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200202230630.8975-6-stanislav.lisovskiy@intel.com
      0f0f9aee
    • S
      drm/i915: Update dbuf slices only with full modeset · 85487cf4
      Stanislav Lisovskiy 提交于
      During full modeset, global state(i.e dev_priv) is protected
      by locking the crtcs in state, otherwise global state is not
      serialized. Also if it is not a full modeset, we anyway
      don't need to change DBuf slice configuration as Pipe configuration
      doesn't change.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200202230630.8975-4-stanislav.lisovskiy@intel.com
      85487cf4
    • S
      drm/i915: Move dbuf slice update to proper place · b06cf595
      Stanislav Lisovskiy 提交于
      Current DBuf slices update wasn't done in proper
      place, especially its "post" part, which should
      disable those only once vblank had passed and
      all other changes are committed.
      
      v2: Fix to use dev_priv and intel_atomic_state
          instead of skl_ddb_values
          (to be nuked in Villes patch)
      
      v3: Renamed "enabled_slices" to "enabled_dbuf_slices_num"
          (Matt Roper)
      
      v4: - Rebase against drm-tip.
          - Move post_update closer to optimize_watermarks,
            to prevent unneeded noise from underrun reporting
            (Ville Syrjälä)
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200202230630.8975-3-stanislav.lisovskiy@intel.com
      b06cf595