From patchwork Thu Oct 20 07:39:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TW91ZHkgSG8gKOS9leWul+WOnyk=?= X-Patchwork-Id: 6013 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp118757wrs; Thu, 20 Oct 2022 00:43:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7fps2iYg9rbMuRKU2jNeTLZOnBjaJ3LPF1rfSZeIY4ct6j1uEGKV4v+mDsneRySobvi+DO X-Received: by 2002:a63:5b5c:0:b0:461:8ba9:457e with SMTP id l28-20020a635b5c000000b004618ba9457emr10849589pgm.218.1666251839712; Thu, 20 Oct 2022 00:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666251839; cv=none; d=google.com; s=arc-20160816; b=AD2LPzsytO+qLGpaRocMgyU3/hfW7NxNZeSES4Qr1FGIdWj3VOkiQ3MDzi+nUSfteS 1GQY9EAdsSK952TYTpd8Th5Pb/knoO5+otcAse1HEV0h7XS+rrVUHPkdmqlmQ7cAUq2E Hit9kEjiSiz0d2ULEran1w077EHMXGoNM9fLH98iggOvG1zsej/wHmEPRjfGLkPcNi71 qCjNmNx0WUuw1OsvoskEbZaKROO5sjDYEx+2SAo9FwwfWZdbp8YHRj0FOCu6Go5vHxSk vryFKN3gBC6Uw81X2x/+lH4A/zlGhYlVh6h2v0tYSR/t6Qpq7fG8oTvPEnQ4Jac2g7CF HcFQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a056a00244300b0055fb32175c4si24050205pfj.294.2022.10.20.00.43.47; Thu, 20 Oct 2022 00:43:59 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747191689343138723?= X-GMAIL-MSGID: =?utf-8?q?1747191689343138723?= 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__ */