From patchwork Tue May 31 09:24:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9144025 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 69E1360761 for ; Tue, 31 May 2016 09:25:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BBF32793B for ; Tue, 31 May 2016 09:25:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5096428188; Tue, 31 May 2016 09:25:01 +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 CFE302793B for ; Tue, 31 May 2016 09:25:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0DD226E358; Tue, 31 May 2016 09:24:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0083.outbound.protection.outlook.com [207.46.100.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2EC3E6E356 for ; Tue, 31 May 2016 09:24:57 +0000 (UTC) Received: from BLUPR0301CA0018.namprd03.prod.outlook.com (10.162.113.156) by BY2PR0301MB1590.namprd03.prod.outlook.com (10.163.28.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.511.6; Tue, 31 May 2016 09:24:55 +0000 Received: from BN1BFFO11FD003.protection.gbl (2a01:111:f400:7c10::1:191) by BLUPR0301CA0018.outlook.office365.com (2a01:111:e400:5259::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.506.9 via Frontend Transport; Tue, 31 May 2016 09:24:54 +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 BN1BFFO11FD003.mail.protection.outlook.com (10.58.144.66) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Tue, 31 May 2016 09:24:53 +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 u4V9OfRO013844; Tue, 31 May 2016 02:24:51 -0700 From: Liu Ying To: Subject: [PATCH v2 04/10] drm/imx: atomic phase 2 step 1: Wire up state ->reset, ->duplicate and ->destroy Date: Tue, 31 May 2016 17:24:25 +0800 Message-ID: <1464686671-20299-5-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464686671-20299-1-git-send-email-gnuiyl@gmail.com> References: <1464686671-20299-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131091602942263000; (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)(2980300002)(199003)(189002)(9170700003)(73392002)(6806005)(6260500002)(586003)(104016004)(229853001)(2351001)(76482005)(2906002)(105596002)(106466001)(110136002)(33646002)(189998001)(87572001)(50986999)(86362001)(76176999)(575784001)(50466002)(55446002)(4326007)(73972006)(81442002)(83322999)(48376002)(87936001)(5008740100001)(5003940100001)(8676002)(81166006)(82202001)(61266001)(47776003)(2950100001)(36756003)(31430400001)(19580405001)(50226002)(77096005)(5890100001)(8936002)(92566002)(19580395003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1590; H:az84smr01.freescale.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD003; 1:gyyPb/QmZuxHmsaS10wRoWkyTv+1dInONaw1X9Ykpu2KoRoJKH2dd0fB7jCApVzkQjso6yOM8DZbW+zDNCFpyJh3P7iNCrKp/83mVFb6wtYIzylKNmVEtov2loHvC3HpoQ6hA8soXGY79alxZlhTZdmErnj05UJWhfgxqk6BSLK5dKsQbA4pBygykpA3UGaXCQySj0MND5/BG/AEIntZUvelC1OoO9hNTsBKMnCEQpQERU9I4qSBlebyZv30xP7yleTM7txqwCMNVLd1iAx0N4qchhJQ10jQhhcE5YWm9Il50YVzjEvqua/O0IkVsqkyMsEDXFOSQ0hc6/GARX6WL6KreFNbR3t9XWbDwSPL5dBleTYq0bl4VjCrPzflhs63FGA946w2wN0P/maXGge4pO5Yf/0vuR4l1wU8hdGKSNJN0rtmbp0yYci/AKdyXJ0A+ajHR9IbQLb/eoyoMRGoyee9rj0cMGokmN6J7g1gSG7sepHKuLMWx/5AI7Ri3NPtdqBdC9naXurRxr97pdd2zI34ijnbOr8gGquo0K8n8tsea/upZqFqcaeWyKKx6oQT MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f72b5253-477d-4833-9d77-08d389356cdd X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1590; 2:/dA9oSu+ckFqAa1njqC2MzXG01MlEhK2cd7p3zzn1vNpI0jwa//DdfaDV0R20Lg5bowJ7dtvhEXDE/O20i1mdyeydoJc2NF4rtevB/feMrSe+cr5cN6eOGj2xi58qn/j4hZtu5rswiTVO2w8Cii8vc1WBBD3R/Yc7DBthBA8wA2NZUuFAR9JBn+Pb4z+EdyL; 3:XeBxZD0LdOohTO+s/OPZaP6guNgdMyJM2QKdt50M+1jofhaijB7W9Ti3G1M6rO1fE0wZjCyQDIM5eth7H0dKv3UIVTXOj9x4gkoiaM0PkxF9mDV4vwIb3NyPS+JV4m7I+71MQdSQQ/gXwLCmjAXAm9/O71fJmGxAAHyErQczmKQBpgaBCDbS7LUS2AIurIiOooK/UNEviseEvLerDkGbA+sIrOolAauyJXMNQL6bmRc=; 25:p8S55nTlVoOZsTumLL5d4JkBQpYXwGjI1DPJgpWMEXxYkLxhHSCMqQfKzh/chVxDu/ebB7dGcxjODGDm2K3tfUDzAzRwYe+oqPRPvALXmb2+ZitCcqNb6kpwFYin5nEgNjA/dO4dVGjqGX5aH7FGGMnjIexEQy5muD99fSLrURTYbgCMBYHGEqpD5ZJrllP4O0JunDB7t3UH1NQVQKSq9J07XdW/4iRGHbenUnu0zRkQV6KeFsZXjdrk/LCGG4j8GNlKFDE11AA1VmnlLN3dcBHnM8pwJt2L/r4aqdt7GaSex2WfWb27EFfKdQt4IZJ8HKPbK886FuQDQuKQIsD+O22yElim6oH/SykzfVfhJOGs1KHsnD7pWmcn1vcKnR9KjGMFxbN7hXIour5RxBlriFzZ647FlN7xbABUBr/+hRU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB1590; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13017025)(13015025)(13023025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:BY2PR0301MB1590; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB1590; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1590; 4:Hz4OmNQQN0Xd3050FDTMsuNRrx6Ruwl6wauI1S5D9BGtrNLs5hl9QLU7vY43hR0qFmnHsO/SBb+2MCSIYC3qkD6NZ1FRn4urV7CaKugJu3VAtF3n7ZEZKFgcbRygbx5WUgqlGm7zSEz25twnZlu5Llr1qe46Hah9fz9WH1ENdBTyJGcEBbWWH/ry1YrrrFvz5VWpoJlpZnZozsdenSQj4THMy2oJdWmXsTIY+gnO/A//8/Sbk+lZLx8PXBeObGVdo2Q35eMHQ09wL3nNbS1jnJgv6ERBRK0VhG54W9YpgScWt3/4GWYseS+Q1eng77wwuZcCAnDkNxmoLKT/sF+dOcskHINnlgprq9HfXwglUaFGA8WKle0f9f/rBdKLEiAxKNjTw+FNaidDm4MpiEPgPP8Q0D7GucYiUq5CXcDaFQbL9wOFF3FEP5435S29IW8uWDw2yuGxPJTjdi5FoWXdarqJv/p//EBVcLKj6s0cLHI= X-Forefront-PRVS: 095972DF2F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB1590; 23:feCNjoQCcA3Krr9N9xS5AGVg03f3IwskVCP2wME?= =?us-ascii?Q?Swllq7NoezjunhmbvQr8v/U6TWuyoU7P38mkx22OqDZeem6ppRDeexBowIsT?= =?us-ascii?Q?Vd/7rQYCZIrk9/b/XycchqAdMUBCxcHYFVV4S0ciujl0kNpCOOjwI+frwqfs?= =?us-ascii?Q?GIvgTe5PLqOuNMTt/oW4DlLY42zJb+yEz3LFYfJ8UghcF/g0Kr1nNv309WFx?= =?us-ascii?Q?uLqP0YL1xp8PegoaYxLIxsMiGSjeki2Z/v3tTteOu06vINHLe5d06/STccIX?= =?us-ascii?Q?5zFLQWBX6NtrPrnyAhB5tJCTcHqC73zzVSXYmQgRnBnx6goOZPIsEr0CUTti?= =?us-ascii?Q?B/e/YxAR5WW3EJr31ZwZ4ru9/R9/HR2vKj1dQIvkB6YOaZdwoULE4uK7PbJG?= =?us-ascii?Q?5IZQLzGGTYKAIpw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301MB1590; 5:NTi1y0LYE/J27pDgi9+4bK+GlgBNViEr9jBb7rsz41PLjsh+RfZ3X+Pa9jb6cHZq2U0cIM4tGOsFN2frRoEO2EKTd6X73M8oMvLFvn5lkMdNvDD58iEBIylB/yudNLpkGGjisIfIfR881J0O37rKUQkFl4TaHXd98nMNhyxP5cI=; 24:8GiZ/PBiR6yLVZ/ChmpYg4d08KQEgYsAJi+eXgwadfrsTkQp7guPbEFpVASwmZyBZSVNPX4D0hD0Vcp2DRMIoc6744TcF1qrJf4jmh4OFyM=; 7:Vnl8QmlJN3uNyVTDH3TESWfhglI7RM16aK+iiJqUs1mJqKu0sWAo+cJXQefL5o1u+BFW5DgktaTCQzpiMedxHP1k/8javLwBZd8JMTIaXZ6jaGk1QDdLejfCNGNLQvvuErmPGTI7jUr7HysMU9WO94j6p70G4UY1KSt3ePolE6b47G3wHflCC42+aDrn+39o SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:24:53.7582 (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: BY2PR0301MB1590 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 --- 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 | 19 +++---------------- 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(+), 16 deletions(-) diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c index c9d9412..3d37e8f 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c @@ -1504,14 +1504,6 @@ static void dw_hdmi_connector_force(struct drm_connector *connector) } static const struct drm_connector_funcs dw_hdmi_connector_funcs = { - .dpms = drm_helper_connector_dpms, - .fill_modes = drm_helper_probe_single_connector_modes, - .detect = dw_hdmi_connector_detect, - .destroy = dw_hdmi_connector_destroy, - .force = dw_hdmi_connector_force, -}; - -static const struct drm_connector_funcs dw_hdmi_atomic_connector_funcs = { .dpms = drm_atomic_helper_connector_dpms, .fill_modes = drm_helper_probe_single_connector_modes, .detect = dw_hdmi_connector_detect, @@ -1643,14 +1635,9 @@ static int dw_hdmi_register(struct drm_device *drm, struct dw_hdmi *hdmi) drm_connector_helper_add(&hdmi->connector, &dw_hdmi_connector_helper_funcs); - if (drm_core_check_feature(drm, DRIVER_ATOMIC)) - drm_connector_init(drm, &hdmi->connector, - &dw_hdmi_atomic_connector_funcs, - DRM_MODE_CONNECTOR_HDMIA); - else - drm_connector_init(drm, &hdmi->connector, - &dw_hdmi_connector_funcs, - DRM_MODE_CONNECTOR_HDMIA); + drm_connector_init(drm, &hdmi->connector, + &dw_hdmi_connector_funcs, + DRM_MODE_CONNECTOR_HDMIA); drm_mode_connector_attach_encoder(&hdmi->connector, encoder); diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index 8265665..3c83590 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