From e4d0f5ff82b2c16fac5c763575b251a2180fcdb8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 30 Jan 2022 09:50:33 -0800 Subject: [PATCH 1/5] 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 d003142..b011500 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR(.) # Initialize Automake -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-xz]) # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS m4_ifndef([XORG_MACROS_VERSION], -- GitLab From 962b8a15a481121ac731431b5be699588d05aa38 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 30 Jan 2022 09:54:31 -0800 Subject: [PATCH 2/5] Fix spelling/wording issues Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith --- README.md | 2 +- src/xg47_accel.c | 4 ++-- src/xg47_cmdlist.c | 6 +++--- src/xg47_i2c.c | 2 +- src/xg47_mode.c | 4 ++-- src/xg47_mode.h | 2 +- src/xg47_tv.c | 4 ++-- src/xg47_videohw.c | 2 +- src/xgi.h | 2 +- src/xgi_driver.c | 4 ++-- src/xgi_hwmc.c | 4 ++-- src/xgi_option.c | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index c48f6d3..39adc32 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-xgixp diff --git a/src/xg47_accel.c b/src/xg47_accel.c index 09268ac..81086da 100644 --- a/src/xg47_accel.c +++ b/src/xg47_accel.c @@ -142,7 +142,7 @@ static void XG47SubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, int skipleft); */ -/* CPU to Screen Color expansion - similiar to XAAImageWrite() */ +/* CPU to Screen Color expansion - similar to XAAImageWrite() */ /* static void XG47SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg, int bg, @@ -326,7 +326,7 @@ Bool XG47AccelInit(ScreenPtr pScreen) } XGIDebug(DBG_FUNCTION, "[DBG] Jong 06142006-After XG47InitCmdList\n"); - /* We always use patten bank0 since HW can not handle patten bank swapping corretly! */ + /* We always use pattern bank0 since HW can not handle pattern bank swapping correctly! */ accel_info.engineFlag = FER_EN_PATTERN_FLIP; /* ENINT; 32bpp */ accel_info.engineCmd = 0x8200; diff --git a/src/xg47_cmdlist.c b/src/xg47_cmdlist.c index 1f8374c..3d7b98d 100644 --- a/src/xg47_cmdlist.c +++ b/src/xg47_cmdlist.c @@ -47,7 +47,7 @@ struct xg47_batch { * batch. */ uint32_t * begin; /**< Pointer to first command of batch. */ - uint32_t * end; /**< Pointer for writing next coomand */ + uint32_t * end; /**< Pointer for writing next command */ }; @@ -72,7 +72,7 @@ struct xg47_CmdList /** * \name 2D Command bunch * - * Buffer indiviual 2D command register writes. + * Buffer individual 2D command register writes. */ /*@{*/ unsigned bunch_count; /**< Number of commands pending in \c bunch. */ @@ -203,7 +203,7 @@ xg47_wait_fence(int fd, uint32_t fence) int xg47_BeginCmdListType(struct xg47_CmdList *pCmdList, unsigned req_size, unsigned type) { - /* Pad the commmand list to 128-bit alignment and add the begin header. + /* Pad the command list to 128-bit alignment and add the begin header. */ const unsigned size = ((req_size + 0x3) & ~0x3) + AGPCMDLIST_BEGIN_SIZE; const uint32_t *const mid_point = diff --git a/src/xg47_i2c.c b/src/xg47_i2c.c index ae8e9cd..6082076 100644 --- a/src/xg47_i2c.c +++ b/src/xg47_i2c.c @@ -183,7 +183,7 @@ xg47_i2c_GetByte(I2CDevPtr d, I2CByte *data, Bool last) /** - * Signal devices that a transation has finished + * Signal devices that a transaction has finished */ static void xg47_i2c_Stop(I2CDevPtr d) diff --git a/src/xg47_mode.c b/src/xg47_mode.c index 8b6a85a..7dd3bc3 100644 --- a/src/xg47_mode.c +++ b/src/xg47_mode.c @@ -38,7 +38,7 @@ int g_DualViewMode=0; -void XG47LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, +void XG47LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual) { vgaHWPtr pVgaHW = VGAHWPTR(pScrn); @@ -47,7 +47,7 @@ void XG47LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, for(i = 0; i < numColors; i++) { - index = indicies[i]; + index = indices[i]; OUTB(0x3C6, 0xFF); DACDelay(pVgaHW); OUTB(0x3c8, index); diff --git a/src/xg47_mode.h b/src/xg47_mode.h index 4a8c790..5686e1e 100644 --- a/src/xg47_mode.h +++ b/src/xg47_mode.h @@ -28,7 +28,7 @@ #ifndef _XG47_MODE_H_ #define _XG47_MODE_H_ -extern void XG47LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, +extern void XG47LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual); extern void XG47SetOverscan(ScrnInfoPtr pScrn, int overscan); extern unsigned int XG47DDCRead(ScrnInfoPtr pScrn); diff --git a/src/xg47_tv.c b/src/xg47_tv.c index 3fafb62..fea383d 100644 --- a/src/xg47_tv.c +++ b/src/xg47_tv.c @@ -694,7 +694,7 @@ unsigned long XG47DetectTVConnection(XGIPtr pXGI) if (path & 2) { /* - * Because default of TV ouput is on, TV will will see the signal by set 3x5.d7. + * Because default of TV output is on, TV will will see the signal by set 3x5.d7. * So we need turn off TV output if TV is not current device. */ XG47SetExternalRegister(pXGI, 0xa0, tv_a0 | 8); @@ -743,7 +743,7 @@ unsigned long XG47DetectTVConnection(XGIPtr pXGI) * void InitTVScreen(CARD16 xRes, CARD16 yRes, CARD16 color, CARD16 attr) * Initial TV screen after set mode. * xRes: Resolution, Width - * yRes: Resolution, Hight + * yRes: Resolution, Height * color: color depth(8, 16 or 32bit) * Attr: Mode sub info */ diff --git a/src/xg47_videohw.c b/src/xg47_videohw.c index 1daffef..6efd25b 100644 --- a/src/xg47_videohw.c +++ b/src/xg47_videohw.c @@ -37,7 +37,7 @@ #include "xgi_misc.h" /* - * HW Regs Setting from blow function + * HW Regs Setting from below function */ void XG47WaitForSync(ScrnInfoPtr pScrn) { diff --git a/src/xgi.h b/src/xgi.h index e122f1c..10bc6b3 100644 --- a/src/xgi.h +++ b/src/xgi.h @@ -372,7 +372,7 @@ typedef struct { * : CARD16, CARD16 - Save the BIOS default value * : CARD8 - Total swing width * : CARD8 - Logical default value - * : CARD8 - Current offset (Registery save value) + * : CARD8 - Current offset (Registry save value) * : CARD8 - Delta * 0----------------+----------|----------N * Bios default defoffset Curoffset diff --git a/src/xgi_driver.c b/src/xgi_driver.c index b440e85..43a2d76 100644 --- a/src/xgi_driver.c +++ b/src/xgi_driver.c @@ -1375,7 +1375,7 @@ Bool XGIPreInit(ScrnInfoPtr pScrn, int flags) /* Check the number of entities registered for the screen against the expected * number (most drivers expect only one).The entity information for * each of them should be retrieved by calling xf86GetEntityInfo()). - * And check for the correct bus type and that none of the sharable + * And check for the correct bus type and that none of the shareable * resources registered during the Probe phase was rejected. */ @@ -1689,7 +1689,7 @@ Bool XGIFBManagerInit(ScreenPtr pScreen) availFBArea.y2 = (temp > 2047) ? 2047 : temp; - /* XAA uses FB manager for its pixmap cahe */ + /* XAA uses FB manager for its pixmap cache */ ret = xf86InitFBManager(pScreen, &availFBArea); #if DBG_FLOW diff --git a/src/xgi_hwmc.c b/src/xgi_hwmc.c index 942a31b..9cce243 100644 --- a/src/xgi_hwmc.c +++ b/src/xgi_hwmc.c @@ -123,7 +123,7 @@ static XF86ImagePtr XGISubpictureList[2] = /* Fill in the device dependent adaptor record. * This is named "XGI Video Overlay" because this code falls under the - * XV extenstion, the name must match or it won't be used. + * XV extension, the name must match or it won't be used. * * Surface and Subpicture - see above * Function pointers to functions below @@ -152,7 +152,7 @@ static XF86MCAdaptorPtr ppAdaptor[1] = * * XGIInitMC * - * Initialize the hardware motion compenstation extention for this + * Initialize the hardware motion compensation extension for this * hardware. The initialization routines want the address of the pointers * to the structures, not the address of the structures. This means we * allocate (or create static?) the pointer memory and pass that diff --git a/src/xgi_option.c b/src/xgi_option.c index 280692e..3ee39f6 100644 --- a/src/xgi_option.c +++ b/src/xgi_option.c @@ -155,7 +155,7 @@ Bool XGIProcessOptions(ScrnInfoPtr pScrn) pXGI->displayDevice = 0; - /* Jong 11/09/2006; pXGI->displayDevice is still 0 after this cheking */ + /* Jong 11/09/2006; pXGI->displayDevice is still 0 after this checking */ if ((s = xf86GetOptValString(pXGI->pOptionInfo, OPTION_DISPLAY))) { if(!xf86NameCmp(s, "CRT")) -- GitLab From 0b67e537bf2a14d584dcfd957b0d4def848e3a6f Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 30 Jan 2022 09:55:00 -0800 Subject: [PATCH 3/5] 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..78c2e62 --- /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-xgixp' + # 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-xgixp + 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 3eca91e150f9fbf4d24e7c96bd33c02fded2c149 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 30 Jan 2022 10:03:47 -0800 Subject: [PATCH 4/5] Stop including xf86RamDac.h xf86RamDac.h has been removed from xserver since version 21.0.99.1 and xorg/xserver@8f8d358b resulting in the following build failure: In file included from ../../src/xg47_accel.c:44: ../../src/xgi.h:53:10: fatal error: xf86RamDac.h: No such file or directory 53 | #include "xf86RamDac.h" /* RamDacRecPtr */ | ^~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith --- src/xgi.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/xgi.h b/src/xgi.h index 10bc6b3..dc7f3d5 100644 --- a/src/xgi.h +++ b/src/xgi.h @@ -50,7 +50,6 @@ #include "xf86DDC.h" /* DDC support */ #include "xf86xv.h" /* Xv support */ #include "shadowfb.h" /* RefreshAreaFuncPtr */ -#include "xf86RamDac.h" /* RamDacRecPtr */ #include "xf86int10.h" /* xf86Int10InfoPtr */ #include "vbe.h" /* vbeInfoPtr */ #include "shadow.h" /* shadowBufPtr */ @@ -550,8 +549,6 @@ typedef struct { CARD32 drawFlag; CARD16 linePattern; - RamDacRecPtr pRamDac; - /** * \name Cursor related data. */ -- GitLab From 06ef7f688aa7dc17827d9f7723211acc5d7d76d8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 30 Jan 2022 10:26:56 -0800 Subject: [PATCH 5/5] Replace or remove invalid characters in comments Fixes flawfinder-sast failures: Error: encoding error in ./src/xg47_videohw.c 'utf-8' codec can't decode byte 0x92 in position 1980: invalid start byte Error: encoding error in ./src/xg47_regs.h 'utf-8' codec can't decode byte 0xa8 in position 6460: invalid start byte Error: encoding error in ./src/xg47_regs.h 'utf-8' codec can't decode byte 0xe7 in position 4716: invalid continuation byte Signed-off-by: Alan Coopersmith --- src/xg47_regs.h | 8 ++++---- src/xg47_videohw.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xg47_regs.h b/src/xg47_regs.h index 34e288e..8f05442 100644 --- a/src/xg47_regs.h +++ b/src/xg47_regs.h @@ -795,9 +795,9 @@ typedef enum typedef enum { BSM_no_swap = 0x0, /* unchanged. default. */ - BSM_half_swap = 0x1, /* bit[7:0] ?¨¨bit[15:08] and bit[31:24] ?¨¨ bit[23:16]. */ - BSM_word_swap = 0x2, /* bit[7:0] ?¨¨bit[23:16] and bit[15:08] ?¨¨ bit[31:24]. */ - BSM_full_swap = 0x3 /* bit[7:0] ?¨¨bit[31:24] and bit[15:08] ?¨¨ bit[23:16]. */ + BSM_half_swap = 0x1, /* bit[7:0] ? bit[15:08] and bit[31:24] ? bit[23:16]. */ + BSM_word_swap = 0x2, /* bit[7:0] ? bit[23:16] and bit[15:08] ? bit[31:24]. */ + BSM_full_swap = 0x3 /* bit[7:0] ? bit[31:24] and bit[15:08] ? bit[23:16]. */ } BufferSwapMode; @@ -3189,7 +3189,7 @@ typedef enum PCC_Signed10_Normalize_IFF = 0xc, /* fixed point 10-10-10 format to IFF in [-1.0, 1.0] = fvalue/(29 - 1) in order of (X, Y, Z, 1.0) and set 1.0 to W. D[9:0] = X, D[29:20] = Z. */ PCC_Signed10_Normalize_IFF_Swap_XZ = 0xd, /* 10-10-10 format to IFF in [-1.0, 1.0] = fvalue/(29 - 1) in order of (Z, Y, X, 1.0) and set 1.0 to W. */ PCC_Unsigned10_IFF = 0xe, /* 10-10-10 format to IFF = fvalue in order of (X, Y, Z, 1.0) and set 1.0 to W. */ - PCC_Unsigned10_IFF_Swap_XZ = 0xf /* 10-10-10 format to IFF = fvalue in order of (Z, Y, X, 1.0) and set 1.0 to W. X çè Z. */ + PCC_Unsigned10_IFF_Swap_XZ = 0xf /* 10-10-10 format to IFF = fvalue in order of (Z, Y, X, 1.0) and set 1.0 to W. X <==> Z. */ } PutConversionCodes; diff --git a/src/xg47_videohw.c b/src/xg47_videohw.c index 6efd25b..06b75f0 100644 --- a/src/xg47_videohw.c +++ b/src/xg47_videohw.c @@ -537,7 +537,7 @@ void XG47HwOverDriveSetPara(ScrnInfoPtr pScrn) /* Overdrive LUT content value divided by 2. * 247B<11>: LOD_DIV2 - * i.e. {Content, 2’b0} => {1’b0,Content,1’b0} + * i.e. {Content, 2'b0} => {1'b0,Content,1'b0} */ OUTB(0x247C, INB(0x247C) & ~0x8); -- GitLab