]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerNoralf Trønnes <noralf@tronnes.org>
Thu, 2 Jan 2020 14:35:56 +0000 (15:35 +0100)
commita564e15f995b59dfe8044fc307acb1959f810443
tree23b605f4b84796f731ed2833dc278def46cf4627
parentd451d6d95dc187db2f180d07990196b618c4e75a
drm/mipi_dbi: Fix off-by-one bugs in mipi_dbi_blank()

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
d2b872ae46823c4c ("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: 3b8ba8032e04ff65 ("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
drivers/gpu/drm/drm_mipi_dbi.c