Introduce DRM_FB_HELPER_DEFAULT_OPS for struct fb_ops
Subsystems (20)
cover Introduce DRM_FB_HELPER_DEFAULT_OPS for struct fb_ops
Hi,
this series is refactoring work suggested by Daniel Vetter in the email:
https://lists.freedesktop.org/archives/dri-devel/2016-July/113237.html
The define DRM_FB_HELPER_DEFAULT_OPS provides the drm_fb_helper default implementations for functions in struct fb_ops. A drm driver can use it like:
static struct fb_ops drm_fbdev_cma_ops = {
.owner = THIS_MODULE,
DRM_FB_HELPER_DEFAULT_OPS,
/* driver specific implementations */
};The patches do not make any functional change to the kernel binary except driver 'drm/gma500'. The patch for gma500 enables two new functions (fb_setcmap and fb_pan_display) in fb_ops. If this is not appropriate, the driver may reassign the struct members to null.
There is no refactoring patch for driver 'vmwgfx'. It reimplements nearly all fb_ops with driver specific functions anyways.
This series is based on tag v4.8-rc8. If rebased onto 'drm-next' there are two small conflicts.
Kind regards,
Stefan Christ
Stefan Christ (20):
drm/fb-helper: add DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/amdgpu: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/armada: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/ast: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/bochs: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/cirrus: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/fb_cma_helper: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/exynos: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/mgag200: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/nouveau: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/qxl: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/rockchip: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/radeon: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/tegra: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/udl: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/msm: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/virtio: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/omapdrm: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/i915: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 6 +----- drivers/gpu/drm/armada/armada_fbdev.c | 6 +----- drivers/gpu/drm/ast/ast_fb.c | 6 +----- drivers/gpu/drm/bochs/bochs_fbdev.c | 6 +----- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 6 +----- drivers/gpu/drm/drm_fb_cma_helper.c | 6 +----- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 6 +----- drivers/gpu/drm/gma500/framebuffer.c | 12 +++--------- drivers/gpu/drm/i915/intel_fbdev.c | 3 +-- drivers/gpu/drm/mgag200/mgag200_fb.c | 6 +----- drivers/gpu/drm/msm/msm_fbdev.c | 7 +------ drivers/gpu/drm/nouveau/nouveau_fbcon.c | 12 ++---------- drivers/gpu/drm/omapdrm/omap_fbdev.c | 5 +---- drivers/gpu/drm/qxl/qxl_fb.c | 6 +----- drivers/gpu/drm/radeon/radeon_fb.c | 6 +----- drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 6 +----- drivers/gpu/drm/tegra/fb.c | 6 +----- drivers/gpu/drm/udl/udl_fb.c | 6 +----- drivers/gpu/drm/virtio/virtgpu_fb.c | 6 +----- include/drm/drm_fb_helper.h | 13 +++++++++++++ 20 files changed, 35 insertions(+), 101 deletions(-)
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/20 drm/fb-helper: add DRM_FB_HELPER_DEFAULT_OPS for fb_ops
The define DRM_FB_HELPER_DEFAULT_OPS provides the drm_fb_helper default implementations for functions in struct fb_ops. A drm driver can use it like:
static struct fb_ops drm_fbdev_cma_ops = {
.owner = THIS_MODULE,
DRM_FB_HELPER_DEFAULT_OPS,
/* driver specific implementations */
};--- include/drm/drm_fb_helper.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
include/drm/drm_fb_helper.h +13 -0
@@ -214,6 +214,19 @@ struct drm_fb_helper {bool delayed_hotplug; }; +/** +* @DRM_FB_HELPER_DEFAULT_OPS: +* +* Helper define to register default implementations of drm_fb_helper +* functions. To be used in struct fb_ops of drm drivers. +*/ +#define DRM_FB_HELPER_DEFAULT_OPS \ + .fb_check_var = drm_fb_helper_check_var, \ + .fb_set_par = drm_fb_helper_set_par, \ + .fb_setcmap = drm_fb_helper_setcmap, \ + .fb_blank = drm_fb_helper_blank, \ + .fb_pan_display = drm_fb_helper_pan_display +#ifdef CONFIG_DRM_FBDEV_EMULATION int drm_fb_helper_modinit (void ); void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 01/20] drm/fb-helper: add DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Quoted 4 lines · Stefan Christ
The define
DRM_FB_HELPER_DEFAULT_OPSprovides thedrm_fb_helperdefault implementations for functions in structfb_ops. A drm driver can use it like:
Quoted 8 lines
static struct fb_ops drm_fbdev_cma_ops = { .owner = THIS_MODULE, DRM_FB_HELPER_DEFAULT_OPS, /* driver specific implementations */ };Suggested-by Daniel Vetter <[email protected]>Signed-off-by Stefan Christ <[email protected]>
Applied just this one for 4.9. I think I'll postpone the others to 4.10. -Daniel
Quoted 35 lines
--- include/drm/drm_fb_helper.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)include/drm/drm_fb_helper.h +13
-0@@ -214,6 +214,19 @@ struct drm_fb_helper {bool delayed_hotplug; }; +/** +* @DRM_FB_HELPER_DEFAULT_OPS: +* +* Helper define to register default implementations of drm_fb_helper +* functions. To be used in struct fb_ops of drm drivers. +*/ +#define DRM_FB_HELPER_DEFAULT_OPS \ + .fb_check_var = drm_fb_helper_check_var, \ + .fb_set_par = drm_fb_helper_set_par, \ + .fb_setcmap = drm_fb_helper_setcmap, \ + .fb_blank = drm_fb_helper_blank, \ + .fb_pan_display = drm_fb_helper_pan_display +#ifdef CONFIG_DRM_FBDEV_EMULATION int drm_fb_helper_modinit (void ); void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/20 drm/amdgpu: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1 -5
@@ -50,14 +50,10 @@ struct amdgpu_fbdev {static struct fb_ops amdgpufb_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_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea, .fb_imageblit = drm_fb_helper_cfb_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, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/20] drm/amdgpu: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Quoted 16 lines · Stefan Christ
Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Signed-off-by Stefan Christ <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0
-1@@ -50,14 +50,10 @@ struct amdgpu_fbdev {static struct fb_ops amdgpufb_ops = { .owner =THIS_MODULE , - .fb_check_var = drm_fb_helper_check_var,
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c struct amdgpu_fbdev { · line 58
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1
-4- .fb_set_par = drm_fb_helper_set_par, + DRM_FB_HELPER_DEFAULT_OPS, .fb_fillrect = drm_fb_helper_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea, .fb_imageblit = drm_fb_helper_cfb_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,
Ok, wanted to start vacuuming stuff up, but then realized that this doesn't share the fb_fillrect, fb_copyarea, fb_imageblit and fb_debug_enter/leave funcs. Not sharing fb_mmap makes sense, because that must be special. But all the others can be shared. Any reasons for not doing so?
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/20 drm/armada: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/armada/armada_fbdev.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/armada/armada_fbdev.c +1 -5
@@ -20,14 +20,10 @@static /*const*/ struct fb_ops armada_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_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea, .fb_imageblit = drm_fb_helper_cfb_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, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/20 drm/ast: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/ast/ast_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/ast/ast_fb.c +1 -5
@@ -150,14 +150,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, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/20] drm/ast: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Quoted 11 lines · Stefan Christ
Cc Dave Airlie <[email protected]>Signed-off-by Stefan Christ <[email protected]>--- drivers/gpu/drm/ast/ast_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/ast/ast_fb.c +0
-0
drivers/gpu/drm/ast/ast_fb.c static void ast_imageblit(struct fb_info *info, · line 156
Quoted 9 lines
drivers/gpu/drm/ast/ast_fb.c +1
-2@@ -150,14 +150,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,
Ah, here's the likely reason for not sharing these, ast/cirrus have their special dirtying stuff for fbdev emulation. And because the fbdev mmap must have a stable pointer it can't use the ttm bo mmap magic of automatically picking the right place for the mmap.
I'd say just leave these 2 drivers out as special cases. -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/20] drm/ast: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Hi Daniel,
Quoted 27 lines · Daniel Vetter
Quoted 11 lines · Stefan Christ
Cc Dave Airlie <[email protected]>Signed-off-by Stefan Christ <[email protected]>--- drivers/gpu/drm/ast/ast_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/ast/ast_fb.c +0
-0drivers/gpu/drm/ast/ast_fb.c static void ast_imageblit(struct fb_info *info, · line 156
Quoted 9 lines
drivers/gpu/drm/ast/ast_fb.c +1
-2@@ -150,14 +150,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,Ah, here's the likely reason for not sharing these, ast/cirrus have their special dirtying stuff for fbdev emulation. And because the fbdev mmap must have a stable pointer it can't use the ttm bo mmap magic of automatically picking the right place for the mmap.
Quoted 2 lines
I'd say just leave these 2 drivers out as special cases. -Daniel
Hmm. There are even more drivers using special implementations like the mgag200 using function mga_fillrect(), which is a wrapper around drm_fb_helper_sys_fillrect().
Even if the drivers ast/cirrus/.. are left out, there are still two different fb_fillrect, fb_copyarea and fb_imageblit implementations:
1/ drm_fb_helper_sys_*() and
2/ drm_fb_helper_cfb_*()
used by different drivers. I don't know which one should be preferred.
Including fb_debug_enter and fb_debug_leave in DRM_FB_HELPER_DEFAULT_OPS is not a problem since there is only a single implementation yet.
Should I resend this series (without the first patch), but with additional memebers fb_debug_enter and fb_debug_leave?
Kind regards,
Stefan Christ
Quoted 5 lines
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/20] drm/ast: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Quoted 29 lines · Stefan Lengfeld
Quoted 27 lines · Daniel Vetter
Quoted 11 lines · Stefan Christ
Cc Dave Airlie <[email protected]>Signed-off-by Stefan Christ <[email protected]>--- drivers/gpu/drm/ast/ast_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/ast/ast_fb.c +0
-0drivers/gpu/drm/ast/ast_fb.c static void ast_imageblit(struct fb_info *info, · line 156
Quoted 9 lines
drivers/gpu/drm/ast/ast_fb.c +1
-2@@ -150,14 +150,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,Ah, here's the likely reason for not sharing these, ast/cirrus have their special dirtying stuff for fbdev emulation. And because the fbdev mmap must have a stable pointer it can't use the ttm bo mmap magic of automatically picking the right place for the mmap.
Quoted 6 lines
Quoted 2 lines
I'd say just leave these 2 drivers out as special cases. -Daniel
Hmm. There are even more drivers using special implementations like the mgag200 using function
mga_fillrect(), which is a wrapper arounddrm_fb_helper_sys_fillrect().
Hm, mga_fillrect is like ast/cirrus.
Quoted 5 lines
Even if the drivers ast/cirrus/.. are left out, there are still two different
fb_fillrect,fb_copyareaandfb_imageblitimplementations:1/ drm_fb_helper_sys_*() and 2/ drm_fb_helper_cfb_*()used by different drivers. I don't know which one should be preferred.
Hm, every day I learn something new about fbdev. Totally missed that there's 2 different kinds of helpers, and I think we do indeed need both.
Quoted 5 lines
Including
fb_debug_enterandfb_debug_leaveinDRM_FB_HELPER_DEFAULT_OPSis not a problem since there is only a single implementation yet.Should I resend this series (without the first patch), but with additional memebers
fb_debug_enterandfb_debug_leave?
Yeah I think that'd be reasonable. For the sys/cfb stuff, what about adding new #defines for those 2, e.g. DRM_FB_HELPER_SYS_OPS and DRM_FB_HELPER_CFB_OPS? Maybe as a follow-up series of course, if you have time. When resending please pick up the acks/reviews from this series (but annoted with a v1 or so.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/20] drm/ast: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Quoted 53 lines · Daniel Vetter
Quoted 29 lines · Stefan Lengfeld
Quoted 27 lines · Daniel Vetter
Quoted 11 lines · Stefan Christ
Cc Dave Airlie <[email protected]>Signed-off-by Stefan Christ <[email protected]>--- drivers/gpu/drm/ast/ast_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/ast/ast_fb.c +0
-0drivers/gpu/drm/ast/ast_fb.c static void ast_imageblit(struct fb_info *info, · line 156
Quoted 9 lines
drivers/gpu/drm/ast/ast_fb.c +1
-2@@ -150,14 +150,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,Ah, here's the likely reason for not sharing these, ast/cirrus have their special dirtying stuff for fbdev emulation. And because the fbdev mmap must have a stable pointer it can't use the ttm bo mmap magic of automatically picking the right place for the mmap.
Quoted 6 lines
Quoted 2 lines
I'd say just leave these 2 drivers out as special cases. -Daniel
Hmm. There are even more drivers using special implementations like the mgag200 using function
mga_fillrect(), which is a wrapper arounddrm_fb_helper_sys_fillrect().Hm,
mga_fillrectis like ast/cirrus.Quoted 5 lines
Even if the drivers ast/cirrus/.. are left out, there are still two different
fb_fillrect,fb_copyareaandfb_imageblitimplementations:1/ drm_fb_helper_sys_*() and 2/ drm_fb_helper_cfb_*()used by different drivers. I don't know which one should be preferred.
Hm, every day I learn something new about fbdev. Totally missed that there's 2 different kinds of helpers, and I think we do indeed need both.
Quoted 3 lines
Including
fb_debug_enterandfb_debug_leaveinDRM_FB_HELPER_DEFAULT_OPSis not a problem since there is only a single implementation yet.
Quoted 8 lines
Quoted 2 lines
Should I resend this series (without the first patch), but with additional memebers
fb_debug_enterandfb_debug_leave?Yeah I think that'd be reasonable. For the sys/cfb stuff, what about adding new #defines for those 2, e.g.
DRM_FB_HELPER_SYS_OPSandDRM_FB_HELPER_CFB_OPS? Maybe as a follow-up series of course, if you have time. When resending please pick up the acks/reviews from this series (but annoted with a v1 or so.
Are you still working on a v2, or should I just pick up v1 for now? -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/20] drm/ast: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Hi Daniel,
Quoted 57 lines · Daniel Vetter
Quoted 56 lines · Daniel Vetter
Quoted 29 lines · Stefan Lengfeld
Quoted 27 lines · Daniel Vetter
Quoted 11 lines · Stefan Christ
Cc Dave Airlie <[email protected]>Signed-off-by Stefan Christ <[email protected]>--- drivers/gpu/drm/ast/ast_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/ast/ast_fb.c +0
-0drivers/gpu/drm/ast/ast_fb.c static void ast_imageblit(struct fb_info *info, · line 156
Quoted 9 lines
drivers/gpu/drm/ast/ast_fb.c +1
-2@@ -150,14 +150,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,Ah, here's the likely reason for not sharing these, ast/cirrus have their special dirtying stuff for fbdev emulation. And because the fbdev mmap must have a stable pointer it can't use the ttm bo mmap magic of automatically picking the right place for the mmap.
Quoted 6 lines
Quoted 2 lines
I'd say just leave these 2 drivers out as special cases. -Daniel
Hmm. There are even more drivers using special implementations like the mgag200 using function
mga_fillrect(), which is a wrapper arounddrm_fb_helper_sys_fillrect().Hm,
mga_fillrectis like ast/cirrus.Quoted 5 lines
Even if the drivers ast/cirrus/.. are left out, there are still two different
fb_fillrect,fb_copyareaandfb_imageblitimplementations:1/ drm_fb_helper_sys_*() and 2/ drm_fb_helper_cfb_*()used by different drivers. I don't know which one should be preferred.
Hm, every day I learn something new about fbdev. Totally missed that there's 2 different kinds of helpers, and I think we do indeed need both.
Quoted 5 lines
Including
fb_debug_enterandfb_debug_leaveinDRM_FB_HELPER_DEFAULT_OPSis not a problem since there is only a single implementation yet.Should I resend this series (without the first patch), but with additional memebers
fb_debug_enterandfb_debug_leave?
Quoted 8 lines
Quoted 5 lines
Yeah I think that'd be reasonable. For the sys/cfb stuff, what about adding new #defines for those 2, e.g.
DRM_FB_HELPER_SYS_OPSandDRM_FB_HELPER_CFB_OPS? Maybe as a follow-up series of course, if you have time. When resending please pick up the acks/reviews from this series (but annoted with a v1 or so.Are you still working on a v2, or should I just pick up v1 for now? -Daniel
I will send a v2 patch set in the next days.
Kind regards,
Stefan Christ
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/20 drm/bochs: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/bochs/bochs_fbdev.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/bochs/bochs_fbdev.c +1 -5
@@ -22,14 +22,10 @@ static int bochsfb_mmap(struct fb_info *info,static struct fb_ops bochsfb_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, .fb_mmap = bochsfb_mmap, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 6/20 drm/cirrus: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/cirrus/cirrus_fbdev.c +1 -5
@@ -124,14 +124,10 @@ static void cirrus_imageblit(struct fb_info *info,static struct fb_ops cirrusfb_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 = cirrus_fillrect, .fb_copyarea = cirrus_copyarea, .fb_imageblit = cirrus_imageblit, - .fb_pan_display = drm_fb_helper_pan_display, - .fb_blank = drm_fb_helper_blank, - .fb_setcmap = drm_fb_helper_setcmap, }; static int cirrusfb_create_object(struct cirrus_fbdev *afbdev,
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/20 drm/fb_cma_helper: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/drm_fb_cma_helper.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/drm_fb_cma_helper.c +1 -5
@@ -311,14 +311,10 @@ static int drm_fb_cma_mmap(struct fb_info *info, struct vm_area_struct *vma)static struct fb_ops drm_fbdev_cma_ops = { .owner =THIS_MODULE , +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_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, - .fb_blank = drm_fb_helper_blank, - .fb_pan_display = drm_fb_helper_pan_display, - .fb_setcmap = drm_fb_helper_setcmap, .fb_mmap = drm_fb_cma_mmap, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 8/20 drm/exynos: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +1 -5
@@ -63,15 +63,11 @@ static int exynos_drm_fb_mmap(struct fb_info *info,static struct fb_ops exynos_drm_fb_ops = { .owner =THIS_MODULE , +DRM_FB_HELPER_DEFAULT_OPS , .fb_mmap = exynos_drm_fb_mmap, .fb_fillrect = drm_fb_helper_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea, .fb_imageblit = drm_fb_helper_cfb_imageblit, - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, - .fb_blank = drm_fb_helper_blank, - .fb_pan_display = drm_fb_helper_pan_display, - .fb_setcmap = drm_fb_helper_setcmap, }; static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 08/20] drm/exynos: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Thanks,
Inki Dae
2016-09-30 5:48 GMT+09:00 Stefan Christ <[email protected]>:
Quoted 33 lines
Cc Inki Dae <[email protected]>Cc Joonyoung Shim <[email protected]>Cc Seung-Woo Kim <[email protected]>Cc Kyungmin Park <[email protected]>Signed-off-by Stefan Christ <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fbdev.c +1
-6@@ -63,15 +63,11 @@ static int exynos_drm_fb_mmap(struct fb_info *info,static struct fb_ops exynos_drm_fb_ops = { .owner =THIS_MODULE , +DRM_FB_HELPER_DEFAULT_OPS , .fb_mmap = exynos_drm_fb_mmap, .fb_fillrect = drm_fb_helper_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea, .fb_imageblit = drm_fb_helper_cfb_imageblit, - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, - .fb_blank = drm_fb_helper_blank, - .fb_pan_display = drm_fb_helper_pan_display, - .fb_setcmap = drm_fb_helper_setcmap, }; static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, --2.7.3
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 9/20 drm/mgag200: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/mgag200/mgag200_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/mgag200/mgag200_fb.c +1 -5
@@ -127,14 +127,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.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 10/20 drm/nouveau: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/nouveau/nouveau_fbcon.c +2 -10
@@ -200,33 +200,25 @@ nouveau_fbcon_release(struct fb_info *info, int user)static struct fb_ops nouveau_fbcon_ops = { .owner =THIS_MODULE , +DRM_FB_HELPER_DEFAULT_OPS , .fb_open = nouveau_fbcon_open, .fb_release = nouveau_fbcon_release, - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, .fb_fillrect = nouveau_fbcon_fillrect, .fb_copyarea = nouveau_fbcon_copyarea, .fb_imageblit = nouveau_fbcon_imageblit, .fb_sync = nouveau_fbcon_sync, - .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 struct fb_ops nouveau_fbcon_sw_ops = { .owner =THIS_MODULE , +DRM_FB_HELPER_DEFAULT_OPS , .fb_open = nouveau_fbcon_open, .fb_release = nouveau_fbcon_release, - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, .fb_fillrect = drm_fb_helper_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea, .fb_imageblit = drm_fb_helper_cfb_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, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 11/20 drm/qxl: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/qxl/qxl_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/qxl/qxl_fb.c +1 -5
@@ -82,14 +82,10 @@ static struct fb_deferred_io qxl_defio = {static struct fb_ops qxlfb_ops = { .owner =THIS_MODULE , - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par,/* TODO: copy vmwgfx */ +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, .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 12/20 drm/rockchip: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c +1 -5
@@ -36,15 +36,11 @@ static int rockchip_fbdev_mmap(struct fb_info *info,static struct fb_ops rockchip_drm_fbdev_ops = { .owner =THIS_MODULE , +DRM_FB_HELPER_DEFAULT_OPS , .fb_mmap = rockchip_fbdev_mmap, .fb_fillrect = drm_fb_helper_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea, .fb_imageblit = drm_fb_helper_cfb_imageblit, - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, - .fb_blank = drm_fb_helper_blank, - .fb_pan_display = drm_fb_helper_pan_display, - .fb_setcmap = drm_fb_helper_setcmap, }; static int rockchip_drm_fbdev_create(struct drm_fb_helper *helper,
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 13/20 drm/radeon: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/radeon/radeon_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/radeon/radeon_fb.c +1 -5
@@ -49,14 +49,10 @@ struct radeon_fbdev {static struct fb_ops radeonfb_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_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea, .fb_imageblit = drm_fb_helper_cfb_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, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 14/20 drm/tegra: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/tegra/fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/tegra/fb.c +1 -5
@@ -186,14 +186,10 @@ unreference:#ifdef CONFIG_DRM_FBDEV_EMULATION static struct fb_ops tegra_fb_ops = { .owner =THIS_MODULE , +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_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, - .fb_blank = drm_fb_helper_blank, - .fb_pan_display = drm_fb_helper_pan_display, - .fb_setcmap = drm_fb_helper_setcmap, }; static int tegra_fbdev_probe(struct drm_fb_helper *helper,
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 15/20 drm/udl: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/udl/udl_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/udl/udl_fb.c +1 -5
@@ -254,14 +254,10 @@ static int udl_fb_release(struct fb_info *info, int user)static struct fb_ops udlfb_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, .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave, .fb_mmap = udl_fb_mmap,
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 16/20 drm/msm: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/msm/msm_fbdev.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/msm/msm_fbdev.c +1 -6
@@ -39,6 +39,7 @@ struct msm_fbdev {static struct fb_ops msm_fb_ops = { .owner =THIS_MODULE , +DRM_FB_HELPER_DEFAULT_OPS ,/* Note: to properly handle manual update displays, we wrap the * basic fbdev ops which write to the framebuffer
@@ -49,12 +50,6 @@ static struct fb_ops msm_fb_ops = { .fb_copyarea = drm_fb_helper_sys_copyarea, .fb_imageblit = drm_fb_helper_sys_imageblit, .fb_mmap = msm_fbdev_mmap, - - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, - .fb_pan_display = drm_fb_helper_pan_display, - .fb_blank = drm_fb_helper_blank, - .fb_setcmap = drm_fb_helper_setcmap, };static int msm_fbdev_mmap (struct fb_info *info,struct vm_area_struct *vma)
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 17/20 drm/virtio: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan ChristThis patch removes a TODO comment in the code. I do not know whether it is still relevant.
--- drivers/gpu/drm/virtio/virtgpu_fb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_fb.c +1 -5
@@ -200,14 +200,10 @@ static void virtio_gpu_3d_imageblit(struct fb_info *info,static struct fb_ops virtio_gpufb_ops = { .owner =THIS_MODULE , - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par,/* TODO: copy vmwgfx */ +DRM_FB_HELPER_DEFAULT_OPS , .fb_fillrect = virtio_gpu_3d_fillrect, .fb_copyarea = virtio_gpu_3d_copyarea, .fb_imageblit = virtio_gpu_3d_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, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 18/20 drm/omapdrm: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/omapdrm/omap_fbdev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/omapdrm/omap_fbdev.c +1 -4
@@ -82,6 +82,7 @@ fallback:static struct fb_ops omap_fb_ops = { .owner =THIS_MODULE , +DRM_FB_HELPER_DEFAULT_OPS ,/* Note: to properly handle manual update displays, we wrap the * basic fbdev ops which write to the framebuffer
@@ -92,11 +93,7 @@ static struct fb_ops omap_fb_ops = { .fb_copyarea = drm_fb_helper_sys_copyarea, .fb_imageblit = drm_fb_helper_sys_imageblit, - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, .fb_pan_display = omap_fbdev_pan_display, - .fb_blank = drm_fb_helper_blank, - .fb_setcmap = drm_fb_helper_setcmap, }; static int omap_fbdev_create(struct drm_fb_helper *helper,
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 19/20 drm/i915: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan Christ--- drivers/gpu/drm/i915/intel_fbdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_fbdev.c +1 -2
@@ -102,14 +102,13 @@ static int intel_fbdev_pan_display(struct fb_var_screeninfo *var,static struct fb_ops intelfb_ops = { .owner =THIS_MODULE , - .fb_check_var = drm_fb_helper_check_var, +DRM_FB_HELPER_DEFAULT_OPS , .fb_set_par = intel_fbdev_set_par, .fb_fillrect = drm_fb_helper_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea, .fb_imageblit = drm_fb_helper_cfb_imageblit, .fb_pan_display = intel_fbdev_pan_display, .fb_blank = intel_fbdev_blank, - .fb_setcmap = drm_fb_helper_setcmap, .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave, };
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 20/20 drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
In reply to Stefan ChristThis refactoring leads to real functional changes in the driver.
Now the struct psbfb_ops implements two additional members:
.fb_setcmap = drm_fb_helper_setcmap,
.fb_pan_display = drm_fb_helper_pan_display,
and the struct psbfb_roll_ops implements one additional member:
.fb_setcmap = drm_fb_helper_setcmap,
and the struct psbfb_unaccel_ops implements two additional members:
.fb_setcmap = drm_fb_helper_setcmap,
.fb_pan_display = drm_fb_helper_pan_display,
These changes are not tested.
--- drivers/gpu/drm/gma500/framebuffer.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +3 -9
@@ -186,9 +186,7 @@ static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma)static struct fb_ops psbfb_ops = { .owner =THIS_MODULE , - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, - .fb_blank = drm_fb_helper_blank, +DRM_FB_HELPER_DEFAULT_OPS , .fb_setcolreg = psbfb_setcolreg, .fb_fillrect = drm_fb_helper_cfb_fillrect, .fb_copyarea = psbfb_copyarea,
@@ -199,9 +197,7 @@ static struct fb_ops psbfb_ops = {static struct fb_ops psbfb_roll_ops = { .owner =THIS_MODULE , - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, - .fb_blank = drm_fb_helper_blank, +DRM_FB_HELPER_DEFAULT_OPS , .fb_setcolreg = psbfb_setcolreg, .fb_fillrect = drm_fb_helper_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea,
@@ -212,9 +208,7 @@ static struct fb_ops psbfb_roll_ops = {static struct fb_ops psbfb_unaccel_ops = { .owner =THIS_MODULE , - .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, - .fb_blank = drm_fb_helper_blank, +DRM_FB_HELPER_DEFAULT_OPS , .fb_setcolreg = psbfb_setcolreg, .fb_fillrect = drm_fb_helper_cfb_fillrect, .fb_copyarea = drm_fb_helper_cfb_copyarea,
Signature · 6 lines
2.7.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Stefan,
2016-09-29 Stefan Christ <[email protected]>:
Quoted 64 lines
Hi,
this series is refactoring work suggested by Daniel Vetter in the email:
https://lists.freedesktop.org/archives/dri-devel/2016-July/113237.htmlThe define
DRM_FB_HELPER_DEFAULT_OPSprovides thedrm_fb_helperdefault implementations for functions in structfb_ops. A drm driver can use it like:static struct fb_ops drm_fbdev_cma_ops = { .owner = THIS_MODULE, DRM_FB_HELPER_DEFAULT_OPS, /* driver specific implementations */ };The patches do not make any functional change to the kernel binary except driver 'drm/gma500'. The patch for gma500 enables two new functions (
fb_setcmapandfb_pan_display) infb_ops. If this is not appropriate, the driver may reassign the struct members to null.There is no refactoring patch for driver 'vmwgfx'. It reimplements nearly all
fb_opswith driver specific functions anyways.This series is based on tag v4.8-rc8. If rebased onto 'drm-next' there are two small conflicts.
Kind regards,
Stefan ChristStefan Christ (20):
drm/fb-helper: addDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/amdgpu: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/armada: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/ast: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/bochs: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/cirrus: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/fb_cma_helper: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/exynos: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/mgag200: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/nouveau: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/qxl: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/rockchip: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/radeon: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/tegra: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/udl: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/msm: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/virtio: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/omapdrm: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/i915: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrm/gma500: useDRM_FB_HELPER_DEFAULT_OPSforfb_opsdrivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 6 +----- drivers/gpu/drm/armada/armada_fbdev.c | 6 +----- drivers/gpu/drm/ast/ast_fb.c | 6 +----- drivers/gpu/drm/bochs/bochs_fbdev.c | 6 +----- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 6 +----- drivers/gpu/drm/drm_fb_cma_helper.c | 6 +----- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 6 +----- drivers/gpu/drm/gma500/framebuffer.c | 12 +++--------- drivers/gpu/drm/i915/intel_fbdev.c | 3 +-- drivers/gpu/drm/mgag200/mgag200_fb.c | 6 +----- drivers/gpu/drm/msm/msm_fbdev.c | 7 +------ drivers/gpu/drm/nouveau/nouveau_fbcon.c | 12 ++---------- drivers/gpu/drm/omapdrm/omap_fbdev.c | 5 +----
Quoted 8 lines
drivers/gpu/drm/qxl/qxl_fb.c | 6 +----- drivers/gpu/drm/radeon/radeon_fb.c | 6 +----- drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 6 +----- drivers/gpu/drm/tegra/fb.c | 6 +----- drivers/gpu/drm/udl/udl_fb.c | 6 +----- drivers/gpu/drm/virtio/virtgpu_fb.c | 6 +----- include/drm/drm_fb_helper.h | 13 +++++++++++++ 20 files changed, 35 insertions(+), 101 deletions(-)
This looks good to me.
I wonder if we shouldn't start doing the same to drm_crtc_funcs and drm_plane_funcs after we added the atomic helpers.
Gustavo
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel