ac: add ac_gpu_info::cu_mask to store bitmask of compute units
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 2 Mar 2020 10:52:28 +0000 (11:52 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 6 Mar 2020 08:22:02 +0000 (08:22 +0000)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4023>

src/amd/common/ac_gpu_info.c
src/amd/common/ac_gpu_info.h

index 67b09ed6ae4af381958a110e37ca842172031eb0..4f928a8b51feb5fa95c5c2d446c86e63d685a237 100644 (file)
@@ -613,10 +613,13 @@ bool ac_query_gpu_info(int fd, void *dev_p,
 
        /* Get the number of good compute units. */
        info->num_good_compute_units = 0;
-       for (i = 0; i < info->max_se; i++)
-               for (j = 0; j < info->max_sh_per_se; j++)
+       for (i = 0; i < info->max_se; i++) {
+               for (j = 0; j < info->max_sh_per_se; j++) {
+                       info->cu_mask[i][j] = amdinfo->cu_bitmap[i][j];
                        info->num_good_compute_units +=
-                               util_bitcount(amdinfo->cu_bitmap[i][j]);
+                               util_bitcount(info->cu_mask[i][j]);
+               }
+       }
        info->num_good_cu_per_sh = info->num_good_compute_units /
                                   (info->max_se * info->max_sh_per_se);
 
index 2794119365d123c5d452d42352b7be8a32019850..93cf323372c677892d5da64dbf16e34ef2246d30 100644 (file)
@@ -152,6 +152,7 @@ struct radeon_info {
        bool                        has_scheduled_fence_dependency;
 
        /* Shader cores. */
+       uint32_t                    cu_mask[4][2];
        uint32_t                    r600_max_quad_pipes; /* wave size / 16 */
        uint32_t                    max_shader_clock;
        uint32_t                    num_good_compute_units;