From 09881d2940bbd641f27f9ae7907e8a1893bc54b2 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 30 Jan 2023 22:35:37 -0500 Subject: drm/vmwgfx: Rename vmw_buffer_object to vmw_bo The rest of the drivers which are using ttm have mostly standardized on driver_prefix_bo as the name for subclasses of the TTM buffer object. Make vmwgfx match the rest of the drivers and follow the same naming semantics. This is especially clear given that the name of the file in which the object was defined is vmw_bo.c. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230131033542.953249-4-zack@kde.org --- drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_validation.h') diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h index ab9ec226f433..4aa4f700c65e 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h @@ -73,7 +73,7 @@ struct vmw_validation_context { size_t total_mem; }; -struct vmw_buffer_object; +struct vmw_bo; struct vmw_resource; struct vmw_fence_obj; @@ -159,7 +159,7 @@ static inline unsigned int vmw_validation_align(unsigned int val) } int vmw_validation_add_bo(struct vmw_validation_context *ctx, - struct vmw_buffer_object *vbo, + struct vmw_bo *vbo, bool as_mob, bool cpu_blit); int vmw_validation_bo_validate_single(struct ttm_buffer_object *bo, bool interruptible, @@ -179,7 +179,7 @@ void vmw_validation_res_unreserve(struct vmw_validation_context *ctx, bool backoff); void vmw_validation_res_switch_backup(struct vmw_validation_context *ctx, void *val_private, - struct vmw_buffer_object *vbo, + struct vmw_bo *vbo, unsigned long backup_offset); int vmw_validation_res_validate(struct vmw_validation_context *ctx, bool intr); -- cgit From 39985eea5a6dd1e844f216028252870e980b9e7f Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 30 Jan 2023 22:35:41 -0500 Subject: drm/vmwgfx: Abstract placement selection Problem with explicit placement selection in vmwgfx is that by the time the buffer object needs to be validated the information about which placement was supposed to be used is lost. To workaround this the driver had a bunch of state in various places e.g. as_mob or cpu_blit to somehow convey the information on which placement was intended. Fix it properly by allowing the buffer objects to hold their preferred placement so it can be reused whenever needed. This makes the entire validation pipeline a lot easier both to understand and maintain. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230131033542.953249-8-zack@kde.org --- drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_validation.h') diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h index 4aa4f700c65e..240ee0c4ebfd 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h @@ -159,11 +159,7 @@ static inline unsigned int vmw_validation_align(unsigned int val) } int vmw_validation_add_bo(struct vmw_validation_context *ctx, - struct vmw_bo *vbo, - bool as_mob, bool cpu_blit); -int vmw_validation_bo_validate_single(struct ttm_buffer_object *bo, - bool interruptible, - bool validate_as_mob); + struct vmw_bo *vbo); int vmw_validation_bo_validate(struct vmw_validation_context *ctx, bool intr); void vmw_validation_unref_lists(struct vmw_validation_context *ctx); int vmw_validation_add_resource(struct vmw_validation_context *ctx, -- cgit