From patchwork Fri Feb 10 16:26:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 9567103 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 8490A60216 for ; Fri, 10 Feb 2017 16:41:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72AA1285A7 for ; Fri, 10 Feb 2017 16:41:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65B7F285AF; Fri, 10 Feb 2017 16:41:48 +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.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 9591A285A7 for ; Fri, 10 Feb 2017 16:41:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEBBA6ED59; Fri, 10 Feb 2017 16:41:43 +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-sn1nam02on0041.outbound.protection.outlook.com [104.47.36.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1FC566ED55; Fri, 10 Feb 2017 16:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wv6PIxqav90rG2T5lpR8XMebo7jGrfrJuMq60gArBEk=; b=ocd/G4quxB3flcjnrGtPqfbtWWzE0U3JDbDJyQaCH35lN7XPmbC6F8XERNuUONkCjXWYhuI+5whg5iDKl/yXff8JOV5Sl5KyY8DOTylG9MZNpg5Os9oNpoxXNOk59mj2llHqsgvmxlkceQ9kNIc8IxAwcfdPGut6+zyFEq6cOro= Received: from BY2PR12CA0036.namprd12.prod.outlook.com (10.160.121.46) by DM2PR12MB0251.namprd12.prod.outlook.com (10.161.146.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Fri, 10 Feb 2017 16:26:55 +0000 Received: from DM3NAM03FT023.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::202) by BY2PR12CA0036.outlook.office365.com (2a01:111:e400:2c84::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Fri, 10 Feb 2017 16:26:55 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by DM3NAM03FT023.mail.protection.outlook.com (10.152.82.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.904.16 via Frontend Transport; Fri, 10 Feb 2017 16:26:55 +0000 Received: from SATLEXDAG01.amd.com (10.181.40.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 10 Feb 2017 10:26:53 -0600 Received: from hwentlanhp.amd.com (10.180.168.240) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server id 14.3.319.2; Fri, 10 Feb 2017 11:26:53 -0500 From: Harry Wentland To: , , , Subject: [PATCH 8/8] Revert "drm/amdgpu: Refactor flip into prepare submit and submit. (v3)" Date: Fri, 10 Feb 2017 11:26:30 -0500 Message-ID: <20170210162630.18157-9-harry.wentland@amd.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170210162630.18157-1-harry.wentland@amd.com> References: <20170210162630.18157-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(39410400002)(39850400002)(39860400002)(39840400002)(2980300002)(428002)(199003)(189002)(77096006)(92566002)(39060400001)(6666003)(2950100002)(626004)(53416004)(2201001)(86362001)(5660300001)(575784001)(1076002)(54906002)(4326007)(2906002)(47776003)(38730400002)(105586002)(106466001)(48376002)(53936002)(8676002)(305945005)(50466002)(81166006)(8936002)(356003)(33646002)(81156014)(101416001)(36756003)(50226002)(68736007)(5003940100001)(76176999)(50986999)(97736004)(189998001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0251; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT023; 1:L7KmiCTyVMJWibKAvFg+jso8TlAGhLzC2Ea3cwEEVvmdUU/IYnztwuVqGiNYRykd2uQ9vzpmpaCo32RcD79a/tgEBmKjejZ7tpGhtjye3pkaYfibGarsi9z+Yab9l+ARf4ej1eHSODNCa3tMBOzQ37zC9YXayvubHwiB6KeXRay65aBYdnPiVe2pjMFB6cACXnCZmbmV1ElEF8VYt/wfyPn/FGSHTaBax2YpShfHLk37PYmAKr9cU/ib98TysjLcHhdORtbdEyTGwIwRfFGJ34Q0Qv3fxEtVJc+m2YdKyg6S7YP1TJaHdgfzmX7Ebd38SYyhTcbupsCyszNBzRQ3UT65c2zgO1ugDF/xN14maL67v0sVRC6cmWAP9jI7yGwUv0PbRg+cc5BhnHkNhd7widDwjMIjRHa2CokNf2+ZiRm3Cm6MDrGYSE/RPsue5ePwfVmxp1iOf395hdA/lC41+A== X-MS-Office365-Filtering-Correlation-Id: 4b530a6b-5b54-49d5-b24d-08d451d1a0bd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR12MB0251; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0251; 3:TAP7+4fmEaq18/A1WRwZPyzS69b/ECG7FQdKu0LJmhJYdzCNobtxkj7kNcgAW3sR879dMfvsoln1q5PNk9GWcijsHgrZ2raOk1G7ckw7EOvMGEiqx46qzuefzOGBv59m+rYY+c2zwXeEc2/AS3ecK5gZ9z12fbbU2m3tKnNHm3epVQcnncI2mx99QuG5c86Jeb4Qi32ce1YV/Pk4maWXSMuCajwEcQeNauYUDUhfLmEJP117bzTAR/sRHoLB9uK9qJn6GYQ/8lHnSFiZtHPmIbWTkn6yUODqqv99IjGVtuIpQzJfqyz1ndtuwxb0nJSsglDAORSsFLqXJVCvwGmDASB/at1Ca8FhLRMiCvrhKtctEH0MiSRLAjKSsGidtCc5; 25:Of9CP2d9PHl2jO9Wqb7oOCAMP3KQgXtervnVdnbLwqa/Z/wWHu9nn4bNLfuVw5IrLOpCjYVrWH/iEB3FkdoGyxl7SRy5DxdSwmQ5wydRLcZ5heuH3aM58JA2JPIdZixMYqfo5x1QhvQTq48TvtgA26oA3Crq3CvNMtM+GBFb3YMvKhiYn2/Pd+1ht+twk6aiXzvw6+DH7P6YmFpTNG9LW9Ek15aa20IqLVaDqS03NPR9wNCmOw3/3XS5v2u579YIHjpgn38JrZoHrD+0462Ns9G26RufD/+eUIA+B74IsH+Feqeog2phgDt5o/5K1CFSQ8zV6gqvg77NzS0pTgrAVYE9pgEAmB+GP6uHxI89yPr0Fv7TKG7j5pwH4/BcTxZ1KtBxD+sLan8jOc51lcoOPJHtKe7fXLh0qfGd0RQBiMUhCOm+feigjdW+srOkmX0AoFxMsO+Ydw549GeP6agH1g== X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0251; 31:LHgInJVxgaP8DhtJeEuXsMLTnq0I1I4qikYheCMB5mRQgBS/yNCgrEj3B4Pv+1jvn9CQw8GAXXO9J2lI8F/yq5E0i4VGZLbvKgR4KP5OY+YgRcXkcHFPhujIPwAySthw6iJ3akbum+8YtnFQW0nFVxNdGrSuhwivqmV/3t71OwIXh0VdZ9y48WPILl1YG/m36++mkqsk4dGIyQJSNeHr9+Ktph6/pMsgcpi9C1/gB8ME+ItCT/2NLMubBQP7hd8I/y5m7FBqZQxlyrwv+dsoSQ==; 20:fXDf6Ns4LKoMnqMtxhcAS6rWJBsY2DCxIgIsTfeaqXOS0AlJEpxMgRddJn6xZVgKOtDF/xPPiTvr36c1pNPYWRAehBfz0YNo3YMJC+uVTnlY2BvsDwgak0U2obFraIOyU79H8xqBcbuDoLYgJHKiQ9GJru2eaVplPANfWR6L5rDKweHxqzkj6B52DQwHg6Q2dJJMSuD7oYNA1YTdvllayhoALsJK4t9+4ppS8iV6e7W0uE54jls/CDCYectuVC7aNfX38cvXgcBjLgVCmtEzRnHM3OTPUPsCB03HQqwukmJQP5REfwfgWZXtFry+0DIBTMOXGV+GdA8yt3tFBgcKj6Qx430awbBm2/kDIciikBKvfl8tI/A9NIYEhiQj9OlssjqGJeG3h7DpFHM1lyDOrdNLCh0nD4JZmz1IwnLWVaeItbBzBi8jQCHz2ApsGrj1+41qDfcpo9MOCtY/zWgHH8xAe3sdc1sxknMAtjw7aubeGM1nrv7p8itTr0u+jitF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(13016025)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123558025)(20161123562025)(6072148); SRVR:DM2PR12MB0251; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0251; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0251; 4:6CNyhCmBqF43N3MgoLizDLyHqseK9v34E8R/ApDy8N1opQjDxt/CvF1JVsE6dKEeDVAB62bqpCA81gtoM8OzlsTTmDOXzRxvCz3luTqr05ieBkX8hQpEmrrJ8CAN0PZnihMx+uieZInehIAwI5GZJ4ko0cKVvivV+BK0m9LY62HhpdkYlt7ywLvhx0oLxC5tOtZxJNMYrRABAMGiVH+NdWUJ0b8VxezOhV6a0S9G/eQ1xfeOgaTgEuFd07wZG7MMtG2CT1lexICWP/htxDgBxo6UZWJop7LLpKMxFyRs23+4GqfkwYkh9IZQQunlfpK7zPWEfwCPu7lrK56N6sPJIqSXqW+31kqkE/ep5yg8X9iXbJ/b8Rh5EqHhP9GDF2wZlJ4ZYW84SFpfyENm3fK0iRSMNl2n/qotuPgNCuCmUsQIpAdb7xBknCQS4whGmHrnzcSMi/An37H7LFySlSo78At3V75NmJhVXxj8T12/C8PkeoZX60PwVcQWryk8IhkfP431qABOyH2ipa3QLMIyLeAbatH+RbaJkJeXW+vcMGOfs15+QTyBLsaCu9SPMs0ex6iefDFl7Ts7LBEW1Xsobaf3HnDJzNx8jaKwC1+22bMahwLlO0oLzjDXaJJA9CAE24uZKoO6SBTJ4bIr9uGVWdS6q4/SoiE7rntwTE5uLBA= X-Forefront-PRVS: 0214EB3F68 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR12MB0251; 23:a8nQbbs8oLwLnTRNm11eJJGeYNicfWPMCmvinDE0m?= =?us-ascii?Q?uTPH76+xFOBTuzXiHxRTgnhx10ImD+Ok3jqPL7SPAy8rN4NtoBOglktF1GkU?= =?us-ascii?Q?cHup3vt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ticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0251; 7:2ckYSvQAYWEorN4qN5ve+lU6+ExlXfU1pCxODBZKJd81xaRVXkNkKPavk6SllAVa+nF/+Lk2ifaFvfY2Oy61aQDSCwFi90k9NRuan2Hx6YtzlCNjdAUX4UxqS9F+5o2subCE+vxo+hOXFO7mSLmbHIt4ViUSohlgksQE6hwxncnj2T4VJaOlvTvqEqFgIrl7S7bYgLDZ0zjd/+qpS+/GRaAJ0OX5CjCl2aA3Vrl43eAKdDRyV4VFdkJzd1eVr13q3i78R4xSchu4CF60CLBseuH8XNp4yyPpCJaVfZSvArGJFsMVSoimxQ2ar0AfGxYxEzb+NYGVbsFJ4L5VGXmrhkvmDgFQyKgTPHSLtSZ2yGc1OAOgrKiauFtNUbt3acREmwJ6MqJdSRie+gNs3hHv1p+eaal6t6pEakJ/QaevkiukxD/3B2DvTTJ0fhjhgnnN5fSc4C/p+X8uzksAlXeFCTNnyudeCw7kCxOKVnXjJZYMb4BEwGbMWsyw4xf4vwVRD6cxPOzpTKxMps+THXoF+g==; 20:JrlNJbgG7Gs9KMwsfwrnSuc+OBDUNhWpRkc5ZF1LOjUNs4O8gNi4NZlk8QwQY1MVghlOhYuYXX+Rpc5PW8H1K0IP72F8UyBoX04+mpvWTlvfKxeBGZ9wqSHfR5RepskBnxantg6pCArbEIXgU/ktuyRiEmjiQgjCzVeY690luchlmt11phwWOgpsZbxg5EhT4DJXsOnlWpSdvQP0n4rqkzv/9OFT0VZ6lOHS28B9I6XGaJf6fw6K3LJE4Mx6Tk0L X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2017 16:26:55.0696 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0251 Cc: dri-devel@lists.freedesktop.org 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 This reverts commit cb341a319f7e66f879d69af929c3dadfc1a8f31e. --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 136 ++++++---------------------- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 15 --- 2 files changed, 28 insertions(+), 123 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index a6000ce6ff43..7bcc65b0c76d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -138,52 +138,10 @@ static void amdgpu_unpin_work_func(struct work_struct *__work) kfree(work); } - -static void amdgpu_flip_work_cleanup(struct amdgpu_flip_work *work) -{ - int i; - - amdgpu_bo_unref(&work->old_abo); - dma_fence_put(work->excl); - for (i = 0; i < work->shared_count; ++i) - dma_fence_put(work->shared[i]); - kfree(work->shared); - kfree(work); -} - -static void amdgpu_flip_cleanup_unreserve(struct amdgpu_flip_work *work, - struct amdgpu_bo *new_abo) -{ - amdgpu_bo_unreserve(new_abo); - amdgpu_flip_work_cleanup(work); -} - -static void amdgpu_flip_cleanup_unpin(struct amdgpu_flip_work *work, - struct amdgpu_bo *new_abo) -{ - if (unlikely(amdgpu_bo_unpin(new_abo) != 0)) - DRM_ERROR("failed to unpin new abo in error path\n"); - amdgpu_flip_cleanup_unreserve(work, new_abo); -} - -void amdgpu_crtc_cleanup_flip_ctx(struct amdgpu_flip_work *work, - struct amdgpu_bo *new_abo) -{ - if (unlikely(amdgpu_bo_reserve(new_abo, false) != 0)) { - DRM_ERROR("failed to reserve new abo in error path\n"); - amdgpu_flip_work_cleanup(work); - return; - } - amdgpu_flip_cleanup_unpin(work, new_abo); -} - -int amdgpu_crtc_prepare_flip(struct drm_crtc *crtc, - struct drm_framebuffer *fb, - struct drm_pending_vblank_event *event, - uint32_t page_flip_flags, - uint32_t target, - struct amdgpu_flip_work **work_p, - struct amdgpu_bo **new_abo_p) +int amdgpu_crtc_page_flip_target(struct drm_crtc *crtc, + struct drm_framebuffer *fb, + struct drm_pending_vblank_event *event, + uint32_t page_flip_flags, uint32_t target) { struct drm_device *dev = crtc->dev; struct amdgpu_device *adev = dev->dev_private; @@ -196,7 +154,7 @@ int amdgpu_crtc_prepare_flip(struct drm_crtc *crtc, unsigned long flags; u64 tiling_flags; u64 base; - int r; + int i, r; work = kzalloc(sizeof *work, GFP_KERNEL); if (work == NULL) @@ -257,79 +215,41 @@ int amdgpu_crtc_prepare_flip(struct drm_crtc *crtc, spin_unlock_irqrestore(&crtc->dev->event_lock, flags); r = -EBUSY; goto pflip_cleanup; - } - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); - - *work_p = work; - *new_abo_p = new_abo; - - return 0; - -pflip_cleanup: - amdgpu_crtc_cleanup_flip_ctx(work, new_abo); - return r; - -unpin: - amdgpu_flip_cleanup_unpin(work, new_abo); - return r; - -unreserve: - amdgpu_flip_cleanup_unreserve(work, new_abo); - return r; -cleanup: - amdgpu_flip_work_cleanup(work); - return r; - -} - -void amdgpu_crtc_submit_flip(struct drm_crtc *crtc, - struct drm_framebuffer *fb, - struct amdgpu_flip_work *work, - struct amdgpu_bo *new_abo) -{ - unsigned long flags; - struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - - spin_lock_irqsave(&crtc->dev->event_lock, flags); amdgpu_crtc->pflip_status = AMDGPU_FLIP_PENDING; amdgpu_crtc->pflip_works = work; + + DRM_DEBUG_DRIVER("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_PENDING, work: %p,\n", + amdgpu_crtc->crtc_id, amdgpu_crtc, work); /* update crtc fb */ crtc->primary->fb = fb; spin_unlock_irqrestore(&crtc->dev->event_lock, flags); - - DRM_DEBUG_DRIVER( - "crtc:%d[%p], pflip_stat:AMDGPU_FLIP_PENDING, work: %p,\n", - amdgpu_crtc->crtc_id, amdgpu_crtc, work); - amdgpu_flip_work_func(&work->flip_work.work); -} - -int amdgpu_crtc_page_flip_target(struct drm_crtc *crtc, - struct drm_framebuffer *fb, - struct drm_pending_vblank_event *event, - uint32_t page_flip_flags, - uint32_t target) -{ - struct amdgpu_bo *new_abo; - struct amdgpu_flip_work *work; - int r; + return 0; - r = amdgpu_crtc_prepare_flip(crtc, - fb, - event, - page_flip_flags, - target, - &work, - &new_abo); - if (r) - return r; +pflip_cleanup: + if (unlikely(amdgpu_bo_reserve(new_abo, false) != 0)) { + DRM_ERROR("failed to reserve new abo in error path\n"); + goto cleanup; + } +unpin: + if (unlikely(amdgpu_bo_unpin(new_abo) != 0)) { + DRM_ERROR("failed to unpin new abo in error path\n"); + } +unreserve: + amdgpu_bo_unreserve(new_abo); - amdgpu_crtc_submit_flip(crtc, fb, work, new_abo); +cleanup: + amdgpu_bo_unref(&work->old_abo); + dma_fence_put(work->excl); + for (i = 0; i < work->shared_count; ++i) + dma_fence_put(work->shared[i]); + kfree(work->shared); + kfree(work); - return 0; + return r; } int amdgpu_crtc_set_config(struct drm_mode_set *set) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h index 1e77136d6f0c..80f062099087 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h @@ -682,21 +682,6 @@ int amdgpu_crtc_page_flip_target(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event, uint32_t page_flip_flags, uint32_t target); -void amdgpu_crtc_cleanup_flip_ctx(struct amdgpu_flip_work *work, - struct amdgpu_bo *new_abo); -int amdgpu_crtc_prepare_flip(struct drm_crtc *crtc, - struct drm_framebuffer *fb, - struct drm_pending_vblank_event *event, - uint32_t page_flip_flags, - uint32_t target, - struct amdgpu_flip_work **work, - struct amdgpu_bo **new_abo); - -void amdgpu_crtc_submit_flip(struct drm_crtc *crtc, - struct drm_framebuffer *fb, - struct amdgpu_flip_work *work, - struct amdgpu_bo *new_abo); - extern const struct drm_mode_config_funcs amdgpu_mode_funcs; #endif