diff mbox series

[05/16] drm/fb-helper: Remove drm_fb_helper_crtc->{x, y, desired_mode}

Message ID 20190326175546.18126-6-noralf@tronnes.org (mailing list archive)
State New, archived
Headers show
Series drm/fb-helper: Move modesetting code to drm_client | expand

Commit Message

Noralf Trønnes March 26, 2019, 5:55 p.m. UTC
The values are already present in the modeset.

This is done in preparation for the removal of struct drm_fb_helper_crtc.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/gpu/drm/drm_fb_helper.c | 12 ++++--------
 include/drm/drm_fb_helper.h     |  2 --
 2 files changed, 4 insertions(+), 10 deletions(-)

Comments

Daniel Vetter March 28, 2019, 8:19 a.m. UTC | #1
On Tue, Mar 26, 2019 at 06:55:35PM +0100, Noralf Trønnes wrote:
> The values are already present in the modeset.
> 
> This is done in preparation for the removal of struct drm_fb_helper_crtc.
> 
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/drm_fb_helper.c | 12 ++++--------
>  include/drm/drm_fb_helper.h     |  2 --
>  2 files changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index e1b147fdd3f9..36310901e935 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -2023,16 +2023,16 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
>  		 */
>  		bool lastv = true, lasth = true;
>  
> -		desired_mode = fb_helper->crtc_info[i].desired_mode;
>  		mode_set = &fb_helper->crtc_info[i].mode_set;
> +		desired_mode = mode_set->mode;
>  
>  		if (!desired_mode)
>  			continue;
>  
>  		crtc_count++;
>  
> -		x = fb_helper->crtc_info[i].x;
> -		y = fb_helper->crtc_info[i].y;
> +		x = mode_set->x;
> +		y = mode_set->y;
>  
>  		sizes.surface_width  = max_t(u32, desired_mode->hdisplay + x, sizes.surface_width);
>  		sizes.surface_height = max_t(u32, desired_mode->vdisplay + y, sizes.surface_height);
> @@ -2617,11 +2617,7 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
>  			DRM_DEBUG_KMS("desired mode %s set on crtc %d (%d,%d)\n",
>  				      mode->name, fb_crtc->mode_set.crtc->base.id, offset->x, offset->y);
>  
> -			fb_crtc->desired_mode = mode;
> -			fb_crtc->x = offset->x;
> -			fb_crtc->y = offset->y;
> -			modeset->mode = drm_mode_duplicate(dev,
> -							   fb_crtc->desired_mode);
> +			modeset->mode = drm_mode_duplicate(dev, mode);
>  			drm_connector_get(connector);
>  			modeset->connectors[modeset->num_connectors++] = connector;
>  			modeset->x = offset->x;
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index cff1aa222886..7a095964f6b2 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -48,8 +48,6 @@ struct drm_fb_offset {
>  
>  struct drm_fb_helper_crtc {
>  	struct drm_mode_set mode_set;
> -	struct drm_display_mode *desired_mode;
> -	int x, y;
>  };
>  
>  /**
> -- 
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index e1b147fdd3f9..36310901e935 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -2023,16 +2023,16 @@  static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
 		 */
 		bool lastv = true, lasth = true;
 
-		desired_mode = fb_helper->crtc_info[i].desired_mode;
 		mode_set = &fb_helper->crtc_info[i].mode_set;
+		desired_mode = mode_set->mode;
 
 		if (!desired_mode)
 			continue;
 
 		crtc_count++;
 
-		x = fb_helper->crtc_info[i].x;
-		y = fb_helper->crtc_info[i].y;
+		x = mode_set->x;
+		y = mode_set->y;
 
 		sizes.surface_width  = max_t(u32, desired_mode->hdisplay + x, sizes.surface_width);
 		sizes.surface_height = max_t(u32, desired_mode->vdisplay + y, sizes.surface_height);
@@ -2617,11 +2617,7 @@  static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
 			DRM_DEBUG_KMS("desired mode %s set on crtc %d (%d,%d)\n",
 				      mode->name, fb_crtc->mode_set.crtc->base.id, offset->x, offset->y);
 
-			fb_crtc->desired_mode = mode;
-			fb_crtc->x = offset->x;
-			fb_crtc->y = offset->y;
-			modeset->mode = drm_mode_duplicate(dev,
-							   fb_crtc->desired_mode);
+			modeset->mode = drm_mode_duplicate(dev, mode);
 			drm_connector_get(connector);
 			modeset->connectors[modeset->num_connectors++] = connector;
 			modeset->x = offset->x;
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index cff1aa222886..7a095964f6b2 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -48,8 +48,6 @@  struct drm_fb_offset {
 
 struct drm_fb_helper_crtc {
 	struct drm_mode_set mode_set;
-	struct drm_display_mode *desired_mode;
-	int x, y;
 };
 
 /**