From d1de50d64f8a39510729611f8c666857c8090a00 Mon Sep 17 00:00:00 2001 From: Kevin Brace Date: Wed, 30 Dec 2015 22:29:19 -0600 Subject: [PATCH] Substitution of VIA_VM800 label Replaces VIA_VM800 label with VIA_P4M800PRO label inside via_driver.c where it is defined due to the fact that there is no such product as VM800 chipset from VIA Technologies. Of course, references to VIA_VM800 label in other files were also replaced as well. The VM800 chipset the source code refers to really is P4M800 Pro chipset. Also, the source code refers to a product called VN800 chipset, and this is similar (related) to P4M800 Pro chipset. The compiled device driver was tested on the following computer. - Epic 1314 laptop (MSI VR321 laptop equivalent, VN896 chipset) with Lubuntu 12.04 i386 --- src/via_bandwidth.c | 7 ++--- src/via_display.c | 3 ++- src/via_driver.c | 7 ++--- src/via_i2c.c | 3 ++- src/via_id.c | 71 ++++++++++++++++++++++++++------------------------ src/via_outputs.c | 5 ++-- src/via_regs.h | 11 ++------ src/via_ums.c | 3 ++- src/via_xv.c | 5 ++-- src/via_xv_overlay.c | 4 +-- 10 files changed, 61 insertions(+), 58 deletions(-) diff --git a/src/via_bandwidth.c b/src/via_bandwidth.c index c33bce5..1f7b178 100644 --- a/src/via_bandwidth.c +++ b/src/via_bandwidth.c @@ -1,4 +1,5 @@ /* + * Copyright 2015 Kevin Brace * Copyright 2005-2015 The Openchrome Project * [http://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] @@ -204,8 +205,8 @@ ViaSetPrimaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) else ViaSeqMask(hwp, 0x22, 0x1F, 0x1F); /* 31 */ break; - /* P4M800Pro/VN800/CN700 */ - case VIA_VM800: + /* P4M800 Pro/VN800/CN700 */ + case VIA_P4M800PRO: hwp->writeSeq(hwp, 0x17, 0x2F); ViaSeqMask(hwp, 0x16, 0x14, 0xBF); /* 80/4 = 20 = 0x14 */ ViaSeqMask(hwp, 0x18, 0x08, 0xBF); @@ -375,7 +376,7 @@ ViaSetSecondaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) else ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); /* 128/4 */ break; - case VIA_VM800: + case VIA_P4M800PRO: ViaCrtcMask(hwp, 0x68, 0xA0, 0xF0); ViaCrtcMask(hwp, 0x94, 0x00, 0x80); ViaCrtcMask(hwp, 0x95, 0x00, 0x80); diff --git a/src/via_display.c b/src/via_display.c index ea2920b..02353ee 100644 --- a/src/via_display.c +++ b/src/via_display.c @@ -1,4 +1,5 @@ /* + * Copyright 2015 Kevin Brace * Copyright 2005-2015 The Openchrome Project * [http://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] @@ -1798,7 +1799,7 @@ UMSCrtcInit(ScrnInfoPtr pScrn) case VIA_KM400: case VIA_K8M800: case VIA_PM800: - case VIA_VM800: + case VIA_P4M800PRO: max_pitch = 3344; max_height = 2508; break; diff --git a/src/via_driver.c b/src/via_driver.c index 649bf99..27e62b4 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -1,4 +1,5 @@ /* + * Copyright 2015 Kevin Brace * Copyright 2005-2015 The Openchrome Project * [http://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2006 Luc Verhaegen. @@ -131,7 +132,7 @@ static SymTabRec VIAChipsets[] = { {VIA_KM400, "KM400/KN400"}, {VIA_K8M800, "K8M800/K8N800"}, {VIA_PM800, "PM800/PM880/CN400"}, - {VIA_VM800, "VM800/P4M800Pro/VN800/CN700"}, + {VIA_P4M800PRO, "P4M800 Pro/VN800/CN700"}, {VIA_CX700, "CX700/VX700"}, {VIA_K8M890, "K8M890/K8N890"}, {VIA_P4M890, "P4M890"}, @@ -148,7 +149,7 @@ static PciChipsets VIAPciChipsets[] = { {VIA_KM400, PCI_CHIP_VT3205, VIA_RES_SHARED}, {VIA_K8M800, PCI_CHIP_VT3204, VIA_RES_SHARED}, {VIA_PM800, PCI_CHIP_VT3259, VIA_RES_SHARED}, - {VIA_VM800, PCI_CHIP_VT3314, VIA_RES_SHARED}, + {VIA_P4M800PRO, PCI_CHIP_VT3314, VIA_RES_SHARED}, {VIA_CX700, PCI_CHIP_VT3324, VIA_RES_SHARED}, {VIA_K8M890, PCI_CHIP_VT3336, VIA_RES_SHARED}, {VIA_P4M890, PCI_CHIP_VT3327, VIA_RES_SHARED}, @@ -707,7 +708,7 @@ VIASetupDefaultOptions(ScrnInfoPtr pScrn) /* FIXME The video playing (XV) is not working correctly after turn on new mode switch */ pVia->VideoEngine = VIDEO_ENGINE_CME; break; - case VIA_VM800: + case VIA_P4M800PRO: /* New mode switch resolve bug with gamma set #282 */ /* and with Xv after hibernate #240 */ break; diff --git a/src/via_i2c.c b/src/via_i2c.c index 6c11cfd..ffc062f 100644 --- a/src/via_i2c.c +++ b/src/via_i2c.c @@ -1,4 +1,5 @@ /* + * Copyright 2015 Kevin Brace * Copyright 2004 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -347,7 +348,7 @@ ViaI2CBus3Init(ScrnInfoPtr pScrn) pI2CBus->DriverPrivate.ptr = hwp; switch (pVia->Chipset) { - case VIA_VM800: + case VIA_P4M800PRO: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "using alternative PutBits/GetBits functions for I2C Bus 3\n")); pI2CBus->I2CPutBits = ViaI2C3SimplePutBits; pI2CBus->I2CGetBits = ViaI2C3SimpleGetBits; diff --git a/src/via_id.c b/src/via_id.c index 0090ad6..7f2f4d2 100644 --- a/src/via_id.c +++ b/src/via_id.c @@ -1,4 +1,7 @@ /* + * Copyright 2015 Kevin Brace + * Copyright 2005-2015 The Openchrome Project + * [http://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * * Permission is hereby granted, free of charge, to any person obtaining a @@ -136,40 +139,40 @@ static struct ViaCardIdStruct ViaCardId[] = { {"Chaintech MPM800-3", VIA_PM800, 0x270F, 0x7671, VIA_DEVICE_CRT}, {"KamLAB KINO-LUKE-533-R20", VIA_PM800, 0x3344, 0x1122, VIA_DEVICE_CRT}, - /*** P4M800Pro, VN800, CN700 ***/ - {"Clevo/RoverBook Partner E419L", VIA_VM800, 0x1019, 0x0F75, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"Haier A60-440256080BD", VIA_VM800, 0x1019, 0x0F79, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"PCChips P23G", VIA_VM800, 0x1019, 0x1623, VIA_DEVICE_CRT}, - {"ECS P4M800PRO-M", VIA_VM800, 0x1019, 0x2122, VIA_DEVICE_CRT}, - {"ECS P4M800PRO-M2 (V2.0)", VIA_VM800, 0x1019, 0x2123, VIA_DEVICE_CRT}, - {"ECS C7VCM", VIA_VM800, 0x1019, 0xAA2D, VIA_DEVICE_CRT}, - {"PCChips V21G", VIA_VM800, 0x1019, 0xAA51, VIA_DEVICE_CRT}, - {"Hewlett Packard DX2020", VIA_VM800, 0x103C, 0x3027, VIA_DEVICE_CRT}, - {"Hitachi FLORA Se210 RK1", VIA_VM800, 0x1043, 0x13E2, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"Asustek P5VDC-MX", VIA_VM800, 0x1043, 0x3344, VIA_DEVICE_CRT}, - {"Asustek P5VDC-TVM", VIA_VM800, 0x1043, 0x81CE, VIA_DEVICE_CRT}, - {"Foxconn P4M800P7MB-RS2H", VIA_VM800, 0x105B, 0x0CF0, VIA_DEVICE_CRT}, - {"Gateway MX3210", VIA_VM800, 0x107B, 0x0216, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"VIA VT3344 (VM800) - EPIA EN", VIA_VM800, 0x1106, 0x3344, VIA_DEVICE_CRT | VIA_DEVICE_TV}, - {"Gigabyte GA-8VM800M-775", VIA_VM800, 0x1458, 0xD000, VIA_DEVICE_CRT}, - {"MSI PM8M-V", VIA_VM800, 0x1462, 0x7104, VIA_DEVICE_CRT}, - {"MSI Fuzzy CN700/CN700T/CN700G", VIA_VM800, 0x1462, 0x7199, VIA_DEVICE_CRT | VIA_DEVICE_TV}, - {"MSI PM8M3-V", VIA_VM800, 0x1462, 0x7211, VIA_DEVICE_CRT}, - {"MSI PM8PM", VIA_VM800, 0x1462, 0x7222, VIA_DEVICE_CRT}, - {"Twinhead M6", VIA_VM800, 0x14FF, 0xA007, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"RoverBook Partner W500", VIA_VM800, 0x1509, 0x4330, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"FIC PTM800Pro LF", VIA_VM800, 0x1509, 0x601A, VIA_DEVICE_CRT}, - {"Clevo/RoverBook Voyager V511L", VIA_VM800, 0x1558, 0x0662, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"Clevo M5xxS", VIA_VM800, 0x1558, 0x5406, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"Biostar P4M80-M4 / P4VMA-M", VIA_VM800, 0x1565, 0x1202, VIA_DEVICE_CRT}, - {"Biostar P4M800 Pro-M7", VIA_VM800, 0x1565, 0x1206, VIA_DEVICE_CRT}, - {"Packard Bell Lima (ASUS MBP5VDZ-NVM)", VIA_VM800, 0x1631, 0xE018, VIA_DEVICE_CRT}, - {"Fujitsu/Siemens Amilo Pro V2030", VIA_VM800, 0x1734, 0x109B, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"Fujitsu/Siemens Amilo Pro V2035", VIA_VM800, 0x1734, 0x10AE, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"Fujitsu/Siemens Amilo Pro V2055", VIA_VM800, 0x1734, 0x10CA, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"Fujitsu/Siemens Amilo L7320", VIA_VM800, 0x1734, 0x10CD, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"ASRock P4VM800", VIA_VM800, 0x1849, 0x3344, VIA_DEVICE_CRT}, - {"Asustek P5V800-MX", VIA_VM800, 0x3344, 0x1122, VIA_DEVICE_CRT}, + /* P4M800 Pro, VN800, CN700 */ + {"Clevo/RoverBook Partner E419L", VIA_P4M800PRO, 0x1019, 0x0F75, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Haier A60-440256080BD", VIA_P4M800PRO, 0x1019, 0x0F79, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"PCChips P23G", VIA_P4M800PRO, 0x1019, 0x1623, VIA_DEVICE_CRT}, + {"ECS P4M800PRO-M", VIA_P4M800PRO, 0x1019, 0x2122, VIA_DEVICE_CRT}, + {"ECS P4M800PRO-M2 (V2.0)", VIA_P4M800PRO, 0x1019, 0x2123, VIA_DEVICE_CRT}, + {"ECS C7VCM", VIA_P4M800PRO, 0x1019, 0xAA2D, VIA_DEVICE_CRT}, + {"PCChips V21G", VIA_P4M800PRO, 0x1019, 0xAA51, VIA_DEVICE_CRT}, + {"Hewlett Packard DX2020", VIA_P4M800PRO, 0x103C, 0x3027, VIA_DEVICE_CRT}, + {"Hitachi FLORA Se210 RK1", VIA_P4M800PRO, 0x1043, 0x13E2, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Asustek P5VDC-MX", VIA_P4M800PRO, 0x1043, 0x3344, VIA_DEVICE_CRT}, + {"Asustek P5VDC-TVM", VIA_P4M800PRO, 0x1043, 0x81CE, VIA_DEVICE_CRT}, + {"Foxconn P4M800P7MB-RS2H", VIA_P4M800PRO, 0x105B, 0x0CF0, VIA_DEVICE_CRT}, + {"Gateway MX3210", VIA_P4M800PRO, 0x107B, 0x0216, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"VIA VT3344 (VM800) - EPIA EN", VIA_P4M800PRO, 0x1106, 0x3344, VIA_DEVICE_CRT | VIA_DEVICE_TV}, + {"Gigabyte GA-8VM800M-775", VIA_P4M800PRO, 0x1458, 0xD000, VIA_DEVICE_CRT}, + {"MSI PM8M-V", VIA_P4M800PRO, 0x1462, 0x7104, VIA_DEVICE_CRT}, + {"MSI Fuzzy CN700/CN700T/CN700G", VIA_P4M800PRO, 0x1462, 0x7199, VIA_DEVICE_CRT | VIA_DEVICE_TV}, + {"MSI PM8M3-V", VIA_P4M800PRO, 0x1462, 0x7211, VIA_DEVICE_CRT}, + {"MSI PM8PM", VIA_P4M800PRO, 0x1462, 0x7222, VIA_DEVICE_CRT}, + {"Twinhead M6", VIA_P4M800PRO, 0x14FF, 0xA007, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"RoverBook Partner W500", VIA_P4M800PRO, 0x1509, 0x4330, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"FIC PTM800Pro LF", VIA_P4M800PRO, 0x1509, 0x601A, VIA_DEVICE_CRT}, + {"Clevo/RoverBook Voyager V511L", VIA_P4M800PRO, 0x1558, 0x0662, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Clevo M5xxS", VIA_P4M800PRO, 0x1558, 0x5406, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Biostar P4M80-M4 / P4VMA-M", VIA_P4M800PRO, 0x1565, 0x1202, VIA_DEVICE_CRT}, + {"Biostar P4M800 Pro-M7", VIA_P4M800PRO, 0x1565, 0x1206, VIA_DEVICE_CRT}, + {"Packard Bell Lima (ASUS MBP5VDZ-NVM)", VIA_P4M800PRO, 0x1631, 0xE018, VIA_DEVICE_CRT}, + {"Fujitsu/Siemens Amilo Pro V2030", VIA_P4M800PRO, 0x1734, 0x109B, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Fujitsu/Siemens Amilo Pro V2035", VIA_P4M800PRO, 0x1734, 0x10AE, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Fujitsu/Siemens Amilo Pro V2055", VIA_P4M800PRO, 0x1734, 0x10CA, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Fujitsu/Siemens Amilo L7320", VIA_P4M800PRO, 0x1734, 0x10CD, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"ASRock P4VM800", VIA_P4M800PRO, 0x1849, 0x3344, VIA_DEVICE_CRT}, + {"Asustek P5V800-MX", VIA_P4M800PRO, 0x3344, 0x1122, VIA_DEVICE_CRT}, /*** K8M890 ***/ {"IBM AnyPlace Kiosk 3xx", VIA_K8M890, 0x1106, 0x3230, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, diff --git a/src/via_outputs.c b/src/via_outputs.c index 66c9be1..0946f7f 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -1,4 +1,5 @@ /* + * Copyright 2015 Kevin Brace * Copyright 2005-2015 The Openchrome Project * [http://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] @@ -1081,7 +1082,7 @@ ViaOutputsDetect(ScrnInfoPtr pScrn) if ((pVia->Chipset != VIA_P4M900) || (pVia->ActiveDevice & VIA_DEVICE_TV)) via_tv_init(pScrn); - if (pVia->Chipset == VIA_VM800) { + if (pVia->Chipset == VIA_P4M800PRO) { via_dvi_init(pScrn); } @@ -1529,7 +1530,7 @@ ViaModeFirstCRTC(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_KM400: case VIA_K8M800: case VIA_PM800: - case VIA_VM800: + case VIA_P4M800PRO: ViaSeqMask(hwp, 0x1A, 0x06, 0x06); break; default: diff --git a/src/via_regs.h b/src/via_regs.h index 1f43d6e..1046d37 100644 --- a/src/via_regs.h +++ b/src/via_regs.h @@ -1,4 +1,5 @@ /* + * Copyright 2015 Kevin Brace * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. * @@ -22,13 +23,6 @@ * DEALINGS IN THE SOFTWARE. */ -/************************************************************************* - * - * File: via_regs.c - * Content: The defines of Via registers - * - ************************************************************************/ - #ifndef _VIA_REGS_H_ #define _VIA_REGS_H_ 1 @@ -47,7 +41,6 @@ enum VIACHIPTAGS { VIA_KM400, VIA_K8M800, VIA_PM800, - VIA_VM800, VIA_P4M800PRO, /* VT3314 */ VIA_CX700, /* VT3324 */ VIA_K8M890, /* VT3336 */ @@ -69,7 +62,7 @@ enum VIACHIPTAGS { #define PCI_CHIP_VT3205 0x7205 /* KM400 */ #define PCI_CHIP_VT3204 0x3108 /* K8M800 */ #define PCI_CHIP_VT3259 0x3118 /* PM800 */ -#define PCI_CHIP_VT3314 0x3344 /* VM800 */ +#define PCI_CHIP_VT3314 0x3344 /* P4M800 Pro */ #define PCI_CHIP_VT3324 0x3157 /* CX700 */ #define PCI_CHIP_VT3336 0x3230 /* K8M890 */ #define PCI_CHIP_VT3327 0x3343 /* P4M890 */ diff --git a/src/via_ums.c b/src/via_ums.c index cda0e45..addb3db 100644 --- a/src/via_ums.c +++ b/src/via_ums.c @@ -1,4 +1,5 @@ /* + * Copyright 2015 Kevin Brace * Copyright 2011-2015 The Openchrome Project * [http://www.freedesktop.org/wiki/Openchrome] * @@ -726,7 +727,7 @@ UMSPreInit(ScrnInfoPtr pScrn) pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10; break; case VIA_PM800: - case VIA_VM800: + case VIA_P4M800PRO: case VIA_K8M800: #ifdef HAVE_PCIACCESS pci_device_cfg_read_u8(vgaDevice, &videoRam, 0xA1); diff --git a/src/via_xv.c b/src/via_xv.c index 6eafb68..ed2617c 100644 --- a/src/via_xv.c +++ b/src/via_xv.c @@ -1,4 +1,5 @@ /* + * Copyright 2015 Kevin Brace * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * @@ -610,7 +611,7 @@ viaInitVideo(ScreenPtr pScreen) (pVia->Chipset == VIA_KM400) || (pVia->Chipset == VIA_K8M800) || (pVia->Chipset == VIA_PM800) || - (pVia->Chipset == VIA_VM800) || + (pVia->Chipset == VIA_P4M800PRO) || (pVia->Chipset == VIA_K8M890) || (pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_CX700) || @@ -633,7 +634,7 @@ viaInitVideo(ScreenPtr pScreen) if ((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400) || (pVia->Chipset == VIA_K8M800) || (pVia->Chipset == VIA_PM800) || - (pVia->Chipset == VIA_VM800) || (pVia->Chipset == VIA_K8M890) || + (pVia->Chipset == VIA_P4M800PRO) || (pVia->Chipset == VIA_K8M890) || (pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_P4M890) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855 || (pVia->Chipset == VIA_VX900))) { diff --git a/src/via_xv_overlay.c b/src/via_xv_overlay.c index 85b2403..b65a688 100644 --- a/src/via_xv_overlay.c +++ b/src/via_xv_overlay.c @@ -275,7 +275,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; HWDiff->HQVCmeRegs = hqv_cme_regs; break; - case VIA_VM800: + case VIA_P4M800PRO: case VIA_P4M900: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; @@ -1857,7 +1857,7 @@ Upd_Video(xf86CrtcPtr crtc, unsigned long videoFlag, * Enable video on secondary */ if ((pVia->VideoEngine == VIDEO_ENGINE_CME || - pVia->Chipset == VIA_VM800) && iga->index) { + pVia->Chipset == VIA_P4M800PRO) && iga->index) { /* V1_ON_SND_DISPLAY */ vidCtl |= V1_ON_SND_DISPLAY; /* SECOND_DISPLAY_COLOR_KEY_ENABLE */ -- 1.7.9.5