From patchwork Tue Jun 11 11:13:45 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: 10986579 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 238346C5 for ; Tue, 11 Jun 2019 11:13:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 144C92863B for ; Tue, 11 Jun 2019 11:13:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07B43287FF; Tue, 11 Jun 2019 11:13:51 +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 A572A287FD for ; Tue, 11 Jun 2019 11:13:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC7C689182; Tue, 11 Jun 2019 11:13:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80053.outbound.protection.outlook.com [40.107.8.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id CAD188918A for ; Tue, 11 Jun 2019 11:13:48 +0000 (UTC) Received: from VI1PR08MB5488.eurprd08.prod.outlook.com (52.133.246.150) by VI1PR08MB3550.eurprd08.prod.outlook.com (20.177.61.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.15; Tue, 11 Jun 2019 11:13:46 +0000 Received: from VI1PR08MB5488.eurprd08.prod.outlook.com ([fe80::e9f4:59c8:9be1:910b]) by VI1PR08MB5488.eurprd08.prod.outlook.com ([fe80::e9f4:59c8:9be1:910b%4]) with mapi id 15.20.1965.017; Tue, 11 Jun 2019 11:13:46 +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 2/2] drm/komeda: Adds komeda_kms_drop_master Thread-Topic: [PATCH v2 2/2] drm/komeda: Adds komeda_kms_drop_master Thread-Index: AQHVIEa84bzVRtMQMUOKgXDAOpomxQ== Date: Tue, 11 Jun 2019 11:13:45 +0000 Message-ID: <1560251589-31827-3-git-send-email-lowry.li@arm.com> References: <1560251589-31827-1-git-send-email-lowry.li@arm.com> In-Reply-To: <1560251589-31827-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: SL2PR04CA0005.apcprd04.prod.outlook.com (2603:1096:100:2d::17) To VI1PR08MB5488.eurprd08.prod.outlook.com (2603:10a6:803:137::22) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 1.9.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 39252528-cb13-4c0b-f767-08d6ee5dde7a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VI1PR08MB3550; x-ms-traffictypediagnostic: VI1PR08MB3550: nodisclaimer: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:67; x-forefront-prvs: 006546F32A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39850400004)(396003)(366004)(346002)(136003)(189003)(199004)(14444005)(305945005)(256004)(11346002)(72206003)(6512007)(476003)(14454004)(99286004)(2616005)(478600001)(52116002)(486006)(6636002)(7736002)(6506007)(26005)(68736007)(66066001)(76176011)(186003)(446003)(2501003)(386003)(36756003)(25786009)(66446008)(3846002)(81156014)(8676002)(316002)(6116002)(66946007)(66556008)(64756008)(66476007)(73956011)(50226002)(8936002)(6486002)(6436002)(71190400001)(86362001)(2906002)(55236004)(110136005)(54906003)(53936002)(71200400001)(4326008)(81166006)(5660300002)(2201001)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3550; H:VI1PR08MB5488.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: 0FiyPYnl8xdfGX5kQMagvLlN8rkZbdkDj4z2QmiXiDz6cNSOtEfSZXyOWn8Myxe8H7CfOACfNn83NHWFhMuebBppr6FlB0ON0/Z2sgY+fkzHXrPnG68KMelLofReJmPlI51eVLZu2GeR2gl+z0wHS1v7H/Mk3h3rVNL1CLeCI/cwwY7G5qeQNMu6hpKWUhLrqA7y8QsrYFSOj+FQQBfG+jN3ObBoCB9M2Qnr6lv1YZoURyNTvmrVBIJ9dHAtPlHtuSoFguZLo145xBx+ETmCtXRNfbAamY8PHFRwoP3jTDcCrL+dTvtlvBh/oYxW0+tAWlxrk97Js1d4jjjdPLhuB5dacb4VyeWQw7e7NEr7rc7FjHx/7oCXQuTnTlQgGNQz1W9gpPaCvmna7kCrNuhpGmN0CAgsfzReI+3qohNcGek= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39252528-cb13-4c0b-f767-08d6ee5dde7a X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jun 2019 11:13:45.8919 (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-CrossTenant-userprincipalname: Lowry.Li@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3550 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Px4O123upaDORe6ZR2GFQwG9BHMNWPHitSyXgYmuohA=; b=UhGRnnPAXFqyNb/HOAk2dX04sH/Zpu5PrfrZOW/rLbMSRL8nWJMOMy3pcA40pMtOwnSYWsH/MHInMTT4HJbDq5bG6LLa2WsVMmWQ7WgvuQGnlNbR/mLkOLU5lyRqd0liXZKBvsKwAoUq/FtLN4wRryEhlTV9sn3G5rowlTraBls= 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 From: "Lowry Li (Arm Technology China)" The komeda internal resources (pipelines) are shared between crtcs, and resources release by disable_crtc. This commit is working for once user forgot disabling crtc like app quit abnomally, and then the resources can not be used by another crtc. Adds drop_master to shutdown the device and make sure all the komeda resources have been released and can be used for the next usage. Signed-off-by: Lowry Li (Arm Technology China) Reviewed-by: James Qian Wang (Arm Technology China) Reviewed-by: James Qian Wang (Arm Technology China) --- drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c index 8543860..647bce5 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -54,11 +54,24 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data) return status; } +/* Komeda internal resources (pipelines) are shared between crtcs, and resources + * are released by disable_crtc. But if user forget disabling crtc like app quit + * abnormally, the resources can not be used by another crtc. + * Use drop_master to shutdown the device and make sure all the komeda resources + * have been released, and can be used for the next usage. + */ +static void komeda_kms_drop_master(struct drm_device *dev, + struct drm_file *file_priv) +{ + drm_atomic_helper_shutdown(dev); +} + static struct drm_driver komeda_kms_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_PRIME | DRIVER_HAVE_IRQ, .lastclose = drm_fb_helper_lastclose, .irq_handler = komeda_kms_irq_handler, + .master_drop = komeda_kms_drop_master, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = komeda_gem_cma_dumb_create,