Skip to content

Commit 5703fc0

Browse files
en4bzzackr
authored andcommitted
drm/vmwgfx: Don't memcmp equivalent pointers
These pointers are frequently the same and memcmp does not compare the pointers before comparing their contents so this was wasting cycles comparing 16 KiB of memory which will always be equal. Fixes: bb6780a ("drm/vmwgfx: Diff cursors when using cmds") Signed-off-by: Ian Forbes <ian.forbes@broadcom.com> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240328190716.27367-1-ian.forbes@broadcom.com
1 parent b91e05f commit 5703fc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static bool vmw_du_cursor_plane_has_changed(struct vmw_plane_state *old_vps,
224224
new_image = vmw_du_cursor_plane_acquire_image(new_vps);
225225

226226
changed = false;
227-
if (old_image && new_image)
227+
if (old_image && new_image && old_image != new_image)
228228
changed = memcmp(old_image, new_image, size) != 0;
229229

230230
return changed;

0 commit comments

Comments
 (0)