From patchwork Wed Aug 7 14:52:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 170762 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp7246520ile; Wed, 7 Aug 2019 07:53:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxw2K0kRRtZIihEyneIu+iyjPjWE625Ppx4NUHYsxYA3qUosbQxBGP0Y1zIM1uQuuRKx3Wz X-Received: by 2002:aa7:96ad:: with SMTP id g13mr10115377pfk.182.1565189586889; Wed, 07 Aug 2019 07:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565189586; cv=none; d=google.com; s=arc-20160816; b=gcI7pESyxeCmouKKPZZS6ut0SR/JTXQVkckfUYAUTc8Q+q35H8c3r7y4do1NOA9gTw afVC9XkEhgPD5pZzgCQAJtPJA00Eso2npZyxWbvwwdwRjKNp5BFLg3yI1n9ofrbuDbhF kBQIA/K2mJ5ALk4PEbyP7BjKMmUCCQxaMWprwx+y9JbescMQUldH73lFurt40Y5Ma5xF d50YKgtw7JHP4yayyi98pKfzxp34Glp4gaURnR6ejDGc2AQLulOENyk4zDIQ9HrrHLzQ RiJhky7LmBTgMSCRL3TFnO1Hzkq25ztwC0/U8k3qN25vaTz+dcBnwwOOd2wFt8JqtGaC LXsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=TDpFAu5ppdJsN7IGZ4gzPX6OUgWdkRSKOCfyfrjWkyo=; b=C9E8YWPCeYwfKOM3PySXGgocdFYszJvFys54pARm0qi41tVOl5AEJLVytbug2jY9ft plVTzS1hbhOnJlMFnOMJXIRsW6KcE67/kCC97u572+Hv8+2sg6/sH9JVT3x2pt82Ko4w DwsI/JPOF6GDLIvi/poVIbKRtGjXhgXhkFGNDVgPG8uMtQ2W4k+rkda7Msuo+OFshkZy 5/D6+zqKd1B8cNVRbYGJ5uHMtQGsDjglIvw0kaBhJdCP+Yd9OokB/HW/mWFuDCpnhyZo zjihv+y5092lOETr7HOmQ8SBrymPnfFDfwwGyK5xYWtBysb9QfzUjY913ajXNenGww2n zmRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id g12si16323916pgs.249.2019.08.07.07.53.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2019 07:53:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A072A6E720; Wed, 7 Aug 2019 14:53:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 779A66E720 for ; Wed, 7 Aug 2019 14:53:04 +0000 (UTC) Received: by mail-yb1-xb43.google.com with SMTP id o82so556233ybg.10 for ; Wed, 07 Aug 2019 07:53:04 -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=Yzd13DG1rp+WsyyQG2U0e84Dj24v4+N318aTRdw7530=; b=K2nJ/K1tN/DIugmpbw5HzBXfXrLRfOtYVs5mEiXnP59BvVvnWC/8Kzvgm1DONpAdyM BuQELiOsfN1P7yjMVPnQhoCems7txyK/AHSi6BCO8BrQpa19mOAiQTv1snSYsGPB59Hf 1RMguaSXk2tLG9bIUcOP5c+53TRmUbUIicWVjl8f8TyoYoicbLhcR9UCXc90YxGqAYf1 2A0tN0GupRf4sAuCZuGDgvyeER6HXjCyr9GWdTctpsqcCqjxPFt1No/4miwIqgNdZIzO bJ0QHu5P71LKfLCttrsNk/aLMmGYVxfqEw+HsZ1O02xNtkWUDT5mZ1LKQSv21PDFR/07 TtDQ== X-Gm-Message-State: APjAAAVJNIQWBvKC6UtKHGT6NcCL98lu2pJnbiiJPGSYI3vu10JyBr0v J929opNXl5KSP3ta7IOjpPT4J3tbOZE= X-Received: by 2002:a25:ba81:: with SMTP id s1mr6797361ybg.354.1565189583544; Wed, 07 Aug 2019 07:53:03 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id c123sm712935ywf.25.2019.08.07.07.53.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 07 Aug 2019 07:53:02 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org, robh@kernel.org, emil.velikov@collabora.com Subject: [PATCH 2/2] Revert "drm/panfrost: Use drm_gem_map_offset()" Date: Wed, 7 Aug 2019 10:52:48 -0400 Message-Id: <20190807145253.2037-3-sean@poorly.run> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog In-Reply-To: <20190807145253.2037-1-sean@poorly.run> References: <20190807145253.2037-1-sean@poorly.run> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yzd13DG1rp+WsyyQG2U0e84Dj24v4+N318aTRdw7530=; b=UDEy+ckbATFh4PJW7sT+KN15TaTALyWXTadz9Q5XHvUUXfIvpt2dllu585zi5pSKd2 rl0VoHQlglfyH8hG8RZa4ZJmKIZqAceRE6gHNTKjDxwjHhhoY0aRjTHkWRurQXd3dN6n c70ZGiFEqHhoNY2s8fuB9UlaRN63r06a54tgpwTrhZIU/o2zcHF10E9wDdX233K+tQLe 0OSPFlCvaigPrbY7otybF3V+XEVT/vg1epnifGAY3ADZVOHWZ1Sl3BakTdmtYEN8X+ot eyJoNWJzTvASOsu1Nf6gbTgNFDZPOT8x9/QCDC9ztnacyZ3ZPfKrMfVYYSRF1hFk8fyU 3KYw== 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Rob Herring This reverts commit 583bbf46133c726bae277e8f4e32bfba2a528c7f. Turns out we need mmap to work on imported BOs even if the current code is buggy. Signed-off-by: Rob Herring Signed-off-by: Sean Paul Reviewed-by: Emil Velikov --- drivers/gpu/drm/panfrost/panfrost_drv.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index b2e325e270b7..b187daa4da85 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -291,14 +291,26 @@ static int panfrost_ioctl_mmap_bo(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_panfrost_mmap_bo *args = data; + struct drm_gem_object *gem_obj; + int ret; if (args->flags != 0) { DRM_INFO("unknown mmap_bo flags: %d\n", args->flags); return -EINVAL; } - return drm_gem_map_offset(file_priv, dev, args->handle, - &args->offset); + gem_obj = drm_gem_object_lookup(file_priv, args->handle); + if (!gem_obj) { + DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle); + return -ENOENT; + } + + ret = drm_gem_create_mmap_offset(gem_obj); + if (ret == 0) + args->offset = drm_vma_node_offset_addr(&gem_obj->vma_node); + drm_gem_object_put_unlocked(gem_obj); + + return ret; } static int panfrost_ioctl_get_bo_offset(struct drm_device *dev, void *data,