From patchwork Mon Dec 24 09:27:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Qian Wang X-Patchwork-Id: 10742153 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 11E0C13AD for ; Mon, 24 Dec 2018 09:27:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0102426E96 for ; Mon, 24 Dec 2018 09:27:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E938428F33; Mon, 24 Dec 2018 09:27:23 +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 81C5426E96 for ; Mon, 24 Dec 2018 09:27:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 485516E55B; Mon, 24 Dec 2018 09:27:22 +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-db5eur01on0631.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::631]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7BD166E55B for ; Mon, 24 Dec 2018 09:27:20 +0000 (UTC) Received: from AM3PR08MB0611.eurprd08.prod.outlook.com (10.163.188.149) by AM3PR08MB0676.eurprd08.prod.outlook.com (10.163.189.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.19; Mon, 24 Dec 2018 09:27:16 +0000 Received: from AM3PR08MB0611.eurprd08.prod.outlook.com ([fe80::3c73:534c:9c6e:352d]) by AM3PR08MB0611.eurprd08.prod.outlook.com ([fe80::3c73:534c:9c6e:352d%2]) with mapi id 15.20.1446.026; Mon, 24 Dec 2018 09:27:16 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau Subject: [PATCH 11/11] drm/komeda: Expose bus_width to Komeda-CORE Thread-Topic: [PATCH 11/11] drm/komeda: Expose bus_width to Komeda-CORE Thread-Index: AQHUm2rcbSck7e4B0kmJSWl7/E0qug== Date: Mon, 24 Dec 2018 09:27:16 +0000 Message-ID: <20181224092435.2792-12-james.qian.wang@arm.com> References: <20181224092435.2792-1-james.qian.wang@arm.com> In-Reply-To: <20181224092435.2792-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: SYXPR01CA0099.ausprd01.prod.outlook.com (2603:10c6:0:2e::32) To AM3PR08MB0611.eurprd08.prod.outlook.com (2a01:111:e400:c408::21) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM3PR08MB0676; 6:VwAkrsG4LjOmOGVqUwnKJjp5XN4+NCewT8qm1SzO0xgFaGoVnzfXyV52rgS5dIBL/CRB9TR2OK2kJRSisopoQqo+TuD02V9hTmQBPyjrTIDRZwzhfh5HRHnEAzATauyuUXTTsBICNMvwEskHEu+JUYhU6/sbHh93cocwI1YJ7SL4amyuMz7lpWyPoyHwgilPqacQrGee22n6qxCvLsf9lUoWKbXIr+15pqo4oMO43dXNB8M7EcG4EmBaown8DUaoLOVuTcztGtY43hQ6E1qxJIp0pqR+C+W7daXJH3gXdhqLh7X/k9ebqMb2au5UNiBH76ozvz56DssbC7aKak9+Z4KX9RAWSIP04T0eC8ifpuPvI8Mko/tFpcdWMQ8lLc4kYKpOS4E635R9VkYXOPBELxnha/Wd9Oof1JOLvaL3V6ysK8uvOg7M23o76HZ48tUE7DN0M86mN7HLuMxad0I0fA==; 5:gvspH60ZRN4Y6IYwwrR9+pbh95YlOJ4NF+pdbYBh8+SSpO792PIKAqfsUb2IxCHqAIHSUjg1lbeS8zpJoAYjRWXRTdWrD1JvrxMO9hpiDoCLofN+/LmkD3jQxID+Brc61x25pU/IfrZSDx7qtIK9p06YVFEhq/RMH2epPImtkbE=; 7:6EtlbRGbsMUszj+bjAoQRXYAx2zaVq6JIaK5XhTFXHBn8PSN42KB6fXGGxlbVItWj/ulLZ55pRq7/0Jquu3F46ekVMCPQhGA09wPkDBf4a5Q4iEDGFkDQdcSM56SUi5DkqFo2SWd7sCQlFTP/W61XA== x-ms-office365-filtering-correlation-id: 5ee53ff9-68a5-4970-853f-08d66981fe75 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM3PR08MB0676; x-ms-traffictypediagnostic: AM3PR08MB0676: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(3002001)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM3PR08MB0676; BCL:0; PCL:0; RULEID:; SRVR:AM3PR08MB0676; x-forefront-prvs: 0896BFCE6C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(366004)(136003)(39850400004)(396003)(189003)(199004)(4326008)(1076003)(25786009)(97736004)(53936002)(6862004)(8936002)(6512007)(256004)(2906002)(68736007)(76176011)(71200400001)(81156014)(52116002)(81166006)(2616005)(486006)(86362001)(8676002)(476003)(575784001)(71190400001)(6486002)(6436002)(103116003)(3846002)(478600001)(26005)(102836004)(105586002)(55236004)(7736002)(6636002)(186003)(6116002)(386003)(305945005)(14454004)(6506007)(316002)(37006003)(66066001)(54906003)(36756003)(446003)(5660300001)(106356001)(11346002)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR08MB0676; H:AM3PR08MB0611.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: eqwR0aG+ep8DoBlCR+rczXbvpcAsJs8Oxt3Ble0jD4iJbok8YjvF7kNBSVO6emU4TzPszg39+04tKG8zTvMdPQia26YmeZOioXip9Eknk6BcibRWYj3nmrq0okZRFRrDh6yGcdo6y3kQc2GDKOJrSqyYoZJi9xRRG99Xejp7cdo9nirp2IkDvmXldqXKqtosnHsm6CHWMQ6NjiTFkGWMtyXh3/vxRSMlNA7PIzxbFLKM4eaw/SppaOlZNPj6RJaMTk9N6j5XU5UMe8CFHLwcbRRpS4eKcIclYhch29Yobekmhsyuu6SpfzvhP1oLkSu/ spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ee53ff9-68a5-4970-853f-08d66981fe75 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Dec 2018 09:27:16.4429 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0676 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\)" , "airlied@linux.ie" , "Jonathan Chai \(Arm Technology China\)" , Alexandru-Cosmin Gheorghe , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "yamada.masahiro@socionext.com" , "james qian wang \(Arm Technology China\)" , "malidp@foss.arm.com" , "Yiqi Kang \(Arm Technology China\)" , "maxime.ripard@bootlin.com" , "thomas Sun \(Arm Technology China\)" , "Jin Gao \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , "sean@poorly.run" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP CHIP set bus_width according to the HW configuration, and CORE will use it as buffer alignment. Signed-off-by: James (Qian) Wang --- 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 31680bc0ccba..b5d7edf0870b 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c @@ -512,6 +512,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 ae97db7e447e..9ca24990495f 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); }