Re: [Intel-gfx] [PATCH v4 6/9] drm/i915: Convert intel_dp properties to atomic.
On 19-04-17 17:53, Daniel Vetter wrote: > On Wed, Apr 12, 2017 at 12:50:04PM +0200, Maarten Lankhorst wrote: >> intel_dp supports 3 properties, scaling mode, broadcast rgb and >> force_audio. intel_digital_connector handles the plumbing, >> so we only have to hook this up in compute_config and init. >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/intel_dp.c | 136 >> +++ >> drivers/gpu/drm/i915/intel_drv.h | 3 - >> 2 files changed, 24 insertions(+), 115 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/intel_dp.c >> b/drivers/gpu/drm/i915/intel_dp.c >> index b1a0cb3c79d4..f976d10b4f0a 100644 >> --- a/drivers/gpu/drm/i915/intel_dp.c >> +++ b/drivers/gpu/drm/i915/intel_dp.c >> @@ -1630,6 +1630,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, >> enum port port = dp_to_dig_port(intel_dp)->port; >> struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->base.crtc); >> struct intel_connector *intel_connector = intel_dp->attached_connector; >> +struct intel_digital_connector_state *intel_conn_state = >> +to_intel_digital_connector_state(conn_state); >> int lane_count, clock; >> int min_lane_count = 1; >> int max_lane_count = intel_dp_max_lane_count(intel_dp); >> @@ -1655,10 +1657,10 @@ intel_dp_compute_config(struct intel_encoder >> *encoder, >> pipe_config->has_drrs = false; >> if (port == PORT_A) >> pipe_config->has_audio = false; >> -else if (intel_dp->force_audio == HDMI_AUDIO_AUTO) >> +else if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO) >> pipe_config->has_audio = intel_dp->has_audio; >> else >> -pipe_config->has_audio = intel_dp->force_audio == HDMI_AUDIO_ON; >> +pipe_config->has_audio = intel_conn_state->force_audio == >> HDMI_AUDIO_ON; >> >> if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) { >> intel_fixed_panel_mode(intel_connector->panel.fixed_mode, >> @@ -1673,10 +1675,10 @@ intel_dp_compute_config(struct intel_encoder >> *encoder, >> >> if (HAS_GMCH_DISPLAY(dev_priv)) >> intel_gmch_panel_fitting(intel_crtc, pipe_config, >> - >> intel_connector->panel.fitting_mode); >> + conn_state->scaling_mode); >> else >> intel_pch_panel_fitting(intel_crtc, pipe_config, >> - >> intel_connector->panel.fitting_mode); >> +conn_state->scaling_mode); >> } >> >> if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK) >> @@ -1745,7 +1747,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, >> return false; >> >> found: >> -if (intel_dp->color_range_auto) { >> +if (intel_conn_state->broadcast_rgb == INTEL_BROADCAST_RGB_AUTO) { >> /* >> * See: >> * CEA-861-E - 5.1 Default Encoding Parameters >> @@ -1757,7 +1759,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, >> HDMI_QUANTIZATION_RANGE_LIMITED; >> } else { >> pipe_config->limited_color_range = >> -intel_dp->limited_color_range; >> +intel_conn_state->broadcast_rgb == >> INTEL_BROADCAST_RGB_LIMITED; >> } >> >> pipe_config->lane_count = lane_count; >> @@ -4781,104 +4783,6 @@ static int intel_dp_get_modes(struct drm_connector >> *connector) >> } >> >> static int >> -intel_dp_set_property(struct drm_connector *connector, >> - struct drm_property *property, >> - uint64_t val) >> -{ >> -struct drm_i915_private *dev_priv = to_i915(connector->dev); >> -struct intel_connector *intel_connector = to_intel_connector(connector); >> -struct intel_encoder *intel_encoder = intel_attached_encoder(connector); >> -struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base); >> -int ret; >> - >> -ret = drm_object_property_set_value(&connector->base, property, val); >> -if (ret) >> -return ret; >> - >> -if (property == dev_priv->force_audio_property) { >> -int i = val; >> -bool has_audio, old_has_audio; >> -int old_force_audio = intel_dp->force_audio; >> - >> -if (i == intel_dp->force_audio) >> -return 0; >> - >> -if (old_force_audio == HDMI_AUDIO_AUTO) >> -old_has_audio = intel_dp->has_audio; >> -else >> -old_has_audio = old_force_audio; >> - >> -intel_dp->force_audio = i; >> - >> -if (i == HDMI_AUDIO_AUTO) >> -has_audio = intel_dp->has_audio; >> -else >> -has_audio = (i == HDMI_AUDIO_ON); >> - >> -if (has_audio == old_has_audio) >> -
Re: [Intel-gfx] [PATCH v4 6/9] drm/i915: Convert intel_dp properties to atomic.
On Wed, Apr 12, 2017 at 12:50:04PM +0200, Maarten Lankhorst wrote: > intel_dp supports 3 properties, scaling mode, broadcast rgb and > force_audio. intel_digital_connector handles the plumbing, > so we only have to hook this up in compute_config and init. > > Signed-off-by: Maarten Lankhorst > --- > drivers/gpu/drm/i915/intel_dp.c | 136 > +++ > drivers/gpu/drm/i915/intel_drv.h | 3 - > 2 files changed, 24 insertions(+), 115 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > index b1a0cb3c79d4..f976d10b4f0a 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -1630,6 +1630,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, > enum port port = dp_to_dig_port(intel_dp)->port; > struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->base.crtc); > struct intel_connector *intel_connector = intel_dp->attached_connector; > + struct intel_digital_connector_state *intel_conn_state = > + to_intel_digital_connector_state(conn_state); > int lane_count, clock; > int min_lane_count = 1; > int max_lane_count = intel_dp_max_lane_count(intel_dp); > @@ -1655,10 +1657,10 @@ intel_dp_compute_config(struct intel_encoder *encoder, > pipe_config->has_drrs = false; > if (port == PORT_A) > pipe_config->has_audio = false; > - else if (intel_dp->force_audio == HDMI_AUDIO_AUTO) > + else if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO) > pipe_config->has_audio = intel_dp->has_audio; > else > - pipe_config->has_audio = intel_dp->force_audio == HDMI_AUDIO_ON; > + pipe_config->has_audio = intel_conn_state->force_audio == > HDMI_AUDIO_ON; > > if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) { > intel_fixed_panel_mode(intel_connector->panel.fixed_mode, > @@ -1673,10 +1675,10 @@ intel_dp_compute_config(struct intel_encoder *encoder, > > if (HAS_GMCH_DISPLAY(dev_priv)) > intel_gmch_panel_fitting(intel_crtc, pipe_config, > - > intel_connector->panel.fitting_mode); > + conn_state->scaling_mode); > else > intel_pch_panel_fitting(intel_crtc, pipe_config, > - > intel_connector->panel.fitting_mode); > + conn_state->scaling_mode); > } > > if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK) > @@ -1745,7 +1747,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, > return false; > > found: > - if (intel_dp->color_range_auto) { > + if (intel_conn_state->broadcast_rgb == INTEL_BROADCAST_RGB_AUTO) { > /* >* See: >* CEA-861-E - 5.1 Default Encoding Parameters > @@ -1757,7 +1759,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, > HDMI_QUANTIZATION_RANGE_LIMITED; > } else { > pipe_config->limited_color_range = > - intel_dp->limited_color_range; > + intel_conn_state->broadcast_rgb == > INTEL_BROADCAST_RGB_LIMITED; > } > > pipe_config->lane_count = lane_count; > @@ -4781,104 +4783,6 @@ static int intel_dp_get_modes(struct drm_connector > *connector) > } > > static int > -intel_dp_set_property(struct drm_connector *connector, > - struct drm_property *property, > - uint64_t val) > -{ > - struct drm_i915_private *dev_priv = to_i915(connector->dev); > - struct intel_connector *intel_connector = to_intel_connector(connector); > - struct intel_encoder *intel_encoder = intel_attached_encoder(connector); > - struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base); > - int ret; > - > - ret = drm_object_property_set_value(&connector->base, property, val); > - if (ret) > - return ret; > - > - if (property == dev_priv->force_audio_property) { > - int i = val; > - bool has_audio, old_has_audio; > - int old_force_audio = intel_dp->force_audio; > - > - if (i == intel_dp->force_audio) > - return 0; > - > - if (old_force_audio == HDMI_AUDIO_AUTO) > - old_has_audio = intel_dp->has_audio; > - else > - old_has_audio = old_force_audio; > - > - intel_dp->force_audio = i; > - > - if (i == HDMI_AUDIO_AUTO) > - has_audio = intel_dp->has_audio; > - else > - has_audio = (i == HDMI_AUDIO_ON); > - > - if (has_audio == old_has_audio) > - return 0; > - > - goto done; > - } > - > - if (property == dev_pri