From patchwork Sun Jan 29 02:26:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9543819 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 6E459604AA for ; Sun, 29 Jan 2017 02:27:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DF6527FBC for ; Sun, 29 Jan 2017 02:27:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 524CE281C3; Sun, 29 Jan 2017 02:27:46 +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 5DF3B27FBC for ; Sun, 29 Jan 2017 02:27:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9B156E0D2; Sun, 29 Jan 2017 02:27:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0049.outbound.protection.outlook.com [104.47.41.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 54B246E0D2 for ; Sun, 29 Jan 2017 02:27:43 +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=0xji+qWditoOsQMkM/3/Lv1IM9iOA4OezRxGFUtJr8I=; b=d96Qe7rSLqVM33ot4mamYFw4gsbHsGR/5J6+UnltoKoyGlyXnM4AkURFLz/KIeA7dcxiU3UL+/B0tXcGMSOhsnIzatLt0+GhMrHB0I1K84xxvDvuqJvZ+xV0VWodSXl1PMB8Q21CBrWpgL8qu2CjjwEM8xk8EEVtKqaktCw/fbc= Received: from CY1PR12CA0081.namprd12.prod.outlook.com (10.163.230.49) by BN1PR12MB0002.namprd12.prod.outlook.com (10.160.81.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Sun, 29 Jan 2017 02:27:41 +0000 Received: from BY2NAM03FT019.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::204) by CY1PR12CA0081.outlook.office365.com (2a01:111:e400:c42b::49) 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:40 +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 BY2NAM03FT019.mail.protection.outlook.com (10.152.84.221) 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:40 +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; Sat, 28 Jan 2017 20:27:39 -0600 Received: from SCYBEXDAG03.amd.com (10.34.11.13) by satlexdag04.amd.com (10.181.40.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 28 Jan 2017 21:27:39 -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:34 +0800 From: Andrey Grodzovsky To: Subject: [v3 PATCH 3/3] drm/amd/display: Switch to using atomic_helper for flip. Date: Sat, 28 Jan 2017 21:26:51 -0500 Message-ID: <1485656811-4211-4-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)(39450400003)(39850400002)(39410400002)(39840400002)(39860400002)(2980300002)(428002)(3190300001)(199003)(189002)(105586002)(8936002)(38730400001)(305945005)(50226002)(101416001)(575784001)(4326007)(626004)(106466001)(53936002)(92566002)(53416004)(356003)(77096006)(36756003)(2351001)(47776003)(81166006)(81156014)(5003940100001)(110136003)(68736007)(97736004)(48376002)(54906002)(86362001)(2906002)(6666003)(189998001)(8676002)(6916009)(2950100002)(50466002)(76176999)(50986999)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR12MB0002; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT019; 1:Oj6a6OYQSLJ8yobkrMwrkTKSxPNDBpqoMh69u7HSUgXT1b8rZiQkpeGy27JZK/Rx8Kitm8rxSRSNhjik8S0S1+XiR3p9kIVrqiO7OMPqfXUTE+hDKqPlrZjaEmyYTt2Mi7ay1ygAk8TTeQmELBVVQIigQwO9PNCoUJImpQ6995kngtjP97yhixKYZwJ1D1lkFOgO+gX9Q+bR3At/B0HecZ6GJe9uWDwdv/YAiMSbQWZ0OIrT+8UzB7QLT783U8yNsf8slMHeTFF1WyZaMdZ5MKxY3NNKC0iL+HAckrIF9PtFUSje5L9SkSRn/umbUHtbF7ot8ICJaJiYEJHeGZd3hj9OLc3WLHWcAusb08utfK2JZeqOVVD1SEobRz9lZrkZmWzi1zk8eoIg4M8cKHba7z6/dmvE6YPWL+p7dN3X94XAt9ySDAtqZfMNJwJ5M2Q176aG7DdxcUb2HJdUYtLSpJ5T3ylVB37xVTTmVGU8un0u7fdLIymZAcPVJCzutfOXcZbX1CKLPI+iMXLPb9TLQxck67naBcx3NQHScLFWHe8ZRHYANxm4HlFX5j8Kqry0 X-MS-Office365-Filtering-Correlation-Id: a467ef10-f87b-4539-835d-08d447ee65fa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN1PR12MB0002; X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0002; 3:ubq9HvbJAxzDUKYfyldUEa8BpCHq4A/uwy0bHU7VMtDKDEj2lhZx68zaNbpgidPXpNg+DNblWsvBRg/KFMo0lcbhCTcc0PlGmAAVp+294QvspHrznVZYRtLIekKwEs9v3VtWUlx/+tIdYPcCP5SpeANcm8PLDgwA0S4tpwPeD0/4A4J3Eq9xG8+gFeTsuoIWp4L3U0CFI4r/A/Bs9KV4BOA7C+L/TBK6l1GbsR2vffTb3iSZgJrz6fs4YBbRHkIc2bltZLZWdkA1BI3LpTWEKVLN/icR4VSY0uGWhSFQETjscvtz/sCuPOz10zEHdmyqR82ZyPNp7TCO2+fUb2qyHd0YcJF9u7EcyTeM9A8QqFEaLlwR3sGWWg7mduQkdCVs X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0002; 25:aGHdR0d7qLJjtgoYfinBOndRP8g51nntlp54gQCj9WcHYLLoM3KOzdwQXqZ3GdOUilnmspRfhdvXS+O4/bdjWX+INEEU7vHw/KqVtkOEEJlEdSYx2PugAeGySy2LwIv8gwit3VkrRHBpg1yVTw1Ir0DTCHw3T1TNfYK465aFWzea/pQTiJr8jCy5NxDIUxq6CgcV+dL9LmIp6sd7KyQd9QOwLq2XusLfaGGQKYjiRIyyi11WCqs6b3ITonhf4c/EgZNfBV3r4iQMlAzM0uST7lY2CNuoj4OXx0wI6lS+4IyqsxCzRGK6rALsvS57QWdjJKJwl3gkFl8HdrEdgcIrjh1zhA5IKeqCLV+F5VBPpbIoo+qnqPdrkxJvnh3gE/s1CktBsHLnE0lu3jCzjIsrzFwFtPDUcHhq0W0j0UIk1LckTtP3u9rlGvvEQzGbLwcrF7Ziaz+3jMAZzJsIXNsh9neCZebUdv/PhRe+jpPARRJL4mNctEyYqQuUEPfPAvEQ9NcKYspO1E5N5KpZSdO2cT3KqbrntedCxxc8mbts8uJoJh6AzoLJNjqXtS3afeGhA34QgE0tZM6bkIspKc288N4dDKrd0cYsovLrZ2lxz1f0dTsZvSkUzLe+E/LpcgY+RotTGARNxJQQ5Kq7Ob5pfRfnNhDRI51XJekUspVpHcbJHwsSDfiaT4idm/LIHcUH4ooO6RWiI9FxNjdVFa7iAmlAdOir0AISKa7qIafWKOjbMdwMC7kUJfzz0FM4NYnk X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0002; 31:nrMESSZE9fqiiyrQwZhJZSqclrsnZFcOOHTQNvO9mB4kNUJp3pBiaVlh7moY7cbNcP9jCp/TVNVljil+VSKnWEs/qdxHb0lYni8lYlQRGMfTJ7gPGSll7BJu7ekwYWtBPloM/vx23VxaPRDLiBOFQe1WpsneC2CfFod385o74koFXlemkE6OlWfTknP488o9faQkNpf+QDxid4AtYbHCiY/yFNK/7xWm857el30QRZHdC2l77E5MLpO8EUp7TKOwXWRzYDvyqMiRDYJPrBx0EQ==; 20:epyiy6zW4MtDUfIk2uhmvs6CFsVpCVC73CKEMZNu/4dm1dWw83Nf1XhgRdgRHPnDDnGEUa+R2OCENqHvNmhlNXiawyTP+yqMfO8kiqmWm/Cr2NaFUdz0L3zhKPyyOgK7kuLfo3vmGYYsJCTZcWhwCbF2rCMBdyF0LzKTfQIiFQD5ZZvxr/URF/PRTBXO2De3Zi3SI+e/4uhLFUcDyxhuVkFFocvdcZdPf4msKXDbFHwI75yBJgRFZLQCS52TxJJzs4sCRx70rkO5P2eorQ6JyL6RRx7aHScRyUR6nm1tWPkIzJSx2U2NOV02DLe9SA7se/B8B1rKvpnrNkL2DZjhFQUOU6rt203MLb4yP4qPaWu/7sJzW+PiR3TMmrPQvliDDmWXUOxz7OwdTY4P6BsokUH8AJscZihFvCN8T0+4lPxL9VZKHc5Gg6PrIJgk+yB+2Vy3ELrfnwAXZcSAGuiFgnW7GtlQ4rt6WZcOFnF74LEI5HcCqKicRt83P3tjjfkw 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)(5005006)(8121501046)(13016025)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123560025)(20161123555025)(20161123564025)(6072148); SRVR:BN1PR12MB0002; BCL:0; PCL:0; RULEID:; SRVR:BN1PR12MB0002; X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0002; 4:QI3o3EJ+0qs12LuH1OvNHrhCHLTVER+8rKEoApnl4KZ0JxQpOdm0U7vO63bAGdsqqzAzyTKEAbOSYet52+Mk3kWbrcVbi0Pwx2qv5i/fu8HGWRZe9Q0J7zECZxoRU4O0LbLx/2E7Vnu7oKVYac89i3nbKIBjzv2c9esUB/dQTq3YuIzEx5plW/aKidbGa9G3fsQhR3k0heAAueiugt8E/rw/vsDpBsnJiXewi0l9bGT9jX0bzndeL8EyzI3ekBaGsIJ0IpgOkcT9OjrRb+Qn1hEATGC8sGBw9l4NAoOxf/g0VzKnK42OgLOWeVnDXluIsTcZldANlC2he6Twt43H1oRlQBYvqvAKywwna8OqemJ7hFdtG4q1N8iYUN6e4J5QihkUM2E984b0Ahj46bZ/sb62NzqIE7rMiXAcdjMm29goGf7Me8b6q38BdBhFCD8273kdEb3AfTyhdxUzRFyh+S3Q+tOaSyHXgnHSXXzbI+Y8t8GX87VZd518DK8uZJPZoM7+kLgDPg40mphPjL9FfvnaU0xp3YJpc6bze8BpN1H6ml1Y+WPbuG6Xd5CH+Uu1OIlWX10Ky8GTGQLJGn1E4A8pWPhxth+EX9TT9mvGRzU9/dZcYg1eoKaBj+EFcpSFYNY9FS+oUQPLMmgTJBwE05PzMGrLE8nUXPsOyPXp4s4= X-Forefront-PRVS: 0202D21D2F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR12MB0002; 23:p3PFwx6iLHC5HH68Q5lx8KEfTRrZGaMtBnGeUHMpy?= =?us-ascii?Q?d01SDA5dmyeaO7834F95O8dwhRwg+4LqsTGKbr5qCrh7I/GupB+BtwyqEPJ9?= =?us-ascii?Q?SJlpI+hiizHdxv+toHBpn82H6KJsyG9EFZf9rVXX7p13VMYp5qzW1slGDXXs?= =?us-ascii?Q?Oy5NBKqmazJg+TWi+ZKTqk3R55m865hpiL0DjePlC/BhehVbVf31tRovNKns?= =?us-ascii?Q?0WsXp+ZXTkajlnX5TGL5lWhxx+9iBAJle8haFzBxpB9++0ygJas6fj0vfpus?= =?us-ascii?Q?Ej6BolXuliHvAZk5P1VtTtGbVsq0DNPeXuhreyAMHNUz0Y6LcRo19+lwM6lb?= =?us-ascii?Q?w50mbclu5gTOI5W+iJG3f28YpSq/bgP59z3IpgSWVhmZfmKcn9fJdm/gaNI2?= =?us-ascii?Q?nBzNyScKr7lmsYgyYXUliXZiolQ9mBPuMu5yhbyfT6DrUP+I3MwQ1S5kEs8Z?= =?us-ascii?Q?9PNLt7Za9hkRqqJ7pikBlA3ly2333PYw/ztgFEA0tIN8QmcGof9WPJ+k0MAd?= =?us-ascii?Q?aOE43doMmK+AJDRahmx/+Z+xKL+BJXn0E7ybV3llLwioQlBeXduLncRXg9z/?= =?us-ascii?Q?tvD6DPxwSBXF6f81MQwIyPfhJLRC89X2lJ2TFp3DAm6Cxp50+1w8DHUY6H8H?= =?us-ascii?Q?m42yA75A7drjfjwVIe6nstF4IPvRlgna6lE6cBAIdeFyNGitsG+35lJXkvjr?= =?us-ascii?Q?lz3R/OgMLOScOtXWVuQ4yi14WX45cuZ+cFWEDT7Ebqnx25fd7E8K5iMVBjb6?= =?us-ascii?Q?vofjIzLzFHW1WEf1VzcLZlevp1i+5t7RpuhpQd5THrzBElp+jVsTw+KuXgRf?= =?us-ascii?Q?A+GPDDz7R8gnPwM6oVJp+ggJWTMDzAEw7ycScpqaCR6u/5vDcx08SfYFI2kQ?= =?us-ascii?Q?Fy07bT+5TymJknQVVTCKT06hwH9t2r29njqVEK3ezxxXQhZgj0Tk9RH5JeLQ?= =?us-ascii?Q?8h5o+6RXBZU8LAvpzjW9CotkjoO/FOwC0IDlBTg1YTU2KYs6OhTQ8m2K2PVf?= =?us-ascii?Q?YzMsjWrOXO15d50xhlpc/Sza5Jb/P29SM2KemBiC+CJzzsYy0xCkuglXP9qS?= =?us-ascii?Q?uNeCEGHOcTmKlehBTalvUnsxjxiYoqD9+NLZmV+HpRl4naSbXO1wVP+08EGL?= =?us-ascii?Q?WBDPf1j+QTR9XJzDehhLEiYW1IoZp173D2b3PpARt0NFle8MwIb9HmbgI6Eg?= =?us-ascii?Q?gmNG8P4JnZlkndhFggNaG/502L9Wgfmr4li?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0002; 6:B6/wULONRKbcDkfEcXW9neQjLDouHzmdI0GeRN8IdsyNP13Mk1weKaXzG31l7HWP5qP9RqIpecn5UgNngapw9S7vgoWLx/UtOUkruxCrR1BZB8hqASNC5okqMq8OEIPoIC++vTVtX5/Z71I+CcRJz6O8nhol1GE/VtljzNsG1+8NWACZUY53HVFua66yIbeZoH5ke8JuLeodPca6o4gY6B2snDD0NyfR7+4/umz6ttpmVFPZdXN9+Y1vkan2AgqhlXlZhbXPjQc/si70wwKZY9OxmN+yUJpRMoP0TOoOGurO3OuyMVqjVg9q5QrhIJSIjPX+JApOg8TKykBHrPWwu6q6LVddMRUDu4mPtzb0vIsEJqMLymwhsENw5Qy+ZsYEL6WtuAtke3sQY4cGrbY3t28lWn3AC+9tYfs/eziFOb46m71A/yKklT5Tc4+M4T++; 5:ss2UDk85vIyClCK9KX+syYWWR9O6cNiGy4fL7F6Afj0zsPHFNIFEYXsiy4ImRauKlD+VaUQ6TbcghPVZuXuLXfrIMJe9tjkqrYOilzPalpt4qkGa2yHbhwYaLNCEPfN2VUq186xa0gJL8BWTznEbnXXEI0i301HY6UZYX74DMGQ=; 24:2hjxXVIyOoVh7t0fHci1CtFjRpkTshf/ywhT72/Te09jg98aF0XdjMUUwj5gGfsglbGLvm2JB367Pf6tekcs8c6MDUnxrDc2GPulij7OJdY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0002; 7:Lm7qrNpnX+CbPLKchlKccI8r2mprSAp9apiuvrgv8+W6tAHPUvtGgpVt5boXrHbUK07RKkqBeDXpnZyP98ff71UuoSoYAeuX8Gu4rSMJJ+AuHl5AKO7ancEjVitdPMZZLBgAAnVqi3cGaPgbyYk1ER6kue+0Vgcws1kpcchsoQy65XHUuDM1vPjv49EvqThFshqKlrGv92dg5NPu4enyoYyj95LfqeTnSOsi5TyxMXnDTxEXW6tsxhOSZBbyteJUjf2PSXFIZMMTy2YMYL6V/2e88LcNfSUA4Nn+CXtZtfL7rvTw6GEpN/fzhpWZcGP0rpASbtuyFYqPsoZDMF19B+JIsD/QXm4ELU1LO5F4LMpgyYy3y7bVemLL06G4d+ISGz6kAYY0i2xbG9j+MitLMLbHwPURGd55vLYb6VxL4fibCBnVCw1/eK9gAvLKDQmGI6FZu9UKV0o+F15VaE+5Vw==; 20:WnXDzTK+Rlq4tgI3fb87VQoRNKy1Vsd1GhJzxZUJ2dyYXwDeSIwWJi7uJMdT9xa8XCJ4fkrsqANXRhXdfrufaowYmE0EHd1rOxTS1DLSwYluGhUysCEvE/daTWef8F5pjGdSEjYt/KecoO9ITSOkJuMamOkvAty4G2UIc35VE+WqYOiuobo5IXIIxr96Cp28Sf+WKkQcZvb1Mahyfl1ZVem9Srb0gv0PYd1K+OMYZ+RD6Bm9f+BtrRPuA0XvBtmP X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2017 02:27:40.3537 (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: BN1PR12MB0002 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 Swicth to use atomic helper. Start using actual user's given target_vblank value for flip instead of current value. v3: Update for movig pflip flags to crtc_state Change-Id: I25dae6d8c29de5d022a42aa99a18a32674b56cda Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 - .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 109 ++++----------------- 2 files changed, 19 insertions(+), 91 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h index 4c0a86e..3ff3c14 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h @@ -443,7 +443,6 @@ struct amdgpu_crtc { enum amdgpu_interrupt_state vsync_timer_enabled; int otg_inst; - uint32_t flip_flags; /* After Set Mode target will be non-NULL */ struct dc_target *target; }; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c index a443b70..148780d 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c @@ -1060,83 +1060,6 @@ static int dm_crtc_funcs_atomic_set_property( return 0; } - -static int amdgpu_atomic_helper_page_flip(struct drm_crtc *crtc, - struct drm_framebuffer *fb, - struct drm_pending_vblank_event *event, - uint32_t flags) -{ - struct drm_plane *plane = crtc->primary; - struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); - 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; - - ret = drm_crtc_vblank_get(crtc); - if (ret) - return ret; - - 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; - } - acrtc->flip_flags = flags; - - ret = drm_atomic_nonblocking_commit(state); - -fail: - if (ret == -EDEADLK) - goto backoff; - - if (ret) - drm_crtc_vblank_put(crtc); - - 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; -} - /* Implemented only the options currently availible for the driver */ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { .reset = drm_atomic_helper_crtc_reset, @@ -1145,7 +1068,7 @@ static int amdgpu_atomic_helper_page_flip(struct drm_crtc *crtc, .destroy = amdgpu_dm_crtc_destroy, .gamma_set = amdgpu_dm_atomic_crtc_gamma_set, .set_config = drm_atomic_helper_set_config, - .page_flip = amdgpu_atomic_helper_page_flip, + .page_flip_target = drm_atomic_helper_page_flip_target, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, .atomic_set_property = dm_crtc_funcs_atomic_set_property @@ -1626,7 +1549,8 @@ static void clear_unrelated_fields(struct drm_plane_state *state) static bool page_flip_needed( const struct drm_plane_state *new_state, const struct drm_plane_state *old_state, - bool commit_surface_required) + bool commit_surface_required, + uint32_t pflip_flags) { struct drm_plane_state old_state_tmp; struct drm_plane_state new_state_tmp; @@ -1679,7 +1603,7 @@ static bool page_flip_needed( sizeof(old_state_tmp)) == 0 ? true:false; if (new_state->crtc && page_flip_required == false) { acrtc_new = to_amdgpu_crtc(new_state->crtc); - if (acrtc_new->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) + if (pflip_flags & DRM_MODE_PAGE_FLIP_ASYNC) page_flip_required = true; } return page_flip_required; @@ -2696,7 +2620,9 @@ int amdgpu_dm_atomic_commit( * 1. This commit is not a page flip. * 2. This commit is a page flip, and targets are created. */ - if (!page_flip_needed(plane_state, old_plane_state, true) || + if (!page_flip_needed( + plane_state, old_plane_state, true, crtc->state->pflip_flags) + || action == DM_COMMIT_ACTION_DPMS_ON || action == DM_COMMIT_ACTION_SET) { list_for_each_entry(connector, @@ -2760,21 +2686,22 @@ int amdgpu_dm_atomic_commit( for_each_plane_in_state(state, plane, old_plane_state, i) { struct drm_plane_state *plane_state = plane->state; struct drm_crtc *crtc = plane_state->crtc; - struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); struct drm_framebuffer *fb = plane_state->fb; + uint32_t pflip_flags; if (!fb || !crtc || !crtc->state->planes_changed || !crtc->state->active) continue; - - if (page_flip_needed(plane_state, old_plane_state, false)) { + + pflip_flags = crtc->state->pflip_flags; + if (page_flip_needed( + plane_state, old_plane_state, false, pflip_flags)) { ret = amdgpu_crtc_page_flip_target(crtc, fb, crtc->state->event, - acrtc->flip_flags, - drm_crtc_vblank_count(crtc)); - /*clean up the flags for next usage*/ - acrtc->flip_flags = 0; + crtc->state->pflip_flags, + crtc->state->target_vblank); + if (ret) break; } @@ -3138,13 +3065,15 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, continue; action = get_dm_commit_action(crtc->state); + crtc_state = drm_atomic_get_existing_crtc_state(state, crtc); /* Surfaces are created under two scenarios: * 1. This commit is not a page flip. * 2. This commit is a page flip, and targets are created. */ - if (!page_flip_needed(plane_state, old_plane_state, - true) || + if (!page_flip_needed( + plane_state, old_plane_state, true, crtc_state->pflip_flags) + || action == DM_COMMIT_ACTION_DPMS_ON || action == DM_COMMIT_ACTION_SET) { struct dc_surface *surface;