From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender4-op-o11.zoho.com (sender4-op-o11.zoho.com [136.143.188.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7870738F926 for ; Sat, 25 Jul 2026 04:00:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.11 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784952001; cv=pass; b=hYK0Dtf7dLbqS0mKXmlnB0H7ZLyat2AiBHjzA/b1zztSJG1U6K/ORsICEpafKhVdCiO24egVUPya52R/7iD+MALSxW6DXgyk8t02jWRzwPZYl1roRG4kr23OtCh3vPwq58ieR8ZkQwq8iBguQaJw8SxzP25prkkAs3ZXUXcGvdA= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784952001; c=relaxed/simple; bh=wCE0or1pGfVdggPi8Ncb99LPc/cNDRvVKVCVbB1FSfg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=t2dxMeXPnKe7T6cRYwMEz0AQNiOehXG0sJP4UG/7xO/oGpGVkxZFQ2y+guIc87LZ6X6KoQgn83ohmPuWQa2+4/WXxC/DZ4oAzpVKBmuOI+OnjyjjlZXWkSeUGApp7axgoGmGB/fhICRzyY35NEyA2/eIGmw0QofwjRuReG4Mk0o= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=daniel.almeida@collabora.com header.b=iqhRor6s; arc=pass smtp.client-ip=136.143.188.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=daniel.almeida@collabora.com header.b="iqhRor6s" ARC-Seal: i=1; a=rsa-sha256; t=1784951993; cv=none; d=zohomail.com; s=zohoarc; b=AkEdgMgVnjZjnQFhlrCWE4guJtHtHC6nw4W1/GCBk1uaWuw/VxrpXZiM/E9r3y+xSRtHhLMEKa/o+AfTgvsOG2/NHlcvm5K3c1SyIa7Q7yjC0ML8nIcKB91ecTySsqM6wgHuw/Cj/ufTLphUcCxt0eFr1tqW1oM9Q+BJhmZHWI8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784951993; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=3W1tqnSMyQwvsS27ceKsbriLhwf0c+O3opmmpmqB0J8=; b=IJahq6RDSSExjx4eRassZeF3z/BoomZWkG77Om/8qR67DMo/7C1NJhAPC97ofnzFKgAAKzHOlvMpN/kXUOAYr0nzTu6eXfhv1l8/2QRZHMh7OcfAQk82MX4vcmyJS7uEWA/RYLchSrsv5NM55lTzwoO2XnzvBDGLtNcxVsQucJY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=daniel.almeida@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1784951993; s=zohomail; d=collabora.com; i=daniel.almeida@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=3W1tqnSMyQwvsS27ceKsbriLhwf0c+O3opmmpmqB0J8=; b=iqhRor6sTk52JRsv9tPoxEk+5lC5xPBg7IeGMZjFWTZbgN8RNrDN2psBRG6H8CSy TQYK131bey/hQHELzYIs7ekOW0tXkEDn32b5nOSYYrzM7UxfUAFc/0U+Rxsju9qG5nO uctTZpHWfctCXLpQ++Pv1bh14m30nSkoILdH0BYk= Received: by mx.zohomail.com with SMTPS id 1784951991074829.1841111702598; Fri, 24 Jul 2026 20:59:51 -0700 (PDT) From: Daniel Almeida To: Lyude Paul , Danilo Krummrich , nouveau@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dave Airlie , Daniel Almeida Subject: [PATCH] drm/nouveau: allow allocating NVDEC channels via abi16 Date: Sat, 25 Jul 2026 00:59:12 -0300 Message-ID: <20260725035912.1016464-1-daniel.almeida@collabora.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External From: Dave Airlie Add NOUVEAU_FIFO_ENGINE_NVDEC to the abi16 uAPI and accept it in channel allocation, mapping it to the NVDEC engine runlist. Skip the Turing copy-engine workaround object for NVDEC channels: the copy engines are not part of the NVDEC runlist, so the workaround object cannot be instantiated on such channels (and is not needed there). This is required for NVK to implement Vulkan Video H.264 decode on top of the NVDEC engine: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31867 Signed-off-by: Dave Airlie Signed-off-by: Daniel Almeida --- drivers/gpu/drm/nouveau/nouveau_abi16.c | 14 ++++++++++---- include/uapi/drm/nouveau_drm.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index 291203121f0c..4542d5f4ded8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c @@ -408,6 +408,9 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) case NOUVEAU_FIFO_ENGINE_CE: engine = NV_DEVICE_HOST_RUNLIST_ENGINES_CE; break; + case NOUVEAU_FIFO_ENGINE_NVDEC: + engine = NV_DEVICE_HOST_RUNLIST_ENGINES_NVDEC; + break; default: return nouveau_abi16_put(abi16, -ENOSYS); } @@ -485,10 +488,13 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) goto done; break; case NV_DEVICE_INFO_V0_TURING: - ret = nvif_object_ctor(&chan->chan->user, "abi16CeWar", 0, TURING_DMA_COPY_A, - NULL, 0, &chan->ce); - if (ret) - goto done; + if (engine != NV_DEVICE_HOST_RUNLIST_ENGINES_NVDEC) { + ret = nvif_object_ctor(&chan->chan->user, "abi16CeWar", + 0, TURING_DMA_COPY_A, NULL, 0, + &chan->ce); + if (ret) + goto done; + } break; default: break; diff --git a/include/uapi/drm/nouveau_drm.h b/include/uapi/drm/nouveau_drm.h index 1fa82fa6af38..c4905b3e4e91 100644 --- a/include/uapi/drm/nouveau_drm.h +++ b/include/uapi/drm/nouveau_drm.h @@ -89,6 +89,7 @@ struct drm_nouveau_getparam { #define NOUVEAU_FIFO_ENGINE_PPP 0x04 #define NOUVEAU_FIFO_ENGINE_BSP 0x08 #define NOUVEAU_FIFO_ENGINE_CE 0x30 +#define NOUVEAU_FIFO_ENGINE_NVDEC 0x300 struct drm_nouveau_channel_alloc { __u32 fb_ctxdma_handle; base-commit: 1590cf0329716306e948a8fc29f1d3ee87d3989f -- 2.55.0