From mboxrd@z Thu Jan 1 00:00:00 1970 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 485B7112583A for ; Wed, 11 Mar 2026 14:40:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C088810E28D; Wed, 11 Mar 2026 14:40:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="SDIuy/ap"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3842C10E28D for ; Wed, 11 Mar 2026 14:40:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1773240027; bh=nzYLErF+rKuMbmIvpwK9XSY2PctEWxTOicG7WCugCiI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SDIuy/ap7S/UwJ70JlObrZN6gJfPs8RCSCsxRB7u0IniF1h5BADbzh6Xe686Pt/+w Q6u6uTvVebjTTWQGIXqowvmlwh9GNxynAFzfFDhuVFoRxuWD+oKHTqjaMUEV4qY6Tk 6uV0goOoAKCIDFzmmZ3uNXOi6TwvJKZCSkCyT6XHEwfIEop5KxE0Yq0rABA9gFms5U OhTHw8IC1RhqxmWtLzrRwZNMiMXlb6oCp3U+CzctvHKG8ngUcshgZQDdIxiVNfPS2U RSOAYdqdB6q9kgk35yyyySS/siNOIRCQD1uhDr3vck4HBGfyC88MFPMWMZ3lw/xSoq p0lTGOfSfzwAw== Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by bali.collaboradmins.com (Postfix) with ESMTPSA id 18C7317E0EAC; Wed, 11 Mar 2026 15:40:27 +0100 (CET) Message-ID: <6dc969eb-0dfa-4ab9-ae39-13c4bef90704@collabora.com> Date: Wed, 11 Mar 2026 15:40:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/4] drm/mediatek: Set dedicated DMA device and drop custom GEM callbacks To: Chen-Yu Tsai , Matthias Brugger , Chun-Kuang Hu , Philipp Zabel , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , David Airlie , Simona Vetter Cc: linux-sunxi@lists.linux.dev, Paul Kocialkowski , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260311094929.3393338-1-wenst@chromium.org> <20260311094929.3393338-4-wenst@chromium.org> From: AngeloGioacchino Del Regno Content-Language: en-US In-Reply-To: <20260311094929.3393338-4-wenst@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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" Il 11/03/26 10:49, Chen-Yu Tsai ha scritto: > In commit 9b54a32c7c6a ("drm/mediatek: mtk_gem: Partial refactor and > use drm_gem_dma_object") the MediaTek DRM driver was refactored to use > drm_gem_dma_object, but custom callbacks were still needed to deal with > using the first device of the pipeline as the DMA device, instead of > the MMSYS device that the DRM driver binds to. > > Turns out there is already partial support for dedicated DMA devices in > the DRM subsystem for PRIME imports. The preceding patches add support > for dedicated DMA devices to the GEM DMA helpers. > > This allows us to just set the dedicated DMA device for the DRM device, > and drop all the custom GEM callbacks. Also drop the .dma_dev field > from the driver private data as it is no longer needed. > > There are slight differences in the mmap helper: the VM_DONTDUMP and > VM_IO flags are no longer set. Both were lifted from drm_gem_mmap_obj(). > VM_IO probably doesn't make sense since the buffer is allocated using > dma_alloc_attrs(). > > Reviewed-by: Thomas Zimmermann > Signed-off-by: Chen-Yu Tsai Aaaaah you're removing all my code! :-P ...but it's so pleasant to see that. Brilliant cleanup. Kudos! Reviewed-by: AngeloGioacchino Del Regno