linux/drivers/video/fbdev/core
Lorenzo Stoakes 6cdef2ddce fb_defio: do not use deprecated page->mapping, index fields
With the introduction of mapping_wrprotect_range() there is no need to use
folio_mkclean() in order to write-protect mappings of frame buffer pages,
and therefore no need to inappropriately set kernel-allocated page->index,
mapping fields to permit this operation.

Instead, store the pointer to the page cache object for the mapped driver
in the fb_deferred_io object, and use the already stored page offset from
the pageref object to look up mappings in order to write-protect them.

This is justified, as for the page objects to store a mapping pointer at
the point of assignment of pages, they must all reference the same
underlying address_space object.  Since the life time of the pagerefs is
also the lifetime of the fb_deferred_io object, storing the pointer here
makes sense.

This eliminates the need for all of the logic around setting and
maintaining page->index,mapping which we remove.

This eliminates the use of folio_mkclean() entirely but otherwise should
have no functional change.

[lorenzo.stoakes@oracle.com: fixup unused variable warnings]
  Link: https://lkml.kernel.org/r/d4018405-2762-4385-a816-e54cc23839ac@lucifer.local
Link: https://lkml.kernel.org/r/81171ab16c14e3df28f6de9d14982cee528d8519.1739029358.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Tested-by: Kajtar Zsolt <soci@c64.rulez.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Simona Vetter <simona.vetter@ffwll.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
History 2025-03-16 22:06:11 -07:00
..
bitblit.c tty: vt: remove CM_* constants 2024-01-27 18:08:54 -08:00
cfbcopyarea.c fbdev: Warn on incorrect framebuffer access 2023-11-29 12:20:50 +01:00
cfbfillrect.c fbdev: Warn on incorrect framebuffer access 2023-11-29 12:20:50 +01:00
cfbimgblt.c fbdev: Warn on incorrect framebuffer access 2023-11-29 12:20:50 +01:00
fb_backlight.c backlight: Match backlight device against struct fb_info.bl_dev 2024-03-28 10:08:47 +00:00
fb_chrdev.c fbdev: Remove default file-I/O implementations 2023-11-29 12:20:53 +01:00
fb_cmdline.c fbdev: Handle video= parameter in video/cmdline.c 2023-02-20 14:56:48 +01:00
fb_ddc.c fbdev: remove I2C_CLASS_DDC support 2024-01-18 21:10:41 +01:00
fb_defio.c fb_defio: do not use deprecated page->mapping, index fields 2025-03-16 22:06:11 -07:00
fb_draw.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fb_info.c fbdev: Document that framebuffer_alloc() returns zero'ed data 2023-07-24 16:50:39 +02:00
fb_internal.h fbdev/core: Move logo functions into separate source file 2023-09-11 15:12:35 +02:00
fb_io_fops.c fbdev: Warn on incorrect framebuffer access 2023-11-29 12:20:50 +01:00
fb_logo.c fbdev/core: Remove empty internal helpers from fb_logo.c 2023-09-11 15:12:37 +02:00
fb_notify.c video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify 2020-12-08 18:31:56 +01:00
fb_procfs.c fbdev/core: Move procfs code to separate file 2023-06-27 09:58:51 +02:00
fb_sys_fops.c fbdev: Warn on incorrect framebuffer access 2023-11-29 12:20:50 +01:00
fbcmap.c fbdev: zero-fill colormap in fbcmap.c 2021-04-10 11:12:08 +02:00
fbcon.c fbcon: break earlier in search_fb_in_map and search_for_mapped_con 2024-09-26 18:25:12 +02:00
fbcon.h tty: vt: remove CM_* constants 2024-01-27 18:08:54 -08:00
fbcon_ccw.c tty: vt: remove CM_* constants 2024-01-27 18:08:54 -08:00
fbcon_cw.c tty: vt: remove CM_* constants 2024-01-27 18:08:54 -08:00
fbcon_rotate.c fbcon: Drop EXPORT_SYMBOL 2020-11-17 11:00:43 +01:00
fbcon_rotate.h fbcon: Add option to enable legacy hardware acceleration 2022-02-02 15:16:26 +01:00
fbcon_ud.c tty: vt: remove CM_* constants 2024-01-27 18:08:54 -08:00
fbcvt.c video: fbdev: fbcvt.c: fix printing in fb_cvt_print_name() 2022-01-30 21:19:22 +01:00
fbmem.c fbdev: Introduce devm_register_framebuffer() 2024-08-30 18:42:38 +02:00
fbmon.c fbmon: prevent division by zero in fb_videomode_from_videomode() 2024-03-19 13:20:20 +01:00
fbsysfs.c fbdev/core: Use list_for_each_entry() helper 2023-08-31 22:54:34 +02:00
Kconfig fbdev: Fix recursive dependencies wrt BACKLIGHT_CLASS_DEVICE 2024-12-17 18:06:10 +01:00
Makefile fbdev: Rename FB_SYS_FOPS token to FB_SYSMEM_FOPS 2023-11-29 12:20:42 +01:00
modedb.c fbdev/core: Use list_for_each_entry() helper 2023-08-31 22:54:34 +02:00
softcursor.c fbcon: Drop EXPORT_SYMBOL 2020-11-17 11:00:43 +01:00
svgalib.c fbcon: Increase maximum font width x height to 64 x 128 2024-03-16 08:29:48 +01:00
syscopyarea.c fbdev: Warn on incorrect framebuffer access 2023-11-29 12:20:50 +01:00
sysfillrect.c fbdev: Warn on incorrect framebuffer access 2023-11-29 12:20:50 +01:00
sysimgblt.c fbdev: Warn on incorrect framebuffer access 2023-11-29 12:20:50 +01:00
tileblit.c tty: vt: remove CM_* constants 2024-01-27 18:08:54 -08:00