Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73922C369A2 for ; Mon, 14 Apr 2025 13:51:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 22B9E10E5E5; Mon, 14 Apr 2025 13:51:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="gNedirmh"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="KyAqSLyg"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gNedirmh"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="KyAqSLyg"; dkim-atps=neutral Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id C697010E5D9 for ; Mon, 14 Apr 2025 13:51:30 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (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) by smtp-out1.suse.de (Postfix) with ESMTPS id 742DA21228; Mon, 14 Apr 2025 13:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1744638689; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=waHi4iXaxUErJqMhqu05bWZ/xCR/jSNgdLujgsjHmsQ=; b=gNedirmhfwH8FrANkve7BNlNVhhCizDSQEjcRvAspygxh8TSO7oF3QWYh4pzsW5Bp73mWa GFTf6IYiobi2rvv8l8aTe/rJMIKtCcxDkeNyAsmeaxrc1RJh4X+WQCqA7bGno6bTdENtp1 pGdtN/f4sj6dPBsBWawSdzlCNNOtETA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1744638689; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=waHi4iXaxUErJqMhqu05bWZ/xCR/jSNgdLujgsjHmsQ=; b=KyAqSLygQhigHVTNc7uw1ZJoUuuDg/DuZRAGH8cDMB7ojI9/Ahb3u3wz/WyYekRk6tv1h+ fwJwUfMdfsm3XuDQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1744638689; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=waHi4iXaxUErJqMhqu05bWZ/xCR/jSNgdLujgsjHmsQ=; b=gNedirmhfwH8FrANkve7BNlNVhhCizDSQEjcRvAspygxh8TSO7oF3QWYh4pzsW5Bp73mWa GFTf6IYiobi2rvv8l8aTe/rJMIKtCcxDkeNyAsmeaxrc1RJh4X+WQCqA7bGno6bTdENtp1 pGdtN/f4sj6dPBsBWawSdzlCNNOtETA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1744638689; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=waHi4iXaxUErJqMhqu05bWZ/xCR/jSNgdLujgsjHmsQ=; b=KyAqSLygQhigHVTNc7uw1ZJoUuuDg/DuZRAGH8cDMB7ojI9/Ahb3u3wz/WyYekRk6tv1h+ fwJwUfMdfsm3XuDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 357E0136A7; Mon, 14 Apr 2025 13:51:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8GXfC+ES/We6BQAAD6G6ig (envelope-from ); Mon, 14 Apr 2025 13:51:29 +0000 From: Thomas Zimmermann To: airlied@gmail.com, simona@ffwll.ch, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann , Lyude Paul , Danilo Krummrich , nouveau@lists.freedesktop.org Subject: [PATCH 11/11] drm/nouveau: Test for imported buffers with drm_gem_is_imported() Date: Mon, 14 Apr 2025 15:48:18 +0200 Message-ID: <20250414134821.568225-11-tzimmermann@suse.de> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FREEMAIL_TO(0.00)[gmail.com,ffwll.ch,kernel.org,linux.intel.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_SEVEN(0.00)[9]; FUZZY_BLOCKED(0.00)[rspamd.com]; R_RATELIMIT(0.00)[to_ip_from(RLqirfcw6gnbcr9a9yhi49fhi6)]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" Instead of testing import_attach for imported GEM buffers, invoke drm_gem_is_imported() to do the test. The helper tests the dma_buf itself while import_attach is just an artifact of the import. Prepares to make import_attach optional. Signed-off-by: Thomas Zimmermann Cc: Lyude Paul Cc: Danilo Krummrich Cc: dri-devel@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org --- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 2016c1e7242f..c17d3d030830 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -144,7 +144,7 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo) nouveau_bo_del_io_reserve_lru(bo); nv10_bo_put_tile_region(dev, nvbo->tile, NULL); - if (bo->base.import_attach) + if (drm_gem_is_imported(&bo->base)) drm_prime_gem_destroy(&bo->base, bo->sg); /* -- 2.49.0