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 EF6AA1BEF77; Wed, 19 Feb 2025 09:21:38 +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=1739956899; cv=none; b=TXVBvFf333Sxsdi3cGoZcKDsA4f/GVuB6ouaNI4OgWxhqXZnAJuUrMOSIKzVE3FzA5xamyEoWrWROY0Qa+3+iZt2nNwJBi9+nHt8Kv5Er7dGKgnucy9pZ42qqkUFeL5gGaBOyJC8NPE+rDEGRSEt/WpAHwAfvTtDzcqnSAMkwvw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739956899; c=relaxed/simple; bh=DRdkGzmnVahKOmwot3PO4oNOdXDYV5Iv8g+uQwZtIPs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qG4uTCdtubjht9omuE+UdR37h9VPuGWjLFDI/qQv/aN5DfdR8YXVArpY6V7GmX+UNGlE2SzXcCfsNQepxwqmMIu/25sdqAKlrAuCB2/AygfCRYio7XzFpW6/4txMM0BccX1QV3xESscro12pfebv3hhe+IGgu03TavcMjD/0qxk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DinZYose; 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="DinZYose" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74DE3C4CED1; Wed, 19 Feb 2025 09:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739956898; bh=DRdkGzmnVahKOmwot3PO4oNOdXDYV5Iv8g+uQwZtIPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DinZYose6vd1QU9j8RIqCfHFVZFUkoNVB52WMB/QjXcjCbG4zDH07qjrFixweoYBu uNNLB7el1vktwsp1R139gTVrL7AEJG82wnac3qhz8009ar2khhdi4jGUT18Eqj8Ym+ J8Zp1YDk9rSuhKhSnBny76xdBnxZkX2iS/ipjxgc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thomas Zimmermann , Maarten Lankhorst Subject: [PATCH 6.1 338/578] drm/modeset: Handle tiled displays in pan_display_atomic. Date: Wed, 19 Feb 2025 09:25:42 +0100 Message-ID: <20250219082706.314885538@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250219082652.891560343@linuxfoundation.org> References: <20250219082652.891560343@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maarten Lankhorst commit f4a9dd57e549a17a7dac1c1defec26abd7e5c2d4 upstream. Tiled displays have a different x/y offset to begin with. Instead of attempting to remember this, just apply a delta instead. This fixes the first tile being duplicated on other tiles when vt switching. Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20250116142825.3933-1-dev@lankhorst.se Signed-off-by: Maarten Lankhorst Cc: Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_fb_helper.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1495,14 +1495,14 @@ int drm_fb_helper_set_par(struct fb_info } EXPORT_SYMBOL(drm_fb_helper_set_par); -static void pan_set(struct drm_fb_helper *fb_helper, int x, int y) +static void pan_set(struct drm_fb_helper *fb_helper, int dx, int dy) { struct drm_mode_set *mode_set; mutex_lock(&fb_helper->client.modeset_mutex); drm_client_for_each_modeset(mode_set, &fb_helper->client) { - mode_set->x = x; - mode_set->y = y; + mode_set->x += dx; + mode_set->y += dy; } mutex_unlock(&fb_helper->client.modeset_mutex); } @@ -1511,16 +1511,18 @@ static int pan_display_atomic(struct fb_ struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; - int ret; + int ret, dx, dy; - pan_set(fb_helper, var->xoffset, var->yoffset); + dx = var->xoffset - info->var.xoffset; + dy = var->yoffset - info->var.yoffset; + pan_set(fb_helper, dx, dy); ret = drm_client_modeset_commit_locked(&fb_helper->client); if (!ret) { info->var.xoffset = var->xoffset; info->var.yoffset = var->yoffset; } else - pan_set(fb_helper, info->var.xoffset, info->var.yoffset); + pan_set(fb_helper, -dx, -dy); return ret; }