1. 27 Feb, 2020 4 commits
  2. 26 Feb, 2020 11 commits
  3. 25 Feb, 2020 10 commits
  4. 24 Feb, 2020 7 commits
  5. 23 Feb, 2020 8 commits
    • Pankaj Bharadiya's avatar
      drm/i915/display/hdcp: Make WARN* drm specific where drm_priv ptr is available · bb393dc5
      Pankaj Bharadiya authored
      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_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_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,
      ...)
      )
      ...+>
      }
      
      @rule2@
      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: default avatarPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200220165507.16823-7-pankaj.laxminarayan.bharadiya@intel.com
      bb393dc5
    • Pankaj Bharadiya's avatar
      drm/i915/display/dp: Make WARN* drm specific where drm_device ptr is available · eb020ca3
      Pankaj Bharadiya authored
      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: default avatarPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200220165507.16823-6-pankaj.laxminarayan.bharadiya@intel.com
      eb020ca3
    • Pankaj Bharadiya's avatar
      drm/i915/display/power: Make WARN* drm specific where drm_priv ptr is available · a66d7c1e
      Pankaj Bharadiya authored
      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_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_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,
      ...)
      )
      ...+>
      }
      
      @rule2@
      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: default avatarPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200220165507.16823-5-pankaj.laxminarayan.bharadiya@intel.com
      a66d7c1e
    • Pankaj Bharadiya's avatar
      drm/i915/display/display: Make WARN* drm specific where drm_device ptr is available · e57291c2
      Pankaj Bharadiya authored
      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: default avatarPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200220165507.16823-4-pankaj.laxminarayan.bharadiya@intel.com
      e57291c2
    • Pankaj Bharadiya's avatar
      drm/i915/display/ddi: Make WARN* drm specific where drm_device ptr is available · 1de143cc
      Pankaj Bharadiya authored
      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: default avatarPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200220165507.16823-3-pankaj.laxminarayan.bharadiya@intel.com
      1de143cc
    • Pankaj Bharadiya's avatar
      drm/i915/display/cdclk: Make WARN* drm specific where drm_priv ptr is available · aff35110
      Pankaj Bharadiya authored
      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_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_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,
      ...)
      )
      ...+>
      }
      
      @rule2@
      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: default avatarPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200220165507.16823-2-pankaj.laxminarayan.bharadiya@intel.com
      aff35110
    • Kees Cook's avatar
      drm/i915: Distribute switch variables for initialization · 2713eb41
      Kees Cook authored
      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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/202002201602.92CADF7D@keescook
      2713eb41
    • Jani Nikula's avatar
      drm/i915: make dbuf configurations const · f8226d02
      Jani Nikula authored
      Ensure const data goes to rodata.
      
      Fixes: ff2cd863 ("drm/i915: Correctly map DBUF slices to pipes")
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200219154542.19574-1-jani.nikula@intel.com
      f8226d02