From patchwork Tue May 24 10:10:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9133391 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 56EB5607D5 for ; Tue, 24 May 2016 10:27:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51BBB2824F for ; Tue, 24 May 2016 10:27:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4630B28258; Tue, 24 May 2016 10:27:49 +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 4CF1728233 for ; Tue, 24 May 2016 10:27:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF0D26E700; Tue, 24 May 2016 10:27:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0097.outbound.protection.outlook.com [65.55.169.97]) by gabe.freedesktop.org (Postfix) with ESMTPS id D87B46E705 for ; Tue, 24 May 2016 10:27:16 +0000 (UTC) Received: from DM2PR03CA0010.namprd03.prod.outlook.com (10.141.96.20) by BLUPR03MB472.namprd03.prod.outlook.com (10.141.78.153) with Microsoft SMTP Server (TLS) id 15.1.492.11; Tue, 24 May 2016 10:11:31 +0000 Received: from BL2FFO11FD050.protection.gbl (2a01:111:f400:7c09::187) by DM2PR03CA0010.outlook.office365.com (2a01:111:e400:2428::20) with Microsoft SMTP Server (TLS) id 15.1.501.7 via Frontend Transport; Tue, 24 May 2016 10:11:31 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) smtp.mailfrom=gmail.com; arm.linux.org.uk; dkim=none (message not signed) header.d=none; arm.linux.org.uk; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD050.mail.protection.outlook.com (10.173.161.212) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Tue, 24 May 2016 10:11:30 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u4OABCM6024148; Tue, 24 May 2016 03:11:28 -0700 From: Liu Ying To: Subject: [PATCH 07/14] drm/imx: atomic phase 2 step 1: Wire up state ->reset, ->duplicate and ->destroy Date: Tue, 24 May 2016 18:10:46 +0800 Message-ID: <1464084653-16684-8-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464084653-16684-1-git-send-email-gnuiyl@gmail.com> References: <1464084653-16684-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131085582907896844; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(189002)(199003)(9170700003)(5008740100001)(83322999)(50986999)(86362001)(575784001)(11100500001)(76176999)(87572001)(110136002)(33646002)(87936001)(50466002)(1220700001)(5003940100001)(105596002)(586003)(48376002)(19580395003)(106466001)(19580405001)(36756003)(229853001)(81166006)(2906002)(31430400001)(4326007)(76482005)(189998001)(104016004)(92566002)(50226002)(2950100001)(73972006)(82202001)(47776003)(5890100001)(73392002)(61266001)(77096005)(8936002)(81442002)(2351001)(6806005)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB472; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD050; 1:9EQAMq4BmVli+kz5eyPyC72yrca7ZsTeTq3pCkRUXTCTtCT7adV2didL/YPqvMpjGy8xxtq7cmUkKb3jnbzuAi4cZM0u1uhxM48SyJxmaHGua4esaR6SPC6+rIQzgOQyprgRvTPkZmUuAl9SmCOlw/d/Wj/ALFGyIF5bW1udrN2liD60Nqvs0kwwTgjLk8RYcXRdlylKcw9fGjUOhCW15UxwbcTuWf06Ncemnzna5kiVV+x6+PqDxbn2IYBfDWR5TDC/wMQCxT8m2x4DWaJSqykN0fvvIuMPG9mCyodbGgfH2nTRwusqjx/De88haOmuGMzQ7Nfhy7g315ckgZJYQZrOEN8wXS9Uy/iiu7MYH4ijOp6vbXpOT20/ftks+fJN94846k8zuWfIiFZ13W+nrZWax0wKRJnbzdKdtxtvo8/wsqBmCSQ3KY+SVidvh2Gm5z//4UzpLw2Qjil4qdIHF8MopVJyLSrX7ZrEmID37gbIokKfQ4p0tlUh6+Vz6Exc3rTrqz83aEnhbLI66Ai5hGqIGFhxHvqoZpsG/Mt+5zCTOCL3O4yFwo3TaMopLV9S MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f6e61e80-0d51-4f6f-12ad-08d383bbc6db X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB472; 2:eOuX7UjyPlBWNe/XFGpccannXhX/UZZ67MqVqGSityVK10PPNMQ8Ofl9v3ssoVki1nb1rBTAsbKZKFfNGBqy3YkkQoNK+1OjtQ0Z0RFdCC8pPKva4M8dE1lbOe7/tWhYlRO5J4q97+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XZfxWx4KZVdg3KKYZIIlYLMEaG5GYtfj0Uts6ZJMYNoa8xotXZjvMuhFcwonkvzdYFUcH52Yi2J6K9MBhFtxTCaHgJeIpS21H9wDalnG+sfRrfS0lmnp0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13015025)(13018025)(8121501046)(13023025)(13017025)(5005006)(3002001)(10201501046)(6055026); SRVR:BLUPR03MB472; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR03MB472; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB472; 4:muvnCEDmIaYtwyD8vg+Xs/TINarteA8j3ejE4MTyXbNfQ6iSzVOJWjqdm4r0WrTz5GKFA5RFMomSbd3hoBCyrQS3WuqTSpbK+0H/f1/f1yfN62KXAu8ER1DqdxhXPtldtBkUh1Ek031LN1NlYYSW/IARGE1fRs28AlzgWxZHEoPMyAzoufwBVJOafknn8btUfawWgOFlsLu78ZZQu/utE8xEUhvol/BsmGT7HTo0+5XDmBPYF8YMpBuMV+O3tgWLNrCoKhQE0LbxbLb5Qsni7kxLCCE66vlVc5JXKa1RoYiRZ7hGFHzh3vFGqyEnv9P1K+jt3iYsPbZw6T9M/BwypERafvTytbScBExRUOYTJr0A1QgmqqSg0q2k0QQ5gt5wxTZfuF06D+coXh+zm8nO+wHJIGGadaJxO8my+9Q5FPxj/K3uq2pRN61glA+kl0Cdh+J3jvINsQfAOTo0O86xmES+lE/p/ZfX7RZSPJtPbzs= X-Forefront-PRVS: 09525C61DB X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB472; 23:YO2C+C4jluh2UaOkwC4nkOABCcboCPWJ+vP8wfF3NA?= =?us-ascii?Q?Ne+a/dKABoPfIULnqJT/4JSmc1bCRCEElQIFu2p7op+hhi067wvHrmem2MSe?= =?us-ascii?Q?9dsbX1b7GNjJ3MRMmSB+NiuYaQ3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FV6yf5pKERdqPAAXY4/0NT27OqKEnaoDIqSmlmtVtB4EGGQDFuh5Fm+JAw?= =?us-ascii?Q?rR981trBF5F2G4dqNugzPDLCddH3wWXtSs/Ih/N3fh6eV2YNQEGpNEeaPZKE?= =?us-ascii?Q?rb0xbJeZUKEe08CrRAWIIisgdtPhNG45BP2o8shiFyEj0INIcNd7T3aBFs3c?= =?us-ascii?Q?WeCHrn7XG9kk7NWBKinh4MaT+r9yGLi7I6vJ9qbdTyBUsTCl5y7gdOnZ74XA?= =?us-ascii?Q?CrnL4aw8g6AAt4XPw=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB472; 5:Ehxgn4JkVL9P/SN0gZwR7hJWfUMUE8sOiqVeifncvvQcS5CXQNBFdX3HqZD6PqjoDShvaIzTeuCLB9NCkyJwnKa65GqWNzKRegzNNTui1mIszIYIJ2fKUjD51sHgWDUqFzxdkn7VtSDR/0gJhPVO/fSCGWS/Asi+dn6VX2RrTgA=; 24:tiRXXU18L0DCnk1qqPehkNIvVFaVrDdg/BpKx81mtJr1hHygNOltpHDhGH1MB5gu19CYJIS3/M3i9UrVvfwpvd70iERmSuV5EspBEE3SWOg=; 7:pUDeJ1oWM7yYOrZH7RsucVbxllYeF4a6iDgpMKqKmn/HCpIHXXCXclKSdwshQtjDeen/+Pi5FpXV3AHzKSIj7Y8DdFj3VX21WZgcy9c7398eBkZr3+Dil+WbDhACTm422U/OJvgowWRj57I7+1PlHlL2q4/5Qbzv1v445jHyEtKj7UmPW/e2wI6B7K6frq2J SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2016 10:11:30.2280 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB472 Cc: Russell King 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 --- 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 9795b72..6541b3c 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c @@ -1508,14 +1508,6 @@ static void dw_hdmi_connector_force(struct drm_connector *connector) mutex_unlock(&hdmi->mutex); } -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, @@ -1650,14 +1642,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_atomic_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 05229b9..e15f887 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -283,6 +283,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 a58eee5..8f17b64 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 @@ -357,6 +358,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 ae7a9fb..9b45deb 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