Skip to content

Commit fefbea7

Browse files
pelwellpopcornmix
authored andcommitted
bcm2708_fb: Explicitly initialise the IOMEM ops
Prior to [1], an fb_ops member of 0 was intepreted as a request for a default value. This saves source code but requires special handling by the framework, slowing down all accesses for no runtime benefit. Use the new __FB_DEFAULT_ macros to explicitly select default handlers in the bcm2708_fb driver. Also remove the pointless wrappers around cfb_fillrect and cfb_imageblit - call them directly. Link: https://forums.raspberrypi.com/viewtopic.php?p=2286016#p2286016 Signed-off-by: Phil Elwell <[email protected]> [1] 8813e86 ("fbdev: Remove default file-I/O implementations")
1 parent 9601bf7 commit fefbea7

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

drivers/video/fbdev/Kconfig

+1-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ config FB_BCM2708
6565
tristate "BCM2708 framebuffer support"
6666
depends on FB && RASPBERRYPI_FIRMWARE
6767
select FB_DEVICE
68-
select FB_CFB_FILLRECT
69-
select FB_CFB_COPYAREA
70-
select FB_CFB_IMAGEBLIT
68+
select FB_IOMEM_HELPERS
7169
help
7270
This framebuffer device driver is for the BCM2708 framebuffer.
7371

drivers/video/fbdev/bcm2708_fb.c

+4-14
Original file line numberDiff line numberDiff line change
@@ -790,12 +790,6 @@ static int bcm2708_compat_ioctl(struct fb_info *info, unsigned int cmd,
790790
}
791791
#endif
792792

793-
static void bcm2708_fb_fillrect(struct fb_info *info,
794-
const struct fb_fillrect *rect)
795-
{
796-
cfb_fillrect(info, rect);
797-
}
798-
799793
/* A helper function for configuring dma control block */
800794
static void set_dma_cb(struct bcm2708_dma_cb *cb,
801795
int burst_size,
@@ -947,12 +941,6 @@ static void bcm2708_fb_copyarea(struct fb_info *info,
947941
mutex_unlock(&fbdev->dma_mutex);
948942
}
949943

950-
static void bcm2708_fb_imageblit(struct fb_info *info,
951-
const struct fb_image *image)
952-
{
953-
cfb_imageblit(info, image);
954-
}
955-
956944
static irqreturn_t bcm2708_fb_dma_irq(int irq, void *cxt)
957945
{
958946
struct bcm2708_fb_dev *fbdev = cxt;
@@ -973,18 +961,20 @@ static irqreturn_t bcm2708_fb_dma_irq(int irq, void *cxt)
973961

974962
static struct fb_ops bcm2708_fb_ops = {
975963
.owner = THIS_MODULE,
964+
__FB_DEFAULT_IOMEM_OPS_RDWR,
976965
.fb_check_var = bcm2708_fb_check_var,
977966
.fb_set_par = bcm2708_fb_set_par,
978967
.fb_setcolreg = bcm2708_fb_setcolreg,
979968
.fb_blank = bcm2708_fb_blank,
980-
.fb_fillrect = bcm2708_fb_fillrect,
969+
.fb_fillrect = cfb_fillrect,
981970
.fb_copyarea = bcm2708_fb_copyarea,
982-
.fb_imageblit = bcm2708_fb_imageblit,
971+
.fb_imageblit = cfb_imageblit,
983972
.fb_pan_display = bcm2708_fb_pan_display,
984973
.fb_ioctl = bcm2708_ioctl,
985974
#ifdef CONFIG_COMPAT
986975
.fb_compat_ioctl = bcm2708_compat_ioctl,
987976
#endif
977+
__FB_DEFAULT_IOMEM_OPS_MMAP,
988978
};
989979

990980
static int bcm2708_fb_register(struct bcm2708_fb *fb)

0 commit comments

Comments
 (0)