Commit 2cad4279 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/dp: Pass around intel_connector rather than drm_connector

Prefer to use intel_connector over drm_connector. Also clean
up the related variable names a bit.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-7-ville.syrjala@linux.intel.comReviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
parent dd934010
...@@ -759,13 +759,13 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp, ...@@ -759,13 +759,13 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,
} }
static enum intel_output_format static enum intel_output_format
intel_dp_output_format(struct drm_connector *connector, intel_dp_output_format(struct intel_connector *connector,
const struct drm_display_mode *mode) const struct drm_display_mode *mode)
{ {
struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector)); struct intel_dp *intel_dp = intel_attached_dp(connector);
const struct drm_display_info *info = &connector->display_info; const struct drm_display_info *info = &connector->base.display_info;
if (!connector->ycbcr_420_allowed || if (!connector->base.ycbcr_420_allowed ||
!drm_mode_is_420_only(info, mode)) !drm_mode_is_420_only(info, mode))
return INTEL_OUTPUT_FORMAT_RGB; return INTEL_OUTPUT_FORMAT_RGB;
...@@ -801,7 +801,7 @@ static int intel_dp_output_bpp(enum intel_output_format output_format, int bpp) ...@@ -801,7 +801,7 @@ static int intel_dp_output_bpp(enum intel_output_format output_format, int bpp)
} }
static int static int
intel_dp_mode_min_output_bpp(struct drm_connector *connector, intel_dp_mode_min_output_bpp(struct intel_connector *connector,
const struct drm_display_mode *mode) const struct drm_display_mode *mode)
{ {
enum intel_output_format output_format = enum intel_output_format output_format =
...@@ -874,7 +874,7 @@ intel_dp_mode_valid_downstream(struct intel_connector *connector, ...@@ -874,7 +874,7 @@ intel_dp_mode_valid_downstream(struct intel_connector *connector,
if (intel_dp->dfp.pcon_max_frl_bw) { if (intel_dp->dfp.pcon_max_frl_bw) {
int target_bw; int target_bw;
int max_frl_bw; int max_frl_bw;
int bpp = intel_dp_mode_min_output_bpp(&connector->base, mode); int bpp = intel_dp_mode_min_output_bpp(connector, mode);
target_bw = bpp * target_clock; target_bw = bpp * target_clock;
...@@ -910,12 +910,12 @@ static bool intel_dp_need_bigjoiner(struct intel_dp *intel_dp, ...@@ -910,12 +910,12 @@ static bool intel_dp_need_bigjoiner(struct intel_dp *intel_dp,
} }
static enum drm_mode_status static enum drm_mode_status
intel_dp_mode_valid(struct drm_connector *connector, intel_dp_mode_valid(struct drm_connector *_connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector)); struct intel_connector *connector = to_intel_connector(_connector);
struct intel_connector *intel_connector = to_intel_connector(connector); struct intel_dp *intel_dp = intel_attached_dp(connector);
struct drm_i915_private *dev_priv = to_i915(connector->dev); struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
const struct drm_display_mode *fixed_mode; const struct drm_display_mode *fixed_mode;
int target_clock = mode->clock; int target_clock = mode->clock;
int max_rate, mode_rate, max_lanes, max_link_clock; int max_rate, mode_rate, max_lanes, max_link_clock;
...@@ -931,9 +931,9 @@ intel_dp_mode_valid(struct drm_connector *connector, ...@@ -931,9 +931,9 @@ intel_dp_mode_valid(struct drm_connector *connector,
if (mode->flags & DRM_MODE_FLAG_DBLCLK) if (mode->flags & DRM_MODE_FLAG_DBLCLK)
return MODE_H_ILLEGAL; return MODE_H_ILLEGAL;
fixed_mode = intel_panel_fixed_mode(intel_connector, mode); fixed_mode = intel_panel_fixed_mode(connector, mode);
if (intel_dp_is_edp(intel_dp) && fixed_mode) { if (intel_dp_is_edp(intel_dp) && fixed_mode) {
status = intel_panel_mode_valid(intel_connector, mode); status = intel_panel_mode_valid(connector, mode);
if (status != MODE_OK) if (status != MODE_OK)
return status; return status;
...@@ -1007,8 +1007,7 @@ intel_dp_mode_valid(struct drm_connector *connector, ...@@ -1007,8 +1007,7 @@ intel_dp_mode_valid(struct drm_connector *connector,
if (mode_rate > max_rate && !dsc) if (mode_rate > max_rate && !dsc)
return MODE_CLOCK_HIGH; return MODE_CLOCK_HIGH;
status = intel_dp_mode_valid_downstream(intel_connector, status = intel_dp_mode_valid_downstream(connector, mode, target_clock);
mode, target_clock);
if (status != MODE_OK) if (status != MODE_OK)
return status; return status;
...@@ -1876,7 +1875,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -1876,7 +1875,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
const struct drm_display_mode *fixed_mode; const struct drm_display_mode *fixed_mode;
struct intel_connector *intel_connector = intel_dp->attached_connector; struct intel_connector *connector = intel_dp->attached_connector;
bool constant_n = drm_dp_has_quirk(&intel_dp->desc, DP_DPCD_QUIRK_CONSTANT_N); bool constant_n = drm_dp_has_quirk(&intel_dp->desc, DP_DPCD_QUIRK_CONSTANT_N);
int ret = 0, output_bpp; int ret = 0, output_bpp;
...@@ -1885,9 +1884,9 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -1885,9 +1884,9 @@ intel_dp_compute_config(struct intel_encoder *encoder,
pipe_config->has_audio = intel_dp_has_audio(encoder, pipe_config, conn_state); pipe_config->has_audio = intel_dp_has_audio(encoder, pipe_config, conn_state);
fixed_mode = intel_panel_fixed_mode(intel_connector, adjusted_mode); fixed_mode = intel_panel_fixed_mode(connector, adjusted_mode);
if (intel_dp_is_edp(intel_dp) && fixed_mode) { if (intel_dp_is_edp(intel_dp) && fixed_mode) {
ret = intel_panel_compute_config(intel_connector, adjusted_mode); ret = intel_panel_compute_config(connector, adjusted_mode);
if (ret) if (ret)
return ret; return ret;
} }
...@@ -1905,8 +1904,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -1905,8 +1904,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
if (intel_dp_hdisplay_bad(dev_priv, adjusted_mode->crtc_hdisplay)) if (intel_dp_hdisplay_bad(dev_priv, adjusted_mode->crtc_hdisplay))
return -EINVAL; return -EINVAL;
pipe_config->output_format = intel_dp_output_format(&intel_connector->base, pipe_config->output_format = intel_dp_output_format(connector, adjusted_mode);
adjusted_mode);
ret = intel_dp_compute_link_config(encoder, pipe_config, conn_state); ret = intel_dp_compute_link_config(encoder, pipe_config, conn_state);
if (ret < 0) if (ret < 0)
...@@ -1964,7 +1962,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -1964,7 +1962,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
intel_vrr_compute_config(pipe_config, conn_state); intel_vrr_compute_config(pipe_config, conn_state);
intel_psr_compute_config(intel_dp, pipe_config, conn_state); intel_psr_compute_config(intel_dp, pipe_config, conn_state);
intel_dp_drrs_compute_config(intel_connector, pipe_config, intel_dp_drrs_compute_config(connector, pipe_config,
output_bpp, constant_n); output_bpp, constant_n);
intel_dp_compute_vsc_sdp(intel_dp, pipe_config, conn_state); intel_dp_compute_vsc_sdp(intel_dp, pipe_config, conn_state);
intel_dp_compute_hdr_metadata_infoframe_sdp(intel_dp, pipe_config, conn_state); intel_dp_compute_hdr_metadata_infoframe_sdp(intel_dp, pipe_config, conn_state);
......
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