From patchwork Fri Mar 16 21:48:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10290323 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 E500060386 for ; Fri, 16 Mar 2018 21:48:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4313290B3 for ; Fri, 16 Mar 2018 21:48:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C664A290C9; Fri, 16 Mar 2018 21:48:13 +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=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 3907F290B3 for ; Fri, 16 Mar 2018 21:48:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 35C406EBF7; Fri, 16 Mar 2018 21:48:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl0-x244.google.com (mail-pl0-x244.google.com [IPv6:2607:f8b0:400e:c01::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5312E6EBF7 for ; Fri, 16 Mar 2018 21:48:09 +0000 (UTC) Received: by mail-pl0-x244.google.com with SMTP id m22-v6so6662800pls.5 for ; Fri, 16 Mar 2018 14:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=UU+T9enFqHQe6BHLGglaPDtJj6+ZG+7jUFxqufR0qcw=; b=io+rQgBUDdb7QvwB9DeejesFPAUeRWOCVnYNdVxbPenqB6uJhCi+GAlo9TpnyDmNXk vor5dNdmyvkUyardx2rgcLTTsZ4M2JL4MvVTMm/L3z1HLlpkfi7WUaLreRC+ORdtHA1l xi7wC5p+xytmlXkOoFJqdvS2Hy0Wj6thr2bLw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UU+T9enFqHQe6BHLGglaPDtJj6+ZG+7jUFxqufR0qcw=; b=f93w94j1t1CHAnCmusDEMbrx9qp91vAzcM3xHlKReJZvJ1UMbY+8JXY/Poc2oojRkc v1oTp+BzBnw3CJwqiVdMY+72iAkZsqppgh/PSXNHZZnOBvlhOAG1bUH6FKA5rId4697f CNEc+0vSnn6CuW4eTXy/KLnU0QaVoYZfAhZAsseTq66EF5Dlo9po6IptIv7x7Fa5q6qF Sl/+hBbeCi/921yutIdTiX4u1QiIJmnPPyQHaWQBNIEO/NDBbasuehWsORuKDAlIjVlU ie3j4xH0C9RON//JjQYORKUm9Fhs2/9yPvBPUYkwQ3YBKojjxKYvYvnoZC8ZMZZ+SNEE pK4w== X-Gm-Message-State: AElRT7EGRRVO7s4aLnjDekzvtRWgPFkdUB1nx8kgLOa+esD4m87NUzHt JC8h2yIECBfMk2d2n2lat/mA9Ulf6Bo= X-Google-Smtp-Source: AG47ELsO6Kc8WHZJJfakHV/LrHoT1NajMw/b9s1SMx/A82hKb007P+dnFCSgvgjdPEeDnvqGCvtd+g== X-Received: by 2002:a17:902:b185:: with SMTP id s5-v6mr3594015plr.109.1521236888048; Fri, 16 Mar 2018 14:48:08 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id q62sm3887124pfd.61.2018.03.16.14.48.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Mar 2018 14:48:06 -0700 (PDT) From: John Stultz To: dri-devel Subject: [RFC][PATCH] libdrm: gralloc_handle.h: Fix build issue with Android Date: Fri, 16 Mar 2018 14:48:02 -0700 Message-Id: <1521236882-21120-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 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: Robert Foss , Sean Paul MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In trying to integrate the new gralloc_handle.h with the drm_hwcomposer, I started seeing the following compilation errors: In file included from external/drm_hwcomposer/platformdrmgeneric.cpp:28: external/libdrm/android/gralloc_handle.h:108:9: error: cannot initialize return object of type 'native_handle_t *' (aka 'native_handle *') with an lvalue of type 'struct gralloc_handle_t *' return handle; ^~~~~~ 1 error generated. This seems to be due to the gralloc_handle_create() definition claiming to return a native_handle_t * type, rather then a gralloc_handle_t *, which is what the code actually returns. This function isn't actually used in the current drm_hwcomposer, so I'm not totally sure that this fix is correct (rather then returning the gralloc_handle_t's embadedded native_handle_t ptr). But it seems something like this is needed. Cc: Robert Foss Cc: Rob Herring Cc: Sean Paul Signed-off-by: John Stultz Reviewed-by: Robert Foss --- android/gralloc_handle.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/gralloc_handle.h b/android/gralloc_handle.h index 9cb5a5d..6e925c9 100644 --- a/android/gralloc_handle.h +++ b/android/gralloc_handle.h @@ -84,7 +84,7 @@ static inline struct gralloc_handle_t *gralloc_handle(buffer_handle_t handle) /** * Create a buffer handle. */ -static inline native_handle_t *gralloc_handle_create(int32_t width, +static inline gralloc_handle_t *gralloc_handle_create(int32_t width, int32_t height, int32_t hal_format, int32_t usage) @@ -107,5 +107,4 @@ static inline native_handle_t *gralloc_handle_create(int32_t width, return handle; } - #endif