From patchwork Wed Feb 1 17:03:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9550219 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 569FF60424 for ; Wed, 1 Feb 2017 17:05:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4741B27F81 for ; Wed, 1 Feb 2017 17:05:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3ABD52845D; Wed, 1 Feb 2017 17:05:27 +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 81BF627F81 for ; Wed, 1 Feb 2017 17:05:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7B356E87C; Wed, 1 Feb 2017 17:05:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0088.outbound.protection.outlook.com [104.47.38.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id F1DF86E879; Wed, 1 Feb 2017 17:05:22 +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=FA0r5sw6FifsQtLL5OjxR9slA5Oix5xgE5MCaxWWVuE=; b=E82u3EXL5KNywvR5+D1SGV+ZzLZkZheRkmR9C3oICZtGMqPx7+DdRpFidlOPDxyHJ/sNOx6VlC2U7Jxs6UDLE3J9Imz40ckcBk6+ieUbZPFpDCx3LqreXsH7z3PzIKUpBAmuXle84rNyllc3WurB423hqRwNo88M8pO6nSzuJo8= Received: from CY1PR1201CA0008.namprd12.prod.outlook.com (10.169.17.146) by BY1PR12MB0455.namprd12.prod.outlook.com (10.162.147.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Wed, 1 Feb 2017 17:05:19 +0000 Received: from BY2NAM03FT041.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::208) by CY1PR1201CA0008.outlook.office365.com (2a01:111:e400:5b9a::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; Wed, 1 Feb 2017 17:05:19 +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 BY2NAM03FT041.mail.protection.outlook.com (10.152.85.246) 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; Wed, 1 Feb 2017 17:05:19 +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; Wed, 1 Feb 2017 11:05:18 -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, 2 Feb 2017 01:05:14 +0800 From: Andrey Grodzovsky To: Subject: [PATCH v4 2/3] drm/nouveau/kms/nv50: Switch to using atomic helper for flip. Date: Wed, 1 Feb 2017 12:03:35 -0500 Message-ID: <1485968616-4296-3-git-send-email-Andrey.Grodzovsky@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485968616-4296-1-git-send-email-Andrey.Grodzovsky@amd.com> References: <1485968616-4296-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)(39840400002)(39860400002)(39410400002)(39850400002)(39450400003)(2980300002)(428002)(189002)(199003)(4326007)(8676002)(5660300001)(47776003)(50466002)(36756003)(81166006)(48376002)(81156014)(575784001)(626004)(86362001)(8936002)(97736004)(189998001)(68736007)(2906002)(305945005)(5003940100001)(2950100002)(6916009)(110136003)(6666003)(76176999)(50226002)(50986999)(356003)(54906002)(2351001)(106466001)(105586002)(53936002)(101416001)(53416004)(38730400001)(92566002)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR12MB0455; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT041; 1:d4mQ+pU+xWel3LNc2P3dbnmpkE1YdsRuyE0LOVNCjp0c1K8NUhWD4Y25hDhVGYhGyuAA1xI0t4ODzzVWyPQuhTzr+zzO/6LOewPW+H4CQqFwGzhw0k7eqfssTXMh7BsfmwPuyJKFkTESRH9kychhhqjUV6C/PMhZ44ohawjj7lDbO031ilA8gluillbg1lTqEr8vNnZX6mzuPYCpqLpUDjWO+WXnn6Xt1FSY87M94Pk0No7kaiyVqWTMxJQuk1qrCNJqNscPjm6WdOo11Jt7R93r8d9RTGPJ2mnx4ixxe0TOZz0OashFPRwuob6f5blm6mMUVuwmGEwfmtHqiEI9lQ0Tsro4EFkklTPed5vCdZETG67Ll7AEJ/j4i0rc0XZslV2PyQlgEiHfcRkQKsRE6qNbE7OsSAwzvH7bxBVxlxIIRB/2kAcztSIBzzOAEWcJRWoCLYBhzvEJMA0Xf4AfapkG+LmIZeP0eAb0xPfIOO/XdRTYCvkxJCgEoEpNBHVM X-MS-Office365-Filtering-Correlation-Id: 63662502-2b93-45c2-657d-08d44ac48074 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR12MB0455; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0455; 3:ySYSg3AMNokMtyzyuXqzWcLNgk6xs6pfZ8YBnw60VRta5uWL/JvYyLijKJOJEbYxUPjVNf/0PvY5gwukn89NRoXEiL3CFsCrQDyJv2VzRP+sHbQa5Zrh3vq5H+ZLFM/ko9/ZQkTYboxAB08pPwjYo97lxvqda1v63uvWxtsGi1u49iFsN7o7FfOMXlplBOdEEI4XLqs0FLjxlgDOrLhZZDP3Q0k8QfeMAijqMRmwWIC3W128JieosHRzeZAs69I8RaW6jO4z+1KFm3J+aMa7lvuLDVFgi6Nu1PkTziQ0GpMTb7BNI4b7UC/WEuyICSC9CA+SOCMc06PAKj4AUFeq10Z7QQvFV2hdRbGiD/4O0A4HqLkOWRVUNzLAaO5hLIE3 X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0455; 25:ykezK28Uqb7cyKp7XKgbX95jP/TPrUJHakfgPx+aybeK/uVKDc+JCDcH/UlvYjMS+Spx3TGE6ISyBOSzXkPF8sFL0OUsYCM12TT4alUyY5tqdu3btV3v2CSYAJQoyvpjN5+NFn7emdZrVQskPGQea6evCqtwl8UwC9FbnQD2MAADB8SBs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5ORvFDwpaBBYy2DHJKQ1mRiPs/+UySvyqs2BHG09I7xDBjTjDboPVp5giMfgqb9gzCEl3W9vD3cVT2DoX4L4OdcEarkjRoWSXGC8gt5SJsACJa4ns4LqYL8RjUdTQ4qqDBXsBxpaWUJJ6Ay0Dnjlrp8fVxFWnc3ZuV/6Ho6hEXmNJF+cjJg4++kgI6kzSfXIg3IMhJid9r/mzIXuw3ibBIgUKeBbnQ1HPjGMWj/X4veg2LW7TYODtMq4AOQKJvCZjEqTB8EpXO+tVY7wt6PMLs0Ps8+GCFsqcPnLQ3+ss+sLZf+hmrViukXp+Ym01HLz5qUexkq 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)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(20161123564025)(6072148); SRVR:BY1PR12MB0455; BCL:0; PCL:0; RULEID:; SRVR:BY1PR12MB0455; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0455; 4:tMNJQohITlI0mAqJvQkGO8dJaE7jCNGXQfxV2ZcDfLU8uu3HFK9D056k7ajMFZEX7zPYx84YJYCkXWchBwBzYl4l+ATZII8rPeTCuKJdQ4hhmMEzpF8XSWoOsENDZ6GLhVZBin9XMAaUXveJhWOwZXSZpfeAFtV2McoABLdTfkvnaoOsWFUz9sNYt2BhIWFnubiSOlL2nLLJRtqiBfECNxrE3P65vrDm6Ekxrdv8za1VakQG3PXenPIGWjfHzKni9mf7zFZxdcJzsL0jt59H7gLNfvO0KCDSsvLHH35/b6V40xhOzamJ7bIR9+yVfbR3iH/R1ZoitmGyq+KBI3M2KJ/ilZFk47vblLgPm4Kz6mXI/FPwn6Up/KTYpGQ49Ht7XvnFGmJKiZQivMXdOsr4CXCrNTnb5YvpE/Uevnf7Y8d4XraCGAeyX0rknpPgTxDKHO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VwnI01sXGHO; 20:mmVyrn/dAQZeVn05JReUPFADWbmsgfZel5e/kz9m2zqIOm/Iihjj/3vz9mr1lqnV8i88rAWcij54J61CcKUS7hCwVpgLx+RbPYpMMvpZuUIT91rYXOhj52HNC9xXMLbQPGbwlFLQojiHFc2Mq0gvovkmPG5bkbD9P+jQbwlUMsoYziG9EfKYpxxJeFp4+unLqskkaBaNc/f8xApns9tX8Smp/Iae5oHbVC+1ldBm57l1K09C+1J6TIa3Sf/VJqgZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2017 17:05:19.3677 (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: BY1PR12MB0455 Cc: dc_upstream@amd.com, nouveau@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, laurent.pinchart@ideasonboard.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 Change-Id: I5a3189c03e389af2ff6c13d870a7d28282b7b0ee 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..0d194ae 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.pflip_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,