[{"id":1714,"web_url":"https://patchwork.libcamera.org/comment/1714/","msgid":"<20190528144158.GD14336@pendragon.ideasonboard.com>","date":"2019-05-28T14:41:58","subject":"Re: [libcamera-devel] [PATCH v2 5/6] include: linux: intel-ipu3:\n\tForce alignement to 32 bytes","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Mon, May 27, 2019 at 11:05:58AM +0200, Jacopo Mondi wrote:\n> Fix compilation error on GCC 8.3.0\n> \n> include/linux/intel-ipu3.h:2475:35: error: ‘ipu3_uapi_acc_param::awb_fr’\n> offset 36756 in ‘ipu3_uapi_acc_param’ isn’t aligned to 32\n> [-Werror=packed-not-aligned]\n> \n> by forcing alignment to 32 bytes for struct ipu3_uapi_awb_fr_config_s.\n> The structure is itself defined as 32 bytes aligned, so adding another\n> alignment directive to the field definition should not change the\n> structure memory layout.\n\nIt won't change the layout of the fields inside the structure, but it\nwill change the position of the structure inside the outer structure. As\nSakari proposed the same fix for upstream I assume this is correct, and\nthe firmware expect this, so\n\nAcked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nIf we later find out that the ImgU doesn't work correctly, we should\nremember this patch and investigate.\n\n> The error is reported by gcc8.3.0 only and not by other gcc compiler\n> versions (5.4.0) or clang.\n> \n> As the header is exported from Linux v5.1 this is a workaround and\n> should probably be fixed in the kernel headers themselves if the error\n> is consistently reported in future compiler versions.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  include/linux/intel-ipu3.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/include/linux/intel-ipu3.h b/include/linux/intel-ipu3.h\n> index f758c9ba230b..fe6e8ed15eb1 100644\n> --- a/include/linux/intel-ipu3.h\n> +++ b/include/linux/intel-ipu3.h\n> @@ -2472,7 +2472,7 @@ struct ipu3_uapi_acc_param {\n>  \tstruct ipu3_uapi_yuvp1_yds_config yds2 __attribute__((aligned(32)));\n>  \tstruct ipu3_uapi_yuvp2_tcc_static_config tcc __attribute__((aligned(32)));\n>  \tstruct ipu3_uapi_anr_config anr;\n> -\tstruct ipu3_uapi_awb_fr_config_s awb_fr;\n> +\tstruct ipu3_uapi_awb_fr_config_s awb_fr __attribute__((aligned(32)));\n>  \tstruct ipu3_uapi_ae_config ae;\n>  \tstruct ipu3_uapi_af_config_s af;\n>  \tstruct ipu3_uapi_awb_config awb;","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 62B29600EA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 May 2019 16:42:19 +0200 (CEST)","from pendragon.ideasonboard.com (85-76-65-42-nat.elisa-mobile.fi\n\t[85.76.65.42])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1B9C4D85;\n\tTue, 28 May 2019 16:42:17 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1559054539;\n\tbh=SsIhbN4Y0ZabrMFICNQBu6YrfjzTYcQpeyjhQ1gU1ec=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=EPRMQLFQ7sgyt9hX79zvRaggUGYrXkvhNQOKS8FaFFLVQWmzDkfxtlYasDI01z9u6\n\tE2XEu5PaQGGKtae49favkPvOdGftjI+5zVs2vS+T29ZwALMZGjrZwRT8o1MugXzOIn\n\tbzr6fHLUoiLYGmASkjmuBvQqj9J7ZUiPID8jph2s=","Date":"Tue, 28 May 2019 17:41:58 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190528144158.GD14336@pendragon.ideasonboard.com>","References":"<20190527090559.26549-1-jacopo@jmondi.org>\n\t<20190527090559.26549-6-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190527090559.26549-6-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2 5/6] include: linux: intel-ipu3:\n\tForce alignement to 32 bytes","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 28 May 2019 14:42:19 -0000"}}]