drm/radeon/kms/combios: verify dac_adj values are valid
Subsystems (2)
PATCH 1/1 drm/radeon/kms/combios: verify dac_adj values are valid
Quoted 1 line
From
8a5f015013cf87433f59383e08cf7757647c0eb0Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Tue, 6 Apr 2010 12:35:26 -0400
Subject: [PATCH] drm/radeon/kms/combios: verify dac_adj values are valid
Some vbios dac_adj tables are all zeros. Check for that case and use the default table if so.
Should fix fdo bug 27478.
--- drivers/gpu/drm/radeon/radeon_combios.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-)
(quoted diff) +0 -0
b/drivers/gpu/drm/radeon/radeon_combios.c
index ecef5b4..a80abc4 100644
drivers/gpu/drm/radeon/radeon_combios.c +0 -0
@@ -760,7 +760,9 @@ struct radeon_encoder_primary_dac
*radeon_combios_get_primary_dac_info(struct
dac = RBIOS8(dac_info + 0x3) & 0xf; p_dac->ps2_pdac_adj = (bg << 8) | (dac);
}
- found = 1;
+ /* if the values are all zeros, use the table */
+ if (p_dac->ps2_pdac_adj)
+ found = 1;
}
if (!found) /* fallback to defaults */
@@ -895,7 +897,9 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
bg = RBIOS8(dac_info + 0x10) & 0xf;
dac = RBIOS8(dac_info + 0x11) & 0xf; tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20);
- found = 1;
+ /* if the values are all zeros, use the table */
+ if (tv_dac->ps2_tvdac_adj)
+ found = 1;
} else if (rev > 1) {
bg = RBIOS8(dac_info + 0xc) & 0xf;
dac = (RBIOS8(dac_info + 0xc) >> 4) & 0xf;
@@ -908,7 +912,9 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
bg = RBIOS8(dac_info + 0xe) & 0xf;
dac = (RBIOS8(dac_info + 0xe) >> 4) & 0xf; tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20);
- found = 1;
+ /* if the values are all zeros, use the table */
+ if (tv_dac->ps2_tvdac_adj)
+ found = 1;
}
tv_dac->tv_std = radeon_combios_get_tv_info(rdev);
}
@@ -925,7 +931,9 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
(bg << 16) | (dac << 20);
tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj; tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj;
- found = 1;
+ /* if the values are all zeros, use the table */
+ if (tv_dac->ps2_tvdac_adj)
+ found = 1;
} else {
bg = RBIOS8(dac_info + 0x4) & 0xf; dac = RBIOS8(dac_info + 0x5) & 0xf;
@@ -933,7 +941,9 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
(bg << 16) | (dac << 20);
tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj; tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj;
- found = 1;
+ /* if the values are all zeros, use the table */
+ if (tv_dac->ps2_tvdac_adj)
+ found = 1;
}
} else {
DRM_INFO("No TV DAC info found in BIOS\n");
Signature · 1 line
1.5.6.3
From 8a5f015013cf87433f59383e08cf7757647c0eb0 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Tue, 6 Apr 2010 12:35:26 -0400
Subject: [PATCH] drm/radeon/kms/combios: verify dac_adj values are valid
Some vbios dac_adj tables are all zeros. Check for that case and use the default table if so.
Should fix fdo bug 27478.
--- drivers/gpu/drm/radeon/radeon_combios.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/radeon_combios.c +15 -5
@@ -760,7 +760,9 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct dac =RBIOS8 (dac_info +0x3 ) &0xf ; p_dac->ps2_pdac_adj = (bg <<8 ) | (dac); } - found =1 ; +/* if the values are all zeros, use the table */ +if (p_dac->ps2_pdac_adj) + found =1 ; }if (!found)/* fallback to defaults */
@@ -895,7 +897,9 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct bg =RBIOS8 (dac_info +0x10 ) &0xf ; dac =RBIOS8 (dac_info +0x11 ) &0xf ; tv_dac->ntsc_tvdac_adj = (bg <<16 ) | (dac <<20 ); - found =1 ; +/* if the values are all zeros, use the table */ +if (tv_dac->ps2_tvdac_adj) + found =1 ; }else if (rev >1 ) { bg =RBIOS8 (dac_info +0xc ) &0xf ; dac = (RBIOS8 (dac_info +0xc ) >>4 ) &0xf ;
@@ -908,7 +912,9 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct bg =RBIOS8 (dac_info +0xe ) &0xf ; dac = (RBIOS8 (dac_info +0xe ) >>4 ) &0xf ; tv_dac->ntsc_tvdac_adj = (bg <<16 ) | (dac <<20 ); - found =1 ; +/* if the values are all zeros, use the table */ +if (tv_dac->ps2_tvdac_adj) + found =1 ; } tv_dac->tv_std =radeon_combios_get_tv_info (rdev); }
@@ -925,7 +931,9 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct (bg <<16 ) | (dac <<20 ); tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj; tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj; - found =1 ; +/* if the values are all zeros, use the table */ +if (tv_dac->ps2_tvdac_adj) + found =1 ; }else { bg =RBIOS8 (dac_info +0x4 ) &0xf ; dac =RBIOS8 (dac_info +0x5 ) &0xf ;
@@ -933,7 +941,9 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct (bg <<16 ) | (dac <<20 ); tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj; tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj; - found =1 ; +/* if the values are all zeros, use the table */ +if (tv_dac->ps2_tvdac_adj) + found =1 ; } }else {DRM_INFO ("No TV DAC info found in BIOS\n" );
Signature · 1 line
1.5.6.3
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel