From patchwork Fri Jul 8 09:40:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9220369 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 627BB6044F for ; Fri, 8 Jul 2016 09:56:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 512F328619 for ; Fri, 8 Jul 2016 09:56:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4605F28649; Fri, 8 Jul 2016 09:56:43 +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 C67CB28619 for ; Fri, 8 Jul 2016 09:56:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 47C316E172; Fri, 8 Jul 2016 09:56:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0053.outbound.protection.outlook.com [104.47.34.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 663D26E8E3 for ; Fri, 8 Jul 2016 09:56:38 +0000 (UTC) Received: from BN3PR0301CA0081.namprd03.prod.outlook.com (10.160.152.177) by BLUPR0301MB2018.namprd03.prod.outlook.com (10.164.22.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16; Fri, 8 Jul 2016 09:41:26 +0000 Received: from BL2FFO11FD019.protection.gbl (2a01:111:f400:7c09::157) by BN3PR0301CA0081.outlook.office365.com (2a01:111:e400:401e::49) 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; Fri, 8 Jul 2016 09:41:27 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) 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.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD019.mail.protection.outlook.com (10.173.161.37) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Fri, 8 Jul 2016 09:41:26 +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 u689fBMq003192; Fri, 8 Jul 2016 02:41:24 -0700 From: Liu Ying To: Subject: [PATCH v4 04/10] drm/imx: atomic phase 2 step 1: Wire up state ->reset, ->duplicate and ->destroy Date: Fri, 8 Jul 2016 17:40:56 +0800 Message-ID: <1467970862-28012-5-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467970862-28012-1-git-send-email-gnuiyl@gmail.com> References: <1467970862-28012-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131124444863569779; (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)(7916002)(2980300002)(189002)(199003)(305945005)(87572001)(76482005)(50986999)(97736004)(6260500002)(110136002)(76176999)(50466002)(48376002)(8676002)(106466001)(81156014)(189998001)(77096005)(81166006)(586003)(81442002)(61266001)(50226002)(8936002)(33646002)(5003940100001)(47776003)(31430400001)(73392002)(68736007)(36756003)(229853001)(92566002)(87936001)(4326007)(575784001)(86362001)(104016004)(356003)(2351001)(82202001)(55446002)(6806005)(2950100001)(105596002)(19580405001)(83322999)(19580395003)(7846002)(73972006)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0301MB2018; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD019; 1:T9IbH7MNwZBI8JnDuLQtaRWWqAuaTPxUeo2RbhKip9QpjPmpd/OLtE//tcuIcey+J9+mm4Tr7FEEH4+7bP6RaYw4RoEgYvRgfSQimP6a+kPsyBI49oTlBYz16437Q9qCJKFPlEooAtCv9YXvROZCafxCxw83XTGoLEa7PcJOT5apwu/3lCQ0AIMTAiT6gJvUlWB3WIiTV1WsYogM8Xhn/o5QLGtc8iRyHm6UjmpLYupP+xudt8XebzsWMh0VyluFBaBTDviSCR18VbIV2asEOZNxiyM7TvGB6L/8ucXLgQgER7ArU47/k5zJpZRCwjmnWpxig0SLR0ieCZcYfkCGFOMxniI4QBQ/K8LZJAYA0G5bGluWj96ScpQ2rh7x/EonFPNyMRHJxkH5EWCE2hPlLnCGiY3U4vvj32cRJy5bOfeXpeIAylDBe38+gX9T9W63NLzulG2kJdH03OLrTJBLdgSqDOzCz8+YrZpJz1jDaVDdQV4IdVEaQ5wOp4riY3zdSWuGONwOxtxP80lD6iNlHwvDukzxbdg+X+8lgTbqGo4ni0vma1dFPogYbfBGVpWeatBdtmoyybTrqBclf29k7Q== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 333cf5fd-3b2c-4cc8-9f73-08d3a71407ed X-Microsoft-Exchange-Diagnost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report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13018025)(13024025)(13015025)(13017025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:BLUPR0301MB2018; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR0301MB2018; X-Forefront-PRVS: 0997523C40 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0301MB2018; 23:uJuqTHUE39uv329m4AiTdEwiZBWAVlgalDo3/iN?= =?us-ascii?Q?CAsp+O+x33eYAOUkrGaNSRz8ca8cr5vcTJWosXOP42JOr5/7+2Xeyh7zndab?= =?us-ascii?Q?TtjrmpNa2ncj/rxgKhfmXChZRgHyzNkRkEYQsWwAg+0AuS6LpVhlxY0afri4?= =?us-ascii?Q?tLjcjiqQ+R/rY5f5dN3I8pt+6EqYOcazCAIDZhAAP1dAlAaYfvh8VhfyNxFc?= =?us-ascii?Q?REeSUlSWxZeCVV+9MtfTLm7ArIe929MY1T3ermsLNywHmoF+I51rwnUQnlKi?= =?us-ascii?Q?lpCx0GDXE3QBP8wy6cU/O2n0TrPpnkQ28mTX9L3AUaWNzOWT/i8hTvzdEqj2?= =?us-ascii?Q?pjXw9JLdvj8Zm99yPcGj+8nm9WcHYnWzES10U56Cgg7Xzkubj1UR5CvirqYC?= =?us-ascii?Q?NPwUufiXBtm56zm5DIhx1JQtfzA/HpyFokWw8Nq/mssn+iX4AT69D7Zt/XC3?= =?us-ascii?Q?urjHb+0ELA0Ge8DwZhuvctgHpTFjEUrt96XQ4QbXSMxBE/Li7YHaSGlLF6G+?= =?us-ascii?Q?WVKUQTY+q2qOZNd7YLPTIhdgzHyINj8Fyi2z9xyGpXfsyXiq54zorzh15GJi?= =?us-ascii?Q?2HA61OJzNfYlEFiOJKMkUexT6pUp+3ryPO+359KIb4r2mZVCBUYzK0TR10CM?= =?us-ascii?Q?tS0UtfbwlYGSjiRxBbJWn7fa5dgwJ5kokKZWJuBgOprnO84BnaLv3ut2PJeW?= =?us-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JOF1pHu6WsxrvHmiE0RLIs+H5T0d5cVYCyvY4ThPKDGF6Av6Zt8EyGazKIxe94LQS7Qc5saOYCW0IFzMOCRjA4ZAvOW5YubXWB9FBkJET6a+oWjopZr+sn/y6LrlD9O6OJJpx7LoWMFM69XIeiWgiVQ6gRbwq8=; 24:X8tQ5eUE0jgu+DpGlnlH5w9kZkEFWKXLtjbhBAL9D5ls9QibHr1k/oXm04UgUnyslV1Hw9VQLASsaXSNmf76kTfxUIReKLSDhaEdJXgi+wA=; 7:ue3zp9+pfKCFWbHKivg5ZXbOiHnmdhdWwqdgTG1ndAf1xUDC7QSBXVJBTpqz+5D0LqLrNK4bL6ZSOqiV+0R562cUXzb/t8kBuLBKr8OMrskPlLn1nmKnouW95nAUxq68AqnQmYcbsSpvuhgUTTmYlDgsm55aRaiu06esXX/e9BLVIiALxJKzRbfFmZ8+ZL5OpMilL44OO23rfMb8vWe9UUdyrUPntyj/0VKLlxccKa+j2R1BD2t2DvjNRjFwhidR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2016 09:41:26.1853 (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: BLUPR0301MB2018 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 --- v3->v4: * None. 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