From patchwork Wed Apr 11 15:22:21 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: 10335701 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 D3C3E60365 for ; Wed, 11 Apr 2018 15:23:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7A082897C for ; Wed, 11 Apr 2018 15:23:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC2C528980; Wed, 11 Apr 2018 15:23:57 +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 713B72897C for ; Wed, 11 Apr 2018 15:23:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03B2B6E6B1; Wed, 11 Apr 2018 15:23:34 +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-eopbgr20051.outbound.protection.outlook.com [40.107.2.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A5616E6AE for ; Wed, 11 Apr 2018 15:23:30 +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=gU1okEEx/f49IHkDBtMyo9m2FKZV/D3YgoCsYWLoCgE=; b=buA4z7Svu90JTDh6wY4FBdIFbe/00s8SKmgkW9CrUhVddXoPeUhBcCa8cZCjng3DfuTMqhVc5M3O6r4199QSyy6EIAhR67jjqrvh6y88GTaZ8VlgZXFQhhwS6Ec+rI1LAJugLqiF9jP7jj3S2GA21f7W4rKUGgYJUE+2RNnJSY8= 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:28 +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 10/18] drm_hwcomposer: hwcutils: Add function for cloning a DrmHwcLayer Date: Wed, 11 Apr 2018 16:22:21 +0100 Message-Id: <1523460149-1740-11-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:IvNCy2IpC9bC9UWQXUPuzELdq92njJkRzfNtwbYpJsPJ2nUEZnzEHWnraeKKrJ8Ji5HfICrac1MkLB1zNDsneV4SlGXJ+ZxEN1zflkbnodRo20uYk9okX8kVmM0JFXJh6AqoW3f/TSQvR5jaf+RLvGtrFxxhgELNfUHn3k4ArSRR6Qsw3OxJOHcwOkZV7Xoj+dedQ2YRld3qWcA4sQC8dJ2iYOpJ031QL0BfO/os+v4L0cah147/a4QHlssUmQ55; 25:Z1H+1jmOhwwXcc+a7NAxr2A5WQUFKkMH19viw2UzNJlz0AHGdLnv6XxA9Tmt7md2YpDO14nO2ZGqMqyADajRuXc4To3jVBVjFYScdwJeNOrORnua3ly7i59l+NFAbsFIN2LuQh1jci0bKMugaDpRtj/xF3Xv6gvZtcBhjQ3mCDKYh46X+R4bnaY2kJGT0vwMnvTv95pvleaRZKwVzoI4uy8JJ+fHZrbNP0R2SM+iQ/y1AgrfAhbHerdUjhtzZ9L7dO3KIBpt+FtyDYb6fCQqvpYF9duxX/0FHHdNxBufzaI+IygJFgNg7+mk5rD163MgCyCD6uz4xie6DjBSI7K/hw==; 31:mGT+M0E0BnyDwq+cNU/Sd69b57Qcd0FfkkFoxKvgmkoWMhEger9ga7/RGt8pItAHcTTOgK5kM7Rw5B4DSUOVDzbg2Fv60ziVoHrX0pGBB1TEd2xyXAOzIyshZoswmXldZ9T/Q7j82Rn/5XuD+UmNSDB00YN3c0GE0rfVXvgFXDnNh/iUBFRvVRmjhEi9LsQUEAUe5Vko5KuZ3i+RMAeKlk8vQKBQZ/RcZxAQ2M8RNiM= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1249: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 20:bPfPYMyxjbY3/fp/jLNM7AKXF4XZqUtw0LufBwZboTowDuk2nVPK5ofEh3eh1TrCQXCIxgxAOU9TY06SXj1dLeFdqID3ZzNBGktvfZhQbqI55jZP+s16feWVqF2EjC/0CIRhnD7PpqWPZAEEaqoYn2sS87eqzLQR8WxdcRtTJaE=; 4:D4FB238TcKHVGPwzxYAE9LvROwwZKYk/wBXYM5Np2LdpdqdO2QZOy5vU3dNvoLN6gXFpdOlJl09wBQVXvqLg/2UI4NKl/6fkufofD2Qczh/Pb3BbKkPoFkJUnQdN6zknADaDREh0Aszj56ABiz1s+hJWs/uEQAdpjkpJ1GAWRySAik+svAXWa8HF8Vhm9Wf7qE5l2TMzsUdaRwn/us/XUTYfKVTCHd5YvcDOQlxAsnlLNDVllMV5vIz2+XSuwgrnx9Q0c/kxyX691TpthkuX+t4ZFg4oIfTNeHEtnWniEEVF1esRS0lJjMHmIF6rk3QN 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)(59450400001)(6116002)(2616005)(26005)(486006)(156123004); 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:zFSJvUhvOufls7wKy7wef8uZ/BP8mKqlZ0er6fQ?= =?us-ascii?Q?i0nvUlI82I4lGSUrCu0zgQGJTfNSd0DMAXf5O9cwhdKgs1OK75o1HoWYWaki?= =?us-ascii?Q?Fr/zi1nIXOpvv2CYa7c1IsdlVn9gRTcVNBx5aG4FXN2wDK4QPkjG9psCFpt2?= =?us-ascii?Q?fnkeEHZ3Op40zehyWesI+uEKbys6uFJuUjssXKE5cUZBoYSj1m/BmW57OGj9?= =?us-ascii?Q?9KWzPqCduEWXxGiouOGChilv+mKM9iq645xFaig6mjIwDGfCVJFEe1lVJYzo?= =?us-ascii?Q?or+iCgOLW5EsKzSAxWpoowaxoLWfE+/3iVydPv0MuA1Jl+A0/dsovc/LX1xV?= =?us-ascii?Q?K68icO1NQtGJeK48XoxgHETg+T2l1AOiz911Wkuu0dvAKxCk+1XRdN2Ss4uZ?= =?us-ascii?Q?jhW+hGDQV/WL4tT6pHtMllAWtwDvO6On56vYw9/wOcF6D/91TWiYqCzt3dZx?= =?us-ascii?Q?En51PvzLfnbh3ZL+e5H7LdYZmY4Ghg5T/KPUBWh5XBoFwZMfVIpJRqCNviG1?= =?us-ascii?Q?2aF2yl6qJ0PyOrggzsRq3C7gvC7H3sacy8EgAAZdRrnkYYT3d5kN088aIUP7?= =?us-ascii?Q?4LcrsGFtjFz2rWNqLRG0YKTnTjVgh2YmXfmeeSu7J5mruAR12aXM4J9SmDc+?= =?us-ascii?Q?cRxaO7XfPp4KN8E7lNa4uCEtBsWTYjQj58XkI8xNROTIiMztqjfXeLaTW0V0?= =?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fngCLsUrY/U+0sLyHQBALt7ummwIPRYwLJhhPiRNm5P0o3BF2QlCZ4/tTh+yvd+PbtUE8ZOmAYzeylvM3rb/gRsCBaROr28ZncjDnrASRqWVvw7QDs/okp1Q5umj0/9hH1lCr5CF+0EfsrWeRCQ/SebMg6sQ+EMMEIMW3+QPpB5axL/O2CQl9w6j6a2TcaSlGdSUu9CLpTGsR/SzaPZdzDvJZ7Lq8NW5AYTtMmJ+V5QW23QEAJ2fCrGCxw/5KnYFczVYm2RLuTsbgE7FZozvnkHa9mppShyPnJdX4zg1Y3A==; 5:JcfoEu3awpBKxHSyLrk/M8+4uYPDVO1nSrSeLpFJASuttGejuu5dkrRucpBF5UU9QchOJyb2454l1efUTt5g08Rye2qH2wvn+YVZ4f1ZQDtVOCoJgOSJGanDniEApsdxGApawra8oyVVe7XXK5HjodSYQlf1wUT0UpwbuuSCo1I=; 24:WMFWtoD1L8DHYoITr2VqTEOulfRUp+LdIWQYwLN8Qjb7SzD1ZET2NTRPaXif1TpRFoy3AqPy4Cw723DHug2TY7w106TWe/B/89UmuIC4Yl8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 7:9hoWgAGq524s08hdlupnUuo4zAzMwZn0beO8f8/JFeU5Z0MmL+nBIH8gbn11XSm0EyPTrJu75Ww8tu8s9xrm15K4hNU1bLElvZK/hRHEase57jzIHmwrPVgunix8pA060JOeZccyw6xgq2ROoPbx0eCnjAJrPnS9ij4awT2Q6HY9rE0P7Q1Uj9OlcvHDFIvGvppFI2pM6lAB7yGqkwA6k4Q2lQZ/rE9LP7ubvMXwqir6yWnx/uZ9HrWe+B/wSC7A X-MS-Office365-Filtering-Correlation-Id: f99d72b0-c77a-4642-7c31-08d59fc02d94 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2018 15:23:28.5102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f99d72b0-c77a-4642-7c31-08d59fc02d94 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 When doing flattening of a composition on a different CRTC we need to be able to clone a layer in order to import it and then pass it to another CRTC. Signed-off-by: Alexandru Gheorghe --- drmhwcomposer.h | 1 + hwcutils.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/drmhwcomposer.h b/drmhwcomposer.h index f8440fb..b256caf 100644 --- a/drmhwcomposer.h +++ b/drmhwcomposer.h @@ -150,6 +150,7 @@ struct DrmHwcLayer { int InitFromHwcLayer(hwc_layer_1_t *sf_layer, Importer *importer, const gralloc_module_t *gralloc); + int PopulateFromDrmHwcLayer(DrmHwcLayer *layer); int ImportBuffer(Importer *importer, const gralloc_module_t *gralloc); void SetTransform(int32_t sf_transform); diff --git a/hwcutils.cpp b/hwcutils.cpp index 53a7d82..ff37c3b 100644 --- a/hwcutils.cpp +++ b/hwcutils.cpp @@ -149,6 +149,17 @@ int DrmHwcLayer::InitFromHwcLayer(hwc_layer_1_t *sf_layer, Importer *importer, return ImportBuffer(importer, gralloc); } +int DrmHwcLayer::PopulateFromDrmHwcLayer(DrmHwcLayer *src_layer) { + blending = src_layer->blending; + sf_handle = src_layer->sf_handle; + acquire_fence = dup(src_layer->acquire_fence.get()); + display_frame = src_layer->display_frame; + alpha = src_layer->alpha; + source_crop = src_layer->source_crop; + transform = src_layer->transform; + return 0; +} + int DrmHwcLayer::ImportBuffer(Importer *importer, const gralloc_module_t *gralloc) { int ret = buffer.ImportBuffer(sf_handle, importer);