.gitignore | 1 configure.ac | 2 debian/changelog | 9 debian/patches/add-missing-include.diff | 19 debian/patches/series | 2 debian/rules | 10 debian/xserver-xorg-video-openchrome.install | 2 src/Makefile.am | 2 src/via_3d.c | 8 src/via_3d.h | 1 src/via_bandwidth.c | 9 src/via_display.c | 34 + src/via_dri.c | 13 src/via_driver.c | 131 +++--- src/via_driver.h | 10 src/via_drm.h | 91 ++-- src/via_exa.c | 7 src/via_i2c.c | 162 ++++++- src/via_id.c | 98 ++-- src/via_kms.c | 1 src/via_lvds.c | 53 ++ src/via_memcpy.c | 12 src/via_memmgr.c | 7 src/via_outputs.c | 553 ++++++++++++++++----------- src/via_priv.h | 3 src/via_regs.h | 3 src/via_ums.c | 28 - src/via_vt1632.c | 275 +++++++++++++ src/via_vt1632.h | 54 ++ src/via_xv.c | 8 src/via_xv_overlay.c | 20 tools/registers.c | 80 ++- 32 files changed, 1173 insertions(+), 535 deletions(-)
New commits: commit 840021ea37d1e351561a1b67005b8d98096a8834 Author: Timo Aaltonen <tjaal...@debian.org> Date: Thu Mar 10 15:55:45 2016 +0200 upload to unstable diff --git a/debian/changelog b/debian/changelog index b5ab5b6..102f330 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -xserver-xorg-video-openchrome (1:0.3.3+git20160310-1) UNRELEASED; urgency=medium +xserver-xorg-video-openchrome (1:0.3.3+git20160310-1) unstable; urgency=medium * New upstream snapshot (Closes: #814682) * rules: Enable parallel builds. * Install shared libs in multiarch libdir. * rules: Add gentarball target - -- Timo Aaltonen <tjaal...@debian.org> Thu, 10 Mar 2016 15:34:35 +0200 + -- Timo Aaltonen <tjaal...@debian.org> Thu, 10 Mar 2016 15:53:41 +0200 xserver-xorg-video-openchrome (1:0.3.3-2) unstable; urgency=medium commit c9f37566a783aef2a3f906c14fdaf9342c7a0b2a Author: Timo Aaltonen <tjaal...@debian.org> Date: Thu Mar 10 15:53:34 2016 +0200 rules: Add gentarball target diff --git a/debian/changelog b/debian/changelog index 7c2856a..b5ab5b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ xserver-xorg-video-openchrome (1:0.3.3+git20160310-1) UNRELEASED; urgency=medium * New upstream snapshot (Closes: #814682) * rules: Enable parallel builds. * Install shared libs in multiarch libdir. + * rules: Add gentarball target -- Timo Aaltonen <tjaal...@debian.org> Thu, 10 Mar 2016 15:34:35 +0200 diff --git a/debian/rules b/debian/rules index 4705ed5..9835f25 100755 --- a/debian/rules +++ b/debian/rules @@ -35,3 +35,8 @@ override_dh_strip: %: dh $@ --parallel --with quilt,autoreconf,xsf --builddirectory=build/ + +gentarball: SOURCE=xserver-xorg-video-openchrome +gentarball: UV=$(shell dpkg-parsechangelog|awk '/^Version:/ {print $$2}'|sed 's/^[0-9]*://;s/-.*$$//') +gentarball: + git archive --format=tar upstream-unstable --prefix=$(SOURCE)-$(UV)/ | gzip -9 > ../$(SOURCE)_$(UV).orig.tar.gz commit b96e76e8d34542ac4c5bfefce062ab97342422b5 Author: Timo Aaltonen <tjaal...@debian.org> Date: Thu Mar 10 15:45:42 2016 +0200 Install shared libs in multiarch libdir. diff --git a/debian/changelog b/debian/changelog index 28a583f..7c2856a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ xserver-xorg-video-openchrome (1:0.3.3+git20160310-1) UNRELEASED; urgency=medium * New upstream snapshot (Closes: #814682) * rules: Enable parallel builds. + * Install shared libs in multiarch libdir. -- Timo Aaltonen <tjaal...@debian.org> Thu, 10 Mar 2016 15:34:35 +0200 diff --git a/debian/rules b/debian/rules index abdbb78..4705ed5 100755 --- a/debian/rules +++ b/debian/rules @@ -21,6 +21,9 @@ override_dh_auto_install: # Kill *.la files, and forget no-one: override_dh_install: find debian/tmp -name '*.la' -delete + mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) + mv debian/tmp/usr/lib/libchromeXvMC* \ + debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/. dh_install --fail-missing # That's a plugin, use appropriate warning level: diff --git a/debian/xserver-xorg-video-openchrome.install b/debian/xserver-xorg-video-openchrome.install index 806b124..b9c0996 100644 --- a/debian/xserver-xorg-video-openchrome.install +++ b/debian/xserver-xorg-video-openchrome.install @@ -1,3 +1,3 @@ usr/lib/xorg/modules/drivers/*.so -usr/lib/libchromeXvMC* +usr/lib/*/libchromeXvMC* usr/share/man commit ca4600c8b52edceb09f274600edc4845741dd67b Author: Timo Aaltonen <tjaal...@debian.org> Date: Thu Mar 10 15:43:17 2016 +0200 rules: Enable parallel builds. diff --git a/debian/changelog b/debian/changelog index c5fd6af..28a583f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ xserver-xorg-video-openchrome (1:0.3.3+git20160310-1) UNRELEASED; urgency=medium * New upstream snapshot (Closes: #814682) + * rules: Enable parallel builds. -- Timo Aaltonen <tjaal...@debian.org> Thu, 10 Mar 2016 15:34:35 +0200 diff --git a/debian/rules b/debian/rules index 050da27..abdbb78 100755 --- a/debian/rules +++ b/debian/rules @@ -31,4 +31,4 @@ override_dh_strip: dh_strip --dbg-package=xserver-xorg-video-openchrome-dbg %: - dh $@ --with quilt,autoreconf,xsf --builddirectory=build/ + dh $@ --parallel --with quilt,autoreconf,xsf --builddirectory=build/ commit 54c4e2d8ac739571e6cbebb99cca696ef92d6f32 Author: Timo Aaltonen <tjaal...@debian.org> Date: Thu Mar 10 15:41:18 2016 +0200 drop patch, update changelog diff --git a/debian/changelog b/debian/changelog index cc143e1..c5fd6af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xserver-xorg-video-openchrome (1:0.3.3+git20160310-1) UNRELEASED; urgency=medium + + * New upstream snapshot (Closes: #814682) + + -- Timo Aaltonen <tjaal...@debian.org> Thu, 10 Mar 2016 15:34:35 +0200 + xserver-xorg-video-openchrome (1:0.3.3-2) unstable; urgency=medium * control: Drop Julien Viard de Galbert and Cyril Brulebois from diff --git a/debian/patches/add-missing-include.diff b/debian/patches/add-missing-include.diff deleted file mode 100644 index c143fda..0000000 --- a/debian/patches/add-missing-include.diff +++ /dev/null @@ -1,19 +0,0 @@ -commit 319fcdad57ebf4f1ef828c3344058ff8f6197432 -Author: Xavier Bachelot <xav...@bachelot.org> -Date: Tue Jan 13 18:34:53 2015 +0100 - - Add missing header inclusion. - Fixes https://bugs.freedesktop.org/show_bug.cgi?id=88334 - -diff --git a/src/via_3d.h b/src/via_3d.h -index c33228e..15be0be 100644 ---- a/src/via_3d.h -+++ b/src/via_3d.h -@@ -24,6 +24,7 @@ - #ifndef VIA_3D_H - #define VIA_3D_H - -+#include "xorg-server.h" - #include "xf86.h" - #include "via_dmabuffer.h" - diff --git a/debian/patches/series b/debian/patches/series index e7b0e40..a82d1b4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1 @@ -add-missing-include.diff +#placeholder commit babf51f887554743a46a5078832fe4013f02a018 Author: Kevin Brace <kevinbr...@gmx.com> Date: Thu Mar 10 02:47:40 2016 -0800 Removing via_dp_* functions Removing via_dp_* functions inside via_outputs.c. These functions are not really doing anything useful, so they will be deleted. Apparently, they were originally meant for CX700, VX800, VX855, and VX900 chipsets. via_lvds_* functions are already handling integrated TMDS and LVDS transmitters for the above chipsets. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_outputs.c b/src/via_outputs.c index f6fc2ad..9e715fc 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -520,172 +520,6 @@ via_tv_init(ScrnInfoPtr pScrn) return TRUE; } -static void -via_dp_create_resources(xf86OutputPtr output) -{ -} - -#ifdef RANDR_12_INTERFACE -static Bool -via_dp_set_property(xf86OutputPtr output, Atom property, - RRPropertyValuePtr value) -{ - return TRUE; -} - -static Bool -via_dp_get_property(xf86OutputPtr output, Atom property) -{ - return FALSE; -} -#endif - -static void -via_dp_dpms(xf86OutputPtr output, int mode) -{ - ScrnInfoPtr pScrn = output->scrn; - - switch (mode) { - case DPMSModeOn: - ViaDFPPower(pScrn, TRUE); - break; - - case DPMSModeStandby: - case DPMSModeSuspend: - case DPMSModeOff: - ViaDFPPower(pScrn, FALSE); - break; - } -} - -static void -via_dp_save(xf86OutputPtr output) -{ -} - -static void -via_dp_restore(xf86OutputPtr output) -{ -} - -static int -via_dp_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) -{ - ScrnInfoPtr pScrn = output->scrn; - - if (!ViaModeDotClockTranslate(pScrn, pMode)) - return MODE_NOCLOCK; - return MODE_OK; -} - -static Bool -via_dp_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, - DisplayModePtr adjusted_mode) -{ - return TRUE; -} - -static void -via_dp_prepare(xf86OutputPtr output) -{ -} - -static void -via_dp_commit(xf86OutputPtr output) -{ -} - -static void -via_dp_mode_set(xf86OutputPtr output, DisplayModePtr mode, - DisplayModePtr adjusted_mode) -{ - ScrnInfoPtr pScrn = output->scrn; - - if (output->crtc) { - drmmode_crtc_private_ptr iga = output->crtc->driver_private; - CARD8 value = 0x00; /* Value for IGA 1 */ - vgaHWPtr hwp = VGAHWPTR(pScrn); - - /* IGA 2 */ - if (iga->index) - value = 0x10; - ViaSeqMask(hwp, 0x99, value, 0x10); - } - ViaDFPPower(pScrn, TRUE); -} - -static xf86OutputStatus -via_dp_detect(xf86OutputPtr output) -{ - xf86OutputStatus status = XF86OutputStatusDisconnected; - ScrnInfoPtr pScrn = output->scrn; - VIAPtr pVia = VIAPTR(pScrn); - xf86MonPtr mon; - - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Entered via_dp_detect.\n")); - - mon = xf86OutputGetEDID(output, pVia->pI2CBus2); - if (mon && DIGITAL(mon->features.input_type)) { - xf86OutputSetEDID(output, mon); - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "I2C Bus 2 detected a DP.\n"); - status = XF86OutputStatusConnected; - } - - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Exiting via_dp_detect.\n")); - return status; -} - -static void -via_dp_destroy(xf86OutputPtr output) -{ -} - -static const xf86OutputFuncsRec via_dp_funcs = { - .create_resources = via_dp_create_resources, -#ifdef RANDR_12_INTERFACE - .set_property = via_dp_set_property, -#endif -#ifdef RANDR_13_INTERFACE - .get_property = via_dp_get_property, -#endif - .dpms = via_dp_dpms, - .save = via_dp_save, - .restore = via_dp_restore, - .mode_valid = via_dp_mode_valid, - .mode_fixup = via_dp_mode_fixup, - .prepare = via_dp_prepare, - .commit = via_dp_commit, - .mode_set = via_dp_mode_set, - .detect = via_dp_detect, - .get_modes = xf86OutputGetEDIDModes, - .destroy = via_dp_destroy, -}; - -void -via_dp_init(ScrnInfoPtr pScrn) -{ - VIAPtr pVia = VIAPTR(pScrn); - xf86OutputPtr output = NULL; - - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Entered via_dp_init.\n")); - - if (pVia->pI2CBus2) - output = xf86OutputCreate(pScrn, &via_dp_funcs, "DP-1"); - if (output) { - output->possible_crtcs = 0x1; - output->possible_clones = 0; - output->interlaceAllowed = TRUE; - output->doubleScanAllowed = FALSE; - } - - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Exiting via_dp_init.\n")); -} - /* * Enables CRT using DPMS registers. */ @@ -1188,16 +1022,6 @@ ViaOutputsDetect(ScrnInfoPtr pScrn) via_dvi_init(pScrn); - if (pVia->ActiveDevice & VIA_DEVICE_DFP) { - switch (pVia->Chipset) { - case VIA_CX700: - case VIA_VX800: - case VIA_VX855: - case VIA_VX900: - via_dp_init(pScrn); - break; - } - } } #ifdef HAVE_DEBUG commit 0a2f6f3d229f93f29a5112bef635ff4b62d774e8 Author: Kevin Brace <kevinbr...@gmx.com> Date: Wed Mar 9 20:26:25 2016 -0800 Added debug messages to via_dp_detect Added debug messages to via_dp_detect function inside via_outputs.c. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_outputs.c b/src/via_outputs.c index c4ebebe..f6fc2ad 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -622,6 +622,9 @@ via_dp_detect(xf86OutputPtr output) VIAPtr pVia = VIAPTR(pScrn); xf86MonPtr mon; + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Entered via_dp_detect.\n")); + mon = xf86OutputGetEDID(output, pVia->pI2CBus2); if (mon && DIGITAL(mon->features.input_type)) { xf86OutputSetEDID(output, mon); @@ -629,6 +632,9 @@ via_dp_detect(xf86OutputPtr output) "I2C Bus 2 detected a DP.\n"); status = XF86OutputStatusConnected; } + + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting via_dp_detect.\n")); return status; } commit 47323aab2d3b406845dc35ef474a3855c1df1aa7 Author: Kevin Brace <kevinbr...@gmx.com> Date: Wed Mar 9 17:32:54 2016 -0800 Modified a debug message within via_vt1632_probe Modified a debug message within via_vt1632_probe function inside via_vt1632.c. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_vt1632.c b/src/via_vt1632.c index 911eee7..3c507cb 100644 --- a/src/via_vt1632.c +++ b/src/via_vt1632.c @@ -262,8 +262,8 @@ via_vt1632_init(ScrnInfoPtr pScrn, I2CDevPtr pDev) xf86I2CReadByte(pDev, 0x07, &buf); Private->DotclockMax = (buf + 65) * 1000; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1632A: Dot Clock Range: %d " - "to %d MHz.\n", + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1632A Dot Clock Range: " + "%d to %d MHz\n", Private->DotclockMin / 1000, Private->DotclockMax / 1000); commit a2def1ce285c7329ec3ae9491b63b5f880141d88 Author: Kevin Brace <kevinbr...@gmx.com> Date: Wed Mar 9 17:30:47 2016 -0800 Added debug messages to via_vt1632_probe Added debug messages to via_vt1632_probe function inside via_vt1632.c. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_vt1632.c b/src/via_vt1632.c index 8b9edf8..911eee7 100644 --- a/src/via_vt1632.c +++ b/src/via_vt1632.c @@ -211,13 +211,17 @@ via_vt1632_probe(ScrnInfoPtr pScrn, I2CDevPtr pDev) { VendorID = buf; xf86I2CReadByte(pDev, 1, &buf); VendorID |= buf << 8; + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Vendor ID: 0x%04x\n", VendorID)); xf86I2CReadByte(pDev, 2, &buf); DeviceID = buf; xf86I2CReadByte(pDev, 3, &buf); DeviceID |= buf << 8; + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Device ID: %04x\n", DeviceID)); - if (VendorID != 0x1106 || DeviceID != 0x3192) { + if ((VendorID != 0x1106) || (DeviceID != 0x3192)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1632A DVI transmitter not detected.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, commit 74e95a634506ab92b4c31ee1423bf9349067e0b5 Author: Kevin Brace <kevinbr...@gmx.com> Date: Wed Mar 9 00:05:44 2016 -0800 set_origin callback of xf86CrtcFuncsRec compilation error It appears that set_origin callback function of xf86CrtcFuncsRec structure is available only if ABI_VIDEODRV_VERSION is greater than 2. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_display.c b/src/via_display.c index be1bebe..15289e9 100644 --- a/src/via_display.c +++ b/src/via_display.c @@ -1241,7 +1241,7 @@ static const xf86CrtcFuncsRec iga1_crtc_funcs = { .show_cursor = iga1_crtc_show_cursor, .hide_cursor = iga1_crtc_hide_cursor, .load_cursor_argb = iga_crtc_load_cursor_argb, -#ifdef RANDR_12_INTERFACE +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) > 2 .set_origin = iga1_crtc_set_origin, #endif .destroy = iga_crtc_destroy, @@ -1658,7 +1658,7 @@ static const xf86CrtcFuncsRec iga2_crtc_funcs = { .show_cursor = iga2_crtc_show_cursor, .hide_cursor = iga2_crtc_hide_cursor, .load_cursor_argb = iga_crtc_load_cursor_argb, -#ifdef RANDR_12_INTERFACE +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) > 2 .set_origin = iga2_crtc_set_origin, #endif .destroy = iga_crtc_destroy, commit 8e95e6919263763f64e8e034a88132f71c5b6783 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Mar 8 23:26:01 2016 -0800 get_property callback of xf86OutputFuncsRec and RandR compilation error get_property callback of xf86OutputFuncsRec structure is supported by RandR version 1.3, not version 1.2. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_lvds.c b/src/via_lvds.c index 09c5763..fd5d4b9 100644 --- a/src/via_lvds.c +++ b/src/via_lvds.c @@ -1476,6 +1476,8 @@ static const xf86OutputFuncsRec via_lvds_funcs = { .create_resources = via_lvds_create_resources, #ifdef RANDR_12_INTERFACE .set_property = via_lvds_set_property, +#endif +#ifdef RANDR_13_INTERFACE .get_property = via_lvds_get_property, #endif .dpms = via_lvds_dpms, commit aed2e6648e9d1b95855c64b3a1edf6c0bcc18c9c Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Mar 8 21:07:11 2016 -0800 get_property callback of xf86OutputFuncsRec and RandR compilation error get_property callback of xf86OutputFuncsRec structure is supported by RandR version 1.3, not version 1.2. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_outputs.c b/src/via_outputs.c index d97d585..c4ebebe 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -375,6 +375,8 @@ static const xf86OutputFuncsRec via_tv_funcs = { .create_resources = via_tv_create_resources, #ifdef RANDR_12_INTERFACE .set_property = via_tv_set_property, +#endif +#ifdef RANDR_13_INTERFACE .get_property = via_tv_get_property, #endif .dpms = via_tv_dpms, @@ -639,6 +641,8 @@ static const xf86OutputFuncsRec via_dp_funcs = { .create_resources = via_dp_create_resources, #ifdef RANDR_12_INTERFACE .set_property = via_dp_set_property, +#endif +#ifdef RANDR_13_INTERFACE .get_property = via_dp_get_property, #endif .dpms = via_dp_dpms, @@ -888,6 +892,8 @@ static const xf86OutputFuncsRec via_analog_funcs = { .create_resources = via_analog_create_resources, #ifdef RANDR_12_INTERFACE .set_property = via_analog_set_property, +#endif +#ifdef RANDR_13_INTERFACE .get_property = via_analog_get_property, #endif .dpms = via_analog_dpms, @@ -1047,6 +1053,8 @@ static const xf86OutputFuncsRec via_dvi_funcs = { .create_resources = via_dvi_create_resources, #ifdef RANDR_12_INTERFACE .set_property = via_dvi_set_property, +#endif +#ifdef RANDR_13_INTERFACE .get_property = via_dvi_get_property, #endif .dpms = via_dvi_dpms, commit 9dbd0359a98f5010e3f8fcf6ad411404b434901b Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Mar 8 02:15:17 2016 -0800 Fixing P4M800 chipset detection code compilation error Likely due to an overlook, the code to detect P4M800 chipset did not compile correctly if the code was being compiled against an older version of x.org X Server. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_ums.c b/src/via_ums.c index 95a171e..ae0393e 100644 --- a/src/via_ums.c +++ b/src/via_ums.c @@ -707,20 +707,21 @@ UMSPreInit(ScrnInfoPtr pScrn) pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10; break; case VIA_KM400: - /* P4M800 */ - if (DEVICE_ID(bridge) == 0x0296) { #ifdef HAVE_PCIACCESS + /* P4M800 Host Bridge PCI Device ID */ + if (DEVICE_ID(bridge) == 0x0296) { pci_device_cfg_read_u8(vgaDevice, &videoRam, 0xA1); -#else - videoRam = pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70; -#endif } else { -#ifdef HAVE_PCIACCESS pci_device_cfg_read_u8(bridge, &videoRam, 0xE1); + } #else + /* P4M800 Host Bridge PCI Device ID */ + if (pciReadWord(pciTag(0, 0, 0), 0x02) == 0x0296) { + videoRam = pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70; + } else { videoRam = pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70; -#endif } +#endif pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10; break; case VIA_PM800: commit e73fa19fec23d6ec5be836f698d323f89ae48611 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Mar 8 01:17:05 2016 -0800 Fixing header file compilation errors with an older version gcc It was observed with an older version gcc where including xf86Crtc.h and xf86fbman.h inside via_ums.c causes compilation errors. It appears that via_driver.h includes necessary header files to correctly compile ums.c, therefore, xf86Crtc.h and xf86fbman.h will no longer be explicitly included inside via_ums.c. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_ums.c b/src/via_ums.c index dfb6511..95a171e 100644 --- a/src/via_ums.c +++ b/src/via_ums.c @@ -25,8 +25,6 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "xf86Crtc.h" -#include "xf86fbman.h" #include "globals.h" #include "via_driver.h" commit 7dd217502d91ffecfc857c4337893e826ffd00bd Author: Kevin Brace <kevinbr...@gmx.com> Date: Sun Mar 6 02:27:28 2016 -0800 Fixing the misdetection of NanoBook flat panel It was observed in a VIA Technologies NanoBook based laptop computer that the flat panel it contains is not connected to an I2C bus, hence the supported screen resolution cannot be determined via an I2C bus. Furthermore, the code was obtaining EDID information via I2C bus 2, but it was not scrutinizing the interface type. Hence, if a VGA monitor is connected to the computer, the code was determining the flat panel screen resolution based on the EDID information obtained from the VGA monitor via I2C bus 2. Due to all of these issues, the flat panel screen color was going completely white, making the flat panel completely useless. Thanks to this fix, the flat panel and a VGA monitor can now be detected correctly. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_lvds.c b/src/via_lvds.c index 073cef6..09c5763 100644 --- a/src/via_lvds.c +++ b/src/via_lvds.c @@ -485,28 +485,55 @@ ViaPanelGetSizeFromDDCv1(xf86OutputPtr output, int *width, int *height) VIAPtr pVia = VIAPTR(pScrn); xf86MonPtr pMon; - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetPanelSizeFromDDCv1\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Entered VIAGetPanelSizeFromDDCv1.\n")); - if (!(pVia->I2CDevices & VIA_I2C_BUS2)) + if (!pVia->pI2CBus2) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "I2C Bus 2 does not exist.\n"); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting VIAGetPanelSizeFromDDCv1.\n")); return FALSE; + } - if (!xf86I2CProbeAddress(pVia->pI2CBus2, 0xA0)) + if (!xf86I2CProbeAddress(pVia->pI2CBus2, 0xA0)) { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "I2C device on I2C Bus 2 does not support EDID.\n"); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting VIAGetPanelSizeFromDDCv1.\n")); return FALSE; + } - pMon = xf86DoEEDID(XF86_SCRN_ARG(pScrn), pVia->pI2CBus2, TRUE); - if (!pMon) + /* Probe I2C Bus 2 to see if a flat panel is connected. */ + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Probing for a flat panel on I2C Bus 2.\n"); + pMon = xf86OutputGetEDID(output, pVia->pI2CBus2); + if (pMon && DIGITAL(pMon->features.input_type)) { + xf86OutputSetEDID(output, pMon); + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Detected a flat panel on I2C Bus 2.\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Did not detect a flat panel on I2C Bus 2.\n"); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting VIAGetPanelSizeFromDDCv1.\n")); return FALSE; - xf86OutputSetEDID(output, pMon); + } if (!ViaPanelGetSizeFromEDID(pScrn, pMon, width, height)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Unable to read PanelSize from EDID information\n"); + "Unable to obtain panel size from EDID information.\n"); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting VIAGetPanelSizeFromDDCv1.\n")); return FALSE; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "VIAGetPanelSizeFromDDCv1: (%dx%d)\n", *width, *height)); + "VIAGetPanelSizeFromDDCv1: (%d X %d)\n", + *width, *height)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting VIAGetPanelSizeFromDDCv1.\n")); return TRUE; } commit 802544370dd827ed3488965e39804e3cb630888a Author: Kevin Brace <kevinbr...@gmx.com> Date: Sat Mar 5 19:48:33 2016 -0800 Checking the validity of I2C buses before initializing VGA output The validity of I2C buses is checked before VGA output is registered with X Server. Reported-by: Christopher Havel <laserhaw...@gmail.com> Tested-by: Justin Chevrier <jchevr...@gmail.com> Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_outputs.c b/src/via_outputs.c index 31013a4..d97d585 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -913,16 +913,22 @@ via_analog_init(ScrnInfoPtr pScrn) DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_analog_init.\n")); - if (pVia->pI2CBus1) { - output = xf86OutputCreate(pScrn, &via_analog_funcs, "VGA-1"); - - output->possible_crtcs = 0x3; - output->possible_clones = 0; - output->interlaceAllowed = TRUE; - output->doubleScanAllowed = FALSE; - pBIOSInfo->analog = output; + if (!pVia->pI2CBus1 || !pVia->pI2CBus2) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "I2C Bus 1 or I2C Bus 2 does not exist.\n"); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting via_analog_init.\n")); + return; } + output = xf86OutputCreate(pScrn, &via_analog_funcs, "VGA-1"); + + output->possible_crtcs = 0x3; + output->possible_clones = 0; + output->interlaceAllowed = TRUE; + output->doubleScanAllowed = FALSE; + pBIOSInfo->analog = output; + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_analog_init.\n")); } commit 7a98f6584fec8dd7d6f516d6718839b5c96342cc Author: Kevin Brace <kevinbr...@gmx.com> Date: Sat Mar 5 11:33:08 2016 -0800 Using I2C bus 2 to detect a VGA monitor Previously, it was assumed that I2C bus 1 is used to detect only a VGA monitor. It was also assumed that I2C bus 2 is used to detect a DVI monitor or TV encoder. However, for devices with a DVI-I connector, VGA signals come out of the connector as well. What this means is that I2C bus 2 also has to be used to detect a VGA monitor, in addition to I2C bus 1. Furthermore, EDID obtained from the monitor via I2C bus will be used to determine whether or not it is an analog type (i.e., VGA monitor). Reported-by: Christopher Havel <laserhaw...@gmail.com> Tested-by: Justin Chevrier <jchevr...@gmail.com> Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_outputs.c b/src/via_outputs.c index 8034911..31013a4 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -804,50 +804,78 @@ via_analog_detect(xf86OutputPtr output) VIAPtr pVia = VIAPTR(pScrn); xf86MonPtr mon; + /* Probe I2C Bus 1 to see if a VGA monitor is connected. */ + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Probing for a VGA monitor on I2C Bus 1.\n"); mon = xf86OutputGetEDID(output, pVia->pI2CBus1); - if (mon) { + if (mon && (!mon->features.input_type)) { xf86OutputSetEDID(output, mon); - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "I2C Bus 1 detected a VGA monitor.\n"); status = XF86OutputStatusConnected; + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Detected a VGA monitor on I2C Bus 1.\n"); } else { - vgaHWPtr hwp = VGAHWPTR(pScrn); - CARD8 SR01 = hwp->readSeq(hwp, 0x01); - CARD8 SR40 = hwp->readSeq(hwp, 0x40); - CARD8 CR36 = hwp->readCrtc(hwp, 0x36); - - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "Test for CRT with VSYNC\n")); - /* We have to power on the display to detect it */ - ViaSeqMask(hwp, 0x01, 0x00, 0x20); - ViaCrtcMask(hwp, 0x36, 0x00, 0xF0); - - /* Wait for vblank */ - usleep(16); - - /* Detect the load on pins */ - ViaSeqMask(hwp, 0x40, 0x80, 0x80); - - if ((VIA_CX700 == pVia->Chipset) || - (VIA_VX800 == pVia->Chipset) || - (VIA_VX855 == pVia->Chipset) || - (VIA_VX900 == pVia->Chipset)) - ViaSeqMask(hwp, 0x40, 0x00, 0x80); + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Did not detect a VGA monitor on I2C Bus 1.\n"); - if (ViaVgahwIn(hwp, 0x3C2) & 0x20) + /* Probe I2C Bus 2 to see if a VGA monitor is connected. */ + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Probing for a VGA monitor on I2C Bus 2.\n"); + mon = xf86OutputGetEDID(output, pVia->pI2CBus2); + if (mon && (!mon->features.input_type)) { + xf86OutputSetEDID(output, mon); status = XF86OutputStatusConnected; + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Detected a VGA monitor on I2C Bus 2.\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Did not detect a VGA monitor on I2C Bus 2.\n"); + + /* Perform manual detection of a VGA monitor since */ + /* it was not detected via I2C buses. */ + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Now perform manual detection of a VGA " + "monitor.\n"); + vgaHWPtr hwp = VGAHWPTR(pScrn); + CARD8 SR01 = hwp->readSeq(hwp, 0x01); + CARD8 SR40 = hwp->readSeq(hwp, 0x40); + CARD8 CR36 = hwp->readCrtc(hwp, 0x36); + + /* We have to power on the display to detect it */ + ViaSeqMask(hwp, 0x01, 0x00, 0x20); + ViaCrtcMask(hwp, 0x36, 0x00, 0xF0); + + /* Wait for vblank */ + usleep(16); + + /* Detect the load on pins */ + ViaSeqMask(hwp, 0x40, 0x80, 0x80); + + if ((VIA_CX700 == pVia->Chipset) || + (VIA_VX800 == pVia->Chipset) || + (VIA_VX855 == pVia->Chipset) || + (VIA_VX900 == pVia->Chipset)) + ViaSeqMask(hwp, 0x40, 0x00, 0x80); + + if (ViaVgahwIn(hwp, 0x3C2) & 0x20) { + status = XF86OutputStatusConnected; + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Detected a VGA monitor using manual " + "detection method.\n"); + } - if ((VIA_CX700 == pVia->Chipset) || - (VIA_VX800 == pVia->Chipset) || - (VIA_VX855 == pVia->Chipset) || - (VIA_VX900 == pVia->Chipset)) - ViaSeqMask(hwp, 0x40, 0x00, 0x80); + if ((VIA_CX700 == pVia->Chipset) || + (VIA_VX800 == pVia->Chipset) || + (VIA_VX855 == pVia->Chipset) || + (VIA_VX900 == pVia->Chipset)) + ViaSeqMask(hwp, 0x40, 0x00, 0x80); - /* Restore previous state */ - hwp->writeSeq(hwp, 0x40, SR40); - hwp->writeSeq(hwp, 0x01, SR01); - hwp->writeCrtc(hwp, 0x36, CR36); + /* Restore previous state */ + hwp->writeSeq(hwp, 0x40, SR40); + hwp->writeSeq(hwp, 0x01, SR01); + hwp->writeCrtc(hwp, 0x36, CR36); + } } + return status; } commit d45116a689463ada005495d7bdde5f6fc0a072a1 Author: Kevin Brace <kevinbr...@gmx.com> Date: Sun Feb 21 12:15:54 2016 -0800 Adding CN333 chipset to the chipset support list It is believed to be a feature limited version of CN400 chipset. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_driver.c b/src/via_driver.c index 3e5122a..330d5a2 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -130,7 +130,7 @@ static SymTabRec VIAChipsets[] = { {VIA_CLE266, "CLE266"}, {VIA_KM400, "KM400 / KM400A / KN400 / P4M800"}, {VIA_K8M800, "K8M800 / K8N800"},