Skip to content

Commit eef295a

Browse files
en4bzzackr
authored andcommitted
drm/vmwgfx: Restore Guest-Backed only cursor plane support
The referenced fixes commit broke the cursor plane for configurations which have Guest-Backed surfaces but no cursor MOB support. Fixes: 9655441 ("drm/vmwgfx: Refactor cursor handling") Signed-off-by: Ian Forbes <ian.forbes@broadcom.com> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patch.msgid.link/20251103201920.381503-1-ian.forbes@broadcom.com
1 parent c196274 commit eef295a

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ vmw_cursor_update_type(struct vmw_private *vmw, struct vmw_plane_state *vps)
100100
if (vmw->has_mob) {
101101
if ((vmw->capabilities2 & SVGA_CAP2_CURSOR_MOB) != 0)
102102
return VMW_CURSOR_UPDATE_MOB;
103+
else
104+
return VMW_CURSOR_UPDATE_GB_ONLY;
103105
}
104-
106+
drm_warn_once(&vmw->drm, "Unknown Cursor Type!\n");
105107
return VMW_CURSOR_UPDATE_NONE;
106108
}
107109

@@ -139,6 +141,7 @@ static u32 vmw_cursor_mob_size(enum vmw_cursor_update_type update_type,
139141
{
140142
switch (update_type) {
141143
case VMW_CURSOR_UPDATE_LEGACY:
144+
case VMW_CURSOR_UPDATE_GB_ONLY:
142145
case VMW_CURSOR_UPDATE_NONE:
143146
return 0;
144147
case VMW_CURSOR_UPDATE_MOB:
@@ -623,6 +626,7 @@ int vmw_cursor_plane_prepare_fb(struct drm_plane *plane,
623626
if (!surface || vps->cursor.legacy.id == surface->snooper.id)
624627
vps->cursor.update_type = VMW_CURSOR_UPDATE_NONE;
625628
break;
629+
case VMW_CURSOR_UPDATE_GB_ONLY:
626630
case VMW_CURSOR_UPDATE_MOB: {
627631
bo = vmw_user_object_buffer(&vps->uo);
628632
if (bo) {
@@ -737,6 +741,7 @@ void
737741
vmw_cursor_plane_atomic_update(struct drm_plane *plane,
738742
struct drm_atomic_state *state)
739743
{
744+
struct vmw_bo *bo;
740745
struct drm_plane_state *new_state =
741746
drm_atomic_get_new_plane_state(state, plane);
742747
struct drm_plane_state *old_state =
@@ -762,6 +767,15 @@ vmw_cursor_plane_atomic_update(struct drm_plane *plane,
762767
case VMW_CURSOR_UPDATE_MOB:
763768
vmw_cursor_update_mob(dev_priv, vps);
764769
break;
770+
case VMW_CURSOR_UPDATE_GB_ONLY:
771+
bo = vmw_user_object_buffer(&vps->uo);
772+
if (bo)
773+
vmw_send_define_cursor_cmd(dev_priv, bo->map.virtual,
774+
vps->base.crtc_w,
775+
vps->base.crtc_h,
776+
vps->base.hotspot_x,
777+
vps->base.hotspot_y);
778+
break;
765779
case VMW_CURSOR_UPDATE_NONE:
766780
/* do nothing */
767781
break;

drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ static const u32 __maybe_unused vmw_cursor_plane_formats[] = {
3333
enum vmw_cursor_update_type {
3434
VMW_CURSOR_UPDATE_NONE = 0,
3535
VMW_CURSOR_UPDATE_LEGACY,
36+
VMW_CURSOR_UPDATE_GB_ONLY,
3637
VMW_CURSOR_UPDATE_MOB,
3738
};
3839

0 commit comments

Comments
 (0)