~vicamo/+git/ubuntu-kernel:bug-1891451/add-tgl-sagv-display-support/oem-5.6

Last commit made on 2020-08-14
Get this branch:
git clone -b bug-1891451/add-tgl-sagv-display-support/oem-5.6 https://git.launchpad.net/~vicamo/+git/ubuntu-kernel
Only You-Sheng Yang can upload to this branch. If you are You-Sheng Yang please log in for upload directions.

Branch merges

Branch information

Name:
bug-1891451/add-tgl-sagv-display-support/oem-5.6
Repository:
lp:~vicamo/+git/ubuntu-kernel

Recent commits

7d2f9ab... by You-Sheng Yang

Bug 1891451: Add TGL+ SAGV display support

6bc82a5... by Stanislav Lisovskiy <email address hidden>

drm/i915: Enable SAGV support for Gen12

BugLink: https://bugs.launchpad.net/bugs/1891451

Flip the switch and enable SAGV support
for Gen12 also.

Signed-off-by: Stanislav Lisovskiy <email address hidden>
Signed-off-by: Ville Syrjälä <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>
(cherry picked from commit 8ca6d0237d1696060cd4f5a3ee93ee001c1a9d5b)
Signed-off-by: You-Sheng Yang <email address hidden>

c3eba31... by Stanislav Lisovskiy <email address hidden>

drm/i915: Restrict qgv points which don't have enough bandwidth.

BugLink: https://bugs.launchpad.net/bugs/1891451

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: Stanislav Lisovskiy <email address hidden>
Cc: Ville Syrjälä <email address hidden>
Cc: James Ausmus <email address hidden>
[vsyrjala: Drop duplicate intel_sagv_{pre,post}_plane_update() prototypes
           and drop unused NUM_SAGV_POINTS define]
Signed-off-by: Ville Syrjälä <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>
(backported from commit 20f505f2253106f695ba6fa0a415159145a8fb2a)
Signed-off-by: You-Sheng Yang <email address hidden>

09f1bf7... by Stanislav Lisovskiy <email address hidden>

drm/i915: Add TGL+ SAGV support

BugLink: https://bugs.launchpad.net/bugs/1891451

Starting from TGL we need to have a separate wm0
values for SAGV and non-SAGV which affects
how calculations are done.

v2: Remove long lines
v3: Removed COLOR_PLANE enum references
v4, v5, v6: Fixed rebase conflict
v7: - Removed skl_plane_wm_level accessor from skl_allocate_pipe_ddb(Ville)
    - Removed sagv_uv_wm0(Ville)
    - can_sagv->use_sagv_wm(Ville)

v8: - Moved tgl_crtc_can_enable_sagv function up(Ville)
    - Changed comment regarding pipe_wm usage(Ville)
    - Call intel_can_enable_sagv and tgl_compute_sagv_wm only
      for Gen12(Ville)
    - Some sagv debugs removed(Ville)
    - skl_print_wm_changes improvements(Ville)
    - Do assignment instead of memcpy in
      skl_pipe_wm_get_hw_state(Ville)

v9: - Removed can_sagv variable(Ville)
    - Removed spurious line(Ville)
    - Changed u32 to unsigned int as agreed(Ville)
    - Assign sagv only for gen12 in
      skl_pipe_wm_get_hw_state(Ville)

Signed-off-by: Stanislav Lisovskiy <email address hidden>
[vsyrjala: Remove the dead 'return false' from intel_crtc_can_enable_sagv()]
Signed-off-by: Ville Syrjälä <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>
(cherry picked from commit 7241c57d3140ad3b613777a8515ffe1f653d4800)
Signed-off-by: You-Sheng Yang <email address hidden>

3f0b3e4... by Stanislav Lisovskiy <email address hidden>

drm/i915: Added required new PCode commands

BugLink: https://bugs.launchpad.net/bugs/1891451

We need a new PCode request commands and reply codes
to be added as a prepartion patch for QGV points
restricting for new SAGV support.

v2: - Extracted those changes into separate patch
      (Ville Syrjälä)

v3: - Moved new PCode masks to another place from
      PCode commands(Ville)

v4: - Moved new PCode masks to correspondent PCode
      command, with identation(Ville)
    - Changed naming to ICL_ instead of GEN11_
      to fit more nicely into existing definition
      style.

Signed-off-by: Stanislav Lisovskiy <email address hidden>
Signed-off-by: Ville Syrjälä <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>
(cherry picked from commit f136c58a0de98e1b56483b7fc8c209dba0a496d9)
Signed-off-by: You-Sheng Yang <email address hidden>

3a13140... by Matt Roper <email address hidden>

