@@ -1354,14 +1354,14 @@ int drm_fb_helper_set_par(struct fb_info *info)
13541354}
13551355EXPORT_SYMBOL (drm_fb_helper_set_par );
13561356
1357- static void pan_set (struct drm_fb_helper * fb_helper , int x , int y )
1357+ static void pan_set (struct drm_fb_helper * fb_helper , int dx , int dy )
13581358{
13591359 struct drm_mode_set * mode_set ;
13601360
13611361 mutex_lock (& fb_helper -> client .modeset_mutex );
13621362 drm_client_for_each_modeset (mode_set , & fb_helper -> client ) {
1363- mode_set -> x = x ;
1364- mode_set -> y = y ;
1363+ mode_set -> x += dx ;
1364+ mode_set -> y += dy ;
13651365 }
13661366 mutex_unlock (& fb_helper -> client .modeset_mutex );
13671367}
@@ -1370,16 +1370,18 @@ static int pan_display_atomic(struct fb_var_screeninfo *var,
13701370 struct fb_info * info )
13711371{
13721372 struct drm_fb_helper * fb_helper = info -> par ;
1373- int ret ;
1373+ int ret , dx , dy ;
13741374
1375- pan_set (fb_helper , var -> xoffset , var -> yoffset );
1375+ dx = var -> xoffset - info -> var .xoffset ;
1376+ dy = var -> yoffset - info -> var .yoffset ;
1377+ pan_set (fb_helper , dx , dy );
13761378
13771379 ret = drm_client_modeset_commit_locked (& fb_helper -> client );
13781380 if (!ret ) {
13791381 info -> var .xoffset = var -> xoffset ;
13801382 info -> var .yoffset = var -> yoffset ;
13811383 } else
1382- pan_set (fb_helper , info -> var . xoffset , info -> var . yoffset );
1384+ pan_set (fb_helper , - dx , - dy );
13831385
13841386 return ret ;
13851387}
0 commit comments