drm/vmwgfx: Update last_read_seqno under the fence lock
authorIan Forbes <ian.forbes@broadcom.com>
Fri, 30 May 2025 18:35:08 +0000 (13:35 -0500)
committerZack Rusin <zack.rusin@broadcom.com>
Wed, 18 Jun 2025 02:49:31 +0000 (22:49 -0400)
commitc82f55f4aa57bf5ba412d55856fe50514b47b971
treed3ed4789760119f211eaf2a9f096f59f0efee154
parenta72002cb181f350734108228b24c5d10d358f95a
drm/vmwgfx: Update last_read_seqno under the fence lock

There was a possible race in vmw_update_seqno. Because of this race it
was possible for last_read_seqno to go backwards. Remove this function
and replace it with vmw_update_fences which now sets and returns the
last_read_seqno while holding the fence lock. This serialization via the
fence lock ensures that last_read_seqno is monotonic again.

Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/r/20250530183510.733175-1-ian.forbes@broadcom.com
drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
drivers/gpu/drm/vmwgfx/vmwgfx_fence.h
drivers/gpu/drm/vmwgfx/vmwgfx_irq.c