From patchwork Thu Jan 19 04:57:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9525169 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 05B5160113 for ; Thu, 19 Jan 2017 04:57:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFE5D2864C for ; Thu, 19 Jan 2017 04:57:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E468628657; Thu, 19 Jan 2017 04:57:31 +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 C62452864C for ; Thu, 19 Jan 2017 04:57:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E4206E38D; Thu, 19 Jan 2017 04:57:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0054.outbound.protection.outlook.com [104.47.41.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id A0EF86E38D for ; Thu, 19 Jan 2017 04:57:27 +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=su1124HR7PKtUx3zGJoA2OtMF6pCCzqiWF++83bLLhM=; b=wk4reY0273pz5y1jfVPV2ngL35T2zWGhOwuh7lsFt2fpGBGta2v23SPIjKFfYEE+ND39OqU7qVLvM8t5Ti5QFaV7LwPVUcjSR2up4DoIRLoPvM+aHYIfBZp3LCbOCp+YTOM8btQQYfJWJT163MrA/RXvO8llvyMej6kyGSnFse0= Received: from BN6PR12CA0019.namprd12.prod.outlook.com (10.168.222.29) by SN1PR12MB0223.namprd12.prod.outlook.com (10.162.3.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Thu, 19 Jan 2017 04:57:25 +0000 Received: from CO1NAM03FT060.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::200) by BN6PR12CA0019.outlook.office365.com (2603:10b6:404:12::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Thu, 19 Jan 2017 04:57:24 +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 SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT060.mail.protection.outlook.com (10.152.81.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Thu, 19 Jan 2017 04:57:23 +0000 Received: from SCYBEXDAG01.amd.com (10.34.11.11) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 18 Jan 2017 22:57:22 -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; Thu, 19 Jan 2017 12:57:18 +0800 From: Andrey Grodzovsky To: Subject: [PATCH v3 2/3] drm/amd/display: Switch to using atomic_helper for flip. Date: Wed, 18 Jan 2017 23:57:17 -0500 Message-ID: <1484801837-8214-1-git-send-email-Andrey.Grodzovsky@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <79d1c845-3586-4641-ad06-73af32ab66e5@daenzer.net> References: <79d1c845-3586-4641-ad06-73af32ab66e5@daenzer.net> 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)(39860400002)(39840400002)(39450400003)(39410400002)(39850400002)(2980300002)(428002)(189002)(199003)(356003)(305945005)(36756003)(50466002)(8936002)(76176999)(53936002)(47776003)(48376002)(50226002)(8676002)(2906002)(101416001)(68736007)(81166006)(4326007)(106466001)(5003940100001)(81156014)(2351001)(50986999)(105586002)(53416004)(77096006)(92566002)(54906002)(2950100002)(38730400001)(575784001)(5660300001)(6916009)(110136003)(189998001)(626004)(97736004)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0223; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT060; 1:k7VaYcQJ3RXpRmB5wEUqHq3dUM7USqIgqVa0TgEIMuPX7ESmdWwFIB4oZsrnFYnFS3jnFW0lfEWZjty1gKTJdc2jLhQ2ZWT391G1hSPhSJ90Avn17PafkMfQ7wVUQuy+8NPqQQv7IzWCxwrLJMEvuY2Iptv/OJ9EdwyS4Zwzg4WcezBGDoCbPTqPI3jOALx24UaqPpvbVD8Od4P9xn0EE9edejYijn81paQuEMCqvGikTzPw0ZrE5aTlobk46JERW6LzPVjCfOMqdFvcZbIKzChbVIvDKwyqqisnBGcDvoR38x9F2CZ+qmESMXkxyoRppNl378+Dlczto+f0LYHniUrhIXSbkn9M+HwELXQtKJVi8bCkGQum9KTykBtXwHUTZTZW2s6eQ3SWBM8FR870m5RrGxYiLvNEw5oolJYfJ4Vr0CqlGigEEJjy5dUxjd76Ncy/aGdT50DrpK9Qep41/c+i2/VDDBL5bK+fyJ92HmANFPVq8ENcTpuxZC1Zz5cg X-MS-Office365-Filtering-Correlation-Id: 06e8ac04-976b-4f8b-7be4-08d44027a858 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:SN1PR12MB0223; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0223; 3:qQzupmffc74LrSffo1RTVsrupl7xDR4jRFnoU4qXjxnEq3YkT0KT+oBtTRww+nfImCWgUwS2xqXnZMXGa4KAhpKcv6FaGuIqJMNDnd4GQmJhluLAKnUcy4BbFMNYoPBpSyPlxD+YwCoqPj4dX7CLY7AchkC9MxVPjeTYLSameLAy0j+/UJm5s0FMIDfBiqFlz7hO1jM3s8ZkFP6Mm+3FkhMV8aEpTm9Lz60l2HrNVzNv5QfeAcBBSVAIKBFG1lwlc8eeLlE+toOKZ1ijk5aYk1kRUKPOvJt+6hpAMmryAi0ZXbiK2MuU9rsHZHIw8UiBhohTwHEHb1+4GlfAj8o26T53zHjGdRcatKXI92SxbIzP6ngW38V0cG3pOEgGxiq8; 25:NG/c/ddi+QS1Ig+RrC+2HwQ0r+zOFcaOOXq+sjGYWAUN72FcI/rByRCCM2D/3YmLsCY0ZM1Sw6YMW/WJ8yCnBhin/bVnToCPYx6YifW6lLH56vmRBR+W+VkuC6Tm/QYPocEML3XEEl/2WnZ/wFTQy1te7y3JGp+++Bi+f6nH74/eLYkn0nFYxMxm7zUEFAvyWWv+EBXalxiF4jF/L09x3Spj4Sryv50BINN4lq2Td7Xq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mZZeI3ax+ 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)(13016025)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:SN1PR12MB0223; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0223; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0223; 4:F4J9ulbuh2AEjQBtaLx70s+v3OzKGiWv7tyQSg88C66At5+/cCwP4X/gpim3iENqUtUHQ7TNoFf7Bb83P1cQwQXDBRHkttnei6OHPr4DqsHbWqhMHcR1dEiQWT6DOCasjT5MLQT4lEVmP0d7oNCt3rs7gwIf1evsPhmQg5GFCzkfO5Xk+PSrmVbVV5ILuOy4pb6x19Krl65GUIekfi6s9NQytLlvwDpWLSsomum96At8WpbHw9SNCWcJ5wPRu6Cy7wYxRATWTUc1/NXpLjFBtcD1pALztRF6zSil9aKSH0jMQ0bhhN+5IRIkFVa0DERbwHiuSqB0nDNe+OYwV2js9Q4MhuJu7t+vtLDOVNl3dzyHcwJrn7TCzlxTt0BKhoi5z+GpRob5kcpXxacNzquvQNW7S/ZzJhgXr6CM5TlKqfgNyxUob3GnGCipDganeYLlHHWwIms+YKsceR9NrkSbgZGaDTrM9vJt52mPw12y2kMtnMbOT3FBUizYQsZkJ33OOU3mjjnXcmdDqIl5XzHZazmNaJCd2EfEfRGE3vdopok3TF2wtQ4QTwvVT6Ax4hXcHV6LAJmi8vitwgCtF1pfH5qRa6wtdCswDcUZcEfIE+G89sfb72vWKjbRbNy22I2L5WVnnO3lpcTzXirMjcJLpF36ucO0x8bMM9yLPQyTCSU= X-Forefront-PRVS: 0192E812EC X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0223; 23:s0W5XPhTyHlEltD158ZFjyNBLq81pLTnJuU60je4y?= =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uOtbn9ZAb2NAESYmpGekxQ9qgVzq2GcyiOWevttNFKD2PYBiCF7FicI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0223; 7:UZj42Op4A98XG0L0FVCQ/+0Pwy4jHZspuZb+rYYX33gALCLB44kmD3gpvAO5xn166KXJxAc3WGxVwwOIi1HwqlV19M0eK41utXcUYuGJokXH2pJ0LxIbu0uU65POYVLXabY/IAJuprPk8mTofMqogVNNujGvlbaDuEqhbcPRp0/kHjrycx1HCzVTxQdT97xU07EtzVn0g5CH9u1oys1sHKvRQKDL1MfF9QxovAxiDn6rWgS3vxGIBmBVPoVZlu/GJgHZhBQ9Pmegqcp3lNLko99agjkMMe4or9cPCaEUnkHR6fd+GjLvFq3FYm57jJHT9mB2GebZyamgndV9aGub5iI93IL65ZEVrGIX5hduJkg1/DRAcD19pEo9mhpVqbzGv6O0udQ/xF9B2z4d0B31OKTQeaX1iOGnyHeU0Rq4t2B80WUbAcDIQOJSZzblBmgREtxlg+HSNcZlPl/79rrhnw==; 20:r26CXjkiFXoQLT95kgxnpOBFSRMlVjXosa2gs1daaAY6NIP96BVZNuWIMnHXFPTQd5XGcJTRou0VgfBZqY8wjO68nBzoVgiYoaVjA1/oFJcg/6NEKiiawQKbDdBRNRQND9UZIR1JY0srKfdx/Gj+YR2IYYs1oaeDJtVAl5XqavqgDAptvJdf9OJ7/DMqhYbJlos24kU6F0vYeOAAq65WrKPmg758v8/93LG4rYp81vliV8jtw/byaImAbq4TICif X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2017 04:57:23.5387 (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: SN1PR12MB0223 Cc: dc_upstream@amd.com, nouveau@lists.freedesktop.org, michel@daenzer.net, 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 v3: Remove white space change. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 - .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 89 ++-------------------- 2 files changed, 5 insertions(+), 85 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..70e01ad 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 @@ -1679,7 +1602,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 (new_state->pflip_flags & DRM_MODE_PAGE_FLIP_ASYNC) page_flip_required = true; } return page_flip_required; @@ -2760,7 +2683,6 @@ 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; if (!fb || !crtc || !crtc->state->planes_changed || @@ -2771,10 +2693,9 @@ int amdgpu_dm_atomic_commit( 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; + plane_state->pflip_flags, + crtc->state->target_vblank); + if (ret) break; }