1. 19 2月, 2022 1 次提交
  2. 17 2月, 2022 1 次提交
  3. 11 2月, 2022 1 次提交
  4. 02 2月, 2022 1 次提交
    • M
      drm/i915: Only include i915_reg.h from .c files · ce2fce25
      Matt Roper 提交于
      Several of our i915 header files, have been including i915_reg.h.  This
      means that any change to i915_reg.h will trigger a full rebuild of
      pretty much every file of the driver, even those that don't have any
      kind of register access.  Let's delete the i915_reg.h include from all
      headers and add an explicit include from the .c files that truly
      need the register definitions; those that need a definition of
      i915_reg_t for a function definition can get it from i915_reg_defs.h
      instead.
      
      We also remove two non-register #define's (VLV_DISPLAY_BASE and
      GEN12_SFC_DONE_MAX) into i915_reg_defs.h to allow us to drop the
      i915_reg.h include from a couple of headers.
      
      There's probably a lot more header dependency optimization possible, but
      the changes here roughly cut the number of files compiled after 'touch
      i915_reg.h' in half --- a good first step.
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      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/20220127234334.4016964-7-matthew.d.roper@intel.com
      ce2fce25
  5. 13 1月, 2022 1 次提交
  6. 01 12月, 2021 1 次提交
    • T
      drm/i915: Use per device iommu check · cca08469
      Tvrtko Ursulin 提交于
      With both integrated and discrete Intel GPUs in a system, the current
      global check of intel_iommu_gfx_mapped, as done from intel_vtd_active()
      may not be completely accurate.
      
      In this patch we add i915 parameter to intel_vtd_active() in order to
      prepare it for multiple GPUs and we also change the check away from Intel
      specific intel_iommu_gfx_mapped (global exported by the Intel IOMMU
      driver) to probing the presence of IOMMU on a specific device using
      device_iommu_mapped().
      
      This will return true both for IOMMU pass-through and address translation
      modes which matches the current behaviour. If in the future we wanted to
      distinguish between these two modes we could either use
      iommu_get_domain_for_dev() and check for __IOMMU_DOMAIN_PAGING bit
      indicating address translation, or ask for a new API to be exported from
      the IOMMU core code.
      
      v2:
        * Check for dmar translation specifically, not just iommu domain. (Baolu)
      
      v3:
       * Go back to plain "any domain" check for now, rewrite commit message.
      
      v4:
       * Use device_iommu_mapped. (Robin, Baolu)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Lu Baolu <baolu.lu@linux.intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      Reviewed-by: NLu Baolu <baolu.lu@linux.intel.com>
      Reviewed-by: NLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211126141424.493753-1-tvrtko.ursulin@linux.intel.com
      cca08469
  7. 09 11月, 2021 1 次提交
  8. 05 11月, 2021 1 次提交
  9. 14 10月, 2021 1 次提交
  10. 21 9月, 2021 1 次提交
  11. 16 9月, 2021 1 次提交
  12. 27 7月, 2021 1 次提交
    • S
      drm/i915: Implement PSF GV point support · 192fbfb7
      Stanislav Lisovskiy 提交于
      PSF GV points are an additional factor that can limit the
      bandwidth available to display, separate from the traditional
      QGV points.  Whereas traditional QGV points represent possible
      memory clock frequencies, PSF GV points reflect possible
      frequencies of the memory fabric.
      
      Switching between PSF GV points has the advantage of incurring
      almost no memory access block time and thus does not need to be
      accounted for in watermark calculations.
      
      This patch adds support for those on top of regular QGV points.
      Those are supposed to be used simultaneously, i.e we are always
      at some QGV and some PSF GV point, based on the current video
      mode requirements.
      Bspec: 64631, 53998
      
      v2: Seems that initial assumption made during ml conversation
          was wrong, PCode rejects any masks containing points beyond
          the ones returned, so even though BSpec says we have around
          8 points theoretically, we can mask/unmask only those which
          are returned, trying to manipulate those beyond causes a
          failure from PCode. So switched back to generating mask
          from 1 - num_qgv_points, where num_qgv_points is the actual
          amount of points, advertised by PCode.
      
      v3: - Extended restricted qgv point mask to 0xf, as we have now
            3:2 bits for PSF GV points(Matt Roper)
          - Replaced val2 with NULL from PCode request, since its not being
            used(Matt Roper)
          - Replaced %d to 0x%x for better readability(thanks for spotting)
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210531064845.4389-2-stanislav.lisovskiy@intel.com
      192fbfb7
  13. 23 7月, 2021 1 次提交
  14. 10 7月, 2021 1 次提交
  15. 26 5月, 2021 1 次提交
  16. 20 5月, 2021 1 次提交
  17. 13 5月, 2021 1 次提交
  18. 21 4月, 2021 1 次提交
  19. 14 4月, 2021 1 次提交
    • 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
  20. 24 3月, 2021 1 次提交
  21. 05 2月, 2021 1 次提交
  22. 01 2月, 2021 1 次提交
  23. 29 1月, 2021 1 次提交
  24. 05 6月, 2020 1 次提交
  25. 22 5月, 2020 2 次提交
    • S
      drm/i915: Fix includes and local vars order · cac91e67
      Stanislav Lisovskiy 提交于
      Removed duplicate include and fixed comment > 80 chars.
      
      v2: Added newline after system include and between functions
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200522131843.20477-1-stanislav.lisovskiy@intel.com
      cac91e67
    • S
      drm/i915: Adjust CDCLK accordingly to our DBuf bw needs · cd191546
      Stanislav Lisovskiy 提交于
      According to BSpec max BW per slice is calculated using formula
      Max BW = CDCLK * 64. Currently when calculating min CDCLK we
      account only per plane requirements, however in order to avoid
      FIFO underruns we need to estimate accumulated BW consumed by
      all planes(ddb entries basically) residing on that particular
      DBuf slice. This will allow us to put CDCLK lower and save power
      when we don't need that much bandwidth or gain additional
      performance once plane consumption grows.
      
      v2: - Fix long line warning
          - Limited new DBuf bw checks to only gens >= 11
      
      v3: - Lets track used Dbuf bw per slice and per crtc in bw state
            (or may be in DBuf state in future), that way we don't need
            to have all crtcs in state and those only if we detect if
            are actually going to change cdclk, just same way as we
            do with other stuff, i.e intel_atomic_serialize_global_state
            and co. Just as per Ville's paradigm.
          - Made dbuf bw calculation procedure look nicer by introducing
            for_each_dbuf_slice_in_mask - we often will now need to iterate
            slices using mask.
          - According to experimental results CDCLK * 64 accounts for
            overall bandwidth across all dbufs, not per dbuf.
      
      v4: - Fixed missing const(Ville)
          - Removed spurious whitespaces(Ville)
          - Fixed local variable init(reduced scope where not needed)
          - Added some comments about data rate for planar formats
          - Changed struct intel_crtc_bw to intel_dbuf_bw
          - Moved dbuf bw calculation to intel_compute_min_cdclk(Ville)
      
      v5: - Removed unneeded macro
      
      v6: - Prevent too frequent CDCLK switching back and forth:
            Always switch to higher CDCLK when needed to prevent bandwidth
            issues, however don't switch to lower CDCLK earlier than once
            in 30 minutes in order to prevent constant modeset blinking.
            We could of course not switch back at all, however this is
            bad from power consumption point of view.
      
      v7: - Fixed to track cdclk using bw_state, modeset will be now
            triggered only when CDCLK change is really needed.
      
      v8: - Lock global state if bw_state->min_cdclk is changed.
          - Try getting bw_state only if there are crtcs in the commit
            (need to have read-locked global state)
      
      v9: - Do not do Dbuf bw check for gens < 9 - triggers WARN
            as ddb_size is 0.
      
      v10: - Lock global state for older gens as well.
      
      v11: - Define new bw_calc_min_cdclk hook, instead of using
             a condition(Manasi Navare)
      
      v12: - Fixed rebase conflict
      
      v13: - Added spaces after declarations to make checkpatch happy.
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Reviewed-by: NManasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: NManasi Navare <manasi.d.navare@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200520150058.16123-1-stanislav.lisovskiy@intel.com
      cd191546
  26. 20 5月, 2020 1 次提交
  27. 15 5月, 2020 1 次提交
    • S
      drm/i915: Restrict qgv points which don't have enough bandwidth. · 20f505f2
      Stanislav Lisovskiy 提交于
      According to BSpec 53998, we should try to
      restrict qgv points, which can't provide
      enough bandwidth for desired display configuration.
      
      Currently we are just comparing against all of
      those and take minimum(worst case).
      
      v2: Fixed wrong PCode reply mask, removed hardcoded
          values.
      
      v3: Forbid simultaneous legacy SAGV PCode requests and
          restricting qgv points. Put the actual restriction
          to commit function, added serialization(thanks to Ville)
          to prevent commit being applied out of order in case of
          nonblocking and/or nomodeset commits.
      
      v4:
          - Minor code refactoring, fixed few typos(thanks to James Ausmus)
          - Change the naming of qgv point
            masking/unmasking functions(James Ausmus).
          - Simplify the masking/unmasking operation itself,
            as we don't need to mask only single point per request(James Ausmus)
          - Reject and stick to highest bandwidth point if SAGV
            can't be enabled(BSpec)
      
      v5:
          - Add new mailbox reply codes, which seems to happen during boot
            time for TGL and indicate that QGV setting is not yet available.
      
      v6:
          - Increase number of supported QGV points to be in sync with BSpec.
      
      v7: - Rebased and resolved conflict to fix build failure.
          - Fix NUM_QGV_POINTS to 8 and moved that to header file(James Ausmus)
      
      v8: - Don't report an error if we can't restrict qgv points, as SAGV
            can be disabled by BIOS, which is completely legal. So don't
            make CI panic. Instead if we detect that there is only 1 QGV
            point accessible just analyze if we can fit the required bandwidth
            requirements, but no need in restricting.
      
      v9: - Fix wrong QGV transition if we have 0 planes and no SAGV
            simultaneously.
      
      v10: - Fix CDCLK corruption, because of global state getting serialized
             without modeset, which caused copying of non-calculated cdclk
             to be copied to dev_priv(thanks to Ville for the hint).
      
      v11: - Remove unneeded headers and spaces(Matthew Roper)
           - Remove unneeded intel_qgv_info qi struct from bw check and zero
             out the needed one(Matthew Roper)
           - Changed QGV error message to have more clear meaning(Matthew Roper)
           - Use state->modeset_set instead of any_ms(Matthew Roper)
           - Moved NUM_SAGV_POINTS from i915_reg.h to i915_drv.h where it's used
           - Keep using crtc_state->hw.active instead of .enable(Matthew Roper)
           - Moved unrelated changes to other patch(using latency as parameter
             for plane wm calculation, moved to SAGV refactoring patch)
      
      v12: - Fix rebase conflict with own temporary SAGV/QGV fix.
           - Remove unnecessary mask being zero check when unmasking
             qgv points as this is completely legal(Matt Roper)
           - Check if we are setting the same mask as already being set
             in hardware to prevent error from PCode.
           - Fix error message when restricting/unrestricting qgv points
             to "mask/unmask" which sounds more accurate(Matt Roper)
           - Move sagv status setting to icl_get_bw_info from atomic check
             as this should be calculated only once.(Matt Roper)
           - Edited comments for the case when we can't enable SAGV and
             use only 1 QGV point with highest bandwidth to be more
             understandable.(Matt Roper)
      
      v13: - Moved max_data_rate in bw check to closer scope(Ville Syrjälä)
           - Changed comment for zero new_mask in qgv points masking function
             to better reflect reality(Ville Syrjälä)
           - Simplified bit mask operation in qgv points masking function
             (Ville Syrjälä)
           - Moved intel_qgv_points_mask closer to gen11 SAGV disabling,
             however this still can't be under modeset condition(Ville Syrjälä)
           - Packed qgv_points_mask as u8 and moved closer to pipe_sagv_mask
             (Ville Syrjälä)
           - Extracted PCode changes to separate patch.(Ville Syrjälä)
           - Now treat num_planes 0 same as 1 to avoid confusion and
             returning max_bw as 0, which would prevent choosing QGV
             point having max bandwidth in case if SAGV is not allowed,
             as per BSpec(Ville Syrjälä)
           - Do the actual qgv_points_mask swap in the same place as
             all other global state parts like cdclk are swapped.
             In the next patch, this all will be moved to bw state as
             global state, once new global state patch series from Ville
             lands
      
      v14: - Now using global state to serialize access to qgv points
           - Added global state locking back, otherwise we seem to read
             bw state in a wrong way.
      
      v15: - Added TODO comment for near atomic global state locking in
             bw code.
      
      v16: - Fixed intel_atomic_bw_* functions to be intel_bw_* as discussed
             with Jani Nikula.
           - Take bw_state_changed flag into use.
      
      v17: - Moved qgv point related manipulations next to SAGV code, as
             those are semantically related(Ville Syrjälä)
           - Renamed those into intel_sagv_(pre)|(post)_plane_update
             (Ville Syrjälä)
      
      v18: - Move sagv related calls from commit tail into
             intel_sagv_(pre)|(post)_plane_update(Ville Syrjälä)
      
      v19: - Use intel_atomic_get_bw_(old)|(new)_state which is intended
             for commit tail stage.
      
      v20: - Return max bandwidth for 0 planes(Ville)
           - Constify old_bw_state in bw_atomic_check(Ville)
           - Removed some debugs(Ville)
           - Added data rate to debug print when no QGV points(Ville)
           - Removed some comments(Ville)
      
      v21, v22, v23: - Fixed rebase conflict
      
      v24: - Changed PCode mask to use ICL_ prefix
      v25: - Resolved rebase conflict
      
      v26: - Removed redundant NULL checks(Ville)
           - Removed redundant error prints(Ville)
      
      v27: - Use device specific drm_err(Ville)
           - Fixed parenthesis ident reported by checkpatch
             Line over 100 warns to be fixed together with
             existing code style.
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@intel.com>
      Cc: James Ausmus <james.ausmus@intel.com>
      [vsyrjala: Drop duplicate intel_sagv_{pre,post}_plane_update() prototypes
                 and drop unused NUM_SAGV_POINTS define]
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200514074853.9508-3-stanislav.lisovskiy@intel.com
      20f505f2
  28. 04 5月, 2020 1 次提交
  29. 18 4月, 2020 1 次提交
  30. 08 4月, 2020 1 次提交
  31. 04 2月, 2020 1 次提交
    • P
      drm/i915/display: Make WARN* drm specific where drm_device ptr is available · f4224a4c
      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/20200128181603.27767-20-pankaj.laxminarayan.bharadiya@intel.com
      f4224a4c
  32. 31 1月, 2020 1 次提交
  33. 23 1月, 2020 1 次提交
    • W
      drm/i915/bw: convert to drm_device based logging macros · 2e3586ce
      Wambui Karuga 提交于
      This replaces the printk based logging macros with the struct drm_based
      macros in i915/display/intel_bw.c
      This transformation was achieved by using the following coccinelle
      script that matches based on the existence of a struct drm_i915_private
      device in the functions:
      
      @rule1@
      identifier fn, T;
      @@
      
      fn(struct drm_i915_private *T,...) {
      <+...
      (
      -DRM_INFO(
      +drm_info(&T->drm,
      ...)
      |
      -DRM_ERROR(
      +drm_err(&T->drm,
      ...)
      |
      -DRM_WARN(
      +drm_warn(&T->drm,
      ...)
      |
      -DRM_DEBUG(
      +drm_dbg(&T->drm,
      ...)
      |
      -DRM_DEBUG_DRIVER(
      +drm_dbg(&T->drm,
      ...)
      |
      -DRM_DEBUG_KMS(
      +drm_dbg_kms(&T->drm,
      ...)
      )
      ...+>
      }
      
      @rule2@
      identifier fn, T;
      @@
      
      fn(...) {
      ...
      struct drm_i915_private *T = ...;
      <+...
      (
      -DRM_INFO(
      +drm_info(&T->drm,
      ...)
      |
      -DRM_ERROR(
      +drm_err(&T->drm,
      ...)
      |
      -DRM_WARN(
      +drm_warn(&T->drm,
      ...)
      |
      -DRM_DEBUG(
      +drm_dbg(&T->drm,
      ...)
      |
      -DRM_DEBUG_KMS(
      +drm_dbg_kms(&T->drm,
      ...)
      |
      -DRM_DEBUG_DRIVER(
      +drm_dbg(&T->drm,
      ...)
      )
      ...+>
      }
      
      Resulting checkpatch warnings were addressed manually.
      Signed-off-by: NWambui Karuga <wambui.karugax@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200121134559.17355-5-wambui.karugax@gmail.com
      2e3586ce
  34. 24 12月, 2019 1 次提交
  35. 27 11月, 2019 1 次提交
  36. 20 11月, 2019 1 次提交
  37. 01 11月, 2019 1 次提交
  38. 26 9月, 2019 1 次提交
  39. 24 9月, 2019 1 次提交