drm/i915: Introduce intel_get_buf_trans()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 8 Jun 2021 07:35:52 +0000 (10:35 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 23 Jun 2021 12:29:15 +0000 (15:29 +0300)
commit439ebf9ef1997eb39da2a11048216a40ebc0ad99
tree2608f05c2c6d3542611a2bbb98d5b31e4b10d936
parent13cee3c123987aa27371b10c89409d7b26e2838a
drm/i915: Introduce intel_get_buf_trans()

Add a small helper to get the buf trans entris+num_entries
from the struct. Should avoid copy-paste errors in the
platform specific get_buf_trans() functions.

@@
identifier T, N;
@@
- *N = T.num_entries;
- return T.entries;
+ return intel_get_buf_trans(&T, N);

@@
@@
is_hobl_buf_trans(...) { ... }
+
+ static const union intel_ddi_buf_trans_entry *
+ intel_get_buf_trans(const struct intel_ddi_buf_trans *ddi_translations, int *num_entries)
+ {
+ *num_entries = ddi_translations->num_entries;
+ return ddi_translations->entries;
+ }

v2: Handle adl-p

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-7-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c