From patchwork Tue Apr 3 03:37:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10320543 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 244BE60390 for ; Tue, 3 Apr 2018 03:37:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1751025D99 for ; Tue, 3 Apr 2018 03:37:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B7AB25F31; Tue, 3 Apr 2018 03:37:42 +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 762D525D99 for ; Tue, 3 Apr 2018 03:37:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A1DF6E264; Tue, 3 Apr 2018 03:37:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 874756E264 for ; Tue, 3 Apr 2018 03:37:39 +0000 (UTC) Received: by mail-pl0-x243.google.com with SMTP id b6-v6so5075570pla.11 for ; Mon, 02 Apr 2018 20:37:39 -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=1QTJDFhrGujbbrCoiIfeQzr2Zc0JWpDdNHBiovbbIfw=; b=HnTV1pj4B9mdpG86L6qbqbRG6t2NYSlv+qlch4W1lF9Rv7k9XYtP1FhUCXIRbRtxwa nAfKyC+OqqbuKk+Nw3lgmR7JFmeUjfXzs/IiEGAz56REFKWiZ4xhh+oMyoe/TUt5MaWu DkeU41k4EkMhdCc8BVh0RBlfBYe0k/ul6/J3A= 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=1QTJDFhrGujbbrCoiIfeQzr2Zc0JWpDdNHBiovbbIfw=; b=PkDoxzK4BNqbA0j+MQj7BO1yS2Dfb3/iem1U5S8FvM0Etgf7oAAN/hHeaOe6dt5kti BSGeYf4LgjIsMd/6NrNLpy00u18psQ2LiFnnPZbD6jt/sItK2WMex+mjqyYMHsf2GO/0 4W1YW4xlBNo36E/Pvu8ITdb8cdKZ/RjKflukUlzIaShJbr+bbDDQ803HGWdoq0Fz5tCR UnUdiYrsepzDHT2YD40hPZhudY6jLvMjuOZDZWZRH6RKGaeVhT5v0/BFEwpkzBzQ2jhX GD3Gm1KhjGS7sJZNGU5M27oPC2ETGesMSS6wUEyR3ciYrI/9/oK68GZZu2t9CAW4pzCN P3dg== X-Gm-Message-State: AElRT7FVr34cj8fm+D2xsloWUgnRTSfDEyE7IQSQXLgiDGDQ3+6xl3ac so9aS8h99b03DntF7tHXluP4vL72lHM= X-Google-Smtp-Source: AIpwx48NaJZdRJQlSHIsNlv/WG/jZzUwH2+I9ptY8eii8bhO1sdyFSwfVHryIvk1pdk+nLX3RNh0hw== X-Received: by 10.98.245.7 with SMTP id n7mr9190887pfh.164.1522726658355; Mon, 02 Apr 2018 20:37:38 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id f22sm3173341pff.146.2018.04.02.20.37.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Apr 2018 20:37:37 -0700 (PDT) From: John Stultz To: dri-devel Subject: [PATCH v2] libdrm: gralloc_handle.h: Fix build issue with Android Date: Mon, 2 Apr 2018 20:37:33 -0700 Message-Id: <1522726653-19248-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: Sean Paul , Robert Foss , Stefan Schake 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 needs to return a native_handle_t * type, rather then a gralloc_handle_t *, which is what the code actually returns. After talking w/ Rob Herring, having the code return the native handle should be the proper fix, so that is what this patch changes. Cc: Chih-Wei Huang Cc: Stefan Schake Cc: Robert Foss Cc: Sean Paul Cc: Rob Herring Signed-off-by: John Stultz Reviewed-by: Robert Foss --- v2: Change fix to return nhandle instead of changing the function definition --- android/gralloc_handle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/gralloc_handle.h b/android/gralloc_handle.h index 9cb5a5d..bcf753d 100644 --- a/android/gralloc_handle.h +++ b/android/gralloc_handle.h @@ -105,7 +105,7 @@ static inline native_handle_t *gralloc_handle_create(int32_t width, handle->usage = usage; handle->prime_fd = -1; - return handle; + return nhandle; } #endif