This is a note to let you know that I've just added the patch titled drm/panel/panel-sitronix-st7701: Fix RTNI calculation to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-panel-panel-sitronix-st7701-fix-rtni-calculation.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 3692b47f5d7630974c4bdc3deb164b1a5c19324e Author: Marek Vasut <marex@xxxxxxx> Date: Thu Oct 13 00:11:59 2022 +0200 drm/panel/panel-sitronix-st7701: Fix RTNI calculation [ Upstream commit c1cdee9b685a174fca849e1451c201a846a69318 ] The RTNI field is multiplied by 16 and incremented by 512 before being used as the minimum number of pixel clock per horizontal line, hence it is necessary to subtract those 512 bytes from htotal and then divide the result by 16 before writing the value into the RTNI field. Fix the calculation. Fixes: de2b4917843c ("drm/panel/panel-sitronix-st7701: Infer horizontal pixel count from TFT mode") Signed-off-by: Marek Vasut <marex@xxxxxxx> Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Link: https://patchwork.freedesktop.org/patch/msgid/20221012221159.88397-1-marex@xxxxxxx Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index c481daa4bbce..9578f461f5e4 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -244,7 +244,7 @@ static void st7701_init_sequence(struct st7701 *st7701) DSI_CMD2_BK0_INVSEL_ONES_MASK | FIELD_PREP(DSI_CMD2_BK0_INVSEL_NLINV_MASK, desc->nlinv), FIELD_PREP(DSI_CMD2_BK0_INVSEL_RTNI_MASK, - DIV_ROUND_UP(mode->htotal, 16))); + (clamp((u32)mode->htotal, 512U, 1008U) - 512) / 16)); /* Command2, BK1 */ ST7701_DSI(st7701, DSI_CMD2BKX_SEL,