diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-11-27 16:16:00 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2023-11-29 14:20:50 +0300 |
commit | b3e8813773c568fd2d65e9752abfda27442e502e (patch) | |
tree | 4bfd1fbb2a8f32f89fabb3a375293edaecfa5652 /include/linux/fb.h | |
parent | 33253d9e01d40542f07aaf718a655893cd2949e5 (diff) | |
download | linux-b3e8813773c568fd2d65e9752abfda27442e502e.tar.xz |
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
Diffstat (limited to 'include/linux/fb.h')
-rw-r--r-- | include/linux/fb.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/fb.h b/include/linux/fb.h index a36d05b576b0..24f0ec366235 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -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 */ |