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: 132698 Delivered-To: patches@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3310326ljb; Mon, 2 Apr 2018 20:37:39 -0700 (PDT) X-Received: by 10.98.238.10 with SMTP id e10mr9304843pfi.129.1522726659030; Mon, 02 Apr 2018 20:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522726659; cv=none; d=google.com; s=arc-20160816; b=vxglDfq8Oa9bASBs1x/jq/MwjmH1MQcjYboo7qva99PQ2lfVzZpjyHAkeqDB//tGaK NbZFET2+1gHYx4jrMWVZ6HYw1CfeD8H77cj001c7q4Mdkmx0nxJkiw7gc3IKIfYYlw0g ImESxJsFzzZxvmqSd2fGEz72Uy1LZuLjYeIpDKdNPNmNvXMr/dz/Ig8Aula9ARIyyoj7 6+mXYVTloXSz5f6HBFq/013xg/bX/49UGZHMEim+dNLgrgVHpasY9inG6PysvsoGoUMA mY2foeshvA9VcpoVFR0+sCqz/j94f104A7X8g5migk5tEzlux7YtYUrEKebHitprK4Rs UxKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=1QTJDFhrGujbbrCoiIfeQzr2Zc0JWpDdNHBiovbbIfw=; b=VuIUOG0IGpyhKyndmXE3uNrcSBXwAqVFy5KKp+Ic/Hie2opzL6qV+swvArYqr1bqwU xttSTdfDBxkPVrLSu5H91UvWoBgTfUzaklngPNlgBnRgdbybYp2AYtPrC3r8kq3u5zcE 0R94mj4SPwWucEYBkP8VgRvQOEoG7SxMax0atWr96pQHiVFBAivZsdObhscG1QgGAZ7t S5DU/4O6KQJ/UYSElfwU8UfejvlYQlsOEYE+TZs8RoAgXEyzGPtwnfHf3AAL3MvQY+dB NEN3JJ/Pog+jimEdoslwE6si9wFgk5pAsppsXqu4nsGzOr3Cvj3KbLjRBNMbMFqYLx9R 4dJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HnTV1pj4; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 68sor511175pfx.9.2018.04.02.20.37.38 for (Google Transport Security); Mon, 02 Apr 2018 20:37:39 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HnTV1pj4; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=CpJhxtxyIyFpyKD0mZ0roqyBNfj7pzUnVlLduTSQV6tLenwuG86XIbgmPihJcVm6WE xi9+S1TvMucTTA8d7oceP77McK9pLsVjhjpuvgrHZvsz16KEY42z2IMpQT5+hSugeDcs L7kFmUD5RzoVy+GMEUjyyjWI37hRVqjqdk9HNx3Ug0yKIJgV0uU161vHWseDZ+/PqdMS 8Ij/44Yebhwd+NV0IlI2VlCY+fayfDjrvCnLcriZOEnN8Qo94UHpGvvPR1c+UPgxifwQ HMLzNesdIuB1y2vJUzciAwbzSN68DEAmLdN7Lb6xUszS/HU4qBD6TLO51cXy6Kh4I0Yx yHPg== X-Gm-Message-State: AElRT7EqbKgdm71gLuEGJ6gkcYiuZG8UzJ8hs1tYorHL1JS5FF0ZU5wo IFOlsBBcp7AG4pXWP7z6v4jKp50erj6qGA== 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) Return-Path: 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 Cc: John Stultz , Chih-Wei Huang , Stefan Schake , Robert Foss , Sean Paul , Rob Herring 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 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 --- v2: Change fix to return nhandle instead of changing the function definition --- android/gralloc_handle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 Reviewed-by: Robert Foss 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