From patchwork Thu Apr 11 08:37:13 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: 10895289 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 E88D2139A for ; Thu, 11 Apr 2019 08:37:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D568E28B5F for ; Thu, 11 Apr 2019 08:37:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9C1528C01; Thu, 11 Apr 2019 08:37:20 +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 64BBE28C7D for ; Thu, 11 Apr 2019 08:37:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7025D8981D; Thu, 11 Apr 2019 08:37:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20062.outbound.protection.outlook.com [40.107.2.62]) by gabe.freedesktop.org (Postfix) with ESMTPS id D971B8981D for ; Thu, 11 Apr 2019 08:37:15 +0000 (UTC) Received: from DB7PR08MB3530.eurprd08.prod.outlook.com (20.177.120.80) by DB7PR08MB4618.eurprd08.prod.outlook.com (20.178.85.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.19; Thu, 11 Apr 2019 08:37:13 +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.1792.009; Thu, 11 Apr 2019 08:37:13 +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: [PATCH v2] drm/komeda: fixing of DMA mapping sg segment warning Thread-Topic: [PATCH v2] drm/komeda: fixing of DMA mapping sg segment warning Thread-Index: AQHU8EHC/9vJCCcYc0eF1Oqu3HFhoA== Date: Thu, 11 Apr 2019 08:37:13 +0000 Message-ID: <1554971813-22049-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: HK0PR01CA0043.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::31) 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: b512d693-7b4a-4abb-41d9-08d6be58e4c5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB7PR08MB4618; x-ms-traffictypediagnostic: DB7PR08MB4618: x-ms-exchange-purlcount: 4 nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 00046D390F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(346002)(376002)(396003)(136003)(189003)(199004)(86362001)(50226002)(68736007)(5660300002)(71190400001)(26005)(25786009)(476003)(2616005)(256004)(4326008)(36756003)(6636002)(71200400001)(7736002)(2906002)(486006)(186003)(54906003)(97736004)(110136005)(305945005)(14444005)(2201001)(478600001)(99286004)(53936002)(316002)(14454004)(66066001)(72206003)(386003)(6436002)(966005)(6506007)(55236004)(52116002)(2501003)(102836004)(8936002)(6306002)(106356001)(81156014)(105586002)(6486002)(6512007)(8676002)(6116002)(3846002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR08MB4618; 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: WFhJa+6M8cJmdcLXrMbbKEgaCrSsotrlBB083wSg6p1uHGpDkfkuz46DHGivtauVEqnhx5Np0RNE00dOc2iO0kS7pCPQ3p1u0c+s5D8JNZDWfHk41lKo5xaQjFLln/ik/LYyRn8zgLHhatDz+2vKvDD4F/FVl4n038QjGPWbY7/r/Zbu5HOdCw7A99TjfGV91RHciLPnkltrqyjR9TEZIcEIpmRafgxmCIVUkicc6deCihbNV8W4ra1awR4tirov4WIDIu1zsv7dI8ivk6YzLJxVnjKNd9vTLo9MwZGvlFZSG92umX9PJwF70GZxskPY+qNwKdZp1VwKWjfD+ZEBlADN/FIZs6EC9M+nESic73laByYaiI4dkb0OpswFUbz+uPflZRcZHeoQuGw1yM+She+0HbXl5Hw6naPf9LLWfGs= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: b512d693-7b4a-4abb-41d9-08d6be58e4c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2019 08:37:13.3722 (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: DB7PR08MB4618 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=uEixj299WRidBZgsJUoh/YW7uGGHLQPcR4mRUy3cCNg=; b=NCSKFiNB/+Qpmm1MK+1N3PZ8yr2jKfR7nwDsIE9m2zo7bAtE9CbimPx0DQYVFes7ULCLrl9KiV8s9Hj8KVqIgUqhBwwsrQz+WnjnpiL/5cHZovT6JPaM8UhqT9/tMgw32ZirFzbWJAqwcTFUpk2BAn/nzb2+S7G0n9D1dQNRrco= 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) --- 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;