Commit 96554415 authored by Zack Rusin's avatar Zack Rusin
Browse files

drm/vmwgfx: Refactor cursor handling



Refactor cursor handling to make the code maintainable again. Over the
last 12 years the svga device improved support for virtualized cursors
and at the same time the drm interfaces evolved quite a bit from
pre-atomic to current atomic ones. vmwgfx only added new code over
the years, instead of adjusting/refactoring the paths.

Export the cursor plane handling to its own file. Remove special
handling of the legacy cursor support to make it fit within the global
cursor plane mechanism.

Finally redo dirty tracking because memcmp never worked correctly
resulting in the cursor not being properly updated in the guest.

Signed-off-by: default avatarZack Rusin <zack.rusin@broadcom.com>
Reviewed-by: default avatarMaaz Mombasawala <maaz.mombasawala@broadcom.com>
Reviewed-by: default avatarMartin Krastev <martin.krastev@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250307125836.3877138-2-zack.rusin@broadcom.com
parent 6efda95a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10,6 +10,6 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
	    vmwgfx_simple_resource.o vmwgfx_va.o vmwgfx_blit.o \
	    vmwgfx_validation.o vmwgfx_page_dirty.o vmwgfx_streamoutput.o \
	    vmwgfx_devcaps.o ttm_object.o vmwgfx_system_manager.o \
	    vmwgfx_gem.o vmwgfx_vkms.o
	    vmwgfx_gem.o vmwgfx_vkms.o vmwgfx_cursor_plane.o

obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o
+6 −0
Original line number Diff line number Diff line
@@ -887,3 +887,9 @@ struct vmw_surface *vmw_bo_surface(struct vmw_bo *vbo)
		surf = vmw_res_to_srf(res);
	return surf;
}

s32 vmw_bo_mobid(struct vmw_bo *vbo)
{
	WARN_ON(vbo->tbo.resource->mem_type != VMW_PL_MOB);
	return (s32)vbo->tbo.resource->start;
}
+2 −0
Original line number Diff line number Diff line
@@ -233,4 +233,6 @@ static inline struct vmw_bo *to_vmw_bo(struct drm_gem_object *gobj)
	return container_of((gobj), struct vmw_bo, tbo.base);
}

s32 vmw_bo_mobid(struct vmw_bo *vbo);

#endif // VMWGFX_BO_H
+844 −0

File added.

Preview size limit exceeded, changes collapsed.

+81 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading