Replies: 1 comment 2 replies
|
On Fri, 2 Oct 2026 at 19:43, Ashahel ***@***.***> wrote:
@Kalamatee <https://github.com/Kalamatee> @bsek <https://github.com/bsek>
(and cc deadwood, for the nouveau.hidd history)
We are working on running Mesa's NVK Vulkan driver on AROS against
nouveau.hidd (RTX 5070 Ti, GB203, through vfio passthrough). The piece that
connects the two is a hidd interface, so we would like your view on its
shape and would rather follow your design than invent a second one.
Citations are against db2b39a.
*Where we are*
- nouveau.hidd already has almost everything NVK needs: GEM/BO,
channels, fences, the r570 GSP-RM client booting on Blackwell, and the full
DRM ioctl table (
workbench/hidds/nouveau/drm/nouveau/nouveau_drm.c:1291-1293 lists
NOUVEAU_VM_INIT / VM_BIND / EXEC). The gap is that VM_BIND/EXEC are
stubbed (drm-aros/nouveau/nouveau_aros_stubs.c:19-20). In our tree we
carry Linux 6.18.44's nouveau_uvmm.c, nouveau_exec.c, nouveau_sched.c
and the drm_gpuvm / drm_exec / drm_syncobj helpers in the hidd. It
builds; it is not yet proven on hardware. We would like to offer it as a PR
once it is.
- NVK cross-builds for AROS. Linking libdrm statically gives NVK a
private copy of the hidd globals (current_drm_device stays NULL, so
drmOpen returns -ENODEV), and pulling the hidd's own objects in drags
hidd-private dependencies into a .library.
- We have a local prototype of the bridge below: NVK reaches the hidd
through it on the guest (the handle is obtained and the first ioctls go
through). NVK device creation on the card is not working yet, so nothing
here is proposed as a PR yet.
*What we propose*
Reuse the pattern you already built for vc4. vc4_aros_bridge.h is a
versioned C table with no Mesa types that the hidd fills in and the Mesa
side calls through; workbench/libs/mesa/aros_drm_shim.c routes drmIoctl()
to bridge->ioctl and mmap() to the BO's CPU address. NVK needs only the
core of it:
struct aros_drm_bridge { /* name open for discussion */
ULONG version;
ULONG driver_id;
void *ctx; /* one per open, i.e. one drm_file */
int (*ioctl)(void *ctx, unsigned long request, void *arg); /* 0 / -errno */
void *(*mmap)(void *ctx, ULONG handle, unsigned long offset);
int (*munmap)(void *ctx, void *addr, unsigned long length);
int (*close)(void *ctx);
};
- ioctl feeds the hidd's existing DRM dispatch with a per-open drm_file,
so GEM, syncobj, prime, VM_BIND and EXEC all go through one entry point. No
per-feature methods.
- The hidd hands the table out through one new attribute read with the
existing Get method (our prototype uses aoHidd_Gfx_Nouveau_DrmBridge).
That avoids a new OOP method. vc4 hands its table over in
CreatePipeScreen, but NVK has no pipe screen.
- The NVK side links a generalised aros_drm_shim.c instead of libdrm.
*Questions*
1. *One generic header or a nouveau one?* We would prefer a
driver-neutral core (version, driver_id, ctx, ioctl, mmap, munmap,
close), with the gallium presentation calls (display_blit, get_scanout,
overlays) left in vc4's own header. The alternative is a separate
nouveau_aros_bridge.h that copies vc4's shape and leaves vc4
untouched. Which do you want?
2. *Full request word.* drmIoctl() currently passes only request & 0xFF
(aros_drm_shim.c:180). That is unambiguous for DRM numbers, but
nouveau's dispatch is Linux's drm_ioctl, which checks direction and
size from the full request. May the bridge pass the full request (vc4 can
keep masking on its side)?
3. *Syncobj.* The shim's drmSyncobj* all return -1 (
aros_drm_shim.c:214-235, "has_syncobj=false"). NVK requires syncobjs,
including timelines. They would go through ioctl like everything else.
Is it fine for the shim to forward them rather than fail, given that vc4
keeps not advertising DRM_CAP_SYNCOBJ?
4. *Handoff.* Is a Get attribute on nouveau.hidd acceptable, or would
you rather have an explicit method (for example Open/Close, returning
the table)?
5. *mmap.* vc4's mmap maps by BO handle. nouveau reports a map offset
through GEM_INFO. We would pass both and let the hidd resolve a CPU
address, since BARs are identity-mapped on AROS. Does that match how
nouveau.hidd maps VRAM BOs today?
6. *Scope.* The shim keeps one bridge per process (aros_drm_bridge,
line 35). That is enough for NVK. Do you see a reason to allow more?
If you are already planning something along these lines, for Gallium
nouveau or anything else, we will follow that instead.
NVK will be exposed from nouveau.hidd in the same manner as the gallium
code currently is - via subclassing vulkan.hidd and returning an object of
its type when the vulkan class id is requested. Client code will interact
with it in the same manner mesa currently does the gallium hidd.
|
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
@Kalamatee @bsek (and cc deadwood, for the nouveau.hidd history)
We are working on running Mesa's NVK Vulkan driver on AROS against nouveau.hidd (RTX 5070 Ti, GB203, through vfio passthrough). The piece that connects the two is a hidd interface, so we would like your view on its shape and would rather follow your design than invent a second one. Citations are against
db2b39a227.Where we are
workbench/hidds/nouveau/drm/nouveau/nouveau_drm.c:1291-1293listsNOUVEAU_VM_INIT/VM_BIND/EXEC). The gap is that VM_BIND/EXEC are stubbed (drm-aros/nouveau/nouveau_aros_stubs.c:19-20). In our tree we carry Linux 6.18.44'snouveau_uvmm.c,nouveau_exec.c,nouveau_sched.cand thedrm_gpuvm/drm_exec/drm_syncobjhelpers in the hidd. It builds; it is not yet proven on hardware. We would like to offer it as a PR once it is.current_drm_devicestays NULL, sodrmOpenreturns-ENODEV), and pulling the hidd's own objects in drags hidd-private dependencies into a.library.What we propose
Reuse the pattern you already built for vc4.
vc4_aros_bridge.his a versioned C table with no Mesa types that the hidd fills in and the Mesa side calls through;workbench/libs/mesa/aros_drm_shim.croutesdrmIoctl()tobridge->ioctlandmmap()to the BO's CPU address. NVK needs only the core of it:ioctlfeeds the hidd's existing DRM dispatch with a per-opendrm_file, so GEM, syncobj, prime, VM_BIND and EXEC all go through one entry point. No per-feature methods.Getmethod (our prototype usesaoHidd_Gfx_Nouveau_DrmBridge). That avoids a new OOP method. vc4 hands its table over inCreatePipeScreen, but NVK has no pipe screen.aros_drm_shim.cinstead of libdrm.Questions
version,driver_id,ctx,ioctl,mmap,munmap,close), with the gallium presentation calls (display_blit,get_scanout, overlays) left in vc4's own header. The alternative is a separatenouveau_aros_bridge.hthat copies vc4's shape and leaves vc4 untouched. Which do you want?drmIoctl()currently passes onlyrequest & 0xFF(aros_drm_shim.c:180). That is unambiguous for DRM numbers, but nouveau's dispatch is Linux'sdrm_ioctl, which checks direction and size from the full request. May the bridge pass the full request (vc4 can keep masking on its side)?drmSyncobj*all return -1 (aros_drm_shim.c:214-235, "has_syncobj=false"). NVK requires syncobjs, including timelines. They would go throughioctllike everything else. Is it fine for the shim to forward them rather than fail, given that vc4 keeps not advertisingDRM_CAP_SYNCOBJ?Getattribute on nouveau.hidd acceptable, or would you rather have an explicit method (for exampleOpen/Close, returning the table)?mmapmaps by BO handle. nouveau reports a map offset throughGEM_INFO. We would pass both and let the hidd resolve a CPU address, since BARs are identity-mapped on AROS. Does that match how nouveau.hidd maps VRAM BOs today?aros_drm_bridge, line 35). That is enough for NVK. Do you see a reason to allow more?If you are already planning something along these lines, for Gallium nouveau or anything else, we will follow that instead.
Thanks!
All reactions