From patchwork Wed Apr 24 17:08:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10915293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94B3A922 for ; Wed, 24 Apr 2019 17:08:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D7FA28A77 for ; Wed, 24 Apr 2019 17:08:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71D8128B81; Wed, 24 Apr 2019 17:08:54 +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.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 20E7728A77 for ; Wed, 24 Apr 2019 17:08:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B513891FF; Wed, 24 Apr 2019 17:08:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84560891D5 for ; Wed, 24 Apr 2019 17:08:46 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id p6so9679437pgh.9 for ; Wed, 24 Apr 2019 10:08:46 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=fGMCTWJCYFtCmoIcDdlw37giMEwdIgyb7vmAWnlhAbU=; b=k/Epd4dN8d9pb9TcXGusRAOzQN2CHpdSPdVxcAUXHPaUI97+dOXGDE8LRQTenwoY9c 3bsxFdplAyJiqOLKZgYJgK7h0GWsz0GdEKmPYTROrJiK1BdfdkUM5pFHUwlmBZfV02g+ qaZ49F1dWl7vvPfZ7mbgS16Hea5HAnQonbaMiYsWhH7DRGuIWT+pu37rdn9tcvPtQTC4 E9ylH3PxorFpoIqu3lgPoG2r+STRaLZs3chXgxshp0Vgoo7uEnqjH92O0LNQZQGZ16Ro xKRILBHDmNVfj+3Yz4gXHhtMNjZa/4hCL+38OmnQlwsjlwaCWK88c69qiTW5v6D/gTDd vMXQ== X-Gm-Message-State: APjAAAVp2EaPI1qybBgMwAQahkgB3FGlvDzxQ/hfOKa/4DFIiBef0tl0 dbj4/t7k9zggTAEC3SjqdoKcd6qEDcc= X-Google-Smtp-Source: APXvYqz6CFw5lGSSen7EuCkTvTwvP/PD0nL/SxzVhNOmBWySmKaHoOzCFB2ss79TJh7/2xra2caRHA== X-Received: by 2002:a62:5ec2:: with SMTP id s185mr35524823pfb.16.1556125725630; Wed, 24 Apr 2019 10:08:45 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:44 -0700 (PDT) From: John Stultz To: dri-devel Subject: [PATCH 1/6 v2] libdrm: Use mmap64 instead of __mmap2 Date: Wed, 24 Apr 2019 10:08:36 -0700 Message-Id: <1556125721-32145-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fGMCTWJCYFtCmoIcDdlw37giMEwdIgyb7vmAWnlhAbU=; b=UTf2v6StjvEQJI37I3dzf0v43Cliy2iqN+hDTOGB6Gn8Olsb+LvnwR3EcjXKL4+Xzl Ldr7ePtP+nu58vm3NXUzS3CVrzNuhzhDgCvM27ViArCBGv+PAz+jE/t2cwmaYCKJ5uq4 9Ltc97Eu8BJYuRf1aSSRbQ9xLnilprXhQ6V1f16h3srFZ7IwA8kLusO8kU2bj+h6DsJ9 58DXBAuRSDfH1azZDVuBwRJ7LHRbpuGysYYK4ehwj6Ji7hWzJnlu4Ff6BUmyIYlK6wl4 jOvblAtvL3oGRx6dAE3cAacdVwj5JVEplH/Xu7jKn1HETxdxXr+epfzqk8FLJFUAXfeZ XljQ== 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: Marissa Wall , Sean Paul , Alistair Strachan , Emil Velikov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul __mmap2 isn't supported on all platforms, mmap64 is the right way to do this in android. Also folds in a fix from Stéphane Marchesin Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Acked-by: Alex Deucher Reviewed-by: Emil Velikov Signed-off-by: Sean Paul [jstultz: Folded in Stéphane's fix] Signed-off-by: John Stultz --- libdrm_macros.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libdrm_macros.h b/libdrm_macros.h index 95f0ef5..0dca827 100644 --- a/libdrm_macros.h +++ b/libdrm_macros.h @@ -48,8 +48,6 @@ #if defined(ANDROID) && !defined(__LP64__) #include /* for EINVAL */ -extern void *__mmap2(void *, size_t, int, int, int, size_t); - static inline void *drm_mmap(void *addr, size_t length, int prot, int flags, int fd, loff_t offset) { @@ -59,7 +57,7 @@ static inline void *drm_mmap(void *addr, size_t length, int prot, int flags, return MAP_FAILED; } - return __mmap2(addr, length, prot, flags, fd, (size_t) (offset >> 12)); + return mmap64(addr, length, prot, flags, fd, offset); } # define drm_munmap(addr, length) \