Commit 79fde301 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915/dvo: use native encoder ->mode_set callback

Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent efea6e8e
...@@ -107,8 +107,7 @@ static struct intel_dvo *enc_to_dvo(struct intel_encoder *encoder) ...@@ -107,8 +107,7 @@ static struct intel_dvo *enc_to_dvo(struct intel_encoder *encoder)
static struct intel_dvo *intel_attached_dvo(struct drm_connector *connector) static struct intel_dvo *intel_attached_dvo(struct drm_connector *connector)
{ {
return container_of(intel_attached_encoder(connector), return enc_to_dvo(intel_attached_encoder(connector));
struct intel_dvo, base);
} }
static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector) static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector)
...@@ -274,15 +273,14 @@ static bool intel_dvo_compute_config(struct intel_encoder *encoder, ...@@ -274,15 +273,14 @@ static bool intel_dvo_compute_config(struct intel_encoder *encoder,
return true; return true;
} }
static void intel_dvo_mode_set(struct drm_encoder *encoder, static void intel_dvo_mode_set(struct intel_encoder *encoder)
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
struct intel_dvo *intel_dvo = enc_to_dvo(to_intel_encoder(encoder)); struct drm_display_mode *adjusted_mode = &crtc->config.adjusted_mode;
int pipe = intel_crtc->pipe; struct intel_dvo *intel_dvo = enc_to_dvo(encoder);
int pipe = crtc->pipe;
u32 dvo_val; u32 dvo_val;
u32 dvo_reg = intel_dvo->dev.dvo_reg, dvo_srcdim_reg; u32 dvo_reg = intel_dvo->dev.dvo_reg, dvo_srcdim_reg;
...@@ -299,7 +297,9 @@ static void intel_dvo_mode_set(struct drm_encoder *encoder, ...@@ -299,7 +297,9 @@ static void intel_dvo_mode_set(struct drm_encoder *encoder,
break; break;
} }
intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev, mode, adjusted_mode); intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev,
&crtc->config.requested_mode,
adjusted_mode);
/* Save the data order, since I don't know what it should be set to. */ /* Save the data order, since I don't know what it should be set to. */
dvo_val = I915_READ(dvo_reg) & dvo_val = I915_READ(dvo_reg) &
...@@ -373,10 +373,6 @@ static void intel_dvo_destroy(struct drm_connector *connector) ...@@ -373,10 +373,6 @@ static void intel_dvo_destroy(struct drm_connector *connector)
kfree(connector); kfree(connector);
} }
static const struct drm_encoder_helper_funcs intel_dvo_helper_funcs = {
.mode_set = intel_dvo_mode_set,
};
static const struct drm_connector_funcs intel_dvo_connector_funcs = { static const struct drm_connector_funcs intel_dvo_connector_funcs = {
.dpms = intel_dvo_dpms, .dpms = intel_dvo_dpms,
.detect = intel_dvo_detect, .detect = intel_dvo_detect,
...@@ -472,6 +468,7 @@ void intel_dvo_init(struct drm_device *dev) ...@@ -472,6 +468,7 @@ void intel_dvo_init(struct drm_device *dev)
intel_encoder->get_hw_state = intel_dvo_get_hw_state; intel_encoder->get_hw_state = intel_dvo_get_hw_state;
intel_encoder->get_config = intel_dvo_get_config; intel_encoder->get_config = intel_dvo_get_config;
intel_encoder->compute_config = intel_dvo_compute_config; intel_encoder->compute_config = intel_dvo_compute_config;
intel_encoder->mode_set = intel_dvo_mode_set;
intel_connector->get_hw_state = intel_dvo_connector_get_hw_state; intel_connector->get_hw_state = intel_dvo_connector_get_hw_state;
/* Now, try to find a controller */ /* Now, try to find a controller */
...@@ -538,9 +535,6 @@ void intel_dvo_init(struct drm_device *dev) ...@@ -538,9 +535,6 @@ void intel_dvo_init(struct drm_device *dev)
connector->interlace_allowed = false; connector->interlace_allowed = false;
connector->doublescan_allowed = false; connector->doublescan_allowed = false;
drm_encoder_helper_add(&intel_encoder->base,
&intel_dvo_helper_funcs);
intel_connector_attach_encoder(intel_connector, intel_encoder); intel_connector_attach_encoder(intel_connector, intel_encoder);
if (dvo->type == INTEL_DVO_CHIP_LVDS) { if (dvo->type == INTEL_DVO_CHIP_LVDS) {
/* For our LVDS chipsets, we should hopefully be able /* For our LVDS chipsets, we should hopefully be able
......
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