Merge remote branch 'origin/modesetting-gem' into modesetting-gem

main
Dave Airlie 2008-09-30 14:17:27 +10:00
commit 7b3aa62648
9 changed files with 68 additions and 34 deletions

View File

@ -419,6 +419,7 @@ void atombios_crtc_mode_set(struct drm_crtc *crtc,
atombios_set_crtc_dtd_timing(crtc, &crtc_dtd_timing); atombios_set_crtc_dtd_timing(crtc, &crtc_dtd_timing);
} }
radeon_crtc_set_base(crtc, x, y); radeon_crtc_set_base(crtc, x, y);
radeon_legacy_atom_set_surface(crtc);
} }
} }

View File

@ -277,6 +277,8 @@ bool radeon_get_atom_connector_info_from_bios_connector_table(struct drm_device
union atom_supported_devices *supported_devices; union atom_supported_devices *supported_devices;
int i,j; int i,j;
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)) if (radeon_get_atom_connector_info_from_bios_object_table(dev))
return true; return true;

View File

@ -195,7 +195,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
radeon_crtc->lut_b[i] = i; 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); radeon_atombios_init_crtc(dev, radeon_crtc);
else else
radeon_legacy_init_crtc(dev, radeon_crtc); radeon_legacy_init_crtc(dev, radeon_crtc);
@ -237,7 +237,10 @@ bool radeon_setup_enc_conn(struct drm_device *dev)
encoder = NULL; encoder = NULL;
/* if we find an LVDS connector */ /* if we find an LVDS connector */
if (mode_info->bios_connector[i].connector_type == CONNECTOR_LVDS) { if (mode_info->bios_connector[i].connector_type == CONNECTOR_LVDS) {
if (radeon_is_avivo(dev_priv) || radeon_r4xx_atom)
encoder = radeon_encoder_lvtma_add(dev, i); encoder = radeon_encoder_lvtma_add(dev, i);
else
encoder = radeon_encoder_legacy_lvds_add(dev, i);
if (encoder) if (encoder)
drm_mode_connector_attach_encoder(connector, 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) || 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_DVI_A) ||
(mode_info->bios_connector[i].connector_type == CONNECTOR_VGA)) { (mode_info->bios_connector[i].connector_type == CONNECTOR_VGA)) {
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); 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) if (encoder)
drm_mode_connector_attach_encoder(connector, encoder); drm_mode_connector_attach_encoder(connector, encoder);
} }
@ -254,14 +264,26 @@ bool radeon_setup_enc_conn(struct drm_device *dev)
/* TMDS on DVI */ /* TMDS on DVI */
if ((mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_I) || if ((mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_I) ||
(mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_D)) { (mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_D)) {
if (radeon_is_avivo(dev_priv) || radeon_r4xx_atom)
encoder = radeon_encoder_atom_tmds_add(dev, i, mode_info->bios_connector[i].tmds_type); 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) if (encoder)
drm_mode_connector_attach_encoder(connector, encoder); drm_mode_connector_attach_encoder(connector, encoder);
} }
/* TVDAC on DIN */ /* TVDAC on DIN */
if (mode_info->bios_connector[i].connector_type == CONNECTOR_DIN) { if (mode_info->bios_connector[i].connector_type == CONNECTOR_DIN) {
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); 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) if (encoder)
drm_mode_connector_attach_encoder(connector, encoder); drm_mode_connector_attach_encoder(connector, encoder);
} }

View File

