lede/target/linux/bcm27xx/patches-6.12/950-0756-bcm2708_fb-Explicitly-initialise-the-IOMEM-ops.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

86 lines
2.8 KiB
Diff

From bcacedbf42719825f819ed44a0a77856395b4ec5 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Tue, 14 Jan 2025 15:28:50 +0000
Subject: [PATCH] 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 <phil@raspberrypi.com>
[1] 8813e86f6d82 ("fbdev: Remove default file-I/O implementations")
---
drivers/video/fbdev/Kconfig | 4 +---
drivers/video/fbdev/bcm2708_fb.c | 18 ++++--------------
2 files changed, 5 insertions(+), 17 deletions(-)
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -65,9 +65,7 @@ config FB_BCM2708
tristate "BCM2708 framebuffer support"
depends on FB && RASPBERRYPI_FIRMWARE
select FB_DEVICE
- select FB_CFB_FILLRECT
- select FB_CFB_COPYAREA
- select FB_CFB_IMAGEBLIT
+ select FB_IOMEM_HELPERS
help
This framebuffer device driver is for the BCM2708 framebuffer.
--- a/drivers/video/fbdev/bcm2708_fb.c
+++ b/drivers/video/fbdev/bcm2708_fb.c
@@ -790,12 +790,6 @@ static int bcm2708_compat_ioctl(struct f
}
#endif
-static void bcm2708_fb_fillrect(struct fb_info *info,
- const struct fb_fillrect *rect)
-{
- cfb_fillrect(info, rect);
-}
-
/* A helper function for configuring dma control block */
static void set_dma_cb(struct bcm2708_dma_cb *cb,
int burst_size,
@@ -947,12 +941,6 @@ static void bcm2708_fb_copyarea(struct f
mutex_unlock(&fbdev->dma_mutex);
}
-static void bcm2708_fb_imageblit(struct fb_info *info,
- const struct fb_image *image)
-{
- cfb_imageblit(info, image);
-}
-
static irqreturn_t bcm2708_fb_dma_irq(int irq, void *cxt)
{
struct bcm2708_fb_dev *fbdev = cxt;
@@ -973,18 +961,20 @@ static irqreturn_t bcm2708_fb_dma_irq(in
static struct fb_ops bcm2708_fb_ops = {
.owner = THIS_MODULE,
+ __FB_DEFAULT_IOMEM_OPS_RDWR,
.fb_check_var = bcm2708_fb_check_var,
.fb_set_par = bcm2708_fb_set_par,
.fb_setcolreg = bcm2708_fb_setcolreg,
.fb_blank = bcm2708_fb_blank,
- .fb_fillrect = bcm2708_fb_fillrect,
+ .fb_fillrect = cfb_fillrect,
.fb_copyarea = bcm2708_fb_copyarea,
- .fb_imageblit = bcm2708_fb_imageblit,
+ .fb_imageblit = cfb_imageblit,
.fb_pan_display = bcm2708_fb_pan_display,
.fb_ioctl = bcm2708_ioctl,
#ifdef CONFIG_COMPAT
.fb_compat_ioctl = bcm2708_compat_ioctl,
#endif
+ __FB_DEFAULT_IOMEM_OPS_MMAP,
};
static int bcm2708_fb_register(struct bcm2708_fb *fb)