From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21B86242D7F; Mon, 23 Mar 2026 14:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774277891; cv=none; b=AZxrClfjuVjL7iMEJFiL583MwoZkhnjkbqV4GKs64oQAYTu8DJAMMsF47SgYORb6jgg0C9L0qoSzb/6Z5HjcaZhthMNHBL9JgsEJRWAPVlyYacXAt5Tas71GLTvXw1I6NXpeXWxna611Kx7EeMEUuLq0Dkb+uZfgDwLjq7x0zmA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774277891; c=relaxed/simple; bh=WsM2ccPDfl1xOcIonlo0ov8CGj9LQz9bsh0LNxoJmuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pwD+wav8RStkPBfetgog7AYpt84uN/murTUoYzWHMAfnxcaKpJfEAszFra4ueYnONYpyDgkXsq3GHPRmiHHfmQSaLqd7RTqUl438uVMBdghPCsSIRw/zDdHr6tkwxuaaND5dkWHMRHaj4SLf7czroNzeM32Ecntr6Eh4LQvW7no= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jyYWE3Re; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jyYWE3Re" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3CF8C4CEF7; Mon, 23 Mar 2026 14:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774277891; bh=WsM2ccPDfl1xOcIonlo0ov8CGj9LQz9bsh0LNxoJmuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jyYWE3ReBrQbUm9uD4GGgXDiIL/v+VrVnIHMlYrZhH22R1S+URuTiUdnAPUN2G5Av Kj5Zsmvz2iL65L5HmN324FHgZ+CamwDVtZH+/1lCZyPXoZvJh1YhiX6gzSM8Hhbzaj 5okJtBK52mL+CbSYlBlelW4ZgBYLtJtIBaLt5CGY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Francesco Lavra , Javier Martinez Canillas , Sasha Levin Subject: [PATCH 6.6 133/567] drm/solomon: Fix page start when updating rectangle in page addressing mode Date: Mon, 23 Mar 2026 14:40:53 +0100 Message-ID: <20260323134537.098270968@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134533.749096647@linuxfoundation.org> References: <20260323134533.749096647@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Francesco Lavra [ Upstream commit 36d9579fed6c9429aa172f77bd28c58696ce8e2b ] In page addressing mode, the pixel values of a dirty rectangle must be sent to the display controller one page at a time. The range of pages corresponding to a given rectangle is being incorrectly calculated as if the Y value of the top left coordinate of the rectangle was 0. This can result in rectangle updates being displayed on wrong parts of the screen. Fix the above issue by consolidating the start page calculation in a single place at the beginning of the update_rect function, and using the calculated value for all addressing modes. Fixes: b0daaa5cfaa5 ("drm/ssd130x: Support page addressing mode") Signed-off-by: Francesco Lavra Reviewed-by: Javier Martinez Canillas Link: https://patch.msgid.link/20260210180932.736502-1-flavra@baylibre.com Signed-off-by: Javier Martinez Canillas Signed-off-by: Sasha Levin --- drivers/gpu/drm/solomon/ssd130x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index 81c85e67fa070..0d6a2664cfbeb 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -463,6 +463,7 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x, unsigned int height = drm_rect_height(rect); unsigned int line_length = DIV_ROUND_UP(width, 8); unsigned int page_height = SSD130X_PAGE_HEIGHT; + u8 page_start = ssd130x->page_offset + y / page_height; unsigned int pages = DIV_ROUND_UP(height, page_height); struct drm_device *drm = &ssd130x->drm; u32 array_idx = 0; @@ -500,14 +501,11 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x, */ if (!ssd130x->page_address_mode) { - u8 page_start; - /* Set address range for horizontal addressing mode */ ret = ssd130x_set_col_range(ssd130x, ssd130x->col_offset + x, width); if (ret < 0) return ret; - page_start = ssd130x->page_offset + y / page_height; ret = ssd130x_set_page_range(ssd130x, page_start, pages); if (ret < 0) return ret; @@ -539,7 +537,7 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x, */ if (ssd130x->page_address_mode) { ret = ssd130x_set_page_pos(ssd130x, - ssd130x->page_offset + i, + page_start + i, ssd130x->col_offset + x); if (ret < 0) return ret; -- 2.51.0