From patchwork Tue Jan 17 05:16:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9519981 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 47C636043D for ; Tue, 17 Jan 2017 05:18:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37DBC284DD for ; Tue, 17 Jan 2017 05:18:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29496284E9; Tue, 17 Jan 2017 05:18:30 +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 BB80F284DD for ; Tue, 17 Jan 2017 05:18:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CDB166E5E5; Tue, 17 Jan 2017 05:18:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 3563 seconds by postgrey-1.35 at gabe; Tue, 17 Jan 2017 05:18:26 UTC Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0083.outbound.protection.outlook.com [104.47.36.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id C27AC6E5DC; Tue, 17 Jan 2017 05:18:26 +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=3ITjPBRqj+FccPnKtwK1Eq1S6U+YzTVO7ULy9E90vF0=; b=gDbO+rS4/iufkbv2fYW79KosAFusHGox0DtrznaZvfm8yPtsdBybdno684nqBNxEiohsVcIHRAQz4IBwiXjc5sCT7gZWG5Cnajpqnq+hFk5hZjw1RNw5QUYFE5QBYL6lLvHwesc8t/MBn6RgDvTwNN/zu7GJIEtBiyym/Rlwyrw= Received: from SN1PR12CA0020.namprd12.prod.outlook.com (10.162.96.158) by CY1PR12MB0074.namprd12.prod.outlook.com (10.160.159.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Tue, 17 Jan 2017 05:18:24 +0000 Received: from DM3NAM03FT026.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::206) by SN1PR12CA0020.outlook.office365.com (2a01:111:e400:5174::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12 via Frontend Transport; Tue, 17 Jan 2017 05:18:23 +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 DM3NAM03FT026.mail.protection.outlook.com (10.152.82.185) 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; Tue, 17 Jan 2017 05:18:23 +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; Mon, 16 Jan 2017 23:18:20 -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; Tue, 17 Jan 2017 13:18:05 +0800 From: Andrey Grodzovsky To: Subject: [PATCH v2 3/3] drm/nouveau/kms/nv50: Switch to using atomic helper for flip. Date: Tue, 17 Jan 2017 00:16:47 -0500 Message-ID: <1484630207-27366-4-git-send-email-Andrey.Grodzovsky@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484630207-27366-1-git-send-email-Andrey.Grodzovsky@amd.com> References: <1484630207-27366-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)(6009001)(7916002)(39450400003)(39850400002)(39840400002)(39410400002)(39860400002)(2980300002)(428002)(189002)(199003)(5003940100001)(53416004)(2906002)(4326007)(626004)(97736004)(86362001)(575784001)(50226002)(76176999)(50986999)(81156014)(8676002)(81166006)(8936002)(68736007)(92566002)(36756003)(189998001)(106466001)(101416001)(2351001)(38730400001)(105586002)(77096006)(2950100002)(6666003)(47776003)(6916009)(5660300001)(110136003)(54906002)(50466002)(356003)(305945005)(30001)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0074; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT026; 1:XsLjcTPWdBy7q/9JTTvdvxnpiQME32SGFSP8aBxSenfUndTTLZwvkMdcih60PcjH7JZVw24PcCPguaiOFG1njx5Ha7hjFfxkt44hjj7ac3WyrZm8RvIpH7b9v5ICsBe1Rw5qY4DX+16vGNYLJaJ6VWIEzUDGH3Bjhflhi5k99Jei9XncPToBL/h7HUrHlgGx+MEAvjr6rpb54Eag/oF0jLSzm9a2jHp7Zy4yXZc8EZzlx/+FgPPpfEWbjzodduoYt+iJfNSEIBeMTdepdG8VR39EOMw95jDRW3678G/bHmGmAgnIbLDR5LwtKcGD5d8GeLvwaH4g7y+xym2ywQK/pFO2z4GsbWDE3P/WQuz62Nxz5Do4jrCgRTtCqZhlQucACzjQA8oyFmUObT3gcc+fjyTpzxxpgkdK8p3rcWunvFs0ngU56MKLNdYnud/v/Mq5esygL8ZlOieFVSQO2u5qXlbr01H9idwapBNIrwxZq4opmPcNU5XNpiFyk7rXC1Er X-MS-Office365-Filtering-Correlation-Id: 9ec72a94-2a57-488f-194a-08d43e984277 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR12MB0074; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0074; 3:bWDk1h61kS14oW0sH7XSEajIy4OWMx5sWzmiUcUw64KyMF5gsQL3zIgcIltCRj8tpM2/ZnOqWWLL4zup+yfR/H5ZAuoDT75cZv93YVanfpFOj3EihlOz8vUbV65aSrg48gtJrC1oz4cr+q0ODb6JX1cEtbuIvhDgOP0slqm+TsgfvC/6irufxG7m4W+eOVRpKLf8AR858Kq/ZW6f72rRDUsTjqyVrH/Gshlxx3Xu7vXkWbE1o7A1nl9C1gs4bgEKpAdZmdM+r2pPeefT2kZRT4BmAXZKo1RR+65awCx5EgOUSuhR66VB765U+yfkNezRFoq3dx2Nm0rpOFB71i7KYZzr08HUoIrrKRPhXgwoFGJ6y5hACcanGmOsJGtRDW+i X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0074; 25:RccJcYrOSg+6igeH6aJ9YBH9VXfmK7UO2lIbeVOfiZG2qB+7JKUhcujUWGhjWKKvhevQju3tin+8i6q+IStJ2/4/Ire8PCfbiy00PZQu3uh2G0PsZ4hqrGxYBAwLBPamdm+743ogY19374Roue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OGKp6cbOTGVY79EXfXxkIUXencBa45nxkfSEt6sWM+Ccvwu51Hj56/ep98Oo/GS4+7ESbKtvR97jqrEpP2MaZhJj+WvqlSbnsuduKseVQEs2Y3mPXHrNdNp02uwKQRKdcKjrjGsOO/EA9vwsMV78lCVyQ7x7JVT/Ct+Bz2/l67hvWMs5d/qp6g9w3t2EBy8r3CiOF7Yh2jeTlZOzYQmSUwdOZclx+18dOo/zeNhMugjlNz9pD7fatRU8htibnR6D5QPo8rIxG4AMLHmASrdT+bfNdcKjUOAgN3gefoJkOO+g13Encqt01BwC5CKOC7nZvA21W0rQ7aaKLi1py0HDZnRgzz+o0P2pOQonLGPxU+JNDgMoZWkGBDCubAo4Lty2CAu6rdwEQMoTVz25KjPVDr0wpOjBqTVKpo0UM5oQErcdnleaJazWZA/GiJGMML 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)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR12MB0074; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0074; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0074; 4:pgWywStLZsbqtdmB91JuDtazkRt8lE95CSbUnc3wkL3XQ366G0zsOoK/prNv3IhDzsDqyTJHtI6OtCT0GJiMahhUydIk7Mk1e2YJHe2PkDbtIm3FiOXShwbdEYL+ARu097TegHp8Eku/hb32T3/yZlmrVNTbzKKCKjbKnCcQoEF8VMMcWJkZ1SMjp2tzSCu+bpcFrikkx8uUqmNxra6R/8EkFeexU40I1UQ0PPIDmfOYvhKeItPoqZZYHbugbd5zAurjswZBGPpdboSY4RWkaKHMK1l2iVDL/Wm3cSA1KFDd/HtQZRhPwQR8EpGb9YynscZpBQhHkawXodPwJFoDdsqRfIL8c7ABT90a02LGdxqeK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go39LlXX48v9T5aN8B35qQiV1hslPGjzfT88m3i0ZPbsMKgijZWMtvfEkGSv2EKn4DYAqE6s5cV5Oic3cxd3AZexYcMxU2x1AZx9H1A957ifNfbHMwCjhwkhAcFrdjoY9vgWSrasSkQ147q/TKK33wH8WX/oPpNamT45ifSQAYIohEJDU/5UyK5SqWsVgSpAFegiF3KiRFh/nBTluwliw5upWe X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 05:18:23.4322 (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: CY1PR12MB0074 Cc: 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 Change-Id: I5a3189c03e389af2ff6c13d870a7d28282b7b0ee Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/nouveau/nv50_display.c | 77 +++------------------------------- 1 file changed, 5 insertions(+), 72 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 2c2c645..419e00c 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -846,6 +846,10 @@ struct nv50_wndw_func { asyw->image.w = fb->base.width; asyw->image.h = fb->base.height; asyw->image.kind = (fb->nvbo->tile_flags & 0x0000ff00) >> 8; + + asyw->interval = + asyw->state.pflip_flags & DRM_MODE_PAGE_FLIP_ASYNC ? 0 : 1; + if (asyw->image.kind) { asyw->image.layout = 0; if (drm->device.info.chipset >= 0xc0) @@ -2221,77 +2225,6 @@ struct nv50_base { .atomic_check = nv50_head_atomic_check, }; -/* This is identical to the version in the atomic helpers, except that - * it supports non-vblanked ("async") page flips. - */ -static int -nv50_head_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, - struct drm_pending_vblank_event *event, u32 flags) -{ - struct drm_plane *plane = crtc->primary; - 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; - - 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; - } - - if (flags & DRM_MODE_PAGE_FLIP_ASYNC) - nv50_wndw_atom(plane_state)->interval = 0; - - ret = drm_atomic_nonblocking_commit(state); -fail: - if (ret == -EDEADLK) - goto backoff; - - 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; -} - static int nv50_head_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, uint32_t size) @@ -2386,7 +2319,7 @@ struct nv50_base { .gamma_set = nv50_head_gamma_set, .destroy = nv50_head_destroy, .set_config = drm_atomic_helper_set_config, - .page_flip = nv50_head_page_flip, + .page_flip = drm_atomic_helper_page_flip, .set_property = drm_atomic_helper_crtc_set_property, .atomic_duplicate_state = nv50_head_atomic_duplicate_state, .atomic_destroy_state = nv50_head_atomic_destroy_state,