[AMD Official Use Only - AMD Internal Distribution Only]
> The modifier u64 bit layout is not supposed to be "Mesa-specific".
> It's shared by multiple userspace components. It needs to be defined > properly in drm_fourcc.h.
I know how modifiers work. I'm a driver person.
The gfx12 modifiers work the same as gfx11 except that TILE values have different names, and some fields are no longer relevant. Mesa sets all fields that are relevant, which why I suggested to look at it.
Marek
From: Simon Ser <contact@xxxxxxxxxxx>
Sent: July 4, 2024 17:57 To: Olsak, Marek <Marek.Olsak@xxxxxxx> Cc: Alex Deucher <alexdeucher@xxxxxxxxx>; Pillai, Aurabindo <Aurabindo.Pillai@xxxxxxx>; DRI Development <dri-devel@xxxxxxxxxxxxxxxxxxxxx>; Siqueira, Rodrigo <Rodrigo.Siqueira@xxxxxxx>; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Bas Nieuwenhuizen <bas@xxxxxxxxxxxxxxxxxxx> Subject: Re: AMD GFX12 modifiers On Wednesday, July 3rd, 2024 at 17:11, Olsak, Marek <Marek.Olsak@xxxxxxx> wrote:
> Alex publishes the amd-staging-drm-next branch regularly where all our kernel commits go. I know. That's what I use as a base when I send amdgpu patches. This doesn't contain any more relevant changes. > See the gfx12 modifiers that Mesa exposes. The modifier u64 bit layout is not supposed to be "Mesa-specific". It's shared by multiple userspace components. It needs to be defined properly in drm_fourcc.h. Please, can you read my questions and answer them? > From: Simon Ser <contact@xxxxxxxxxxx> > Sent: Tuesday, July 2, 2024 12:39:10 PM > To: Olsak, Marek <Marek.Olsak@xxxxxxx> > Cc: Alex Deucher <alexdeucher@xxxxxxxxx>; Pillai, Aurabindo <Aurabindo.Pillai@xxxxxxx>; DRI Development <dri-devel@xxxxxxxxxxxxxxxxxxxxx>; Siqueira, Rodrigo <Rodrigo.Siqueira@xxxxxxx>; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Bas Nieuwenhuizen <bas@xxxxxxxxxxxxxxxxxxx> > Subject: Re: AMD GFX12 modifiers > > On Tuesday, July 2nd, 2024 at 15:22, Olsak, Marek <Marek.Olsak@xxxxxxx> wrote: > > > The code you are looking at seems out of date. The latest code is on > > amd-gfx. > > Could you point me where? I searched for drm_fourcc.h and only found [1] > which I guess at least answers my question about > AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_MASK. > > [1]: https://lore.kernel.org/amd-gfx/20240626183135.8606-5-marek.olsak@xxxxxxx/ > > > That doesn't matter though. This seems to be a general > > question about modifiers. Here's the answer. > > > > Modifier definitions don't describe compatibility between chips and generations. They only identify the memory layout. Because of that, hw support can't be inferred from modifiers. There could be multiple GFX definitions, tile numbers, and even modifiers from other vendors describing exactly the same layout, and all such equivalent modifiers can be exposed by the same hw. > > > > The gfx12 modifiers work in exactly the same way as any other modifiers. > > Thanks, I know how modifiers work, I'm a WSI person. :) > > My questions were not generic questions about modifiers though. My > questions are about the technical detail of how GFX12 buffer tiling > properties are encoded in the modifier u64. > > This is something I need to know for libdrm modifier pretty-printing, > as well as drm_info and drmdb. And in general, I think it's important to > audit changes to drm_fourcc.h, rules around modifiers are a bit > complicated and easy to get wrong. > > > From: Alex Deucher <alexdeucher@xxxxxxxxx> > > Sent: July 1, 2024 13:09 > > To: Simon Ser <contact@xxxxxxxxxxx>; Olsak, Marek <Marek.Olsak@xxxxxxx> > > Cc: Pillai, Aurabindo <Aurabindo.Pillai@xxxxxxx>; DRI Development <dri-devel@xxxxxxxxxxxxxxxxxxxxx>; Siqueira, Rodrigo <Rodrigo.Siqueira@xxxxxxx>; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Bas Nieuwenhuizen <bas@xxxxxxxxxxxxxxxxxxx> > > Subject: Re: AMD GFX12 modifiers > > > > + Marek > > > > On Sat, Jun 29, 2024 at 1:15 PM Simon Ser <contact@xxxxxxxxxxx> wrote: > > > > > > Hi all! > > > > > > In 7ceb94e87bff ("drm/amd: Add gfx12 swizzle mode defs"), some > > > definitions were added for GFX12 modifiers. However I'm not quite sure > > > I understand how these work. > > > > > > Tile values seem to not be in the same namespace as GFX9 through GFX11, > > > is that correct? In other words, can GFX9 ~ GFX11 modifiers be used with > > > GFX12, or are these mutually exclusive? > > > > > > AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_MASK has a comment explaining > > > the 3 possible values, is there a reason why #defines are missing for > > > these values? > > > > > > The comment lists a lot more swizzle modes than just 64K_2D and 256K_2D, > > > any reason why the rest are missing (at least for the 2D ones)? > > > > > > Could you explain how the new GFX12 modifiers work? > > > > > > Would it be possible to update the comment on top of #define AMD_FMT_MOD > > > to reflect the GFX12 updates? > > > > > > Thanks, > > > > > > Simon |