From patchwork Thu Apr 4 10:08:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lowry Li (Arm Technology China)" X-Patchwork-Id: 10885349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1A9317EE for ; Thu, 4 Apr 2019 10:08:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D391E289F3 for ; Thu, 4 Apr 2019 10:08:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5FD528A25; Thu, 4 Apr 2019 10:08:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C5962289F3 for ; Thu, 4 Apr 2019 10:08:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3E086E582; Thu, 4 Apr 2019 10:08:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on061a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::61a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 14DEE6E582 for ; Thu, 4 Apr 2019 10:08:07 +0000 (UTC) Received: from DB7PR08MB3530.eurprd08.prod.outlook.com (20.177.120.80) by DB7PR08MB3450.eurprd08.prod.outlook.com (20.176.238.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Thu, 4 Apr 2019 10:08:04 +0000 Received: from DB7PR08MB3530.eurprd08.prod.outlook.com ([fe80::899e:4160:166b:923a]) by DB7PR08MB3530.eurprd08.prod.outlook.com ([fe80::899e:4160:166b:923a%3]) with mapi id 15.20.1771.011; Thu, 4 Apr 2019 10:08:04 +0000 From: "Lowry Li (Arm Technology China)" To: Liviu Dudau , "james qian wang (Arm Technology China)" , "maarten.lankhorst@linux.intel.com" , "seanpaul@chromium.org" , "airlied@linux.ie" , Brian Starkey Subject: [RFC PATCH v2] drm/komeda: fixing of DMA mapping sg segment warning Thread-Topic: [RFC PATCH v2] drm/komeda: fixing of DMA mapping sg segment warning Thread-Index: AQHU6s5KQMOVm+DvoUynXnNB4vwxrA== Date: Thu, 4 Apr 2019 10:08:04 +0000 Message-ID: <1554372474-3594-1-git-send-email-lowry.li@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-clientproxiedby: HK2PR0401CA0010.apcprd04.prod.outlook.com (2603:1096:202:2::20) To DB7PR08MB3530.eurprd08.prod.outlook.com (2603:10a6:10:49::16) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 1.9.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 01d32956-b61f-4bfc-de1e-08d6b8e56d19 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:DB7PR08MB3450; x-ms-traffictypediagnostic: DB7PR08MB3450: x-ms-exchange-purlcount: 4 nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0997523C40 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(346002)(39860400002)(396003)(376002)(189003)(199004)(4326008)(7736002)(71200400001)(66066001)(97736004)(53936002)(72206003)(25786009)(478600001)(5660300002)(966005)(68736007)(3846002)(6512007)(6506007)(105586002)(110136005)(6116002)(106356001)(26005)(316002)(8676002)(36756003)(50226002)(81156014)(186003)(14454004)(256004)(14444005)(2501003)(486006)(54906003)(2906002)(2201001)(6486002)(2616005)(52116002)(386003)(6436002)(476003)(6306002)(102836004)(8936002)(6636002)(55236004)(71190400001)(305945005)(99286004)(81166006)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR08MB3450; H:DB7PR08MB3530.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: h1VJVuuthXOeXNF+wZ9XtNDhy+fcoV2j+sRnM0VlnuPJQFn3vFvf95grWmwBe5TZcloCwUgxzJkyZlNO776vAJ5gN16bbV7iHNz5ASQrQRCyogIF4opmsBPBKJ0KZj63eVbyLO6tVPkJaN+6aRhyVo4RVavfipYTx4O4g7qu42X4OISi1wfb8lqHy8CM/XpyH+ZAHO895i6NWsdxf/Cv5AfMrfXu1B8adEreH5KUDby7W8R0xJXn8kx5ngnPrx01mnO0PZuKUVUJk+Nan78cTQXm6RLBbtvTVW00Ix/Y1dKcWoR6QKT1PNyt6MdLLxxOlSQDJt9G8LSjsN5TafgVeOVlG4GaKwGwjhfcCRQNtfuN5xC69ppPfhhr8XECn9yMFSvJXT9NWZbg/E1eQKbP4aV902zbsM3kStCX75j2AgQ= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01d32956-b61f-4bfc-de1e-08d6b8e56d19 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 10:08:04.1520 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3450 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wUPvzulVhCdlCdmvWuxofD/x4xXNPy318UhPbEunRgY=; b=YXIMb923SPpf2p+FtQcvjZMuX29lJF9VgTu+sIL6hhNFLWcWudjEABoIs1RIDDahzuMsPBHt6Y2A/D1iyKi5i7zJ/EIYNnH+8FjlvVvJPYS1RaTXOMQSHp2OpSVdDOiPZsaOnp3L+r4mOvrVSGEfSSyVlRM0pWBhrDMbDuB7zFs= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Lowry.Li@arm.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ayan Halder , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , nd Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fixing the DMA mapping sg segment warning, which shows "DMA-API: mapping sg segment longer than device claims to support [len=921600] [max=65536]". Fixed by setting the max segment size at Komeda driver. This patch depends on: - https://patchwork.freedesktop.org/series/54448/ - https://patchwork.freedesktop.org/series/54449/ - https://patchwork.freedesktop.org/series/54450/ - https://patchwork.freedesktop.org/series/58976/ Changes since v1: - Adds member description - Adds patch denpendency in the comment Signed-off-by: Lowry Li (Arm Technology China) Reviewed-by: James Qian Wang (Arm Technology China) Reviewed-by: Ayan Kumar Halder --- drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 4 ++++ drivers/gpu/drm/arm/display/komeda/komeda_dev.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c index 7f25e6a..b4902ae 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -8,6 +8,7 @@ #include #include #include +#include #ifdef CONFIG_DEBUG_FS #include #include @@ -245,6 +246,9 @@ struct komeda_dev *komeda_dev_create(struct device *dev) goto err_cleanup; } + dev->dma_parms = &mdev->dma_parms; + dma_set_max_seg_size(dev, DMA_BIT_MASK(32)); + err = sysfs_create_group(&dev->kobj, &komeda_sysfs_attr_group); if (err) { DRM_ERROR("create sysfs group failed.\n"); diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h index 29e03c4..83ace71 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h @@ -149,6 +149,8 @@ struct komeda_dev { struct device *dev; /** @reg_base: the base address of komeda io space */ u32 __iomem *reg_base; + /** @dma_parms: the dma parameters of komeda */ + struct device_dma_parameters dma_parms; /** @chip: the basic chip information */ struct komeda_chip_info chip;