mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
drm/i915/dvo: use native encoder ->mode_set callback
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
efea6e8e49
commit
79fde3011f
1 changed files with 11 additions and 17 deletions
|
@ -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,
|
||||||
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,
|
||||||
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)
|
||||||
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)
|
||||||
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)
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue