Skip to contentSkip to conversation

drm/vmwgfx: fix regression in thp code due to ttm init refactor.

PATCH In review Dave Airlie 2 participants 2 messages Oct 1, 2020

Subsystems (3)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm/vmwgfx: fix regression in thp code due to ttm init refactor.

From: Dave Airlie <[email protected]>

When I refactored this code with the new init paths, I failed to set the funcs back up properly, this caused a failure to bringup gdm properly.

Fixes 252f8d7b9174 ("drm/vmwgfx/ttm: convert vram mm init to new code paths")
---
 drivers/gpu/drm/vmwgfx/vmwgfx_thp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_thp.c +4 -1
index 63fe7da4cbf4..c158e672b762 100644
@@ -26,6 +26,8 @@ static struct vmw_thp_manager *to_thp_manager(struct ttm_resource_manager *man)
 	return container_of(man, struct vmw_thp_manager, manager);
 }
 
+static const struct ttm_resource_manager_func vmw_thp_func;
+
 static int vmw_thp_insert_aligned(struct drm_mm *mm, struct drm_mm_node *node,
 				  unsigned long align_pages,
 				  const struct ttm_place *place,
@@ -132,6 +134,7 @@ int vmw_thp_init(struct vmw_private *dev_priv)
 	ttm_resource_manager_init(&rman->manager,
 				  dev_priv->vram_size >> PAGE_SHIFT);
 
+	rman->manager.func = &vmw_thp_func;
 	drm_mm_init(&rman->mm, 0, rman->manager.size);
 	spin_lock_init(&rman->lock);
 
@@ -171,7 +174,7 @@ static void vmw_thp_debug(struct ttm_resource_manager *man,
 	spin_unlock(&rman->lock);
 }
 
-const struct ttm_resource_manager_func vmw_thp_func = {
+static const struct ttm_resource_manager_func vmw_thp_func = {
 	.alloc = vmw_thp_get_node,
 	.free = vmw_thp_put_node,
 	.debug = vmw_thp_debug
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dave Airlie

From: Dave Airlie <[email protected]>

When I refactored this code with the new init paths, I failed to set the funcs back up properly, this caused a failure to bringup gdm properly.

Fixes 252f8d7b9174 ("drm/vmwgfx/ttm: convert vram mm init to new code paths")

Indeed, I missed that that got lost.

Quoted 41 lines
---
 drivers/gpu/drm/vmwgfx/vmwgfx_thp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_thp.c +4 -2
index 63fe7da4cbf4..c158e672b762 100644
@@ -26,6 +26,8 @@ static struct vmw_thp_manager *to_thp_manager(struct ttm_resource_manager *man)
        return container_of(man, struct vmw_thp_manager, manager);
 }
 
+static const struct ttm_resource_manager_func vmw_thp_func;
+
 static int vmw_thp_insert_aligned(struct drm_mm *mm, struct drm_mm_node *node,
                                  unsigned long align_pages,
                                  const struct ttm_place *place,
@@ -132,6 +134,7 @@ int vmw_thp_init(struct vmw_private *dev_priv)
        ttm_resource_manager_init(&rman->manager,
                                  dev_priv->vram_size >> PAGE_SHIFT);
 
+       rman->manager.func = &vmw_thp_func;
        drm_mm_init(&rman->mm, 0, rman->manager.size);
        spin_lock_init(&rman->lock);
 
@@ -171,7 +174,7 @@ static void vmw_thp_debug(struct ttm_resource_manager *man,
        spin_unlock(&rman->lock);
 }
 
-const struct ttm_resource_manager_func vmw_thp_func = {
+static const struct ttm_resource_manager_func vmw_thp_func = {
        .alloc = vmw_thp_get_node,
        .free = vmw_thp_put_node,
        .debug = vmw_thp_debug
--

2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel