02:32mareko: ac_surface_get_pitch_align also has the pitch alignment formula for gfx6-8, so the only missing thing is to figure out height alignment and you can allocate modifier images without addrlib in theory
03:07kode54: neat
04:38soreau: mareko: are you saying there are no changes that would need to be made to the kernel to implement modifier support for GFX6-8 and it's just in mesa?
04:41soreau: I see drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c uses GB_TILE_MODE0, GB_MACROTILE_MODE0 and GB_ADDR_CONFIG at least
05:01mareko: soreau: the kernel would have to expose modifiers for gfx6-8 and translate those to existing tiling modes for the display code
05:03soreau: hence the fourcc bits..
05:03soreau: mareko: where does i.e. gfx9 expose modifiers?
05:04mareko: soreau: search for AMD_FMT_MOD_SET
05:04mareko: somewhere in DAL
05:06mareko: I don't think that is used by gfx6-7 though
05:06mareko: calling it "gfx" isn't right because the display block isn't called gfx
05:11soreau: so needs changes in drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c and drivers/gpu/drm/amd/amdgpu/amdgpu_display.c ?
05:12mareko: most likely
05:12mareko: you can probably pass GL/VK modifier tests without it
05:41soreau: and I guess GFX8 supports up to 64bpp?
06:05soreau: is this headed in a good direction? http://ix.io/4HCU
06:07soreau: it's using the GFX9 paths where unsure of what needs to happen
15:18mareko: soreau: all modifier bitfields should come from GB_TILE_MODE0, GB_MACROTILE_MODE0 and GB_ADDR_CONFIG other than TILE_VERSION
15:18soreau: ok, let's see
15:20soreau: so I need to set TILE, TILE_MODE, PIPE_XOR_BITS and BANK_XOR_BITS?
15:27MrCooper: wasn't there an issue with older gens where they could end up using different tiling even with the same values for these, e.g. depending on the HW memory configuration?
15:27mareko: soreau: I think TILE_VERSION is the only existing field that will be used
15:28soreau: mareko: oh hm
15:28agd5f: MrCooper, yeah, the alignment depends on the number of pipes IIRC
15:28agd5f: or the number of memory channels
15:29soreau: oh yea, I meant s/TILE_MODE/TILE_VERSION/
15:29mareko: MrCooper: HW memory configuration is already expressed in those 3 registers
15:29agd5f: The macro tile size varies based on the number of channels IIRC
15:30agd5f: so even if the registers are set the same the layout may not be compatible across 2 GPUs with different memory configs
15:31soreau: so I have add_gfx8_modifiers() {add_modifier(mods, size, capacity, AMD_FMT_MOD | AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX8));}
15:32MrCooper: agd5f: and that difference isn't reflected in any other register(s)?
15:32mareko: the layout is determined by those 3 registers
15:32mareko: nothing else
15:36mareko: they are different for each memory configuration
15:49soreau: mareko: so do I need to call add_modifier(mods, size, capacity, AMD_FMT_MOD | AMD_FMT_MOD_SET(TILE_VERSION, with GB_TILE_MODE0, GB_MACROTILE_MODE0 and GB_ADDR_CONFIG or'ed together, or one on each call or what?
15:53soreau: or AMD_FMT_MOD_TILE_VER_GFX8, and what would that value be? (I #defined it to 0 in drm_fourcc.h)
15:56soreau: or, call add_modifier(mods, size, capacity, AMD_FMT_MOD | AMD_FMT_MOD_SET(GB_TILE_MODE0, AMD_FMT_MOD_TILE_VER_GFX8); for each you outlined
15:57agd5f: you probably need a number of memory channel parameter as well
16:05agd5f: mmMC_ARB_RAMCFG and mmMC_SHARED_CHMAP or adev->gmc.vram_width
16:05agd5f: look at whatever addrlib does
18:13mareko: addrlib consumes the value of MC_ARB_RAMCFG, but doesn't seem to use it
18:15bnieuwenhuizen: yeah there are a whole bunch of bits consumed but not used
18:16mareko: in gfx6-8, the memory channel config is actually set in the GB_TILE_MODEn itself
18:16mareko: in gfx9 and later, it's set in GB_ADDR_CONFIG