@ -38,6 +38,7 @@
int radeon_no_wb; int radeon_no_wb;
int radeon_dynclks = 1; int radeon_dynclks = 1;
int radeon_r4xx_atom = 0;
MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers\n"); MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers\n");
module_param_named(no_wb, radeon_no_wb, int, 0444); 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_PARM_DESC(dynclks, "Disable/Enable dynamic clocks");
module_param_named(dynclks, radeon_dynclks, int, 0444); 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) static int dri_library_name(struct drm_device * dev, char * buf)
{ {
drm_radeon_private_t *dev_priv = dev->dev_private; drm_radeon_private_t *dev_priv = dev->dev_private;

View File

@ -768,7 +768,7 @@ static void atombios_tmds2_setup(struct drm_encoder *encoder,
} }
static void atombios_ext_tmds_setup(struct drm_encoder *encoder, void atombios_ext_tmds_setup(struct drm_encoder *encoder,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;

View File

@ -172,7 +172,7 @@ void radeon_crtc_dpms(struct drm_crtc *crtc, int mode)
} }
/* properly set crtc bpp when using atombios */ /* 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_device *dev = crtc->dev;
struct drm_radeon_private *dev_priv = dev->dev_private; 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; disp_merge_cntl &= ~RADEON_DISP_RGB_OFFSET_EN;
RADEON_WRITE(RADEON_DISP_MERGE_CNTL, disp_merge_cntl); RADEON_WRITE(RADEON_DISP_MERGE_CNTL, disp_merge_cntl);
if (dev_priv->is_atom_bios)
radeon_legacy_atom_set_surface(crtc);
return true; 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; disp2_merge_cntl &= ~RADEON_DISP2_RGB_OFFSET_EN;
RADEON_WRITE(RADEON_DISP2_MERGE_CNTL, disp2_merge_cntl); RADEON_WRITE(RADEON_DISP2_MERGE_CNTL, disp2_merge_cntl);
if (dev_priv->is_atom_bios)
radeon_legacy_atom_set_surface(crtc);
return true; return true;
} }

View File

@ -923,13 +923,19 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
struct drm_radeon_private *dev_priv = dev->dev_private; struct drm_radeon_private *dev_priv = dev->dev_private;
struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
uint32_t fp2_gen_cntl = RADEON_READ(RADEON_FP2_GEN_CNTL); uint32_t fp2_gen_cntl;
DRM_DEBUG("\n"); DRM_DEBUG("\n");
if (radeon_crtc->crtc_id == 0) if (radeon_crtc->crtc_id == 0)
radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode); radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
if (dev_priv->is_atom_bios) {
atombios_ext_tmds_setup(encoder, adjusted_mode);
fp2_gen_cntl = RADEON_READ(RADEON_FP2_GEN_CNTL);
} else {
fp2_gen_cntl = RADEON_READ(RADEON_FP2_GEN_CNTL);
if (1) // FIXME rgbBits == 8 if (1) // FIXME rgbBits == 8
fp2_gen_cntl |= RADEON_FP2_PANEL_FORMAT; /* 24 bit format, */ fp2_gen_cntl |= RADEON_FP2_PANEL_FORMAT; /* 24 bit format, */
else else
@ -951,6 +957,7 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
/*if (mode->clock > 165000) /*if (mode->clock > 165000)
fp2_gen_cntl |= R300_FP2_DVO_DUAL_CHANNEL_EN;*/ fp2_gen_cntl |= R300_FP2_DVO_DUAL_CHANNEL_EN;*/
} }
}
if (radeon_crtc->crtc_id == 0) { if (radeon_crtc->crtc_id == 0) {
if ((dev_priv->chip_family == CHIP_R200) || radeon_is_r300(dev_priv)) { if ((dev_priv->chip_family == CHIP_R200) || radeon_is_r300(dev_priv)) {

View File

@ -277,6 +277,8 @@ struct drm_encoder *radeon_encoder_legacy_primary_dac_add(struct drm_device *dev
struct drm_encoder *radeon_encoder_legacy_tv_dac_add(struct drm_device *dev, int bios_index, int with_tv); struct drm_encoder *radeon_encoder_legacy_tv_dac_add(struct drm_device *dev, int bios_index, int with_tv);
struct drm_encoder *radeon_encoder_legacy_tmds_int_add(struct drm_device *dev, int bios_index); struct drm_encoder *radeon_encoder_legacy_tmds_int_add(struct drm_device *dev, int bios_index);
struct drm_encoder *radeon_encoder_legacy_tmds_ext_add(struct drm_device *dev, int bios_index); struct drm_encoder *radeon_encoder_legacy_tmds_ext_add(struct drm_device *dev, int bios_index);
extern void atombios_ext_tmds_setup(struct drm_encoder *encoder,
struct drm_display_mode *mode);
extern void radeon_crtc_load_lut(struct drm_crtc *crtc); extern void radeon_crtc_load_lut(struct drm_crtc *crtc);
extern void atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y); extern void atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y);
@ -287,6 +289,7 @@ extern void atombios_crtc_mode_set(struct drm_crtc *crtc,
extern void atombios_crtc_dpms(struct drm_crtc *crtc, int mode); 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_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, extern int radeon_crtc_cursor_set(struct drm_crtc *crtc,
struct drm_file *file_priv, struct drm_file *file_priv,

View File

@ -456,6 +456,7 @@ typedef struct drm_radeon_kcmd_buffer {
extern int radeon_no_wb; extern int radeon_no_wb;
extern int radeon_dynclks; extern int radeon_dynclks;
extern int radeon_r4xx_atom;
extern struct drm_ioctl_desc radeon_ioctls[]; extern struct drm_ioctl_desc radeon_ioctls[];
extern int radeon_max_ioctl; extern int radeon_max_ioctl;