drm/i915/tgl: Program BW_BUDDY registers during display init
authorMatt Roper <matthew.d.roper@intel.com>
Thu, 5 Dec 2019 22:48:48 +0000 (14:48 -0800)
committerMatt Roper <matthew.d.roper@intel.com>
Tue, 10 Dec 2019 16:09:25 +0000 (08:09 -0800)
commit3fa01d642fa7fc8b2ee2833155048d2d107da2e8
treefe0a7cfbdff22cc7ca33cbc00f84545ab9a4b7c7
parent1805ec67b12a12c794aee7ed46bd577748ee2a2c
drm/i915/tgl: Program BW_BUDDY registers during display init

Gen12 can improve bandwidth efficiency by pairing up memory requests
with similar addresses.  We need to program the BW_BUDDY1 and BW_BUDDY2
registers according to the memory configuration during display
initialization to take advantage of this capability.

The magic numbers we program here feel like something that could
definitely change on future platforms, so let's use a table-based
programming scheme to make this easy to extend in the future.

v2:
 - Add separate table for Wa_1409767108.  (Stan)
 - Reorder structure reduce size by a word.  Page mask can still be up
   to 28 bits (even though current values are small) so we should keep
   it as a u32, but just using a u8 for DRAM type instead of the actual
   enum type saves space.  (Lucas, Ville)
 - Rename function to tgl_bw_buddy_init() to be more precise about what
   it does.  (Lucas)

Bspec: 49189
Bspec: 49218
Bspec: 52890
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191205224848.76712-1-matthew.d.roper@intel.com
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
drivers/gpu/drm/i915/display/intel_display_power.c
drivers/gpu/drm/i915/i915_reg.h