Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp285577lqs; Tue, 5 Mar 2024 01:47:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXFOva9qC5/jtY42LXSbwhsYOesGnxXzQ2mjdRZePQtl6P7JJtPDLCLhVh+FzjYz50aD8cKht8i+FqeK16sQbcJzzzO9kRLPE1GFBrIqw== X-Google-Smtp-Source: AGHT+IFxd/RICMcsoUaubitx9x6NoTcwtzEg95eo3JTGHsu8B1675dtIvNULEBqJ9tAEY7fDlLEa X-Received: by 2002:a05:620a:3bcd:b0:788:22e4:aec5 with SMTP id yf13-20020a05620a3bcd00b0078822e4aec5mr1360163qkn.57.1709632066169; Tue, 05 Mar 2024 01:47:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709632066; cv=pass; d=google.com; s=arc-20160816; b=oRnfQYCrmzH3M/9lnZnxGFgWnhgPIS1NfWr5PkcF677jNHiUgm+09P0WHoISQADs8o KW1h48yAGP+JTl2jEaEZWW1JRDWLBCrw797adobtB8BsDKMrCcqI1udQmBjQ70q6uvIw 4zg4tZsAJFWnpNzF0IvIUS+bfoWuL9s9a94Ljw+9v3ciTDfXWq/lKw1n2dTvDPQNCfJK jgY963V5YZJtlyzO/yrTapK6FdqbLb65xncV0zwSvE7f01CAgSySvYRZvo0R/Uj39IfP psWozi3eES9ArNqGHgKydwqmk17BmgtsM8D+beZhRdrY/pRB9nEY5+mSgA70d1yud2eh /0vA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=WbI5i4Q4tsI2CMeqv6RPoW9fsJnk/FBruMClWqYDOF0=; fh=RCnId3FXTnBrHYPTNlIZD+TaPOcR22BcpOtggin51ZU=; b=pVv5HE+vJJgTljpCZSPuj0II0iEu+qHGkoo1EK54phkgS2EuGwpqEGy6I+oSCGDrUd DY1fVdW0MNKiJ51vYrh+N2VuuibmZu8Q1GZpsVdMPLvSKCc+9CNaOA0f2dQUL6LfpzU2 nTkvs2Q87IVKPJnyud8xHgPbIN746I7ERic/zf4ht3hA0DkS4y6U+4QdPtG6l5VaI7/R aMrfV01qJ/2IlO0Sj0ibqEbYrx/bgmNMganf6NHx2bkBeYQa6ro19vj2ols5+WYfUOpc fzIl3NWNzYNUIgf/c9d1CWHOfn4xU5nYAULbzeyixYhDRPbPVpYzJjJ3wv6QptZ6yFhB p12Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EF6c874q; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-92021-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92021-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l1-20020a37f501000000b007832366f885si11523077qkk.224.2024.03.05.01.47.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 01:47:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92021-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EF6c874q; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-92021-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92021-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B4D351C20FC2 for ; Tue, 5 Mar 2024 09:47:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C7EB535C7; Tue, 5 Mar 2024 09:47:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EF6c874q" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 881B85339E for ; Tue, 5 Mar 2024 09:47:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709632057; cv=none; b=QHMr2YzFt3vkgpk1zEBbypas7UGFXImZ2kplMpwcIaB+acqVXEbDjmA0l7sBo3BjTAApMFy/UOkZDO6jvKqbzI82G2jgEdNnWlyomwscF6nw0wC0zbuq5YEZVhhW8o6ZJKuMmWIVeNNq7cZUasdWG7OORwxzHG/46ok7dHSCJQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709632057; c=relaxed/simple; bh=FEn6/6EKZGsnNA0+B7tmFuE7HeJTxYX3bJK2YrmrITM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NWtOwcKZMQzcEVvFJB79HIA1d/5qv72BrIgn4ZmH6VQ94Y35kRWjtonrk9u/lJ22MLrYacFXLAOALsK8yXxqW7kiTl+Ip90v8mVBx5KKlVInpXEB+Os5zrpMzyemVZ67xPOs5NR2QmxdzO9MEgbukGq0mqcF3iqtjYHK/qxQcrw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EF6c874q; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709632054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WbI5i4Q4tsI2CMeqv6RPoW9fsJnk/FBruMClWqYDOF0=; b=EF6c874q0mn3wGALKxq+MebDwpOPZonbXVY/ijeMdObAiab6tfneICTy27ouTnVzfUQHpS RuLMeGNjgUuq54thXxq0wg5SIssROqWt5qfsH85v6X9b/EuQ1oX1TYRZskmJmOMluH8CXX ojTKIxhgxgpA+FidU2zmlnBHDmsid90= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-o7QQIbSlOdiaSD1KoZnP1Q-1; Tue, 05 Mar 2024 04:47:33 -0500 X-MC-Unique: o7QQIbSlOdiaSD1KoZnP1Q-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-78819cae842so394846985a.0 for ; Tue, 05 Mar 2024 01:47:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709632052; x=1710236852; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WbI5i4Q4tsI2CMeqv6RPoW9fsJnk/FBruMClWqYDOF0=; b=EMcL9jAzDmvwNVUsi+zQaamMAp4j8nqNCRlQtnTFVwlsU3qD2bIGclXeejRex0XHQn 3itzOHkNB4aQ72XD/Yr5FCPXaulq+rR2P0W1NYpNLa79mLxIFactJgax2wl90tWV24B2 1ol2rjOA/uWqRfNqIIyXLg8E2eN8f9vBTkIEIEbmrVuKirYy1clPHbFZOrQOQ3d25gAk J8lQcG2C6stjlWxttSvatlz69/wWIGNUlJFarMgAvcM1EvxT+Bh2zT9HUfiX6GjUGpJ7 J0BsGsE1OC8pVyXJxnR2bBSq4eZD26QhrpHCb6F6C/fRvsWjhbKHP2pc6vs5B2o7hyAs xyVw== X-Forwarded-Encrypted: i=1; AJvYcCUzmgrlY4OHCZESQduRDouOzR+iWOi7Tcmn/DZF+1bAIis3Xgk1vVQKbRsnoUazrtQwvYOsAmduY2IMprPJCLNqLHlR+mnSCyua+SSR X-Gm-Message-State: AOJu0Ywll92U+PsOu8QKXF4EFjHTfAK76qWdtid0KmpvvLCLsqr4WIMP R/7JzLFj0HawPl4l7wZU374rJcxbReG9Blwg83NFkC8ruUm/z1/KqaLy++mVJ8gQKt9wh8ngS2Z Wdn08Ei3xWZAskqxrwDj873im1cLokPwQo9+k7aHx5nQDSkdrJasZzCH2GzrsmWGOy8o4MA== X-Received: by 2002:a05:620a:1242:b0:787:d904:c4a0 with SMTP id a2-20020a05620a124200b00787d904c4a0mr1202516qkl.22.1709630353359; Tue, 05 Mar 2024 01:19:13 -0800 (PST) X-Received: by 2002:a05:620a:1242:b0:787:d904:c4a0 with SMTP id a2-20020a05620a124200b00787d904c4a0mr1202512qkl.22.1709630353047; Tue, 05 Mar 2024 01:19:13 -0800 (PST) Received: from [10.32.64.131] (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id bp9-20020a05620a458900b0078812f8a042sm3635157qkb.90.2024.03.05.01.19.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Mar 2024 01:19:12 -0800 (PST) Message-ID: <123c38bd-5b68-4f28-a218-b96fbb41f15d@redhat.com> Date: Tue, 5 Mar 2024 10:19:11 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] drm/nouveau: move more missing UAPI bits Content-Language: en-US To: Karol Herbst , linux-kernel@vger.kernel.org Cc: Lyude Paul , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org References: <20240304183157.1587152-1-kherbst@redhat.com> <20240304183157.1587152-2-kherbst@redhat.com> From: Danilo Krummrich Organization: RedHat In-Reply-To: <20240304183157.1587152-2-kherbst@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/4/24 19:31, Karol Herbst wrote: > Those are already de-facto UAPI, so let's just move it into the uapi > header. > > Signed-off-by: Karol Herbst Reviewed-by: Danilo Krummrich > --- > drivers/gpu/drm/nouveau/nouveau_abi16.c | 20 +++++++++++++++----- > drivers/gpu/drm/nouveau/nouveau_abi16.h | 12 ------------ > include/uapi/drm/nouveau_drm.h | 22 ++++++++++++++++++++++ > 3 files changed, 37 insertions(+), 17 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c > index cd14f993bdd1b..92f9127b284ac 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c > +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c > @@ -312,11 +312,21 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) > if (device->info.family >= NV_DEVICE_INFO_V0_KEPLER) { > if (init->fb_ctxdma_handle == ~0) { > switch (init->tt_ctxdma_handle) { > - case 0x01: engine = NV_DEVICE_HOST_RUNLIST_ENGINES_GR ; break; > - case 0x02: engine = NV_DEVICE_HOST_RUNLIST_ENGINES_MSPDEC; break; > - case 0x04: engine = NV_DEVICE_HOST_RUNLIST_ENGINES_MSPPP ; break; > - case 0x08: engine = NV_DEVICE_HOST_RUNLIST_ENGINES_MSVLD ; break; > - case 0x30: engine = NV_DEVICE_HOST_RUNLIST_ENGINES_CE ; break; > + case NOUVEAU_FIFO_ENGINE_GR: > + engine = NV_DEVICE_HOST_RUNLIST_ENGINES_GR; > + break; > + case NOUVEAU_FIFO_ENGINE_VP: > + engine = NV_DEVICE_HOST_RUNLIST_ENGINES_MSPDEC; > + break; > + case NOUVEAU_FIFO_ENGINE_PPP: > + engine = NV_DEVICE_HOST_RUNLIST_ENGINES_MSPPP; > + break; > + case NOUVEAU_FIFO_ENGINE_BSP: > + engine = NV_DEVICE_HOST_RUNLIST_ENGINES_MSVLD; > + break; > + case NOUVEAU_FIFO_ENGINE_CE: > + engine = NV_DEVICE_HOST_RUNLIST_ENGINES_CE; > + break; > default: > return nouveau_abi16_put(abi16, -ENOSYS); > } > diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.h b/drivers/gpu/drm/nouveau/nouveau_abi16.h > index 11c8c4a80079b..661b901d8ecc9 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_abi16.h > +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.h > @@ -50,18 +50,6 @@ struct drm_nouveau_grobj_alloc { > int class; > }; > > -struct drm_nouveau_notifierobj_alloc { > - uint32_t channel; > - uint32_t handle; > - uint32_t size; > - uint32_t offset; > -}; > - > -struct drm_nouveau_gpuobj_free { > - int channel; > - uint32_t handle; > -}; > - > struct drm_nouveau_setparam { > uint64_t param; > uint64_t value; > diff --git a/include/uapi/drm/nouveau_drm.h b/include/uapi/drm/nouveau_drm.h > index 77d7ff0d5b110..5404d4cfff4c2 100644 > --- a/include/uapi/drm/nouveau_drm.h > +++ b/include/uapi/drm/nouveau_drm.h > @@ -73,6 +73,16 @@ struct drm_nouveau_getparam { > __u64 value; > }; > > +/* > + * Those are used to support selecting the main engine used on Kepler. > + * This goes into drm_nouveau_channel_alloc::tt_ctxdma_handle > + */ > +#define NOUVEAU_FIFO_ENGINE_GR 0x01 > +#define NOUVEAU_FIFO_ENGINE_VP 0x02 > +#define NOUVEAU_FIFO_ENGINE_PPP 0x04 > +#define NOUVEAU_FIFO_ENGINE_BSP 0x08 > +#define NOUVEAU_FIFO_ENGINE_CE 0x30 > + > struct drm_nouveau_channel_alloc { > __u32 fb_ctxdma_handle; > __u32 tt_ctxdma_handle; > @@ -95,6 +105,18 @@ struct drm_nouveau_channel_free { > __s32 channel; > }; > > +struct drm_nouveau_notifierobj_alloc { > + __u32 channel; > + __u32 handle; > + __u32 size; > + __u32 offset; > +}; > + > +struct drm_nouveau_gpuobj_free { > + __s32 channel; > + __u32 handle; > +}; > + > #define NOUVEAU_GEM_DOMAIN_CPU (1 << 0) > #define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1) > #define NOUVEAU_GEM_DOMAIN_GART (1 << 2)