From patchwork Wed Apr 11 15:22:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10335705 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 8C2AB60365 for ; Wed, 11 Apr 2018 15:24:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F4202897C for ; Wed, 11 Apr 2018 15:24:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71AE828980; Wed, 11 Apr 2018 15:24:09 +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=-5.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, 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 1F6B82897C for ; Wed, 11 Apr 2018 15:24:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30BCE6E6B2; Wed, 11 Apr 2018 15:23:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20072.outbound.protection.outlook.com [40.107.2.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id E566E6E6B6 for ; Wed, 11 Apr 2018 15:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=v/9v6uf4sotkqzSf3SpxkxZz6Qd6lpyeibGOUeKQTHM=; b=RliHaLAVkTJO4amYrYDfvI3pCNFFJI+qM1eHcn4aRVgJ5qklm+70GQ2cOzvzVP8cmX2TOQWSoKU+85/y4BX+tbW5Hu5UxP5SHOPzEhDkgQwn0oJqQPrco0DkLabFGdKw/EtEVlVSbfb6wWhwRmnfBd3leRN2wpgH5C8+J1Tg7hI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alexandru-Cosmin.Gheorghe@arm.com; Received: from e114479-lin.cambridge.arm.com (217.140.96.140) by AM5PR0801MB1249.eurprd08.prod.outlook.com (2603:10a6:203:1e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.675.10; Wed, 11 Apr 2018 15:23:33 +0000 From: Alexandru Gheorghe To: dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, brian.starkey@arm.com, ayan.halder@arm.com, seanpaul@chromium.org Subject: [PATCH hwc v2 13/18] drm_hwcomposer: Pass buffer sizes to Prepareframebuffer Date: Wed, 11 Apr 2018 16:22:24 +0100 Message-Id: <1523460149-1740-14-git-send-email-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523460149-1740-1-git-send-email-alexandru-cosmin.gheorghe@arm.com> References: <1523460149-1740-1-git-send-email-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: VI1PR0701CA0066.eurprd07.prod.outlook.com (2603:10a6:800:5f::28) To AM5PR0801MB1249.eurprd08.prod.outlook.com (2603:10a6:203:1e::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM5PR0801MB1249; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 3:XlGxOQORtSWEmtC9bdLEG3rgvPV49vt1kmwoId4wNJ4/fXWhpb+kWbKHHyollFG4E6v0KAzIlSwVC07q9MEoHeCuSofU3ETj1QkLfp5f8jYUfuTDHEK2IVrP6sy1y7S/DysoDTc7Uaw/2gbZ0AfAyGvc8w1D7gB8KEQ4pkufgSbJWbag6z55224j6JMzV1pf5SCIcd2eblVgvVtsu+EayFhtFbDv61U5LWybgPeaZr73tJl4N/QHFVNdhAIHctHW; 25:LCcSuhPdhrJwBbnULbbg/5wlL2it5NTm0m14U7VA9yieQypztWXLUbWJSJR+JzoOkn4KJMGIWoA3ItYU0izLEQ503LRlMdfGSfwd2NBY1c7HgG8KUSNCdXuDxr/VkBkNgVCeENPQcbbiyqd+XQnvWZxMyUIF6hsVEhR1hlubUWr8dgPGStILMDcgZxk7BLA2tkP6wAz1rJM4+AA7mF/mTqHszIDMazHE2fgg96pdqPupIaIR87akXpDly6JWKHL7TBSqhEFWxQI4eob7bzjasW+lETv4EyI2mvtcnnLFGmmJlWyj9zmzQlDVnlHbVF9/Cf/RTPs0j+Z65LT5tIYfCA==; 31:j8WNCmJkGK5hiQ6KIIAN7YdX9cByip78L6Ya/UFofbvg3nfX9xsxKorqfM0pb5Y6Gvh3dT/ozDkTC2CVZY3nNLMWDYw7aCOghk2PhLihg7rkzXHqqKgz9utVFCx6j8niYXF+jqa48eJdcsjvFsuBqF2lix8GQZFsPuEiziJGfQec93IuREVMHisTrTezIBgEzouYjICHBYNVNBOXlMTwyO5DkDtPTtEwAlZORhi7gWU= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1249: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 20:o7JDsYLmZ3lQnpaq7xHQn+xxzRBwEH4oqPhMVUuDVFfgy1S9mUXw/J0+0ea1KpTLHmNC5Zsq6hTJ+sGBYCGtbEZkpmECLtUPHzE9TDWCtigHxDIN1xJ6xCmN76u57wrJwR8gPiKaWdOTej1DwEjZ3n5FAhGF/bipgc6/brmwHmo=; 4:nD70o+aPeY9wM1JI9aCWkvwtwwvkRjOF21GIXDJJX91tB0NO40ztnVZXBq3We3nb8FMnyIMkOSM7SXyHSAcqzmITfWbMc8yhxBiY326xL26hfPQIuB2EAknL4IBUPzKWYAQJnGJNI8Oh91FlagAbb/+5xF/2UpWLNi4OEPkcQl/FgI5ma23Ab3JMKfaLUtFDA2gm0dGhE+4jRWWGxvB9q7kHpi4gPIhMDzEETDT+AsskzxqpMEkD3gdftmRE6nDvdCOYynP4N8UPx0D7A31ui9wWmZM/4DhO0TweqO+mT/h2d5S5LI17jYGxrikfSS62 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231221)(944501327)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:AM5PR0801MB1249; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1249; X-Forefront-PRVS: 0639027A9E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(396003)(376002)(366004)(39860400002)(189003)(199004)(16526019)(478600001)(305945005)(50226002)(16586007)(68736007)(7736002)(86362001)(81156014)(8676002)(316002)(81166006)(4326008)(25786009)(2906002)(50466002)(8936002)(6486002)(105586002)(48376002)(186003)(956004)(5660300001)(6666003)(72206003)(106356001)(476003)(53936002)(3846002)(76176011)(51416003)(52116002)(47776003)(7696005)(36756003)(66066001)(11346002)(446003)(386003)(97736004)(6116002)(2616005)(26005)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1249; H:e114479-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1249; 23:JdPw/IShAnLIeg9/WavOIzuz+gLWmJjRX55QKD+?= =?us-ascii?Q?qvHmO/QWBnG2aI+OlVYKsRzvHC2qzScgFonagjkM689b9uyZ7LkrDXu1FoRP?= =?us-ascii?Q?wv6zAtQ6mDB2TgBGLiPZCvUS6nfp3Nsr8Dh/CI+DaZltQB/Zcrtrmm0jm00G?= =?us-ascii?Q?5ysxNcfRFsCTqjwvoff5E3/ghxRC5PtKpZcDsZZzuck57Xac2JQUO1yca3ue?= =?us-ascii?Q?3RmnQe4Yi3h64G7LJ3UYG7LMz4t7GKJvHzkLgwGvmjtyx6LyU5wWSiKUZdX4?= =?us-ascii?Q?ITc4F28bH6kHmvavb24oA4Z0E3v6o1oMDsalFhe5/psuOG2CnQFLzui3/LTk?= =?us-ascii?Q?0ubfq7H6VvrPGqIorgbgLLDnZ0Txox8vendHA0R2tE5flQL5ydIeqN89j53G?= =?us-ascii?Q?8FuQQfwErT1kgDydeFzYy6fMG8w1yo8qZNRDyLsgw8xpET7IPXMRa0tP0Rfj?= =?us-ascii?Q?U+T304O71STdtKFygaPSCpTodkli6iEkZ5wZ6iGfzUqD8MOIChGy87c7IhW4?= =?us-ascii?Q?xfpxPpLv5Zas8zkDp+ZkDr08IQB2571HKdqh3cZNjSLBZq+hEZpDkH+MLckq?= =?us-ascii?Q?BFxSHPIF8h4KE5I552UoaY9fMV3spfJoHaKano4PNBsHRnOwJUo6ropUvr1Y?= =?us-ascii?Q?9YloDDFhOMCAIv4LB5HGK7hJoV0BU35XCAIucjQw6SACyNOTFzaySDSLiZ5S?= =?us-ascii?Q?Xkm8b2IIkLurMe59nqxIXEFvpTMRYLrB2E2l0+Xpi/gptQY+uQdMUVAgdoMd?= =?us-ascii?Q?rGADJgnH7U8QJ7Il/9Pi2H7GaUtvJzo9GgNgvMFUQhfVdG4fi3DH5h1sSSO0?= =?us-ascii?Q?+fcbLKROHDIN6jVcfVEklDiojtgEZQBcZS66b1veZAnLZv9Ry0OXKRUrfQ0D?= =?us-ascii?Q?yEvT5J4rGZUnvu1fTLifr6BklCqELYdX/BC7KDXd/V7uCuTph9FSqKxPwOwK?= =?us-ascii?Q?snn7RlpGxQNt4RcRPlIeNa62Fn6DUNkhyHxDhp49xAsldyNxbwlPZN470me9?= =?us-ascii?Q?+MY0ZUGKaEz3vIV5BAfM+MS3PgFO5eFldS29fibVJUlqC7kjOzgjHwQc344/?= =?us-ascii?Q?VbNr8LQafUcmjAMtPIOrPFYE7Opcr941af6kccD06Pm99+nhsbym2QAr0cYq?= =?us-ascii?Q?Omac588KkmUdeIf39PxO4qf8X43UJobLLx8jerjAPqJhMOtwg1Y3fXQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Antispam-Message-Info: i66ZQEwg0qYqYKaBZnkOWtQ/c3NLdhcBL1qGTdIu/4gGIGRDiqVY9Rl5t0Qy4cQFEXb1IVpEAlpsiG9yQSfIHEmSbbn4aFnIcKrDad+imd6IGo99phU+nssx1/htixfNsbHHw2pVrXA5ld8jl85MbE4s7s5I40c/s8pSd5cv/0q0RSPfD5x1pJY9ydfjUa+n X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 6:0f/Z+4er/f5MStMgG+pO/kyirAtQHfmVK1xHRtu7DRIrausNOcgWt3GKnBNnKCHK2cMiprpJo2zbtJq8QrV+Yf+ejD424TZSneRRikmLeFTTuSyWfCVXcwfI0T4x7ypR6HqG81bJubH/hf4Cv8eqVbOcziLh4BpiTIs0cwI5OXuDMRMa3d3ltDb71xkGT+i1MYIS+qtXogJSTWsY9cS3+L3nT2MKR51HrRLZDSMGHoVDaBxHGGeazIB9t4OqYKUimJcVrw4UfBcCulU8uOtEF6Uuu+E7warihbYm93qd03u20uhFleOYUyibQKA/u57UkHAUXYDVfrTqsWnr0ZZMkQeEayE7IJq7hF+5MSVga25+OZQQA8F3fK+dO3BX8J4H+/SjMn05l7EvMngCTAVbgq2btmo1/KsWeatbwZ+Oa10XXkfT1dJiVGUi6gfEQV6iiDMyyn8IE4qBAGhM/MjvDA==; 5:E91KT5vE7mek0kZ9mQA2FqD7cZSRpoaNpB9mGDjHSGZABBzyhic2UzfUW9ZBzGQyYIv93FrDVioO2/F6aP4UvXgt2rdX8i7NehhLe+aeVXcVj5XrmE9+Se4BpLg3FvnxgfmbZsckP/rN+518jc1+TbH3XJ2N3oGa2GxaIZZ8AyA=; 24:PDvZFzYAq6l1DhX5rB8mWQD2HgAL7zq84PPUhj30C4Dp2z++fVVnuvw/qSbQw2fRq6NL+MsT/x0xpr6Dg1aqKsQO4mlb+Wpa3ivpUUGZt3s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 7:iaUoRL/oeg0vhXVMEckU0g2JsXJ1wGUMsPoNvagsVek96+z39+Z9IA5yY+OJkv23tRR8DQyTg+c5DN6+ekdnQ1SK3/0S6fitDQYJzHEKtBi7hrgwTowQhD/y9Mesl/XtDgjixovkt1pGP5Qc8rDVcnDWPvXW/ie7F/PSJT9vvCEsvZwyzx869tzD7/UMec5Lisfn0CUE4q+gfiG0FFlRGf70o5i8KRJo1TH9Z0eCsQ+YIj63l1PuGvNkPK91jzD/ X-MS-Office365-Filtering-Correlation-Id: 470a43e6-0414-4c14-787b-08d59fc03042 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2018 15:23:33.0078 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 470a43e6-0414-4c14-787b-08d59fc03042 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1249 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Currently Prepareframebuffer uses the mode of the connected connector to decide how big the buffer should be, however when using the drmdisplaycompositor just for flattening, the mode had not been set yet, so we need a way to pass the desired buffer sizes. Signed-off-by: Alexandru Gheorghe --- drmdisplaycompositor.cpp | 7 ++++--- drmdisplaycompositor.h | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp index 6e5be24..afd3b05 100644 --- a/drmdisplaycompositor.cpp +++ b/drmdisplaycompositor.cpp @@ -268,14 +268,15 @@ DrmDisplayCompositor::GetActiveModeResolution() { } int DrmDisplayCompositor::PrepareFramebuffer( - DrmFramebuffer &fb, DrmDisplayComposition *display_comp) { + DrmFramebuffer &fb, DrmDisplayComposition *display_comp, uint32_t width, + uint32_t height) { int ret = fb.WaitReleased(-1); if (ret) { ALOGE("Failed to wait for framebuffer release %d", ret); return ret; } - uint32_t width, height; - std::tie(width, height, ret) = GetActiveModeResolution(); + if (width == 0 || height == 0) + std::tie(width, height, ret) = GetActiveModeResolution(); if (ret) { ALOGE( "Failed to allocate framebuffer because the display resolution could " diff --git a/drmdisplaycompositor.h b/drmdisplaycompositor.h index ccaffb4..0f8daad 100644 --- a/drmdisplaycompositor.h +++ b/drmdisplaycompositor.h @@ -115,7 +115,8 @@ class DrmDisplayCompositor { static const int kAcquireWaitTimeoutMs = 100; int PrepareFramebuffer(DrmFramebuffer &fb, - DrmDisplayComposition *display_comp); + DrmDisplayComposition *display_comp, + uint32_t width = 0, uint32_t height = 0); int ApplySquash(DrmDisplayComposition *display_comp); int ApplyPreComposite(DrmDisplayComposition *display_comp); int PrepareFrame(DrmDisplayComposition *display_comp);