* The following fields of \p surf must be initialized by the caller:
* blk_w, blk_h, bpe, flags.
*/
-int gfx6_compute_surface(ADDR_HANDLE addrlib,
- const struct ac_surf_config *config,
- enum radeon_surf_mode mode,
- struct radeon_surf *surf)
+static int gfx6_compute_surface(ADDR_HANDLE addrlib,
+ const struct ac_surf_config *config,
+ enum radeon_surf_mode mode,
+ struct radeon_surf *surf)
{
unsigned level;
bool compressed;
return 0;
}
-int gfx9_compute_surface(ADDR_HANDLE addrlib,
- const struct ac_surf_config *config,
- enum radeon_surf_mode mode,
- struct radeon_surf *surf)
+static int gfx9_compute_surface(ADDR_HANDLE addrlib,
+ const struct ac_surf_config *config,
+ enum radeon_surf_mode mode,
+ struct radeon_surf *surf)
{
bool compressed;
ADDR2_COMPUTE_SURFACE_INFO_INPUT AddrSurfInfoIn = {0};
return 0;
}
+
+int ac_compute_surface(ADDR_HANDLE addrlib,
+ const struct ac_surf_config *config,
+ enum radeon_surf_mode mode,
+ struct radeon_surf *surf)
+{
+ if (config->chip_class >= GFX9)
+ return gfx9_compute_surface(addrlib, config, mode, surf);
+ else
+ return gfx6_compute_surface(addrlib, config, mode, surf);
+}
ADDR_HANDLE amdgpu_addr_create(enum radeon_family family,
const struct amdgpu_gpu_info *info);
-int gfx6_compute_surface(ADDR_HANDLE addrlib,
- const struct ac_surf_config *config,
- enum radeon_surf_mode mode,
- struct radeon_surf *surf);
-int gfx9_compute_surface(ADDR_HANDLE addrlib,
- const struct ac_surf_config *config,
- enum radeon_surf_mode mode,
- struct radeon_surf *surf);
+int ac_compute_surface(ADDR_HANDLE addrlib,
+ const struct ac_surf_config * config,
+ enum radeon_surf_mode mode,
+ struct radeon_surf *surf);
#endif /* AC_SURFACE_H */
config.pipe_interleave_bytes = ws->info.pipe_interleave_bytes;
config.amdinfo = &ws->amdinfo;
- if (ws->info.chip_class >= GFX9)
- return gfx9_compute_surface(ws->addrlib, &config, mode, surf);
- else
- return gfx6_compute_surface(ws->addrlib, &config, mode, surf);
+ return ac_compute_surface(ws->addrlib, &config, mode, surf);
}
void amdgpu_surface_init_functions(struct amdgpu_winsys *ws)