Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/vmwgfx: Add a debug callback to mobid resource manager

Mob/GMR id resource manager was lacking the debug print callback
which meant that during memory errors we weren't getting the details
which are needed to fix those errors.

Kernel logs need to contain the information about used/max pages
by the Mob/GMR id resource manager as well as the maximum number
of id's they're allowed to allocate.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-3-zack@kde.org

+15 -1
+15 -1
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
··· 42 42 uint32_t max_gmr_ids; 43 43 uint32_t max_gmr_pages; 44 44 uint32_t used_gmr_pages; 45 + uint8_t type; 45 46 }; 46 47 47 48 static struct vmwgfx_gmrid_man *to_gmrid_manager(struct ttm_resource_manager *man) ··· 133 132 kfree(res); 134 133 } 135 134 135 + static void vmw_gmrid_man_debug(struct ttm_resource_manager *man, 136 + struct drm_printer *printer) 137 + { 138 + struct vmwgfx_gmrid_man *gman = to_gmrid_manager(man); 139 + 140 + BUG_ON(gman->type != VMW_PL_GMR && gman->type != VMW_PL_MOB); 141 + 142 + drm_printf(printer, "%s's used: %u pages, max: %u pages, %u id's\n", 143 + (gman->type == VMW_PL_MOB) ? "Mob" : "GMR", 144 + gman->used_gmr_pages, gman->max_gmr_pages, gman->max_gmr_ids); 145 + } 146 + 136 147 static const struct ttm_resource_manager_func vmw_gmrid_manager_func; 137 148 138 149 int vmw_gmrid_man_init(struct vmw_private *dev_priv, int type) ··· 159 146 man = &gman->manager; 160 147 161 148 man->func = &vmw_gmrid_manager_func; 162 - /* TODO: This is most likely not correct */ 163 149 man->use_tt = true; 164 150 ttm_resource_manager_init(man, 0); 165 151 spin_lock_init(&gman->lock); 166 152 gman->used_gmr_pages = 0; 167 153 ida_init(&gman->gmr_ida); 154 + gman->type = type; 168 155 169 156 switch (type) { 170 157 case VMW_PL_GMR: ··· 203 190 static const struct ttm_resource_manager_func vmw_gmrid_manager_func = { 204 191 .alloc = vmw_gmrid_man_get_node, 205 192 .free = vmw_gmrid_man_put_node, 193 + .debug = vmw_gmrid_man_debug 206 194 };