Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp508407rwi; Thu, 20 Oct 2022 01:24:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5iMqLyVekUfsF3VWEbyy/JCYulSeL3X618bx6YimdLUk8dnTKTCJO9hnjNu8mOjS6PEpPB X-Received: by 2002:a17:907:2d1e:b0:78e:2c3b:559f with SMTP id gs30-20020a1709072d1e00b0078e2c3b559fmr9942605ejc.435.1666254278316; Thu, 20 Oct 2022 01:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666254278; cv=none; d=google.com; s=arc-20160816; b=mLyOZGYnNca69nOexQql0z1ipqcUeaIWTgDHiqqKJzIWzQhNz6q8t7+g1/tSBmwCtR 0tDlgvf7+lxWN0u0o3kyY13Gkja0Y7uWyEliWT9LXnKBh308dmOimZz+y9ePqoMpWKlo 2qF/O3lJ+Ly4TOxRT44l6vu4J4rqiCq/u2h9AL2sW0XrmdPTbdclKlufgoRMi+bdM1xz TIFzgsU3upeLE56j89562/qpZGA1pK/VviaJlQy2LF5uUDiuuT/EW0o71NVs8+CivSYc 3658R2ex5ZOI2fkCTbrv2nXW8JgYrec8bimU+Yf1XlYJXlF0Gyz72c2SkxjBnD8h1IjP D/og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=u58lkal9O6ZniiGmn3zPbvHh98+Mlb3TQ62yFSXQPJk=; b=cdG0FDovHIZWdKlKj4WWRc2LD9rSvtCxA+kaHmXP1bqc5zhg5G6e0NeD9S8iORTvgZ ZeX8/lzV9Uld80Gcl54zlT+nZTpcAUQIbp71sOl4a1Sfuqbwzmxzktj3c0n03N/1G9X8 Dj2zGuB6rdKG9gWhy4I6vvpBlc/WLRuisjm1LrefjGF9c58GEWku4s5Ou5wpAymF40gW R9G2R1oFWfrFIe1dNyA61xAIgtW5t+/rq4/QC5HjblFCdhArW3ogc8fqBsxiYyZTB9+1 h4gv9pqj3zvpdYD7Yu9hBucENYk9wIZKLU8O3sLKU5IlvhdG6C87PUWxvyUVNz2TPGZQ fWtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=t0SYKoqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds18-20020a170907725200b00789d1d367dcsi16483311ejc.281.2022.10.20.01.24.10; Thu, 20 Oct 2022 01:24:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=t0SYKoqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230434AbiJTHjb (ORCPT + 99 others); Thu, 20 Oct 2022 03:39:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230322AbiJTHjQ (ORCPT ); Thu, 20 Oct 2022 03:39:16 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D54D17535D; Thu, 20 Oct 2022 00:39:14 -0700 (PDT) X-UUID: 7c8f9628d76c4091a3613f2025ec7cb0-20221020 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=u58lkal9O6ZniiGmn3zPbvHh98+Mlb3TQ62yFSXQPJk=; b=t0SYKoqB3fWyXkLP5THVtqh5CC5ZNUp4c53zF/gCcUT6K78wmwky4fW/zBP6RaOO8quHXzJLwuxnZjdfMwpNf3qIxcNirJnQxBA4M/dfydhLCh8hJgANtsxIfU1GDpQQEw/bUuOjzWPB7Xo+K9J/z+5MdAF9c5m9s/+aXOCD/HA=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.12,REQID:a82f36eb-d0b1-4226-95b2-3b3d74abbbc5,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:100 X-CID-INFO: VERSION:1.1.12,REQID:a82f36eb-d0b1-4226-95b2-3b3d74abbbc5,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:100 X-CID-META: VersionHash:62cd327,CLOUDID:c9f9e0ee-314c-4293-acb8-ca4299dd021f,B ulkID:221020153912PKWL4GJE,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 7c8f9628d76c4091a3613f2025ec7cb0-20221020 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1546502171; Thu, 20 Oct 2022 15:39:10 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Thu, 20 Oct 2022 15:39:09 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 20 Oct 2022 15:39:09 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil CC: Chun-Kuang Hu , , , , , Moudy Ho Subject: [PATCH v2 9/9] media: platform: mtk-mdp3: extend shared memory structure to 4-byte aligned Date: Thu, 20 Oct 2022 15:39:02 +0800 Message-ID: <20221020073902.21039-10-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221020073902.21039-1-moudy.ho@mediatek.com> References: <20221020073902.21039-1-moudy.ho@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The common header "mtk-img-ipi.h" defines the input frame parameters used to pass to SCP for components config calculations. However, there is a 4-byte read limit in further SCP hardware, so the data structure should be aligned. Signed-off-by: Moudy Ho --- .../platform/mediatek/mdp3/mtk-img-ipi.h | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h b/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h index fcd6f7dd39fc..5b99d3505f9b 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h @@ -47,14 +47,14 @@ struct img_sw_addr { struct img_plane_format { u32 size; - u16 stride; + u32 stride; } __packed; struct img_pix_format { - u16 width; - u16 height; + u32 width; + u32 height; u32 colorformat; /* enum mdp_color */ - u16 ycbcr_prof; /* enum mdp_ycbcr_profile */ + u32 ycbcr_prof; /* enum mdp_ycbcr_profile */ struct img_plane_format plane_fmt[IMG_MAX_PLANES]; } __packed; @@ -68,10 +68,10 @@ struct img_image_buffer { #define IMG_SUBPIXEL_SHIFT 20 struct img_crop { - s16 left; - s16 top; - u16 width; - u16 height; + s32 left; + s32 top; + u32 width; + u32 height; u32 left_subpix; u32 top_subpix; u32 width_subpix; @@ -86,24 +86,24 @@ struct img_crop { struct img_input { struct img_image_buffer buffer; - u16 flags; /* HDR, DRE, dither */ + u32 flags; /* HDR, DRE, dither */ } __packed; struct img_output { struct img_image_buffer buffer; struct img_crop crop; - s16 rotation; - u16 flags; /* H-flip, sharpness, dither */ + s32 rotation; + u32 flags; /* H-flip, sharpness, dither */ } __packed; struct img_ipi_frameparam { u32 index; u32 frame_no; struct img_timeval timestamp; - u8 type; /* enum mdp_stream_type */ - u8 state; - u8 num_inputs; - u8 num_outputs; + u32 type; /* enum mdp_stream_type */ + u32 state; + u32 num_inputs; + u32 num_outputs; u64 drv_data; struct img_input inputs[IMG_MAX_HW_INPUTS]; struct img_output outputs[IMG_MAX_HW_OUTPUTS]; @@ -119,25 +119,25 @@ struct img_sw_buffer { } __packed; struct img_ipi_param { - u8 usage; + u32 usage; struct img_sw_buffer frm_param; } __packed; struct img_frameparam { struct list_head list_entry; struct img_ipi_frameparam frameparam; -}; +} __packed; struct img_region { - s16 left; - s16 right; - s16 top; - s16 bottom; + s32 left; + s32 right; + s32 top; + s32 bottom; } __packed; struct img_offset { - s16 left; - s16 top; + s32 left; + s32 top; u32 left_subpix; u32 top_subpix; } __packed; @@ -148,11 +148,11 @@ struct img_mux { u32 reg; u32 value; u32 subsys_id; -}; +} __packed; struct img_mmsys_ctrl { struct img_mux sets[IMG_MAX_COMPONENTS * 2]; u32 num_sets; -}; +} __packed; #endif /* __MTK_IMG_IPI_H__ */ -- 2.18.0