From patchwork Tue Jan 22 11:12:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Qian Wang X-Patchwork-Id: 10775397 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 6B66017F0 for ; Tue, 22 Jan 2019 11:12:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B5002A1E2 for ; Tue, 22 Jan 2019 11:12:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C30B2A209; Tue, 22 Jan 2019 11:12:08 +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 F12E12A1E2 for ; Tue, 22 Jan 2019 11:12:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A99B6EC99; Tue, 22 Jan 2019 11:12:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on060d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::60d]) by gabe.freedesktop.org (Postfix) with ESMTPS id A2AFE6EC99 for ; Tue, 22 Jan 2019 11:12:05 +0000 (UTC) Received: from DB6PR0801MB1990.eurprd08.prod.outlook.com (10.168.81.21) by DB6PR0801MB2085.eurprd08.prod.outlook.com (10.168.86.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.26; Tue, 22 Jan 2019 11:12:02 +0000 Received: from DB6PR0801MB1990.eurprd08.prod.outlook.com ([fe80::b9be:3d28:78a2:6e33]) by DB6PR0801MB1990.eurprd08.prod.outlook.com ([fe80::b9be:3d28:78a2:6e33%2]) with mapi id 15.20.1537.031; Tue, 22 Jan 2019 11:12:02 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey Subject: [PATCH v2 11/11] drm/komeda: Expose bus_width to Komeda-CORE Thread-Topic: [PATCH v2 11/11] drm/komeda: Expose bus_width to Komeda-CORE Thread-Index: AQHUskNN9SGO4YEklkqblbMQ2M6ApQ== Date: Tue, 22 Jan 2019 11:12:02 +0000 Message-ID: <20190122110932.5138-12-james.qian.wang@arm.com> References: <20190122110932.5138-1-james.qian.wang@arm.com> In-Reply-To: <20190122110932.5138-1-james.qian.wang@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-clientproxiedby: SYAPR01CA0034.ausprd01.prod.outlook.com (2603:10c6:1:1::22) To DB6PR0801MB1990.eurprd08.prod.outlook.com (2603:10a6:4:6c::21) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0801MB2085; 6:nyGqCDmLRFqnR22fKXl8O03IMvJ8uscuD1khTfz8lmBP5KXsK2ojTNT1WABjF9Heq9uRFQpRFuhgOi/y1tuMJ45HhGs502f3IKp7yFXGc54vkDXsSJ0dCTg4QHu/d7E4BOpBiDzzfG1x0zOIpkH+YmTSyLmX00mEn8kvY7pLiTCB5qVfOmcpX9nxS42rJCYaK23yoQEdHeWIrs7IVFaO8XzNoZ5YAIuAIZbzPkwB2juAJWcERcnRlQTSI/DnBMEuQzz6aPn/EDZfbex9ZQD4BuaGidDRenfLnON/zZ14rnWMRPpTKkF0gDTpds5A5GGQbVDxctoASRjnGjrKKxJFdOym0aCZEd9DOw1jaRLf9FxN5RJ5qkBneCu50veu3QaC4Hmk6PV07aq7AqKtD9vVylfjUeX+YJBAejwvE83AbV1DSBqBMveYyb4XxBCjGe4wHO/ExupzepOy9jDefUibqA==; 5:triTfbrJMVV+AU/IujoRJqU1plsLu629d3MkOhlScX80cjsw5luhNGrOAqkFEi4On3TpOfywMOqW0Bipk2riBry59nQgmpsAAIcYm4VyXQx1GdfBusbE4OSAgWmX6KIeq2RIAHG2NtjQF5OZPHmC/Rp8XnVUPA6Ava0Nq1G5NicY2hgBRNlFTv+gR2enaTAofqm1s5V38eW2MAJR1t4WHA==; 7:79VvgADO/Qf9SAWMMrq+JMqo0ciS+TTdB4QTDyfQTo8pa/KOCMV3bd5OHq1v074qyVT0XaDBRGdPU5Sia/FVV77diVzIcR83gObhwGmWnwcidNe3tiYmQLp5Eo4BwYxGEDG3CH5tfQBLmHyDPZ+EhA== x-ms-office365-filtering-correlation-id: 98d6943d-0550-48b1-ca9f-08d6805a6f3a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0801MB2085; x-ms-traffictypediagnostic: DB6PR0801MB2085: nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0925081676 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(366004)(396003)(136003)(189003)(199004)(316002)(110136005)(11346002)(71200400001)(99286004)(6512007)(53936002)(36756003)(2501003)(4326008)(25786009)(26005)(478600001)(71190400001)(446003)(476003)(2616005)(486006)(54906003)(186003)(1076003)(68736007)(86362001)(2906002)(6486002)(52116002)(6436002)(103116003)(6506007)(6116002)(97736004)(386003)(14454004)(102836004)(55236004)(105586002)(305945005)(7736002)(76176011)(106356001)(81156014)(81166006)(6636002)(66066001)(50226002)(8676002)(256004)(3846002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0801MB2085; H:DB6PR0801MB1990.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: rbkcqTcm7QVUych8fAWFntSRQLwk8a/p7fzmvk0J3ncQXK7TdY+4P/WdF3Vgo5champ45gZXVTSOIGyO8NehXztaRYvkJhLbqE6tXIzsd7+8RmXxPAGBF4htBmnE0S9WbDwzPdKCWvDgZHveiQYfW1rAgLUAgJ2FlanK/fo7lcGpy+H5vPO++oU+Z0hBAXsyte8aPi7AiFgA/W52ItrmdVVjnnF6IldBvpE/GbFGKC4oYo30lSAG/I9DlkfO1QbqpgrVjJc1TLWK1bgobZSGXGUBWph/yTwkalrE5fI85m0dL1biWYDf6cTQHYJ4Tmap+/HUyovAa9hty0s5bzCY07shIAsyO8noYYh8/JioDxJun7sLWI+qO3SJ4IVx0mUs3V/eiShVCqOkHxHrIerXIqokG6Pvsjb+VejFPoBqELY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98d6943d-0550-48b1-ca9f-08d6805a6f3a X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2019 11:11:54.0101 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2085 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: nd , Ayan Halder , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "malidp@foss.arm.com" , "Yiqi Kang \(Arm Technology China\)" , "thomas Sun \(Arm Technology China\)" , "Jin Gao \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "james qian wang (Arm Technology China)" CHIP set bus_width according to the HW configuration, and CORE will use it as buffer alignment. v2: Rebase Signed-off-by: James Qian Wang (Arm Technology China) --- drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c | 1 + drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c index f517ab0ceae9..a6ca3ff16fef 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c @@ -518,6 +518,7 @@ d71_identify(u32 __iomem *reg_base, struct komeda_chip_info *chip) chip->arch_id = malidp_read32(reg_base, GLB_ARCH_ID); chip->core_id = malidp_read32(reg_base, GLB_CORE_ID); chip->core_info = malidp_read32(reg_base, GLB_CORE_INFO); + chip->bus_width = D71_BUS_WIDTH_16_BYTES; return &d71_chip_funcs; } diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c index 337e6fddead0..ed54beaee2f9 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -21,10 +21,10 @@ static int komeda_gem_cma_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args) { - u32 alignment = 16; /* TODO get alignment from dev */ + struct komeda_dev *mdev = dev->dev_private; + u32 pitch = DIV_ROUND_UP(args->width * args->bpp, 8); - args->pitch = ALIGN(DIV_ROUND_UP(args->width * args->bpp, 8), - alignment); + args->pitch = ALIGN(pitch, mdev->chip.bus_width); return drm_gem_cma_dumb_create_internal(file, dev, args); }