From patchwork Sun Jan 29 02:26:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9543817 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 42C11604AA for ; Sun, 29 Jan 2017 02:27:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32B6E27FBC for ; Sun, 29 Jan 2017 02:27:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2684F281C3; Sun, 29 Jan 2017 02:27:38 +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 A43A527FBC for ; Sun, 29 Jan 2017 02:27:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C10896E167; Sun, 29 Jan 2017 02:27:35 +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-bl2nam02on0084.outbound.protection.outlook.com [104.47.38.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C8176E0E6; Sun, 29 Jan 2017 02:27:34 +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=5e0BCWgeYyVdMd7upU3e0ZgHnR00S7XXDTZgCPsozY0=; b=uoMKZne5Q12efc649GV/KZRCbIFu5iylj8OacRkl9WU6HAjOZPIyz2waRQ8cYF+9UU8lirkjbRa5V34qTtAY9n/kaR+2uK4pRegLyGARJiFycdm4q9rotrrAGub9Zk7Y4gnBGcLIKliYnwXs6lG54mdf0eMK/XBvElLR44DwLk0= Received: from CY1PR1201CA0024.namprd12.prod.outlook.com (10.169.17.162) by MWHPR12MB1664.namprd12.prod.outlook.com (10.172.56.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Sun, 29 Jan 2017 02:27:32 +0000 Received: from BY2NAM03FT005.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::207) by CY1PR1201CA0024.outlook.office365.com (2a01:111:e400:5b9a::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12 via Frontend Transport; Sun, 29 Jan 2017 02:27:32 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; intel.com; dkim=none (message not signed) header.d=none; intel.com; 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 BY2NAM03FT005.mail.protection.outlook.com (10.152.84.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.2 via Frontend Transport; Sun, 29 Jan 2017 02:27:31 +0000 Received: from SATLEXDAG01.amd.com (10.181.40.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 28 Jan 2017 20:27:30 -0600 Received: from SCYBEXDAG03.amd.com (10.34.11.13) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 28 Jan 2017 21:27:29 -0500 Received: from agrodzovsky-All-Series.amd.com (172.29.227.109) by SCYBEXDAG03.amd.com (10.34.11.13) with Microsoft SMTP Server id 14.3.319.2; Sun, 29 Jan 2017 10:27:25 +0800 From: Andrey Grodzovsky To: Subject: [v3 PATCH 2/3] drm/nouveau/kms/nv50: Switch to using atomic flip helper. Date: Sat, 28 Jan 2017 21:26:50 -0500 Message-ID: <1485656811-4211-3-git-send-email-Andrey.Grodzovsky@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485656811-4211-1-git-send-email-Andrey.Grodzovsky@amd.com> References: <1485656811-4211-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)(39410400002)(39840400002)(39850400002)(39450400003)(39860400002)(2980300002)(428002)(3190300001)(189002)(199003)(54906002)(50466002)(6916009)(86362001)(68736007)(53936002)(5660300001)(50986999)(53416004)(6666003)(2950100002)(38730400001)(110136003)(105586002)(626004)(76176999)(101416001)(50226002)(8676002)(4326007)(356003)(81156014)(106466001)(81166006)(8936002)(305945005)(77096006)(2906002)(47776003)(97736004)(36756003)(189998001)(5003940100001)(48376002)(92566002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1664; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT005; 1:brKwMMFmOhuX6mRO37bjWlYAfQCJU/9MEPC0XWCVQxpEDFGTuo3XIE/m1+TnvETJ5c8uKkQ9EXxIwiT9O+SoYSfx2l86/GWdyCrvLdolvD7Y8SsGBf8Hi1nDpHv51whFU2IYIrWnf5XqtUbP2qBUlapS+8vsgGXKX0RivDmgnZBiisUrMe3t9ahDgSyWfL9oKUtbYB8BCBwL/kIDauuXc177RpJCqNIk5JUP9g3wWcZ0VzD9ar1YYU/F081ze1L6pYiE1sdV1qILWz8Y711eGkZ5XW7nja2nkAeqKG5qqThq1NlU+xOCvGoOGR3ut54JlKUctFgC4moLdO0zGdsXGGJLe2xLNLK1lxKbSxkm5Ywz37l4MoAjOZ86Qc7JsljSnHYNWoQfD9qwrVS5xPRSqPsOpqQAQlhis5/EjcfTazRrZ+PsCQlY2OAzygwPS9AcM+yYtBT8bQj7S3DugoLP7MXYGnHdi0vy43Tzj1yYLauiQQQZkjfr3bSXKFQWQNMqdibCqgzks7aHiR1NagxfMAQO7AgPjrxnorsJcSim0++7fSTF7mqt/ss3/e/7JDOJ X-MS-Office365-Filtering-Correlation-Id: fd13977c-6027-4e83-b20c-08d447ee608c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR12MB1664; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1664; 3:qlNyqQKCVxv5FwPEw8iU77sF94BLBbvSvgRuAtVBAdhiTI0hWy2+VBGUmsVmNLap3bijKpZXetQBsZgR22Euo3L69LWDfX7znp7KeovtGUoQWWiqdhzDdkDbjuyl+Gl9eW5fH37ruSRDv/SIpK0Lwn/K4AWNE16PJTAfBsZpslbI+qlE9Cqx2fRbd8iEaRwRV+jB96GM8FtmlTXujbxanoBDqC+pKrIgx7FXQlavXHAp+hxoln+Uf9RGbl+T9RxQhKTF1xFbDZ/dhrYtmWXjH+5oaKHyppwV8QICQFtHgtPr995Nv3BeARr48BGJexC8PFkZ3RQ++O8ZiTi20Nu8+i7htNwWUJupX+w1vWY1IMyhoN8E6nLcgICTSayWhMIq X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1664; 25:i3n03jTnO0EK4SJkPXX4OU51YVcS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8kWVVnZjsU/WSLh7TbT/IObQi69+D872QX9TjD0XCTBW/r8rDVsnMIxDshE1YQ8xHkdVS9PX8hirbue1el207fbUh7JrKZMVeMOdsHr9DuCMBvi9nDoDFv3RcsyzGtHx7V5b3/ePrOVUy31T6EjLlXMsmvZpeX+/aT4DB8gBVR8bno3JK7yQhO+S9pcUS2YUdo1fPKUiXn8XIT0sNuJsJ+7fZcsRq681FqTVpETzlB9IdlJpASoHvGUFSRa637NQ0MBKfWA4XgFG2uezre8nXm+Nw4OqFUyZFuI9fuOMS/Nzjbf3MoVL22wV2pzPNOpv2ZFP1f++tLZYAPkXUmtNknjTsIMDMFhIBEQmKBKERsusLMEKple5KFDd8rMQte16uuhXdsPo84BdtlauT/WJdF9emin9ZX5mUxUZBJaq+mwwFeUTkBKrl79j35jX23wIeOgldAo38XRiujMcF9TyqWFcvDa+ZmtZq1B 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)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:MWHPR12MB1664; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1664; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1664; 4:UAxB06IHexcYb9D0Xz1CG5H5tgr9tsW0pti8QS4wOs0eqrtIbCA5PG3OIgFxxA//YPsGWm3pZAiKc5//fW2E/6LNFh6TqsiE8LRs1UkWoxrWRoZ/AJyDzJGTnH0j/AfIjR2quftejd5Zbi2/exOGrpl39fYS0XbJVi5sMIoUiMMIFJIEcVm5XLtCgjp3Pn8p0OuhDdpyT7w3coDb35EE1VyCeis9PdUb+Hc3WN2ZTt8jh854e++1r7zdla5rG0YAgGvkeQULNA2/hArp1lkvM3xxCsVSCgEr6C0CguQGOKse03QHPgC2nwMW3rNbciLeq3oBewaf4CDIvpiGGtcT8COdP5321Ax5U544p4nAwQn2UPucZN4E0khHQnplZmiJD2a5W+rI1/F37jsAWfplPEkledzI/EW2aWIQ9WyVhU3SJEcsnQpv5gxnvh5JQq4jO5LZ7Cj222t1QZZUBFk1o6zYN9fReN89NrPLoTptoCf9ybApu1BPAKmWbcrYeH3XCX5ry2ZCLJvO67ixUYTzgDY6DFR1ymcPvKvGHRg9dc3VN1RCOMzrbkEKUiQROInWlFiLqjJuxiuC7r5tjPnQ4qQW5TRDHMF7waHrJInRjdnawXK4we6nB/4/5hFxz6QibMJ43HpzsuFE77AXY9SbZs52/eiCb+MYu0ctDEuZljs= X-Forefront-PRVS: 0202D21D2F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1664; 23:s7PjMy+zXf/sIrbqhEUY/3+QJiuJFBffPO1NlXKHx?= =?us-ascii?Q?3Tu7H4LOigUwDoTD9a2pfrP8TachRuSbCm1bVySDNKCLqpy7w1TYWo7AARvz?= =?us-ascii?Q?r1KtqwexzFyg0Wz8JVXYH/EaF8cp5KiXPTgfB9DWU+pDeapP/JoUdoqaGVVs?= =?us-ascii?Q?7y6htPfiVzMvu7h2WlNZmwMNcPgdXs8+6vDY6Q8afZwgWU9wyKq55r2MdP0R?= =?us-ascii?Q?/ELMUly7O80cHcA49tVRQRLOEJk5Fc0zSLvrMjk2z1URQS0RKOvq3xGl2ak0?= =?us-ascii?Q?yuLK1sY3gozeLLBCnScVT+ub5EBEBBhjII9FpNW/KJ2lme6pQrcslbsi70zS?= =?us-ascii?Q?TBGPSWGOUE6bwsBCoV+OMW6258r99XAnkKkzcryg3Q4WMBsnweKbDFtCaVft?= =?us-ascii?Q?8/YBS2qnPLIKQ6YQDyulcAHDT24brHJSlTQQisIEdUjYaQTpXqOi73qHr6ik?= =?us-ascii?Q?cHzSXTEseD3RbFhIi3E/0V+KkoIHOEckCcx8sdfrpkOVvl9aOGy1thjK/Kdo?= =?us-ascii?Q?IZ1eDJ0X76oH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M2MNA==; 20:gUz3KI6Fik74fDVoR7KUFfhbT4GmabczsFNxskn7m3MyTXh4iPRV/Q6UGHcTNE/7YcXEkrT3FnVldzrJbdUZeYQguOJMCfJdXXrA8jbYDz3edXtPX6V7rYluSmws/DMWWG+PB26PzgGZ5naq3u3fqzGyk3qGlxEUm8leo7vH6Awb3yE809cqJrkln+Wy/IVevqGAZPNqW1ezy16faHdnCXVVeDeX5IBLB/9SX+QAxPKbz5CVY2vns85t20WgD3uF X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2017 02:27:31.2298 (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: MWHPR12MB1664 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 v3: Update code after flip_flags moved from plane_state to crtc_state Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/nouveau/nv50_display.c | 84 ++++------------------------------ 1 file changed, 10 insertions(+), 74 deletions(-) P.S This patch hasn't been tested since i don't have nVidia card. 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,