aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500
diff options
context:
space:
mode:
authorPatrik Jakobsson <patrik.r.jakobsson@gmail.com>2013-07-10 19:02:01 -0400
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>2013-07-23 19:47:29 -0400
commitc9d4959000c0b11c4265af820434b868c4066e0e (patch)
treef7e1119053d66240d41e7c0abaaad564b9e8cfea /drivers/gpu/drm/gma500
parent593458470191e9226c2530c0e10f8e35604063dc (diff)
drm/gma500: Convert to generic encoder funcs
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/gma500')
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_crt.c13
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_display.c4
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_dp.c17
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_hdmi.c19
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_lvds.c9
-rw-r--r--drivers/gpu/drm/gma500/framebuffer.c2
-rw-r--r--drivers/gpu/drm/gma500/gma_display.c4
-rw-r--r--drivers/gpu/drm/gma500/mdfld_intel_display.c2
-rw-r--r--drivers/gpu/drm/gma500/oaktrail_crtc.c2
-rw-r--r--drivers/gpu/drm/gma500/oaktrail_hdmi.c9
-rw-r--r--drivers/gpu/drm/gma500/oaktrail_lvds.c3
-rw-r--r--drivers/gpu/drm/gma500/psb_drv.c2
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_display.c47
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_drv.h17
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_lvds.c15
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_sdvo.c17
16 files changed, 58 insertions, 124 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_intel_crt.c b/drivers/gpu/drm/gma500/cdv_intel_crt.c
index 7b8386fc3024..0cfcb26fb2a1 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_crt.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_crt.c
@@ -198,7 +198,7 @@ static enum drm_connector_status cdv_intel_crt_detect(
198static void cdv_intel_crt_destroy(struct drm_connector *connector) 198static void cdv_intel_crt_destroy(struct drm_connector *connector)
199{ 199{
200 struct psb_intel_encoder *psb_intel_encoder = 200 struct psb_intel_encoder *psb_intel_encoder =
201 psb_intel_attached_encoder(connector); 201 gma_attached_encoder(connector);
202 202
203 psb_intel_i2c_destroy(psb_intel_encoder->ddc_bus); 203 psb_intel_i2c_destroy(psb_intel_encoder->ddc_bus);
204 drm_sysfs_connector_remove(connector); 204 drm_sysfs_connector_remove(connector);
@@ -209,7 +209,7 @@ static void cdv_intel_crt_destroy(struct drm_connector *connector)
209static int cdv_intel_crt_get_modes(struct drm_connector *connector) 209static int cdv_intel_crt_get_modes(struct drm_connector *connector)
210{ 210{
211 struct psb_intel_encoder *psb_intel_encoder = 211 struct psb_intel_encoder *psb_intel_encoder =
212 psb_intel_attached_encoder(connector); 212 gma_attached_encoder(connector);
213 return psb_intel_ddc_get_modes(connector, &psb_intel_encoder->ddc_bus->adapter); 213 return psb_intel_ddc_get_modes(connector, &psb_intel_encoder->ddc_bus->adapter);
214} 214}
215 215
@@ -227,8 +227,8 @@ static int cdv_intel_crt_set_property(struct drm_connector *connector,
227static const struct drm_encoder_helper_funcs cdv_intel_crt_helper_funcs = { 227static const struct drm_encoder_helper_funcs cdv_intel_crt_helper_funcs = {
228 .dpms = cdv_intel_crt_dpms, 228 .dpms = cdv_intel_crt_dpms,
229 .mode_fixup = cdv_intel_crt_mode_fixup, 229 .mode_fixup = cdv_intel_crt_mode_fixup,
230 .prepare = psb_intel_encoder_prepare, 230 .prepare = gma_encoder_prepare,
231 .commit = psb_intel_encoder_commit, 231 .commit = gma_encoder_commit,
232 .mode_set = cdv_intel_crt_mode_set, 232 .mode_set = cdv_intel_crt_mode_set,
233}; 233};
234 234
@@ -244,7 +244,7 @@ static const struct drm_connector_helper_funcs
244 cdv_intel_crt_connector_helper_funcs = { 244 cdv_intel_crt_connector_helper_funcs = {
245 .mode_valid = cdv_intel_crt_mode_valid, 245 .mode_valid = cdv_intel_crt_mode_valid,
246 .get_modes = cdv_intel_crt_get_modes, 246 .get_modes = cdv_intel_crt_get_modes,
247 .best_encoder = psb_intel_best_encoder, 247 .best_encoder = gma_best_encoder,
248}; 248};
249 249
250static void cdv_intel_crt_enc_destroy(struct drm_encoder *encoder) 250static void cdv_intel_crt_enc_destroy(struct drm_encoder *encoder)
@@ -284,8 +284,7 @@ void cdv_intel_crt_init(struct drm_device *dev,
284 drm_encoder_init(dev, encoder, 284 drm_encoder_init(dev, encoder,
285 &cdv_intel_crt_enc_funcs, DRM_MODE_ENCODER_DAC); 285 &cdv_intel_crt_enc_funcs, DRM_MODE_ENCODER_DAC);
286 286
287 psb_intel_connector_attach_encoder(psb_intel_connector, 287 gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
288 psb_intel_encoder);
289 288
290 /* Set up the DDC bus. */ 289 /* Set up the DDC bus. */
291 i2c_reg = GPIOA; 290 i2c_reg = GPIOA;
diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c
index 2351f4223b83..257e0e8820ec 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_display.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_display.c
@@ -499,7 +499,7 @@ static bool is_pipeb_lvds(struct drm_device *dev, struct drm_crtc *crtc)
499 499
500 list_for_each_entry(connector, &mode_config->connector_list, head) { 500 list_for_each_entry(connector, &mode_config->connector_list, head) {
501 struct psb_intel_encoder *psb_intel_encoder = 501 struct psb_intel_encoder *psb_intel_encoder =
502 psb_intel_attached_encoder(connector); 502 gma_attached_encoder(connector);
503 503
504 if (!connector->encoder 504 if (!connector->encoder
505 || connector->encoder->crtc != crtc) 505 || connector->encoder->crtc != crtc)
@@ -634,7 +634,7 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,
634 634
635 list_for_each_entry(connector, &mode_config->connector_list, head) { 635 list_for_each_entry(connector, &mode_config->connector_list, head) {
636 struct psb_intel_encoder *psb_intel_encoder = 636 struct psb_intel_encoder *psb_intel_encoder =
637 psb_intel_attached_encoder(connector); 637 gma_attached_encoder(connector);
638 638
639 if (!connector->encoder 639 if (!connector->encoder
640 || connector->encoder->crtc != crtc) 640 || connector->encoder->crtc != crtc)
diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
index 839ab83ff6ec..e3907becf8c9 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
@@ -315,7 +315,7 @@ static int
315cdv_intel_dp_mode_valid(struct drm_connector *connector, 315cdv_intel_dp_mode_valid(struct drm_connector *connector,
316 struct drm_display_mode *mode) 316 struct drm_display_mode *mode)
317{ 317{
318 struct psb_intel_encoder *encoder = psb_intel_attached_encoder(connector); 318 struct psb_intel_encoder *encoder = gma_attached_encoder(connector);
319 struct cdv_intel_dp *intel_dp = encoder->dev_priv; 319 struct cdv_intel_dp *intel_dp = encoder->dev_priv;
320 int max_link_clock = cdv_intel_dp_link_clock(cdv_intel_dp_max_link_bw(encoder)); 320 int max_link_clock = cdv_intel_dp_link_clock(cdv_intel_dp_max_link_bw(encoder));
321 int max_lanes = cdv_intel_dp_max_lane_count(encoder); 321 int max_lanes = cdv_intel_dp_max_lane_count(encoder);
@@ -1532,7 +1532,7 @@ cdv_dp_detect(struct psb_intel_encoder *encoder)
1532static enum drm_connector_status 1532static enum drm_connector_status
1533cdv_intel_dp_detect(struct drm_connector *connector, bool force) 1533cdv_intel_dp_detect(struct drm_connector *connector, bool force)
1534{ 1534{
1535 struct psb_intel_encoder *encoder = psb_intel_attached_encoder(connector); 1535 struct psb_intel_encoder *encoder = gma_attached_encoder(connector);
1536 struct cdv_intel_dp *intel_dp = encoder->dev_priv; 1536 struct cdv_intel_dp *intel_dp = encoder->dev_priv;
1537 enum drm_connector_status status; 1537 enum drm_connector_status status;
1538 struct edid *edid = NULL; 1538 struct edid *edid = NULL;
@@ -1566,7 +1566,8 @@ cdv_intel_dp_detect(struct drm_connector *connector, bool force)
1566 1566
1567static int cdv_intel_dp_get_modes(struct drm_connector *connector) 1567static int cdv_intel_dp_get_modes(struct drm_connector *connector)
1568{ 1568{
1569 struct psb_intel_encoder *intel_encoder = psb_intel_attached_encoder(connector); 1569 struct psb_intel_encoder *intel_encoder =
1570 gma_attached_encoder(connector);
1570 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; 1571 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv;
1571 struct edid *edid = NULL; 1572 struct edid *edid = NULL;
1572 int ret = 0; 1573 int ret = 0;
@@ -1622,7 +1623,7 @@ static int cdv_intel_dp_get_modes(struct drm_connector *connector)
1622static bool 1623static bool
1623cdv_intel_dp_detect_audio(struct drm_connector *connector) 1624cdv_intel_dp_detect_audio(struct drm_connector *connector)
1624{ 1625{
1625 struct psb_intel_encoder *encoder = psb_intel_attached_encoder(connector); 1626 struct psb_intel_encoder *encoder = gma_attached_encoder(connector);
1626 struct cdv_intel_dp *intel_dp = encoder->dev_priv; 1627 struct cdv_intel_dp *intel_dp = encoder->dev_priv;
1627 struct edid *edid; 1628 struct edid *edid;
1628 bool has_audio = false; 1629 bool has_audio = false;
@@ -1648,7 +1649,7 @@ cdv_intel_dp_set_property(struct drm_connector *connector,
1648 uint64_t val) 1649 uint64_t val)
1649{ 1650{
1650 struct drm_psb_private *dev_priv = connector->dev->dev_private; 1651 struct drm_psb_private *dev_priv = connector->dev->dev_private;
1651 struct psb_intel_encoder *encoder = psb_intel_attached_encoder(connector); 1652 struct psb_intel_encoder *encoder = gma_attached_encoder(connector);
1652 struct cdv_intel_dp *intel_dp = encoder->dev_priv; 1653 struct cdv_intel_dp *intel_dp = encoder->dev_priv;
1653 int ret; 1654 int ret;
1654 1655
@@ -1702,7 +1703,7 @@ static void
1702cdv_intel_dp_destroy(struct drm_connector *connector) 1703cdv_intel_dp_destroy(struct drm_connector *connector)
1703{ 1704{
1704 struct psb_intel_encoder *psb_intel_encoder = 1705 struct psb_intel_encoder *psb_intel_encoder =
1705 psb_intel_attached_encoder(connector); 1706 gma_attached_encoder(connector);
1706 struct cdv_intel_dp *intel_dp = psb_intel_encoder->dev_priv; 1707 struct cdv_intel_dp *intel_dp = psb_intel_encoder->dev_priv;
1707 1708
1708 if (is_edp(psb_intel_encoder)) { 1709 if (is_edp(psb_intel_encoder)) {
@@ -1742,7 +1743,7 @@ static const struct drm_connector_funcs cdv_intel_dp_connector_funcs = {
1742static const struct drm_connector_helper_funcs cdv_intel_dp_connector_helper_funcs = { 1743static const struct drm_connector_helper_funcs cdv_intel_dp_connector_helper_funcs = {
1743 .get_modes = cdv_intel_dp_get_modes, 1744 .get_modes = cdv_intel_dp_get_modes,
1744 .mode_valid = cdv_intel_dp_mode_valid, 1745 .mode_valid = cdv_intel_dp_mode_valid,
1745 .best_encoder = psb_intel_best_encoder, 1746 .best_encoder = gma_best_encoder,
1746}; 1747};
1747 1748
1748static const struct drm_encoder_funcs cdv_intel_dp_enc_funcs = { 1749static const struct drm_encoder_funcs cdv_intel_dp_enc_funcs = {
@@ -1828,7 +1829,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev
1828 drm_connector_init(dev, connector, &cdv_intel_dp_connector_funcs, type); 1829 drm_connector_init(dev, connector, &cdv_intel_dp_connector_funcs, type);
1829 drm_encoder_init(dev, encoder, &cdv_intel_dp_enc_funcs, DRM_MODE_ENCODER_TMDS); 1830 drm_encoder_init(dev, encoder, &cdv_intel_dp_enc_funcs, DRM_MODE_ENCODER_TMDS);
1830 1831
1831 psb_intel_connector_attach_encoder(psb_intel_connector, psb_intel_encoder); 1832 gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
1832 1833
1833 if (type == DRM_MODE_CONNECTOR_DisplayPort) 1834 if (type == DRM_MODE_CONNECTOR_DisplayPort)
1834 psb_intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT; 1835 psb_intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index 464153d9d2df..a849e912f30a 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -117,7 +117,7 @@ static void cdv_hdmi_save(struct drm_connector *connector)
117{ 117{
118 struct drm_device *dev = connector->dev; 118 struct drm_device *dev = connector->dev;
119 struct psb_intel_encoder *psb_intel_encoder = 119 struct psb_intel_encoder *psb_intel_encoder =
120 psb_intel_attached_encoder(connector); 120 gma_attached_encoder(connector);
121 struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv; 121 struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv;
122 122
123 hdmi_priv->save_HDMIB = REG_READ(hdmi_priv->hdmi_reg); 123 hdmi_priv->save_HDMIB = REG_READ(hdmi_priv->hdmi_reg);
@@ -127,7 +127,7 @@ static void cdv_hdmi_restore(struct drm_connector *connector)
127{ 127{
128 struct drm_device *dev = connector->dev; 128 struct drm_device *dev = connector->dev;
129 struct psb_intel_encoder *psb_intel_encoder = 129 struct psb_intel_encoder *psb_intel_encoder =
130 psb_intel_attached_encoder(connector); 130 gma_attached_encoder(connector);
131 struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv; 131 struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv;
132 132
133 REG_WRITE(hdmi_priv->hdmi_reg, hdmi_priv->save_HDMIB); 133 REG_WRITE(hdmi_priv->hdmi_reg, hdmi_priv->save_HDMIB);
@@ -138,7 +138,7 @@ static enum drm_connector_status cdv_hdmi_detect(
138 struct drm_connector *connector, bool force) 138 struct drm_connector *connector, bool force)
139{ 139{
140 struct psb_intel_encoder *psb_intel_encoder = 140 struct psb_intel_encoder *psb_intel_encoder =
141 psb_intel_attached_encoder(connector); 141 gma_attached_encoder(connector);
142 struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv; 142 struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv;
143 struct edid *edid = NULL; 143 struct edid *edid = NULL;
144 enum drm_connector_status status = connector_status_disconnected; 144 enum drm_connector_status status = connector_status_disconnected;
@@ -222,7 +222,7 @@ static int cdv_hdmi_set_property(struct drm_connector *connector,
222static int cdv_hdmi_get_modes(struct drm_connector *connector) 222static int cdv_hdmi_get_modes(struct drm_connector *connector)
223{ 223{
224 struct psb_intel_encoder *psb_intel_encoder = 224 struct psb_intel_encoder *psb_intel_encoder =
225 psb_intel_attached_encoder(connector); 225 gma_attached_encoder(connector);
226 struct edid *edid = NULL; 226 struct edid *edid = NULL;
227 int ret = 0; 227 int ret = 0;
228 228
@@ -257,7 +257,7 @@ static int cdv_hdmi_mode_valid(struct drm_connector *connector,
257static void cdv_hdmi_destroy(struct drm_connector *connector) 257static void cdv_hdmi_destroy(struct drm_connector *connector)
258{ 258{
259 struct psb_intel_encoder *psb_intel_encoder = 259 struct psb_intel_encoder *psb_intel_encoder =
260 psb_intel_attached_encoder(connector); 260 gma_attached_encoder(connector);
261 261
262 if (psb_intel_encoder->i2c_bus) 262 if (psb_intel_encoder->i2c_bus)
263 psb_intel_i2c_destroy(psb_intel_encoder->i2c_bus); 263 psb_intel_i2c_destroy(psb_intel_encoder->i2c_bus);
@@ -269,16 +269,16 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
269static const struct drm_encoder_helper_funcs cdv_hdmi_helper_funcs = { 269static const struct drm_encoder_helper_funcs cdv_hdmi_helper_funcs = {
270 .dpms = cdv_hdmi_dpms, 270 .dpms = cdv_hdmi_dpms,
271 .mode_fixup = cdv_hdmi_mode_fixup, 271 .mode_fixup = cdv_hdmi_mode_fixup,
272 .prepare = psb_intel_encoder_prepare, 272 .prepare = gma_encoder_prepare,
273 .mode_set = cdv_hdmi_mode_set, 273 .mode_set = cdv_hdmi_mode_set,
274 .commit = psb_intel_encoder_commit, 274 .commit = gma_encoder_commit,
275}; 275};
276 276
277static const struct drm_connector_helper_funcs 277static const struct drm_connector_helper_funcs
278 cdv_hdmi_connector_helper_funcs = { 278 cdv_hdmi_connector_helper_funcs = {
279 .get_modes = cdv_hdmi_get_modes, 279 .get_modes = cdv_hdmi_get_modes,
280 .mode_valid = cdv_hdmi_mode_valid, 280 .mode_valid = cdv_hdmi_mode_valid,
281 .best_encoder = psb_intel_best_encoder, 281 .best_encoder = gma_best_encoder,
282}; 282};
283 283
284static const struct drm_connector_funcs cdv_hdmi_connector_funcs = { 284static const struct drm_connector_funcs cdv_hdmi_connector_funcs = {
@@ -328,8 +328,7 @@ void cdv_hdmi_init(struct drm_device *dev,
328 drm_encoder_init(dev, encoder, &psb_intel_lvds_enc_funcs, 328 drm_encoder_init(dev, encoder, &psb_intel_lvds_enc_funcs,
329 DRM_MODE_ENCODER_TMDS); 329 DRM_MODE_ENCODER_TMDS);
330 330
331 psb_intel_connector_attach_encoder(psb_intel_connector, 331 gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
332 psb_intel_encoder);
333 psb_intel_encoder->type = INTEL_OUTPUT_HDMI; 332 psb_intel_encoder->type = INTEL_OUTPUT_HDMI;
334 hdmi_priv->hdmi_reg = reg; 333 hdmi_priv->hdmi_reg = reg;
335 hdmi_priv->has_hdmi_sink = false; 334 hdmi_priv->has_hdmi_sink = false;
diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index d81dbc3368f0..e461dce1d088 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -408,7 +408,7 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
408 struct drm_device *dev = connector->dev; 408 struct drm_device *dev = connector->dev;
409 struct drm_psb_private *dev_priv = dev->dev_private; 409 struct drm_psb_private *dev_priv = dev->dev_private;
410 struct psb_intel_encoder *psb_intel_encoder = 410 struct psb_intel_encoder *psb_intel_encoder =
411 psb_intel_attached_encoder(connector); 411 gma_attached_encoder(connector);
412 struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; 412 struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
413 int ret; 413 int ret;
414 414
@@ -445,7 +445,7 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
445static void cdv_intel_lvds_destroy(struct drm_connector *connector) 445static void cdv_intel_lvds_destroy(struct drm_connector *connector)
446{ 446{
447 struct psb_intel_encoder *psb_intel_encoder = 447 struct psb_intel_encoder *psb_intel_encoder =
448 psb_intel_attached_encoder(connector); 448 gma_attached_encoder(connector);
449 449
450 if (psb_intel_encoder->i2c_bus) 450 if (psb_intel_encoder->i2c_bus)
451 psb_intel_i2c_destroy(psb_intel_encoder->i2c_bus); 451 psb_intel_i2c_destroy(psb_intel_encoder->i2c_bus);
@@ -529,7 +529,7 @@ static const struct drm_connector_helper_funcs
529 cdv_intel_lvds_connector_helper_funcs = { 529 cdv_intel_lvds_connector_helper_funcs = {
530 .get_modes = cdv_intel_lvds_get_modes, 530 .get_modes = cdv_intel_lvds_get_modes,
531 .mode_valid = cdv_intel_lvds_mode_valid, 531 .mode_valid = cdv_intel_lvds_mode_valid,
532 .best_encoder = psb_intel_best_encoder, 532 .best_encoder = gma_best_encoder,
533}; 533};
534 534
535static const struct drm_connector_funcs cdv_intel_lvds_connector_funcs = { 535static const struct drm_connector_funcs cdv_intel_lvds_connector_funcs = {
@@ -659,8 +659,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
659 DRM_MODE_ENCODER_LVDS); 659 DRM_MODE_ENCODER_LVDS);
660 660
661 661
662 psb_intel_connector_attach_encoder(psb_intel_connector, 662 gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
663 psb_intel_encoder);
664 psb_intel_encoder->type = INTEL_OUTPUT_LVDS; 663 psb_intel_encoder->type = INTEL_OUTPUT_LVDS;
665 664
666 drm_encoder_helper_add(encoder, &cdv_intel_lvds_helper_funcs); 665 drm_encoder_helper_add(encoder, &cdv_intel_lvds_helper_funcs);
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index 362dd2ad286f..e0e7eb0680e6 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -704,7 +704,7 @@ static void psb_setup_outputs(struct drm_device *dev)
704 list_for_each_entry(connector, &dev->mode_config.connector_list, 704 list_for_each_entry(connector, &dev->mode_config.connector_list,
705 head) { 705 head) {
706 struct psb_intel_encoder *psb_intel_encoder = 706 struct psb_intel_encoder *psb_intel_encoder =
707 psb_intel_attached_encoder(connector); 707 gma_attached_encoder(connector);
708 struct drm_encoder *encoder = &psb_intel_encoder->base; 708 struct drm_encoder *encoder = &psb_intel_encoder->base;
709 int crtc_mask = 0, clone_mask = 0; 709 int crtc_mask = 0, clone_mask = 0;
710 710
diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c
index 98a0eec38cbe..67d86d8fcd4d 100644
--- a/drivers/gpu/drm/gma500/gma_display.c
+++ b/drivers/gpu/drm/gma500/gma_display.c
@@ -38,7 +38,7 @@ bool gma_pipe_has_type(struct drm_crtc *crtc, int type)
38 list_for_each_entry(l_entry, &mode_config->connector_list, head) { 38 list_for_each_entry(l_entry, &mode_config->connector_list, head) {
39 if (l_entry->encoder && l_entry->encoder->crtc == crtc) { 39 if (l_entry->encoder && l_entry->encoder->crtc == crtc) {
40 struct psb_intel_encoder *psb_intel_encoder = 40 struct psb_intel_encoder *psb_intel_encoder =
41 psb_intel_attached_encoder(l_entry); 41 gma_attached_encoder(l_entry);
42 if (psb_intel_encoder->type == type) 42 if (psb_intel_encoder->type == type)
43 return true; 43 return true;
44 } 44 }
@@ -547,7 +547,7 @@ void gma_encoder_destroy(struct drm_encoder *encoder)
547struct drm_encoder *gma_best_encoder(struct drm_connector *connector) 547struct drm_encoder *gma_best_encoder(struct drm_connector *connector)
548{ 548{
549 struct psb_intel_encoder *psb_intel_encoder = 549 struct psb_intel_encoder *psb_intel_encoder =
550 psb_intel_attached_encoder(connector); 550 gma_attached_encoder(connector);
551 551
552 return &psb_intel_encoder->base; 552 return &psb_intel_encoder->base;
553} 553}
diff --git a/drivers/gpu/drm/gma500/mdfld_intel_display.c b/drivers/gpu/drm/gma500/mdfld_intel_display.c
index 0114408c483f..e5d3a02ac650 100644
--- a/drivers/gpu/drm/gma500/mdfld_intel_display.c
+++ b/drivers/gpu/drm/gma500/mdfld_intel_display.c
@@ -747,7 +747,7 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
747 if (encoder->crtc != crtc) 747 if (encoder->crtc != crtc)
748 continue; 748 continue;
749 749
750 psb_intel_encoder = psb_intel_attached_encoder(connector); 750 psb_intel_encoder = gma_attached_encoder(connector);
751 751
752 switch (psb_intel_encoder->type) { 752 switch (psb_intel_encoder->type) {
753 case INTEL_OUTPUT_MIPI: 753 case INTEL_OUTPUT_MIPI:
diff --git a/drivers/gpu/drm/gma500/oaktrail_crtc.c b/drivers/gpu/drm/gma500/oaktrail_crtc.c
index 504ae1117782..b2744293c5c8 100644
--- a/drivers/gpu/drm/gma500/oaktrail_crtc.c
+++ b/drivers/gpu/drm/gma500/oaktrail_crtc.c
@@ -324,7 +324,7 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc,
324 if (!connector->encoder || connector->encoder->crtc != crtc) 324 if (!connector->encoder || connector->encoder->crtc != crtc)
325 continue; 325 continue;
326 326
327 psb_intel_encoder = psb_intel_attached_encoder(connector); 327 psb_intel_encoder = gma_attached_encoder(connector);
328 328
329 switch (psb_intel_encoder->type) { 329 switch (psb_intel_encoder->type) {
330 case INTEL_OUTPUT_LVDS: 330 case INTEL_OUTPUT_LVDS:
diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
index 7d9a5ee52814..059de197c942 100644
--- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
+++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
@@ -609,16 +609,16 @@ static void oaktrail_hdmi_destroy(struct drm_connector *connector)
609static const struct drm_encoder_helper_funcs oaktrail_hdmi_helper_funcs = { 609static const struct drm_encoder_helper_funcs oaktrail_hdmi_helper_funcs = {
610 .dpms = oaktrail_hdmi_dpms, 610 .dpms = oaktrail_hdmi_dpms,
611 .mode_fixup = oaktrail_hdmi_mode_fixup, 611 .mode_fixup = oaktrail_hdmi_mode_fixup,
612 .prepare = psb_intel_encoder_prepare, 612 .prepare = gma_encoder_prepare,
613 .mode_set = oaktrail_hdmi_mode_set, 613 .mode_set = oaktrail_hdmi_mode_set,
614 .commit = psb_intel_encoder_commit, 614 .commit = gma_encoder_commit,
615}; 615};
616 616
617static const struct drm_connector_helper_funcs 617static const struct drm_connector_helper_funcs
618 oaktrail_hdmi_connector_helper_funcs = { 618 oaktrail_hdmi_connector_helper_funcs = {
619 .get_modes = oaktrail_hdmi_get_modes, 619 .get_modes = oaktrail_hdmi_get_modes,
620 .mode_valid = oaktrail_hdmi_mode_valid, 620 .mode_valid = oaktrail_hdmi_mode_valid,
621 .best_encoder = psb_intel_best_encoder, 621 .best_encoder = gma_best_encoder,
622}; 622};
623 623
624static const struct drm_connector_funcs oaktrail_hdmi_connector_funcs = { 624static const struct drm_connector_funcs oaktrail_hdmi_connector_funcs = {
@@ -663,8 +663,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
663 &oaktrail_hdmi_enc_funcs, 663 &oaktrail_hdmi_enc_funcs,
664 DRM_MODE_ENCODER_TMDS); 664 DRM_MODE_ENCODER_TMDS);
665 665
666 psb_intel_connector_attach_encoder(psb_intel_connector, 666 gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
667 psb_intel_encoder);
668 667
669 psb_intel_encoder->type = INTEL_OUTPUT_HDMI; 668 psb_intel_encoder->type = INTEL_OUTPUT_HDMI;
670 drm_encoder_helper_add(encoder, &oaktrail_hdmi_helper_funcs); 669 drm_encoder_helper_add(encoder, &oaktrail_hdmi_helper_funcs);
diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c
index 325013a9c48c..7b1cfd6d1606 100644
--- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
+++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
@@ -352,8 +352,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
352 drm_encoder_init(dev, encoder, &psb_intel_lvds_enc_funcs, 352 drm_encoder_init(dev, encoder, &psb_intel_lvds_enc_funcs,
353 DRM_MODE_ENCODER_LVDS); 353 DRM_MODE_ENCODER_LVDS);
354 354
355 psb_intel_connector_attach_encoder(psb_intel_connector, 355 gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
356 psb_intel_encoder);
357 psb_intel_encoder->type = INTEL_OUTPUT_LVDS; 356 psb_intel_encoder->type = INTEL_OUTPUT_LVDS;
358 357
359 drm_encoder_helper_add(encoder, &oaktrail_lvds_helper_funcs); 358 drm_encoder_helper_add(encoder, &oaktrail_lvds_helper_funcs);
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index b4d13261f762..ab8b9ef86c37 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -372,7 +372,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)
372 /* Only add backlight support if we have LVDS output */ 372 /* Only add backlight support if we have LVDS output */
373 list_for_each_entry(connector, &dev->mode_config.connector_list, 373 list_for_each_entry(connector, &dev->mode_config.connector_list,
374 head) { 374 head) {
375 psb_intel_encoder = psb_intel_attached_encoder(connector); 375 psb_intel_encoder = gma_attached_encoder(connector);
376 376
377 switch (psb_intel_encoder->type) { 377 switch (psb_intel_encoder->type) {
378 case INTEL_OUTPUT_LVDS: 378 case INTEL_OUTPUT_LVDS:
diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c
index 1e6a357a245e..a419e7969cc8 100644
--- a/drivers/gpu/drm/gma500/psb_intel_display.c
+++ b/drivers/gpu/drm/gma500/psb_intel_display.c
@@ -82,30 +82,6 @@ static void psb_intel_clock(int refclk, struct gma_clock_t *clock)
82 clock->dot = clock->vco / clock->p; 82 clock->dot = clock->vco / clock->p;
83} 83}
84 84
85void psb_intel_encoder_prepare(struct drm_encoder *encoder)
86{
87 struct drm_encoder_helper_funcs *encoder_funcs =
88 encoder->helper_private;
89 /* lvds has its own version of prepare see psb_intel_lvds_prepare */
90 encoder_funcs->dpms(encoder, DRM_MODE_DPMS_OFF);
91}
92
93void psb_intel_encoder_commit(struct drm_encoder *encoder)
94{
95 struct drm_encoder_helper_funcs *encoder_funcs =
96 encoder->helper_private;
97 /* lvds has its own version of commit see psb_intel_lvds_commit */
98 encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON);
99}
100
101void psb_intel_encoder_destroy(struct drm_encoder *encoder)
102{
103 struct psb_intel_encoder *intel_encoder = to_psb_intel_encoder(encoder);
104
105 drm_encoder_cleanup(encoder);
106 kfree(intel_encoder);
107}
108
109/** 85/**
110 * Return the pipe currently connected to the panel fitter, 86 * Return the pipe currently connected to the panel fitter,
111 * or -1 if the panel fitter is not present or not in use 87 * or -1 if the panel fitter is not present or not in use
@@ -152,7 +128,7 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc,
152 128
153 list_for_each_entry(connector, &mode_config->connector_list, head) { 129 list_for_each_entry(connector, &mode_config->connector_list, head) {
154 struct psb_intel_encoder *psb_intel_encoder = 130 struct psb_intel_encoder *psb_intel_encoder =
155 psb_intel_attached_encoder(connector); 131 gma_attached_encoder(connector);
156 132
157 if (!connector->encoder 133 if (!connector->encoder
158 || connector->encoder->crtc != crtc) 134 || connector->encoder->crtc != crtc)
@@ -752,29 +728,10 @@ int psb_intel_connector_clones(struct drm_device *dev, int type_mask)
752 list_for_each_entry(connector, &dev->mode_config.connector_list, 728 list_for_each_entry(connector, &dev->mode_config.connector_list,
753 head) { 729 head) {
754 struct psb_intel_encoder *psb_intel_encoder = 730 struct psb_intel_encoder *psb_intel_encoder =
755 psb_intel_attached_encoder(connector); 731 gma_attached_encoder(connector);
756 if (type_mask & (1 << psb_intel_encoder->type)) 732 if (type_mask & (1 << psb_intel_encoder->type))
757 index_mask |= (1 << entry); 733 index_mask |= (1 << entry);
758 entry++; 734 entry++;
759 } 735 }
760 return index_mask; 736 return index_mask;
761} 737}
762
763/* current intel driver doesn't take advantage of encoders
764 always give back the encoder for the connector
765*/
766struct drm_encoder *psb_intel_best_encoder(struct drm_connector *connector)
767{
768 struct psb_intel_encoder *psb_intel_encoder =
769 psb_intel_attached_encoder(connector);
770
771 return &psb_intel_encoder->base;
772}
773
774void psb_intel_connector_attach_encoder(struct psb_intel_connector *connector,
775 struct psb_intel_encoder *encoder)
776{
777 connector->encoder = encoder;
778 drm_mode_connector_attach_encoder(&connector->base,
779 &encoder->base);
780}
diff --git a/drivers/gpu/drm/gma500/psb_intel_drv.h b/drivers/gpu/drm/gma500/psb_intel_drv.h
index 39f09e067beb..1e1bf8bbfe5a 100644
--- a/drivers/gpu/drm/gma500/psb_intel_drv.h
+++ b/drivers/gpu/drm/gma500/psb_intel_drv.h
@@ -226,33 +226,16 @@ extern void oaktrail_dsi_init(struct drm_device *dev,
226extern void mid_dsi_init(struct drm_device *dev, 226extern void mid_dsi_init(struct drm_device *dev,
227 struct psb_intel_mode_device *mode_dev, int dsi_num); 227 struct psb_intel_mode_device *mode_dev, int dsi_num);
228 228
229extern void psb_intel_encoder_prepare(struct drm_encoder *encoder);
230extern void psb_intel_encoder_commit(struct drm_encoder *encoder);
231extern void psb_intel_encoder_destroy(struct drm_encoder *encoder);
232
233extern struct drm_encoder *gma_best_encoder(struct drm_connector *connector); 229extern struct drm_encoder *gma_best_encoder(struct drm_connector *connector);
234extern void gma_connector_attach_encoder(struct psb_intel_connector *connector, 230extern void gma_connector_attach_encoder(struct psb_intel_connector *connector,
235 struct psb_intel_encoder *encoder); 231 struct psb_intel_encoder *encoder);
236 232
237static inline struct psb_intel_encoder *psb_intel_attached_encoder(
238 struct drm_connector *connector)
239{
240 return to_psb_intel_connector(connector)->encoder;
241}
242
243static inline struct psb_intel_encoder *gma_attached_encoder( 233static inline struct psb_intel_encoder *gma_attached_encoder(
244 struct drm_connector *connector) 234 struct drm_connector *connector)
245{ 235{
246 return to_psb_intel_connector(connector)->encoder; 236 return to_psb_intel_connector(connector)->encoder;
247} 237}
248 238
249extern void psb_intel_connector_attach_encoder(
250 struct psb_intel_connector *connector,
251 struct psb_intel_encoder *encoder);
252
253extern struct drm_encoder *psb_intel_best_encoder(struct drm_connector
254 *connector);
255
256extern struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev, 239extern struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev,
257 struct drm_crtc *crtc); 240 struct drm_crtc *crtc);
258extern int psb_intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, 241extern int psb_intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index 9fa5fa2e6192..42541e8ea0ad 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -268,7 +268,7 @@ static void psb_intel_lvds_save(struct drm_connector *connector)
268 struct drm_psb_private *dev_priv = 268 struct drm_psb_private *dev_priv =
269 (struct drm_psb_private *)dev->dev_private; 269 (struct drm_psb_private *)dev->dev_private;
270 struct psb_intel_encoder *psb_intel_encoder = 270 struct psb_intel_encoder *psb_intel_encoder =
271 psb_intel_attached_encoder(connector); 271 gma_attached_encoder(connector);
272 struct psb_intel_lvds_priv *lvds_priv = 272 struct psb_intel_lvds_priv *lvds_priv =
273 (struct psb_intel_lvds_priv *)psb_intel_encoder->dev_priv; 273 (struct psb_intel_lvds_priv *)psb_intel_encoder->dev_priv;
274 274
@@ -308,7 +308,7 @@ static void psb_intel_lvds_restore(struct drm_connector *connector)
308 struct drm_device *dev = connector->dev; 308 struct drm_device *dev = connector->dev;
309 u32 pp_status; 309 u32 pp_status;
310 struct psb_intel_encoder *psb_intel_encoder = 310 struct psb_intel_encoder *psb_intel_encoder =
311 psb_intel_attached_encoder(connector); 311 gma_attached_encoder(connector);
312 struct psb_intel_lvds_priv *lvds_priv = 312 struct psb_intel_lvds_priv *lvds_priv =
313 (struct psb_intel_lvds_priv *)psb_intel_encoder->dev_priv; 313 (struct psb_intel_lvds_priv *)psb_intel_encoder->dev_priv;
314 314
@@ -350,7 +350,7 @@ int psb_intel_lvds_mode_valid(struct drm_connector *connector,
350{ 350{
351 struct drm_psb_private *dev_priv = connector->dev->dev_private; 351 struct drm_psb_private *dev_priv = connector->dev->dev_private;
352 struct psb_intel_encoder *psb_intel_encoder = 352 struct psb_intel_encoder *psb_intel_encoder =
353 psb_intel_attached_encoder(connector); 353 gma_attached_encoder(connector);
354 struct drm_display_mode *fixed_mode = 354 struct drm_display_mode *fixed_mode =
355 dev_priv->mode_dev.panel_fixed_mode; 355 dev_priv->mode_dev.panel_fixed_mode;
356 356
@@ -526,7 +526,7 @@ static int psb_intel_lvds_get_modes(struct drm_connector *connector)
526 struct drm_psb_private *dev_priv = dev->dev_private; 526 struct drm_psb_private *dev_priv = dev->dev_private;
527 struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; 527 struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
528 struct psb_intel_encoder *psb_intel_encoder = 528 struct psb_intel_encoder *psb_intel_encoder =
529 psb_intel_attached_encoder(connector); 529 gma_attached_encoder(connector);
530 struct psb_intel_lvds_priv *lvds_priv = psb_intel_encoder->dev_priv; 530 struct psb_intel_lvds_priv *lvds_priv = psb_intel_encoder->dev_priv;
531 int ret = 0; 531 int ret = 0;
532 532
@@ -565,7 +565,7 @@ static int psb_intel_lvds_get_modes(struct drm_connector *connector)
565void psb_intel_lvds_destroy(struct drm_connector *connector) 565void psb_intel_lvds_destroy(struct drm_connector *connector)
566{ 566{
567 struct psb_intel_encoder *psb_intel_encoder = 567 struct psb_intel_encoder *psb_intel_encoder =
568 psb_intel_attached_encoder(connector); 568 gma_attached_encoder(connector);
569 struct psb_intel_lvds_priv *lvds_priv = psb_intel_encoder->dev_priv; 569 struct psb_intel_lvds_priv *lvds_priv = psb_intel_encoder->dev_priv;
570 570
571 if (lvds_priv->ddc_bus) 571 if (lvds_priv->ddc_bus)
@@ -656,7 +656,7 @@ const struct drm_connector_helper_funcs
656 psb_intel_lvds_connector_helper_funcs = { 656 psb_intel_lvds_connector_helper_funcs = {
657 .get_modes = psb_intel_lvds_get_modes, 657 .get_modes = psb_intel_lvds_get_modes,
658 .mode_valid = psb_intel_lvds_mode_valid, 658 .mode_valid = psb_intel_lvds_mode_valid,
659 .best_encoder = psb_intel_best_encoder, 659 .best_encoder = gma_best_encoder,
660}; 660};
661 661
662const struct drm_connector_funcs psb_intel_lvds_connector_funcs = { 662const struct drm_connector_funcs psb_intel_lvds_connector_funcs = {
@@ -734,8 +734,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
734 &psb_intel_lvds_enc_funcs, 734 &psb_intel_lvds_enc_funcs,
735 DRM_MODE_ENCODER_LVDS); 735 DRM_MODE_ENCODER_LVDS);
736 736
737 psb_intel_connector_attach_encoder(psb_intel_connector, 737 gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
738 psb_intel_encoder);
739 psb_intel_encoder->type = INTEL_OUTPUT_LVDS; 738 psb_intel_encoder->type = INTEL_OUTPUT_LVDS;
740 739
741 drm_encoder_helper_add(encoder, &psb_intel_lvds_helper_funcs); 740 drm_encoder_helper_add(encoder, &psb_intel_lvds_helper_funcs);
diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
index e3d1078ecf09..631e01abc04b 100644
--- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
+++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
@@ -200,7 +200,7 @@ static struct psb_intel_sdvo *to_psb_intel_sdvo(struct drm_encoder *encoder)
200 200
201static struct psb_intel_sdvo *intel_attached_sdvo(struct drm_connector *connector) 201static struct psb_intel_sdvo *intel_attached_sdvo(struct drm_connector *connector)
202{ 202{
203 return container_of(psb_intel_attached_encoder(connector), 203 return container_of(gma_attached_encoder(connector),
204 struct psb_intel_sdvo, base); 204 struct psb_intel_sdvo, base);
205} 205}
206 206
@@ -1837,7 +1837,7 @@ static void psb_intel_sdvo_save(struct drm_connector *connector)
1837{ 1837{
1838 struct drm_device *dev = connector->dev; 1838 struct drm_device *dev = connector->dev;
1839 struct psb_intel_encoder *psb_intel_encoder = 1839 struct psb_intel_encoder *psb_intel_encoder =
1840 psb_intel_attached_encoder(connector); 1840 gma_attached_encoder(connector);
1841 struct psb_intel_sdvo *sdvo = 1841 struct psb_intel_sdvo *sdvo =
1842 to_psb_intel_sdvo(&psb_intel_encoder->base); 1842 to_psb_intel_sdvo(&psb_intel_encoder->base);
1843 1843
@@ -1847,8 +1847,7 @@ static void psb_intel_sdvo_save(struct drm_connector *connector)
1847static void psb_intel_sdvo_restore(struct drm_connector *connector) 1847static void psb_intel_sdvo_restore(struct drm_connector *connector)
1848{ 1848{
1849 struct drm_device *dev = connector->dev; 1849 struct drm_device *dev = connector->dev;
1850 struct drm_encoder *encoder = 1850 struct drm_encoder *encoder = &gma_attached_encoder(connector)->base;
1851 &psb_intel_attached_encoder(connector)->base;
1852 struct psb_intel_sdvo *sdvo = to_psb_intel_sdvo(encoder); 1851 struct psb_intel_sdvo *sdvo = to_psb_intel_sdvo(encoder);
1853 struct drm_crtc *crtc = encoder->crtc; 1852 struct drm_crtc *crtc = encoder->crtc;
1854 1853
@@ -1864,9 +1863,9 @@ static void psb_intel_sdvo_restore(struct drm_connector *connector)
1864static const struct drm_encoder_helper_funcs psb_intel_sdvo_helper_funcs = { 1863static const struct drm_encoder_helper_funcs psb_intel_sdvo_helper_funcs = {
1865 .dpms = psb_intel_sdvo_dpms, 1864 .dpms = psb_intel_sdvo_dpms,
1866 .mode_fixup = psb_intel_sdvo_mode_fixup, 1865 .mode_fixup = psb_intel_sdvo_mode_fixup,
1867 .prepare = psb_intel_encoder_prepare, 1866 .prepare = gma_encoder_prepare,
1868 .mode_set = psb_intel_sdvo_mode_set, 1867 .mode_set = psb_intel_sdvo_mode_set,
1869 .commit = psb_intel_encoder_commit, 1868 .commit = gma_encoder_commit,
1870}; 1869};
1871 1870
1872static const struct drm_connector_funcs psb_intel_sdvo_connector_funcs = { 1871static const struct drm_connector_funcs psb_intel_sdvo_connector_funcs = {
@@ -1882,7 +1881,7 @@ static const struct drm_connector_funcs psb_intel_sdvo_connector_funcs = {
1882static const struct drm_connector_helper_funcs psb_intel_sdvo_connector_helper_funcs = { 1881static const struct drm_connector_helper_funcs psb_intel_sdvo_connector_helper_funcs = {
1883 .get_modes = psb_intel_sdvo_get_modes, 1882 .get_modes = psb_intel_sdvo_get_modes,
1884 .mode_valid = psb_intel_sdvo_mode_valid, 1883 .mode_valid = psb_intel_sdvo_mode_valid,
1885 .best_encoder = psb_intel_best_encoder, 1884 .best_encoder = gma_best_encoder,
1886}; 1885};
1887 1886
1888static void psb_intel_sdvo_enc_destroy(struct drm_encoder *encoder) 1887static void psb_intel_sdvo_enc_destroy(struct drm_encoder *encoder)
@@ -1894,7 +1893,7 @@ static void psb_intel_sdvo_enc_destroy(struct drm_encoder *encoder)
1894 psb_intel_sdvo->sdvo_lvds_fixed_mode); 1893 psb_intel_sdvo->sdvo_lvds_fixed_mode);
1895 1894
1896 i2c_del_adapter(&psb_intel_sdvo->ddc); 1895 i2c_del_adapter(&psb_intel_sdvo->ddc);
1897 psb_intel_encoder_destroy(encoder); 1896 gma_encoder_destroy(encoder);
1898} 1897}
1899 1898
1900static const struct drm_encoder_funcs psb_intel_sdvo_enc_funcs = { 1899static const struct drm_encoder_funcs psb_intel_sdvo_enc_funcs = {
@@ -2055,7 +2054,7 @@ psb_intel_sdvo_connector_init(struct psb_intel_sdvo_connector *connector,
2055 connector->base.base.doublescan_allowed = 0; 2054 connector->base.base.doublescan_allowed = 0;
2056 connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB; 2055 connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
2057 2056
2058 psb_intel_connector_attach_encoder(&connector->base, &encoder->base); 2057 gma_connector_attach_encoder(&connector->base, &encoder->base);
2059 drm_sysfs_connector_add(&connector->base.base); 2058 drm_sysfs_connector_add(&connector->base.base);
2060} 2059}
2061 2060