> Subject: [PATCH v3 14/31] drm/i915/buf_trans: abstract VS/PE-O index
> computation
>
> Move index computation for most appropriate VS/PE-O table into separate
> function.
>
> Unlike VS/PE-O tables' parsing, index computation cannot happen during DDI
> ports parsing. It is because computation depends on link's port clock, which
> can change with every modeset. Thus index computation must be deferred to
> occur during intel_ddi_buf_trans_get(), after tables'
> parsing has completed.
>
> v2->v3
> - break logging into two lines
> - return -EINVAL instead of -1 (Suraj)
>
> Signed-off-by: Michał Grzelak <[email protected]>
> ---
> .../gpu/drm/i915/display/intel_ddi_buf_trans.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> index 38f2a030c018d..9ae7a780a7639 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> @@ -1786,6 +1786,15 @@ xe3plpd_get_lt_buf_trans(struct intel_encoder
> *encoder,
> return intel_get_buf_trans(&xe3plpd_lt_trans_dp14,
> n_entries); }
>
> +static int
> +vspeo_compute_index(struct intel_encoder *encoder) {
You change the argument later in patches. try to define functions in such a way
in the earlier patches that only minimal changes are needed
In the later ones.
> + drm_dbg_kms(to_intel_display(encoder)->drm,
No inline function calls like this please.
Also let avoid wring debug message which will be remove by end of series
> + "VS/PE-O unsupported, using default VS/PE tables");
Missing \n
> +
> + return -EINVAL;
> +}
> +
> void intel_ddi_buf_trans_init(struct intel_encoder *encoder) {
> struct intel_display *display = to_intel_display(encoder); @@ -1859,9
> +1868,10 @@ const struct intel_ddi_buf_trans *intel_ddi_buf_trans_get(struct
> intel_encoder *
> const struct
> intel_crtc_state *crtc_state,
> int *n_entries)
> {
> - if (encoder->vspeo)
> - drm_dbg_kms(to_intel_display(encoder)->drm,
> - "VS/PE-O unsupported, using default VS/PE tables");
> + if (!encoder->vspeo)
> + return encoder->get_buf_trans(encoder, crtc_state, n_entries);
Why we are still calling encoder->get_buf_trans() during return
Regards,
Suraj Kandpal
> +
> + vspeo_compute_index(encoder);
>
> return encoder->get_buf_trans(encoder, crtc_state, n_entries); }
> --
> 2.45.2