Commit 8aca63aa authored by Daniel Vetter's avatar Daniel Vetter

drm/i915/sdvo: use intel_encoder for upcast helper

It's what all callers (except for the destroy callback which is called
from drm core) actually want.
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 79fde301
...@@ -202,15 +202,14 @@ struct intel_sdvo_connector { ...@@ -202,15 +202,14 @@ struct intel_sdvo_connector {
u32 cur_dot_crawl, max_dot_crawl; u32 cur_dot_crawl, max_dot_crawl;
}; };
static struct intel_sdvo *to_intel_sdvo(struct drm_encoder *encoder) static struct intel_sdvo *to_sdvo(struct intel_encoder *encoder)
{ {
return container_of(encoder, struct intel_sdvo, base.base); return container_of(encoder, struct intel_sdvo, base);
} }
static struct intel_sdvo *intel_attached_sdvo(struct drm_connector *connector) static struct intel_sdvo *intel_attached_sdvo(struct drm_connector *connector)
{ {
return container_of(intel_attached_encoder(connector), return to_sdvo(intel_attached_encoder(connector));
struct intel_sdvo, base);
} }
static struct intel_sdvo_connector *to_intel_sdvo_connector(struct drm_connector *connector) static struct intel_sdvo_connector *to_intel_sdvo_connector(struct drm_connector *connector)
...@@ -1084,7 +1083,7 @@ static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_config *pipe_config) ...@@ -1084,7 +1083,7 @@ static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_config *pipe_config)
static bool intel_sdvo_compute_config(struct intel_encoder *encoder, static bool intel_sdvo_compute_config(struct intel_encoder *encoder,
struct intel_crtc_config *pipe_config) struct intel_crtc_config *pipe_config)
{ {
struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode; struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;
struct drm_display_mode *mode = &pipe_config->requested_mode; struct drm_display_mode *mode = &pipe_config->requested_mode;
...@@ -1154,7 +1153,7 @@ static void intel_sdvo_mode_set(struct intel_encoder *intel_encoder) ...@@ -1154,7 +1153,7 @@ static void intel_sdvo_mode_set(struct intel_encoder *intel_encoder)
struct drm_display_mode *adjusted_mode = struct drm_display_mode *adjusted_mode =
&intel_crtc->config.adjusted_mode; &intel_crtc->config.adjusted_mode;
struct drm_display_mode *mode = &intel_crtc->config.requested_mode; struct drm_display_mode *mode = &intel_crtc->config.requested_mode;
struct intel_sdvo *intel_sdvo = to_intel_sdvo(&intel_encoder->base); struct intel_sdvo *intel_sdvo = to_sdvo(intel_encoder);
u32 sdvox; u32 sdvox;
struct intel_sdvo_in_out_map in_out; struct intel_sdvo_in_out_map in_out;
struct intel_sdvo_dtd input_dtd, output_dtd; struct intel_sdvo_dtd input_dtd, output_dtd;
...@@ -1292,7 +1291,7 @@ static bool intel_sdvo_get_hw_state(struct intel_encoder *encoder, ...@@ -1292,7 +1291,7 @@ static bool intel_sdvo_get_hw_state(struct intel_encoder *encoder,
{ {
struct drm_device *dev = encoder->base.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_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
u16 active_outputs = 0; u16 active_outputs = 0;
u32 tmp; u32 tmp;
...@@ -1315,7 +1314,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, ...@@ -1315,7 +1314,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,
{ {
struct drm_device *dev = encoder->base.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_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
struct intel_sdvo_dtd dtd; struct intel_sdvo_dtd dtd;
int encoder_pixel_multiplier = 0; int encoder_pixel_multiplier = 0;
u32 flags = 0, sdvox; u32 flags = 0, sdvox;
...@@ -1380,7 +1379,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, ...@@ -1380,7 +1379,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,
static void intel_disable_sdvo(struct intel_encoder *encoder) static void intel_disable_sdvo(struct intel_encoder *encoder)
{ {
struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
u32 temp; u32 temp;
intel_sdvo_set_active_outputs(intel_sdvo, 0); intel_sdvo_set_active_outputs(intel_sdvo, 0);
...@@ -1422,7 +1421,7 @@ static void intel_enable_sdvo(struct intel_encoder *encoder) ...@@ -1422,7 +1421,7 @@ static void intel_enable_sdvo(struct intel_encoder *encoder)
{ {
struct drm_device *dev = encoder->base.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_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc); struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
u32 temp; u32 temp;
bool input1, input2; bool input1, input2;
...@@ -1583,7 +1582,7 @@ static uint16_t intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo) ...@@ -1583,7 +1582,7 @@ static uint16_t intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo)
static void intel_sdvo_enable_hotplug(struct intel_encoder *encoder) static void intel_sdvo_enable_hotplug(struct intel_encoder *encoder)
{ {
struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG,
&intel_sdvo->hotplug_active, 2); &intel_sdvo->hotplug_active, 2);
...@@ -2190,7 +2189,7 @@ static const struct drm_connector_helper_funcs intel_sdvo_connector_helper_funcs ...@@ -2190,7 +2189,7 @@ static const struct drm_connector_helper_funcs intel_sdvo_connector_helper_funcs
static void intel_sdvo_enc_destroy(struct drm_encoder *encoder) static void intel_sdvo_enc_destroy(struct drm_encoder *encoder)
{ {
struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder); struct intel_sdvo *intel_sdvo = to_sdvo(to_intel_encoder(encoder));
if (intel_sdvo->sdvo_lvds_fixed_mode != NULL) if (intel_sdvo->sdvo_lvds_fixed_mode != NULL)
drm_mode_destroy(encoder->dev, drm_mode_destroy(encoder->dev,
......
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