提交 897a6e27 编写于 作者: M Marcin Slusarz 提交者: Ben Skeggs

drm/nouveau/drm: fix crash in vram manager debug callback

It's probably impossible to hit it now on mainline kernel.
I only noticed it because one of my debugging patches uses it.
Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 fffeba2a
...@@ -35,14 +35,16 @@ ...@@ -35,14 +35,16 @@
static int static int
nouveau_vram_manager_init(struct ttm_mem_type_manager *man, unsigned long psize) nouveau_vram_manager_init(struct ttm_mem_type_manager *man, unsigned long psize)
{ {
/* nothing to do */ struct nouveau_drm *drm = nouveau_bdev(man->bdev);
struct nouveau_fb *pfb = nouveau_fb(drm->device);
man->priv = pfb;
return 0; return 0;
} }
static int static int
nouveau_vram_manager_fini(struct ttm_mem_type_manager *man) nouveau_vram_manager_fini(struct ttm_mem_type_manager *man)
{ {
/* nothing to do */ man->priv = NULL;
return 0; return 0;
} }
...@@ -104,7 +106,8 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, ...@@ -104,7 +106,8 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
static void static void
nouveau_vram_manager_debug(struct ttm_mem_type_manager *man, const char *prefix) nouveau_vram_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
{ {
struct nouveau_mm *mm = man->priv; struct nouveau_fb *pfb = man->priv;
struct nouveau_mm *mm = &pfb->vram;
struct nouveau_mm_node *r; struct nouveau_mm_node *r;
u32 total = 0, free = 0; u32 total = 0, free = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册