Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2083361rdh; Sat, 25 Nov 2023 12:56:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6NfqxwSFtMy7b2OOibTAd4+3SFegWbLeX3WStFJx5ubESlyc97yckTKemSZkZoNNCH80F X-Received: by 2002:a05:6358:89e:b0:16e:1a22:a1b9 with SMTP id m30-20020a056358089e00b0016e1a22a1b9mr7255290rwj.15.1700945766108; Sat, 25 Nov 2023 12:56:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700945766; cv=none; d=google.com; s=arc-20160816; b=N2T0zSvTYEkSXiZv4DHHQECQ1gHqMnWmMwDOR58lSTVrJS3iEO+yM1f+c3qjUuN+wi +1agaWvtW/f93/1m+ReFjkm1RWi9LcDtjt4puohS3sauKbj94N0jKIaqG+8YwWifW3HQ Im8Mg6hDBG0ObpxGYul4gdkUCDuYhPK58IPhlXS/2i3qdxNnTnDK4OxQ3BnK9op29mmz 0wilfWH+/WLVl40wU9FxYHfLmEkh0vH1DiUk1pX3XhpKW8YM+5B0Lw8bpIj7E1H7tPMm gwyl/aagI3iEDBhTHmpSBf9lkTSL6vmQ9L9OjCJsscwMb2SZU0ND8hPVjdF0Ocg3M9Lm /+Ng== 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=9SqntmNABX2PjTKybG9y8+BdzA5qkp65j8GlIHJsJxs=; fh=cSHm+nVwN8cjRRKF1iYWd4A94Bvv8YZ/kWIZ7P1vH1U=; b=dlQo9AEcrfYqVFSutwHSUPpYF+Cy15BGw+oJ3dyfrAyf0kVsz2EbpYslpFdMjTgOh8 1towWPipkLqjrRmFY3akZPY2NLgPvX1sw58BNONFDCye2ogBOkKgd9f6eVmClLGLU5Hq Q4/1ju8TYa+pl0aHLQEFrbtsFIsDrP4Yan8u7+9mhtO2tiXfOeIWX9jc9BPHOYkyhFCw lBTwalMf5nc6Tek37UNqG5I6ZMyQM1oI7ceNAsfSW9g2RKcgNPSbOZxchfLchRFChqUT pyf5TudfxMdDNvgP+GNV3hm6G6RkZNjYshkgnPFy85z0uu9/7u41eHhoNAzOQ6OePsA+ W23A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SBuySs8g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id e25-20020a656899000000b005bd04873387si6314950pgt.105.2023.11.25.12.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:56:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SBuySs8g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C67E88055556; Sat, 25 Nov 2023 12:56:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230185AbjKYUzh (ORCPT + 99 others); Sat, 25 Nov 2023 15:55:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230021AbjKYUzf (ORCPT ); Sat, 25 Nov 2023 15:55:35 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1723411D for ; Sat, 25 Nov 2023 12:55:42 -0800 (PST) Received: from sobremesa.fritz.box (cola.collaboradmins.com [195.201.22.229]) (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: alarumbe) by madras.collabora.co.uk (Postfix) with ESMTPSA id 32E106602F30; Sat, 25 Nov 2023 20:55:40 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700945740; bh=UCnojBz357ehFcHJCdupwHygUfwmTRP1P4SkpuCnJmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SBuySs8gmpXp1f5nRNwaMV9TqS56Xb9Ss5nuXB9Mooj9F/tlXqBYWyPMXXwxNhJwz wLAxH/nw+MhDUi4yHBnw5QlKpmYquscX1iirdz6UFZgVJDmv2eS6wSTrD+7hIEaB88 pzRjyf7GY6JKc1ugLE1hxSYklw5fyJLXD+5g4Lsze8a5T6orkdJJQcun3SRAYEV+g0 2rAtRih/5RUys73ZVedlZ0haETz+V3cGctiR6l2+VbpR5SNeGS40dYmo/iN3r1L91K ClHtipM5mnkCWfsv0jN+cgzFs2assJT+W64XiYlYOuM3EXQNn4xCKr5i6cnabMjtU2 GfgaVOuvmiChQ== From: =?UTF-8?q?Adri=C3=A1n=20Larumbe?= To: Boris Brezillon , Rob Herring , Steven Price , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , =?UTF-8?q?Adri=C3=A1n=20Larumbe?= , AngeloGioacchino Del Regno Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH 1/2] drm/panfrost: Consider dma-buf imported objects as resident Date: Sat, 25 Nov 2023 20:52:02 +0000 Message-ID: <20231125205438.375407-2-adrian.larumbe@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231125205438.375407-1-adrian.larumbe@collabora.com> References: <20231125205438.375407-1-adrian.larumbe@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:56:03 -0800 (PST) A GEM object constructed from a dma-buf imported sgtable should be regarded as being memory resident, because the dma-buf API mandates backing storage to be allocated when attachment succeeds. Signed-off-by: Adrián Larumbe Fixes: 9ccdac7aa822 ("drm/panfrost: Add fdinfo support for memory stats") Reported-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index 0cf64456e29a..d47b40b82b0b 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -200,7 +200,7 @@ static enum drm_gem_object_status panfrost_gem_status(struct drm_gem_object *obj struct panfrost_gem_object *bo = to_panfrost_bo(obj); enum drm_gem_object_status res = 0; - if (bo->base.pages) + if (bo->base.base.import_attach || bo->base.pages) res |= DRM_GEM_OBJECT_RESIDENT; if (bo->base.madv == PANFROST_MADV_DONTNEED) -- 2.42.0