Commit 831a277e authored by Jani Nikula's avatar Jani Nikula

Revert "drm/i915: Extract drm_dp_atomic_find_vcpi_slots cycle to separate function"

This reverts commit 7ae5ab44.

Part of a series where patches were modified while applying to resolve
conflicts, leading to further conflicts between drm-misc-next and
drm-intel-next, resulting in build failures in drm-tip. To be applied
again on a baseline with drm-misc-next and drm-intel-next in sync.
Acked-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent cc6b2ba2
...@@ -44,14 +44,10 @@ ...@@ -44,14 +44,10 @@
#include "intel_hotplug.h" #include "intel_hotplug.h"
#include "skl_scaler.h" #include "skl_scaler.h"
static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,
struct intel_crtc_state *crtc_state, struct intel_crtc_state *crtc_state,
int max_bpp, struct drm_connector_state *conn_state,
int min_bpp, struct link_config_limits *limits)
struct link_config_limits *limits,
struct drm_connector_state *conn_state,
int step,
bool dsc)
{ {
struct drm_atomic_state *state = crtc_state->uapi.state; struct drm_atomic_state *state = crtc_state->uapi.state;
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder); struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
...@@ -61,31 +57,28 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, ...@@ -61,31 +57,28 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
struct drm_i915_private *i915 = to_i915(connector->base.dev); struct drm_i915_private *i915 = to_i915(connector->base.dev);
const struct drm_display_mode *adjusted_mode = const struct drm_display_mode *adjusted_mode =
&crtc_state->hw.adjusted_mode; &crtc_state->hw.adjusted_mode;
bool constant_n = drm_dp_has_quirk(&intel_dp->desc, DP_DPCD_QUIRK_CONSTANT_N);
int bpp, slots = -EINVAL; int bpp, slots = -EINVAL;
int ret = 0; int ret = 0;
int pbn_div;
crtc_state->lane_count = limits->max_lane_count; crtc_state->lane_count = limits->max_lane_count;
crtc_state->port_clock = limits->max_rate; crtc_state->port_clock = limits->max_rate;
pbn_div = drm_dp_get_vc_payload_bw(&intel_dp->mst_mgr, for (bpp = limits->max_bpp; bpp >= limits->min_bpp; bpp -= 2 * 3) {
crtc_state->port_clock,
crtc_state->lane_count);
for (bpp = max_bpp; bpp >= min_bpp; bpp -= step) {
crtc_state->pipe_bpp = bpp; crtc_state->pipe_bpp = bpp;
crtc_state->pbn = drm_dp_calc_pbn_mode(adjusted_mode->crtc_clock, crtc_state->pbn = drm_dp_calc_pbn_mode(adjusted_mode->crtc_clock,
dsc ? bpp << 4 : crtc_state->pipe_bpp, crtc_state->pipe_bpp,
dsc); false);
slots = drm_dp_atomic_find_vcpi_slots(state, &intel_dp->mst_mgr, slots = drm_dp_atomic_find_vcpi_slots(state, &intel_dp->mst_mgr,
connector->port, connector->port,
crtc_state->pbn, crtc_state->pbn,
pbn_div); drm_dp_get_vc_payload_bw(&intel_dp->mst_mgr,
crtc_state->port_clock,
crtc_state->lane_count));
if (slots == -EDEADLK) if (slots == -EDEADLK)
return slots; return slots;
if (slots >= 0) { if (slots >= 0) {
ret = drm_dp_mst_atomic_check(state); ret = drm_dp_mst_atomic_check(state);
/* /*
...@@ -101,32 +94,11 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, ...@@ -101,32 +94,11 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
if (ret && slots >= 0) if (ret && slots >= 0)
slots = ret; slots = ret;
if (slots < 0) if (slots < 0) {
drm_dbg_kms(&i915->drm, "failed finding vcpi slots:%d\n", drm_dbg_kms(&i915->drm, "failed finding vcpi slots:%d\n",
slots); slots);
return slots;
}
static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,
struct intel_crtc_state *crtc_state,
struct drm_connector_state *conn_state,
struct link_config_limits *limits)
{
const struct drm_display_mode *adjusted_mode =
&crtc_state->hw.adjusted_mode;
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
struct intel_dp *intel_dp = &intel_mst->primary->dp;
bool constant_n = drm_dp_has_quirk(&intel_dp->desc, DP_DPCD_QUIRK_CONSTANT_N);
int slots = -EINVAL;
slots = intel_dp_mst_find_vcpi_slots_for_bpp(encoder, crtc_state, limits->max_bpp,
limits->min_bpp, limits,
conn_state, 2 * 3, false);
if (slots < 0)
return slots; return slots;
}
intel_link_compute_m_n(crtc_state->pipe_bpp, intel_link_compute_m_n(crtc_state->pipe_bpp,
crtc_state->lane_count, crtc_state->lane_count,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment