sm501: Fix and optimize overlap check
commit9982c605a71bffd4c52c111b5c79e2060953a762
authorBALATON Zoltan <balaton@eik.bme.hu>
Wed, 24 Jun 2020 16:42:18 +0000 (24 18:42 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 30 Jun 2020 20:50:04 +0000 (30 22:50 +0200)
tree73ef2a7b035df327d229b5b593da1dcfc1898824
parentd8327a68694e49d7d125b5dbe4eeaaf9695cbb73
sm501: Fix and optimize overlap check

When doing reverse blit we need to check if source and dest overlap
but it is not trivial due to possible different base and pitch of
source and dest. Do rectangle overlap if base and pitch match,
otherwise just check if memory area containing the rects overlaps so
rects could possibly overlap.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-Id: <20200624164737.A941374633D@zero.eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/sm501.c