From patchwork Thu Feb 2 21:56:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9553275 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 7A86E60424 for ; Thu, 2 Feb 2017 21:57:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AA4128437 for ; Thu, 2 Feb 2017 21:57:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F2D9284BC; Thu, 2 Feb 2017 21:57: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.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 CE9F128437 for ; Thu, 2 Feb 2017 21:57:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A34A6EAE2; Thu, 2 Feb 2017 21:56:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0087.outbound.protection.outlook.com [104.47.40.87]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0487C89F77; Thu, 2 Feb 2017 21:56:56 +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=sxxCxr03hYpeTktswGrZjrnUuJHjbc6rPd89bNaEIBU=; b=s5w849xfuqsvAk7mUfDye9Y6U20l7Y3u1CP5Qon++BwpOqMnUDYdn5nRlF6P4htfstgHasFjNK3QQ3fdP7KfS24RMKHUAfGvGWW5sPDKGpb8UG09BvBQB9jdLIQ3gQJOQ5zud+Iw/YuOAG9wXCZNbCec0v727RP5BYXmQfrv/xk= Received: from CY1PR12CA0004.namprd12.prod.outlook.com (10.160.137.14) by MWHPR12MB1199.namprd12.prod.outlook.com (10.169.204.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Thu, 2 Feb 2017 21:56:53 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::200) by CY1PR12CA0004.outlook.office365.com (2a01:111:e400:4c1f::14) 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; Thu, 2 Feb 2017 21:56:53 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.7 via Frontend Transport; Thu, 2 Feb 2017 21:56:52 +0000 Received: from SCYBEXDAG01.amd.com (10.34.11.11) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 2 Feb 2017 15:56:51 -0600 Received: from agrodzovsky-All-Series.amd.com (172.29.227.109) by SCYBEXDAG01.amd.com (10.34.11.11) with Microsoft SMTP Server id 14.3.319.2; Fri, 3 Feb 2017 05:56:47 +0800 From: Andrey Grodzovsky To: Subject: [PATCH v5 3/3] drm/amd/display: Switch to using atomic_helper for flip. Date: Thu, 2 Feb 2017 16:56:31 -0500 Message-ID: <1486072591-3893-4-git-send-email-Andrey.Grodzovsky@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486072591-3893-1-git-send-email-Andrey.Grodzovsky@amd.com> References: <1486072591-3893-1-git-send-email-Andrey.Grodzovsky@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)(979002)(6009001)(7916002)(39850400002)(39860400002)(39410400002)(39840400002)(39450400003)(2980300002)(428002)(189002)(199003)(106466001)(105586002)(86362001)(2351001)(54906002)(4326007)(92566002)(50986999)(76176999)(36756003)(47776003)(5660300001)(2950100002)(110136003)(6916009)(50466002)(626004)(6666003)(81156014)(8676002)(189998001)(575784001)(101416001)(53416004)(97736004)(53936002)(305945005)(5003940100001)(48376002)(356003)(50226002)(38730400001)(77096006)(68736007)(81166006)(2906002)(8936002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1199; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT017; 1:kzG9QdS9XPuTm/Q/t0bwpZvhDQ8fnA7rH08FME929fVyOKXH4amp2W8+99Zh2tOYojS7IEPg4L3imsMC6nLEbBGfmH8+doMzGxKMtrCsRB3ybVLA7bjEPY91hwoKZi4bj+Rqj9wOfwmfUBP2EhwGSE1TJ3hPcrUed44paW/SaViNoIr2NYYFNgBecaZZ0YIPlGAmlT17Qc0ZpDIm7PLr5GlQ8d1kuvFQ/ZnsBd44WeIQqZQuE2PLu11fxR60XkC/8KvB1U8LKgLySRWrJpLoFkQZB3Q1MKH6pTfHSmUWDFVs100rD+cdH5mTXtRklCytI0uzmE4h8LYkNDblZ/4HYRDdsSCoUJJlVI0xv/FwRixtALYLDgaT6KGeM/2rYtUfPGnP0ZTmEy3DGND6uMb9x3dz+0/kXkzK/UbYUvZj3Q3wCBRGETH762h94W0npPaWuDz5bmQfqoSu20qrhfsoZ/zEQVpUagTcKqJ7uFXyqtjFFSp4hPtsdykdPjHy9pR5 X-MS-Office365-Filtering-Correlation-Id: 462396b5-06f9-408f-f562-08d44bb665e6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR12MB1199; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1199; 3:BPvc8XWrlqkX5zyzzaJTnuEuqPI06jykn697zqpccxF40/RsrQPMP7TxeDX+ECl5SwW/yZjdLn9ec55nwApjFquALRKcOjlp5nzIj820R5AsZc1J8K8DdIFdTGWliHEfZC9fugjaUWaIm+lL6wQDHJP3xbu2Gh6fiZMkFRme7j0w0wHePLEt1Z5wrygoYp3INOejuaa/VKACNI+KZSBKP1O9C7E7Yrt22yNhA4j+mKa4XcNI74DPLKwB87szZtEFhW05YwWcPS28l55olrGAq0HKw9DGiP+1jGr9hwskWEcyElmPd5ykP+r8htelymKypZbFc5YNDBqsmzwSQbQqX18KtMKgSuQzweeQKw+zYpjl+JOWbS0miUgmzlu9Zjl3; 25:b8rpp8NixbXxtPjXZ88ygavFfqrx72wRI8QOQ9Oh+r4LISX8VelLhVBHp9uLTbsOuK+zNjS0MUfTkg7LJLFD252Vajcvtw7clnPwujP+fz38YzYR+jIMnKbqUjZPf3LMQqzlgdniHGtXEtNskZtoTZxK+P6H1Uz+32MEezErk5sN+VSsv5WSnwy/m3IbPn9ciHa/Ao2CbSzc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eAggMrSZ8xoyGI8Sj+3sOgLp+ym3koAAhtnRRimFt92TMYWdJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123558025)(20161123560025)(20161123562025)(20161123555025)(6072148); SRVR:MWHPR12MB1199; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1199; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1199; 4:3/8yRsAvXzeNuAyfgRpFkjZPn59UF6fSQVoJr3ROFV5bM22agcrBxHasDv/rmiMN3/+gw0n5PVwvyuYYrF07z7eZFgKjJrPJw/57UQSCygx82JINfMB6nDqzfQHVh37Ryj/pt0M92AmJX5YJKXsw+yeYIDPGEu3ax9tf7TdmqftlhGdWikio5ZlmDDway1P1nd7g92K74IVCTiEr1Zo7f0I8bV/BbxhAve6kNnNxEaatbPJlYGyQzWHDRqQTSE871VWjc4EcSEyEPTj0fSKsJ8EQrmyplaa/wsK+2yEidiGERybM84F1MSdZtBtZgPTqVStZ5EXTP6OeYMDTf3J4DovPJ8qyUIJe/MAdgVr6Pt/pnrEn0OMJf75y7nuy7bpIfBS2Q+HPXJDMCH+idQStyG6XTdbRfC88YkelgHj66uekrCjeTOkXkNbfRPKJU5QdI2C3KSVNv1lmLZ4DglmJibo16XwQboNkSYSFJ9UYY/64REpwqB1juKDZfuBwiQ9369M4UwgxXVFpCus/IY/Gk6RU1+qQgj1qWgxEhJS4pzKVlSUazRp3nvvn/26KQQVyW3O/ncJk0VP3i5UGq0NFY05KopZVtxVUcweqIBh2DZtNSr7vI5HUu3Kj1yvphyrmyZ6m67ir806NL8xlXtO2mXSVKubNqgH7+y77tdYnQkanRZRWSRGZpZJBkFSY9qK62R8k9eWHv1xT4DDB7OUEZQ== X-Forefront-PRVS: 02065A9E77 X-Micro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J X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2017 21:56:52.9504 (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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1199 Cc: dc_upstream@amd.com, nouveau@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, laurent.pinchart@ideasonboard.com, Alexander.Deucher@amd.com, daniel.vetter@intel.com 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 v2: Modify for movig pflip flags to crtc_state v4: Fix identation. v5: Rename field to pageflip_flags. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 - .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 113 +++++---------------- 2 files changed, 24 insertions(+), 90 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h index 4c0a86e..3ff3c14 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h @@ -443,7 +443,6 @@ struct amdgpu_crtc { enum amdgpu_interrupt_state vsync_timer_enabled; int otg_inst; - uint32_t flip_flags; /* After Set Mode target will be non-NULL */ struct dc_target *target; }; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c index a443b70..81c46d6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c @@ -1060,83 +1060,6 @@ static int dm_crtc_funcs_atomic_set_property( return 0; } - -static int amdgpu_atomic_helper_page_flip(struct drm_crtc *crtc, - struct drm_framebuffer *fb, - struct drm_pending_vblank_event *event, - uint32_t flags) -{ - struct drm_plane *plane = crtc->primary; - struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); - struct drm_atomic_state *state; - struct drm_plane_state *plane_state; - struct drm_crtc_state *crtc_state; - int ret = 0; - - state = drm_atomic_state_alloc(plane->dev); - if (!state) - return -ENOMEM; - - ret = drm_crtc_vblank_get(crtc); - if (ret) - return ret; - - state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); -retry: - crtc_state = drm_atomic_get_crtc_state(state, crtc); - if (IS_ERR(crtc_state)) { - ret = PTR_ERR(crtc_state); - goto fail; - } - crtc_state->event = event; - - plane_state = drm_atomic_get_plane_state(state, plane); - if (IS_ERR(plane_state)) { - ret = PTR_ERR(plane_state); - goto fail; - } - - ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); - if (ret != 0) - goto fail; - drm_atomic_set_fb_for_plane(plane_state, fb); - - /* Make sure we don't accidentally do a full modeset. */ - state->allow_modeset = false; - if (!crtc_state->active) { - DRM_DEBUG_ATOMIC("[CRTC:%d] disabled, rejecting legacy flip\n", - crtc->base.id); - ret = -EINVAL; - goto fail; - } - acrtc->flip_flags = flags; - - ret = drm_atomic_nonblocking_commit(state); - -fail: - if (ret == -EDEADLK) - goto backoff; - - if (ret) - drm_crtc_vblank_put(crtc); - - drm_atomic_state_put(state); - - return ret; -backoff: - drm_atomic_state_clear(state); - drm_atomic_legacy_backoff(state); - - /* - * Someone might have exchanged the framebuffer while we dropped locks - * in the backoff code. We need to fix up the fb refcount tracking the - * core does for us. - */ - plane->old_fb = plane->fb; - - goto retry; -} - /* Implemented only the options currently availible for the driver */ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { .reset = drm_atomic_helper_crtc_reset, @@ -1145,7 +1068,7 @@ static int amdgpu_atomic_helper_page_flip(struct drm_crtc *crtc, .destroy = amdgpu_dm_crtc_destroy, .gamma_set = amdgpu_dm_atomic_crtc_gamma_set, .set_config = drm_atomic_helper_set_config, - .page_flip = amdgpu_atomic_helper_page_flip, + .page_flip_target = drm_atomic_helper_page_flip_target, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, .atomic_set_property = dm_crtc_funcs_atomic_set_property @@ -1626,7 +1549,8 @@ static void clear_unrelated_fields(struct drm_plane_state *state) static bool page_flip_needed( const struct drm_plane_state *new_state, const struct drm_plane_state *old_state, - bool commit_surface_required) + bool commit_surface_required, + uint32_t pflip_flags) { struct drm_plane_state old_state_tmp; struct drm_plane_state new_state_tmp; @@ -1679,7 +1603,7 @@ static bool page_flip_needed( sizeof(old_state_tmp)) == 0 ? true:false; if (new_state->crtc && page_flip_required == false) { acrtc_new = to_amdgpu_crtc(new_state->crtc); - if (acrtc_new->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) + if (pflip_flags & DRM_MODE_PAGE_FLIP_ASYNC) page_flip_required = true; } return page_flip_required; @@ -2696,7 +2620,11 @@ int amdgpu_dm_atomic_commit( * 1. This commit is not a page flip. * 2. This commit is a page flip, and targets are created. */ - if (!page_flip_needed(plane_state, old_plane_state, true) || + if (!page_flip_needed(plane_state, + old_plane_state, + true, + crtc->state->pageflip_flags) + || action == DM_COMMIT_ACTION_DPMS_ON || action == DM_COMMIT_ACTION_SET) { list_for_each_entry(connector, @@ -2760,21 +2688,24 @@ int amdgpu_dm_atomic_commit( for_each_plane_in_state(state, plane, old_plane_state, i) { struct drm_plane_state *plane_state = plane->state; struct drm_crtc *crtc = plane_state->crtc; - struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); struct drm_framebuffer *fb = plane_state->fb; + uint32_t pflip_flags; if (!fb || !crtc || !crtc->state->planes_changed || !crtc->state->active) continue; - if (page_flip_needed(plane_state, old_plane_state, false)) { + pflip_flags = crtc->state->pageflip_flags; + if (page_flip_needed(plane_state, + old_plane_state, + false, + pflip_flags)) { ret = amdgpu_crtc_page_flip_target(crtc, fb, crtc->state->event, - acrtc->flip_flags, - drm_crtc_vblank_count(crtc)); - /*clean up the flags for next usage*/ - acrtc->flip_flags = 0; + crtc->state->pageflip_flags, + crtc->state->target_vblank); + if (ret) break; } @@ -3138,13 +3069,17 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, continue; action = get_dm_commit_action(crtc->state); + crtc_state = drm_atomic_get_existing_crtc_state(state, crtc); /* Surfaces are created under two scenarios: * 1. This commit is not a page flip. * 2. This commit is a page flip, and targets are created. */ - if (!page_flip_needed(plane_state, old_plane_state, - true) || + if (!page_flip_needed(plane_state, + old_plane_state, + true, + crtc_state->pageflip_flags) + || action == DM_COMMIT_ACTION_DPMS_ON || action == DM_COMMIT_ACTION_SET) { struct dc_surface *surface;