hw/display/omap_lcdc: Drop broken bigendian ifdef
commit78b40bfb8fee5bb8ecff176522ad8098476cab5d
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 15 Feb 2021 10:32:12 +0000 (15 10:32 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Sat, 6 Mar 2021 13:30:38 +0000 (6 13:30 +0000)
treeada8069b3aa7997346ebf852fac12e5b4346e310
parent52b8ac590daebe1bbdaa2a5757ba5e05a626fab5
hw/display/omap_lcdc: Drop broken bigendian ifdef

The draw_line16_32() function in the omap_lcdc template header
includes an ifdef for the case where HOST_WORDS_BIGENDIAN matches
TARGET_WORDS_BIGENDIAN.  This is trying to optimise for "source
bitmap and destination bitmap format match", but it is broken,
because in this function the formats don't match: the source is
16-bit colour and the destination is 32-bit colour, so a memcpy()
will produce corrupted graphics output.  Drop the bogus ifdef.

This bug was introduced in commit ea644cf343129, when we dropped
support for DEPTH values other than 32 from the template header.
The old #if line was
  #if DEPTH == 16 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
and this was mistakenly changed to
  #if defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
rather than deleting the #if as now having an always-false condition.

Fixes: ea644cf343129
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210215103215.4944-7-peter.maydell@linaro.org
hw/display/omap_lcd_template.h