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 91774C369B2 for ; Mon, 14 Apr 2025 13:51:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B03D710E5E6; Mon, 14 Apr 2025 13:51:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="RWE3nDJa"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6NqsW0uO"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="RWE3nDJa"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6NqsW0uO"; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56C4410E5E6 for ; Mon, 14 Apr 2025 13:51:34 +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-out2.suse.de (Postfix) with ESMTPS id 363B51F397; Mon, 14 Apr 2025 13:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1744638687; 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=OkjmLgYa47traK/GAQsIUZ+1+v2Gh28nJbRpJaP+i4U=; b=RWE3nDJa/pQqHqy38nGBURQlqLi7RZPQi+Xe5QH4iJ3b5SszCbTwTSyKUA/slEbqWjlWvU g97SFldJNH7uIkr75rXiDeuJHdSnmuDdO2oxi09z4rkMFsARobeOagdO2iBx0NdOElJ1WM yCqJl28eEJTwwMomOkytrYvEL/Qen/w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1744638687; 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=OkjmLgYa47traK/GAQsIUZ+1+v2Gh28nJbRpJaP+i4U=; b=6NqsW0uOLxzeCndHlq8vswI0y5nKr1io+3O8QhcU6GVzUJZkSVmUPw8TfpMkyc3kLPLnKM ws6+yWDBuiW8hTAg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1744638687; 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=OkjmLgYa47traK/GAQsIUZ+1+v2Gh28nJbRpJaP+i4U=; b=RWE3nDJa/pQqHqy38nGBURQlqLi7RZPQi+Xe5QH4iJ3b5SszCbTwTSyKUA/slEbqWjlWvU g97SFldJNH7uIkr75rXiDeuJHdSnmuDdO2oxi09z4rkMFsARobeOagdO2iBx0NdOElJ1WM yCqJl28eEJTwwMomOkytrYvEL/Qen/w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1744638687; 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=OkjmLgYa47traK/GAQsIUZ+1+v2Gh28nJbRpJaP+i4U=; b=6NqsW0uOLxzeCndHlq8vswI0y5nKr1io+3O8QhcU6GVzUJZkSVmUPw8TfpMkyc3kLPLnKM ws6+yWDBuiW8hTAg== 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 093FA136A7; Mon, 14 Apr 2025 13:51:27 +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 6AIPAd8S/We6BQAAD6G6ig (envelope-from ); Mon, 14 Apr 2025 13:51:27 +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 Subject: [PATCH 03/11] drm/gud: Test for imported buffers with drm_gem_is_imported() Date: Mon, 14 Apr 2025 15:48:10 +0200 Message-ID: <20250414134821.568225-3-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)[100.00%]; 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]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com,ffwll.ch,kernel.org,linux.intel.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:email,suse.de:mid]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- drivers/gpu/drm/gud/gud_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gud/gud_pipe.c b/drivers/gpu/drm/gud/gud_pipe.c index 77cfcf37ddd2..43b4c00fd346 100644 --- a/drivers/gpu/drm/gud/gud_pipe.c +++ b/drivers/gpu/drm/gud/gud_pipe.c @@ -443,7 +443,7 @@ static void gud_fb_handle_damage(struct gud_device *gdrm, struct drm_framebuffer } /* Imported buffers are assumed to be WriteCombined with uncached reads */ - gud_flush_damage(gdrm, fb, src, !fb->obj[0]->import_attach, damage); + gud_flush_damage(gdrm, fb, src, !drm_gem_is_imported(fb->obj[0]), damage); } int gud_pipe_check(struct drm_simple_display_pipe *pipe, -- 2.49.0