From patchwork Thu Feb 2 21:56:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9553271 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 518BB60424 for ; Thu, 2 Feb 2017 21:56:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41DFF28437 for ; Thu, 2 Feb 2017 21:56:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35889284BC; Thu, 2 Feb 2017 21:56:44 +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 B398E28437 for ; Thu, 2 Feb 2017 21:56:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A3D8897F3; Thu, 2 Feb 2017 21:56:42 +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-by2nam03on0058.outbound.protection.outlook.com [104.47.42.58]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29FC66EAD5; Thu, 2 Feb 2017 21:56:40 +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=xBJXNuKe4fRdE6T7PLWg7l855/PtpTnWVqqnWfNfyE0=; b=RRxoKy5KKpwNPCe2WBuIVoiPZ4F/FSaTX4hY6BUwOaZ6VTGRkIDrHfmasPdD938CvKUZHVjnqzW1aMJ6vjYOHfDCVNFrWy84cD5KoTnvWVPvLv2NreNN3gXIVwdOKe1F9dc7VIS7KGp0MUCK4Yikz2QrrBw8KkgTVJbKcPZzHSg= Received: from DM3PR12CA0032.namprd12.prod.outlook.com (10.164.12.170) by BLUPR12MB0451.namprd12.prod.outlook.com (10.162.92.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Thu, 2 Feb 2017 21:56:36 +0000 Received: from BY2NAM03FT011.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::208) by DM3PR12CA0032.outlook.office365.com (2a01:111:e400:599f::42) 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:36 +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 BY2NAM03FT011.mail.protection.outlook.com (10.152.84.233) 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:35 +0000 Received: from SATLEXDAG04.amd.com (10.181.40.9) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 2 Feb 2017 15:56:34 -0600 Received: from SCYBEXDAG01.amd.com (10.34.11.11) by satlexdag04.amd.com (10.181.40.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 2 Feb 2017 16:56:33 -0500 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:29 +0800 From: Andrey Grodzovsky To: Subject: [PATCH v5 1/3] drm/atomic: Save flip flags in drm_crtc_state Date: Thu, 2 Feb 2017 16:56:29 -0500 Message-ID: <1486072591-3893-2-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)(39850400002)(39860400002)(39840400002)(39410400002)(39450400003)(2980300002)(428002)(3190300001)(189002)(199003)(77096006)(54906002)(6916009)(2950100002)(36756003)(68736007)(305945005)(8936002)(38730400001)(8676002)(4326007)(81156014)(81166006)(53936002)(76176999)(92566002)(47776003)(50466002)(53416004)(106466001)(2351001)(105586002)(50986999)(86362001)(101416001)(48376002)(97736004)(5003940100001)(5660300001)(626004)(356003)(189998001)(110136003)(50226002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0451; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT011; 1:n0vcY7l0RXwfRTX7srK/G++2AUZ7+53ipniQ/Tk4oErwPBSgeyyomqSuxQy1KNk5r8tyPMw8UMTNhPAHC3TfRJE1FXFB5sqV4R4gNOKEfNIuizQWf8EA9poISyJBZdu9U0xtd84yFodKcdmPuQh1THbByPRsMVAJRJDVCsB77s2zHH85MFiOu3nujE4DtBMx401En5IMqXlEDL7uyJRN3B65zDcIoAqeUhyoezsZ/CDDZBw9njGFe1+EDbqoUNEIDyd/2yzO6OFVC+ofnIptOui7DcqFEbo7K9DwV3dTq9Ge8cir5rGW450XKwLoWbqmtWaE7fDd3gSyX/5j3/cmSkYpt5jMppktBwjq57qbJ/kbcLfjzet4NFEivpt1igLvXzKJmnYKKEbxasg8DgWJtcr9a9HIA3I8kOLLIG7/29o9018Tb9LFzV43Nb8PWf0XYdRinpA9J8zEEXnATZ0aUtXJcv/Ni9GHSEWC4ckzorhxDjX6Agm+EH61n8pOikOvkcirgdMgXI0388Rez9y7MMRuSq/PpyYHkHG1gLQhA7Q30EthtTe8WP9VGzs2IgBb X-MS-Office365-Filtering-Correlation-Id: 0f7d7e7a-a6d7-4096-d653-08d44bb65b65 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR12MB0451; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0451; 3:ohDzuaHIuUFcywOEMxEsHIw1I/J6+kf2VP82vXyjHWGQ50U7BUC//Q4cP+9owraVPmTddUs1rlFumxaIOP3ewS/UxUssknAt07OUNo6iMjSAlEf4I1fy/8Ox8qtvHAY4sLSraQtSQDk18Lo4Bwnf5eJI7Fr0ldw9YZW2aKNENKsyB1aTKt8yvsoKVWUJ+Yr2dliOdXld6d3AHlI/vCToyNQFRY9ac5TKx44ihIT5mLBPypzXyECSYq9u+k4uyTdRXYYfQMtBgMpyNMmJawZpNtVpGSHLnUP/OXqNLyxdJ81ShyCpHlTyNiHuJpHfrdIa+bxLnG7MZNQWwQ98PIJbVtQGBvZ2Ud/yhTTBK+6ip/q+jyQsvP2cqia9H9MMjD5E; 25:HA38xt20JovWVQs6FYLYna74CjyACrIZZAVqMTldqvFbQKn9+yNEUQnFHMAb8c/AXSZ6V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fT7DuUq3yvan0iUw4KVI3iSoqTARYzEteOg3VyQgIOdOkMtqpc0tMl7mjfyBwe8yib8jw498xv2QjYFm/Fdh49w4gQuDI5lt7mSSv344ZytB/wMNVBGVFvJ028Z0dP4uQYDWIr5+Gnl9hYQzVBx6ueQ4ouH+Bvcbb2BljAYkGV4zw/ngSnNq5 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)(8121501046)(5005006)(13018025)(13016025)(7006099)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148); SRVR:BLUPR12MB0451; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0451; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0451; 4:5OjfqOcTkzjyh7hu8U8kqkU7TfJC1kH1iwZmGIVwMBgBNKW3sQE3r+Znhxy/rhoNQM1G81rNYXwdGb+ORtnZDYnj1sseuQbznx3bBe0WYtOish/s8C4Wdweu2z4BFNl0SexA3SaKqx0RcoHkv5uLxmFm+i1wGX9UMGTc4lFSnNepHymnAFDn2gfyErDozRy/trOfVQ5G6uQirPpV5ucA5KKu25y1XumondHepL/bijabGXdKwpJEDBs9DhJIl+X5ON58Ta+VMFAZi+LS/nA0TIG9wfq8vhdMS1XfAOFtjsamtcDLzu0AwbvIqrMxbnbeXK0GyZjDb5T//oC+kWLGpwFdSQ+LuVAhHEDS3Q04kP2ijQKzefURF8e3TlzsdturX01SHOiDWzKnorvK1oAyWTM93bcGiKj9FBd3NTbBqKVGpOrLCJXMApmR0GiwUbVpYVAZL80OQXGxKiDZ5B9xgbrZ1AwqVvGBp0OallZJmw+NSjUYKHGYFF0xRFyGigzCkXIas251atoueHk7TCKFNeBb+4CrfEdWic0Q0X+3ecDmAhwrtePr71/Zf7gbZVFK8muelxplIGRNtC7qGLLZ5kgOxogIa/UGTw1HMEgmGjB0pOwTz6U/VJgoAbceEfoHi7dFroDFeTgbC3Px7FdTeSv8SMEmE1LSH8PHucaYcGdQgkujaWtqhkK9BMXS0I4S/KrMzqGZvhS6tWN0DZ3OHe21xAEdJaS1udlh71wDrpA= X-Forefront-PRVS: 02065A9E77 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR12MB0451; 23:MMtyOkwsZ2KDcgtDCPHSuWpkE6fNfptsl59K2aD23?= =?us-ascii?Q?yx05fj1rXXKDbNZnzdhtY1Fogl41tEXgd0o/GYrr8PWEKqxAmn1o3IfNiqbl?= =?us-ascii?Q?aU/Bn52YrP6egy0AJ9Tx9iGS4mObKSUHPQoPuEgUow/5MH93kl1dqCtOCm2z?= =?us-ascii?Q?jl8i21oERReasoXA6pGBnjcBXy6RdSJb5Pj6L18Q9Xh8Djv7TGrcQg07ledh?= =?us-ascii?Q?nzYonTN3qd67InvZk/GOThROYu1dpiojdTH8AiIKTJUnba0q8SjMWzjSLr83?= =?us-ascii?Q?Fcg25eDzvuQWbj8WI3mpHuVZbwz7wzk8x2IVWeSiN32XoJETaFUx7piXoR+7?= =?us-ascii?Q?RsPpbDMdQXnCqTbZ6vpYrwF2SQocT0RDVLdb2Ws7O6/p+61bXmD2Fj8A+Gct?= =?us-ascii?Q?DsF30PYtlEo08ujXGAPk84SozHh5DGo/ySBK21OUpc9gfAdBHO8at5154HsG?= =?us-ascii?Q?0n7YW31UMhu0SC5ptYbXOPBjN/5kFJ1Ka5fffTiYQGLAHdviBW7s3NTZVYKF?= =?us-ascii?Q?8+2XJmQedoH2Oovbv/7H67k29EIXF5Q4p5a+1ACAuvkfMpHpw1zITY4w7NqQ?= =?us-ascii?Q?xS18dGgR18r/MPMRaBcK8RAHpCnE3ZBZe0JAcUqjZQ5bgXWVY1R+mUqqZhoK?= =?us-ascii?Q?DvTm88Mk3bxdKrZrwLCnwkvLOkSYaL4kx2sveaB1Y0Cb2XM98Kpf2AjwEuzd?= =?us-ascii?Q?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Ar310/MFAeI9czGklmyV4pAIshRj1sCO6pIzeDo X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2017 21:56:35.3739 (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: BLUPR12MB0451 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 Allows using atomic flip helpers for drivers using ASYNC flip. Remove ASYNC_FLIP restriction in helpers and caches the page flip flags in drm_crtc_state to be used in the low level drivers. v2: Resending the patch since the original was broken. v3: Save flag in crtc_state instead of plane_state v4: Reset the flag before using again. v5: Fix type in header. Rename the field to pageflip_flags. Remove unrelated hunk. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/drm_atomic_helper.c | 20 ++++++-------------- include/drm/drm_crtc.h | 9 ++++++++- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index a4e5477..63efa05 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2737,7 +2737,8 @@ static int page_flip_common( struct drm_atomic_state *state, struct drm_crtc *crtc, struct drm_framebuffer *fb, - struct drm_pending_vblank_event *event) + struct drm_pending_vblank_event *event, + uint32_t flags) { struct drm_plane *plane = crtc->primary; struct drm_plane_state *plane_state; @@ -2749,12 +2750,12 @@ static int page_flip_common( return PTR_ERR(crtc_state); crtc_state->event = event; + crtc_state->pageflip_flags = flags; plane_state = drm_atomic_get_plane_state(state, plane); if (IS_ERR(plane_state)) return PTR_ERR(plane_state); - ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); if (ret != 0) return ret; @@ -2781,10 +2782,6 @@ static int page_flip_common( * Provides a default &drm_crtc_funcs.page_flip implementation * using the atomic driver interface. * - * Note that for now so called async page flips (i.e. updates which are not - * synchronized to vblank) are not supported, since the atomic interfaces have - * no provisions for this yet. - * * Returns: * Returns 0 on success, negative errno numbers on failure. * @@ -2800,9 +2797,6 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc, struct drm_atomic_state *state; int ret = 0; - if (flags & DRM_MODE_PAGE_FLIP_ASYNC) - return -EINVAL; - state = drm_atomic_state_alloc(plane->dev); if (!state) return -ENOMEM; @@ -2810,7 +2804,7 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc, state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); retry: - ret = page_flip_common(state, crtc, fb, event); + ret = page_flip_common(state, crtc, fb, event, flags); if (ret != 0) goto fail; @@ -2865,9 +2859,6 @@ int drm_atomic_helper_page_flip_target( struct drm_crtc_state *crtc_state; int ret = 0; - if (flags & DRM_MODE_PAGE_FLIP_ASYNC) - return -EINVAL; - state = drm_atomic_state_alloc(plane->dev); if (!state) return -ENOMEM; @@ -2875,7 +2866,7 @@ int drm_atomic_helper_page_flip_target( state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); retry: - ret = page_flip_common(state, crtc, fb, event); + ret = page_flip_common(state, crtc, fb, event, flags); if (ret != 0) goto fail; @@ -3072,6 +3063,7 @@ void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, state->color_mgmt_changed = false; state->zpos_changed = false; state->event = NULL; + state->pageflip_flags = 0; } EXPORT_SYMBOL(__drm_atomic_helper_crtc_duplicate_state); diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 5c77c3f..76561fb 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -162,10 +162,17 @@ struct drm_crtc_state { * Target vertical blank period when a page flip * should take effect. */ - u32 target_vblank; /** + * @pageflip_flags: + * + * DRM_MODE_PAGE_FLIP_* flags, as passed to the page flip ioctl. + * Zero in any other case. + */ + u32 pageflip_flags; + + /** * @event: * * Optional pointer to a DRM event to signal upon completion of the