diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2005-09-15 08:58:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-15 11:24:09 -0400 |
commit | 7b6a186d65589901a73d460070504a5e02703c45 (patch) | |
tree | adc52e885b8ffbf50853b6f67eb55e6a6c2a4f2b /drivers/video/savage | |
parent | be201f7f4cd26b1bb994062803e0d87877e749ce (diff) |
[PATCH] savagefb: Fix load failure of the Twister chipset
- The Twister chipsets are actually prosavages. Reclassify them as
such and remove the S3_SAVAGE_TWISTER id.
- Fix i2c code if fb_firmware_edid() returns NULL
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/savage')
-rw-r--r-- | drivers/video/savage/savagefb-i2c.c | 11 | ||||
-rw-r--r-- | drivers/video/savage/savagefb.h | 4 | ||||
-rw-r--r-- | drivers/video/savage/savagefb_driver.c | 11 |
3 files changed, 12 insertions, 14 deletions
diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index 959404ad68f4..3c98457783c4 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c | |||
@@ -274,10 +274,13 @@ int savagefb_probe_i2c_connector(struct fb_info *info, u8 **out_edid) | |||
274 | 274 | ||
275 | if (!edid) { | 275 | if (!edid) { |
276 | /* try to get from firmware */ | 276 | /* try to get from firmware */ |
277 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); | 277 | const u8 *e = fb_firmware_edid(info->device); |
278 | if (edid) | 278 | |
279 | memcpy(edid, fb_firmware_edid(info->device), | 279 | if (e) { |
280 | EDID_LENGTH); | 280 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); |
281 | if (edid) | ||
282 | memcpy(edid, e, EDID_LENGTH); | ||
283 | } | ||
281 | } | 284 | } |
282 | 285 | ||
283 | if (out_edid) | 286 | if (out_edid) |
diff --git a/drivers/video/savage/savagefb.h b/drivers/video/savage/savagefb.h index d6f94742c9f2..ea17f7e0482c 100644 --- a/drivers/video/savage/savagefb.h +++ b/drivers/video/savage/savagefb.h | |||
@@ -60,8 +60,6 @@ | |||
60 | 60 | ||
61 | #define S3_SAVAGE_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000)) | 61 | #define S3_SAVAGE_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000)) |
62 | 62 | ||
63 | #define S3_MOBILE_TWISTER_SERIES(chip) ((chip==S3_TWISTER) || (chip == S3_PROSAVAGEDDR)) | ||
64 | |||
65 | /* Chip tags. These are used to group the adapters into | 63 | /* Chip tags. These are used to group the adapters into |
66 | * related families. | 64 | * related families. |
67 | */ | 65 | */ |
@@ -74,8 +72,6 @@ typedef enum { | |||
74 | S3_PROSAVAGE, | 72 | S3_PROSAVAGE, |
75 | S3_SUPERSAVAGE, | 73 | S3_SUPERSAVAGE, |
76 | S3_SAVAGE2000, | 74 | S3_SAVAGE2000, |
77 | S3_PROSAVAGEDDR, | ||
78 | S3_TWISTER, | ||
79 | S3_LAST | 75 | S3_LAST |
80 | } savage_chipset; | 76 | } savage_chipset; |
81 | 77 | ||
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index b5ca3ef8271f..7c285455c924 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
@@ -1773,8 +1773,7 @@ static int __devinit savage_init_hw (struct savagefb_par *par) | |||
1773 | } | 1773 | } |
1774 | } | 1774 | } |
1775 | 1775 | ||
1776 | if (S3_SAVAGE_MOBILE_SERIES(par->chip) || | 1776 | if (S3_SAVAGE_MOBILE_SERIES(par->chip) && !par->crtonly) |
1777 | (S3_MOBILE_TWISTER_SERIES(par->chip) && !par->crtonly)) | ||
1778 | par->display_type = DISP_LCD; | 1777 | par->display_type = DISP_LCD; |
1779 | else if (dvi || (par->chip == S3_SAVAGE4 && par->dvi)) | 1778 | else if (dvi || (par->chip == S3_SAVAGE4 && par->dvi)) |
1780 | par->display_type = DISP_DFP; | 1779 | par->display_type = DISP_DFP; |
@@ -1783,7 +1782,7 @@ static int __devinit savage_init_hw (struct savagefb_par *par) | |||
1783 | 1782 | ||
1784 | /* Check LCD panel parrmation */ | 1783 | /* Check LCD panel parrmation */ |
1785 | 1784 | ||
1786 | if (par->chip == S3_SAVAGE_MX) { | 1785 | if (par->display_type == DISP_LCD) { |
1787 | unsigned char cr6b = VGArCR( 0x6b ); | 1786 | unsigned char cr6b = VGArCR( 0x6b ); |
1788 | 1787 | ||
1789 | int panelX = (VGArSEQ (0x61) + | 1788 | int panelX = (VGArSEQ (0x61) + |
@@ -1922,15 +1921,15 @@ static int __devinit savage_init_fb_info (struct fb_info *info, | |||
1922 | snprintf (info->fix.id, 16, "ProSavageKM"); | 1921 | snprintf (info->fix.id, 16, "ProSavageKM"); |
1923 | break; | 1922 | break; |
1924 | case FB_ACCEL_S3TWISTER_P: | 1923 | case FB_ACCEL_S3TWISTER_P: |
1925 | par->chip = S3_TWISTER; | 1924 | par->chip = S3_PROSAVAGE; |
1926 | snprintf (info->fix.id, 16, "TwisterP"); | 1925 | snprintf (info->fix.id, 16, "TwisterP"); |
1927 | break; | 1926 | break; |
1928 | case FB_ACCEL_S3TWISTER_K: | 1927 | case FB_ACCEL_S3TWISTER_K: |
1929 | par->chip = S3_TWISTER; | 1928 | par->chip = S3_PROSAVAGE; |
1930 | snprintf (info->fix.id, 16, "TwisterK"); | 1929 | snprintf (info->fix.id, 16, "TwisterK"); |
1931 | break; | 1930 | break; |
1932 | case FB_ACCEL_PROSAVAGE_DDR: | 1931 | case FB_ACCEL_PROSAVAGE_DDR: |
1933 | par->chip = S3_PROSAVAGEDDR; | 1932 | par->chip = S3_PROSAVAGE; |
1934 | snprintf (info->fix.id, 16, "ProSavageDDR"); | 1933 | snprintf (info->fix.id, 16, "ProSavageDDR"); |
1935 | break; | 1934 | break; |
1936 | case FB_ACCEL_PROSAVAGE_DDRK: | 1935 | case FB_ACCEL_PROSAVAGE_DDRK: |