xref: /linux/drivers/video/fbdev/core/cfbfillrect.c (revision b4ada0618eed0fbd1b1630f73deb048c592b06a1)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  *	Copyright (C)  2025 Zsolt Kajtar (soci@c64.rulez.org)
4  */
5 
6 #include <linux/export.h>
7 #include <linux/module.h>
8 #include <linux/fb.h>
9 #include <linux/bitrev.h>
10 #include <asm/types.h>
11 
12 #ifdef CONFIG_FB_CFB_REV_PIXELS_IN_BYTE
13 #define FB_REV_PIXELS_IN_BYTE
14 #endif
15 
16 #include "cfbmem.h"
17 #include "fb_fillrect.h"
18 
19 void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
20 {
21 	if (p->state != FBINFO_STATE_RUNNING)
22 		return;
23 
24 	if (p->flags & FBINFO_VIRTFB)
25 		fb_warn_once(p, "%s: framebuffer is not in I/O address space.\n", __func__);
26 
27 	if (p->fbops->fb_sync)
28 		p->fbops->fb_sync(p);
29 
30 	fb_fillrect(p, rect);
31 }
32 EXPORT_SYMBOL(cfb_fillrect);
33 
34 MODULE_AUTHOR("Zsolt Kajtar <soci@c64.rulez.org>");
35 MODULE_DESCRIPTION("I/O memory packed pixel framebuffer area fill");
36 MODULE_LICENSE("GPL");
37