drm/gma500: Convert to generic encoder funcs
authorPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Wed, 10 Jul 2013 23:02:01 +0000 (01:02 +0200)
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Tue, 23 Jul 2013 23:47:29 +0000 (01:47 +0200)
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
16 files changed:
drivers/gpu/drm/gma500/cdv_intel_crt.c
drivers/gpu/drm/gma500/cdv_intel_display.c
drivers/gpu/drm/gma500/cdv_intel_dp.c
drivers/gpu/drm/gma500/cdv_intel_hdmi.c
drivers/gpu/drm/gma500/cdv_intel_lvds.c
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/gma500/gma_display.c
drivers/gpu/drm/gma500/mdfld_intel_display.c
drivers/gpu/drm/gma500/oaktrail_crtc.c
drivers/gpu/drm/gma500/oaktrail_hdmi.c
drivers/gpu/drm/gma500/oaktrail_lvds.c
drivers/gpu/drm/gma500/psb_drv.c
drivers/gpu/drm/gma500/psb_intel_display.c
drivers/gpu/drm/gma500/psb_intel_drv.h
drivers/gpu/drm/gma500/psb_intel_lvds.c
drivers/gpu/drm/gma500/psb_intel_sdvo.c

index 7b8386fc30242b194fa2eb7d081b9d2168711f79..0cfcb26fb2a159d861761b2372bfe78d670efa87 100644 (file)
@@ -198,7 +198,7 @@ static enum drm_connector_status cdv_intel_crt_detect(
 static void cdv_intel_crt_destroy(struct drm_connector *connector)
 {
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                       gma_attached_encoder(connector);
 
        psb_intel_i2c_destroy(psb_intel_encoder->ddc_bus);
        drm_sysfs_connector_remove(connector);
@@ -209,7 +209,7 @@ static void cdv_intel_crt_destroy(struct drm_connector *connector)
 static int cdv_intel_crt_get_modes(struct drm_connector *connector)
 {
        struct psb_intel_encoder *psb_intel_encoder =
-                               psb_intel_attached_encoder(connector);
+                               gma_attached_encoder(connector);
        return psb_intel_ddc_get_modes(connector, &psb_intel_encoder->ddc_bus->adapter);
 }
 
@@ -227,8 +227,8 @@ static int cdv_intel_crt_set_property(struct drm_connector *connector,
 static const struct drm_encoder_helper_funcs cdv_intel_crt_helper_funcs = {
        .dpms = cdv_intel_crt_dpms,
        .mode_fixup = cdv_intel_crt_mode_fixup,
-       .prepare = psb_intel_encoder_prepare,
-       .commit = psb_intel_encoder_commit,
+       .prepare = gma_encoder_prepare,
+       .commit = gma_encoder_commit,
        .mode_set = cdv_intel_crt_mode_set,
 };
 
@@ -244,7 +244,7 @@ static const struct drm_connector_helper_funcs
                                cdv_intel_crt_connector_helper_funcs = {
        .mode_valid = cdv_intel_crt_mode_valid,
        .get_modes = cdv_intel_crt_get_modes,
-       .best_encoder = psb_intel_best_encoder,
+       .best_encoder = gma_best_encoder,
 };
 
 static void cdv_intel_crt_enc_destroy(struct drm_encoder *encoder)
@@ -284,8 +284,7 @@ void cdv_intel_crt_init(struct drm_device *dev,
        drm_encoder_init(dev, encoder,
                &cdv_intel_crt_enc_funcs, DRM_MODE_ENCODER_DAC);
 
-       psb_intel_connector_attach_encoder(psb_intel_connector,
-                                          psb_intel_encoder);
+       gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
 
        /* Set up the DDC bus. */
        i2c_reg = GPIOA;
index 2351f4223b83e9c4c729c68ea3030244cbd145cc..257e0e8820ec2aef393cd682fa328bd552b0deb9 100644 (file)
@@ -499,7 +499,7 @@ static bool is_pipeb_lvds(struct drm_device *dev, struct drm_crtc *crtc)
 
        list_for_each_entry(connector, &mode_config->connector_list, head) {
                struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                       gma_attached_encoder(connector);
 
                if (!connector->encoder
                    || connector->encoder->crtc != crtc)
@@ -634,7 +634,7 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,
 
        list_for_each_entry(connector, &mode_config->connector_list, head) {
                struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                       gma_attached_encoder(connector);
 
                if (!connector->encoder
                    || connector->encoder->crtc != crtc)
index 839ab83ff6ec2065b4593149dfeb337470d19dd2..e3907becf8c91add39b1ba250feca50a20321334 100644 (file)
@@ -315,7 +315,7 @@ static int
 cdv_intel_dp_mode_valid(struct drm_connector *connector,
                    struct drm_display_mode *mode)
 {
-       struct psb_intel_encoder *encoder = psb_intel_attached_encoder(connector);
+       struct psb_intel_encoder *encoder = gma_attached_encoder(connector);
        struct cdv_intel_dp *intel_dp = encoder->dev_priv;
        int max_link_clock = cdv_intel_dp_link_clock(cdv_intel_dp_max_link_bw(encoder));
        int max_lanes = cdv_intel_dp_max_lane_count(encoder);
@@ -1532,7 +1532,7 @@ cdv_dp_detect(struct psb_intel_encoder *encoder)
 static enum drm_connector_status
 cdv_intel_dp_detect(struct drm_connector *connector, bool force)
 {
-       struct psb_intel_encoder *encoder = psb_intel_attached_encoder(connector);
+       struct psb_intel_encoder *encoder = gma_attached_encoder(connector);
        struct cdv_intel_dp *intel_dp = encoder->dev_priv;
        enum drm_connector_status status;
        struct edid *edid = NULL;
@@ -1566,7 +1566,8 @@ cdv_intel_dp_detect(struct drm_connector *connector, bool force)
 
 static int cdv_intel_dp_get_modes(struct drm_connector *connector)
 {
-       struct psb_intel_encoder *intel_encoder = psb_intel_attached_encoder(connector);
+       struct psb_intel_encoder *intel_encoder =
+                                               gma_attached_encoder(connector);
        struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv;
        struct edid *edid = NULL;
        int ret = 0;
@@ -1622,7 +1623,7 @@ static int cdv_intel_dp_get_modes(struct drm_connector *connector)
 static bool
 cdv_intel_dp_detect_audio(struct drm_connector *connector)
 {
-       struct psb_intel_encoder *encoder = psb_intel_attached_encoder(connector);
+       struct psb_intel_encoder *encoder = gma_attached_encoder(connector);
        struct cdv_intel_dp *intel_dp = encoder->dev_priv;
        struct edid *edid;
        bool has_audio = false;
@@ -1648,7 +1649,7 @@ cdv_intel_dp_set_property(struct drm_connector *connector,
                      uint64_t val)
 {
        struct drm_psb_private *dev_priv = connector->dev->dev_private;
-       struct psb_intel_encoder *encoder = psb_intel_attached_encoder(connector);
+       struct psb_intel_encoder *encoder = gma_attached_encoder(connector);
        struct cdv_intel_dp *intel_dp = encoder->dev_priv;
        int ret;
 
@@ -1702,7 +1703,7 @@ static void
 cdv_intel_dp_destroy(struct drm_connector *connector)
 {
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct cdv_intel_dp *intel_dp = psb_intel_encoder->dev_priv;
 
        if (is_edp(psb_intel_encoder)) {
@@ -1742,7 +1743,7 @@ static const struct drm_connector_funcs cdv_intel_dp_connector_funcs = {
 static const struct drm_connector_helper_funcs cdv_intel_dp_connector_helper_funcs = {
        .get_modes = cdv_intel_dp_get_modes,
        .mode_valid = cdv_intel_dp_mode_valid,
-       .best_encoder = psb_intel_best_encoder,
+       .best_encoder = gma_best_encoder,
 };
 
 static 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
        drm_connector_init(dev, connector, &cdv_intel_dp_connector_funcs, type);
        drm_encoder_init(dev, encoder, &cdv_intel_dp_enc_funcs, DRM_MODE_ENCODER_TMDS);
 
-       psb_intel_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
+       gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
 
        if (type == DRM_MODE_CONNECTOR_DisplayPort)
                psb_intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
index 464153d9d2df770b2805a0add9005ff8460c5541..a849e912f30ad89df4019b55bded0cea1a5caefd 100644 (file)
@@ -117,7 +117,7 @@ static void cdv_hdmi_save(struct drm_connector *connector)
 {
        struct drm_device *dev = connector->dev;
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv;
 
        hdmi_priv->save_HDMIB = REG_READ(hdmi_priv->hdmi_reg);
@@ -127,7 +127,7 @@ static void cdv_hdmi_restore(struct drm_connector *connector)
 {
        struct drm_device *dev = connector->dev;
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv;
 
        REG_WRITE(hdmi_priv->hdmi_reg, hdmi_priv->save_HDMIB);
@@ -138,7 +138,7 @@ static enum drm_connector_status cdv_hdmi_detect(
                                struct drm_connector *connector, bool force)
 {
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv;
        struct edid *edid = NULL;
        enum drm_connector_status status = connector_status_disconnected;
@@ -222,7 +222,7 @@ static int cdv_hdmi_set_property(struct drm_connector *connector,
 static int cdv_hdmi_get_modes(struct drm_connector *connector)
 {
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct edid *edid = NULL;
        int ret = 0;
 
@@ -257,7 +257,7 @@ static int cdv_hdmi_mode_valid(struct drm_connector *connector,
 static void cdv_hdmi_destroy(struct drm_connector *connector)
 {
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
 
        if (psb_intel_encoder->i2c_bus)
                psb_intel_i2c_destroy(psb_intel_encoder->i2c_bus);
@@ -269,16 +269,16 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
 static const struct drm_encoder_helper_funcs cdv_hdmi_helper_funcs = {
        .dpms = cdv_hdmi_dpms,
        .mode_fixup = cdv_hdmi_mode_fixup,
-       .prepare = psb_intel_encoder_prepare,
+       .prepare = gma_encoder_prepare,
        .mode_set = cdv_hdmi_mode_set,
-       .commit = psb_intel_encoder_commit,
+       .commit = gma_encoder_commit,
 };
 
 static const struct drm_connector_helper_funcs
                                        cdv_hdmi_connector_helper_funcs = {
        .get_modes = cdv_hdmi_get_modes,
        .mode_valid = cdv_hdmi_mode_valid,
-       .best_encoder = psb_intel_best_encoder,
+       .best_encoder = gma_best_encoder,
 };
 
 static const struct drm_connector_funcs cdv_hdmi_connector_funcs = {
@@ -328,8 +328,7 @@ void cdv_hdmi_init(struct drm_device *dev,
        drm_encoder_init(dev, encoder, &psb_intel_lvds_enc_funcs,
                         DRM_MODE_ENCODER_TMDS);
 
-       psb_intel_connector_attach_encoder(psb_intel_connector,
-                                          psb_intel_encoder);
+       gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
        psb_intel_encoder->type = INTEL_OUTPUT_HDMI;
        hdmi_priv->hdmi_reg = reg;
        hdmi_priv->has_hdmi_sink = false;
index d81dbc3368f0116a19da89c6b03d7b8c5371a83d..e461dce1d0888fa0e2e8c62fe72723268c6c3c5b 100644 (file)
@@ -408,7 +408,7 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
        struct drm_device *dev = connector->dev;
        struct drm_psb_private *dev_priv = dev->dev_private;
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
        int ret;
 
@@ -445,7 +445,7 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
 static void cdv_intel_lvds_destroy(struct drm_connector *connector)
 {
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
 
        if (psb_intel_encoder->i2c_bus)
                psb_intel_i2c_destroy(psb_intel_encoder->i2c_bus);
@@ -529,7 +529,7 @@ static const struct drm_connector_helper_funcs
                                cdv_intel_lvds_connector_helper_funcs = {
        .get_modes = cdv_intel_lvds_get_modes,
        .mode_valid = cdv_intel_lvds_mode_valid,
-       .best_encoder = psb_intel_best_encoder,
+       .best_encoder = gma_best_encoder,
 };
 
 static const struct drm_connector_funcs cdv_intel_lvds_connector_funcs = {
@@ -659,8 +659,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
                         DRM_MODE_ENCODER_LVDS);
 
 
-       psb_intel_connector_attach_encoder(psb_intel_connector,
-                                          psb_intel_encoder);
+       gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
        psb_intel_encoder->type = INTEL_OUTPUT_LVDS;
 
        drm_encoder_helper_add(encoder, &cdv_intel_lvds_helper_funcs);
index 362dd2ad286fb57397c91dba8f723038c7ca7035..e0e7eb0680e6751243c07b40a42d743a8451a989 100644 (file)
@@ -704,7 +704,7 @@ static void psb_setup_outputs(struct drm_device *dev)
        list_for_each_entry(connector, &dev->mode_config.connector_list,
                            head) {
                struct psb_intel_encoder *psb_intel_encoder =
-                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
                struct drm_encoder *encoder = &psb_intel_encoder->base;
                int crtc_mask = 0, clone_mask = 0;
 
index 98a0eec38cbe4f6449e3b56f375ad23de21f9c01..67d86d8fcd4d5a92f02088877cc1547b28e76ba8 100644 (file)
@@ -38,7 +38,7 @@ bool gma_pipe_has_type(struct drm_crtc *crtc, int type)
        list_for_each_entry(l_entry, &mode_config->connector_list, head) {
                if (l_entry->encoder && l_entry->encoder->crtc == crtc) {
                        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(l_entry);
+                                               gma_attached_encoder(l_entry);
                        if (psb_intel_encoder->type == type)
                                return true;
                }
@@ -547,7 +547,7 @@ void gma_encoder_destroy(struct drm_encoder *encoder)
 struct drm_encoder *gma_best_encoder(struct drm_connector *connector)
 {
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
 
        return &psb_intel_encoder->base;
 }
index 0114408c483f42808e4369313087d8744381807a..e5d3a02ac6505af7eb10ee18b87677678bedc301 100644 (file)
@@ -747,7 +747,7 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
                if (encoder->crtc != crtc)
                        continue;
 
-               psb_intel_encoder = psb_intel_attached_encoder(connector);
+               psb_intel_encoder = gma_attached_encoder(connector);
 
                switch (psb_intel_encoder->type) {
                case INTEL_OUTPUT_MIPI:
index 504ae1117782b5cf2b08823fb86ce4a261920f49..b2744293c5c89b658a7b7749161b38c21cfed27b 100644 (file)
@@ -324,7 +324,7 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc,
                if (!connector->encoder || connector->encoder->crtc != crtc)
                        continue;
 
-               psb_intel_encoder = psb_intel_attached_encoder(connector);
+               psb_intel_encoder = gma_attached_encoder(connector);
 
                switch (psb_intel_encoder->type) {
                case INTEL_OUTPUT_LVDS:
index 7d9a5ee52814e63e5153a8ced617fd6395c9f80b..059de197c9423b868027c6bf37a99c3a6a729553 100644 (file)
@@ -609,16 +609,16 @@ static void oaktrail_hdmi_destroy(struct drm_connector *connector)
 static const struct drm_encoder_helper_funcs oaktrail_hdmi_helper_funcs = {
        .dpms = oaktrail_hdmi_dpms,
        .mode_fixup = oaktrail_hdmi_mode_fixup,
-       .prepare = psb_intel_encoder_prepare,
+       .prepare = gma_encoder_prepare,
        .mode_set = oaktrail_hdmi_mode_set,
-       .commit = psb_intel_encoder_commit,
+       .commit = gma_encoder_commit,
 };
 
 static const struct drm_connector_helper_funcs
                                        oaktrail_hdmi_connector_helper_funcs = {
        .get_modes = oaktrail_hdmi_get_modes,
        .mode_valid = oaktrail_hdmi_mode_valid,
-       .best_encoder = psb_intel_best_encoder,
+       .best_encoder = gma_best_encoder,
 };
 
 static const struct drm_connector_funcs oaktrail_hdmi_connector_funcs = {
@@ -663,8 +663,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
                         &oaktrail_hdmi_enc_funcs,
                         DRM_MODE_ENCODER_TMDS);
 
-       psb_intel_connector_attach_encoder(psb_intel_connector,
-                                          psb_intel_encoder);
+       gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
 
        psb_intel_encoder->type = INTEL_OUTPUT_HDMI;
        drm_encoder_helper_add(encoder, &oaktrail_hdmi_helper_funcs);
index 325013a9c48c451938fe45235f78721c62bcfdb4..7b1cfd6d16063396a5c3fbfcd4ae78f328ea8fa1 100644 (file)
@@ -352,8 +352,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
        drm_encoder_init(dev, encoder, &psb_intel_lvds_enc_funcs,
                         DRM_MODE_ENCODER_LVDS);
 
-       psb_intel_connector_attach_encoder(psb_intel_connector,
-                                          psb_intel_encoder);
+       gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
        psb_intel_encoder->type = INTEL_OUTPUT_LVDS;
 
        drm_encoder_helper_add(encoder, &oaktrail_lvds_helper_funcs);
index b4d13261f762edd4c671b790f1f9cc11a3c2b0b3..ab8b9ef86c37524127cdedd4578cf160de3c19e0 100644 (file)
@@ -372,7 +372,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)
        /* Only add backlight support if we have LVDS output */
        list_for_each_entry(connector, &dev->mode_config.connector_list,
                            head) {
-               psb_intel_encoder = psb_intel_attached_encoder(connector);
+               psb_intel_encoder = gma_attached_encoder(connector);
 
                switch (psb_intel_encoder->type) {
                case INTEL_OUTPUT_LVDS:
index 1e6a357a245e20b9163e3cb67777df3ce569a7db..a419e7969cc8d32902ee18277d0a3f23b8023284 100644 (file)
@@ -82,30 +82,6 @@ static void psb_intel_clock(int refclk, struct gma_clock_t *clock)
        clock->dot = clock->vco / clock->p;
 }
 
-void psb_intel_encoder_prepare(struct drm_encoder *encoder)
-{
-       struct drm_encoder_helper_funcs *encoder_funcs =
-           encoder->helper_private;
-       /* lvds has its own version of prepare see psb_intel_lvds_prepare */
-       encoder_funcs->dpms(encoder, DRM_MODE_DPMS_OFF);
-}
-
-void psb_intel_encoder_commit(struct drm_encoder *encoder)
-{
-       struct drm_encoder_helper_funcs *encoder_funcs =
-           encoder->helper_private;
-       /* lvds has its own version of commit see psb_intel_lvds_commit */
-       encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON);
-}
-
-void psb_intel_encoder_destroy(struct drm_encoder *encoder)
-{
-       struct psb_intel_encoder *intel_encoder = to_psb_intel_encoder(encoder);
-
-       drm_encoder_cleanup(encoder);
-       kfree(intel_encoder);
-}
-
 /**
  * Return the pipe currently connected to the panel fitter,
  * 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,
 
        list_for_each_entry(connector, &mode_config->connector_list, head) {
                struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
 
                if (!connector->encoder
                    || connector->encoder->crtc != crtc)
@@ -752,29 +728,10 @@ int psb_intel_connector_clones(struct drm_device *dev, int type_mask)
        list_for_each_entry(connector, &dev->mode_config.connector_list,
                            head) {
                struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
                if (type_mask & (1 << psb_intel_encoder->type))
                        index_mask |= (1 << entry);
                entry++;
        }
        return index_mask;
 }
-
-/* current intel driver doesn't take advantage of encoders
-   always give back the encoder for the connector
-*/
-struct drm_encoder *psb_intel_best_encoder(struct drm_connector *connector)
-{
-       struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
-
-       return &psb_intel_encoder->base;
-}
-
-void psb_intel_connector_attach_encoder(struct psb_intel_connector *connector,
-                                       struct psb_intel_encoder *encoder)
-{
-       connector->encoder = encoder;
-       drm_mode_connector_attach_encoder(&connector->base,
-                                         &encoder->base);
-}
index 39f09e067beb4cff46a164654228050134e4f8ce..1e1bf8bbfe5ae6ea059f22f551892f451bc701fd 100644 (file)
@@ -226,33 +226,16 @@ extern void oaktrail_dsi_init(struct drm_device *dev,
 extern void mid_dsi_init(struct drm_device *dev,
                    struct psb_intel_mode_device *mode_dev, int dsi_num);
 
-extern void psb_intel_encoder_prepare(struct drm_encoder *encoder);
-extern void psb_intel_encoder_commit(struct drm_encoder *encoder);
-extern void psb_intel_encoder_destroy(struct drm_encoder *encoder);
-
 extern struct drm_encoder *gma_best_encoder(struct drm_connector *connector);
 extern void gma_connector_attach_encoder(struct psb_intel_connector *connector,
                                         struct psb_intel_encoder *encoder);
 
-static inline struct psb_intel_encoder *psb_intel_attached_encoder(
-                                               struct drm_connector *connector)
-{
-       return to_psb_intel_connector(connector)->encoder;
-}
-
 static inline struct psb_intel_encoder *gma_attached_encoder(
                                                struct drm_connector *connector)
 {
        return to_psb_intel_connector(connector)->encoder;
 }
 
-extern void psb_intel_connector_attach_encoder(
-                                       struct psb_intel_connector *connector,
-                                       struct psb_intel_encoder *encoder);
-
-extern struct drm_encoder *psb_intel_best_encoder(struct drm_connector
-                                             *connector);
-
 extern struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev,
                                                    struct drm_crtc *crtc);
 extern int psb_intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
index 9fa5fa2e61921898090b9c241725f729b3b9ffe6..42541e8ea0ad8b7e0c1ddb1563f7d825c3bdefa7 100644 (file)
@@ -268,7 +268,7 @@ static void psb_intel_lvds_save(struct drm_connector *connector)
        struct drm_psb_private *dev_priv =
                (struct drm_psb_private *)dev->dev_private;
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct psb_intel_lvds_priv *lvds_priv =
                (struct psb_intel_lvds_priv *)psb_intel_encoder->dev_priv;
 
@@ -308,7 +308,7 @@ static void psb_intel_lvds_restore(struct drm_connector *connector)
        struct drm_device *dev = connector->dev;
        u32 pp_status;
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct psb_intel_lvds_priv *lvds_priv =
                (struct psb_intel_lvds_priv *)psb_intel_encoder->dev_priv;
 
@@ -350,7 +350,7 @@ int psb_intel_lvds_mode_valid(struct drm_connector *connector,
 {
        struct drm_psb_private *dev_priv = connector->dev->dev_private;
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct drm_display_mode *fixed_mode =
                                        dev_priv->mode_dev.panel_fixed_mode;
 
@@ -526,7 +526,7 @@ static int psb_intel_lvds_get_modes(struct drm_connector *connector)
        struct drm_psb_private *dev_priv = dev->dev_private;
        struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct psb_intel_lvds_priv *lvds_priv = psb_intel_encoder->dev_priv;
        int ret = 0;
 
@@ -565,7 +565,7 @@ static int psb_intel_lvds_get_modes(struct drm_connector *connector)
 void psb_intel_lvds_destroy(struct drm_connector *connector)
 {
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct psb_intel_lvds_priv *lvds_priv = psb_intel_encoder->dev_priv;
 
        if (lvds_priv->ddc_bus)
@@ -656,7 +656,7 @@ const struct drm_connector_helper_funcs
                                psb_intel_lvds_connector_helper_funcs = {
        .get_modes = psb_intel_lvds_get_modes,
        .mode_valid = psb_intel_lvds_mode_valid,
-       .best_encoder = psb_intel_best_encoder,
+       .best_encoder = gma_best_encoder,
 };
 
 const struct drm_connector_funcs psb_intel_lvds_connector_funcs = {
@@ -734,8 +734,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
                         &psb_intel_lvds_enc_funcs,
                         DRM_MODE_ENCODER_LVDS);
 
-       psb_intel_connector_attach_encoder(psb_intel_connector,
-                                          psb_intel_encoder);
+       gma_connector_attach_encoder(psb_intel_connector, psb_intel_encoder);
        psb_intel_encoder->type = INTEL_OUTPUT_LVDS;
 
        drm_encoder_helper_add(encoder, &psb_intel_lvds_helper_funcs);
index e3d1078ecf09e7de0ddcdcdb5922bf8913f78421..631e01abc04ba6c4dc903b870ff02f6d0be6506e 100644 (file)
@@ -200,7 +200,7 @@ static struct psb_intel_sdvo *to_psb_intel_sdvo(struct drm_encoder *encoder)
 
 static struct psb_intel_sdvo *intel_attached_sdvo(struct drm_connector *connector)
 {
-       return container_of(psb_intel_attached_encoder(connector),
+       return container_of(gma_attached_encoder(connector),
                            struct psb_intel_sdvo, base);
 }
 
@@ -1837,7 +1837,7 @@ static void psb_intel_sdvo_save(struct drm_connector *connector)
 {
        struct drm_device *dev = connector->dev;
        struct psb_intel_encoder *psb_intel_encoder =
-                                       psb_intel_attached_encoder(connector);
+                                               gma_attached_encoder(connector);
        struct psb_intel_sdvo *sdvo =
                                to_psb_intel_sdvo(&psb_intel_encoder->base);
 
@@ -1847,8 +1847,7 @@ static void psb_intel_sdvo_save(struct drm_connector *connector)
 static void psb_intel_sdvo_restore(struct drm_connector *connector)
 {
        struct drm_device *dev = connector->dev;
-       struct drm_encoder *encoder =
-                               &psb_intel_attached_encoder(connector)->base;
+       struct drm_encoder *encoder = &gma_attached_encoder(connector)->base;
        struct psb_intel_sdvo *sdvo = to_psb_intel_sdvo(encoder);
        struct drm_crtc *crtc = encoder->crtc;
 
@@ -1864,9 +1863,9 @@ static void psb_intel_sdvo_restore(struct drm_connector *connector)
 static const struct drm_encoder_helper_funcs psb_intel_sdvo_helper_funcs = {
        .dpms = psb_intel_sdvo_dpms,
        .mode_fixup = psb_intel_sdvo_mode_fixup,
-       .prepare = psb_intel_encoder_prepare,
+       .prepare = gma_encoder_prepare,
        .mode_set = psb_intel_sdvo_mode_set,
-       .commit = psb_intel_encoder_commit,
+       .commit = gma_encoder_commit,
 };
 
 static 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 = {
 static const struct drm_connector_helper_funcs psb_intel_sdvo_connector_helper_funcs = {
        .get_modes = psb_intel_sdvo_get_modes,
        .mode_valid = psb_intel_sdvo_mode_valid,
-       .best_encoder = psb_intel_best_encoder,
+       .best_encoder = gma_best_encoder,
 };
 
 static 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)
                                 psb_intel_sdvo->sdvo_lvds_fixed_mode);
 
        i2c_del_adapter(&psb_intel_sdvo->ddc);
-       psb_intel_encoder_destroy(encoder);
+       gma_encoder_destroy(encoder);
 }
 
 static 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,
        connector->base.base.doublescan_allowed = 0;
        connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
 
-       psb_intel_connector_attach_encoder(&connector->base, &encoder->base);
+       gma_connector_attach_encoder(&connector->base, &encoder->base);
        drm_sysfs_connector_add(&connector->base.base);
 }