From patchwork Mon Jul 4 07:40:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9211857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB60760571 for ; Mon, 4 Jul 2016 08:14:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAEB6284BC for ; Mon, 4 Jul 2016 08:14:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE29728522; Mon, 4 Jul 2016 08:14:10 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 572EA284BC for ; Mon, 4 Jul 2016 08:14:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A00BA6E3C4; Mon, 4 Jul 2016 08:14:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0061.outbound.protection.outlook.com [104.47.36.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 89C4C6E3C4 for ; Mon, 4 Jul 2016 08:14:05 +0000 (UTC) Received: from BN3PR0301CA0062.namprd03.prod.outlook.com (10.160.152.158) by DM2PR03MB589.namprd03.prod.outlook.com (10.141.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.517.8; Mon, 4 Jul 2016 07:41:04 +0000 Received: from BY2FFO11FD013.protection.gbl (2a01:111:f400:7c0c::143) by BN3PR0301CA0062.outlook.office365.com (2a01:111:e400:401e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Mon, 4 Jul 2016 07:41:04 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.158.2) smtp.mailfrom=gmail.com; ffwll.ch; dkim=none (message not signed) header.d=none; ffwll.ch; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 192.88.158.2 as permitted sender) Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD013.mail.protection.outlook.com (10.1.14.75) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Mon, 4 Jul 2016 07:41:03 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u647ep0T026135; Mon, 4 Jul 2016 00:41:01 -0700 From: Liu Ying To: Subject: [PATCH v3 04/10] drm/imx: atomic phase 2 step 1: Wire up state ->reset, ->duplicate and ->destroy Date: Mon, 4 Jul 2016 15:40:33 +0800 Message-ID: <1467618039-7457-5-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467618039-7457-1-git-send-email-gnuiyl@gmail.com> References: <1467618039-7457-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131120916636610839; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(189002)(199003)(33646002)(6260500002)(81156014)(81166006)(82202001)(36756003)(76482005)(305945005)(31430400001)(6806005)(97736004)(4326007)(50226002)(2906002)(586003)(2950100001)(8936002)(110136002)(105596002)(106466001)(7846002)(8676002)(104016004)(2351001)(92566002)(87936001)(50986999)(229853001)(68736007)(76176999)(87572001)(575784001)(47776003)(69596002)(11100500001)(189998001)(81442002)(50466002)(73392002)(5003940100001)(86362001)(48376002)(55446002)(19580405001)(83322999)(356003)(19580395003)(61266001)(73972006)(77096005); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR03MB589; H:az84smr01.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD013; 1:l+fQcUxWPqa1S3WQe0JGXlGENaDku6hqTrSWXGTv2w9h4UXGTf/dzThAtWZm3gCdtd5fOT1JLnmvI0BrqCs1K2NLdwPldfMFs0zI6ZulRngkwlGfrkHVIWNeacl9faW322QKbHf/desq1s8AaX5Azz5+uDHkgYExNwgbldpGNS5H22h2UYUrKeAF0spVJsxhQOToEoQVFW+dipEEBmpWiFhkwdLKSZa/5Ib+7yjr6huMMoqhm1rajyexcMKmugHKw/Ko1MtJ/t5lESAAaCoS+794E/031nEv2kBnokMZ9pE+2znBpTfyxycJ/RokbQyJuhaGuMMc4TNyQevE4hA5tIlmW0RDBXpSbsQh4bCWtpFbQBO+wkToEgNBKVzTEj3oWPL+0w72LEF2b0NSQipd2XSwtdbA8QKg43XAQXmVWg1BvNwJQ0PYh3Z9BwAZ/k+hiPRLjAeGSSyDoSNo/Fz7gFBf0cj6qV4ta74qSgYYY9nQygmNUuP7ZGiSxOgxEVo2CWjX4I/xisjOPOQHz2SlDJhffxu02PXTUuKFdMuOgqnwooG6QK9LXFWBgdDtIAcSWWm21InYT8+b+pjnPhWHPg== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 4634c876-7139-4418-4fb6-08d3a3de8d34 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB589; 2:HjEGlDOc3a3XcmhATM1V/vbZB5k/g07tYv3t1DwNYK0KM/G9/zSNb0of6oGa9ZnAMhZMGI/xaX09+opYuAlFnHjpsZUUU0PVi20sKlYD99O3etvgCC7XaRBkN+izHTZUyKii1rIKE7ladgZ8H61pj2zaqdMOpWM0w8eL86HzmaumtVhJ44PlcoWW6lv5iB4v; 3:GQwgMQ72/HxhBaqPgWGE+3xo6S4zy/OC23qE2dCNeogHFDdb899nJXHweJaDYD79YGN8sbsDMPr79o4kXbbCmnkPkOI+pakd7G8ztRWJzGvj8uJs2OEEgF6JZ65+UKE6iHQ2gywQIv91+VPbBby05PdF+BbXIrGyjR64gh2IJk+yGDbaw26Gm4cHR38PY1DXlMVRNo7wheTJerYQCboBycZz8t78UdRdUpH4hiNVmtk= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB589; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB589; 25:FaondYSIBoWXgdeETaYKwv34XokPClb2B3mgHn5gbhuBq9NpI2k7kEoECreAyDCYL09s+Y5j9N3/Y/d/cbsr0HX8fVrnMZoU2L9dK11sjlTNhe17ytEANrM6fHEM99uK1E88J7T2ZQfYEuinWM9Pc/+8zLOeFz8rI+1SZhy8cktxnx6zzWF6WQLE81xXNsGBD5kMUVJk3znZorM/wmBq5drFieNeFEEFd7DMlRNmn8N2sMPow4Ogot/NtzjhIIEI7urjy7qBRgrR6bgH+5RBRCmI5r29KIjPrOmCl5laZwX+iWmlNPC6JMGBN+ntOov552mv9qX73jOrFvl0NYGzJrgkCYeq4zfTcrc1N5Dr7YeB9y9ZnMsBmuzd7PY/Lbu3Lw3qELmmuo/ANArt2AbaUkF8nAZWGnKREsQ2iDqvdpD+/uBl1gGNqYSA8NPwpsI/pGs31nkNNF3DPywBb32soaITw2A3TrX4s0cO/JyYnMlkd0BDiAXd/GKRrUb40fEM1kMk21ZVVGxpwsVASYaGX4vgOxubhSLgddL3sCGi2cKYUsNlWWKT3MU4ibHEP5vZPYhQwjsHFa88rBvNb/kFzaerg7ScQe7rQ21Vhui+AFXx1VHu7xni1OolmJuz2Q2R7uweY6Vb1X1vxoqp84csFlMUD+0+CAsZ9MtQAMMfKVN56yNAk8IndMgADerA3QLtNVBq5BbObCIgKctuqVvJWn5ORBey9C+s57eVfeeBZTK66FLO8EXzvxIpzX7YuHjfRexm1I2SR1SJav9yItG3FA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13024025)(13018025)(8121501046)(13017025)(13015025)(5005006)(10201501046)(3002001)(6055026); SRVR:DM2PR03MB589; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR03MB589; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB589; 4:AOu+dgM+uz9Wy1XlBucccJshxzdnJQj2SdDKZv1SsM4hVdcPzkbbroKSDqU9j+rwr0qxGXSNT5Jw6RcJOy30x0LeEGlCDhBeQzUDjbGTiK112z9MrZ+0k7dkGKA84Fx3NyaT37gB4VTm+RdmsahssHQ2IVrAh8RUsfJVIxG9GsHgfkFrkGYllxFXbe8NXFdxHVOOtxzy706vXLa6wuMuPLMryvKB15nje8TET0/eEjnxQA8rcqvzT5HXX+ry3uZj9IQR9gkGQU8qViqIn/IwLHGe2UGCQ7WH3SE/a+4/IhtplCy5neNQhtwIs48KOM/tUYHDbrlKOlqr1tOdYkNqMWTVEi1AL7PpDMsUmDmiEtYu9vroI5wuDak/dlwLSW5gU9L1aKhclBijOvuKARiKutSMjtvxMGQMC3TSdkzRWhX5yQuBHS6jWb/0lmOkDKkRf4hJdstGFPNvfXkXDH7WJ8IGsDEyAGDhuQRnZpvV+J8= X-Forefront-PRVS: 0993689CD1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR03MB589; 23:AaZcA+O9tGD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fOvFG3yxUx9/naxqA8BtTkA84O/qJSzE3gg0H4QlZg=; 24:t9oh2noPsZG+RUENz7JBBeljDdAL7hCyF38szzFWIycWsc7WNPAzASF2U2OdqhCYpyI5h0ClvZKL0Z8E6uwGfncjTqrjI00YgGFTdqldXUs=; 7:ykgVujR9wGYPdAxZLMMgOMFUg4cDiUe61ZhgCSD5knrP7v0OndwZHeb7y7jl6CJrsI3gNZuzK3fwEfevd6mzxkuVuhnKXVoEFUm9WBUVHZ1omgh+RAG3ZL111dLAo8bKb4xRuiYRb82d/hH+tiWx3Wq9LzhIAYxL98VIfTTzJ2BSfJk8sjxhCDb+vrm4/gwySsh3JQWeHL+I4m74gDXmfthLVqXrCSEh6eDvoe6Mbt0ZVLhil+PY+hFh0EemtNSF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2016 07:41:03.5518 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB589 Cc: Russell King , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Wire up CRTCs', planes' and connectors' ->reset, ->duplicate and ->destroy state hooks to use the default implementations from the atomic helper library. The helpers track each DRM object state. Signed-off-by: Liu Ying --- v2->v3: * For dw-hdmi bridge driver, simply add the hooks to the legacy connector function structure instead of using the atomic version directly, because we are not yet ready to use the atomic version's ->dpms hook. v1->v2: * Remove the 'atomic' from the name of the structure dw_hdmi_atomic_connector_funcs to address Philipp's comment. drivers/gpu/drm/bridge/dw-hdmi.c | 3 +++ drivers/gpu/drm/imx/imx-drm-core.c | 2 ++ drivers/gpu/drm/imx/imx-ldb.c | 4 ++++ drivers/gpu/drm/imx/imx-tve.c | 4 ++++ drivers/gpu/drm/imx/ipuv3-crtc.c | 4 ++++ drivers/gpu/drm/imx/ipuv3-plane.c | 4 ++++ drivers/gpu/drm/imx/parallel-display.c | 4 ++++ 7 files changed, 25 insertions(+) diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c index 70b1f7d..dd5b21a 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c @@ -1500,6 +1500,9 @@ static const struct drm_connector_funcs dw_hdmi_connector_funcs = { .detect = dw_hdmi_connector_detect, .destroy = dw_hdmi_connector_destroy, .force = dw_hdmi_connector_force, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; static const struct drm_connector_funcs dw_hdmi_atomic_connector_funcs = { diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index 7746418..b5a5173 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -279,6 +279,8 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags) } } + drm_mode_config_reset(drm); + /* * All components are now initialised, so setup the fb helper. * The fb helper takes copies of key hardware information, so the diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index beff793..12bf368 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -362,6 +363,9 @@ static const struct drm_connector_funcs imx_ldb_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .detect = imx_ldb_connector_detect, .destroy = imx_drm_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; static const struct drm_connector_helper_funcs imx_ldb_connector_helper_funcs = { diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c index baf7881..0b0aeee 100644 --- a/drivers/gpu/drm/imx/imx-tve.c +++ b/drivers/gpu/drm/imx/imx-tve.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include