From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=SFwoQHqb; spf=pass (domain: linaro.org, ip: 209.85.221.65, mailfrom: leif.lindholm@linaro.org) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by groups.io with SMTP; Wed, 14 Aug 2019 10:50:26 -0700 Received: by mail-wr1-f65.google.com with SMTP id g17so111924594wrr.5 for ; Wed, 14 Aug 2019 10:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=x9yZLxI0oaE9PBGgQVB5LlJvmMHGPk/oIcxi4FmRqEc=; b=SFwoQHqb082V6DBLdQ/ZlQWkr/EYy1BrQ+Y3PYYTfjV7pWrALtFhFKg4gLW4KnoawZ +SnlLdSxZ0zDk3I8I7VjA/2S/tQ9IKMLGD1GPejNiLXGmCIfT3Vyj0VEttcPV3SPPfIk m1sRUlW55/478bTuXFkF9QP5t30U7Fy0KSbnPAbdQrAX1PJhWpjBCIENJUpXtWnFy1XY 7yxeK/RVmDr/H8tPRVCyPeuRml7GU4zQtxQE++3yTAjQbtkPL3fxGeg9HwB59tpgZslg z/NmGz9qYVGUTlbhXjoFwZqooUittxUUH8UI05tGp0ZoLKuWF6O4++UXNMNFcUpNnGtb XIuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=x9yZLxI0oaE9PBGgQVB5LlJvmMHGPk/oIcxi4FmRqEc=; b=fba5bKX4ZX6q6b0veLYxKDZxcXxcDWXhNCNhPAF25c+bHVlwSLHY3x5Go52Oahkqvt y+DHBUIfE5746hN30Zx8GTI0pm8m+FfqKGRInvI9ctPlXok1UhyXTippbqPs1kwwbfgq 2QX0ksBSq5CwY+rE7KgPu61FniYpA5qxMrdJ1bQGPec5qROVU+uRcO7secixGXivOALB 9ZF6IaaZKIrsoQbpi2J53ozAJU5n3Iaj7rfQqG1DFCyvMKJc/3DMcYaNU1AZfzgo6DQS 413ypRNHEvD3KG7nY1Ef+Y1AZCXyQZAUlzadwQDVAD155HcRbNpcTA+d9vkwyqbJMwpj fypg== X-Gm-Message-State: APjAAAVGQecQClyDoTnkiaXRNsg+PySnva+bZujBjjqMxeyWYIG2cFdo KSo+Fj0cEcDVyVUnyAR7H4tYBg== X-Google-Smtp-Source: APXvYqzCFaLm5j3xVhVUIbb0lorMgqTUtpGW/h8KjSWTSDidZkqZZxsc2pjYnPSvEcu87P4wuPib/w== X-Received: by 2002:a5d:634c:: with SMTP id b12mr969563wrw.127.1565805024752; Wed, 14 Aug 2019 10:50:24 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id q19sm201157wmc.41.2019.08.14.10.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2019 10:50:23 -0700 (PDT) Date: Wed, 14 Aug 2019 18:50:22 +0100 From: "Leif Lindholm" To: Andy Hayes Cc: "devel@edk2.groups.io" , "michael.d.kinney@intel.com" Subject: Re: [PATCH v1 0/1] Added GOP driver for DisplayLink-based Universal USB Docks to edk2-platforms Message-ID: <20190814175022.GJ29255@bivouac.eciton.net> References: <20190814170351.GI29255@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: <20190814170351.GI29255@bivouac.eciton.net> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Andy, A follow-up - a few more things need changing: UsbDisplayLink.h (well, any .h file) should only contain the headers it itself requires. Moreover, the inclusion of wchar.h must disappear completely. Instead, use CHAR16 * in the two locations in UsbDisplayLink.c. Removing wchar.h will then trip you up in Edid.h, at #define EDID_HEADER_SIZE ((size_t)8) Please change the size_t to UINTN. Finally, you need to (and now can after the above changes) get rid of #undef _DEBUG #undef NULL #undef _ASSERT in UsbDisplayLink.h. With these additional changes, the driver builds successfully across GCC 8.3 and CLANG 7.0 for AARCH64/ARM/IA32/X64. Best Regards, Leif On Wed, Aug 14, 2019 at 06:03:51PM +0100, Leif Lindholm wrote: > Hi Andy, > > Many thanks for this submission. > > I am finding a few issues when building with gcc/clang (I expect you > use Visual Studio). > > The RELEASE target barfs with > .../edk2-platforms/Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/Gop.c:363:1: > error: unused function 'CalculateRefreshRate' > since the function is only called from a DEBUG statement. > Could be resolved by putting the function inside #ifndef MDEPKG_NDEBUG > > Clang triggers an error on the > USB_DISPLAYLINK_DEV_FROM_GRAPHICS_OUTPUT_PROTOCOL macro which seems to > go away if the USB_DISPLAYLINK_DEV_SIGNATURE macro is moved below the > USB_DISPLAYLINK_DEV definition. (I haven't bothered to figure out why > this helps.) > > The NOOPT build fails for IA32/X64 on clang with > .../edk2-platforms/Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/UsbDescriptors.c:35: > undefined reference to `memset' > You could get rid of this by doing the assignment separate from the > definition. (Indeed, I believe this is one of the reasons for the > rule.) > > On X64/clang, the build fails with > .../edk2-platforms/Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/UsbDisplayLink.c:410:3: > error: '__builtin_ms_va_start' used in System V ABI function > Adding EFIAPI to the definition/declaration of DlGopPrintTextToScreen > makes this one go away. > > Best Regards, > > Leif > > On Wed, Aug 14, 2019 at 02:43:43PM +0000, Andy Hayes wrote: > > From 4a42eb997aeb3699217b40bf3bc47dec56458847 Mon Sep 17 00:00:00 2001 > > From: "Andy Hayes" < andy.hayes@displaylink.com > > > Date: Wed, 14 Aug 2019 15:30:20 +0100 > > Subject: [PATCH v1 0/1] Added GOP graphics driver for DisplayLink-based Universal USB Docks to edk2-platforms > > > > andy.hayes@displaylink.com (1): > > Added GOP driver for USB Docks which use DisplayLink chips. > > > > .../DisplayLinkPkg/DisplayLinkPkg.dsc | 61 + > > .../DisplayLinkGop/DisplayLinkGopDxe.inf | 63 + > > .../DisplayLinkPkg/DisplayLinkGop/Edid.h | 129 ++ > > .../DisplayLinkGop/UsbDescriptors.h | 109 ++ > > .../DisplayLinkGop/UsbDisplayLink.h | 284 +++++ > > .../DisplayLinkGop/CapabilityDescriptor.c | 137 ++ > > .../DisplayLinkGop/ComponentName.c | 235 ++++ > > .../DisplayLinkPkg/DisplayLinkGop/Edid.c | 598 +++++++++ > > .../DisplayLinkPkg/DisplayLinkGop/Gop.c | 587 +++++++++ > > .../DisplayLinkGop/UsbDescriptors.c | 144 +++ > > .../DisplayLinkGop/UsbDisplayLink.c | 1109 +++++++++++++++++ > > .../DisplayLinkGop/UsbTransfer.c | 180 +++ > > .../DisplayLinkGop/VideoModes.c | 254 ++++ > > Drivers/DisplayLink/DisplayLinkPkg/ReadMe.md | 77 ++ > > Maintainers.txt | 5 + > > 15 files changed, 3972 insertions(+) > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkPkg.dsc > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/DisplayLinkGopDxe.inf > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/Edid.h > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/UsbDescriptors.h > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/UsbDisplayLink.h > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/CapabilityDescriptor.c > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/ComponentName.c > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/Edid.c > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/Gop.c > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/UsbDescriptors.c > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/UsbDisplayLink.c > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/UsbTransfer.c > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/VideoModes.c > > create mode 100644 Drivers/DisplayLink/DisplayLinkPkg/ReadMe.md > > > > -- > > 2.17.1 > >