drm/i915/gen11: Add additional pcode status values

BugLink: https://bugs.launchpad.net/bugs/1891451

I don't think we've ever hit these new error codes, but they're
documented in the gen11 pcode document, so we might as well add them to
the handler.

Signed-off-by: Matt Roper <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>
Reviewed-by: José Roberto de Souza <email address hidden>
(cherry picked from commit f22fd334890e0e24305aaa7249ff56baba082eca)
Signed-off-by: You-Sheng Yang <email address hidden>

1935656... by Stanislav Lisovskiy <email address hidden>

drm/i915: Make active_pipes check skl specific

BugLink: https://bugs.launchpad.net/bugs/1891451

Seems that only skl needs to have SAGV turned off
for multipipe scenarios, so lets do it this way.

If anything blows up - we can always revert this patch.

v2: Changed if condition to look better (Ville).

Signed-off-by: Stanislav Lisovskiy <email address hidden>
[vsyrjala: wrapped long line to appease checkpatch]
Signed-off-by: Ville Syrjälä <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>
(cherry picked from commit d8d5afe35e3f88f73436f79f974d96a67e879637)
Signed-off-by: You-Sheng Yang <email address hidden>

d987af7... by Stanislav Lisovskiy <email address hidden>

drm/i915: Extract skl SAGV checking

BugLink: https://bugs.launchpad.net/bugs/1891451

Introduce platform dependent SAGV checking in
combination with bandwidth state pipe SAGV mask.

This is preparation to adding TGL support, which
requires different way of SAGV checking.

v2, v3, v4, v5, v6: Fix rebase conflict

v7: - Nuke icl specific function, use skl
      for icl as well, gen specific active_pipes
      check to be added in the next patch(Ville)

v8: - Use more generic intel_crtc_can_enable_sagv
      for checking(Ville)

Signed-off-by: Stanislav Lisovskiy <email address hidden>
Signed-off-by: Ville Syrjälä <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>
(cherry picked from commit 1d0a6c8486aa53f7545e80f5f0293ed99e48ffc0)
Signed-off-by: You-Sheng Yang <email address hidden>

8ce41c9... by Stanislav Lisovskiy <email address hidden>

drm/i915: Introduce skl_plane_wm_level accessor.

BugLink: https://bugs.launchpad.net/bugs/1891451

For future Gen12 SAGV implementation we need to
seemlessly alter wm levels calculated, depending
on whether we are allowed to enable SAGV or not.

So this accessor will give additional flexibility
to do that.

Currently this accessor is still simply working
as "pass-through" function. This will be changed
in next coming patches from this series.

v2: - plane_id -> plane->id(Ville Syrjälä)
    - Moved wm_level var to have more local scope
      (Ville Syrjälä)
    - Renamed yuv to color_plane(Ville Syrjälä) in
      skl_plane_wm_level

v3: - plane->id -> plane_id(this time for real, Ville Syrjälä)
    - Changed colorplane id type from boolean to int as index
      (Ville Syrjälä)
    - Moved crtc_state param so that it is first now
      (Ville Syrjälä)
    - Moved wm_level declaration to tigher scope in
      skl_write_plane_wm(Ville Syrjälä)

v4: - Started to use enum values for color plane
    - Do sizeof for a type what we are memset'ing
    - Zero out wm_uv as well(Ville Syrjälä)

v5: - Fixed rebase conflict caused by COLOR_PLANE_*
      enum removal

v6: - Do not use skl_plane_wm_level accessor in skl_allocate_pipe_ddb

v7: - Get rid of wm_uv, which is not used in skl_plane_write_wm(Ville)

Signed-off-by: Stanislav Lisovskiy <email address hidden>
Signed-off-by: Ville Syrjälä <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>
(cherry picked from commit d9162348db12487754e61f73497bdcfcea753590)
Signed-off-by: You-Sheng Yang <email address hidden>

d386659... by Stanislav Lisovskiy <email address hidden>

drm/i915: Rename bw_state to new_bw_state

BugLink: https://bugs.launchpad.net/bugs/1891451

That is a preparation patch before next one where we
introduce old_bw_state and a bunch of other changes
as well.
In a review comment it was suggested to split out
at least that renaming into a separate patch, what
is done here.

v2: Removed spurious space

Reviewed-by: Ville Syrjälä <email address hidden>
Signed-off-by: Stanislav Lisovskiy <email address hidden>
Signed-off-by: Ville Syrjälä <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>
(backported from commit 9ff79708c54d34a3d4d451b15f8d6e5e042f1d36)
Signed-off-by: You-Sheng Yang <email address hidden>