video, drm: constify fbops in struct fb_info
Subsystems (53)
cover video, drm: constify fbops in struct fb_info
So I wanted to quickly move our struct fb_ops to const data because we don't modify it... and this series is where the rabbit hole ends. Ugh.
The main pain point is deferred IO, which is covered in patch
1. Everything gets easier after that. The last 5 could be merged at leisure.
BR,
Jani.
Jani Nikula (13):
video: fb_defio: preserve user fb_ops
drm/fb-helper: don't preserve fb_ops across deferred IO use
video: smscufx: don't restore fb_mmap after deferred IO cleanup
video: udlfb: don't restore fb_mmap after deferred IO cleanup
video: fbdev: vesafb: modify the static fb_ops directly
video: fbmem: use const pointer for fb_ops
video: omapfb: use const pointer for fb_ops
video: fbdev: make fbops member of struct fb_info a const pointer
drm: constify fb ops across all drivers
video: constify fb ops across all drivers
HID: picoLCD: constify fb ops
media: constify fb ops across all drivers
samples: vfio-mdev: constify fb ops
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +- drivers/gpu/drm/armada/armada_fbdev.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 20 +++------------ drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +- .../gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 2 +- drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +- drivers/gpu/drm/msm/msm_fbdev.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 4 +-- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/radeon/radeon_fb.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 2 +- drivers/gpu/drm/tegra/fb.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 2 +- drivers/hid/hid-picolcd_fb.c | 3 +-- drivers/media/pci/ivtv/ivtvfb.c | 3 +-- drivers/media/platform/vivid/vivid-osd.c | 1 - drivers/video/fbdev/68328fb.c | 2 +- drivers/video/fbdev/acornfb.c | 2 +- drivers/video/fbdev/amba-clcd.c | 2 +- drivers/video/fbdev/amifb.c | 2 +- drivers/video/fbdev/arcfb.c | 2 +- drivers/video/fbdev/arkfb.c | 2 +- drivers/video/fbdev/asiliantfb.c | 2 +- drivers/video/fbdev/atmel_lcdfb.c | 2 +- drivers/video/fbdev/aty/aty128fb.c | 2 +- drivers/video/fbdev/aty/atyfb_base.c | 2 +- drivers/video/fbdev/aty/radeon_base.c | 2 +- drivers/video/fbdev/au1100fb.c | 2 +- drivers/video/fbdev/au1200fb.c | 2 +- drivers/video/fbdev/broadsheetfb.c | 2 +- drivers/video/fbdev/bw2.c | 2 +- drivers/video/fbdev/carminefb.c | 2 +- drivers/video/fbdev/cg14.c | 2 +- drivers/video/fbdev/cg3.c | 2 +- drivers/video/fbdev/cg6.c | 2 +- drivers/video/fbdev/chipsfb.c | 2 +- drivers/video/fbdev/cirrusfb.c | 2 +- drivers/video/fbdev/clps711x-fb.c | 2 +- drivers/video/fbdev/cobalt_lcdfb.c | 2 +- drivers/video/fbdev/controlfb.c | 2 +- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++--- drivers/video/fbdev/core/fbmem.c | 6 ++--- drivers/video/fbdev/cyber2000fb.c | 2 +- drivers/video/fbdev/da8xx-fb.c | 2 +- drivers/video/fbdev/dnfb.c | 2 +- drivers/video/fbdev/efifb.c | 2 +- drivers/video/fbdev/ep93xx-fb.c | 2 +- drivers/video/fbdev/fb-puv3.c | 2 +- drivers/video/fbdev/ffb.c | 2 +- drivers/video/fbdev/fm2fb.c | 2 +- drivers/video/fbdev/fsl-diu-fb.c | 2 +- drivers/video/fbdev/g364fb.c | 2 +- drivers/video/fbdev/gbefb.c | 2 +- drivers/video/fbdev/geode/gx1fb_core.c | 2 +- drivers/video/fbdev/geode/gxfb_core.c | 2 +- drivers/video/fbdev/geode/lxfb_core.c | 2 +- drivers/video/fbdev/goldfishfb.c | 2 +- drivers/video/fbdev/grvga.c | 2 +- drivers/video/fbdev/gxt4500.c | 2 +- drivers/video/fbdev/hecubafb.c | 2 +- drivers/video/fbdev/hgafb.c | 2 +- drivers/video/fbdev/hitfb.c | 2 +- drivers/video/fbdev/hpfb.c | 2 +- drivers/video/fbdev/hyperv_fb.c | 2 +- drivers/video/fbdev/i740fb.c | 2 +- drivers/video/fbdev/imsttfb.c | 2 +- drivers/video/fbdev/imxfb.c | 2 +- drivers/video/fbdev/intelfb/intelfbdrv.c | 2 +- drivers/video/fbdev/kyro/fbdev.c | 2 +- drivers/video/fbdev/leo.c | 2 +- drivers/video/fbdev/macfb.c | 2 +- drivers/video/fbdev/matrox/matroxfb_crtc2.c | 2 +- drivers/video/fbdev/maxinefb.c | 2 +- drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 2 +- drivers/video/fbdev/mbx/mbxfb.c | 2 +- drivers/video/fbdev/metronomefb.c | 2 +- drivers/video/fbdev/mmp/fb/mmpfb.c | 2 +- drivers/video/fbdev/mx3fb.c | 5 ++-- drivers/video/fbdev/neofb.c | 2 +- drivers/video/fbdev/nvidia/nvidia.c | 2 +- drivers/video/fbdev/ocfb.c | 2 +- drivers/video/fbdev/offb.c | 2 +- drivers/video/fbdev/omap/omapfb_main.c | 2 +- .../video/fbdev/omap2/omapfb/omapfb-main.c | 2 +- drivers/video/fbdev/p9100.c | 2 +- drivers/video/fbdev/platinumfb.c | 2 +- drivers/video/fbdev/pm2fb.c | 2 +- drivers/video/fbdev/pm3fb.c | 2 +- drivers/video/fbdev/pmag-aa-fb.c | 2 +- drivers/video/fbdev/pmag-ba-fb.c | 2 +- drivers/video/fbdev/pmagb-b-fb.c | 2 +- drivers/video/fbdev/ps3fb.c | 2 +- drivers/video/fbdev/pvr2fb.c | 2 +- drivers/video/fbdev/pxa168fb.c | 2 +- drivers/video/fbdev/pxafb.c | 4 +-- drivers/video/fbdev/q40fb.c | 2 +- drivers/video/fbdev/riva/fbdev.c | 2 +- drivers/video/fbdev/s3c-fb.c | 2 +- drivers/video/fbdev/s3c2410fb.c | 2 +- drivers/video/fbdev/s3fb.c | 2 +- drivers/video/fbdev/sa1100fb.c | 2 +- drivers/video/fbdev/savage/savagefb_driver.c | 2 +- drivers/video/fbdev/sh7760fb.c | 2 +- drivers/video/fbdev/sh_mobile_lcdcfb.c | 4 +-- drivers/video/fbdev/simplefb.c | 2 +- drivers/video/fbdev/sis/sis_main.c | 2 +- drivers/video/fbdev/skeletonfb.c | 2 +- drivers/video/fbdev/sm712fb.c | 2 +- drivers/video/fbdev/smscufx.c | 1 - drivers/video/fbdev/ssd1307fb.c | 2 +- drivers/video/fbdev/sstfb.c | 2 +- drivers/video/fbdev/stifb.c | 2 +- drivers/video/fbdev/sunxvr1000.c | 2 +- drivers/video/fbdev/sunxvr2500.c | 2 +- drivers/video/fbdev/sunxvr500.c | 2 +- drivers/video/fbdev/tcx.c | 2 +- drivers/video/fbdev/tdfxfb.c | 2 +- drivers/video/fbdev/tgafb.c | 2 +- drivers/video/fbdev/tmiofb.c | 2 +- drivers/video/fbdev/tridentfb.c | 2 +- drivers/video/fbdev/udlfb.c | 1 - drivers/video/fbdev/uvesafb.c | 2 +- drivers/video/fbdev/valkyriefb.c | 2 +- drivers/video/fbdev/vesafb.c | 6 ++--- drivers/video/fbdev/vfb.c | 2 +- drivers/video/fbdev/vga16fb.c | 2 +- drivers/video/fbdev/vt8500lcdfb.c | 2 +- drivers/video/fbdev/vt8623fb.c | 2 +- drivers/video/fbdev/w100fb.c | 2 +- drivers/video/fbdev/wm8505fb.c | 2 +- drivers/video/fbdev/xen-fbfront.c | 2 +- drivers/video/fbdev/xilinxfb.c | 2 +- include/linux/fb.h | 5 ++-- samples/vfio-mdev/mdpy-fb.c | 2 +- 134 files changed, 165 insertions(+), 163 deletions(-)
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/13 video: fb_defio: preserve user fb_ops
Modifying fb_ops directly to override fb_mmap with fb_deferred_io_mmap and then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of struct fb_info a const pointer, which means we can't make struct fb_ops const anywhere. Second, a few places have to go out of their way to restore the original fb_mmap pointer that gets reset to NULL.
Preserve the passed in fb_ops by making a copy of it and modifying that instead. Add a deferred_io_private member to struct fb_info to store the pointer to the old fb_ops, and restore that at cleanup.
---
Note: If the approach is acceptable, we'll also need to handle the error returns on memory allocation failures at fb_deferred_io_init() call sites. There are 13.
--- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++++++++--- include/linux/fb.h | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-)
drivers/video/fbdev/core/fb_defio.c +22 -3
@@ -200,13 +200,23 @@ static void fb_deferred_io_work(struct work_struct *work)mutex_unlock (&fbdefio->lock); } -void fb_deferred_io_init (struct fb_info *info) +int fb_deferred_io_init (struct fb_info *info) {struct fb_deferred_io *fbdefio = info->fbdefio; +struct fb_ops *fbops;BUG_ON (!fbdefio); + + fbops =kmemdup (info->fbops,sizeof (*fbops),GFP_KERNEL ); +if (!fbops) +return -ENOMEM ; + + fbops->fb_mmap = fb_deferred_io_mmap; + info->deferred_io_private = info->fbops; + info->fbops = fbops; +mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; +INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */
@@ -229,6 +239,12 @@ void fb_deferred_io_cleanup(struct fb_info *info)int i;BUG_ON (!fbdefio); + +/* sanity check against misuse */ +if (WARN_ON (!info->deferred_io_private || + info->fbops->fb_mmap != fb_deferred_io_mmap)) +return ; +cancel_delayed_work_sync (&info->deferred_work);/* clear out the mapping that we setup */
@@ -237,7 +253,10 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping =NULL ; } - info->fbops->fb_mmap =NULL ; +kfree (info->fbops); + info->fbops = info->deferred_io_private; + info->deferred_io_private =NULL ; +mutex_destroy (&fbdefio->lock); }EXPORT_SYMBOL_GPL (fb_deferred_io_cleanup);
include/linux/fb.h +2 -1
@@ -470,6 +470,7 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; +void *deferred_io_private;#endif struct fb_ops *fbops;
@@ -658,7 +659,7 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,/* drivers/video/fb_defio.c */ int fb_deferred_io_mmap (struct fb_info *info,struct vm_area_struct *vma); -extern void fb_deferred_io_init (struct fb_info *info); +extern int fb_deferred_io_init (struct fb_info *info);extern void fb_deferred_io_open (struct fb_info *info,struct inode *inode,struct file *file);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/13] video: fb_defio: preserve user fb_ops
Quoted 10 lines · Jani Nikula
Modifying
fb_opsdirectly to overridefb_mmapwithfb_deferred_io_mmapand then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of structfb_infoa const pointer, which means we can't make structfb_opsconst anywhere. Second, a few places have to go out of their way to restore the originalfb_mmappointer that gets reset to NULL.Preserve the passed in
fb_opsby making a copy of it and modifying that instead. Add adeferred_io_privatemember to structfb_infoto store the pointer to the oldfb_ops, and restore that at cleanup.
Quite the horror show. I wonder how hard it would be to just have each driver that can use defio provide a mmap hook that either dispatches to the defio one or the native one depending if defio is used or not...
A few drivers at least seem to always use defio so those should be trivial. Some others seem to make the decision dynamically, which would require custom .mmap(). Though I suppose all of them could just be of the form
foo_mmap_wrap{)
{
if (info->defio)
defio_mmap()
else
foo_mmap();
}Hmm. Actually is .fb_mmap() called from anywhere but fb_mmap()? If not we could just shove the defio check there? Or if it's called from several places we could try to wrap all calls in _fb_mmap() or somesuch.
Quoted 93 lines
---
Note: If the approach is acceptable, we'll also need to handle the error returns on memory allocation failures at
fb_deferred_io_init()call sites. There are 13.--- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++++++++--- include/linux/fb.h | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-)drivers/video/fbdev/core/fb_defio.c +22
-3@@ -200,13 +200,23 @@ static void fb_deferred_io_work(struct work_struct *work)mutex_unlock (&fbdefio->lock); } -void fb_deferred_io_init (struct fb_info *info) +int fb_deferred_io_init (struct fb_info *info) {struct fb_deferred_io *fbdefio = info->fbdefio; +struct fb_ops *fbops;BUG_ON (!fbdefio); + + fbops =kmemdup (info->fbops,sizeof (*fbops),GFP_KERNEL ); +if (!fbops) +return -ENOMEM ; + + fbops->fb_mmap = fb_deferred_io_mmap; + info->deferred_io_private = info->fbops; + info->fbops = fbops; +mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; +INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ @@ -229,6 +239,12 @@ void fb_deferred_io_cleanup(struct fb_info *info)int i;BUG_ON (!fbdefio); + +/* sanity check against misuse */ +if (WARN_ON (!info->deferred_io_private || + info->fbops->fb_mmap != fb_deferred_io_mmap)) +return ; +cancel_delayed_work_sync (&info->deferred_work);/* clear out the mapping that we setup */ @@ -237,7 +253,10 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping =NULL ; } - info->fbops->fb_mmap =NULL ; +kfree (info->fbops); + info->fbops = info->deferred_io_private; + info->deferred_io_private =NULL ; +mutex_destroy (&fbdefio->lock); }EXPORT_SYMBOL_GPL (fb_deferred_io_cleanup);include/linux/fb.h +2
-1@@ -470,6 +470,7 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; +void *deferred_io_private;#endif struct fb_ops *fbops;@@ -658,7 +659,7 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,/* drivers/video/fb_defio.c */ int fb_deferred_io_mmap (struct fb_info *info,struct vm_area_struct *vma); -extern void fb_deferred_io_init (struct fb_info *info); +extern int fb_deferred_io_init (struct fb_info *info);extern void fb_deferred_io_open (struct fb_info *info,struct inode *inode,struct file *file);Signature · 1 line
2.20.1
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/13] video: fb_defio: preserve user fb_ops
Quoted 28 lines · Ville Syrjälä
Quoted 10 lines · Jani Nikula
Modifying
fb_opsdirectly to overridefb_mmapwithfb_deferred_io_mmapand then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of structfb_infoa const pointer, which means we can't make structfb_opsconst anywhere. Second, a few places have to go out of their way to restore the originalfb_mmappointer that gets reset to NULL.Preserve the passed in
fb_opsby making a copy of it and modifying that instead. Add adeferred_io_privatemember to structfb_infoto store the pointer to the oldfb_ops, and restore that at cleanup.Quite the horror show. I wonder how hard it would be to just have each driver that can use defio provide a mmap hook that either dispatches to the defio one or the native one depending if defio is used or not...
A few drivers at least seem to always use defio so those should be trivial. Some others seem to make the decision dynamically, which would require custom .mmap(). Though I suppose all of them could just be of the form
foo_mmap_wrap{){ if (info->defio) defio_mmap() else foo_mmap(); }
Quoted 3 lines
Hmm. Actually is .fb_mmap() called from anywhere but
fb_mmap()? If not we could just shove the defio check there? Or if it's called from several places we could try to wrap all calls in_fb_mmap()or somesuch.
While we're spinning this garn about fb_mmap improvements: My cunning plan, documented in todo.rst even, is to have our own fb_mmap implementation for the drm fbdev helper, which will handle all this internally.
And then just quietly burn down the fbdev defio stuff to the ground, because it's the stuff for nightmares.
https://dri.freedesktop.org/docs/drm/gpu/todo.html#generic-fbdev-defio-support
tldr; Imo no point investing too much in polishing the defio stuff. -Daniel
Quoted 102 lines
Quoted 94 lines
---
Note: If the approach is acceptable, we'll also need to handle the error returns on memory allocation failures at
fb_deferred_io_init()call sites. There are 13.--- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++++++++--- include/linux/fb.h | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-)drivers/video/fbdev/core/fb_defio.c +22
-3@@ -200,13 +200,23 @@ static void fb_deferred_io_work(struct work_struct *work)mutex_unlock (&fbdefio->lock); } -void fb_deferred_io_init (struct fb_info *info) +int fb_deferred_io_init (struct fb_info *info) {struct fb_deferred_io *fbdefio = info->fbdefio; +struct fb_ops *fbops;BUG_ON (!fbdefio); + + fbops =kmemdup (info->fbops,sizeof (*fbops),GFP_KERNEL ); +if (!fbops) +return -ENOMEM ; + + fbops->fb_mmap = fb_deferred_io_mmap; + info->deferred_io_private = info->fbops; + info->fbops = fbops; +mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; +INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ @@ -229,6 +239,12 @@ void fb_deferred_io_cleanup(struct fb_info *info)int i;BUG_ON (!fbdefio); + +/* sanity check against misuse */ +if (WARN_ON (!info->deferred_io_private || + info->fbops->fb_mmap != fb_deferred_io_mmap)) +return ; +cancel_delayed_work_sync (&info->deferred_work);/* clear out the mapping that we setup */ @@ -237,7 +253,10 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping =NULL ; } - info->fbops->fb_mmap =NULL ; +kfree (info->fbops); + info->fbops = info->deferred_io_private; + info->deferred_io_private =NULL ; +mutex_destroy (&fbdefio->lock); }EXPORT_SYMBOL_GPL (fb_deferred_io_cleanup);include/linux/fb.h +2
-1@@ -470,6 +470,7 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; +void *deferred_io_private;#endif struct fb_ops *fbops;@@ -658,7 +659,7 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,/* drivers/video/fb_defio.c */ int fb_deferred_io_mmap (struct fb_info *info,struct vm_area_struct *vma); -extern void fb_deferred_io_init (struct fb_info *info); +extern int fb_deferred_io_init (struct fb_info *info);extern void fb_deferred_io_open (struct fb_info *info,struct inode *inode,struct file *file);Signature · 1 line
2.20.1Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 01/13] video: fb_defio: preserve user fb_ops
In reply to Jani NikulaQuoted 15 lines · Jani Nikula
Modifying
fb_opsdirectly to overridefb_mmapwithfb_deferred_io_mmapand then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of structfb_infoa const pointer, which means we can't make structfb_opsconst anywhere. Second, a few places have to go out of their way to restore the originalfb_mmappointer that gets reset to NULL.Preserve the passed in
fb_opsby making a copy of it and modifying that instead. Add adeferred_io_privatemember to structfb_infoto store the pointer to the oldfb_ops, and restore that at cleanup.
Quoted 5 lines
---
Note: If the approach is acceptable, we'll also need to handle the error returns on memory allocation failures at
fb_deferred_io_init()call sites. There are 13.
it's fbdev defio, I think we can do worse with less effort. Just embed a copy of fb_ops into fb_info, and use that, and tada! no memory allocation needed :-)
I'd totally r-b that patch.
Or do what Ville suggested, add an fb_info->fbdefio.enabled, set that in the _init function and in fb_mmap call fb_deferred_io_mmap for that case instead of the driver's fb_ops->fb_mmap. There's only one caller of that in the entire tree, in fbmem.c. Also, we could/should nuke the EXPORT_SYMBOL(fb_deferred_io_mmap) I think.
That version would also get my r-b stamp. So up to you what you prefer. -Daniel
Quoted 88 lines
--- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++++++++--- include/linux/fb.h | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-)drivers/video/fbdev/core/fb_defio.c +22
-3@@ -200,13 +200,23 @@ static void fb_deferred_io_work(struct work_struct *work)mutex_unlock (&fbdefio->lock); } -void fb_deferred_io_init (struct fb_info *info) +int fb_deferred_io_init (struct fb_info *info) {struct fb_deferred_io *fbdefio = info->fbdefio; +struct fb_ops *fbops;BUG_ON (!fbdefio); + + fbops =kmemdup (info->fbops,sizeof (*fbops),GFP_KERNEL ); +if (!fbops) +return -ENOMEM ; + + fbops->fb_mmap = fb_deferred_io_mmap; + info->deferred_io_private = info->fbops; + info->fbops = fbops; +mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; +INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ @@ -229,6 +239,12 @@ void fb_deferred_io_cleanup(struct fb_info *info)int i;BUG_ON (!fbdefio); + +/* sanity check against misuse */ +if (WARN_ON (!info->deferred_io_private || + info->fbops->fb_mmap != fb_deferred_io_mmap)) +return ; +cancel_delayed_work_sync (&info->deferred_work);/* clear out the mapping that we setup */ @@ -237,7 +253,10 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping =NULL ; } - info->fbops->fb_mmap =NULL ; +kfree (info->fbops); + info->fbops = info->deferred_io_private; + info->deferred_io_private =NULL ; +mutex_destroy (&fbdefio->lock); }EXPORT_SYMBOL_GPL (fb_deferred_io_cleanup);include/linux/fb.h +2
-1@@ -470,6 +470,7 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; +void *deferred_io_private;#endif struct fb_ops *fbops;@@ -658,7 +659,7 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,/* drivers/video/fb_defio.c */ int fb_deferred_io_mmap (struct fb_info *info,struct vm_area_struct *vma); -extern void fb_deferred_io_init (struct fb_info *info); +extern int fb_deferred_io_init (struct fb_info *info);extern void fb_deferred_io_open (struct fb_info *info,struct inode *inode,struct file *file);Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
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 01/13] video: fb_defio: preserve user fb_ops
Quoted 26 lines · Daniel Vetter
Quoted 15 lines · Jani Nikula
Modifying
fb_opsdirectly to overridefb_mmapwithfb_deferred_io_mmapand then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of structfb_infoa const pointer, which means we can't make structfb_opsconst anywhere. Second, a few places have to go out of their way to restore the originalfb_mmappointer that gets reset to NULL.Preserve the passed in
fb_opsby making a copy of it and modifying that instead. Add adeferred_io_privatemember to structfb_infoto store the pointer to the oldfb_ops, and restore that at cleanup.Quoted 5 lines
---
Note: If the approach is acceptable, we'll also need to handle the error returns on memory allocation failures at
fb_deferred_io_init()call sites. There are 13.it's fbdev defio, I think we can do worse with less effort. Just embed a copy of
fb_opsintofb_info, and use that, and tada! no memory allocation needed :-)
Quoted 7 lines
I'd totally r-b that patch.
Or do what Ville suggested, add an
fb_info->fbdefio.enabled, set that in the_initfunction and infb_mmapcallfb_deferred_io_mmapfor that case instead of the driver'sfb_ops->fb_mmap. There's only one caller of that in the entire tree, infbmem.c. Also, we could/should nuke theEXPORT_SYMBOL(fb_deferred_io_mmap)I think.
I just realized that fb_info->fbdefio is a pointer, so this would be really simple to pull off I think.
-Daniel
Quoted 97 lines
That version would also get my r-b stamp. So up to you what you prefer. -Daniel
Quoted 88 lines
--- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++++++++--- include/linux/fb.h | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-)drivers/video/fbdev/core/fb_defio.c +22
-3@@ -200,13 +200,23 @@ static void fb_deferred_io_work(struct work_struct *work)mutex_unlock (&fbdefio->lock); } -void fb_deferred_io_init (struct fb_info *info) +int fb_deferred_io_init (struct fb_info *info) {struct fb_deferred_io *fbdefio = info->fbdefio; +struct fb_ops *fbops;BUG_ON (!fbdefio); + + fbops =kmemdup (info->fbops,sizeof (*fbops),GFP_KERNEL ); +if (!fbops) +return -ENOMEM ; + + fbops->fb_mmap = fb_deferred_io_mmap; + info->deferred_io_private = info->fbops; + info->fbops = fbops; +mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; +INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ @@ -229,6 +239,12 @@ void fb_deferred_io_cleanup(struct fb_info *info)int i;BUG_ON (!fbdefio); + +/* sanity check against misuse */ +if (WARN_ON (!info->deferred_io_private || + info->fbops->fb_mmap != fb_deferred_io_mmap)) +return ; +cancel_delayed_work_sync (&info->deferred_work);/* clear out the mapping that we setup */ @@ -237,7 +253,10 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping =NULL ; } - info->fbops->fb_mmap =NULL ; +kfree (info->fbops); + info->fbops = info->deferred_io_private; + info->deferred_io_private =NULL ; +mutex_destroy (&fbdefio->lock); }EXPORT_SYMBOL_GPL (fb_deferred_io_cleanup);include/linux/fb.h +2
-1@@ -470,6 +470,7 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; +void *deferred_io_private;#endif struct fb_ops *fbops;@@ -658,7 +659,7 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,/* drivers/video/fb_defio.c */ int fb_deferred_io_mmap (struct fb_info *info,struct vm_area_struct *vma); -extern void fb_deferred_io_init (struct fb_info *info); +extern int fb_deferred_io_init (struct fb_info *info);extern void fb_deferred_io_open (struct fb_info *info,struct inode *inode,struct file *file);Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/13] video: fb_defio: preserve user fb_ops
Quoted 29 lines · Daniel Vetter
Quoted 28 lines · Daniel Vetter
Quoted 15 lines · Jani Nikula
Modifying
fb_opsdirectly to overridefb_mmapwithfb_deferred_io_mmapand then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of structfb_infoa const pointer, which means we can't make structfb_opsconst anywhere. Second, a few places have to go out of their way to restore the originalfb_mmappointer that gets reset to NULL.Preserve the passed in
fb_opsby making a copy of it and modifying that instead. Add adeferred_io_privatemember to structfb_infoto store the pointer to the oldfb_ops, and restore that at cleanup.Quoted 5 lines
---
Note: If the approach is acceptable, we'll also need to handle the error returns on memory allocation failures at
fb_deferred_io_init()call sites. There are 13.it's fbdev defio, I think we can do worse with less effort. Just embed a copy of
fb_opsintofb_info, and use that, and tada! no memory allocation needed :-)I'd totally r-b that patch.
Quoted 8 lines
Quoted 5 lines
Or do what Ville suggested, add an
fb_info->fbdefio.enabled, set that in the_initfunction and infb_mmapcallfb_deferred_io_mmapfor that case instead of the driver'sfb_ops->fb_mmap. There's only one caller of that in the entire tree, infbmem.c. Also, we could/should nuke theEXPORT_SYMBOL(fb_deferred_io_mmap)I think.I just realized that
fb_info->fbdefiois a pointer, so this would be really simple to pull off I think.
Heh, having a
int (*fb_deferred_io_mmap)(struct fb_info *, struct vm_area_struct *);
member in struct fb_info, and using that in fbmem.c if non-NULL, was actually my first idea. I didn't think it was particularly pretty, but if we don't care about aesthetics...
Would you like that instead of the patch at hand?
BR,
Jani.
Quoted 99 lines
-Daniel
Quoted 97 lines
That version would also get my r-b stamp. So up to you what you prefer. -Daniel
Quoted 88 lines
--- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++++++++--- include/linux/fb.h | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-)drivers/video/fbdev/core/fb_defio.c +22
-3@@ -200,13 +200,23 @@ static void fb_deferred_io_work(struct work_struct *work)mutex_unlock (&fbdefio->lock); } -void fb_deferred_io_init (struct fb_info *info) +int fb_deferred_io_init (struct fb_info *info) {struct fb_deferred_io *fbdefio = info->fbdefio; +struct fb_ops *fbops;BUG_ON (!fbdefio); + + fbops =kmemdup (info->fbops,sizeof (*fbops),GFP_KERNEL ); +if (!fbops) +return -ENOMEM ; + + fbops->fb_mmap = fb_deferred_io_mmap; + info->deferred_io_private = info->fbops; + info->fbops = fbops; +mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; +INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ @@ -229,6 +239,12 @@ void fb_deferred_io_cleanup(struct fb_info *info)int i;BUG_ON (!fbdefio); + +/* sanity check against misuse */ +if (WARN_ON (!info->deferred_io_private || + info->fbops->fb_mmap != fb_deferred_io_mmap)) +return ; +cancel_delayed_work_sync (&info->deferred_work);/* clear out the mapping that we setup */ @@ -237,7 +253,10 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping =NULL ; } - info->fbops->fb_mmap =NULL ; +kfree (info->fbops); + info->fbops = info->deferred_io_private; + info->deferred_io_private =NULL ; +mutex_destroy (&fbdefio->lock); }EXPORT_SYMBOL_GPL (fb_deferred_io_cleanup);include/linux/fb.h +2
-1@@ -470,6 +470,7 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; +void *deferred_io_private;#endif struct fb_ops *fbops;@@ -658,7 +659,7 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,/* drivers/video/fb_defio.c */ int fb_deferred_io_mmap (struct fb_info *info,struct vm_area_struct *vma); -extern void fb_deferred_io_init (struct fb_info *info); +extern int fb_deferred_io_init (struct fb_info *info);extern void fb_deferred_io_open (struct fb_info *info,struct inode *inode,struct file *file);Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/13] video: fb_defio: preserve user fb_ops
Quoted 41 lines · Jani Nikula
Quoted 29 lines · Daniel Vetter
Quoted 28 lines · Daniel Vetter
Quoted 15 lines · Jani Nikula
Modifying
fb_opsdirectly to overridefb_mmapwithfb_deferred_io_mmapand then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of structfb_infoa const pointer, which means we can't make structfb_opsconst anywhere. Second, a few places have to go out of their way to restore the originalfb_mmappointer that gets reset to NULL.Preserve the passed in
fb_opsby making a copy of it and modifying that instead. Add adeferred_io_privatemember to structfb_infoto store the pointer to the oldfb_ops, and restore that at cleanup.Quoted 5 lines
---
Note: If the approach is acceptable, we'll also need to handle the error returns on memory allocation failures at
fb_deferred_io_init()call sites. There are 13.it's fbdev defio, I think we can do worse with less effort. Just embed a copy of
fb_opsintofb_info, and use that, and tada! no memory allocation needed :-)I'd totally r-b that patch.
Quoted 8 lines
Quoted 5 lines
Or do what Ville suggested, add an
fb_info->fbdefio.enabled, set that in the_initfunction and infb_mmapcallfb_deferred_io_mmapfor that case instead of the driver'sfb_ops->fb_mmap. There's only one caller of that in the entire tree, infbmem.c. Also, we could/should nuke theEXPORT_SYMBOL(fb_deferred_io_mmap)I think.I just realized that
fb_info->fbdefiois a pointer, so this would be really simple to pull off I think.Heh, having a
Quoted 7 lines
int (*fb_deferred_io_mmap)(struct fb_info *, struct vm_area_struct *);member in struct
fb_info, and using that infbmem.cif non-NULL, was actually my first idea. I didn't think it was particularly pretty, but if we don't care about aesthetics...Would you like that instead of the patch at hand?
drivers/video/fbdev/core/fb_defio.c +0 -2
@@ -206,13 +206,11 @@ void fb_deferred_io_init(struct fb_info *info)BUG_ON (!fbdefio);mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap;INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ fbdefio->delay =HZ ; } -EXPORT_SYMBOL_GPL (fb_deferred_io_init); void fb_deferred_io_open(struct fb_info *info, struct inode *inode,
drivers/video/fbdev/core/fbmem.c +10 -1
@@ -1341,7 +1341,16 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)return -ENODEV ; fb = info->fbops;mutex_lock (&info->mm_lock); -if (fb->fb_mmap) { +if (fb->fbdefio) { +/* +* The framebuffer needs to be accessed decrypted, be sure +* SME protection is removed ahead of the call +*/ + vma->vm_page_prot =pgprot_decrypted (vma->vm_page_prot); + res =fb_deferred_io_mmap (info, vma); +mutex_unlock (&info->mm_lock); +return res; + }else if (fb->fb_mmap) {int res;/*
Is what I was thinking off as the pretty solution. Add an explicit fb_info->fbdefio_enabled boolean if you don't feel like auditing all the drivers for whether they really call defio_init() every time they assign something to that pointer. A quick scan brought some nasties to light in that area.
I think a function pointer here is pointless because we clearly don't need it, and with all the panic around function pointers a direct call feels much better :-)
-Daniel
Quoted 107 lines
BR,
Jani.Quoted 99 lines
-Daniel
Quoted 97 lines
That version would also get my r-b stamp. So up to you what you prefer. -Daniel
Quoted 88 lines
--- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++++++++--- include/linux/fb.h | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-)drivers/video/fbdev/core/fb_defio.c +22
-3@@ -200,13 +200,23 @@ static void fb_deferred_io_work(struct work_struct *work)mutex_unlock (&fbdefio->lock); } -void fb_deferred_io_init (struct fb_info *info) +int fb_deferred_io_init (struct fb_info *info) {struct fb_deferred_io *fbdefio = info->fbdefio; +struct fb_ops *fbops;BUG_ON (!fbdefio); + + fbops =kmemdup (info->fbops,sizeof (*fbops),GFP_KERNEL ); +if (!fbops) +return -ENOMEM ; + + fbops->fb_mmap = fb_deferred_io_mmap; + info->deferred_io_private = info->fbops; + info->fbops = fbops; +mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; +INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ @@ -229,6 +239,12 @@ void fb_deferred_io_cleanup(struct fb_info *info)int i;BUG_ON (!fbdefio); + +/* sanity check against misuse */ +if (WARN_ON (!info->deferred_io_private || + info->fbops->fb_mmap != fb_deferred_io_mmap)) +return ; +cancel_delayed_work_sync (&info->deferred_work);/* clear out the mapping that we setup */ @@ -237,7 +253,10 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping =NULL ; } - info->fbops->fb_mmap =NULL ; +kfree (info->fbops); + info->fbops = info->deferred_io_private; + info->deferred_io_private =NULL ; +mutex_destroy (&fbdefio->lock); }EXPORT_SYMBOL_GPL (fb_deferred_io_cleanup);include/linux/fb.h +2
-1@@ -470,6 +470,7 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; +void *deferred_io_private;#endif struct fb_ops *fbops;@@ -658,7 +659,7 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,/* drivers/video/fb_defio.c */ int fb_deferred_io_mmap (struct fb_info *info,struct vm_area_struct *vma); -extern void fb_deferred_io_init (struct fb_info *info); +extern int fb_deferred_io_init (struct fb_info *info);extern void fb_deferred_io_open (struct fb_info *info,struct inode *inode,struct file *file);Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 01/13] video: fb_defio: preserve user fb_ops
Quoted 92 lines · Daniel Vetter
Quoted 48 lines · Jani Nikula
Quoted 29 lines · Daniel Vetter
Quoted 28 lines · Daniel Vetter
Quoted 15 lines · Jani Nikula
Modifying
fb_opsdirectly to overridefb_mmapwithfb_deferred_io_mmapand then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of structfb_infoa const pointer, which means we can't make structfb_opsconst anywhere. Second, a few places have to go out of their way to restore the originalfb_mmappointer that gets reset to NULL.Preserve the passed in
fb_opsby making a copy of it and modifying that instead. Add adeferred_io_privatemember to structfb_infoto store the pointer to the oldfb_ops, and restore that at cleanup.Quoted 5 lines
---
Note: If the approach is acceptable, we'll also need to handle the error returns on memory allocation failures at
fb_deferred_io_init()call sites. There are 13.it's fbdev defio, I think we can do worse with less effort. Just embed a copy of
fb_opsintofb_info, and use that, and tada! no memory allocation needed :-)I'd totally r-b that patch.
Quoted 8 lines
Quoted 5 lines
Or do what Ville suggested, add an
fb_info->fbdefio.enabled, set that in the_initfunction and infb_mmapcallfb_deferred_io_mmapfor that case instead of the driver'sfb_ops->fb_mmap. There's only one caller of that in the entire tree, infbmem.c. Also, we could/should nuke theEXPORT_SYMBOL(fb_deferred_io_mmap)I think.I just realized that
fb_info->fbdefiois a pointer, so this would be really simple to pull off I think.Heh, having a
int (*fb_deferred_io_mmap)(struct fb_info *, struct vm_area_struct *);member in struct
fb_info, and using that infbmem.cif non-NULL, was actually my first idea. I didn't think it was particularly pretty, but if we don't care about aesthetics...Would you like that instead of the patch at hand?
drivers/video/fbdev/core/fb_defio.c +0
-2@@ -206,13 +206,11 @@ void fb_deferred_io_init(struct fb_info *info)BUG_ON (!fbdefio);mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap;INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ fbdefio->delay =HZ ; } -EXPORT_SYMBOL_GPL (fb_deferred_io_init); void fb_deferred_io_open(struct fb_info *info, struct inode *inode,drivers/video/fbdev/core/fbmem.c +10
-1@@ -1341,7 +1341,16 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)return -ENODEV ; fb = info->fbops;mutex_lock (&info->mm_lock); -if (fb->fb_mmap) { +if (fb->fbdefio) { +/* +* The framebuffer needs to be accessed decrypted, be sure +* SME protection is removed ahead of the call +*/ + vma->vm_page_prot =pgprot_decrypted (vma->vm_page_prot); + res =fb_deferred_io_mmap (info, vma); +mutex_unlock (&info->mm_lock); +return res; + }else if (fb->fb_mmap) {int res;/*
Quoted 5 lines
Is what I was thinking off as the pretty solution. Add an explicit
fb_info->fbdefio_enabledboolean if you don't feel like auditing all the drivers for whether they really calldefio_init()every time they assign something to that pointer. A quick scan brought some nasties to light in that area.
Correction, brain wasn't awake yet, I've done the audit and the above diff should work afaict.
-Daniel
Quoted 118 lines
I think a function pointer here is pointless because we clearly don't need it, and with all the panic around function pointers a direct call feels much better :-)
-DanielQuoted 107 lines
BR,
Jani.Quoted 99 lines
-Daniel
Quoted 97 lines
That version would also get my r-b stamp. So up to you what you prefer. -Daniel
Quoted 88 lines
--- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++++++++--- include/linux/fb.h | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-)drivers/video/fbdev/core/fb_defio.c +22
-3@@ -200,13 +200,23 @@ static void fb_deferred_io_work(struct work_struct *work)mutex_unlock (&fbdefio->lock); } -void fb_deferred_io_init (struct fb_info *info) +int fb_deferred_io_init (struct fb_info *info) {struct fb_deferred_io *fbdefio = info->fbdefio; +struct fb_ops *fbops;BUG_ON (!fbdefio); + + fbops =kmemdup (info->fbops,sizeof (*fbops),GFP_KERNEL ); +if (!fbops) +return -ENOMEM ; + + fbops->fb_mmap = fb_deferred_io_mmap; + info->deferred_io_private = info->fbops; + info->fbops = fbops; +mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; +INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ @@ -229,6 +239,12 @@ void fb_deferred_io_cleanup(struct fb_info *info)int i;BUG_ON (!fbdefio); + +/* sanity check against misuse */ +if (WARN_ON (!info->deferred_io_private || + info->fbops->fb_mmap != fb_deferred_io_mmap)) +return ; +cancel_delayed_work_sync (&info->deferred_work);/* clear out the mapping that we setup */ @@ -237,7 +253,10 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping =NULL ; } - info->fbops->fb_mmap =NULL ; +kfree (info->fbops); + info->fbops = info->deferred_io_private; + info->deferred_io_private =NULL ; +mutex_destroy (&fbdefio->lock); }EXPORT_SYMBOL_GPL (fb_deferred_io_cleanup);include/linux/fb.h +2
-1@@ -470,6 +470,7 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; +void *deferred_io_private;#endif struct fb_ops *fbops;@@ -658,7 +659,7 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,/* drivers/video/fb_defio.c */ int fb_deferred_io_mmap (struct fb_info *info,struct vm_area_struct *vma); -extern void fb_deferred_io_init (struct fb_info *info); +extern int fb_deferred_io_init (struct fb_info *info);extern void fb_deferred_io_open (struct fb_info *info,struct inode *inode,struct file *file);Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 1 line
Jani Nikula, Intel Open Source Graphics CenterSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
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: [Intel-gfx] [PATCH 01/13] video: fb_defio: preserve user fb_ops
Quoted 93 lines · Daniel Vetter
Quoted 92 lines · Daniel Vetter
Quoted 48 lines · Jani Nikula
Quoted 29 lines · Daniel Vetter
Quoted 28 lines · Daniel Vetter
Quoted 15 lines · Jani Nikula
Modifying
fb_opsdirectly to overridefb_mmapwithfb_deferred_io_mmapand then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of structfb_infoa const pointer, which means we can't make structfb_opsconst anywhere. Second, a few places have to go out of their way to restore the originalfb_mmappointer that gets reset to NULL.Preserve the passed in
fb_opsby making a copy of it and modifying that instead. Add adeferred_io_privatemember to structfb_infoto store the pointer to the oldfb_ops, and restore that at cleanup.Quoted 5 lines
---
Note: If the approach is acceptable, we'll also need to handle the error returns on memory allocation failures at
fb_deferred_io_init()call sites. There are 13.it's fbdev defio, I think we can do worse with less effort. Just embed a copy of
fb_opsintofb_info, and use that, and tada! no memory allocation needed :-)I'd totally r-b that patch.
Quoted 8 lines
Quoted 5 lines
Or do what Ville suggested, add an
fb_info->fbdefio.enabled, set that in the_initfunction and infb_mmapcallfb_deferred_io_mmapfor that case instead of the driver'sfb_ops->fb_mmap. There's only one caller of that in the entire tree, infbmem.c. Also, we could/should nuke theEXPORT_SYMBOL(fb_deferred_io_mmap)I think.I just realized that
fb_info->fbdefiois a pointer, so this would be really simple to pull off I think.Heh, having a
int (*fb_deferred_io_mmap)(struct fb_info *, struct vm_area_struct *);member in struct
fb_info, and using that infbmem.cif non-NULL, was actually my first idea. I didn't think it was particularly pretty, but if we don't care about aesthetics...Would you like that instead of the patch at hand?
drivers/video/fbdev/core/fb_defio.c +0
-2@@ -206,13 +206,11 @@ void fb_deferred_io_init(struct fb_info *info)BUG_ON (!fbdefio);mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap;INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ fbdefio->delay =HZ ; } -EXPORT_SYMBOL_GPL (fb_deferred_io_init); void fb_deferred_io_open(struct fb_info *info, struct inode *inode,drivers/video/fbdev/core/fbmem.c +10
-1@@ -1341,7 +1341,16 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)return -ENODEV ; fb = info->fbops;mutex_lock (&info->mm_lock); -if (fb->fb_mmap) { +if (fb->fbdefio) { +/* +* The framebuffer needs to be accessed decrypted, be sure +* SME protection is removed ahead of the call +*/ + vma->vm_page_prot =pgprot_decrypted (vma->vm_page_prot); + res =fb_deferred_io_mmap (info, vma); +mutex_unlock (&info->mm_lock); +return res; + }else if (fb->fb_mmap) {int res;/*
Quoted 8 lines
Quoted 5 lines
Is what I was thinking off as the pretty solution. Add an explicit
fb_info->fbdefio_enabledboolean if you don't feel like auditing all the drivers for whether they really calldefio_init()every time they assign something to that pointer. A quick scan brought some nasties to light in that area.Correction, brain wasn't awake yet, I've done the audit and the above diff should work afaict.
It just felt sketchy to me to depend on that pointer being set as the decider, independent of defio init. But if you think that's the way to go, I'm not going to argue. I'll bet it won't go unnoticed if fb_deferred_io_mmap() gets called without the init. ;)
BR,
Jani.
Quoted 120 lines
-Daniel
Quoted 118 lines
I think a function pointer here is pointless because we clearly don't need it, and with all the panic around function pointers a direct call feels much better :-)
-DanielQuoted 107 lines
BR,
Jani.Quoted 99 lines
-Daniel
Quoted 97 lines
That version would also get my r-b stamp. So up to you what you prefer. -Daniel
Quoted 88 lines
--- drivers/video/fbdev/core/fb_defio.c | 25 ++++++++++++++++++++++--- include/linux/fb.h | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-)drivers/video/fbdev/core/fb_defio.c +22
-3@@ -200,13 +200,23 @@ static void fb_deferred_io_work(struct work_struct *work)mutex_unlock (&fbdefio->lock); } -void fb_deferred_io_init (struct fb_info *info) +int fb_deferred_io_init (struct fb_info *info) {struct fb_deferred_io *fbdefio = info->fbdefio; +struct fb_ops *fbops;BUG_ON (!fbdefio); + + fbops =kmemdup (info->fbops,sizeof (*fbops),GFP_KERNEL ); +if (!fbops) +return -ENOMEM ; + + fbops->fb_mmap = fb_deferred_io_mmap; + info->deferred_io_private = info->fbops; + info->fbops = fbops; +mutex_init (&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; +INIT_DELAYED_WORK (&info->deferred_work, fb_deferred_io_work);INIT_LIST_HEAD (&fbdefio->pagelist);if (fbdefio->delay ==0 )/* set a default of 1 s */ @@ -229,6 +239,12 @@ void fb_deferred_io_cleanup(struct fb_info *info)int i;BUG_ON (!fbdefio); + +/* sanity check against misuse */ +if (WARN_ON (!info->deferred_io_private || + info->fbops->fb_mmap != fb_deferred_io_mmap)) +return ; +cancel_delayed_work_sync (&info->deferred_work);/* clear out the mapping that we setup */ @@ -237,7 +253,10 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping =NULL ; } - info->fbops->fb_mmap =NULL ; +kfree (info->fbops); + info->fbops = info->deferred_io_private; + info->deferred_io_private =NULL ; +mutex_destroy (&fbdefio->lock); }EXPORT_SYMBOL_GPL (fb_deferred_io_cleanup);include/linux/fb.h +2
-1@@ -470,6 +470,7 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; +void *deferred_io_private;#endif struct fb_ops *fbops;@@ -658,7 +659,7 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,/* drivers/video/fb_defio.c */ int fb_deferred_io_mmap (struct fb_info *info,struct vm_area_struct *vma); -extern void fb_deferred_io_init (struct fb_info *info); +extern int fb_deferred_io_init (struct fb_info *info);extern void fb_deferred_io_open (struct fb_info *info,struct inode *inode,struct file *file);Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 1 line
Jani Nikula, Intel Open Source Graphics CenterSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/13 drm/fb-helper: don't preserve fb_ops across deferred IO use
In reply to Jani NikulaDeferred IO now preserves the fb_ops.
--- drivers/gpu/drm/drm_fb_helper.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +2 -16
@@ -1954,7 +1954,6 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)static void drm_fbdev_cleanup (struct drm_fb_helper *fb_helper) {struct fb_info *fbi = fb_helper->fbdev; -struct fb_ops *fbops =NULL ;void *shadow =NULL ;if (!fb_helper->dev)
@@ -1963,15 +1962,11 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)if (fbi && fbi->fbdefio) {fb_deferred_io_cleanup (fbi); shadow = fbi->screen_buffer; - fbops = fbi->fbops; }drm_fb_helper_fini (fb_helper); -if (shadow) { -vfree (shadow); -kfree (fbops); - } +vfree (shadow);drm_client_framebuffer_delete (fb_helper->buffer); }
@@ -2062,23 +2057,14 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,drm_fb_helper_fill_info (fbi, fb_helper, sizes);if (drm_fbdev_use_shadow_fb (fb_helper)) { -struct fb_ops *fbops;void *shadow; -/* -* fb_deferred_io_cleanup() clears &fbops->fb_mmap so a per -* instance version is necessary. -*/ - fbops =kzalloc (sizeof (*fbops),GFP_KERNEL ); shadow =vzalloc (fbi->screen_size); -if (!fbops || !shadow) { -kfree (fbops); +if (!shadow) {vfree (shadow);return -ENOMEM ; } - *fbops = *fbi->fbops; - fbi->fbops = fbops; fbi->screen_buffer = shadow; fbi->fbdefio = &drm_fbdev_defio;
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 02/13] drm/fb-helper: don't preserve fb_ops across deferred IO use
Quoted 5 lines · Jani Nikula
Deferred IO now preserves the
fb_ops.Cc Noralf Trønnes <[email protected]>Signed-off-by Jani Nikula <[email protected]>
Quoted 65 lines
--- drivers/gpu/drm/drm_fb_helper.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)drivers/gpu/drm/drm_fb_helper.c +2
-16@@ -1954,7 +1954,6 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)static void drm_fbdev_cleanup (struct drm_fb_helper *fb_helper) {struct fb_info *fbi = fb_helper->fbdev; -struct fb_ops *fbops =NULL ;void *shadow =NULL ;if (!fb_helper->dev)@@ -1963,15 +1962,11 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)if (fbi && fbi->fbdefio) {fb_deferred_io_cleanup (fbi); shadow = fbi->screen_buffer; - fbops = fbi->fbops; }drm_fb_helper_fini (fb_helper); -if (shadow) { -vfree (shadow); -kfree (fbops); - } +vfree (shadow);drm_client_framebuffer_delete (fb_helper->buffer); }@@ -2062,23 +2057,14 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,drm_fb_helper_fill_info (fbi, fb_helper, sizes);if (drm_fbdev_use_shadow_fb (fb_helper)) { -struct fb_ops *fbops;void *shadow; -/* -* fb_deferred_io_cleanup() clears &fbops->fb_mmap so a per -* instance version is necessary. -*/ - fbops =kzalloc (sizeof (*fbops),GFP_KERNEL ); shadow =vzalloc (fbi->screen_size); -if (!fbops || !shadow) { -kfree (fbops); +if (!shadow) {vfree (shadow);return -ENOMEM ; } - *fbops = *fbi->fbops; - fbi->fbops = fbops; fbi->screen_buffer = shadow; fbi->fbdefio = &drm_fbdev_defio;Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
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 02/13] drm/fb-helper: don't preserve fb_ops across deferred IO use
In reply to Jani NikulaDen 27.11.2019 17.31, skrev Jani Nikula:
Quoted 45 lines
Deferred IO now preserves the
fb_ops.Cc Noralf Trønnes <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/drm_fb_helper.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)drivers/gpu/drm/drm_fb_helper.c +1
-7@@ -1954,7 +1954,6 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)static void drm_fbdev_cleanup (struct drm_fb_helper *fb_helper) {struct fb_info *fbi = fb_helper->fbdev; -struct fb_ops *fbops =NULL ;void *shadow =NULL ;if (!fb_helper->dev)@@ -1963,15 +1962,11 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)if (fbi && fbi->fbdefio) {fb_deferred_io_cleanup (fbi); shadow = fbi->screen_buffer; - fbops = fbi->fbops; }drm_fb_helper_fini (fb_helper); -if (shadow) { -vfree (shadow); -kfree (fbops); - } +vfree (shadow);drm_client_framebuffer_delete (fb_helper->buffer); }@@ -2062,23 +2057,14 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,drm_fb_helper_fill_info (fbi, fb_helper, sizes);if (drm_fbdev_use_shadow_fb (fb_helper)) { -struct fb_ops *fbops;void *shadow;
drivers/gpu/drm/drm_fb_helper.c static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · line 2064
Quoted 10 lines
drivers/gpu/drm/drm_fb_helper.c +1
-7-/* -* fb_deferred_io_cleanup() clears &fbops->fb_mmap so a per -* instance version is necessary. -*/ - fbops =kzalloc (sizeof (*fbops),GFP_KERNEL ); shadow =vzalloc (fbi->screen_size); -if (!fbops || !shadow) { -kfree (fbops); +if (!shadow) {vfree (shadow);
This vfree can is a no-op now and can be dropped. With that:
drivers/gpu/drm/drm_fb_helper.c static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · line 2070
Quoted 9 lines
drivers/gpu/drm/drm_fb_helper.c +0
-2return -ENOMEM ; } - *fbops = *fbi->fbops; - fbi->fbops = fbops; fbi->screen_buffer = shadow; fbi->fbdefio = &drm_fbdev_defio;
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/13] drm/fb-helper: don't preserve fb_ops across deferred IO use
Quoted 46 lines · Noralf Trønnes
Den 27.11.2019 17.31, skrev Jani Nikula:
Quoted 45 lines
Deferred IO now preserves the
fb_ops.Cc Noralf Trønnes <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/drm_fb_helper.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)drivers/gpu/drm/drm_fb_helper.c +1
-7@@ -1954,7 +1954,6 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)static void drm_fbdev_cleanup (struct drm_fb_helper *fb_helper) {struct fb_info *fbi = fb_helper->fbdev; -struct fb_ops *fbops =NULL ;void *shadow =NULL ;if (!fb_helper->dev)@@ -1963,15 +1962,11 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)if (fbi && fbi->fbdefio) {fb_deferred_io_cleanup (fbi); shadow = fbi->screen_buffer; - fbops = fbi->fbops; }drm_fb_helper_fini (fb_helper); -if (shadow) { -vfree (shadow); -kfree (fbops); - } +vfree (shadow);drm_client_framebuffer_delete (fb_helper->buffer); }@@ -2062,23 +2057,14 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,drm_fb_helper_fill_info (fbi, fb_helper, sizes);if (drm_fbdev_use_shadow_fb (fb_helper)) { -struct fb_ops *fbops;void *shadow;
Quoted 12 lines
drivers/gpu/drm/drm_fb_helper.c static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · line 2064
Quoted 10 lines
drivers/gpu/drm/drm_fb_helper.c +1
-7-/* -* fb_deferred_io_cleanup() clears &fbops->fb_mmap so a per -* instance version is necessary. -*/ - fbops =kzalloc (sizeof (*fbops),GFP_KERNEL ); shadow =vzalloc (fbi->screen_size); -if (!fbops || !shadow) { -kfree (fbops); +if (!shadow) {vfree (shadow);This vfree can is a no-op now and can be dropped. With that:
D'oh!
With that I think I'd also drop the shadow local variable and assign to fbi->screen_buffer directly. Fine with that?
Thanks.
BR,
Jani.
Quoted 16 lines
Reviewed-by Noralf Trønnes <[email protected]>drivers/gpu/drm/drm_fb_helper.c static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · line 2070
Quoted 9 lines
drivers/gpu/drm/drm_fb_helper.c +0
-2return -ENOMEM ; } - *fbops = *fbi->fbops; - fbi->fbops = fbops; fbi->screen_buffer = shadow; fbi->fbdefio = &drm_fbdev_defio;_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 02/13] drm/fb-helper: don't preserve fb_ops across deferred IO use
Den 28.11.2019 13.05, skrev Jani Nikula:
Quoted 60 lines · Noralf Trønnes
Quoted 46 lines
Den 27.11.2019 17.31, skrev Jani Nikula:
Quoted 45 lines
Deferred IO now preserves the
fb_ops.Cc Noralf Trønnes <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/drm_fb_helper.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)drivers/gpu/drm/drm_fb_helper.c +1
-7@@ -1954,7 +1954,6 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)static void drm_fbdev_cleanup (struct drm_fb_helper *fb_helper) {struct fb_info *fbi = fb_helper->fbdev; -struct fb_ops *fbops =NULL ;void *shadow =NULL ;if (!fb_helper->dev)@@ -1963,15 +1962,11 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)if (fbi && fbi->fbdefio) {fb_deferred_io_cleanup (fbi); shadow = fbi->screen_buffer; - fbops = fbi->fbops; }drm_fb_helper_fini (fb_helper); -if (shadow) { -vfree (shadow); -kfree (fbops); - } +vfree (shadow);drm_client_framebuffer_delete (fb_helper->buffer); }@@ -2062,23 +2057,14 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,drm_fb_helper_fill_info (fbi, fb_helper, sizes);if (drm_fbdev_use_shadow_fb (fb_helper)) { -struct fb_ops *fbops;void *shadow;Quoted 12 lines
drivers/gpu/drm/drm_fb_helper.c static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · line 2064
Quoted 10 lines
drivers/gpu/drm/drm_fb_helper.c +1
-7-/* -* fb_deferred_io_cleanup() clears &fbops->fb_mmap so a per -* instance version is necessary. -*/ - fbops =kzalloc (sizeof (*fbops),GFP_KERNEL ); shadow =vzalloc (fbi->screen_size); -if (!fbops || !shadow) { -kfree (fbops); +if (!shadow) {vfree (shadow);This vfree can is a no-op now and can be dropped. With that:
Quoted 4 lines
D'oh!
With that I think I'd also drop the shadow local variable and assign to
fbi->screen_bufferdirectly. Fine with that?
Sure, that's even better.
Noralf.
Quoted 23 lines
Thanks.
BR,
Jani.Quoted 16 lines
Reviewed-by Noralf Trønnes <[email protected]>drivers/gpu/drm/drm_fb_helper.c static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · line 2070
Quoted 9 lines
drivers/gpu/drm/drm_fb_helper.c +0
-2return -ENOMEM ; } - *fbops = *fbi->fbops; - fbi->fbops = fbops; fbi->screen_buffer = shadow; fbi->fbdefio = &drm_fbdev_defio;_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/13 video: smscufx: don't restore fb_mmap after deferred IO cleanup
In reply to Jani NikulaDeferred IO now preserves the fb_ops.
--- drivers/video/fbdev/smscufx.c | 1 - 1 file changed, 1 deletion(-)
drivers/video/fbdev/smscufx.c +0 -1
@@ -1170,7 +1170,6 @@ static int ufx_ops_release(struct fb_info *info, int user)fb_deferred_io_cleanup (info);kfree (info->fbdefio); info->fbdefio =NULL ; - info->fbops->fb_mmap = ufx_ops_mmap; } pr_debug("released /dev/fb%d user=%d count=%d",
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 03/13] video: smscufx: don't restore fb_mmap after deferred IO cleanup
Quoted 14 lines · Jani Nikula
Deferred IO now preserves the
fb_ops.Cc Steve Glendinning <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- drivers/video/fbdev/smscufx.c | 1 - 1 file changed, 1 deletion(-)drivers/video/fbdev/smscufx.c +0
-0
drivers/video/fbdev/smscufx.c static int ufx_ops_release(struct fb_info *info, int user) · line 1173
Quoted 4 lines
drivers/video/fbdev/smscufx.c +0
-1@@ -1170,7 +1170,6 @@ static int ufx_ops_release(struct fb_info *info, int user)fb_deferred_io_cleanup (info);kfree (info->fbdefio); info->fbdefio =NULL ; - info->fbops->fb_mmap = ufx_ops_mmap;
Also totally pointless to restore this here, since if you have indeed loaded the driver twice shit has hit the fan already. I guess that was for the module option .... wtf.
Quoted 10 lines
drivers/video/fbdev/smscufx.c +0
-0} pr_debug("released /dev/fb%d user=%d count=%d",Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/13 video: udlfb: don't restore fb_mmap after deferred IO cleanup
In reply to Jani NikulaDeferred IO now preserves the fb_ops.
--- drivers/video/fbdev/udlfb.c | 1 - 1 file changed, 1 deletion(-)
drivers/video/fbdev/udlfb.c +0 -1
@@ -1037,7 +1037,6 @@ static int dlfb_ops_release(struct fb_info *info, int user)fb_deferred_io_cleanup (info);kfree (info->fbdefio); info->fbdefio =NULL ; - info->fbops->fb_mmap = dlfb_ops_mmap; }dev_dbg (info->dev,"release, user=%d count=%d\n" , user, dlfb->fb_count);
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/13] video: udlfb: don't restore fb_mmap after deferred IO cleanup
Quoted 5 lines · Jani Nikula
Deferred IO now preserves the
fb_ops.Cc Bernie Thompson <[email protected]>Signed-off-by Jani Nikula <[email protected]>
Aside: I wonder whether we should start retiring all the fbdev drivers which have kms drivers already ... you get fbdev for free with the latter. -Daniel
Quoted 23 lines
--- drivers/video/fbdev/udlfb.c | 1 - 1 file changed, 1 deletion(-)drivers/video/fbdev/udlfb.c +0
-1@@ -1037,7 +1037,6 @@ static int dlfb_ops_release(struct fb_info *info, int user)fb_deferred_io_cleanup (info);kfree (info->fbdefio); info->fbdefio =NULL ; - info->fbops->fb_mmap = dlfb_ops_mmap; }dev_dbg (info->dev,"release, user=%d count=%d\n" , user, dlfb->fb_count);Signature · 6 lines
2.20.1 _______________________________________________ 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 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/13 video: fbdev: vesafb: modify the static fb_ops directly
In reply to Jani NikulaAvoid modifying the fb_ops via info->fbops to let us make the pointer const in the future.
--- drivers/video/fbdev/vesafb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/vesafb.c +3 -3
@@ -447,15 +447,15 @@ static int vesafb_probe(struct platform_device *dev) vesafb_fix.smem_start, info->screen_base, size_remap/1024, size_total/1024); +if (!ypan) + vesafb_ops.fb_pan_display =NULL ; + info->fbops = &vesafb_ops; info->var = vesafb_defined; info->fix = vesafb_fix; info->flags =FBINFO_FLAG_DEFAULT |FBINFO_MISC_FIRMWARE | (ypan ?FBINFO_HWACCEL_YPAN :0 ); -if (!ypan) - info->fbops->fb_pan_display =NULL ; -if (fb_alloc_cmap (&info->cmap,256 ,0 ) <0 ) { err = -ENOMEM ; goto err;
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 05/13] video: fbdev: vesafb: modify the static fb_ops directly
Quoted 14 lines · Jani Nikula
Avoid modifying the
fb_opsviainfo->fbopsto let us make the pointer const in the future.Signed-off-by Jani Nikula <[email protected]>--- drivers/video/fbdev/vesafb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/video/fbdev/vesafb.c +0
-0
drivers/video/fbdev/vesafb.c static int vesafb_probe(struct platform_device *dev) · line 451
Quoted 5 lines
drivers/video/fbdev/vesafb.c +2
-0@@ -447,15 +447,15 @@ static int vesafb_probe(struct platform_device *dev) vesafb_fix.smem_start, info->screen_base, size_remap/1024, size_total/1024); +if (!ypan) + vesafb_ops.fb_pan_display =NULL ;
vesafb at least has a guarantee that there's only ever one ...
Quoted 20 lines
drivers/video/fbdev/vesafb.c +1
-3+ info->fbops = &vesafb_ops; info->var = vesafb_defined; info->fix = vesafb_fix; info->flags =FBINFO_FLAG_DEFAULT |FBINFO_MISC_FIRMWARE | (ypan ?FBINFO_HWACCEL_YPAN :0 ); -if (!ypan) - info->fbops->fb_pan_display =NULL ; -if (fb_alloc_cmap (&info->cmap,256 ,0 ) <0 ) { err = -ENOMEM ; goto err;Signature · 6 lines
2.20.1 _______________________________________________ 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 6/13 video: fbmem: use const pointer for fb_ops
In reply to Jani NikulaUse const for fb_ops to let us make the info->fbops pointer const in the future.
--- drivers/video/fbdev/core/fbmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/core/fbmem.c +3 -3
@@ -1079,7 +1079,7 @@ EXPORT_SYMBOL(fb_blank);static long do_fb_ioctl (struct fb_info *info,unsigned int cmd,unsigned long arg) { -struct fb_ops *fb; +const struct fb_ops *fb;struct fb_var_screeninfo var;struct fb_fix_screeninfo fix;struct fb_cmap cmap_from;
@@ -1292,7 +1292,7 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) {struct fb_info *info =file_fb_info (file); -struct fb_ops *fb; +const struct fb_ops *fb;long ret = -ENOIOCTLCMD ;if (!info)
@@ -1332,7 +1332,7 @@ static int fb_mmap(struct file *file, struct vm_area_struct * vma) { struct fb_info *info = file_fb_info(file); -struct fb_ops *fb; +const struct fb_ops *fb;unsigned long mmio_pgoff;unsigned long start;u32 len;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/13 video: omapfb: use const pointer for fb_ops
In reply to Jani NikulaUse const for fb_ops to let us make the info->fbops pointer const in the future.
--- drivers/video/fbdev/omap/omapfb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/omap/omapfb_main.c +1 -1
@@ -1052,7 +1052,7 @@ static int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, {struct omapfb_plane_struct *plane = fbi->par;struct omapfb_device *fbdev = plane->fbdev; -struct fb_ops *ops = fbi->fbops; +const struct fb_ops *ops = fbi->fbops;union {struct omapfb_update_window update_window;struct omapfb_plane_info plane_info;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/13 video: fbdev: make fbops member of struct fb_info a const pointer
In reply to Jani NikulaNow that we no longer modify the fbops, or hold non-const pointers to it, we can make it const. With that, also deferred_io_private needs to be const. After this, we can start making the fbops const all over the place.
--- include/linux/fb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/fb.h +2 -2
@@ -470,10 +470,10 @@ struct fb_info {#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;struct fb_deferred_io *fbdefio; -void *deferred_io_private; +const void *deferred_io_private;#endif -struct fb_ops *fbops; +const struct fb_ops *fbops;struct device *device;/* This is the parent */ struct device *dev;/* This is this fb device */ int class_flag;/* private sysfs flags */
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH 08/13] video: fbdev: make fbops member of struct fb_info a const pointer
I love your patch! Yet something to improve:
Hi Jani,
I love your patch! Yet something to improve:
[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v5.4 next-20191127]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Jani-Nikula/video-drm-constify-fbops-in-struct-fb_info/20191128-022047 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: x86_64-randconfig-s1-20191128 (attached as .config) compiler: gcc-7 (Debian 7.4.0-14) 7.4.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
If you fix the issue, kindly add following tag
All errors (new ones prefixed by >>):
drivers/video/fbdev/uvesafb.c: In function 'uvesafb_init_info':
>> drivers/video/fbdev/uvesafb.c:1443:25: error: assignment of member 'fb_blank' in read-only object
info->fbops->fb_blank = NULL;
^
>> drivers/video/fbdev/uvesafb.c:1513:31: error: assignment of member 'fb_pan_display' in read-only object
info->fbops->fb_pan_display = NULL;
^
--
drivers/video/fbdev/mb862xx/mb862xxfb_accel.c: In function 'mb862xxfb_init_accel':
>> drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:311:28: error: assignment of member 'fb_fillrect' in read-only object
info->fbops->fb_fillrect = cfb_fillrect;
^
>> drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:312:28: error: assignment of member 'fb_copyarea' in read-only object
info->fbops->fb_copyarea = cfb_copyarea;
^
>> drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:313:29: error: assignment of member 'fb_imageblit' in read-only object
info->fbops->fb_imageblit = cfb_imageblit;
^
drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:316:28: error: assignment of member 'fb_fillrect' in read-only object
info->fbops->fb_fillrect = mb86290fb_fillrect;
^
drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:317:28: error: assignment of member 'fb_copyarea' in read-only object
info->fbops->fb_copyarea = mb86290fb_copyarea;
^
drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:318:29: error: assignment of member 'fb_imageblit' in read-only object
info->fbops->fb_imageblit = mb86290fb_imageblit;
^
--
drivers/video/fbdev/nvidia/nvidia.c: In function 'nvidiafb_set_par':
>> drivers/video/fbdev/nvidia/nvidia.c:663:29: error: assignment of member 'fb_imageblit' in read-only object
info->fbops->fb_imageblit = nvidiafb_imageblit;
^
>> drivers/video/fbdev/nvidia/nvidia.c:664:28: error: assignment of member 'fb_fillrect' in read-only object
info->fbops->fb_fillrect = nvidiafb_fillrect;
^
>> drivers/video/fbdev/nvidia/nvidia.c:665:28: error: assignment of member 'fb_copyarea' in read-only object
info->fbops->fb_copyarea = nvidiafb_copyarea;
^
>> drivers/video/fbdev/nvidia/nvidia.c:666:24: error: assignment of member 'fb_sync' in read-only object
info->fbops->fb_sync = nvidiafb_sync;
^
drivers/video/fbdev/nvidia/nvidia.c:672:29: error: assignment of member 'fb_imageblit' in read-only object
info->fbops->fb_imageblit = cfb_imageblit;
^
drivers/video/fbdev/nvidia/nvidia.c:673:28: error: assignment of member 'fb_fillrect' in read-only object
info->fbops->fb_fillrect = cfb_fillrect;
^
drivers/video/fbdev/nvidia/nvidia.c:674:28: error: assignment of member 'fb_copyarea' in read-only object
info->fbops->fb_copyarea = cfb_copyarea;
^
drivers/video/fbdev/nvidia/nvidia.c:675:24: error: assignment of member 'fb_sync' in read-only object
info->fbops->fb_sync = NULL;
^
drivers/video/fbdev/nvidia/nvidia.c: In function 'nvidia_set_fbinfo':
>> drivers/video/fbdev/nvidia/nvidia.c:1168:29: error: assignment of member 'fb_cursor' in read-only object
info->fbops->fb_cursor = NULL;
^vim +/fb_blank +1443 drivers/video/fbdev/uvesafb.c
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1427
48c68c4f1b5424 drivers/video/uvesafb.c Greg Kroah-Hartman 2012-12-21 1428 static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1429 {
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1430 unsigned int size_vmode;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1431 unsigned int size_remap;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1432 unsigned int size_total;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1433 struct uvesafb_par *par = info->par;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1434 int i, h;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1435
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1436 info->pseudo_palette = ((u8 *)info->par + sizeof(struct uvesafb_par));
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1437 info->fix = uvesafb_fix;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1438 info->fix.ypanstep = par->ypan ? 1 : 0;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1439 info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1440
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1441 /* Disable blanking if the user requested so. */
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1442 if (!blank)
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 @1443 info->fbops->fb_blank = NULL;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1444
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1445 /*
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1446 * Find out how much IO memory is required for the mode with
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1447 * the highest resolution.
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1448 */
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1449 size_remap = 0;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1450 for (i = 0; i < par->vbe_modes_cnt; i++) {
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1451 h = par->vbe_modes[i].bytes_per_scan_line *
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1452 par->vbe_modes[i].y_res;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1453 if (h > size_remap)
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1454 size_remap = h;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1455 }
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1456 size_remap *= 2;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1457
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1458 /*
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1459 * size_vmode -- that is the amount of memory needed for the
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1460 * used video mode, i.e. the minimum amount of
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1461 * memory we need.
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1462 */
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1463 size_vmode = info->var.yres * mode->bytes_per_scan_line;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1464
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1465 /*
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1466 * size_total -- all video memory we have. Used for mtrr
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1467 * entries, resource allocation and bounds
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1468 * checking.
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1469 */
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1470 size_total = par->vbe_ib.total_memory * 65536;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1471 if (vram_total)
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1472 size_total = vram_total * 1024 * 1024;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1473 if (size_total < size_vmode)
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1474 size_total = size_vmode;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1475
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1476 /*
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1477 * size_remap -- the amount of video memory we are going to
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1478 * use for vesafb. With modern cards it is no
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1479 * option to simply use size_total as th
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1480 * wastes plenty of kernel address space.
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1481 */
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1482 if (vram_remap)
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1483 size_remap = vram_remap * 1024 * 1024;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1484 if (size_remap < size_vmode)
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1485 size_remap = size_vmode;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1486 if (size_remap > size_total)
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1487 size_remap = size_total;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1488
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1489 info->fix.smem_len = size_remap;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1490 info->fix.smem_start = mode->phys_base_ptr;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1491
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1492 /*
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1493 * We have to set yres_virtual here because when setup_var() was
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1494 * called, smem_len wasn't defined yet.
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1495 */
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1496 info->var.yres_virtual = info->fix.smem_len /
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1497 mode->bytes_per_scan_line;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1498
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1499 if (par->ypan && info->var.yres_virtual > info->var.yres) {
a8feae09110675 drivers/video/fbdev/uvesafb.c Joe Perches 2017-06-14 1500 pr_info("scrolling: %s using protected mode interface, yres_virtual=%d\n",
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1501 (par->ypan > 1) ? "ywrap" : "ypan",
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1502 info->var.yres_virtual);
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1503 } else {
a8feae09110675 drivers/video/fbdev/uvesafb.c Joe Perches 2017-06-14 1504 pr_info("scrolling: redraw\n");
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1505 info->var.yres_virtual = info->var.yres;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1506 par->ypan = 0;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1507 }
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1508
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1509 info->flags = FBINFO_FLAG_DEFAULT |
1cc9fb6dbf915e drivers/video/uvesafb.c Roel Kluin 2009-03-31 1510 (par->ypan ? FBINFO_HWACCEL_YPAN : 0);
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1511
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1512 if (!par->ypan)
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 @1513 info->fbops->fb_pan_display = NULL;
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1514 }
8bdb3a2d7df48b drivers/video/uvesafb.c Michal Januszewski 2007-10-16 1515 :::::: The code at line 1443 was first introduced by commit :::::: 8bdb3a2d7df48b861972c4bfb58490853a228f51 uvesafb: the driver core
:::::: TO: Michal Januszewski <[email protected]> :::::: CC: Linus Torvalds <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/[email protected] Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
kbuild test robot
build botRe: [PATCH 08/13] video: fbdev: make fbops member of struct fb_info a const pointer
In reply to Jani NikulaI love your patch! Yet something to improve:
Hi Jani,
I love your patch! Yet something to improve:
[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v5.4 next-20191127]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Jani-Nikula/video-drm-constify-fbops-in-struct-fb_info/20191128-022047 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: x86_64-allyesconfig (attached as .config) compiler: gcc-7 (Debian 7.4.0-14) 7.4.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
If you fix the issue, kindly add following tag
All errors (new ones prefixed by >>):
drivers/gpu/drm/udl/udl_fb.c: In function 'udl_fb_release':
>> drivers/gpu/drm/udl/udl_fb.c:256:24: error: assignment of member 'fb_mmap' in read-only object
info->fbops->fb_mmap = udl_fb_mmap;
^vim +/fb_mmap +256 drivers/gpu/drm/udl/udl_fb.c
5320918b9a8786 Dave Airlie 2010-12-15 240
5320918b9a8786 Dave Airlie 2010-12-15 241
5320918b9a8786 Dave Airlie 2010-12-15 242 /*
5320918b9a8786 Dave Airlie 2010-12-15 243 * Assumes caller is holding info->lock mutex (for open and release at least)
5320918b9a8786 Dave Airlie 2010-12-15 244 */
5320918b9a8786 Dave Airlie 2010-12-15 245 static int udl_fb_release(struct fb_info *info, int user)
5320918b9a8786 Dave Airlie 2010-12-15 246 {
5320918b9a8786 Dave Airlie 2010-12-15 247 struct udl_fbdev *ufbdev = info->par;
5320918b9a8786 Dave Airlie 2010-12-15 248
5320918b9a8786 Dave Airlie 2010-12-15 249 ufbdev->fb_count--;
5320918b9a8786 Dave Airlie 2010-12-15 250
2b721f20770ccb Daniel Vetter 2016-08-10 251 #ifdef CONFIG_DRM_FBDEV_EMULATION
5320918b9a8786 Dave Airlie 2010-12-15 252 if ((ufbdev->fb_count == 0) && (info->fbdefio)) {
5320918b9a8786 Dave Airlie 2010-12-15 253 fb_deferred_io_cleanup(info);
5320918b9a8786 Dave Airlie 2010-12-15 254 kfree(info->fbdefio);
5320918b9a8786 Dave Airlie 2010-12-15 255 info->fbdefio = NULL;
5320918b9a8786 Dave Airlie 2010-12-15 @256 info->fbops->fb_mmap = udl_fb_mmap;
5320918b9a8786 Dave Airlie 2010-12-15 257 }
2b721f20770ccb Daniel Vetter 2016-08-10 258 #endif
5320918b9a8786 Dave Airlie 2010-12-15 259
90991209837ab6 Mikulas Patocka 2018-06-03 260 pr_debug("released /dev/fb%d user=%d count=%d\n",
5320918b9a8786 Dave Airlie 2010-12-15 261 info->node, user, ufbdev->fb_count);
5320918b9a8786 Dave Airlie 2010-12-15 262
5320918b9a8786 Dave Airlie 2010-12-15 263 return 0;
5320918b9a8786 Dave Airlie 2010-12-15 264 }
5320918b9a8786 Dave Airlie 2010-12-15 265 :::::: The code at line 256 was first introduced by commit
:::::: 5320918b9a87865223fd6b228e530bf30bc64d9d drm/udl: initial UDL driver (v4)
:::::: TO: Dave Airlie <[email protected]>
:::::: CC: Dave Airlie <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/[email protected] Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 9/13 drm: constify fb ops across all drivers
In reply to Jani NikulaNow that the fbops member of struct fb_info is const, we can start making the ops const as well.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +- drivers/gpu/drm/armada/armada_fbdev.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 2 +- drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +- drivers/gpu/drm/msm/msm_fbdev.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 4 ++-- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/radeon/radeon_fb.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 2 +- drivers/gpu/drm/tegra/fb.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1 -1
@@ -69,7 +69,7 @@ amdgpufb_release(struct fb_info *info, int user)return 0 ; } -static struct fb_ops amdgpufb_ops = { +static const struct fb_ops amdgpufb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_open = amdgpufb_open,
drivers/gpu/drm/armada/armada_fbdev.c +1 -1
@@ -16,7 +16,7 @@#include "armada_fb.h" #include "armada_gem.h" -static /*const*/ struct fb_ops armada_fb_ops = { +static const struct fb_ops armada_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_fillrect = drm_fb_helper_cfb_fillrect,
drivers/gpu/drm/drm_fb_helper.c +1 -1
@@ -1997,7 +1997,7 @@ static int drm_fbdev_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)return -ENODEV ; } -static struct fb_ops drm_fbdev_fb_ops = { +static const struct fb_ops drm_fbdev_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_open = drm_fbdev_fb_open,
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +1 -1
@@ -60,7 +60,7 @@ static int exynos_drm_fb_mmap(struct fb_info *info,return 0 ; } -static struct fb_ops exynos_drm_fb_ops = { +static const struct fb_ops exynos_drm_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_mmap = exynos_drm_fb_mmap,
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c +1 -1
@@ -38,7 +38,7 @@ static int hibmcfb_create_object(return ret; } -static struct fb_ops hibmc_drm_fb_ops = { +static const 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,
drivers/gpu/drm/i915/display/intel_fbdev.c +1 -1
@@ -100,7 +100,7 @@ static int intel_fbdev_pan_display(struct fb_var_screeninfo *var,return ret; } -static struct fb_ops intelfb_ops = { +static const struct fb_ops intelfb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_set_par = intel_fbdev_set_par,
drivers/gpu/drm/msm/msm_fbdev.c +1 -1
@@ -26,7 +26,7 @@ struct msm_fbdev {struct drm_framebuffer *fb; }; -static struct fb_ops msm_fb_ops = { +static const struct fb_ops msm_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS ,
drivers/gpu/drm/nouveau/nouveau_fbcon.c +2 -2
@@ -203,7 +203,7 @@ nouveau_fbcon_release(struct fb_info *info, int user)return 0 ; } -static struct fb_ops nouveau_fbcon_ops = { +static const struct fb_ops nouveau_fbcon_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_open = nouveau_fbcon_open,
@@ -214,7 +214,7 @@ static struct fb_ops nouveau_fbcon_ops = { .fb_sync = nouveau_fbcon_sync, }; -static struct fb_ops nouveau_fbcon_sw_ops = { +static const struct fb_ops nouveau_fbcon_sw_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_open = nouveau_fbcon_open,
drivers/gpu/drm/omapdrm/omap_fbdev.c +1 -1
@@ -70,7 +70,7 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var,return drm_fb_helper_pan_display (var, fbi); } -static struct fb_ops omap_fb_ops = { +static const struct fb_ops omap_fb_ops = { .owner =THIS_MODULE , .fb_check_var = drm_fb_helper_check_var,
drivers/gpu/drm/radeon/radeon_fb.c +1 -1
@@ -73,7 +73,7 @@ radeonfb_release(struct fb_info *info, int user)return 0 ; } -static struct fb_ops radeonfb_ops = { +static const struct fb_ops radeonfb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_open = radeonfb_open,
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c +1 -1
@@ -27,7 +27,7 @@ static int rockchip_fbdev_mmap(struct fb_info *info,return rockchip_gem_mmap_buf (private->fbdev_bo, vma); } -static struct fb_ops rockchip_drm_fbdev_ops = { +static const struct fb_ops rockchip_drm_fbdev_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_mmap = rockchip_fbdev_mmap,
drivers/gpu/drm/tegra/fb.c +1 -1
@@ -192,7 +192,7 @@ static int tegra_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)return __tegra_gem_mmap (&bo->gem, vma); } -static struct fb_ops tegra_fb_ops = { +static const struct fb_ops tegra_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , .fb_fillrect = drm_fb_helper_sys_fillrect,
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +1 -1
@@ -624,7 +624,7 @@ static int vmw_fb_set_par(struct fb_info *info) } -static struct fb_ops vmw_fb_ops = { +static const struct fb_ops vmw_fb_ops = { .owner =THIS_MODULE , .fb_check_var = vmw_fb_check_var, .fb_set_par = vmw_fb_set_par,
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/13 video: constify fb ops across all drivers
In reply to Jani NikulaNow that the fbops member of struct fb_info is const, we can star making the ops const as well.
--- drivers/video/fbdev/68328fb.c | 2 +- drivers/video/fbdev/acornfb.c | 2 +- drivers/video/fbdev/amba-clcd.c | 2 +- drivers/video/fbdev/amifb.c | 2 +- drivers/video/fbdev/arcfb.c | 2 +- drivers/video/fbdev/arkfb.c | 2 +- drivers/video/fbdev/asiliantfb.c | 2 +- drivers/video/fbdev/atmel_lcdfb.c | 2 +- drivers/video/fbdev/aty/aty128fb.c | 2 +- drivers/video/fbdev/aty/atyfb_base.c | 2 +- drivers/video/fbdev/aty/radeon_base.c | 2 +- drivers/video/fbdev/au1100fb.c | 2 +- drivers/video/fbdev/au1200fb.c | 2 +- drivers/video/fbdev/broadsheetfb.c | 2 +- drivers/video/fbdev/bw2.c | 2 +- drivers/video/fbdev/carminefb.c | 2 +- drivers/video/fbdev/cg14.c | 2 +- drivers/video/fbdev/cg3.c | 2 +- drivers/video/fbdev/cg6.c | 2 +- drivers/video/fbdev/chipsfb.c | 2 +- drivers/video/fbdev/cirrusfb.c | 2 +- drivers/video/fbdev/clps711x-fb.c | 2 +- drivers/video/fbdev/cobalt_lcdfb.c | 2 +- drivers/video/fbdev/controlfb.c | 2 +- drivers/video/fbdev/cyber2000fb.c | 2 +- drivers/video/fbdev/da8xx-fb.c | 2 +- drivers/video/fbdev/dnfb.c | 2 +- drivers/video/fbdev/efifb.c | 2 +- drivers/video/fbdev/ep93xx-fb.c | 2 +- drivers/video/fbdev/fb-puv3.c | 2 +- drivers/video/fbdev/ffb.c | 2 +- drivers/video/fbdev/fm2fb.c | 2 +- drivers/video/fbdev/fsl-diu-fb.c | 2 +- drivers/video/fbdev/g364fb.c | 2 +- drivers/video/fbdev/gbefb.c | 2 +- drivers/video/fbdev/geode/gx1fb_core.c | 2 +- drivers/video/fbdev/geode/gxfb_core.c | 2 +- drivers/video/fbdev/geode/lxfb_core.c | 2 +- drivers/video/fbdev/goldfishfb.c | 2 +- drivers/video/fbdev/grvga.c | 2 +- drivers/video/fbdev/gxt4500.c | 2 +- drivers/video/fbdev/hecubafb.c | 2 +- drivers/video/fbdev/hgafb.c | 2 +- drivers/video/fbdev/hitfb.c | 2 +- drivers/video/fbdev/hpfb.c | 2 +- drivers/video/fbdev/hyperv_fb.c | 2 +- drivers/video/fbdev/i740fb.c | 2 +- drivers/video/fbdev/imsttfb.c | 2 +- drivers/video/fbdev/imxfb.c | 2 +- drivers/video/fbdev/intelfb/intelfbdrv.c | 2 +- drivers/video/fbdev/kyro/fbdev.c | 2 +- drivers/video/fbdev/leo.c | 2 +- drivers/video/fbdev/macfb.c | 2 +- drivers/video/fbdev/matrox/matroxfb_crtc2.c | 2 +- drivers/video/fbdev/maxinefb.c | 2 +- drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 2 +- drivers/video/fbdev/mbx/mbxfb.c | 2 +- drivers/video/fbdev/metronomefb.c | 2 +- drivers/video/fbdev/mmp/fb/mmpfb.c | 2 +- drivers/video/fbdev/mx3fb.c | 5 +++-- drivers/video/fbdev/neofb.c | 2 +- drivers/video/fbdev/nvidia/nvidia.c | 2 +- drivers/video/fbdev/ocfb.c | 2 +- drivers/video/fbdev/offb.c | 2 +- drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 2 +- drivers/video/fbdev/p9100.c | 2 +- drivers/video/fbdev/platinumfb.c | 2 +- drivers/video/fbdev/pm2fb.c | 2 +- drivers/video/fbdev/pm3fb.c | 2 +- drivers/video/fbdev/pmag-aa-fb.c | 2 +- drivers/video/fbdev/pmag-ba-fb.c | 2 +- drivers/video/fbdev/pmagb-b-fb.c | 2 +- drivers/video/fbdev/ps3fb.c | 2 +- drivers/video/fbdev/pvr2fb.c | 2 +- drivers/video/fbdev/pxa168fb.c | 2 +- drivers/video/fbdev/pxafb.c | 4 ++-- drivers/video/fbdev/q40fb.c | 2 +- drivers/video/fbdev/riva/fbdev.c | 2 +- drivers/video/fbdev/s3c-fb.c | 2 +- drivers/video/fbdev/s3c2410fb.c | 2 +- drivers/video/fbdev/s3fb.c | 2 +- drivers/video/fbdev/sa1100fb.c | 2 +- drivers/video/fbdev/savage/savagefb_driver.c | 2 +- drivers/video/fbdev/sh7760fb.c | 2 +- drivers/video/fbdev/sh_mobile_lcdcfb.c | 4 ++-- drivers/video/fbdev/simplefb.c | 2 +- drivers/video/fbdev/sis/sis_main.c | 2 +- drivers/video/fbdev/skeletonfb.c | 2 +- drivers/video/fbdev/sm712fb.c | 2 +- drivers/video/fbdev/ssd1307fb.c | 2 +- drivers/video/fbdev/sstfb.c | 2 +- drivers/video/fbdev/stifb.c | 2 +- drivers/video/fbdev/sunxvr1000.c | 2 +- drivers/video/fbdev/sunxvr2500.c | 2 +- drivers/video/fbdev/sunxvr500.c | 2 +- drivers/video/fbdev/tcx.c | 2 +- drivers/video/fbdev/tdfxfb.c | 2 +- drivers/video/fbdev/tgafb.c | 2 +- drivers/video/fbdev/tmiofb.c | 2 +- drivers/video/fbdev/tridentfb.c | 2 +- drivers/video/fbdev/uvesafb.c | 2 +- drivers/video/fbdev/valkyriefb.c | 2 +- drivers/video/fbdev/vfb.c | 2 +- drivers/video/fbdev/vga16fb.c | 2 +- drivers/video/fbdev/vt8500lcdfb.c | 2 +- drivers/video/fbdev/vt8623fb.c | 2 +- drivers/video/fbdev/w100fb.c | 2 +- drivers/video/fbdev/wm8505fb.c | 2 +- drivers/video/fbdev/xen-fbfront.c | 2 +- drivers/video/fbdev/xilinxfb.c | 2 +- 110 files changed, 114 insertions(+), 113 deletions(-)
drivers/video/fbdev/68328fb.c +1 -1
@@ -96,7 +96,7 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);static int mc68x328fb_mmap (struct fb_info *info,struct vm_area_struct *vma); -static struct fb_ops mc68x328fb_ops = { +static const struct fb_ops mc68x328fb_ops = { .fb_check_var = mc68x328fb_check_var, .fb_set_par = mc68x328fb_set_par, .fb_setcolreg = mc68x328fb_setcolreg,
drivers/video/fbdev/acornfb.c +1 -1
@@ -604,7 +604,7 @@ acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)return 0 ; } -static struct fb_ops acornfb_ops = { +static const struct fb_ops acornfb_ops = { .owner =THIS_MODULE , .fb_check_var = acornfb_check_var, .fb_set_par = acornfb_set_par,
drivers/video/fbdev/amba-clcd.c +1 -1
@@ -423,7 +423,7 @@ static int clcdfb_mmap(struct fb_info *info,return ret; } -static struct fb_ops clcdfb_ops = { +static const struct fb_ops clcdfb_ops = { .owner =THIS_MODULE , .fb_check_var = clcdfb_check_var, .fb_set_par = clcdfb_set_par,
drivers/video/fbdev/amifb.c +1 -1
@@ -3493,7 +3493,7 @@ static irqreturn_t amifb_interrupt(int irq, void *dev_id) } -static struct fb_ops amifb_ops = { +static const struct fb_ops amifb_ops = { .owner =THIS_MODULE , .fb_check_var = amifb_check_var, .fb_set_par = amifb_set_par,
drivers/video/fbdev/arcfb.c +1 -1
@@ -491,7 +491,7 @@ static ssize_t arcfb_write(struct fb_info *info, const char __user *buf,return err; } -static struct fb_ops arcfb_ops = { +static const struct fb_ops arcfb_ops = { .owner =THIS_MODULE , .fb_open = arcfb_open, .fb_read = fb_sys_read,
drivers/video/fbdev/arkfb.c +1 -1
@@ -917,7 +917,7 @@ static int arkfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info/* Frame buffer operations */ -static struct fb_ops arkfb_ops = { +static const struct fb_ops arkfb_ops = { .owner =THIS_MODULE , .fb_open = arkfb_open, .fb_release = arkfb_release,
drivers/video/fbdev/asiliantfb.c +1 -1
@@ -95,7 +95,7 @@ static int asiliantfb_set_par(struct fb_info *info);static int asiliantfb_setcolreg (u_int regno,u_int red,u_int green,u_int blue,u_int transp,struct fb_info *info); -static struct fb_ops asiliantfb_ops = { +static const struct fb_ops asiliantfb_ops = { .owner =THIS_MODULE , .fb_check_var = asiliantfb_check_var, .fb_set_par = asiliantfb_set_par,
drivers/video/fbdev/atmel_lcdfb.c +1 -1
@@ -824,7 +824,7 @@ static int atmel_lcdfb_blank(int blank_mode, struct fb_info *info)return ((blank_mode ==FB_BLANK_NORMAL ) ?1 :0 ); } -static struct fb_ops atmel_lcdfb_ops = { +static const struct fb_ops atmel_lcdfb_ops = { .owner =THIS_MODULE , .fb_check_var = atmel_lcdfb_check_var, .fb_set_par = atmel_lcdfb_set_par,
drivers/video/fbdev/aty/aty128fb.c +1 -1
@@ -509,7 +509,7 @@ static void aty128_bl_set_power(struct fb_info *info, int power); (readb(bios + (v) + 3) << 24)) -static struct fb_ops aty128fb_ops = { +static const struct fb_ops aty128fb_ops = { .owner =THIS_MODULE , .fb_check_var = aty128fb_check_var, .fb_set_par = aty128fb_set_par,
drivers/video/fbdev/aty/atyfb_base.c +1 -1
@@ -280,7 +280,7 @@ static const struct fb_videomode defmode = {0 ,FB_VMODE_NONINTERLACED }; -static struct fb_ops atyfb_ops = { +static const struct fb_ops atyfb_ops = { .owner =THIS_MODULE , .fb_open = atyfb_open, .fb_release = atyfb_release,
drivers/video/fbdev/aty/radeon_base.c +1 -1
@@ -1965,7 +1965,7 @@ static int radeonfb_set_par(struct fb_info *info) } -static struct fb_ops radeonfb_ops = { +static const struct fb_ops radeonfb_ops = { .owner =THIS_MODULE , .fb_check_var = radeonfb_check_var, .fb_set_par = radeonfb_set_par,
drivers/video/fbdev/au1100fb.c +1 -1
@@ -348,7 +348,7 @@ int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) fbdev->fb_len); } -static struct fb_ops au1100fb_ops = +static const struct fb_ops au1100fb_ops = { .owner =THIS_MODULE , .fb_setcolreg = au1100fb_fb_setcolreg,
drivers/video/fbdev/au1200fb.c +1 -1
@@ -1483,7 +1483,7 @@ static int au1200fb_ioctl(struct fb_info *info, unsigned int cmd, } -static struct fb_ops au1200fb_fb_ops = { +static const struct fb_ops au1200fb_fb_ops = { .owner =THIS_MODULE , .fb_check_var = au1200fb_fb_check_var, .fb_set_par = au1200fb_fb_set_par,
drivers/video/fbdev/broadsheetfb.c +1 -1
@@ -1048,7 +1048,7 @@ static ssize_t broadsheetfb_write(struct fb_info *info, const char __user *buf,return (err) ? err : count; } -static struct fb_ops broadsheetfb_ops = { +static const struct fb_ops broadsheetfb_ops = { .owner =THIS_MODULE , .fb_read = fb_sys_read, .fb_write = broadsheetfb_write,
drivers/video/fbdev/bw2.c +1 -1
@@ -37,7 +37,7 @@ static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long);* Frame buffer operations */ -static struct fb_ops bw2_ops = { +static const struct fb_ops bw2_ops = { .owner =THIS_MODULE , .fb_blank = bw2_blank, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/carminefb.c +1 -1
@@ -527,7 +527,7 @@ static int init_hardware(struct carmine_hw *hw)return 0 ; } -static struct fb_ops carminefb_ops = { +static const struct fb_ops carminefb_ops = { .owner =THIS_MODULE , .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea,
drivers/video/fbdev/cg14.c +1 -1
@@ -39,7 +39,7 @@ static int cg14_pan_display(struct fb_var_screeninfo *, struct fb_info *);* Frame buffer operations */ -static struct fb_ops cg14_ops = { +static const struct fb_ops cg14_ops = { .owner =THIS_MODULE , .fb_setcolreg = cg14_setcolreg, .fb_pan_display = cg14_pan_display,
drivers/video/fbdev/cg3.c +1 -1
@@ -39,7 +39,7 @@ static int cg3_ioctl(struct fb_info *, unsigned int, unsigned long);* Frame buffer operations */ -static struct fb_ops cg3_ops = { +static const struct fb_ops cg3_ops = { .owner =THIS_MODULE , .fb_setcolreg = cg3_setcolreg, .fb_blank = cg3_blank,
drivers/video/fbdev/cg6.c +1 -1
@@ -44,7 +44,7 @@ static int cg6_pan_display(struct fb_var_screeninfo *, struct fb_info *);* Frame buffer operations */ -static struct fb_ops cg6_ops = { +static const struct fb_ops cg6_ops = { .owner =THIS_MODULE , .fb_setcolreg = cg6_setcolreg, .fb_blank = cg6_blank,
drivers/video/fbdev/chipsfb.c +1 -1
@@ -79,7 +79,7 @@ static int chipsfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info);static int chipsfb_blank (int blank,struct fb_info *info); -static struct fb_ops chipsfb_ops = { +static const struct fb_ops chipsfb_ops = { .owner =THIS_MODULE , .fb_check_var = chipsfb_check_var, .fb_set_par = chipsfb_set_par,
drivers/video/fbdev/cirrusfb.c +1 -1
@@ -1956,7 +1956,7 @@ static void cirrusfb_zorro_unmap(struct fb_info *info)#endif /* CONFIG_ZORRO */ /* function table of the above functions */ -static struct fb_ops cirrusfb_ops = { +static const struct fb_ops cirrusfb_ops = { .owner =THIS_MODULE , .fb_open = cirrusfb_open, .fb_release = cirrusfb_release,
drivers/video/fbdev/clps711x-fb.c +1 -1
@@ -153,7 +153,7 @@ static int clps711x_fb_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops clps711x_fb_ops = { +static const struct fb_ops clps711x_fb_ops = { .owner =THIS_MODULE , .fb_setcolreg = clps711x_fb_setcolreg, .fb_check_var = clps711x_fb_check_var,
drivers/video/fbdev/cobalt_lcdfb.c +1 -1
@@ -269,7 +269,7 @@ static int cobalt_lcdfb_cursor(struct fb_info *info, struct fb_cursor *cursor)return 0 ; } -static struct fb_ops cobalt_lcd_fbops = { +static const struct fb_ops cobalt_lcd_fbops = { .owner =THIS_MODULE , .fb_read = cobalt_lcdfb_read, .fb_write = cobalt_lcdfb_write,
drivers/video/fbdev/controlfb.c +1 -1
@@ -157,7 +157,7 @@ static int default_vmode __initdata = VMODE_NVRAM;static int default_cmode__initdata =CMODE_NVRAM ; -static struct fb_ops controlfb_ops = { +static const struct fb_ops controlfb_ops = { .owner =THIS_MODULE , .fb_check_var = controlfb_check_var, .fb_set_par = controlfb_set_par,
drivers/video/fbdev/cyber2000fb.c +1 -1
@@ -1060,7 +1060,7 @@ static int cyber2000fb_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops cyber2000fb_ops = { +static const struct fb_ops cyber2000fb_ops = { .owner =THIS_MODULE , .fb_check_var = cyber2000fb_check_var, .fb_set_par = cyber2000fb_set_par,
drivers/video/fbdev/da8xx-fb.c +1 -1
@@ -1294,7 +1294,7 @@ static int da8xxfb_set_par(struct fb_info *info)return 0 ; } -static struct fb_ops da8xx_fb_ops = { +static const struct fb_ops da8xx_fb_ops = { .owner =THIS_MODULE , .fb_check_var = fb_check_var, .fb_set_par = da8xxfb_set_par,
drivers/video/fbdev/dnfb.c +1 -1
@@ -108,7 +108,7 @@static int dnfb_blank (int blank,struct fb_info *info);static void dnfb_copyarea (struct fb_info *info,const struct fb_copyarea *area); -static struct fb_ops dn_fb_ops = { +static const struct fb_ops dn_fb_ops = { .owner =THIS_MODULE , .fb_blank = dnfb_blank, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/efifb.c +1 -1
@@ -255,7 +255,7 @@ static void efifb_destroy(struct fb_info *info)fb_dealloc_cmap (&info->cmap); } -static struct fb_ops efifb_ops = { +static const struct fb_ops efifb_ops = { .owner =THIS_MODULE , .fb_destroy = efifb_destroy, .fb_setcolreg = efifb_setcolreg,
drivers/video/fbdev/ep93xx-fb.c +1 -1
@@ -402,7 +402,7 @@ static int ep93xxfb_setcolreg(unsigned int regno, unsigned int red,return 0 ; } -static struct fb_ops ep93xxfb_ops = { +static const struct fb_ops ep93xxfb_ops = { .owner =THIS_MODULE , .fb_check_var = ep93xxfb_check_var, .fb_set_par = ep93xxfb_set_par,
drivers/video/fbdev/fb-puv3.c +1 -1
@@ -644,7 +644,7 @@ int unifb_mmap(struct fb_info *info,return vm_iomap_memory (vma, info->fix.smem_start, info->fix.smem_len); } -static struct fb_ops unifb_ops = { +static const struct fb_ops unifb_ops = { .fb_read = fb_sys_read, .fb_write = fb_sys_write, .fb_check_var = unifb_check_var,
drivers/video/fbdev/ffb.c +1 -1
@@ -44,7 +44,7 @@ static int ffb_pan_display(struct fb_var_screeninfo *, struct fb_info *);* Frame buffer operations */ -static struct fb_ops ffb_ops = { +static const struct fb_ops ffb_ops = { .owner =THIS_MODULE , .fb_setcolreg = ffb_setcolreg, .fb_blank = ffb_blank,
drivers/video/fbdev/fm2fb.c +1 -1
@@ -165,7 +165,7 @@ static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info);static int fm2fb_blank (int blank,struct fb_info *info); -static struct fb_ops fm2fb_ops = { +static const struct fb_ops fm2fb_ops = { .owner =THIS_MODULE , .fb_setcolreg = fm2fb_setcolreg, .fb_blank = fm2fb_blank,
drivers/video/fbdev/fsl-diu-fb.c +1 -1
@@ -1448,7 +1448,7 @@ static int fsl_diu_release(struct fb_info *info, int user)return res; } -static struct fb_ops fsl_diu_ops = { +static const struct fb_ops fsl_diu_ops = { .owner =THIS_MODULE , .fb_check_var = fsl_diu_check_var, .fb_set_par = fsl_diu_set_par,
drivers/video/fbdev/g364fb.c +1 -1
@@ -111,7 +111,7 @@ static int g364fb_setcolreg(u_int regno, u_int red, u_int green,static int g364fb_cursor (struct fb_info *info,struct fb_cursor *cursor);static int g364fb_blank (int blank,struct fb_info *info); -static struct fb_ops g364fb_ops = { +static const struct fb_ops g364fb_ops = { .owner =THIS_MODULE , .fb_setcolreg = g364fb_setcolreg, .fb_pan_display = g364fb_pan_display,
drivers/video/fbdev/gbefb.c +1 -1
@@ -1044,7 +1044,7 @@ static int gbefb_mmap(struct fb_info *info,return 0 ; } -static struct fb_ops gbefb_ops = { +static const struct fb_ops gbefb_ops = { .owner =THIS_MODULE , .fb_check_var = gbefb_check_var, .fb_set_par = gbefb_set_par,
drivers/video/fbdev/geode/gx1fb_core.c +1 -1
@@ -252,7 +252,7 @@ static int parse_panel_option(struct fb_info *info)return 0 ; } -static struct fb_ops gx1fb_ops = { +static const struct fb_ops gx1fb_ops = { .owner =THIS_MODULE , .fb_check_var = gx1fb_check_var, .fb_set_par = gx1fb_set_par,
drivers/video/fbdev/geode/gxfb_core.c +1 -1
@@ -265,7 +265,7 @@ static int gxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev)return 0 ; } -static struct fb_ops gxfb_ops = { +static const struct fb_ops gxfb_ops = { .owner =THIS_MODULE , .fb_check_var = gxfb_check_var, .fb_set_par = gxfb_set_par,
drivers/video/fbdev/geode/lxfb_core.c +1 -1
@@ -386,7 +386,7 @@ static int lxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev)return 0 ; } -static struct fb_ops lxfb_ops = { +static const struct fb_ops lxfb_ops = { .owner =THIS_MODULE , .fb_check_var = lxfb_check_var, .fb_set_par = lxfb_set_par,
drivers/video/fbdev/goldfishfb.c +1 -1
@@ -160,7 +160,7 @@ static int goldfish_fb_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops goldfish_fb_ops = { +static const struct fb_ops goldfish_fb_ops = { .owner =THIS_MODULE , .fb_check_var = goldfish_fb_check_var, .fb_set_par = goldfish_fb_set_par,
drivers/video/fbdev/grvga.c +1 -1
@@ -251,7 +251,7 @@ static int grvga_pan_display(struct fb_var_screeninfo *var,return 0 ; } -static struct fb_ops grvga_ops = { +static const struct fb_ops grvga_ops = { .owner =THIS_MODULE , .fb_check_var = grvga_check_var, .fb_set_par = grvga_set_par,
drivers/video/fbdev/gxt4500.c +1 -1
@@ -599,7 +599,7 @@ static const struct fb_fix_screeninfo gxt4500_fix = { .mmio_len = 0x20000, }; -static struct fb_ops gxt4500_ops = { +static const struct fb_ops gxt4500_ops = { .owner =THIS_MODULE , .fb_check_var = gxt4500_check_var, .fb_set_par = gxt4500_set_par,
drivers/video/fbdev/hecubafb.c +1 -1
@@ -197,7 +197,7 @@ static ssize_t hecubafb_write(struct fb_info *info, const char __user *buf,return (err) ? err : count; } -static struct fb_ops hecubafb_ops = { +static const struct fb_ops hecubafb_ops = { .owner =THIS_MODULE , .fb_read = fb_sys_read, .fb_write = hecubafb_write,
drivers/video/fbdev/hgafb.c +1 -1
@@ -523,7 +523,7 @@ static void hgafb_imageblit(struct fb_info *info, const struct fb_image *image) } } -static struct fb_ops hgafb_ops = { +static const struct fb_ops hgafb_ops = { .owner =THIS_MODULE , .fb_open = hgafb_open, .fb_release = hgafb_release,
drivers/video/fbdev/hitfb.c +1 -1
@@ -311,7 +311,7 @@ static int hitfb_set_par(struct fb_info *info)return 0 ; } -static struct fb_ops hitfb_ops = { +static const struct fb_ops hitfb_ops = { .owner =THIS_MODULE , .fb_check_var = hitfb_check_var, .fb_set_par = hitfb_set_par,
drivers/video/fbdev/hpfb.c +1 -1
@@ -184,7 +184,7 @@ static int hpfb_sync(struct fb_info *info)return 0 ; } -static struct fb_ops hpfb_ops = { +static const struct fb_ops hpfb_ops = { .owner =THIS_MODULE , .fb_setcolreg = hpfb_setcolreg, .fb_blank = hpfb_blank,
drivers/video/fbdev/hyperv_fb.c +1 -1
@@ -623,7 +623,7 @@ static void hvfb_cfb_imageblit(struct fb_info *p,synthvid_update (p); } -static struct fb_ops hvfb_ops = { +static const struct fb_ops hvfb_ops = { .owner =THIS_MODULE , .fb_check_var = hvfb_check_var, .fb_set_par = hvfb_set_par,
drivers/video/fbdev/i740fb.c +1 -1
@@ -981,7 +981,7 @@ static int i740fb_blank(int blank_mode, struct fb_info *info)return (blank_mode ==FB_BLANK_NORMAL ) ?1 :0 ; } -static struct fb_ops i740fb_ops = { +static const struct fb_ops i740fb_ops = { .owner =THIS_MODULE , .fb_open = i740fb_open, .fb_release = i740fb_release,
drivers/video/fbdev/imsttfb.c +1 -1
@@ -1333,7 +1333,7 @@ static struct pci_driver imsttfb_pci_driver = { .remove = imsttfb_remove, }; -static struct fb_ops imsttfb_ops = { +static const struct fb_ops imsttfb_ops = { .owner =THIS_MODULE , .fb_check_var = imsttfb_check_var, .fb_set_par = imsttfb_set_par,
drivers/video/fbdev/imxfb.c +1 -1
@@ -566,7 +566,7 @@ static int imxfb_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops imxfb_ops = { +static const struct fb_ops imxfb_ops = { .owner =THIS_MODULE , .fb_check_var = imxfb_check_var, .fb_set_par = imxfb_set_par,
drivers/video/fbdev/intelfb/intelfbdrv.c +1 -1
@@ -193,7 +193,7 @@ static const struct pci_device_id intelfb_pci_table[] = {static int num_registered =0 ;/* fb ops */ -static struct fb_ops intel_fb_ops = { +static const struct fb_ops intel_fb_ops = { .owner =THIS_MODULE , .fb_open = intelfb_open, .fb_release = intelfb_release,
drivers/video/fbdev/kyro/fbdev.c +1 -1
@@ -648,7 +648,7 @@ static struct pci_driver kyrofb_pci_driver = { .remove = kyrofb_remove, }; -static struct fb_ops kyrofb_ops = { +static const struct fb_ops kyrofb_ops = { .owner =THIS_MODULE , .fb_check_var = kyrofb_check_var, .fb_set_par = kyrofb_set_par,
drivers/video/fbdev/leo.c +1 -1
@@ -39,7 +39,7 @@ static int leo_pan_display(struct fb_var_screeninfo *, struct fb_info *);* Frame buffer operations */ -static struct fb_ops leo_ops = { +static const struct fb_ops leo_ops = { .owner =THIS_MODULE , .fb_setcolreg = leo_setcolreg, .fb_blank = leo_blank,
drivers/video/fbdev/macfb.c +1 -1
@@ -496,7 +496,7 @@ static int macfb_setcolreg(unsigned regno, unsigned red, unsigned green,return 0 ; } -static struct fb_ops macfb_ops = { +static const struct fb_ops macfb_ops = { .owner =THIS_MODULE , .fb_setcolreg = macfb_setcolreg, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/matrox/matroxfb_crtc2.c +1 -1
@@ -563,7 +563,7 @@ static int matroxfb_dh_blank(int blank, struct fb_info* info) {#undef m2info } -static struct fb_ops matroxfb_dh_ops = { +static const struct fb_ops matroxfb_dh_ops = { .owner =THIS_MODULE , .fb_open = matroxfb_dh_open, .fb_release = matroxfb_dh_release,
drivers/video/fbdev/maxinefb.c +1 -1
@@ -105,7 +105,7 @@ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green,return 0 ; } -static struct fb_ops maxinefb_ops = { +static const struct fb_ops maxinefb_ops = { .owner =THIS_MODULE , .fb_setcolreg = maxinefb_setcolreg, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +1 -1
@@ -401,7 +401,7 @@ static int mb862xxfb_ioctl(struct fb_info *fbi, unsigned int cmd, }/* framebuffer ops */ -static struct fb_ops mb862xxfb_ops = { +static const struct fb_ops mb862xxfb_ops = { .owner =THIS_MODULE , .fb_check_var = mb862xxfb_check_var, .fb_set_par = mb862xxfb_set_par,
drivers/video/fbdev/mbx/mbxfb.c +1 -1
@@ -671,7 +671,7 @@ static int mbxfb_ioctl(struct fb_info *info, unsigned int cmd,return -EINVAL ; } -static struct fb_ops mbxfb_ops = { +static const struct fb_ops mbxfb_ops = { .owner =THIS_MODULE , .fb_check_var = mbxfb_check_var, .fb_set_par = mbxfb_set_par,
drivers/video/fbdev/metronomefb.c +1 -1
@@ -558,7 +558,7 @@ static ssize_t metronomefb_write(struct fb_info *info, const char __user *buf,return (err) ? err : count; } -static struct fb_ops metronomefb_ops = { +static const struct fb_ops metronomefb_ops = { .owner =THIS_MODULE , .fb_write = metronomefb_write, .fb_fillrect = metronomefb_fillrect,
drivers/video/fbdev/mmp/fb/mmpfb.c +1 -1
@@ -454,7 +454,7 @@ static int mmpfb_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops mmpfb_ops = { +static const struct fb_ops mmpfb_ops = { .owner =THIS_MODULE , .fb_blank = mmpfb_blank, .fb_check_var = mmpfb_check_var,
drivers/video/fbdev/mx3fb.c +3 -2
@@ -1249,7 +1249,7 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,* invoked by the core framebuffer driver to perform operations like * blitting, rectangle filling, copy regions and cursor definition. */ -static struct fb_ops mx3fb_ops = { +const static struct fb_ops mx3fb_ops = { .owner =THIS_MODULE , .fb_set_par = mx3fb_set_par, .fb_check_var = mx3fb_check_var,
@@ -1389,7 +1389,8 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi)* mx3fb_init_fbinfo() - initialize framebuffer information object. * @return: initialized framebuffer structure. */ -static struct fb_info *mx3fb_init_fbinfo (struct device *dev,struct fb_ops *ops) +static struct fb_info *mx3fb_init_fbinfo (struct device *dev, +const struct fb_ops *ops) {struct fb_info *fbi;struct mx3fb_info *mx3fbi;
drivers/video/fbdev/neofb.c +1 -1
@@ -1610,7 +1610,7 @@ neofb_cursor(struct fb_info *info, struct fb_cursor *cursor)} */ -static struct fb_ops neofb_ops = { +static const struct fb_ops neofb_ops = { .owner =THIS_MODULE , .fb_open = neofb_open, .fb_release = neofb_release,
drivers/video/fbdev/nvidia/nvidia.c +1 -1
@@ -1024,7 +1024,7 @@ static int nvidiafb_release(struct fb_info *info, int user)return err; } -static struct fb_ops nvidia_fb_ops = { +static const struct fb_ops nvidia_fb_ops = { .owner =THIS_MODULE , .fb_open = nvidiafb_open, .fb_release = nvidiafb_release,
drivers/video/fbdev/ocfb.c +1 -1
@@ -285,7 +285,7 @@ static int ocfb_init_var(struct ocfb_dev *fbdev)return 0 ; } -static struct fb_ops ocfb_ops = { +static const struct fb_ops ocfb_ops = { .owner =THIS_MODULE , .fb_setcolreg = ocfb_setcolreg, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/offb.c +1 -1
@@ -286,7 +286,7 @@ static void offb_destroy(struct fb_info *info)framebuffer_release (info); } -static struct fb_ops offb_ops = { +static const struct fb_ops offb_ops = { .owner =THIS_MODULE , .fb_destroy = offb_destroy, .fb_setcolreg = offb_setcolreg,
drivers/video/fbdev/omap2/omapfb/omapfb-main.c +1 -1
@@ -1280,7 +1280,7 @@ ssize_t omapfb_write(struct fb_info *info, const char __user *buf, }#endif -static struct fb_ops omapfb_ops = { +static const struct fb_ops omapfb_ops = { .owner =THIS_MODULE , .fb_open = omapfb_open, .fb_release = omapfb_release,
drivers/video/fbdev/p9100.c +1 -1
@@ -37,7 +37,7 @@ static int p9100_ioctl(struct fb_info *, unsigned int, unsigned long);* Frame buffer operations */ -static struct fb_ops p9100_ops = { +static const struct fb_ops p9100_ops = { .owner =THIS_MODULE , .fb_setcolreg = p9100_setcolreg, .fb_blank = p9100_blank,
drivers/video/fbdev/platinumfb.c +1 -1
@@ -96,7 +96,7 @@ static int platinum_var_to_par(struct fb_var_screeninfo *var,* Interface used by the world */ -static struct fb_ops platinumfb_ops = { +static const struct fb_ops platinumfb_ops = { .owner =THIS_MODULE , .fb_check_var = platinumfb_check_var, .fb_set_par = platinumfb_set_par,
drivers/video/fbdev/pm2fb.c +1 -1
@@ -1483,7 +1483,7 @@ static int pm2fb_cursor(struct fb_info *info, struct fb_cursor *cursor)* Frame buffer operations */ -static struct fb_ops pm2fb_ops = { +static const struct fb_ops pm2fb_ops = { .owner =THIS_MODULE , .fb_check_var = pm2fb_check_var, .fb_set_par = pm2fb_set_par,
drivers/video/fbdev/pm3fb.c +1 -1
@@ -1200,7 +1200,7 @@ static int pm3fb_blank(int blank_mode, struct fb_info *info)* Frame buffer operations */ -static struct fb_ops pm3fb_ops = { +static const struct fb_ops pm3fb_ops = { .owner =THIS_MODULE , .fb_check_var = pm3fb_check_var, .fb_set_par = pm3fb_set_par,
drivers/video/fbdev/pmag-aa-fb.c +1 -1
@@ -147,7 +147,7 @@ static int aafb_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops aafb_ops = { +static const struct fb_ops aafb_ops = { .owner =THIS_MODULE , .fb_blank = aafb_blank, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/pmag-ba-fb.c +1 -1
@@ -117,7 +117,7 @@ static int pmagbafb_setcolreg(unsigned int regno, unsigned int red,return 0 ; } -static struct fb_ops pmagbafb_ops = { +static const struct fb_ops pmagbafb_ops = { .owner =THIS_MODULE , .fb_setcolreg = pmagbafb_setcolreg, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/pmagb-b-fb.c +1 -1
@@ -121,7 +121,7 @@ static int pmagbbfb_setcolreg(unsigned int regno, unsigned int red,return 0 ; } -static struct fb_ops pmagbbfb_ops = { +static const struct fb_ops pmagbbfb_ops = { .owner =THIS_MODULE , .fb_setcolreg = pmagbbfb_setcolreg, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/ps3fb.c +1 -1
@@ -934,7 +934,7 @@ static irqreturn_t ps3fb_vsync_interrupt(int irq, void *ptr) } -static struct fb_ops ps3fb_ops = { +static const struct fb_ops ps3fb_ops = { .fb_open = ps3fb_open, .fb_release = ps3fb_release, .fb_read = fb_sys_read,
drivers/video/fbdev/pvr2fb.c +1 -1
@@ -707,7 +707,7 @@ static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, }#endif /* CONFIG_PVR2_DMA */ -static struct fb_ops pvr2fb_ops = { +static const struct fb_ops pvr2fb_ops = { .owner =THIS_MODULE , .fb_setcolreg = pvr2fb_setcolreg, .fb_blank = pvr2fb_blank,
drivers/video/fbdev/pxa168fb.c +1 -1
@@ -545,7 +545,7 @@ static irqreturn_t pxa168fb_handle_irq(int irq, void *dev_id)return IRQ_NONE ; } -static struct fb_ops pxa168fb_ops = { +static const struct fb_ops pxa168fb_ops = { .owner =THIS_MODULE , .fb_check_var = pxa168fb_check_var, .fb_set_par = pxa168fb_set_par,
drivers/video/fbdev/pxafb.c +2 -2
@@ -597,7 +597,7 @@ static int pxafb_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops pxafb_ops = { +static const struct fb_ops pxafb_ops = { .owner =THIS_MODULE , .fb_check_var = pxafb_check_var, .fb_set_par = pxafb_set_par,
@@ -865,7 +865,7 @@ static int overlayfb_set_par(struct fb_info *info)return 0 ; } -static struct fb_ops overlay_fb_ops = { +static const struct fb_ops overlay_fb_ops = { .owner =THIS_MODULE , .fb_open = overlayfb_open, .fb_release = overlayfb_release,
drivers/video/fbdev/q40fb.c +1 -1
@@ -75,7 +75,7 @@ static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green,return 0 ; } -static struct fb_ops q40fb_ops = { +static const struct fb_ops q40fb_ops = { .owner =THIS_MODULE , .fb_setcolreg = q40fb_setcolreg, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/riva/fbdev.c +1 -1
@@ -1673,7 +1673,7 @@ static int rivafb_sync(struct fb_info *info)* ------------------------------------------------------------------------- */ /* kernel interface */ -static struct fb_ops riva_fb_ops = { +static const struct fb_ops riva_fb_ops = { .owner =THIS_MODULE , .fb_open = rivafb_open, .fb_release = rivafb_release,
drivers/video/fbdev/s3c-fb.c +1 -1
@@ -1035,7 +1035,7 @@ static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd,return ret; } -static struct fb_ops s3c_fb_ops = { +static const struct fb_ops s3c_fb_ops = { .owner =THIS_MODULE , .fb_check_var = s3c_fb_check_var, .fb_set_par = s3c_fb_set_par,
drivers/video/fbdev/s3c2410fb.c +1 -1
@@ -618,7 +618,7 @@ static int s3c2410fb_debug_store(struct device *dev, static DEVICE_ATTR(debug, 0664, s3c2410fb_debug_show, s3c2410fb_debug_store); -static struct fb_ops s3c2410fb_ops = { +static const struct fb_ops s3c2410fb_ops = { .owner =THIS_MODULE , .fb_check_var = s3c2410fb_check_var, .fb_set_par = s3c2410fb_set_par,
drivers/video/fbdev/s3fb.c +1 -1
@@ -1037,7 +1037,7 @@ static int s3fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)/* Frame buffer operations */ -static struct fb_ops s3fb_ops = { +static const struct fb_ops s3fb_ops = { .owner =THIS_MODULE , .fb_open = s3fb_open, .fb_release = s3fb_release,
drivers/video/fbdev/sa1100fb.c +1 -1
@@ -574,7 +574,7 @@ static int sa1100fb_mmap(struct fb_info *info,return vm_iomap_memory (vma, info->fix.mmio_start, info->fix.mmio_len); } -static struct fb_ops sa1100fb_ops = { +static const struct fb_ops sa1100fb_ops = { .owner =THIS_MODULE , .fb_check_var = sa1100fb_check_var, .fb_set_par = sa1100fb_set_par,
drivers/video/fbdev/savage/savagefb_driver.c +1 -1
@@ -1637,7 +1637,7 @@ static int savagefb_release(struct fb_info *info, int user)return 0 ; } -static struct fb_ops savagefb_ops = { +static const struct fb_ops savagefb_ops = { .owner =THIS_MODULE , .fb_open = savagefb_open, .fb_release = savagefb_release,
drivers/video/fbdev/sh7760fb.c +1 -1
@@ -341,7 +341,7 @@ static int sh7760fb_set_par(struct fb_info *info)return 0 ; } -static struct fb_ops sh7760fb_ops = { +static const struct fb_ops sh7760fb_ops = { .owner =THIS_MODULE , .fb_blank = sh7760fb_blank, .fb_check_var = sh7760fb_check_var,
drivers/video/fbdev/sh_mobile_lcdcfb.c +2 -2
@@ -1490,7 +1490,7 @@ sh_mobile_lcdc_overlay_mmap(struct fb_info *info, struct vm_area_struct *vma) ovl->dma_handle, ovl->fb_size); } -static struct fb_ops sh_mobile_lcdc_overlay_ops = { +static const struct fb_ops sh_mobile_lcdc_overlay_ops = { .owner =THIS_MODULE , .fb_read = fb_sys_read, .fb_write = fb_sys_write,
@@ -1964,7 +1964,7 @@ sh_mobile_lcdc_mmap(struct fb_info *info, struct vm_area_struct *vma) ch->dma_handle, ch->fb_size); } -static struct fb_ops sh_mobile_lcdc_ops = { +static const struct fb_ops sh_mobile_lcdc_ops = { .owner =THIS_MODULE , .fb_setcolreg = sh_mobile_lcdc_setcolreg, .fb_read = fb_sys_read,
drivers/video/fbdev/simplefb.c +1 -1
@@ -78,7 +78,7 @@ static void simplefb_destroy(struct fb_info *info)iounmap (info->screen_base); } -static struct fb_ops simplefb_ops = { +static const struct fb_ops simplefb_ops = { .owner =THIS_MODULE , .fb_destroy = simplefb_destroy, .fb_setcolreg = simplefb_setcolreg,
drivers/video/fbdev/sis/sis_main.c +1 -1
@@ -1906,7 +1906,7 @@ sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)/* ---------------- fb_ops structures ----------------- */ -static struct fb_ops sisfb_ops = { +static const struct fb_ops sisfb_ops = { .owner =THIS_MODULE , .fb_open = sisfb_open, .fb_release = sisfb_release,
drivers/video/fbdev/skeletonfb.c +1 -1
@@ -634,7 +634,7 @@ int xxxfb_sync(struct fb_info *info)* Frame buffer operations */ -static struct fb_ops xxxfb_ops = { +static const struct fb_ops xxxfb_ops = { .owner =THIS_MODULE , .fb_open = xxxfb_open, .fb_read = xxxfb_read,
drivers/video/fbdev/sm712fb.c +1 -1
@@ -1369,7 +1369,7 @@ static int smtc_set_par(struct fb_info *info)return 0 ; } -static struct fb_ops smtcfb_ops = { +static const struct fb_ops smtcfb_ops = { .owner =THIS_MODULE , .fb_check_var = smtc_check_var, .fb_set_par = smtc_set_par,
drivers/video/fbdev/ssd1307fb.c +1 -1
@@ -280,7 +280,7 @@ static void ssd1307fb_imageblit(struct fb_info *info, const struct fb_image *imassd1307fb_update_display (par); } -static struct fb_ops ssd1307fb_ops = { +static const struct fb_ops ssd1307fb_ops = { .owner =THIS_MODULE , .fb_read = fb_sys_read, .fb_write = ssd1307fb_write,
drivers/video/fbdev/sstfb.c +1 -1
@@ -1307,7 +1307,7 @@ static int sstfb_setup(char *options) } -static struct fb_ops sstfb_ops = { +static const struct fb_ops sstfb_ops = { .owner =THIS_MODULE , .fb_check_var = sstfb_check_var, .fb_set_par = sstfb_set_par,
drivers/video/fbdev/stifb.c +1 -1
@@ -1101,7 +1101,7 @@ stifb_init_display(struct stifb_info *fb)/* ------------ Interfaces to hardware functions ------------ */ -static struct fb_ops stifb_ops = { +static const struct fb_ops stifb_ops = { .owner =THIS_MODULE , .fb_setcolreg = stifb_setcolreg, .fb_blank = stifb_blank,
drivers/video/fbdev/sunxvr1000.c +1 -1
@@ -59,7 +59,7 @@ static int gfb_setcolreg(unsigned regno,return 0 ; } -static struct fb_ops gfb_ops = { +static const struct fb_ops gfb_ops = { .owner =THIS_MODULE , .fb_setcolreg = gfb_setcolreg, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/sunxvr2500.c +1 -1
@@ -63,7 +63,7 @@ static int s3d_setcolreg(unsigned regno,return 0 ; } -static struct fb_ops s3d_ops = { +static const struct fb_ops s3d_ops = { .owner =THIS_MODULE , .fb_setcolreg = s3d_setcolreg, .fb_fillrect = cfb_fillrect,
drivers/video/fbdev/sunxvr500.c +1 -1
@@ -186,7 +186,7 @@ static void e3d_copyarea(struct fb_info *info, const struct fb_copyarea *area)spin_unlock_irqrestore (&ep->lock, flags); } -static struct fb_ops e3d_ops = { +static const struct fb_ops e3d_ops = { .owner =THIS_MODULE , .fb_setcolreg = e3d_setcolreg, .fb_fillrect = e3d_fillrect,
drivers/video/fbdev/tcx.c +1 -1
@@ -40,7 +40,7 @@ static int tcx_pan_display(struct fb_var_screeninfo *, struct fb_info *);* Frame buffer operations */ -static struct fb_ops tcx_ops = { +static const struct fb_ops tcx_ops = { .owner =THIS_MODULE , .fb_setcolreg = tcx_setcolreg, .fb_blank = tcx_blank,
drivers/video/fbdev/tdfxfb.c +1 -1
@@ -1141,7 +1141,7 @@ static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor)return 0 ; } -static struct fb_ops tdfxfb_ops = { +static const struct fb_ops tdfxfb_ops = { .owner =THIS_MODULE , .fb_check_var = tdfxfb_check_var, .fb_set_par = tdfxfb_set_par,
drivers/video/fbdev/tgafb.c +1 -1
@@ -70,7 +70,7 @@ static struct tc_driver tgafb_tc_driver;* Frame buffer operations */ -static struct fb_ops tgafb_ops = { +static const struct fb_ops tgafb_ops = { .owner =THIS_MODULE , .fb_check_var = tgafb_check_var, .fb_set_par = tgafb_set_par,
drivers/video/fbdev/tmiofb.c +1 -1
@@ -646,7 +646,7 @@ static int tmiofb_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops tmiofb_ops = { +static const struct fb_ops tmiofb_ops = { .owner =THIS_MODULE , .fb_ioctl = tmiofb_ioctl,
drivers/video/fbdev/tridentfb.c +1 -1
@@ -1443,7 +1443,7 @@ static int tridentfb_blank(int blank_mode, struct fb_info *info)return (blank_mode ==FB_BLANK_NORMAL ) ?1 :0 ; } -static struct fb_ops tridentfb_ops = { +static const struct fb_ops tridentfb_ops = { .owner =THIS_MODULE , .fb_setcolreg = tridentfb_setcolreg, .fb_pan_display = tridentfb_pan_display,
drivers/video/fbdev/uvesafb.c +1 -1
@@ -1410,7 +1410,7 @@ static int uvesafb_check_var(struct fb_var_screeninfo *var,return 0 ; } -static struct fb_ops uvesafb_ops = { +static const struct fb_ops uvesafb_ops = { .owner =THIS_MODULE , .fb_open = uvesafb_open, .fb_release = uvesafb_release,
drivers/video/fbdev/valkyriefb.c +1 -1
@@ -113,7 +113,7 @@ static int valkyrie_init_info(struct fb_info *info, struct fb_info_valkyrie *p);static void valkyrie_par_to_fix (struct fb_par_valkyrie *par,struct fb_fix_screeninfo *fix);static void valkyrie_init_fix (struct fb_fix_screeninfo *fix,struct fb_info_valkyrie *p); -static struct fb_ops valkyriefb_ops = { +static const struct fb_ops valkyriefb_ops = { .owner =THIS_MODULE , .fb_check_var = valkyriefb_check_var, .fb_set_par = valkyriefb_set_par,
drivers/video/fbdev/vfb.c +1 -1
@@ -78,7 +78,7 @@ static int vfb_pan_display(struct fb_var_screeninfo *var,static int vfb_mmap (struct fb_info *info,struct vm_area_struct *vma); -static struct fb_ops vfb_ops = { +static const struct fb_ops vfb_ops = { .fb_read = fb_sys_read, .fb_write = fb_sys_write, .fb_check_var = vfb_check_var,
drivers/video/fbdev/vga16fb.c +1 -1
@@ -1270,7 +1270,7 @@ static void vga16fb_destroy(struct fb_info *info)framebuffer_release (info); } -static struct fb_ops vga16fb_ops = { +static const struct fb_ops vga16fb_ops = { .owner =THIS_MODULE , .fb_open = vga16fb_open, .fb_release = vga16fb_release,
drivers/video/fbdev/vt8500lcdfb.c +1 -1
@@ -238,7 +238,7 @@ static int vt8500lcd_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops vt8500lcd_ops = { +static const struct fb_ops vt8500lcd_ops = { .owner =THIS_MODULE , .fb_set_par = vt8500lcd_set_par, .fb_setcolreg = vt8500lcd_setcolreg,
drivers/video/fbdev/vt8623fb.c +1 -1
@@ -634,7 +634,7 @@ static int vt8623fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *i/* Frame buffer operations */ -static struct fb_ops vt8623fb_ops = { +static const struct fb_ops vt8623fb_ops = { .owner =THIS_MODULE , .fb_open = vt8623fb_open, .fb_release = vt8623fb_release,
drivers/video/fbdev/w100fb.c +1 -1
@@ -549,7 +549,7 @@ static int w100fb_set_par(struct fb_info *info)/* * Frame buffer operations */ -static struct fb_ops w100fb_ops = { +static const struct fb_ops w100fb_ops = { .owner =THIS_MODULE , .fb_check_var = w100fb_check_var, .fb_set_par = w100fb_set_par,
drivers/video/fbdev/wm8505fb.c +1 -1
@@ -246,7 +246,7 @@ static int wm8505fb_blank(int blank, struct fb_info *info)return 0 ; } -static struct fb_ops wm8505fb_ops = { +static const struct fb_ops wm8505fb_ops = { .owner =THIS_MODULE , .fb_set_par = wm8505fb_set_par, .fb_setcolreg = wm8505fb_setcolreg,
drivers/video/fbdev/xen-fbfront.c +1 -1
@@ -328,7 +328,7 @@ static int xenfb_set_par(struct fb_info *info)return 0 ; } -static struct fb_ops xenfb_fb_ops = { +static const struct fb_ops xenfb_fb_ops = { .owner =THIS_MODULE , .fb_read = fb_sys_read, .fb_write = xenfb_write,
drivers/video/fbdev/xilinxfb.c +1 -1
@@ -247,7 +247,7 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi)return 0 ;/* success */ } -static struct fb_ops xilinxfb_ops = { +static const struct fb_ops xilinxfb_ops = { .owner =THIS_MODULE , .fb_setcolreg = xilinx_fb_setcolreg, .fb_blank = xilinx_fb_blank,
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 11/13 HID: picoLCD: constify fb ops
In reply to Jani NikulaNow that the fbops member of struct fb_info is const, we can star making the ops const as well.
--- drivers/hid/hid-picolcd_fb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hid/hid-picolcd_fb.c +1 -2
@@ -417,8 +417,7 @@ static int picolcd_set_par(struct fb_info *info)return 0 ; } -/* Note this can't be const because of struct fb_info definition */ -static struct fb_ops picolcdfb_ops = { +static const struct fb_ops picolcdfb_ops = { .owner =THIS_MODULE , .fb_destroy = picolcd_fb_destroy, .fb_read = fb_sys_read,
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 12/13 media: constify fb ops across all drivers
In reply to Jani NikulaNow that the fbops member of struct fb_info is const, we can star making the ops const as well.
--- drivers/media/pci/ivtv/ivtvfb.c | 3 +-- drivers/media/platform/vivid/vivid-osd.c | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/media/pci/ivtv/ivtvfb.c +1 -2
@@ -925,7 +925,7 @@ static int ivtvfb_blank(int blank_mode, struct fb_info *info)return 0 ; } -static struct fb_ops ivtvfb_ops = { +static const struct fb_ops ivtvfb_ops = { .owner =THIS_MODULE , .fb_write = ivtvfb_write, .fb_check_var = ivtvfb_check_var,
@@ -1049,7 +1049,6 @@ static int ivtvfb_init_vidmode(struct ivtv *itv) oi->ivtvfb_info.node =-1 ; oi->ivtvfb_info.flags =FBINFO_FLAG_DEFAULT ; - oi->ivtvfb_info.fbops = &ivtvfb_ops; oi->ivtvfb_info.par = itv; oi->ivtvfb_info.var = oi->ivtvfb_defined; oi->ivtvfb_info.fix = oi->ivtvfb_fix;
drivers/media/platform/vivid/vivid-osd.c +0 -1
@@ -311,7 +311,6 @@ static int vivid_fb_init_vidmode(struct vivid_dev *dev) dev->fb_info.node =-1 ; dev->fb_info.flags =FBINFO_FLAG_DEFAULT ; - dev->fb_info.fbops = &vivid_fb_ops; dev->fb_info.par = dev; dev->fb_info.var = dev->fb_defined; dev->fb_info.fix = dev->fb_fix;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 13/13 samples: vfio-mdev: constify fb ops
In reply to Jani NikulaNow that the fbops member of struct fb_info is const, we can star making the ops const as well.
--- samples/vfio-mdev/mdpy-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
samples/vfio-mdev/mdpy-fb.c +1 -1
@@ -86,7 +86,7 @@ static void mdpy_fb_destroy(struct fb_info *info)iounmap (info->screen_base); } -static struct fb_ops mdpy_fb_ops = { +static const struct fb_ops mdpy_fb_ops = { .owner =THIS_MODULE , .fb_destroy = mdpy_fb_destroy, .fb_setcolreg = mdpy_fb_setcolreg,
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
Quoted 6 lines · Jani Nikula
Now that the fbops member of struct
fb_infois const, we can star making the ops const as well.Cc Kirti Wankhede <[email protected]>Signed-off-by Jani Nikula <[email protected]>
You've missed at least drivers/staging/fbtft in your search. I guess you need to do a full make allyesconfig on x86/arm and arm64 (the latter because some stupid drivers only compile there, not on arm, don't ask). Still misses a pile of mips/ppc only stuff and maybe the sparcs and alphas, but should be good enough.
With that done, on the remaining patches:
Quoted 24 lines
--- samples/vfio-mdev/mdpy-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)samples/vfio-mdev/mdpy-fb.c +1
-1@@ -86,7 +86,7 @@ static void mdpy_fb_destroy(struct fb_info *info)iounmap (info->screen_base); } -static struct fb_ops mdpy_fb_ops = { +static const struct fb_ops mdpy_fb_ops = { .owner =THIS_MODULE , .fb_destroy = mdpy_fb_destroy, .fb_setcolreg = mdpy_fb_setcolreg,Signature · 6 lines
2.20.1 _______________________________________________ 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 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
Quoted 8 lines · Daniel Vetter
Quoted 6 lines · Jani Nikula
Now that the fbops member of struct
fb_infois const, we can star making the ops const as well.Cc Kirti Wankhede <[email protected]>Signed-off-by Jani Nikula <[email protected]>
Quoted 5 lines
You've missed at least
drivers/staging/fbtftin your search. I guess you need to do a full make allyesconfig on x86/arm and arm64 (the latter because some stupid drivers only compile there, not on arm, don't ask). Still misses a pile of mips/ppc only stuff and maybe the sparcs and alphas, but should be good enough.
fbtft dynamically allocates the fbops, for whatever reason. There were others like that too. Some of the drivers modify the fbops runtime to choose different hooks for different configurations. Can't change them all anyway.
Facilitating making the fbops const is one thing (patches 1-8), but I'm not really sure I want to sign up for exhaustively moving fbops to rodata on anything beyond drivers/gpu/drm. It's not like I leave stuff broken. Besides I am trying to cover all the low hanging fruit where I can simply add the "const" and be done with it.
BR,
Jani.
Quoted 29 lines
With that done, on the remaining patches:
Reviewed-by Daniel Vetter <[email protected]>Quoted 24 lines
--- samples/vfio-mdev/mdpy-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)samples/vfio-mdev/mdpy-fb.c +1
-1@@ -86,7 +86,7 @@ static void mdpy_fb_destroy(struct fb_info *info)iounmap (info->screen_base); } -static struct fb_ops mdpy_fb_ops = { +static const struct fb_ops mdpy_fb_ops = { .owner =THIS_MODULE , .fb_destroy = mdpy_fb_destroy, .fb_setcolreg = mdpy_fb_setcolreg,Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
Quoted 20 lines · Jani Nikula
Quoted 8 lines · Daniel Vetter
Quoted 6 lines · Jani Nikula
Now that the fbops member of struct
fb_infois const, we can star making the ops const as well.Cc Kirti Wankhede <[email protected]>Signed-off-by Jani Nikula <[email protected]>Quoted 5 lines
You've missed at least
drivers/staging/fbtftin your search. I guess you need to do a full make allyesconfig on x86/arm and arm64 (the latter because some stupid drivers only compile there, not on arm, don't ask). Still misses a pile of mips/ppc only stuff and maybe the sparcs and alphas, but should be good enough.fbtft dynamically allocates the fbops, for whatever reason. There were others like that too. Some of the drivers modify the fbops runtime to choose different hooks for different configurations. Can't change them all anyway.
Quoted 5 lines
Facilitating making the fbops const is one thing (patches 1-8), but I'm not really sure I want to sign up for exhaustively moving fbops to rodata on anything beyond
drivers/gpu/drm. It's not like I leave stuff broken. Besides I am trying to cover all the low hanging fruit where I can simply add the "const" and be done with it.
Uh indeed, I didn't check the output of my grep with sufficient finesses. r-b as-is on that pile.
Since fbdev is officially in drm-misc you can just merge it all once the prep is done - feels silly not to when you've done the work already. -Daniel
Quoted 36 lines
BR,
Jani.Quoted 29 lines
With that done, on the remaining patches:
Reviewed-by Daniel Vetter <[email protected]>Quoted 24 lines
--- samples/vfio-mdev/mdpy-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)samples/vfio-mdev/mdpy-fb.c +1
-1@@ -86,7 +86,7 @@ static void mdpy_fb_destroy(struct fb_info *info)iounmap (info->screen_base); } -static struct fb_ops mdpy_fb_ops = { +static const struct fb_ops mdpy_fb_ops = { .owner =THIS_MODULE , .fb_destroy = mdpy_fb_destroy, .fb_setcolreg = mdpy_fb_setcolreg,Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
In reply to Jani NikulaQuoted 5 lines · Jani Nikula
Now that the fbops member of struct
fb_infois const, we can star making
s/star/start/
Quoted 25 lines
the ops const as well.
Cc Kirti Wankhede <[email protected]>Signed-off-by Jani Nikula <[email protected]>---
samples/vfio-mdev/mdpy-fb.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)samples/vfio-mdev/mdpy-fb.c +1
-1@@ -86,7 +86,7 @@ static void mdpy_fb_destroy(struct fb_info *info)iounmap (info->screen_base); } -static struct fb_ops mdpy_fb_ops = { +static const struct fb_ops mdpy_fb_ops = { .owner =THIS_MODULE , .fb_destroy = mdpy_fb_destroy, .fb_setcolreg = mdpy_fb_setcolreg,Signature · 1 line
2.20.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
Quoted 4 lines · Christophe de Dinechin
Quoted 3 lines · Jani Nikula
Now that the fbops member of struct
fb_infois const, we can star makings/star/start/
Ooops, thanks.
BR,
Jani.
Quoted 27 lines
Quoted 26 lines
the ops const as well.
Cc Kirti Wankhede <[email protected]>Signed-off-by Jani Nikula <[email protected]>---
samples/vfio-mdev/mdpy-fb.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)samples/vfio-mdev/mdpy-fb.c +1
-1@@ -86,7 +86,7 @@ static void mdpy_fb_destroy(struct fb_info *info)iounmap (info->screen_base); } -static struct fb_ops mdpy_fb_ops = { +static const struct fb_ops mdpy_fb_ops = { .owner =THIS_MODULE , .fb_destroy = mdpy_fb_destroy, .fb_setcolreg = mdpy_fb_setcolreg,Signature · 1 line
2.20.1
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for video, drm: constify fbops in struct fb_info
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: video, drm: constify fbops in struct fb_info
URL : https://patchwork.freedesktop.org/series/70119/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip a9312755bd82 video: fb_defio: preserve user fb_ops -:93: CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #93: FILE: include/linux/fb.h:662: +extern int fb_deferred_io_init(struct fb_info *info);
total: 0 errors, 0 warnings, 1 checks, 63 lines checked cf928543bfcb drm/fb-helper: don't preserve fb_ops across deferred IO use e515c9d3f15d video: smscufx: don't restore fb_mmap after deferred IO cleanup ad46cac3c0e3 video: udlfb: don't restore fb_mmap after deferred IO cleanup 460ff53fe566 video: fbdev: vesafb: modify the static fb_ops directly 05fc2b33565c video: fbmem: use const pointer for fb_ops f0f669a03d49 video: omapfb: use const pointer for fb_ops 5fae561dc75e video: fbdev: make fbops member of struct fb_info a const pointer 74779cba2dfc drm: constify fb ops across all drivers841a383b2ff8 video: constify fb ops across all drivers c8ce711c9998 HID: picoLCD: constify fb opsa7314310fb66 media: constify fb ops across all drivers ea51beeaf182 samples: vfio-mdev: constify fb ops
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for video, drm: constify fbops in struct fb_info
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: video, drm: constify fbops in struct fb_info
URL : https://patchwork.freedesktop.org/series/70119/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_7434 -> Patchwork_15470
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/index.html
Known issues
------------
Here are the changes found in Patchwork_15470 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live_blt:
- fi-bsw-nick: [PASS][1] -> [DMESG-FAIL][2] ([fdo#112176])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7434/fi-bsw-nick/igt@i915_selftest@live_blt.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/fi-bsw-nick/igt@i915_selftest@live_blt.html
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [PASS][3] -> [FAIL][4] ([fdo#111045] / [fdo#111096])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7434/fi-kbl-7500u/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/fi-kbl-7500u/igt@[email protected]
#### Possible fixes ####
* igt@i915_module_load@reload-no-display:
- fi-skl-lmem: [DMESG-WARN][5] ([fdo#112261]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7434/fi-skl-lmem/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/fi-skl-lmem/igt@[email protected]
* igt@i915_module_load@reload-with-fault-injection:
- fi-icl-u3: [INCOMPLETE][7] ([fdo#107713]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7434/fi-icl-u3/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/fi-icl-u3/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: [DMESG-WARN][9] ([fdo#112261]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7434/fi-skl-6770hq/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/fi-skl-6770hq/igt@[email protected]
* igt@i915_selftest@live_blt:
- fi-hsw-peppy: [DMESG-FAIL][11] ([fdo#112147]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7434/fi-hsw-peppy/igt@i915_selftest@live_blt.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/fi-hsw-peppy/igt@i915_selftest@live_blt.html
#### Warnings ####
* igt@gem_exec_suspend@basic-s4-devices:
- fi-kbl-x1275: [DMESG-WARN][13] ([fdo#103558] / [fdo#105602] / [fdo#107139]) -> [DMESG-WARN][14] ([fdo#103558] / [fdo#105602] / [fdo#105763] / [fdo#107139])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7434/fi-kbl-x1275/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/fi-kbl-x1275/igt@[email protected]
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-kbl-x1275: [DMESG-WARN][15] ([fdo#103558] / [fdo#105602] / [fdo#105763]) -> [DMESG-WARN][16] ([fdo#103558] / [fdo#105602]) +4 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7434/fi-kbl-x1275/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/fi-kbl-x1275/igt@[email protected]
* igt@kms_cursor_legacy@basic-flip-before-cursor-legacy:
- fi-kbl-x1275: [DMESG-WARN][17] ([fdo#103558] / [fdo#105602]) -> [DMESG-WARN][18] ([fdo#103558] / [fdo#105602] / [fdo#105763])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7434/fi-kbl-x1275/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/fi-kbl-x1275/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#107139]: https://bugs.freedesktop.org/show_bug.cgi?id=107139
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#109964]: https://bugs.freedesktop.org/show_bug.cgi?id=109964
[fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045
[fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
[fdo#112147]: https://bugs.freedesktop.org/show_bug.cgi?id=112147
[fdo#112176]: https://bugs.freedesktop.org/show_bug.cgi?id=112176
[fdo#112261]: https://bugs.freedesktop.org/show_bug.cgi?id=112261
[fdo#112298]: https://bugs.freedesktop.org/show_bug.cgi?id=112298
Participating hosts (52 -> 45)
------------------------------
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_7434 -> Patchwork_15470
CI-20190529: 20190529
CI_DRM_7434: 1bbc4d30ca9fd950cbcb73f324e00d0bc357758e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5312: 851c75531043cd906e028632b64b02b9312e9945 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15470: ea51beeaf182bd646076b689b05607ceb88850fc @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
ea51beeaf182 samples: vfio-mdev: constify fb opsa7314310fb66 media: constify fb ops across all drivers c8ce711c9998 HID: picoLCD: constify fb ops841a383b2ff8 video: constify fb ops across all drivers 74779cba2dfc drm: constify fb ops across all drivers5fae561dc75e video: fbdev: make fbops member of struct fb_info a const pointer f0f669a03d49 video: omapfb: use const pointer for fb_ops 05fc2b33565c video: fbmem: use const pointer for fb_ops 460ff53fe566 video: fbdev: vesafb: modify the static fb_ops directly ad46cac3c0e3 video: udlfb: don't restore fb_mmap after deferred IO cleanup e515c9d3f15d video: smscufx: don't restore fb_mmap after deferred IO cleanup cf928543bfcb drm/fb-helper: don't preserve fb_ops across deferred IO use a9312755bd82 video: fb_defio: preserve user fb_ops
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15470/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BUILD: failure for video, drm: constify fbops in struct fb_info (rev2)
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: video, drm: constify fbops in struct fb_info (rev2)
URL : https://patchwork.freedesktop.org/series/70119/
State : failure
== Summary ==
Applying: video: fb_defio: preserve user fb_ops
Applying: drm/fb-helper: don't preserve fb_ops across deferred IO use
Applying: video: smscufx: don't restore fb_mmap after deferred IO cleanup
Applying: video: udlfb: don't restore fb_mmap after deferred IO cleanup
Applying: video: fbdev: vesafb: modify the static fb_ops directly
Applying: video: fbmem: use const pointer for fb_ops
Applying: video: omapfb: use const pointer for fb_ops
Applying: video: fbdev: make fbops member of struct fb_info a const pointer Using index info to reconstruct a base tree...
M include/linux/fb.h
Falling back to patching base and 3-way merge...
Auto-merging include/linux/fb.h
CONFLICT (content): Merge conflict in include/linux/fb.h
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0008 video: fbdev: make fbops member of struct fb_info a const pointer When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx