1. 06 5月, 2021 1 次提交
  2. 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
  3. 08 4月, 2021 1 次提交
  4. 24 3月, 2021 3 次提交
    • 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/display: Eliminate most usage of INTEL_GEN() · 005e9537
      Matt Roper 提交于
      Use Coccinelle to convert most of the usage of INTEL_GEN() and IS_GEN()
      in the display code to use DISPLAY_VER() comparisons instead.  The
      following semantic patch was used:
      
              @@ expression dev_priv, E; @@
              - INTEL_GEN(dev_priv) == E
              + IS_DISPLAY_VER(dev_priv, E)
      
              @@ expression dev_priv; @@
              - INTEL_GEN(dev_priv)
              + DISPLAY_VER(dev_priv)
      
              @@ expression dev_priv; expression E; @@
              - IS_GEN(dev_priv, E)
              + IS_DISPLAY_VER(dev_priv, E)
      
              @@
              expression dev_priv;
              expression from, until;
              @@
              - IS_GEN_RANGE(dev_priv, from, until)
              + IS_DISPLAY_RANGE(dev_priv, from, until)
      
      There are still some display-related uses of INTEL_GEN() in intel_pm.c
      (watermark code) and i915_irq.c.  Those will be updated separately.
      
      v2:
       - Use new IS_DISPLAY_RANGE and IS_DISPLAY_VER helpers.  (Jani)
      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-4-matthew.d.roper@intel.com
      005e9537
    • M
      drm/i915/display: Convert gen5/gen6 tests to IS_IRONLAKE/IS_SANDYBRIDGE · d47d29a6
      Matt Roper 提交于
      ILK is the only platform that we consider "gen5" and SNB is the only
      platform we consider "gen6."  Add an IS_SANDYBRIDGE() macro and then
      replace numeric platform tests for these two generations with direct
      platform tests with the following Coccinelle semantic patch:
      
              @@ expression dev_priv; @@
              - IS_GEN(dev_priv, 5)
              + IS_IRONLAKE(dev_priv)
      
              @@ expression dev_priv; @@
              - IS_GEN(dev_priv, 6)
              + IS_SANDYBRIDGE(dev_priv)
      
              @@ expression dev_priv; @@
              - IS_GEN_RANGE(dev_priv, 5, 6)
              + IS_IRONLAKE(dev_priv) || IS_SANDYBRIDGE(dev_priv)
      
      This will simplify our upcoming patches which eliminate INTEL_GEN()
      usage in the display code.
      
      v2:
       - Reverse ilk/snb order for IS_GEN_RANGE conversion.  (Ville)
       - Rebase + regenerate from semantic patch
      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/20210320044245.3920043-2-matthew.d.roper@intel.com
      d47d29a6
  5. 05 2月, 2021 1 次提交
  6. 02 2月, 2021 1 次提交
  7. 05 12月, 2020 1 次提交
  8. 01 12月, 2020 1 次提交
  9. 16 10月, 2020 1 次提交
  10. 14 10月, 2020 1 次提交
  11. 08 10月, 2020 1 次提交
  12. 18 9月, 2020 1 次提交
  13. 24 8月, 2020 1 次提交
  14. 18 8月, 2020 2 次提交
  15. 03 7月, 2020 1 次提交
  16. 08 6月, 2020 1 次提交
  17. 05 6月, 2020 1 次提交
  18. 22 5月, 2020 3 次提交
  19. 19 5月, 2020 3 次提交
    • V
      drm/i915: Read out hrawclk on all gen3+ platforms · 488e0179
      Ville Syrjälä 提交于
      I've checked a bunch of gen3/4 machines and all seem to have
      consistent FSB frequency information in the CLKCFG register.
      So let's read out hrawclk on all gen3+ machines. Although
      apart from g4x/pnv aux/pps dividers we only really need this
      for for i965g/gm cs timestamp increment.
      
      The CLKCFG memory clock values seem less consistent but we
      don't care about those here.
      
      For posterity here's a list of CLKCFG vs. FSB dumps from
      a bunch of machines (only missing lpt for a full set):
      machine CLKCFG     FSB
      alv1    0x00001411 533
      alv2    0x00000420 400 (Chris)
      gdg1    0x20000022 800
      gdg2    0x20000022 800
      cst     0x00010043 666
      blb     0x00002034 1333
      pnv1    0x00000423 666
      pnv2    0x00000433 666
      965gm   0x00004342 800
      946gz   0x00000022 800
      965g    0x00000422 800
      g35     0x00000430 1066
              0x00000434 1333
      ctg1    0x00644056 1066
      ctg2    0x00644066 1066
      elk1    0x00012420 1066
              0x00012424 1333
              0x00012436 1600
              0x00012422 800
      elk2    0x00012040 1066
      
      For the mobile parts the chipset docs generally have these
      documented to some degree (alv being the exception).
      
      The two settings w/o any evidence are 0x5=400MHz on desktop
      and 0x7=1333MHz on mobile. Though the mobile 1333MHz case
      probably doesn't even exist since ctg is only documented
      to go up to 1066MHz.
      
      v2: Fix 400mhz readout for Chris's alv/celeron machine
          Do a clean mobile vs. dekstop split since that's really
          what seems to be going on
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200514123838.3017-3-ville.syrjala@linux.intel.comAcked-by: NChris Wilson <chris@chris-wilson.co.uk>
      488e0179
    • V
      drm/i915: Document our lackluster FSB frequency readout · 42ab3305
      Ville Syrjälä 提交于
      Document the fact that we aren't reading out the actual FSB
      frequency but rather just the state of the FSB straps.
      Some BIOSen allow you to configure the two independently.
      So if someone sets the two up in an inconsistent manner
      we'll get the wrong answer here and thus will end up with
      incorrect aux/pps clock dividers. Alas, proper docs are no
      longer around so we can't do any better.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200514123838.3017-2-ville.syrjala@linux.intel.comReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      42ab3305
    • V
      drm/i915: Fix 400 MHz FSB readout on elk · 6f62bda1
      Ville Syrjälä 提交于
      Looks like elk redefines some of the CLKCFG FSB values to
      make room for 400 MHz FSB. The setting overlaps with one of
      the 266MHz settings (which is even documented in the ctg docs,
      and cofirmed to be correct on my ctg). So we limit the special
      case to elk only.
      
      Though it might also be that we have some kind of desktop vs.
      mobile difference going on here as eg. both g35 and elk
      use 0x0 for the 266 MHz setting, vs. 0x6 used by ctg). The
      g35 doesn't let me select 400MHz for the FSB strap so can't
      confirm which way it would go here. But anyways as it seems
      only elk has the 400MHz option we shouldn't lose anything
      by limiting the special case to it alone.
      
      My earlier experiments on this appear to have been nonsense as
      the comment I added claims that FSB strap of 400MHz results in
      a value of 0x4, but I've now retested it and I definitely get a
      value of 0x6 instead. So let's remove that bogus comment.
      
      v2: s/_ELK/_ALT/ in the define in anticipation of a full
          mobile vs. desktop CLKCFG split
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200514123838.3017-1-ville.syrjala@linux.intel.comAcked-by: NChris Wilson <chris@chris-wilson.co.uk>
      6f62bda1
  20. 10 3月, 2020 1 次提交
  21. 23 2月, 2020 1 次提交
  22. 19 2月, 2020 1 次提交
  23. 12 2月, 2020 1 次提交
  24. 11 2月, 2020 1 次提交
  25. 31 1月, 2020 8 次提交