Skip to contentSkip to conversation

Final round for DRM_FB_HELPER_DEFAULT_OPS usage

PATCH New Stefan Lengfeld 1 participant 4 messages Mar 14, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Final round for DRM_FB_HELPER_DEFAULT_OPS usage

Hi folks,

this is a follow up patch set to my initial tree wide refactoring

Subject: Introduce DRM_FB_HELPER_DEFAULT_OPS for struct fb_ops
https://patchwork.freedesktop.org/series/13099/

nearly one and a half year ago. It contains three patches for drivers

ast, hisilicon and mgag200

that are currently not using DRM_FB_HELPER_DEFAULT_OPS.

If the conversion is appropriate for your driver, you can pick up the patch. If not (because it may enable untested functionality), you can just ignore it. It's only a gentle remainder in case the conversion was missed in the first version/round.

In detail: One and a half year ago the drivers 'ast' and 'mgag200' did not use much of the drm_fb_helper functions. Now they do, so using DRM_FB_HELPER_DEFAULT_OPS seems beneficial.

The drm driver 'hisilicon' was either missed in the initial patch set or the driver was just added later.

Except the three drivers above, there are only two drivers not using DRM_FB_HELPER_DEFAULT_OPS left in the whole tree (v4.16-rc1): 'cirrus' and 'vmwgfx'. The former is marked as *do-not-touch* by checkpatch.pl and the later implements all fb_ops functions on it's on. No need for a conversion.

Last but not least: The driver 'omapdrm' just received a patch for the next kernel version to drop DRM_FB_HELPER_DEFAULT_OPS again. It causes a compiler waring 'Initializer entry defined twice', because the driver reassigns .fb_pan_display which is already provided in DRM_FB_HELPER_DEFAULT_OPS.

Kind Regards,
Stefan

Cc Dave Airlie <[email protected]>
Cc Rongrong Zou <[email protected]>
Cc Xinliang Liu <[email protected]>

---

Stefan Lengfeld (3):
drm/ast: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/hisilicon: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/mgag200: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops

 drivers/gpu/drm/ast/ast_fb.c                      | 8 +-------
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 6 +-----
 drivers/gpu/drm/mgag200/mgag200_fb.c              | 6 +-----
 3 files changed, 3 insertions(+), 17 deletions(-)
Signature · 6 lines
2.16.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 1/3 drm/ast: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops

Small refactoring. Use the helper define DRM_FB_HELPER_DEFAULT_OPS that provides the default implementations of the drm_fb_helper functions for struct fb_ops.

Now the driver implements an additional member of the struct fb_ops:

.fb_ioctl = drm_fb_helper_ioctl

This change is not tested.

---
 drivers/gpu/drm/ast/ast_fb.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/gpu/drm/ast/ast_fb.c +1 -7
index 0cd827e11fa2..e19b3bffe10b 100644
@@ -149,16 +149,10 @@ static void ast_imageblit(struct fb_info *info,
 
 static struct fb_ops astfb_ops = {
 	.owner = THIS_MODULE,
-	.fb_check_var = drm_fb_helper_check_var,
-	.fb_set_par = drm_fb_helper_set_par,
+	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_fillrect = ast_fillrect,
 	.fb_copyarea = ast_copyarea,
 	.fb_imageblit = ast_imageblit,
-	.fb_pan_display = drm_fb_helper_pan_display,
-	.fb_blank = drm_fb_helper_blank,
-	.fb_setcmap = drm_fb_helper_setcmap,
-	.fb_debug_enter = drm_fb_helper_debug_enter,
-	.fb_debug_leave = drm_fb_helper_debug_leave,
 };
 
 static int astfb_create_object(struct ast_fbdev *afbdev,
Signature · 6 lines
2.16.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 2/3 drm/hisilicon: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops

In reply to Stefan Lengfeld

Small refactoring. Use the helper define DRM_FB_HELPER_DEFAULT_OPS that provides the default implementations of the drm_fb_helper functions for struct fb_ops.

Now the driver implements three additional members of the struct fb_ops:

.fb_debug_enter = drm_fb_helper_debug_enter,
.fb_debug_leave = drm_fb_helper_debug_leave,
.fb_ioctl = drm_fb_helper_ioctl

These changes are not tested.

Cc Rongrong Zou <[email protected]>
Cc Xinliang Liu <[email protected]>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c +1 -5
index b92595c477ef..b18b20535cff 100644
@@ -43,14 +43,10 @@ static int hibmcfb_create_object(
 
 static struct fb_ops hibmc_drm_fb_ops = {
 	.owner = THIS_MODULE,
-	.fb_check_var = drm_fb_helper_check_var,
-	.fb_set_par = drm_fb_helper_set_par,
+	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_fillrect = drm_fb_helper_sys_fillrect,
 	.fb_copyarea = drm_fb_helper_sys_copyarea,
 	.fb_imageblit = drm_fb_helper_sys_imageblit,
-	.fb_pan_display = drm_fb_helper_pan_display,
-	.fb_blank = drm_fb_helper_blank,
-	.fb_setcmap = drm_fb_helper_setcmap,
 };
 
 static int hibmc_drm_fb_create(struct drm_fb_helper *helper,
Signature · 6 lines
2.16.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 3/3 drm/mgag200: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops

In reply to Stefan Lengfeld

Small refactoring. Use the helper define DRM_FB_HELPER_DEFAULT_OPS that provides the default implementations of the drm_fb_helper functions for struct fb_ops.

Now the driver implements three additional members of the struct fb_ops:

.fb_debug_enter = drm_fb_helper_debug_enter,
.fb_debug_leave = drm_fb_helper_debug_leave,
.fb_ioctl = drm_fb_helper_ioctl

These changes are not tested.

---
 drivers/gpu/drm/mgag200/mgag200_fb.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/mgag200/mgag200_fb.c +1 -5
index 30726c9fe28c..e02c11b6d27d 100644
@@ -125,14 +125,10 @@ static void mga_imageblit(struct fb_info *info,
 
 static struct fb_ops mgag200fb_ops = {
 	.owner = THIS_MODULE,
-	.fb_check_var = drm_fb_helper_check_var,
-	.fb_set_par = drm_fb_helper_set_par,
+	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_fillrect = mga_fillrect,
 	.fb_copyarea = mga_copyarea,
 	.fb_imageblit = mga_imageblit,
-	.fb_pan_display = drm_fb_helper_pan_display,
-	.fb_blank = drm_fb_helper_blank,
-	.fb_setcmap = drm_fb_helper_setcmap,
 };
 
 static int mgag200fb_create_object(struct mga_fbdev *afbdev,
Signature · 6 lines
2.16.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel