From fb010f424314f49ba6710def546b550affede61c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 30 Jan 2022 09:12:05 -0800 Subject: [PATCH 1/4] Build xz tarballs instead of bzip2 Signed-off-by: Alan Coopersmith --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9c70850..577396c 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,7 @@ XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS # Initialize Automake -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-xz]) AM_MAINTAINER_MODE # Initialize libtool -- GitLab From 279b965c8be7ab0a01af039aa497222064dfa977 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 30 Jan 2022 09:23:37 -0800 Subject: [PATCH 2/4] Fix spelling/wording issues Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith --- README.md | 2 +- src/init.c | 4 ++-- src/osdef.h | 2 +- src/vb_def.h | 2 +- src/vb_i2c.c | 2 +- src/vb_setmode.c | 12 ++++++------ src/vgatypes.h | 4 ++-- src/xgi.h | 2 +- src/xgi_accel.c | 2 +- src/xgi_dri.c | 4 ++-- src/xgi_driver.c | 12 ++++++------ src/xgi_memcpy.c | 2 +- src/xgi_video.c | 6 +++--- src/xgi_videohw.c | 4 ++-- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 4a4820f..6934094 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Xorg mailing list: https://lists.x.org/mailman/listinfo/xorg -The master development code repository can be found at: +The primary development code repository can be found at: https://gitlab.freedesktop.org/xorg/driver/xf86-video-xgi diff --git a/src/init.c b/src/init.c index 1e36296..4fc2c84 100644 --- a/src/init.c +++ b/src/init.c @@ -384,7 +384,7 @@ XGI_SearchModeID(const XGI_StStruct *SModeIDTable, if ((*ModeNo) <= 0x05) (*ModeNo) |= 0x01; - for (*ModeIdIndex = 0; /* emtpy */; (*ModeIdIndex)++) { + for (*ModeIdIndex = 0; /* empty */; (*ModeIdIndex)++) { if (SModeIDTable[*ModeIdIndex].St_ModeID == (*ModeNo)) break; @@ -410,7 +410,7 @@ XGI_SearchModeID(const XGI_StStruct *SModeIDTable, } else { - for (*ModeIdIndex = 0; /* emtpy */; (*ModeIdIndex)++) { + for (*ModeIdIndex = 0; /* empty */; (*ModeIdIndex)++) { if (EModeIDTable[*ModeIdIndex].Ext_ModeID == (*ModeNo)) break; diff --git a/src/osdef.h b/src/osdef.h index 9a6ff91..39c5168 100644 --- a/src/osdef.h +++ b/src/osdef.h @@ -53,7 +53,7 @@ /* #define LINUX_KERNEL */ /* Kernel framebuffer */ #define LINUX_XF86 /* XFree86 */ -#define XGI_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length) +#define XGI_MemoryCopy(Destination,Source,Length) memcpy(Destination,Source,Length) #ifdef LINUX_XF86 #define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize) diff --git a/src/vb_def.h b/src/vb_def.h index 5f43dd5..936c23d 100644 --- a/src/vb_def.h +++ b/src/vb_def.h @@ -748,7 +748,7 @@ #define OSDSupportInSBIOS 0x40 #define DisableLogo 0x80 -/* ---------------------- HK Evnet Definition */ +/* ---------------------- HK Event Definition */ #define HKEvent 0x0f /* CR3D */ #define HK_ModeSwitch 0x01 #define HK_Expanding 0x02 diff --git a/src/vb_i2c.c b/src/vb_i2c.c index 69cdb8a..e5f8adf 100644 --- a/src/vb_i2c.c +++ b/src/vb_i2c.c @@ -1850,7 +1850,7 @@ BOOLEAN bGetEDID( return FALSE; } - // Force Monitor using DDC2 protocal... + // Force Monitor using DDC2 protocol... I2C.ClockRate = I2C_MAX_CLOCK_RATE; I2C.Command = I2C_COMMAND_WRITE; I2C.Flags = I2C_FLAGS_STOP; diff --git a/src/vb_setmode.c b/src/vb_setmode.c index bfcae8b..7e31938 100644 --- a/src/vb_setmode.c +++ b/src/vb_setmode.c @@ -1523,7 +1523,7 @@ XGI_GetRatePtrCRT2(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, USHORT ModeNo = pVBInfo->RefIndex[RefreshRateTableIndex].ModeID; /* Jong 10/03/2007; merge code */ - /* Do the similiar adjustment like XGISearchCRT1Rate() */ + /* Do the similar adjustment like XGISearchCRT1Rate() */ if ( HwDeviceExtension->jChipType >= XG20 ) /* for XG20, XG21, XG27 */ { /* @@ -2706,7 +2706,7 @@ XGI_SetCRT1FIFO(USHORT ModeNo, PXGI_HW_DEVICE_INFO HwDeviceExtension, data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x3D); data &= 0xfe; - XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x3D, data); /* diable auto-threshold */ + XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x3D, data); /* disable auto-threshold */ if (ModeNo > 0x13) { XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x08, 0x34); @@ -3795,7 +3795,7 @@ XGI_GetVBInfo(USHORT ModeNo, USHORT ModeIdIndex, temp = 0x017C; } } - else /* 3nd party chip */ + else /* 3rd party chip */ { if ( pVBInfo->IF_DEF_CH7017 == 1 ) temp = ( SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA ) ; @@ -5598,7 +5598,7 @@ XGI_SetLockRegs(USHORT ModeNo, USHORT ModeIdIndex, tempbx = pVBInfo->VGAVT; push1 = tempbx; tempcx = 0x121; - tempbx = pVBInfo->VGAVDE; /* 0x0E Virtical Display End */ + tempbx = pVBInfo->VGAVDE; /* 0x0E Vertical Display End */ if (tempbx == 357) tempbx = 350; @@ -8813,7 +8813,7 @@ XGI_EnableBridge(PXGI_HW_DEVICE_INFO HwDeviceExtension, if (pVBInfo->VBType & (VB_XGI301LV | VB_XGI302LV | VB_XGI301C)) { tempah = 0x01; - tempbl = 0xFE; /* turn on backlght */ + tempbl = 0xFE; /* turn on backlight */ } else { tempbl = 0xF7; @@ -8878,7 +8878,7 @@ XGI_DisableBridge(PXGI_HW_DEVICE_INFO HwDeviceExtension, tempah = 0xBF; /* Disable Channel B */ if (pVBInfo->SetFlag & DisableChB) - tempah &= 0xBF; /* force to disable Cahnnel */ + tempah &= 0xBF; /* force to disable Channel */ if (pVBInfo->SetFlag & DisableChA) tempah &= 0x7F; /* Force to disable Channel B */ diff --git a/src/vgatypes.h b/src/vgatypes.h index e7c07a2..ef3b4ea 100644 --- a/src/vgatypes.h +++ b/src/vgatypes.h @@ -259,7 +259,7 @@ struct _XGI_HW_DEVICE_INFO BOOLEAN bSkipSense; BOOLEAN bIsPowerSaving; /* True: XGIInit() is invoked by power management, - otherwise by 2nd adapter's initialzation */ + otherwise by 2nd adapter's initialization */ PXGI_DSReg pSR; /* restore SR registers in initial function. */ /* end data :(idx, val) = (FF, FF). */ @@ -307,7 +307,7 @@ struct _XGI_HW_DEVICE_INFO }; #endif -/* Addtional IOCTL for communication xgifb <> X driver */ +/* Additional IOCTL for communication xgifb <> X driver */ /* If changing this, xgifb.h must also be changed (for xgifb) */ #ifdef LINUX_XF86 /* We don't want the X driver to depend on the kernel source */ diff --git a/src/xgi.h b/src/xgi.h index 8bec688..7d4177b 100644 --- a/src/xgi.h +++ b/src/xgi.h @@ -694,7 +694,7 @@ typedef struct { void (*XGIRestore2)(ScrnInfoPtr pScrn, XGIRegPtr xgireg); void (*XGIRestore3)(ScrnInfoPtr pScrn, XGIRegPtr xgireg); void (*LoadCRT2Palette)(ScrnInfoPtr pScrn, int numColors, - int *indicies, LOCO *colors, VisualPtr pVisual); + int *indices, LOCO *colors, VisualPtr pVisual); int cmdQueueLen; /* Current cmdQueueLength (for 2D and 3D) */ unsigned long cmdQueueLenMax; diff --git a/src/xgi_accel.c b/src/xgi_accel.c index 0e7760b..1c06a20 100644 --- a/src/xgi_accel.c +++ b/src/xgi_accel.c @@ -717,7 +717,7 @@ Volari_AccelInit(ScreenPtr pScreen) if(!(pXGI->EXADriverPtr = xnfcalloc(sizeof(ExaDriverRec), 1))) #endif { - ErrorF("Failt to allocate EXADriverPtr!\n"); + ErrorF("Failed to allocate EXADriverPtr!\n"); return FALSE; } diff --git a/src/xgi_dri.c b/src/xgi_dri.c index 31ffb39..dc50ecd 100644 --- a/src/xgi_dri.c +++ b/src/xgi_dri.c @@ -264,7 +264,7 @@ Bool XGIDRIScreenInit(ScreenPtr pScreen) pXGI->agpVtxBufSize = 0; pXGIDRI->AGPVtxBufSize = 0; - /* jill note: IF not AGP, diable AGP memory allocate */ + /* jill note: IF not AGP, disable AGP memory allocate */ if (AGP_BUS_TYPE != IsXGIAGPCard(pScreen)) break; @@ -312,7 +312,7 @@ Bool XGIDRIScreenInit(ScreenPtr pScreen) /* pXGI->agpSize = AGP_SIZE; */ pXGI->agpAddr = drmAgpBase(pXGI->drmSubFD); - /* pXGI->agpBase = */ /* Xserver connot access VtxBuf, bc. not mem-map */ + /* pXGI->agpBase = */ /* Xserver cannot access VtxBuf, bc. not mem-map */ /* any client can access this VtxBuf AGP area */ /* by mem-map pXGIDRI->agp.handle */ diff --git a/src/xgi_driver.c b/src/xgi_driver.c index 79fe4fe..62ba138 100644 --- a/src/xgi_driver.c +++ b/src/xgi_driver.c @@ -891,7 +891,7 @@ XGIProbe(DriverPtr drv, int flags) /* Copy and link two modes form mergedfb mode * (Code base taken from mga driver) - * Copys mode i, links the result to dest, and returns it. + * Copies mode i, links the result to dest, and returns it. * Links i and j in Private record. * If dest is NULL, return value is copy of i linked to itself. * For mergedfb auto-config, we only check the dimension @@ -1634,7 +1634,7 @@ XGIDumpMonitorInfo(xf86MonPtr pMonitor) pMonitor->vendor.week, pMonitor->vendor.year); ErrorF("ver = %d %d\n", pMonitor->ver.version, pMonitor->ver.revision); - ErrorF("intput type = %d voltage = %d setup = %d sync = %d\n", + ErrorF("input type = %d voltage = %d setup = %d sync = %d\n", pMonitor->features.input_type, pMonitor->features.input_voltage, pMonitor->features.input_setup, pMonitor->features.input_sync); @@ -2467,7 +2467,7 @@ int ModifyTypeOfSupportMode(DisplayModePtr availModes) while(p) { /* if( (p->HDisplay == 1440) && (p->VDisplay == 900)) */ - if( p->type == 0) /* externel support modeline */ + if( p->type == 0) /* external support modeline */ { p->type = M_T_USERDEF; CountOfModifiedModes++; @@ -3576,8 +3576,8 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) /* Jong 07/29/2009; Proposal : use wide range for HorizSync and strict range for VertRefresh; And set 1024x768 in Modes of Screen section */ /* Jong 07/17/2009; fix issue of only one mode (800x600) */ - /* if (no Horizsync or VertRefresh is spefified in Monitor section) and (no DDC detection) */ - /* then apply followings as default Hsync and VRefresh (1024x768x60HZ) */ + /* if (no Horizsync or VertRefresh is specified in Monitor section) and (no DDC detection) */ + /* then apply following as default Hsync and VRefresh (1024x768x60HZ) */ /* XGIDDCPreInit() should be called first to get EDID but need I2C programming instead of VBIOS call */ if(pScrn->monitor->DDC == NULL) { @@ -4094,7 +4094,7 @@ XGIMapMem(ScrnInfoPtr pScrn) err = pci_device_map_region(pXGI->PciInfo, i, TRUE); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Internal error: cound not map PCI region %u\n", i); + "Internal error: could not map PCI region %u\n", i); return FALSE; } } diff --git a/src/xgi_memcpy.c b/src/xgi_memcpy.c index 50034f3..483b4d8 100644 --- a/src/xgi_memcpy.c +++ b/src/xgi_memcpy.c @@ -676,7 +676,7 @@ static unsigned int taketime(void) /* get current time (for benchmarking) */ /* 2. Do we have /proc filesystem or similar for CPU information? */ /* #define XGI_haveproc */ -/* 3. Optional: build-in memcpy() */ +/* 3. Optional: built-in memcpy() */ /* #define XGI_haveBuiltInMC */ /* static __inline void * builtin_memcpy(void * to, const void * from, int n) { diff --git a/src/xgi_video.c b/src/xgi_video.c index 6f90d3d..ae5805a 100644 --- a/src/xgi_video.c +++ b/src/xgi_video.c @@ -1743,7 +1743,7 @@ XGIPutVideo( //v4l get format if (0 == ioctl(pPriv->fd, VIDIOC_G_FMT, &fmt)) { - ErrorF("ioctl:VIDIOC_G_FMT succes!\n"); + ErrorF("ioctl:VIDIOC_G_FMT success!\n"); } else { @@ -1765,7 +1765,7 @@ XGIPutVideo( //v4l set format if (0 == ioctl(pPriv->fd, VIDIOC_S_FMT, &fmt)) { - ErrorF("ioctl:VIDIOC_S_FMT succes!\n"); + ErrorF("ioctl:VIDIOC_S_FMT success!\n"); } else { @@ -1780,7 +1780,7 @@ XGIPutVideo( if (0 == ioctl(pPriv->fd, XGIIOC_G_FBUF, &xgifbuf)) { static int offset; - ErrorF("ioctl:XGIIOC_G_FBUF succes!\n"); + ErrorF("ioctl:XGIIOC_G_FBUF success!\n"); pPriv->bufAddr[0] = offset = xgifbuf.fboffset[0]; ErrorF("capture buf offset 0 = %x\n",offset); pPriv->bufAddr[1] = offset = xgifbuf.fboffset[1]; diff --git a/src/xgi_videohw.c b/src/xgi_videohw.c index db1e630..0f1913d 100644 --- a/src/xgi_videohw.c +++ b/src/xgi_videohw.c @@ -267,7 +267,7 @@ VOID SetDDAReg (XGIPtr pXGI, float scale) /* Normalize the weights */ WW = W[0]+W[1]+W[2]+W[3]; - /* for rouding */ + /* for rounding */ for(j=0; j<4; j++) tempW[j] = (float)((W[j]/WW*16)+0.5); @@ -471,7 +471,7 @@ XGIResetVideo(ScrnInfoPtr pScrn) /* Enable Horizontal 4-tap DDA mode */ SetVideoRegMask(pXGI, Index_VI_Key_Overlay_OP, 0x40, 0x40); - /* Disable Vertical 4-tap DDA mode -- not surport not */ + /* Disable Vertical 4-tap DDA mode -- not support not */ SetVideoRegMask(pXGI, Index_VI_Key_Overlay_OP, 0x00, 0x80); /* The DDA registers should set scale to 1 as default */ SetDDAReg (pXGI, 1.0); -- GitLab From 542aaf8ac4b7b9872861e3f218d012cdf360ff59 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 30 Jan 2022 09:25:24 -0800 Subject: [PATCH 3/4] gitlab CI: add a basic build test Signed-off-by: Alan Coopersmith --- .gitlab-ci.yml | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b2022f3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,98 @@ +# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml: +# +# This CI uses the freedesktop.org ci-templates. +# Please see the ci-templates documentation for details: +# https://freedesktop.pages.freedesktop.org/ci-templates/ + +.templates_sha: &template_sha 34f4ade99434043f88e164933f570301fd18b125 # see https://docs.gitlab.com/ee/ci/yaml/#includefile + + +include: + # Arch container builder template + - project: 'freedesktop/ci-templates' + ref: *template_sha + file: '/templates/arch.yml' + - project: 'freedesktop/ci-templates' + ref: *template_sha + file: '/templates/ci-fairy.yml' + - template: Security/SAST.gitlab-ci.yml + + +stages: + - prep # prep work like rebuilding the container images if there is a change + - build # for actually building and testing things in a container + - test + - deploy + + +variables: + FDO_UPSTREAM_REPO: 'xorg/driver/xf86-video-xgi' + # The tag should be updated each time the list of packages is updated. + # Changing a tag forces the associated image to be rebuilt. + # Note: the tag has no meaning, we use a date format purely for readability + FDO_DISTRIBUTION_TAG: '2022-01-30.0' + FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake make xorg-util-macros xorgproto xorg-server-devel pixman libpciaccess libdrm' + + +# +# Verify that commit messages are as expected, signed-off, etc. +# +check-commits: + extends: + - .fdo.ci-fairy + stage: prep + script: + - ci-fairy check-commits --signed-off-by --junit-xml=results.xml + except: + - master@xorg/driver/xf86-video-xgi + variables: + GIT_DEPTH: 100 + artifacts: + reports: + junit: results.xml + +# +# Verify that the merge request has the allow-collaboration checkbox ticked +# +check-merge-request: + extends: + - .fdo.ci-fairy + stage: deploy + script: + - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml + artifacts: + when: on_failure + reports: + junit: results.xml + allow_failure: true + + +# +# Build a container with the given tag and the packages pre-installed. +# This only happens if the tag changes, otherwise the existing image is +# re-used. +# +container-prep: + extends: + - .fdo.container-build@arch + stage: prep + variables: + GIT_STRATEGY: none + + +# +# The default build, runs on the image built above. +# +build: + stage: build + extends: + - .fdo.distribution-image@arch + script: + - autoreconf -ivf + - mkdir _builddir + - pushd _builddir > /dev/null + - ../configure --disable-silent-rules + - make + - make check + - make distcheck + - popd > /dev/null -- GitLab From 3143bdee580c4d397e21adb0fa35502d4dc8e888 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 30 Jan 2022 09:41:19 -0800 Subject: [PATCH 4/4] Fix building with `-fno-common` This is the default in gcc 10 & later, and causes build failures with: /usr/sbin/ld: .libs/xgi_driver.o:/builds/alanc/xf86-video-xgi/_builddir/src/../../src/xgi_accel.h:125: multiple definition of `Alignment'; .libs/xgi_accel.o:/builds/alanc/xf86-video-xgi/_builddir/src/../../src/xgi_accel.h:125: first defined here /usr/sbin/ld: .libs/xgi_driver.o:/builds/alanc/xf86-video-xgi/_builddir/src/../../src/xgi_accel.h:124: multiple definition of `G2CmdQueLen'; .libs/xgi_accel.o:/builds/alanc/xf86-video-xgi/_builddir/src/../../src/xgi_accel.h:124: first defined here /usr/sbin/ld: .libs/xgi_driver.o:/builds/alanc/xf86-video-xgi/_builddir/src/../../src/xgi_accel.h:122: multiple definition of `w_port'; .libs/xgi_accel.o:/builds/alanc/xf86-video-xgi/_builddir/src/../../src/xgi_accel.h:122: first defined here /usr/sbin/ld: .libs/xgi_driver.o:/builds/alanc/xf86-video-xgi/_builddir/src/../../src/xgi_accel.h:122: multiple definition of `r_port'; .libs/xgi_accel.o:/builds/alanc/xf86-video-xgi/_builddir/src/../../src/xgi_accel.h:122: first defined here Signed-off-by: Alan Coopersmith --- src/xgi_accel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xgi_accel.h b/src/xgi_accel.h index c475514..5eb5801 100644 --- a/src/xgi_accel.h +++ b/src/xgi_accel.h @@ -119,10 +119,10 @@ /* Jong 09/27/2007; recover for compiler error */ /* typedef unsigned long ulong ; */ -unsigned long r_port, w_port ; +extern unsigned long r_port, w_port ; -int G2CmdQueLen; -int Alignment ; +extern int G2CmdQueLen; +extern int Alignment ; /* int GBCount = 0 ; */ extern void Volari_SetDefaultIdleWait(XGIPtr pXGI, unsigned HDisplay, -- GitLab