[07/21] drm/cirrus: Use drm_fb_helper_fill_info
diff mbox series

Message ID 20190326132008.11781-7-daniel.vetter@ffwll.ch
State New
Headers show
Series
  • [01/21] drm/fb-helper: Add fill_info() functions
Related show

Commit Message

Daniel Vetter March 26, 2019, 1:19 p.m. UTC
Should not result in any changes.

v2: Rebase

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/cirrus/cirrus_drv.h   | 2 +-
 drivers/gpu/drm/cirrus/cirrus_fbdev.c | 8 +-------
 2 files changed, 2 insertions(+), 8 deletions(-)

Comments

Noralf Trønnes March 26, 2019, 2:24 p.m. UTC | #1
Den 26.03.2019 14.19, skrev Daniel Vetter:
> Should not result in any changes.
> 
> v2: Rebase
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  drivers/gpu/drm/cirrus/cirrus_drv.h   | 2 +-
>  drivers/gpu/drm/cirrus/cirrus_fbdev.c | 8 +-------
>  2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h
> index f2b2e0d169fa..915709739257 100644
> --- a/drivers/gpu/drm/cirrus/cirrus_drv.h
> +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h
> @@ -143,7 +143,7 @@ struct cirrus_device {
>  
>  
>  struct cirrus_fbdev {
> -	struct drm_fb_helper helper;
> +	struct drm_fb_helper helper; /* must be first */

Same implicit issue here as with ast, but anyways:

Acked-by: Noralf Trønnes <noralf@tronnes.org>


>  	struct drm_framebuffer *gfb;
>  	void *sysram;
>  	int size;
> diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
> index 39df62acac69..2e6128069fc3 100644
> --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
> +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
> @@ -195,8 +195,6 @@ static int cirrusfb_create(struct drm_fb_helper *helper,
>  		goto err_vfree;
>  	}
>  
> -	info->par = gfbdev;
> -
>  	fb = kzalloc(sizeof(*fb), GFP_KERNEL);
>  	if (!fb) {
>  		ret = -ENOMEM;
> @@ -214,13 +212,9 @@ static int cirrusfb_create(struct drm_fb_helper *helper,
>  	/* setup helper */
>  	gfbdev->helper.fb = fb;
>  
> -	strcpy(info->fix.id, "cirrusdrmfb");
> -
>  	info->fbops = &cirrusfb_ops;
>  
> -	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
> -	drm_fb_helper_fill_var(info, &gfbdev->helper, sizes->fb_width,
> -			       sizes->fb_height);
> +	drm_fb_helper_fill_info(info, &gfbdev->helper, sizes);
>  
>  	/* setup aperture base/size for vesafb takeover */
>  	info->apertures->ranges[0].base = cdev->dev->mode_config.fb_base;
>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h
index f2b2e0d169fa..915709739257 100644
--- a/drivers/gpu/drm/cirrus/cirrus_drv.h
+++ b/drivers/gpu/drm/cirrus/cirrus_drv.h
@@ -143,7 +143,7 @@  struct cirrus_device {
 
 
 struct cirrus_fbdev {
-	struct drm_fb_helper helper;
+	struct drm_fb_helper helper; /* must be first */
 	struct drm_framebuffer *gfb;
 	void *sysram;
 	int size;
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
index 39df62acac69..2e6128069fc3 100644
--- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
+++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
@@ -195,8 +195,6 @@  static int cirrusfb_create(struct drm_fb_helper *helper,
 		goto err_vfree;
 	}
 
-	info->par = gfbdev;
-
 	fb = kzalloc(sizeof(*fb), GFP_KERNEL);
 	if (!fb) {
 		ret = -ENOMEM;
@@ -214,13 +212,9 @@  static int cirrusfb_create(struct drm_fb_helper *helper,
 	/* setup helper */
 	gfbdev->helper.fb = fb;
 
-	strcpy(info->fix.id, "cirrusdrmfb");
-
 	info->fbops = &cirrusfb_ops;
 
-	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
-	drm_fb_helper_fill_var(info, &gfbdev->helper, sizes->fb_width,
-			       sizes->fb_height);
+	drm_fb_helper_fill_info(info, &gfbdev->helper, sizes);
 
 	/* setup aperture base/size for vesafb takeover */
 	info->apertures->ranges[0].base = cdev->dev->mode_config.fb_base;