aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/hw.c
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-05-22 19:30:48 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-08-05 08:46:51 -0400
commitf18e3e0ce0dacca497e3f1547095b3f9b111b0f7 (patch)
treeed3a34329b2f16e428a3c6f82d35527f7e0e0f8e /drivers/video/via/hw.c
parentd60defb7b2c05b5c4b187171c09b714b0a00efe9 (diff)
viafb: kill viafb_load_crtc_timing
This patch replaces calls to viafb_load_crtc_timing with the code. This should make it easier to fix the oddity that in the modetable the blank and sync end entries contain the length and we need to add the start values to get those to be written to the hardware. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/via/hw.c')
-rw-r--r--drivers/video/via/hw.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 372ce4f071c2..52d41f011d85 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -1467,20 +1467,6 @@ void viafb_set_vclock(u32 clk, int set_iga)
1467 via_write_misc_reg_mask(0x0C, 0x0C); /* select external clock */ 1467 via_write_misc_reg_mask(0x0C, 0x0C); /* select external clock */
1468} 1468}
1469 1469
1470void viafb_load_crtc_timing(struct display_timing device_timing,
1471 int set_iga)
1472{
1473 device_timing.hor_blank_end += device_timing.hor_blank_start;
1474 device_timing.hor_sync_end += device_timing.hor_sync_start;
1475 device_timing.ver_blank_end += device_timing.ver_blank_start;
1476 device_timing.ver_sync_end += device_timing.ver_sync_start;
1477
1478 if (set_iga == IGA1)
1479 via_set_primary_timing(&device_timing);
1480 else if (set_iga == IGA2)
1481 via_set_secondary_timing(&device_timing);
1482}
1483
1484void viafb_fill_crtc_timing(struct crt_mode_table *crt_table, 1470void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
1485 struct VideoModeTable *video_mode, int bpp_byte, int set_iga) 1471 struct VideoModeTable *video_mode, int bpp_byte, int set_iga)
1486{ 1472{
@@ -1515,6 +1501,10 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
1515 crt_reg.hor_blank_end = crt_reg.hor_blank_end + 16; 1501 crt_reg.hor_blank_end = crt_reg.hor_blank_end + 16;
1516 } 1502 }
1517 1503
1504 crt_reg.hor_blank_end += crt_reg.hor_blank_start;
1505 crt_reg.hor_sync_end += crt_reg.hor_sync_start;
1506 crt_reg.ver_blank_end += crt_reg.ver_blank_start;
1507 crt_reg.ver_sync_end += crt_reg.ver_sync_start;
1518 h_addr = crt_reg.hor_addr; 1508 h_addr = crt_reg.hor_addr;
1519 v_addr = crt_reg.ver_addr; 1509 v_addr = crt_reg.ver_addr;
1520 if (set_iga == IGA1) { 1510 if (set_iga == IGA1) {
@@ -1522,14 +1512,10 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
1522 viafb_write_reg_mask(CR17, VIACR, 0x00, BIT7); 1512 viafb_write_reg_mask(CR17, VIACR, 0x00, BIT7);
1523 } 1513 }
1524 1514
1525 switch (set_iga) { 1515 if (set_iga == IGA1)
1526 case IGA1: 1516 via_set_primary_timing(&crt_reg);
1527 viafb_load_crtc_timing(crt_reg, IGA1); 1517 else if (set_iga == IGA2)
1528 break; 1518 via_set_secondary_timing(&crt_reg);
1529 case IGA2:
1530 viafb_load_crtc_timing(crt_reg, IGA2);
1531 break;
1532 }
1533 1519
1534 viafb_lock_crt(); 1520 viafb_lock_crt();
1535 viafb_write_reg_mask(CR17, VIACR, 0x80, BIT7); 1521 viafb_write_reg_mask(CR17, VIACR, 0x80, BIT7);