diff --git a/src/add-ons/accelerants/matrox/GetDeviceInfo.c b/src/add-ons/accelerants/matrox/GetDeviceInfo.c index b4c6dede20..75059841ae 100644 --- a/src/add-ons/accelerants/matrox/GetDeviceInfo.c +++ b/src/add-ons/accelerants/matrox/GetDeviceInfo.c @@ -1,7 +1,6 @@ /* - Authors: - Mark Watson - 21/6/00, - Apsed + Author: + Rudolf Cornelissen 11/2004 */ #define MODULE_BIT 0x04000000 @@ -11,41 +10,46 @@ /* Get some info about the device */ status_t GET_ACCELERANT_DEVICE_INFO(accelerant_device_info * adi) { - /*no info on version is provided, so presumably this is for my info*/ - LOG(4,("DEVICE_INFO: version 0x%08x\n", adi->version)); - - switch ((si->ps.secondary_head << 4)|si->ps.card_type) + LOG(4,("GET_ACCELERANT_DEVICE_INFO: returning info\n")); + + /* no info on version is provided, so presumably this is for my info */ + adi->version = 1; + + sprintf(adi->name, "Matrox chipset"); + switch (si->ps.card_type) { - case 0x01: - sprintf(adi->name,"Matrox G400 Plain"); + case MIL1: + sprintf(adi->chipset, "Millennium I"); break; - case 0x02: - sprintf(adi->name,"Matrox G400 MAX"); + case MYST: + sprintf(adi->chipset, "Mystique"); break; - case 0x11: - sprintf(adi->name,"Matrox Dualhead G400 Plain"); + case MIL2: + sprintf(adi->chipset, "Millennium II"); break; - case 0x12: - sprintf(adi->name,"Matrox Dualhead G400 MAX"); + case G100: + sprintf(adi->chipset, "G100"); + break; + case G200: + sprintf(adi->chipset, "G200"); + break; + case G400: + case G400MAX: + sprintf(adi->chipset, "G400"); + break; + case G450: + sprintf(adi->chipset, "G450"); + break; + case G550: + sprintf(adi->chipset, "G550"); + break; + default: + sprintf(adi->chipset, "unknown"); break; } - - sprintf(adi->chipset,"MGAG400"); - - sprintf(adi->serial_no,"01134"); /*FIXME*/ - - adi->memory=si->ps.memory_size * 1024 * 1024; - - adi->dac_speed=si->ps.max_dac1_clock; - - // apsed, TODO ?? GET_ACCELERANT_DEVICE_INFO never called and kind of cards - LOG(2,("GET_ACCELERANT_DEVICE_INFO %20s 0x%08x %d\n", "version", adi->version, adi->version)); - LOG(2,("GET_ACCELERANT_DEVICE_INFO %20s %s\n", "name", adi->name)); - LOG(2,("GET_ACCELERANT_DEVICE_INFO %20s %s\n", "chipset", adi->chipset)); - LOG(2,("GET_ACCELERANT_DEVICE_INFO %20s %s\n", "serial_no", adi->serial_no)); - LOG(2,("GET_ACCELERANT_DEVICE_INFO %20s 0x%08x %d\n", "memory", adi->memory, adi->memory)); - LOG(2,("GET_ACCELERANT_DEVICE_INFO %20s %d\n", "dac_speed", adi->dac_speed)); - + sprintf(adi->serial_no, "unknown"); + adi->memory = (si->ps.memory_size * 1024 * 1024); + adi->dac_speed = si->ps.max_dac1_clock; return B_OK; } diff --git a/src/add-ons/accelerants/matrox/GetTimingConstraints.c b/src/add-ons/accelerants/matrox/GetTimingConstraints.c index 29751b96c8..7e34855c44 100644 --- a/src/add-ons/accelerants/matrox/GetTimingConstraints.c +++ b/src/add-ons/accelerants/matrox/GetTimingConstraints.c @@ -1,7 +1,6 @@ /* - Authors: - Mark Watson - 21/6/00, - Apsed + Author: + Rudolf Cornelissen 11/2004 */ #define MODULE_BIT 0x01000000 @@ -11,20 +10,25 @@ /* Used to help generate mode lines */ status_t GET_TIMING_CONSTRAINTS(display_timing_constraints * dtc) { - // apsed, TODO, is that following card capabilities ?? - LOG(4, ("GET_TIMING_CONSTRAINTS\n")); - - dtc->h_res=8; - dtc->h_sync_min=8; - dtc->h_sync_max=248; - dtc->h_blank_min=8; - dtc->h_blank_max=504; - - dtc->v_res=1; - dtc->v_sync_min=1; - dtc->v_sync_max=15; - dtc->v_blank_min=1; - dtc->v_blank_max=255; + LOG(4, ("GET_TIMING_CONSTRAINTS: returning info\n")); + + /* specs are identical for all Matrox cards on CRTC1 (Mil-1 - G550) */ + /* Note: G400-G550 CRTC2 have wider constraints, so this is OK. */ + dtc->h_res = 8; + dtc->h_sync_min = 8; + dtc->h_sync_max = 248; + /* Note: + * h_blank info is used to determine the max. diff. between h_total and h_display! */ + dtc->h_blank_min = 8; + dtc->h_blank_max = 1016; + + dtc->v_res = 1; + dtc->v_sync_min = 1; + dtc->v_sync_max = 15; + /* Note: + * v_blank info is used to determine the max. diff. between v_total and v_display! */ + dtc->v_blank_min = 1; + dtc->v_blank_max = 255; return B_OK; } diff --git a/src/add-ons/accelerants/matrox/engine/mga_crtc.c b/src/add-ons/accelerants/matrox/engine/mga_crtc.c index 217268dbee..2e971f11d8 100644 --- a/src/add-ons/accelerants/matrox/engine/mga_crtc.c +++ b/src/add-ons/accelerants/matrox/engine/mga_crtc.c @@ -2,7 +2,7 @@ /* Authors: Mark Watson 2/2000, Apsed, - Rudolf Cornelissen 11/2002-2/2004 + Rudolf Cornelissen 11/2002-11/2004 */ #define MODULE_BIT 0x00040000 @@ -50,6 +50,9 @@ status_t gx00_crtc_validate_timing( /* if hor. total does not leave room for a sensible sync pulse, increase it! */ if (*ht < (*hd_e + 80)) *ht = (*hd_e + 80); + /* if hor. total does not adhere to max. blanking pulse width, decrease it! */ + if (*ht > (*hd_e + 0x3f8)) *ht = (*hd_e + 0x3f8); + /* make sure sync pulse is not during display */ if (*hs_e > (*ht - 8)) *hs_e = (*ht - 8); if (*hs_s < (*hd_e + 8)) *hs_s = (*hd_e + 8); @@ -86,6 +89,9 @@ status_t gx00_crtc_validate_timing( /*if vertical total does not leave room for a sync pulse, increase it!*/ if (*vt < (*vd_e + 3)) *vt = (*vd_e + 3); + /* if vert. total does not adhere to max. blanking pulse width, decrease it! */ + if (*vt > (*vd_e + 0xff)) *vt = (*vd_e + 0xff); + /* make sure sync pulse is not during display */ if (*vs_e > (*vt - 1)) *vs_e = (*vt - 1); if (*vs_s < (*vd_e + 1)) *vs_s = (*vd_e + 1);