mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
drm/modeset: Handle tiled displays in pan_display_atomic.
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 <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20250116142825.3933-1-dev@lankhorst.se Signed-off-by: Maarten Lankhorst <dev@lankhorst.se> Cc: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
aab59f1ca9
commit
c6b9eaeff4
@@ -1495,14 +1495,14 @@ int drm_fb_helper_set_par(struct fb_info *info)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_fb_helper_set_par);
|
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;
|
struct drm_mode_set *mode_set;
|
||||||
|
|
||||||
mutex_lock(&fb_helper->client.modeset_mutex);
|
mutex_lock(&fb_helper->client.modeset_mutex);
|
||||||
drm_client_for_each_modeset(mode_set, &fb_helper->client) {
|
drm_client_for_each_modeset(mode_set, &fb_helper->client) {
|
||||||
mode_set->x = x;
|
mode_set->x += dx;
|
||||||
mode_set->y = y;
|
mode_set->y += dy;
|
||||||
}
|
}
|
||||||
mutex_unlock(&fb_helper->client.modeset_mutex);
|
mutex_unlock(&fb_helper->client.modeset_mutex);
|
||||||
}
|
}
|
||||||
@@ -1511,16 +1511,18 @@ static int pan_display_atomic(struct fb_var_screeninfo *var,
|
|||||||
struct fb_info *info)
|
struct fb_info *info)
|
||||||
{
|
{
|
||||||
struct drm_fb_helper *fb_helper = info->par;
|
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);
|
ret = drm_client_modeset_commit_locked(&fb_helper->client);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
info->var.xoffset = var->xoffset;
|
info->var.xoffset = var->xoffset;
|
||||||
info->var.yoffset = var->yoffset;
|
info->var.yoffset = var->yoffset;
|
||||||
} else
|
} else
|
||||||
pan_set(fb_helper, info->var.xoffset, info->var.yoffset);
|
pan_set(fb_helper, -dx, -dy);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user