summaryrefslogtreecommitdiffstats
path: root/src/amd/common/ac_surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd/common/ac_surface.c')
-rw-r--r--src/amd/common/ac_surface.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index 8b6d3b10a2f..b20d8189cc8 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -362,10 +362,10 @@ static unsigned cik_get_macro_tile_index(struct radeon_surf *surf)
* 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;
@@ -847,10 +847,10 @@ static int gfx9_compute_miptree(ADDR_HANDLE addrlib,
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};
@@ -1010,3 +1010,14 @@ int gfx9_compute_surface(ADDR_HANDLE addrlib,
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);
+}