drm/mipi_dbi: Fix off-by-one bugs in mipi_dbi_blank()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 30 Dec 2019 13:06:04 +0000 (14:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:36:25 +0000 (08:36 +0100)
commit4aa148666a709cc163259cdf47d420e8a5305ea4
tree75bd15025dce7ba49546df22e9fb5e8a4c14ba62
parentd21cc4ea7a82a97dc3876a4020209c6ab81a7615
drm/mipi_dbi: Fix off-by-one bugs in mipi_dbi_blank()

[ Upstream commit 2ce18249af5a28031b3f909cfafccc88ea966c9d ]

When configuring the frame memory window, the last column and row
numbers are written to the column resp. page address registers.  These
numbers are thus one less than the actual window width resp. height.

While this is handled correctly in mipi_dbi_fb_dirty() since commit
03ceb1c8dfd1e293 ("drm/tinydrm: Fix setting of the column/page end
addresses."), it is not in mipi_dbi_blank().  The latter still forgets
to subtract one when calculating the most significant bytes of the
column and row numbers, thus programming wrong values when the display
width or height is a multiple of 256.

Fixes: 02dd95fe31693626 ("drm/tinydrm: Add MIPI DBI support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191230130604.31006-1-geert+renesas@glider.be
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/drm_mipi_dbi.c