fbdev: Warn on incorrect framebuffer access

Test in framebuffer read, write and drawing helpers if FBINFO_VIRTFB
has been set correctly. Framebuffers in I/O memory should only be
accessed with the architecture's respective helpers. Framebuffers
in system memory should be accessed with the regular load and
store operations. Presumably not all drivers get this right, so we
now warn about it.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231127131655.4020-32-tzimmermann@suse.de
This commit is contained in:
Thomas Zimmermann
2023-11-27 14:16:00 +01:00
parent 33253d9e01
commit b3e8813773
9 changed files with 40 additions and 1 deletions

View File

@@ -849,7 +849,10 @@ static inline bool fb_modesetting_disabled(const char *drvname)
}
#endif
/* Convenience logging macros */
/*
* Convenience logging macros
*/
#define fb_err(fb_info, fmt, ...) \
pr_err("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
#define fb_notice(info, fmt, ...) \
@@ -861,4 +864,7 @@ static inline bool fb_modesetting_disabled(const char *drvname)
#define fb_dbg(fb_info, fmt, ...) \
pr_debug("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
#define fb_warn_once(fb_info, fmt, ...) \
pr_warn_once("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
#endif /* _LINUX_FB_H */