From patchwork Thu Feb 2 21:56:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9553273 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 AE02F60424 for ; Thu, 2 Feb 2017 21:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DAAD28437 for ; Thu, 2 Feb 2017 21:56:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91B43284BC; Thu, 2 Feb 2017 21:56:50 +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 29D4528437 for ; Thu, 2 Feb 2017 21:56:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4EC716EADE; Thu, 2 Feb 2017 21:56:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0087.outbound.protection.outlook.com [104.47.42.87]) by gabe.freedesktop.org (Postfix) with ESMTPS id 80E5189E36; Thu, 2 Feb 2017 21:56:46 +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=CTQaFJnPRvG+PLoirDJMfdRdUbGp5HigeJ4Ic52hlpo=; b=fMZT9Y5nqPYu9rAVFnWUkD+u/SXySWz34XFefjYdjFjWSV4C76p8q2J0+FM4oG+5IR7Mvz4F+IxrD7/1ZVg+9qZk/8AWexsu/uzToZS774ClAmW3ecRapFcDSmJDt/G8QeX9abN1Mm7hTJt3BBYgCkHT0CWqRtKOi7s8l72r2ug= Received: from DM5PR12CA0008.namprd12.prod.outlook.com (10.172.32.146) by BLUPR12MB0643.namprd12.prod.outlook.com (10.163.217.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Thu, 2 Feb 2017 21:56:44 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::203) by DM5PR12CA0008.outlook.office365.com (2603:10b6:4:1::18) 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:44 +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 BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) 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:43 +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; Thu, 2 Feb 2017 15:56:42 -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:38 +0800 From: Andrey Grodzovsky To: Subject: [PATCH v5 2/3] drm/nouveau/kms/nv50: Switch to using atomic helper for flip. Date: Thu, 2 Feb 2017 16:56:30 -0500 Message-ID: <1486072591-3893-3-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)(6009001)(7916002)(39860400002)(39410400002)(39850400002)(39450400003)(39840400002)(2980300002)(428002)(199003)(189002)(68736007)(101416001)(2351001)(105586002)(86362001)(47776003)(97736004)(53416004)(5003940100001)(106466001)(54906002)(356003)(81166006)(110136003)(4326007)(8936002)(2950100002)(6666003)(50226002)(6916009)(305945005)(8676002)(48376002)(81156014)(189998001)(38730400001)(53936002)(76176999)(50466002)(92566002)(626004)(36756003)(5660300001)(50986999)(2906002)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0643; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT027; 1:p6JHdWITe7KgzB6JKFqNxx08pb79VCCbxgwHfbx3mzvCqvcqgJdKsrpPNGlSOigjXB8bBh/oWq7TXZFi5TgB3SJ3EmM/Eqf8A+zYxI0JhuVhQPqJoGQKE4Eyep+ol8Nl6MfNGJ+8XwnW8QOU8EKJbiTiZfmP327ZUOYCb2Eg8UFa5L+N2AWRyIR+A5OZZjK6pVUFXNxjicgyKoc2Cu5oIpwkNnSWB5/PsDGIX4c0fwz3LdEdmVyvkCbCPXY3larZofeu+ykKQmRO61QK+RCG4WE9Enf52D44AsR23kUuTfVtriDXeHaLGYkO96vsvVjxtC4iNeG5PmICcRH99huRTDDok0pp9MpXVameZuo5x4fMsV6l01h4iLYz/r4XugdUOeyahEO+iBBVQY9ItA6oJGoIHqCqex+sySI0GOssYi+9xP3lfMhKKbzI19RTndeLdQs94Vww8mkzyqnDIU08WRpGA8egkY2ejrP4UKBWmhSrBC++dbGIEhiAUmWJIC/d X-MS-Office365-Filtering-Correlation-Id: aa83252f-2c49-4693-126b-08d44bb6607a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR12MB0643; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0643; 3:74RKj7F0+knKJRFXQ0VLbt7o8l/oVRKB3gZe+rbSACIZJzmCRf9rbJ5yarLNhvVDPqLovuO4pGAb10dMVNj5xpVh5qlnM2uHS2q9CNuKqlunpCB55JD/WDnKmZPYsspH/lqpDEOr3D6IsZvzmWgLoAkXWgE6+9PoVSHJeQR5h5yraW3uAUSjiG+UCnROCDVK2N7GU7lKORBmi/Mwo4dlPpftfMBU1U9Lag6CiWQ6vPg3T3QXxR818ZM1+TmAo2FyZM23CyR5JE9PkhEmSw1khVD2A0gwPxWNzsXq9muDGSbJkZ7kw4a7c2XVq2zHJDfEjPSNPHq1i/OdgTSzWLS6HC1uvwaKh3VyTpVDAKMKlCwzMp8dcwdiTrfaKvQ659ze; 25:24Vlhclf49pFyNL6knCuGO+LnR3KZ8h94XI4cQFuz/nrI7av5y+zAnaQekZBh87RnCC4wU5ZIDKGM6pdPG/s6+67x5igpOCVxMeXOQI4DsP6d3KZBv7uvmrKpW1igT97msyAfzxoLb0DxRwLpkEiZhys41nVXWxNTzvNUe/jKMF1rs6uF7TQMhnpf/GJOwLrvbNLRDnS5M4UXDnOMPn52OoCcdqcalrb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D/Ec5T6 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)(13018025)(13016025)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:BLUPR12MB0643; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0643; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0643; 4:E3qLEq49Om/gfN8HjQFSoDRll1JVhSDwY05Mtkq4czHBlz/Ng2JAdSB/XptxqOmp2hc7PJiHfXMHwHulzNBWkVH5PWVaTnct2xoIQSUy+OC1OBgMJhZiy6xCT4Gh6iut3kBNQr/YT/8i6HM3wu2j4nup3YfqnHaBjZKJCxGo4OBj91rvHNwDw2P20TbD/Fb4Z3NtTMgP+R6NRcrC1VglQ+lrhRCRCaBHUt28H+LW6b6nQbs2BWBkBdkztrVkOqS8wkpElIee/KSDJ501aBXeE2V0eeapyXL19vwf9B9ropu2N1M0nBl204YQACAwtXKj5HzuNtSFq2nhMeU4q1dN1z22M19zw5oZDoX11XaNgqO7AmiojPyEvazBxlTYD9CrLaUScqivZc2wLwLzfmCuXhLMK7gzg19uss8DyicFrIOYeo0mn+rnnLOet3F3ZoqxrGfjmc/D4x33paa9lIr/ADkPPyvKJLUhHnC1jLHnKsg4LXj5LZWdZq+Li36lGB+a8Hsb3pKu00cnJHZ9fL4gKeZ7WI+5vUwvqZ8khLQuPZ8ivrb009qmRfnM/eDXF8o10WG6yTNA3OtqNnXZf7uRfsGpw2NTBY8TqlMFrzA/3/Jz552iCEXqR8HOrH56i9CCJ25y9Yb27MpobL8QGB9Q/XbvylIusHw8jivkY2sMFaixSFRFmtXcKygU+JeGy04RcRM09JP9Ymr635Fj1Cn6mQ== X-Forefront-PRVS: 02065A9E77 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLU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YXbbuim7g1sSZ9u74kafX6sWDMg06DUV5OaqeL4azVBvIlRdyFpY4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0643; 7:pjzHq9VCRC7bkQivSuupaWQfihaVNnfKicO109OC0VSuBzXlPBEdQxdaC3oupuJ2ocafKXvuyhhzl3bkNfQnfuUCsvcAu+zx/Lj6CqAdaIybrOnQcHuG87T4vw3TN79qiAkCIZpAMJcf/RqqTKPkt7XpbIXNLgKX5/h8Q8bIFPiDMz4EeRhsPt/mrssdwQ/R8Xu8iEFz0bh/Y6PE8NQzA4nt8LlIK/B7jb+hgE7QeiIaYbe/A6UcHzrVr9ro5pWqNsRQFD9lL/0gTiqrLvEKzHjW3ACHxW+vrPzxUGgBEZ1GwI6JhI7qikxCalXk5V5YGdLPJgvaG6j349skQAKzKguIe1n8d9LjC8aPL5E5Z1DfAL59v4ldNoZND29MFrMPOJWJCZ/57dCeKapOdzChZNdM6aZQWpTVE1WeUyNvWPp6iMrBaEqQVg7AsJpW0mYzamvZw2En31+3hXgAE6KlVJCIgJY7LD7NrR/P7AFfzpvrXqU7GtWgm/BN7uHk0fF3rneD3quPpF7iXHPPmLdcYXcbtHwb2XEU61hm0H6cqDXr8JVSl4+FMrT60HfZVp8L; 20:Pj9srN5SJnMgVw7mMH96OiVGhY4v7dPB7YvucuJs3HBEbRUPUbyOJnARm2ybaSzhMpNAbE+nm1PVFY71STB1BsMSr/fKsMdPk2IKexEGnFvaeLud6cDFTsO8hbsw+8uYjJE9FTi7VOTIjg8bpq0QTZoHmxNMV8gpin/gnEf4jWHWQ2EZw+OxZTOtoZAgYsDwELTNZKdSc12LkLEk2HljMvhiNVd3efmYQKVrEtq5xpaM9Wk8fSdhK7NsuHWfe16o X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2017 21:56:43.7701 (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: BLUPR12MB0643 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: Update code after flip_flags moved from plane_state to crtc_state v5: Rename to pageflip_flags. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/nouveau/nv50_display.c | 84 ++++------------------------------ 1 file changed, 10 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 2c2c645..c6153d3 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -831,7 +831,8 @@ struct nv50_wndw_func { static int nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, - struct nv50_head_atom *asyh) + struct nv50_head_atom *asyh, + u32 pflip_flags) { struct nouveau_framebuffer *fb = nouveau_framebuffer(asyw->state.fb); struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev); @@ -846,6 +847,9 @@ 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 = pflip_flags & DRM_MODE_PAGE_FLIP_ASYNC ? 0 : 1; + if (asyw->image.kind) { asyw->image.layout = 0; if (drm->device.info.chipset >= 0xc0) @@ -883,6 +887,7 @@ struct nv50_wndw_func { struct nv50_head_atom *harm = NULL, *asyh = NULL; bool varm = false, asyv = false, asym = false; int ret; + u32 pflip_flags = 0; NV_ATOMIC(drm, "%s atomic_check\n", plane->name); if (asyw->state.crtc) { @@ -891,6 +896,7 @@ struct nv50_wndw_func { return PTR_ERR(asyh); asym = drm_atomic_crtc_needs_modeset(&asyh->state); asyv = asyh->state.active; + pflip_flags = asyh->state.pageflip_flags; } if (armw->state.crtc) { @@ -907,7 +913,8 @@ struct nv50_wndw_func { asyw->set.point = true; if (!varm || asym || armw->state.fb != asyw->state.fb) { - ret = nv50_wndw_atomic_check_acquire(wndw, asyw, asyh); + ret = nv50_wndw_atomic_check_acquire( + wndw, asyw, asyh, pflip_flags); if (ret) return ret; } @@ -2221,77 +2228,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 +2322,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,