Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4146897imw; Thu, 7 Jul 2022 13:35:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tOeYzWpop2tAfxPI/BvE4wVqiPQ9feHNU1AzagGrqAZAJj75tKpN155HI16hPEykUDMMol X-Received: by 2002:a63:f04a:0:b0:411:e30e:4d9a with SMTP id s10-20020a63f04a000000b00411e30e4d9amr31422463pgj.58.1657226154960; Thu, 07 Jul 2022 13:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657226154; cv=none; d=google.com; s=arc-20160816; b=CmyngWc90YXp6QPjZiBG6CLApEkohI9v64pjPvHRuPTdV8+mbcJ3SR0wGTuWS2wRqK D0ILRqjbK931X6RSgR3RHFwc5CKVLnM7xbEMsq3aH9r+eVVkcsdoo7pRn5wwJCebSV1f yIYmZAWw9lnIC4lZaPnsbZehmqBC6hh11rNs+FIZTK1J9QtvaxQbRm/TvmDVhB+KNNzs IP3q37KnVkIV9FIi1Cl8k+QBffMbqQ9j5pnOeN6FtgTW3fPJZMMIwlNNSzWqEOIYGaLj LIzsHsXK7/hpeFhVQkeM4ogBZ8rV+ZgDDzP+u5uI4D21Ept6KREQaAKezekBWBf6qfvG FgVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x/9lAK8+CvMKqYrH/6IWAxQMPieF4DFJevGGNmjeys8=; b=BTRkYPyxjZKpkOvWn5isO3pvNsrd8WrWnVnN39Rbb5YtALjt1TTBnOllajEPB3g/8n m4BxocxEfQ0LDViNK5D0O4oRvtSJPYp1/hQEsWlCcKbacCGEwnA/gZj1rA9faORlPNmA 9YNFNikFlZOS6LvEjQvcWpMdUUxy4TN9FViSgVYvggan3P2PkkR1s/4ALpaPx1Epgljv 7FtOvpmzB3W5vl1J5MoKLX3OOGRQ6DcfcJLN5JG6VrRgSr+pbZk2x0eooOVTZ3yAcOO3 UvmRTonNU2HhFqHeynd9arDf4o6GsHOjvwmvynXH5kjYWLQ97MckX6Ywu5A/LYNEPIeT TYtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=XHKITXNb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l63-20020a638842000000b004129616bd83si2256057pgd.250.2022.07.07.13.35.42; Thu, 07 Jul 2022 13:35:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=XHKITXNb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236836AbiGGUC5 (ORCPT + 99 others); Thu, 7 Jul 2022 16:02:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236755AbiGGUCr (ORCPT ); Thu, 7 Jul 2022 16:02:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25427205CD for ; Thu, 7 Jul 2022 13:02:47 -0700 (PDT) Received: from hermes-devbox.fritz.box (82-71-8-225.dsl.in-addr.zen.co.uk [82.71.8.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbeckett) by madras.collabora.co.uk (Postfix) with ESMTPSA id B746066019D5; Thu, 7 Jul 2022 21:02:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657224166; bh=qy8+fGCHoC0k4JC8KL3MA8/A+stlKuCvaW0SY+DabgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XHKITXNbokLUcewLHkw402KhFQh7UWhgyGj5R9Eh9QkF37aVykycR81Mn/seHYjYz JJLhpR764RYcSYoBCjHYemNaGGNUxP62KZTCa4VDU88Vb61vvlVW3sAAd3gSVFL8/v 6ka8foOd1euFPuNFRBTiZnPIJoq/WcXjb2l3VhSfVuu+aqYkOT9Sje+BHh4/vNs/F6 KaMouzWvdWDATsCMPDJq3MBWBoGo5m4IuRhBTmG1g7Oo6oiMtH3bG+cfXZgKzN6DA/ 8f0TZ/NMN+wDasrAHFwdtdmdfJSm335RLPv+cPbUVN9r9URZ0lalwHJzrOKC6bwxe2 NkR1uw1NwXacw== From: Robert Beckett To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: kernel@collabora.com, Robert Beckett , Matthew Auld , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , linux-kernel@vger.kernel.org Subject: [PATCH v10 04/11] drm/i915/gem: selftest should not attempt mmap of private regions Date: Thu, 7 Jul 2022 20:02:22 +0000 Message-Id: <20220707200230.1657555-5-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707200230.1657555-1-bob.beckett@collabora.com> References: <20220707200230.1657555-1-bob.beckett@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During testing make can_mmap consider whether the region is private. Signed-off-by: Robert Beckett Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c index 5bc93a1ce3e3..76181e28c75e 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c @@ -869,6 +869,9 @@ static bool can_mmap(struct drm_i915_gem_object *obj, enum i915_mmap_type type) struct drm_i915_private *i915 = to_i915(obj->base.dev); bool no_map; + if (obj->mm.region && obj->mm.region->private) + return false; + if (obj->ops->mmap_offset) return type == I915_MMAP_TYPE_FIXED; else if (type == I915_MMAP_TYPE_FIXED) -- 2.25.1