drm/radeon/kms: simplify memory controller setup V2
[safe/jmp/linux-2.6] / drivers / gpu / drm / radeon / radeon_mode.h
index b884bac..8912f2e 100644 (file)
@@ -83,6 +83,8 @@ struct radeon_i2c_bus_rec {
        bool valid;
        /* id used by atom */
        uint8_t i2c_id;
+       /* id used by atom */
+       uint8_t hpd_id;
        /* can be used with hw i2c engine */
        bool hw_capable;
        /* uses multi-media i2c engine */
@@ -113,6 +115,7 @@ struct radeon_tmds_pll {
 
 #define RADEON_MAX_BIOS_CONNECTOR 16
 
+/* pll flags */
 #define RADEON_PLL_USE_BIOS_DIVS        (1 << 0)
 #define RADEON_PLL_NO_ODD_POST_DIV      (1 << 1)
 #define RADEON_PLL_USE_REF_DIV          (1 << 2)
@@ -127,6 +130,12 @@ struct radeon_tmds_pll {
 #define RADEON_PLL_PREFER_CLOSEST_LOWER (1 << 11)
 #define RADEON_PLL_USE_POST_DIV         (1 << 12)
 
+/* pll algo */
+enum radeon_pll_algo {
+       PLL_ALGO_LEGACY,
+       PLL_ALGO_AVIVO
+};
+
 struct radeon_pll {
        /* reference frequency */
        uint32_t reference_freq;
@@ -157,6 +166,8 @@ struct radeon_pll {
 
        /* pll id */
        uint32_t id;
+       /* pll algo */
+       enum radeon_pll_algo algo;
 };
 
 struct i2c_algo_radeon_data {
@@ -198,7 +209,7 @@ struct radeon_mode_info {
        struct card_info *atom_card_info;
        enum radeon_connector_table connector_table;
        bool mode_config_initialized;
-       struct radeon_crtc *crtcs[2];
+       struct radeon_crtc *crtcs[6];
        /* DVI-I properties */
        struct drm_property *coherent_mode_property;
        /* DAC enable load detect */
@@ -207,7 +218,8 @@ struct radeon_mode_info {
        struct drm_property *tv_std_property;
        /* legacy TMDS PLL detect */
        struct drm_property *tmds_pll_property;
-
+       /* hardcoded DFP edid from BIOS */
+       struct edid *bios_hardcoded_edid;
 };
 
 #define MAX_H_CODE_TIMING_LEN 32
@@ -242,6 +254,7 @@ struct radeon_crtc {
        fixed20_12 vsc;
        fixed20_12 hsc;
        struct drm_display_mode native_mode;
+       int pll_id;
 };
 
 struct radeon_encoder_primary_dac {
@@ -308,6 +321,7 @@ struct radeon_encoder_atom_dig {
        /* atom lvds */
        uint32_t lvds_misc;
        uint16_t panel_pwr_delay;
+       enum radeon_pll_algo pll_algo;
        struct radeon_atom_ss *ss;
        /* panel mode */
        struct drm_display_mode native_mode;
@@ -403,6 +417,7 @@ extern void dp_link_train(struct drm_encoder *encoder,
                          struct drm_connector *connector);
 extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector);
 extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector);
+extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action);
 extern void atombios_dig_transmitter_setup(struct drm_encoder *encoder,
                                           int action, uint8_t lane_num,
                                           uint8_t lane_set);
@@ -438,14 +453,6 @@ extern void radeon_compute_pll(struct radeon_pll *pll,
                               uint32_t *ref_div_p,
                               uint32_t *post_div_p);
 
-extern void radeon_compute_pll_avivo(struct radeon_pll *pll,
-                                    uint64_t freq,
-                                    uint32_t *dot_clock_p,
-                                    uint32_t *fb_div_p,
-                                    uint32_t *frac_fb_div_p,
-                                    uint32_t *ref_div_p,
-                                    uint32_t *post_div_p);
-
 extern void radeon_setup_encoder_clones(struct drm_device *dev);
 
 struct drm_encoder *radeon_encoder_legacy_lvds_add(struct drm_device *dev, int bios_index);
@@ -479,6 +486,9 @@ extern int radeon_crtc_cursor_set(struct drm_crtc *crtc,
 extern int radeon_crtc_cursor_move(struct drm_crtc *crtc,
                                   int x, int y);
 
+extern bool radeon_combios_check_hardcoded_edid(struct radeon_device *rdev);
+extern struct edid *
+radeon_combios_get_hardcoded_edid(struct radeon_device *rdev);
 extern bool radeon_atom_get_clock_info(struct drm_device *dev);
 extern bool radeon_combios_get_clock_info(struct drm_device *dev);
 extern struct radeon_encoder_atom_dig *