summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/atombios_crtc.c1
-rw-r--r--linux-core/radeon_atombios.c6
-rw-r--r--linux-core/radeon_display.c32
-rw-r--r--linux-core/radeon_drv.c4
-rw-r--r--linux-core/radeon_legacy_crtc.c8
-rw-r--r--linux-core/radeon_mode.h1
-rw-r--r--shared-core/radeon_drv.h1
7 files changed, 39 insertions, 14 deletions
diff --git a/linux-core/atombios_crtc.c b/linux-core/atombios_crtc.c
index 922cc7e0..3856f8ca 100644
--- a/linux-core/atombios_crtc.c
+++ b/linux-core/atombios_crtc.c
@@ -419,6 +419,7 @@ void atombios_crtc_mode_set(struct drm_crtc *crtc,
atombios_set_crtc_dtd_timing(crtc, &crtc_dtd_timing);
}
radeon_crtc_set_base(crtc, x, y);
+ radeon_legacy_atom_set_surface(crtc);
}
}
diff --git a/linux-core/radeon_atombios.c b/linux-core/radeon_atombios.c
index 90a367a0..a763e766 100644
--- a/linux-core/radeon_atombios.c
+++ b/linux-core/radeon_atombios.c
@@ -277,8 +277,10 @@ bool radeon_get_atom_connector_info_from_bios_connector_table(struct drm_device
union atom_supported_devices *supported_devices;
int i,j;
- if (radeon_get_atom_connector_info_from_bios_object_table(dev))
- return true;
+ if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
+ // FIXME this should return false for pre-r6xx chips
+ if (radeon_get_atom_connector_info_from_bios_object_table(dev))
+ return true;
atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset);
diff --git a/linux-core/radeon_display.c b/linux-core/radeon_display.c
index 5c86f74c..ddc933cc 100644
--- a/linux-core/radeon_display.c
+++ b/linux-core/radeon_display.c
@@ -195,7 +195,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
radeon_crtc->lut_b[i] = i;
}
- if (dev_priv->is_atom_bios)
+ if (dev_priv->is_atom_bios && (radeon_is_avivo(dev_priv) || radeon_r4xx_atom))
radeon_atombios_init_crtc(dev, radeon_crtc);
else
radeon_legacy_init_crtc(dev, radeon_crtc);
@@ -237,7 +237,10 @@ bool radeon_setup_enc_conn(struct drm_device *dev)
encoder = NULL;
/* if we find an LVDS connector */
if (mode_info->bios_connector[i].connector_type == CONNECTOR_LVDS) {
- encoder = radeon_encoder_lvtma_add(dev, i);
+ if (radeon_is_avivo(dev_priv) || radeon_r4xx_atom)
+ encoder = radeon_encoder_lvtma_add(dev, i);
+ else
+ encoder = radeon_encoder_legacy_lvds_add(dev, i);
if (encoder)
drm_mode_connector_attach_encoder(connector, encoder);
}
@@ -246,7 +249,14 @@ bool radeon_setup_enc_conn(struct drm_device *dev)
if ((mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_I) ||
(mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_A) ||
(mode_info->bios_connector[i].connector_type == CONNECTOR_VGA)) {
- encoder = radeon_encoder_atom_dac_add(dev, i, mode_info->bios_connector[i].dac_type, 0);
+ if (radeon_is_avivo(dev_priv) || radeon_r4xx_atom)
+ encoder = radeon_encoder_atom_dac_add(dev, i, mode_info->bios_connector[i].dac_type, 0);
+ else {
+ if (mode_info->bios_connector[i].dac_type == DAC_PRIMARY)
+ encoder = radeon_encoder_legacy_primary_dac_add(dev, i, 0);
+ else if (mode_info->bios_connector[i].dac_type == DAC_TVDAC)
+ encoder = radeon_encoder_legacy_tv_dac_add(dev, i, 0);
+ }
if (encoder)
drm_mode_connector_attach_encoder(connector, encoder);
}
@@ -254,14 +264,26 @@ bool radeon_setup_enc_conn(struct drm_device *dev)
/* TMDS on DVI */
if ((mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_I) ||
(mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_D)) {
- encoder = radeon_encoder_atom_tmds_add(dev, i, mode_info->bios_connector[i].tmds_type);
+ if (radeon_is_avivo(dev_priv) || radeon_r4xx_atom)
+ encoder = radeon_encoder_atom_tmds_add(dev, i, mode_info->bios_connector[i].tmds_type);
+ else {
+ if (mode_info->bios_connector[i].tmds_type == TMDS_INT)
+ encoder = radeon_encoder_legacy_tmds_int_add(dev, i);
+ else if (mode_info->bios_connector[i].tmds_type == TMDS_EXT)
+ encoder = radeon_encoder_legacy_tmds_ext_add(dev, i);
+ }
if (encoder)
drm_mode_connector_attach_encoder(connector, encoder);
}
/* TVDAC on DIN */
if (mode_info->bios_connector[i].connector_type == CONNECTOR_DIN) {
- encoder = radeon_encoder_atom_dac_add(dev, i, mode_info->bios_connector[i].dac_type, 1);
+ if (radeon_is_avivo(dev_priv) || radeon_r4xx_atom)
+ encoder = radeon_encoder_atom_dac_add(dev, i, mode_info->bios_connector[i].dac_type, 1);
+ else {
+ if (mode_info->bios_connector[i].dac_type == DAC_TVDAC)
+ encoder = radeon_encoder_legacy_tv_dac_add(dev, i, 0);
+ }
if (encoder)
drm_mode_connector_attach_encoder(connector, encoder);
}
diff --git a/linux-core/radeon_drv.c b/linux-core/radeon_drv.c
index 9b3397ca..79bcc3e6 100644
--- a/linux-core/radeon_drv.c
+++ b/linux-core/radeon_drv.c
@@ -38,6 +38,7 @@
int radeon_no_wb;
int radeon_dynclks = 1;
+int radeon_r4xx_atom = 0;
MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers\n");
module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -48,6 +49,9 @@ module_param_named(modeset, radeon_modeset, int, 0400);
MODULE_PARM_DESC(dynclks, "Disable/Enable dynamic clocks");
module_param_named(dynclks, radeon_dynclks, int, 0444);
+MODULE_PARM_DESC(r4xx_atom, "Enable ATOMBIOS modesetting for R4xx");
+module_param_named(r4xx_atom, radeon_r4xx_atom, int, 0444);
+
static int dri_library_name(struct drm_device * dev, char * buf)
{
drm_radeon_private_t *dev_priv = dev->dev_private;
diff --git a/linux-core/radeon_legacy_crtc.c b/linux-core/radeon_legacy_crtc.c
index f99cbdaa..820bd548 100644
--- a/linux-core/radeon_legacy_crtc.c
+++ b/linux-core/radeon_legacy_crtc.c
@@ -172,7 +172,7 @@ void radeon_crtc_dpms(struct drm_crtc *crtc, int mode)
}
/* properly set crtc bpp when using atombios */
-static void radeon_legacy_atom_set_surface(struct drm_crtc *crtc)
+void radeon_legacy_atom_set_surface(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_radeon_private *dev_priv = dev->dev_private;
@@ -312,9 +312,6 @@ static bool radeon_set_crtc1_base(struct drm_crtc *crtc, int x, int y)
disp_merge_cntl &= ~RADEON_DISP_RGB_OFFSET_EN;
RADEON_WRITE(RADEON_DISP_MERGE_CNTL, disp_merge_cntl);
- if (dev_priv->is_atom_bios)
- radeon_legacy_atom_set_surface(crtc);
-
return true;
}
@@ -736,9 +733,6 @@ static bool radeon_set_crtc2_base(struct drm_crtc *crtc, int x, int y)
disp2_merge_cntl &= ~RADEON_DISP2_RGB_OFFSET_EN;
RADEON_WRITE(RADEON_DISP2_MERGE_CNTL, disp2_merge_cntl);
- if (dev_priv->is_atom_bios)
- radeon_legacy_atom_set_surface(crtc);
-
return true;
}
diff --git a/linux-core/radeon_mode.h b/linux-core/radeon_mode.h
index 577c3cf9..8074eb7c 100644
--- a/linux-core/radeon_mode.h
+++ b/linux-core/radeon_mode.h
@@ -287,6 +287,7 @@ extern void atombios_crtc_mode_set(struct drm_crtc *crtc,
extern void atombios_crtc_dpms(struct drm_crtc *crtc, int mode);
extern void radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y);
+extern void radeon_legacy_atom_set_surface(struct drm_crtc *crtc);
extern int radeon_crtc_cursor_set(struct drm_crtc *crtc,
struct drm_file *file_priv,
diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h
index 25a07e30..3490ddbe 100644
--- a/shared-core/radeon_drv.h
+++ b/shared-core/radeon_drv.h
@@ -456,6 +456,7 @@ typedef struct drm_radeon_kcmd_buffer {
extern int radeon_no_wb;
extern int radeon_dynclks;
+extern int radeon_r4xx_atom;
extern struct drm_ioctl_desc radeon_ioctls[];
extern int radeon_max_ioctl;