drm/vmwgfx: Fix src/dst_pitch confusion
authorZack Rusin <zackr@vmware.com>
Tue, 14 Mar 2023 21:14:45 +0000 (17:14 -0400)
committerZack Rusin <zackr@vmware.com>
Wed, 15 Mar 2023 20:15:25 +0000 (16:15 -0400)
commit328839ff93709a517e89ba1de1132c5d138e5dcb
tree556c49f9db4b419e2863ecbd28850551103aeacb
parent4230cea89cafb11b2c2e4dcac8b505e7a766b386
drm/vmwgfx: Fix src/dst_pitch confusion

The src/dst_pitch got mixed up during the rework of the function, make
sure the offset's refer to the correct one.

Spotted by clang:
Clang warns (or errors with CONFIG_WERROR):

  drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c:509:29: error: variable 'dst_pitch' is uninitialized when used here [-Werror,-Wuninitialized]
          src_offset = ddirty->top * dst_pitch + ddirty->left * stdu->cpp;
                                     ^~~~~~~~~
  drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c:492:26: note: initialize the variable 'dst_pitch' to silence this warning
          s32 src_pitch, dst_pitch;
                                  ^
                                   = 0
  1 error generated.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Reported-by: Dave Airlie <airlied@gmail.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1811
Fixes: 39985eea5a6d ("drm/vmwgfx: Abstract placement selection")
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230314211445.1363828-1-zack@kde.org
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c