1. 21 4月, 2021 5 次提交
  2. 20 4月, 2021 1 次提交
    • J
      drm/i915/pm: Make the wm parameter of print_wm_latency a pointer · c6deb5e9
      Jason Ekstrand 提交于
      This fixes the following build error with GCC 11:
      
          In function ‘snb_wm_latency_quirk’,
              inlined from ‘ilk_setup_wm_latency’ at drivers/gpu/drm/i915/intel_pm.c:3109:3,
              inlined from ‘intel_init_pm’ at drivers/gpu/drm/i915/intel_pm.c:7695:3:
          drivers/gpu/drm/i915/intel_pm.c:3058:9: error: ‘intel_print_wm_latency’ reading 16 bytes from a region of size 10 [-Werror=stringop-overread]
           3058 |         intel_print_wm_latency(dev_priv, "Primary", dev_priv->wm.pri_latency);
                |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          drivers/gpu/drm/i915/intel_pm.c: In function ‘intel_init_pm’:
          drivers/gpu/drm/i915/intel_pm.c:3058:9: note: referencing argument 3 of type ‘const u16 *’ {aka ‘const short unsigned int *’}
          drivers/gpu/drm/i915/intel_pm.c:2995:13: note: in a call to function ‘intel_print_wm_latency’
           2995 | static void intel_print_wm_latency(struct drm_i915_private *dev_priv,
                |             ^~~~~~~~~~~~~~~~~~~~~~
      
      As far as I can tell, we don't actually need 8 elements except on SKL
      and that uses dev_priv->wm.skl_latency which has enough.
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210413173259.472405-1-jason@jlekstrand.netSigned-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      c6deb5e9
  3. 14 4月, 2021 2 次提交
    • L
      drm/i915/display: rename display version macros · 93e7e61e
      Lucas De Marchi 提交于
      While converting the rest of the driver to use GRAPHICS_VER() and
      MEDIA_VER(), following what was done for display, some discussions went
      back on what we did for display:
      
      	1) Why is the == comparison special that deserves a separate
      	macro instead of just getting the version and comparing directly
      	like is done for >, >=, <=?
      
      	2) IS_DISPLAY_RANGE() is weird in that it omits the "_VER" for
      	brevity. If we remove the current users of IS_DISPLAY_VER(), we
      	could actually repurpose it for a range check
      
      With (1) there could be an advantage if we used gen_mask since multiple
      conditionals be combined by the compiler in a single and instruction and
      check the result. However a) INTEL_GEN() doesn't use the mask since it
      would make the code bigger everywhere else and b) in the cases it made
      sense, it also made sense to convert to the _RANGE() variant.
      
      So here we repurpose IS_DISPLAY_VER() to work with a [ from, to ] range
      like was the IS_DISPLAY_RANGE() and convert the current IS_DISPLAY_VER()
      users to use == and != operators. Aside from the definition changes,
      this was done by the following semantic patch:
      
      	@@ expression dev_priv, E1; @@
      	- !IS_DISPLAY_VER(dev_priv, E1)
      	+ DISPLAY_VER(dev_priv) != E1
      
      	@@ expression dev_priv, E1; @@
      	- IS_DISPLAY_VER(dev_priv, E1)
      	+ DISPLAY_VER(dev_priv) == E1
      
      	@@ expression dev_priv, from, until; @@
      	- IS_DISPLAY_RANGE(dev_priv, from, until)
      	+ IS_DISPLAY_VER(dev_priv, from, until)
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NLucas De Marchi <lucas.demarchi@intel.com>
      [Jani: Minor conflict resolve while applying.]
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20210413051002.92589-4-lucas.demarchi@intel.com
      93e7e61e
    • M
      drm/i915/display: Eliminate IS_GEN9_{BC,LP} · 2446e1d6
      Matt Roper 提交于
      Now that we've eliminated INTEL_GEN(), IS_GEN_RANGE(), etc. from the
      display code, we should also kill off our use of the IS_GEN9_* macros
      too.  We'll do the conversion manually this time instead of using
      Coccinelle since the most logical substitution can depend heavily on the
      code context, and sometimes we can keep the code simpler if we make
      additional adjustments such as swapping the order of if/else arms.
      
      v2:
       - Restore a lost negation in intel_pll_is_valid().
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NRadhakrishna Sripada <radhakrishna.sripada@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210407203945.1432531-1-matthew.d.roper@intel.com
      (cherry picked from commit 70bfb307)
      [Jani: cherry picked to topic branch to reduce conflicts]
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      2446e1d6
  4. 13 4月, 2021 1 次提交
  5. 09 4月, 2021 1 次提交
  6. 08 4月, 2021 1 次提交
  7. 29 3月, 2021 2 次提交
  8. 26 3月, 2021 1 次提交
  9. 24 3月, 2021 2 次提交
    • M
      drm/i915/display: Simplify GLK display version tests · 2b5a4562
      Matt Roper 提交于
      GLK has always been a bit of a special case since it reports INTEL_GEN()
      as 9, but has version 10 display IP.  Now we can properly represent the
      display version as 10 and simplify the display generation tests
      throughout the display code.
      
      Aside from manually adding the version to the glk_info structure, the
      rest of this patch is generated with a Coccinelle semantic patch.  Note
      that we also need to switch any code that matches gen10 today but *not*
      GLK to be CNL-specific:
      
              @@ expression dev_priv; @@
              - DISPLAY_VER(dev_priv) > 9
              + DISPLAY_VER(dev_priv) >= 10
      
              @@ expression dev_priv, E; @@
              (
              - DISPLAY_VER(dev_priv) >= 10 && E
              + (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) && E
              |
              - DISPLAY_VER(dev_priv) >= 10
              + DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)
              |
              - IS_DISPLAY_RANGE(dev_priv, 10, E)
              + IS_DISPLAY_RANGE(dev_priv, 11, E) || IS_CANNONLAKE(dev_priv)
              )
      
              @@ expression dev_priv, E, E2; @@
              (
              - (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv))
              + IS_DISPLAY_VER(dev_priv, 10)
              |
              - E || IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)
              + E || IS_DISPLAY_VER(dev_priv, 10)
              |
              - (IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv))
              + IS_DISPLAY_VER(dev_priv, 10)
              |
              - IS_GEMINILAKE(dev_priv) || E || IS_CANNONLAKE(dev_priv)
              + E || IS_DISPLAY_VER(dev_priv, 10)
              |
              - E || IS_GEMINILAKE(dev_priv) || E2 || IS_CANNONLAKE(dev_priv)
              + E || E2 || IS_DISPLAY_VER(dev_priv, 10)
              |
              - (IS_DISPLAY_VER(dev_priv, 10) || IS_GEMINILAKE(dev_priv))
              + IS_DISPLAY_VER(dev_priv, 10)
              |
              - (IS_GEMINILAKE(dev_priv) || IS_DISPLAY_VER(dev_priv, 10))
              + IS_DISPLAY_VER(dev_priv, 10)
              )
      
              @@ expression dev_priv; @@
              - (IS_DISPLAY_VER(dev_priv, 9) && !IS_GEMINILAKE(dev_priv))
              + IS_DISPLAY_VER(dev_priv, 9)
      
              @@ expression dev_priv; @@
              (
              - !(DISPLAY_VER(dev_priv) >= 11 || IS_DISPLAY_VER(dev_priv, 10))
              + DISPLAY_VER(dev_priv) < 10
              |
              - (DISPLAY_VER(dev_priv) >= 11 || IS_DISPLAY_VER(dev_priv, 10))
              + DISPLAY_VER(dev_priv) >= 10
              )
      
              @@ expression dev_priv, E; @@
              - E || DISPLAY_VER(dev_priv) >= 11 || IS_DISPLAY_VER(dev_priv, 10)
              + E || DISPLAY_VER(dev_priv) >= 10
      
              @@ expression dev_priv, E; @@
              - (IS_DISPLAY_RANGE(dev_priv, 11, E) || IS_DISPLAY_VER(dev_priv, 10))
              + IS_DISPLAY_RANGE(dev_priv, 10, E)
      
              @@ expression dev_priv; @@
              (
              - DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv) || IS_GEN9_LP(dev_priv)
              + DISPLAY_VER(dev_priv) >= 10 || IS_GEN9_LP(dev_priv)
              |
              - IS_GEN9_LP(dev_priv) || DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)
              + IS_GEN9_LP(dev_priv) || DISPLAY_VER(dev_priv) >= 10
              )
      
              @@ expression dev_priv, E; @@
              - !(DISPLAY_VER(dev_priv) >= E)
              + DISPLAY_VER(dev_priv) < E
      
      v2:
       - Convert gen10 conditions that don't include GLK into CNL conditions.
         (Ville)
      
      v3:
       - Rework coccinelle rules so that "ver>=10" turns into "ver>=11||is_cnl." (Ville)
      
      v3.1:
       - Manually re-add the ".display.version = 10" to glk_info after
         regenerating patch via Coccinelle.
      
      v4:
       - Also apply cocci rules to intel_pm.c and i915_irq.c!  (CI)
      
      Cc: Ville Syrjälä <ville.syrjala@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210322233840.4056851-1-matthew.d.roper@intel.com
      2b5a4562
    • M
      drm/i915: Convert INTEL_GEN() to DISPLAY_VER() as appropriate in intel_pm.c · 7dadd286
      Matt Roper 提交于
      Although most of the code in this file is display-related (watermarks),
      there's some functions that are not (e.g., clock gating).  Thus we need
      to do the conversions to DISPLAY_VER() manually here rather than using
      Coccinelle.
      
      In the near-future we'll probably want to think about moving watermark
      logic out of intel_pm.c and into watermark-specific files under the
      display/ directory.
      
      v2:
       - Use new IS_DISPLAY_VER macro where appropriate.
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210320044245.3920043-5-matthew.d.roper@intel.com
      7dadd286
  10. 13 3月, 2021 6 次提交
  11. 03 3月, 2021 6 次提交
  12. 18 2月, 2021 1 次提交
  13. 08 2月, 2021 1 次提交
  14. 29 1月, 2021 1 次提交
  15. 26 1月, 2021 8 次提交
  16. 21 1月, 2021 1 次提交