* [PATCH v2 0/4] fbdev: au1100fb: support COMPILE_TEST and fix multi-device support
@ 2026-02-07 17:12 Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 1/4] fbdev: au1100fb: Don't store device specific data in global variables Uwe Kleine-König
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2026-02-07 17:12 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
Hello,
v1 is available at
https://lore.kernel.org/linux-fbdev/cover.1770196161.git.u.kleine-koenig@baylibre.com
.
I reshuffled the series to have the only really relevant fix at the
start. Patch #3 is new in this revision and so is the s390 specific
#ifdef in patch #4. Patches #2 and #3 fix issues that pop up when
compiling the driver for arm and arm64 and s390. The last patch drops
the hard dependency on MIPS_ALCHEMY. For that the above mentioned s390
specfic #ifdef block has to be added (or alternatively s390 excluded
from build testing) because s390 is the only platform where pgprot_val
is not an l-value. The things that happen in that block are maybe very
mips-specific such that maybe this should be an #ifdef CONFIG_MIPS block
instead of an #ifndef CONFIG_S390 block?
Note that in the v1 thread Helge wrote to already having applied the
first two patches, they are not yet in next, so I included them here
again.
Best regards
Uwe
Uwe Kleine-König (4):
fbdev: au1100fb: Don't store device specific data in global variables
fbdev: au1100fb: Mark several local functions as static
fbdev: au1100fb: Use %zu to printk a value of type size_t
fbdev: au1100fb: Make driver compilable on non-mips platforms
drivers/video/fbdev/Kconfig | 3 +-
drivers/video/fbdev/au1100fb.c | 89 ++++++++++++++++++----------------
drivers/video/fbdev/au1100fb.h | 7 ++-
3 files changed, 53 insertions(+), 46 deletions(-)
base-commit: 0636e6205beed850d985276dc56fd73d785bea5c
--
2.47.3
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 1/4] fbdev: au1100fb: Don't store device specific data in global variables
2026-02-07 17:12 [PATCH v2 0/4] fbdev: au1100fb: support COMPILE_TEST and fix multi-device support Uwe Kleine-König
@ 2026-02-07 17:12 ` Uwe Kleine-König
2026-02-07 19:04 ` Helge Deller
2026-02-07 17:12 ` [PATCH v2 2/4] fbdev: au1100fb: Mark several local functions as static Uwe Kleine-König
` (2 subsequent siblings)
3 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2026-02-07 17:12 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
Using global data to store device specific data is a bad pattern that
breaks if there is more than one device. So expand driver data and drop
the global variables.
While there is probably no machine that has two or more au1100fb
devices, this makes the driver a better template for new drivers and
saves some memory if there is no such bound device.
bloat-o-meter reports (for ARCH=arm allmodconfig + CONFIG_FB_AU1100=y
and ignoring the rename of the init function):
add/remove: 1/4 grow/shrink: 2/2 up/down: 1360/-4800 (-3440)
Function old new delta
au1100fb_drv_probe 2648 3328 +680
$a 12808 13484 +676
au1100fb_drv_resume 404 400 -4
au1100fb_fix 68 - -68
au1100fb_var 160 - -160
fbregs 2048 - -2048
$d 9525 7009 -2516
Total: Before=38664, After=35224, chg -8.90%
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
I think this doesn't need a Fixes line, but if you want, it would be:
Fixes: 3b495f2bb749 ("Au1100 FB driver uplift for 2.6.")
Fixes: f77f50ca1a23 ("[PATCH] au1100fb: add power management support")
---
drivers/video/fbdev/au1100fb.c | 63 ++++++++++++++++------------------
drivers/video/fbdev/au1100fb.h | 5 +++
2 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index feaa1061c436..75344ee080f3 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -84,21 +84,6 @@ struct fb_bitfield rgb_bitfields[][4] =
{ { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } },
};
-static struct fb_fix_screeninfo au1100fb_fix = {
- .id = "AU1100 FB",
- .xpanstep = 1,
- .ypanstep = 1,
- .type = FB_TYPE_PACKED_PIXELS,
- .accel = FB_ACCEL_NONE,
-};
-
-static struct fb_var_screeninfo au1100fb_var = {
- .activate = FB_ACTIVATE_NOW,
- .height = -1,
- .width = -1,
- .vmode = FB_VMODE_NONINTERLACED,
-};
-
/* fb_blank
* Blank the screen. Depending on the mode, the screen will be
* activated with the backlight color, or desactivated
@@ -432,19 +417,26 @@ static int au1100fb_drv_probe(struct platform_device *dev)
return -EFAULT;
}
- au1100fb_fix.mmio_start = regs_res->start;
- au1100fb_fix.mmio_len = resource_size(regs_res);
+ fbdev->info.fix = (struct fb_fix_screeninfo) {
+ .mmio_start = regs_res->start,
+ .mmio_len = resource_size(regs_res),
+ .id = "AU1100 FB",
+ .xpanstep = 1,
+ .ypanstep = 1,
+ .type = FB_TYPE_PACKED_PIXELS,
+ .accel = FB_ACCEL_NONE,
+ };
if (!devm_request_mem_region(&dev->dev,
- au1100fb_fix.mmio_start,
- au1100fb_fix.mmio_len,
+ fbdev->info.fix.mmio_start,
+ fbdev->info.fix.mmio_len,
DRIVER_NAME)) {
print_err("fail to lock memory region at 0x%08lx",
- au1100fb_fix.mmio_start);
+ fbdev->info.fix.mmio_start);
return -EBUSY;
}
- fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(au1100fb_fix.mmio_start);
+ fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start);
print_dbg("Register memory map at %p", fbdev->regs);
print_dbg("phys=0x%08x, size=%d", fbdev->regs_phys, fbdev->regs_len);
@@ -469,22 +461,27 @@ static int au1100fb_drv_probe(struct platform_device *dev)
return -ENOMEM;
}
- au1100fb_fix.smem_start = fbdev->fb_phys;
- au1100fb_fix.smem_len = fbdev->fb_len;
+ fbdev->info.fix.smem_start = fbdev->fb_phys;
+ fbdev->info.fix.smem_len = fbdev->fb_len;
print_dbg("Framebuffer memory map at %p", fbdev->fb_mem);
print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);
/* load the panel info into the var struct */
- au1100fb_var.bits_per_pixel = fbdev->panel->bpp;
- au1100fb_var.xres = fbdev->panel->xres;
- au1100fb_var.xres_virtual = au1100fb_var.xres;
- au1100fb_var.yres = fbdev->panel->yres;
- au1100fb_var.yres_virtual = au1100fb_var.yres;
+ fbdev->info.var = (struct fb_var_screeninfo) {
+ .activate = FB_ACTIVATE_NOW,
+ .height = -1,
+ .width = -1,
+ .vmode = FB_VMODE_NONINTERLACED,
+ .bits_per_pixel = fbdev->panel->bpp,
+ .xres = fbdev->panel->xres,
+ .xres_virtual = fbdev->panel->xres,
+ .yres = fbdev->panel->yres,
+ .yres_virtual = fbdev->panel->yres,
+ };
fbdev->info.screen_base = fbdev->fb_mem;
fbdev->info.fbops = &au1100fb_ops;
- fbdev->info.fix = au1100fb_fix;
fbdev->info.pseudo_palette =
devm_kcalloc(&dev->dev, 16, sizeof(u32), GFP_KERNEL);
@@ -497,8 +494,6 @@ static int au1100fb_drv_probe(struct platform_device *dev)
return -EFAULT;
}
- fbdev->info.var = au1100fb_var;
-
/* Set h/w registers */
au1100fb_setmode(fbdev);
@@ -547,7 +542,7 @@ void au1100fb_drv_remove(struct platform_device *dev)
#ifdef CONFIG_PM
static struct au1100fb_regs fbregs;
-int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
+static int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
{
struct au1100fb_device *fbdev = platform_get_drvdata(dev);
@@ -559,7 +554,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
clk_disable(fbdev->lcdclk);
- memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
+ memcpy(&fbdev->pm_regs, fbdev->regs, sizeof(struct au1100fb_regs));
return 0;
}
@@ -572,7 +567,7 @@ int au1100fb_drv_resume(struct platform_device *dev)
if (!fbdev)
return 0;
- memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));
+ memcpy(fbdev->regs, &fbdev->pm_regs, sizeof(struct au1100fb_regs));
ret = clk_enable(fbdev->lcdclk);
if (ret)
diff --git a/drivers/video/fbdev/au1100fb.h b/drivers/video/fbdev/au1100fb.h
index 79f4048726f1..dc53d063fcc3 100644
--- a/drivers/video/fbdev/au1100fb.h
+++ b/drivers/video/fbdev/au1100fb.h
@@ -105,6 +105,11 @@ struct au1100fb_device {
size_t regs_len;
unsigned int regs_phys;
+#ifdef CONFIG_PM
+ /* stores the register values during suspend */
+ struct au1100fb_regs pm_regs;
+#endif
+
unsigned char* fb_mem; /* FrameBuffer memory map */
size_t fb_len;
dma_addr_t fb_phys;
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 2/4] fbdev: au1100fb: Mark several local functions as static
2026-02-07 17:12 [PATCH v2 0/4] fbdev: au1100fb: support COMPILE_TEST and fix multi-device support Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 1/4] fbdev: au1100fb: Don't store device specific data in global variables Uwe Kleine-König
@ 2026-02-07 17:12 ` Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 3/4] fbdev: au1100fb: Use %zu to printk a value of type size_t Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms Uwe Kleine-König
3 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2026-02-07 17:12 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
This fixes several (fatal) compiler warnings à la
drivers/video/fbdev/au1100fb.c:530:6: error: no previous prototype for ‘au1100fb_drv_remove’ [-Werror=missing-prototypes]
523 | void au1100fb_drv_remove(struct platform_device *dev)
| ^~~~~~~~~~~~~~~~~~~
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/video/fbdev/au1100fb.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index 75344ee080f3..beba8befaec9 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -120,7 +120,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
* Set hardware with var settings. This will enable the controller with a specific
* mode, normally validated with the fb_check_var method
*/
-int au1100fb_setmode(struct au1100fb_device *fbdev)
+static int au1100fb_setmode(struct au1100fb_device *fbdev)
{
struct fb_info *info;
u32 words;
@@ -219,7 +219,7 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
/* fb_setcolreg
* Set color in LCD palette.
*/
-int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi)
+static int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi)
{
struct au1100fb_device *fbdev;
u32 *palette;
@@ -278,7 +278,7 @@ int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned
/* fb_pan_display
* Pan display in x and/or y as specified
*/
-int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi)
+static int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi)
{
struct au1100fb_device *fbdev;
int dy;
@@ -325,7 +325,7 @@ int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi)
* Map video memory in user space. We don't use the generic fb_mmap method mainly
* to allow the use of the TLB streaming flag (CCA=6)
*/
-int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
+static int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
{
struct au1100fb_device *fbdev = to_au1100fb_device(fbi);
@@ -517,7 +517,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
return -ENODEV;
}
-void au1100fb_drv_remove(struct platform_device *dev)
+static void au1100fb_drv_remove(struct platform_device *dev)
{
struct au1100fb_device *fbdev = NULL;
@@ -559,7 +559,7 @@ static int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
return 0;
}
-int au1100fb_drv_resume(struct platform_device *dev)
+static int au1100fb_drv_resume(struct platform_device *dev)
{
struct au1100fb_device *fbdev = platform_get_drvdata(dev);
int ret;
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 3/4] fbdev: au1100fb: Use %zu to printk a value of type size_t
2026-02-07 17:12 [PATCH v2 0/4] fbdev: au1100fb: support COMPILE_TEST and fix multi-device support Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 1/4] fbdev: au1100fb: Don't store device specific data in global variables Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 2/4] fbdev: au1100fb: Mark several local functions as static Uwe Kleine-König
@ 2026-02-07 17:12 ` Uwe Kleine-König
2026-02-07 19:06 ` Helge Deller
2026-02-07 17:12 ` [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms Uwe Kleine-König
3 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2026-02-07 17:12 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
%zu is the dedicated type for size_t. %d only works on 32bit
architectures where size_t is typedef'd to be unsigned int. (And then
the signedness doesn't fit, but `gcc -Wformat` doesn't stumble over this.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/video/fbdev/au1100fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index beba8befaec9..a0e1aceaf9a6 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -456,7 +456,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
PAGE_ALIGN(fbdev->fb_len),
&fbdev->fb_phys, GFP_KERNEL);
if (!fbdev->fb_mem) {
- print_err("fail to allocate framebuffer (size: %dK))",
+ print_err("fail to allocate framebuffer (size: %zuK))",
fbdev->fb_len / 1024);
return -ENOMEM;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms
2026-02-07 17:12 [PATCH v2 0/4] fbdev: au1100fb: support COMPILE_TEST and fix multi-device support Uwe Kleine-König
` (2 preceding siblings ...)
2026-02-07 17:12 ` [PATCH v2 3/4] fbdev: au1100fb: Use %zu to printk a value of type size_t Uwe Kleine-König
@ 2026-02-07 17:12 ` Uwe Kleine-König
2026-02-07 22:02 ` kernel test robot
` (2 more replies)
3 siblings, 3 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2026-02-07 17:12 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
The header asm/mach-au1x00/au1000.h is unused apart from pulling in
<linux/delay.h> (for mdelay()) and <linux/io.h> (for KSEG1ADDR()). Then
the only platform specific part in the driver is the usage of the KSEG1ADDR
macro, which for the non-mips case can be stubbed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/video/fbdev/Kconfig | 3 ++-
drivers/video/fbdev/au1100fb.c | 12 ++++++++++--
drivers/video/fbdev/au1100fb.h | 2 --
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 45733522ff48..4514c42db9fa 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -1345,7 +1345,8 @@ endchoice
config FB_AU1100
bool "Au1100 LCD Driver"
- depends on (FB = y) && MIPS_ALCHEMY
+ depends on FB
+ depends on MIPS_ALCHEMY || COMPILE_TEST
select FB_IOMEM_HELPERS
help
This is the framebuffer driver for the AMD Au1100 SOC. It can drive
diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index a0e1aceaf9a6..758002cb5ea8 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -42,6 +42,8 @@
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/io.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -55,12 +57,15 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
-#include <asm/mach-au1x00/au1000.h>
-
#define DEBUG 0
#include "au1100fb.h"
+#if defined(CONFIG_COMPILE_TEST) && !defined(CONFIG_MIPS)
+/* This is only defined to be able to compile this driver on non-mips platforms */
+#define KSEG1ADDR(x) (x)
+#endif
+
#define DRIVER_NAME "au1100fb"
#define DRIVER_DESC "LCD controller driver for AU1100 processors"
@@ -331,7 +336,10 @@ static int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
+#ifndef CONFIG_S390
+ /* On s390 pgprot_val() is a function and thus not a lvalue */
pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6
+#endif
return dma_mmap_coherent(fbdev->dev, vma, fbdev->fb_mem, fbdev->fb_phys,
fbdev->fb_len);
diff --git a/drivers/video/fbdev/au1100fb.h b/drivers/video/fbdev/au1100fb.h
index dc53d063fcc3..998328cd16a2 100644
--- a/drivers/video/fbdev/au1100fb.h
+++ b/drivers/video/fbdev/au1100fb.h
@@ -30,8 +30,6 @@
#ifndef _AU1100LCD_H
#define _AU1100LCD_H
-#include <asm/mach-au1x00/au1000.h>
-
#define print_err(f, arg...) printk(KERN_ERR DRIVER_NAME ": " f "\n", ## arg)
#define print_warn(f, arg...) printk(KERN_WARNING DRIVER_NAME ": " f "\n", ## arg)
#define print_info(f, arg...) printk(KERN_INFO DRIVER_NAME ": " f "\n", ## arg)
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] fbdev: au1100fb: Don't store device specific data in global variables
2026-02-07 17:12 ` [PATCH v2 1/4] fbdev: au1100fb: Don't store device specific data in global variables Uwe Kleine-König
@ 2026-02-07 19:04 ` Helge Deller
2026-02-07 21:34 ` Uwe Kleine-König
0 siblings, 1 reply; 13+ messages in thread
From: Helge Deller @ 2026-02-07 19:04 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Chen Ni, linux-fbdev, dri-devel
Hi Uwe,
On 2/7/26 18:12, Uwe Kleine-König wrote:
> Using global data to store device specific data is a bad pattern that
> breaks if there is more than one device. So expand driver data and drop
> the global variables.
>
> While there is probably no machine that has two or more au1100fb
> devices, this makes the driver a better template for new drivers and
> saves some memory if there is no such bound device.
>
> bloat-o-meter reports (for ARCH=arm allmodconfig + CONFIG_FB_AU1100=y
> and ignoring the rename of the init function):
>
> add/remove: 1/4 grow/shrink: 2/2 up/down: 1360/-4800 (-3440)
> Function old new delta
> au1100fb_drv_probe 2648 3328 +680
> $a 12808 13484 +676
> au1100fb_drv_resume 404 400 -4
> au1100fb_fix 68 - -68
> au1100fb_var 160 - -160
> fbregs 2048 - -2048
> $d 9525 7009 -2516
> Total: Before=38664, After=35224, chg -8.90%
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> I think this doesn't need a Fixes line, but if you want, it would be:
>
> Fixes: 3b495f2bb749 ("Au1100 FB driver uplift for 2.6.")
> Fixes: f77f50ca1a23 ("[PATCH] au1100fb: add power management support")
> ---
> drivers/video/fbdev/au1100fb.c | 63 ++++++++++++++++------------------
> drivers/video/fbdev/au1100fb.h | 5 +++
> 2 files changed, 34 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
> index feaa1061c436..75344ee080f3 100644
> --- a/drivers/video/fbdev/au1100fb.c
> +++ b/drivers/video/fbdev/au1100fb.c
> @@ -84,21 +84,6 @@ struct fb_bitfield rgb_bitfields[][4] =
> { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } },
> };
>
> -static struct fb_fix_screeninfo au1100fb_fix = {
> - .id = "AU1100 FB",
> - .xpanstep = 1,
> - .ypanstep = 1,
> - .type = FB_TYPE_PACKED_PIXELS,
> - .accel = FB_ACCEL_NONE,
> -};
> -
> -static struct fb_var_screeninfo au1100fb_var = {
> - .activate = FB_ACTIVATE_NOW,
> - .height = -1,
> - .width = -1,
> - .vmode = FB_VMODE_NONINTERLACED,
> -};
> -
> /* fb_blank
> * Blank the screen. Depending on the mode, the screen will be
> * activated with the backlight color, or desactivated
> @@ -432,19 +417,26 @@ static int au1100fb_drv_probe(struct platform_device *dev)
> return -EFAULT;
> }
>
> - au1100fb_fix.mmio_start = regs_res->start;
> - au1100fb_fix.mmio_len = resource_size(regs_res);
> + fbdev->info.fix = (struct fb_fix_screeninfo) {
> + .mmio_start = regs_res->start,
> + .mmio_len = resource_size(regs_res),
> + .id = "AU1100 FB",
> + .xpanstep = 1,
> + .ypanstep = 1,
> + .type = FB_TYPE_PACKED_PIXELS,
> + .accel = FB_ACCEL_NONE,
> + };
>
> if (!devm_request_mem_region(&dev->dev,
> - au1100fb_fix.mmio_start,
> - au1100fb_fix.mmio_len,
> + fbdev->info.fix.mmio_start,
> + fbdev->info.fix.mmio_len,
> DRIVER_NAME)) {
> print_err("fail to lock memory region at 0x%08lx",
> - au1100fb_fix.mmio_start);
> + fbdev->info.fix.mmio_start);
> return -EBUSY;
> }
>
> - fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(au1100fb_fix.mmio_start);
> + fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start);
>
> print_dbg("Register memory map at %p", fbdev->regs);
> print_dbg("phys=0x%08x, size=%d", fbdev->regs_phys, fbdev->regs_len);
> @@ -469,22 +461,27 @@ static int au1100fb_drv_probe(struct platform_device *dev)
> return -ENOMEM;
> }
>
> - au1100fb_fix.smem_start = fbdev->fb_phys;
> - au1100fb_fix.smem_len = fbdev->fb_len;
> + fbdev->info.fix.smem_start = fbdev->fb_phys;
> + fbdev->info.fix.smem_len = fbdev->fb_len;
>
> print_dbg("Framebuffer memory map at %p", fbdev->fb_mem);
> print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);
>
> /* load the panel info into the var struct */
> - au1100fb_var.bits_per_pixel = fbdev->panel->bpp;
> - au1100fb_var.xres = fbdev->panel->xres;
> - au1100fb_var.xres_virtual = au1100fb_var.xres;
> - au1100fb_var.yres = fbdev->panel->yres;
> - au1100fb_var.yres_virtual = au1100fb_var.yres;
> + fbdev->info.var = (struct fb_var_screeninfo) {
> + .activate = FB_ACTIVATE_NOW,
> + .height = -1,
> + .width = -1,
> + .vmode = FB_VMODE_NONINTERLACED,
> + .bits_per_pixel = fbdev->panel->bpp,
> + .xres = fbdev->panel->xres,
> + .xres_virtual = fbdev->panel->xres,
> + .yres = fbdev->panel->yres,
> + .yres_virtual = fbdev->panel->yres,
> + };
>
> fbdev->info.screen_base = fbdev->fb_mem;
> fbdev->info.fbops = &au1100fb_ops;
> - fbdev->info.fix = au1100fb_fix;
>
> fbdev->info.pseudo_palette =
> devm_kcalloc(&dev->dev, 16, sizeof(u32), GFP_KERNEL);
> @@ -497,8 +494,6 @@ static int au1100fb_drv_probe(struct platform_device *dev)
> return -EFAULT;
> }
>
> - fbdev->info.var = au1100fb_var;
> -
> /* Set h/w registers */
> au1100fb_setmode(fbdev);
>
> @@ -547,7 +542,7 @@ void au1100fb_drv_remove(struct platform_device *dev)
> #ifdef CONFIG_PM
> static struct au1100fb_regs fbregs;
^ you missed to delete "fbregs" now.
Your previous series deleted it.
> -int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
> +static int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
> {
> struct au1100fb_device *fbdev = platform_get_drvdata(dev);
>
> @@ -559,7 +554,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
>
> clk_disable(fbdev->lcdclk);
>
> - memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
> + memcpy(&fbdev->pm_regs, fbdev->regs, sizeof(struct au1100fb_regs));
Although memcpy() was used before, isn't this:
fbdev->pm_regs = *fbdev->regs;
sufficient and better?
> return 0;
> }
> @@ -572,7 +567,7 @@ int au1100fb_drv_resume(struct platform_device *dev)
> if (!fbdev)
> return 0;
>
> - memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));
> + memcpy(fbdev->regs, &fbdev->pm_regs, sizeof(struct au1100fb_regs));
same here.
> ret = clk_enable(fbdev->lcdclk);
> if (ret)
> diff --git a/drivers/video/fbdev/au1100fb.h b/drivers/video/fbdev/au1100fb.h
> index 79f4048726f1..dc53d063fcc3 100644
> --- a/drivers/video/fbdev/au1100fb.h
> +++ b/drivers/video/fbdev/au1100fb.h
> @@ -105,6 +105,11 @@ struct au1100fb_device {
> size_t regs_len;
> unsigned int regs_phys;
>
> +#ifdef CONFIG_PM
> + /* stores the register values during suspend */
> + struct au1100fb_regs pm_regs;
> +#endif
> +
> unsigned char* fb_mem; /* FrameBuffer memory map */
> size_t fb_len;
> dma_addr_t fb_phys;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 3/4] fbdev: au1100fb: Use %zu to printk a value of type size_t
2026-02-07 17:12 ` [PATCH v2 3/4] fbdev: au1100fb: Use %zu to printk a value of type size_t Uwe Kleine-König
@ 2026-02-07 19:06 ` Helge Deller
2026-02-07 21:32 ` Uwe Kleine-König
0 siblings, 1 reply; 13+ messages in thread
From: Helge Deller @ 2026-02-07 19:06 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Chen Ni, linux-fbdev, dri-devel
On 2/7/26 18:12, Uwe Kleine-König wrote:
> %zu is the dedicated type for size_t. %d only works on 32bit
> architectures where size_t is typedef'd to be unsigned int. (And then
> the signedness doesn't fit, but `gcc -Wformat` doesn't stumble over this.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/video/fbdev/au1100fb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
> index beba8befaec9..a0e1aceaf9a6 100644
> --- a/drivers/video/fbdev/au1100fb.c
> +++ b/drivers/video/fbdev/au1100fb.c
> @@ -456,7 +456,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
> PAGE_ALIGN(fbdev->fb_len),
> &fbdev->fb_phys, GFP_KERNEL);
> if (!fbdev->fb_mem) {
> - print_err("fail to allocate framebuffer (size: %dK))",
> + print_err("fail to allocate framebuffer (size: %zuK))",
> fbdev->fb_len / 1024);
> return -ENOMEM;
> }
I think there is a second hunk missing?
@@ -470,7 +470,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
fbdev->info.fix.smem_len = fbdev->fb_len;
print_dbg("Framebuffer memory map at %p", fbdev->fb_mem);
- print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);
+ print_dbg("phys=0x%08x, size=%zuK", fbdev->fb_phys, fbdev->fb_len / 1024);
Helge
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 3/4] fbdev: au1100fb: Use %zu to printk a value of type size_t
2026-02-07 19:06 ` Helge Deller
@ 2026-02-07 21:32 ` Uwe Kleine-König
0 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2026-02-07 21:32 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]
On Sat, Feb 07, 2026 at 08:06:18PM +0100, Helge Deller wrote:
> On 2/7/26 18:12, Uwe Kleine-König wrote:
> > %zu is the dedicated type for size_t. %d only works on 32bit
> > architectures where size_t is typedef'd to be unsigned int. (And then
> > the signedness doesn't fit, but `gcc -Wformat` doesn't stumble over this.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> > ---
> > drivers/video/fbdev/au1100fb.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
> > index beba8befaec9..a0e1aceaf9a6 100644
> > --- a/drivers/video/fbdev/au1100fb.c
> > +++ b/drivers/video/fbdev/au1100fb.c
> > @@ -456,7 +456,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
> > PAGE_ALIGN(fbdev->fb_len),
> > &fbdev->fb_phys, GFP_KERNEL);
> > if (!fbdev->fb_mem) {
> > - print_err("fail to allocate framebuffer (size: %dK))",
> > + print_err("fail to allocate framebuffer (size: %zuK))",
> > fbdev->fb_len / 1024);
> > return -ENOMEM;
> > }
>
> I think there is a second hunk missing?
>
> @@ -470,7 +470,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
> fbdev->info.fix.smem_len = fbdev->fb_len;
>
> print_dbg("Framebuffer memory map at %p", fbdev->fb_mem);
> - print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);
> + print_dbg("phys=0x%08x, size=%zuK", fbdev->fb_phys, fbdev->fb_len / 1024);
Ah, the compiler didn't stumble about this one because print_dbg is a
stub without DEBUG defined.
I will prepare a v3.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] fbdev: au1100fb: Don't store device specific data in global variables
2026-02-07 19:04 ` Helge Deller
@ 2026-02-07 21:34 ` Uwe Kleine-König
2026-02-08 17:48 ` Uwe Kleine-König
0 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2026-02-07 21:34 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]
Hello Helge,
On Sat, Feb 07, 2026 at 08:04:21PM +0100, Helge Deller wrote:
> > @@ -547,7 +542,7 @@ void au1100fb_drv_remove(struct platform_device *dev)
> > #ifdef CONFIG_PM
> > static struct au1100fb_regs fbregs;
>
> ^ you missed to delete "fbregs" now.
> Your previous series deleted it.
I guess this is a fallout from reordering the patches. Will fix.
> > -int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
> > +static int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
> > {
> > struct au1100fb_device *fbdev = platform_get_drvdata(dev);
> > @@ -559,7 +554,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
> > clk_disable(fbdev->lcdclk);
> > - memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
> > + memcpy(&fbdev->pm_regs, fbdev->regs, sizeof(struct au1100fb_regs));
>
> Although memcpy() was used before, isn't this:
> fbdev->pm_regs = *fbdev->regs;
> sufficient and better?
Probably yes, that's a separate patch then.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms
2026-02-07 17:12 ` [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms Uwe Kleine-König
@ 2026-02-07 22:02 ` kernel test robot
2026-02-07 23:04 ` kernel test robot
2026-02-08 11:12 ` kernel test robot
2 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2026-02-07 22:02 UTC (permalink / raw)
To: Uwe Kleine-König, Helge Deller
Cc: oe-kbuild-all, Chen Ni, linux-fbdev, dri-devel
Hi Uwe,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 0636e6205beed850d985276dc56fd73d785bea5c]
url: https://github.com/intel-lab-lkp/linux/commits/Uwe-Kleine-K-nig/fbdev-au1100fb-Don-t-store-device-specific-data-in-global-variables/20260208-011505
base: 0636e6205beed850d985276dc56fd73d785bea5c
patch link: https://lore.kernel.org/r/b894247689a7a920d9caa465dbcb840bca806cbf.1770483674.git.u.kleine-koenig%40baylibre.com
patch subject: [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms
config: sh-allyesconfig (https://download.01.org/0day-ci/archive/20260208/202602080635.w8n9dF6S-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260208/202602080635.w8n9dF6S-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602080635.w8n9dF6S-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/video/fbdev/au1100fb.c:551:29: warning: 'fbregs' defined but not used [-Wunused-variable]
551 | static struct au1100fb_regs fbregs;
| ^~~~~~
vim +/fbregs +551 drivers/video/fbdev/au1100fb.c
^1da177e4c3f415 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 549
f77f50ca1a236ae drivers/video/au1100fb.c Rodolfo Giometti 2006-06-26 550 #ifdef CONFIG_PM
f77f50ca1a236ae drivers/video/au1100fb.c Rodolfo Giometti 2006-06-26 @551 static struct au1100fb_regs fbregs;
f77f50ca1a236ae drivers/video/au1100fb.c Rodolfo Giometti 2006-06-26 552
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms
2026-02-07 17:12 ` [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms Uwe Kleine-König
2026-02-07 22:02 ` kernel test robot
@ 2026-02-07 23:04 ` kernel test robot
2026-02-08 11:12 ` kernel test robot
2 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2026-02-07 23:04 UTC (permalink / raw)
To: Uwe Kleine-König, Helge Deller
Cc: llvm, oe-kbuild-all, Chen Ni, linux-fbdev, dri-devel
Hi Uwe,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 0636e6205beed850d985276dc56fd73d785bea5c]
url: https://github.com/intel-lab-lkp/linux/commits/Uwe-Kleine-K-nig/fbdev-au1100fb-Don-t-store-device-specific-data-in-global-variables/20260208-011505
base: 0636e6205beed850d985276dc56fd73d785bea5c
patch link: https://lore.kernel.org/r/b894247689a7a920d9caa465dbcb840bca806cbf.1770483674.git.u.kleine-koenig%40baylibre.com
patch subject: [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms
config: sparc64-allmodconfig (https://download.01.org/0day-ci/archive/20260208/202602080617.eBFEo4gK-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260208/202602080617.eBFEo4gK-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602080617.eBFEo4gK-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/video/fbdev/au1100fb.c:551:29: warning: unused variable 'fbregs' [-Wunused-variable]
551 | static struct au1100fb_regs fbregs;
| ^~~~~~
1 warning generated.
vim +/fbregs +551 drivers/video/fbdev/au1100fb.c
^1da177e4c3f415 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 549
f77f50ca1a236ae drivers/video/au1100fb.c Rodolfo Giometti 2006-06-26 550 #ifdef CONFIG_PM
f77f50ca1a236ae drivers/video/au1100fb.c Rodolfo Giometti 2006-06-26 @551 static struct au1100fb_regs fbregs;
f77f50ca1a236ae drivers/video/au1100fb.c Rodolfo Giometti 2006-06-26 552
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms
2026-02-07 17:12 ` [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms Uwe Kleine-König
2026-02-07 22:02 ` kernel test robot
2026-02-07 23:04 ` kernel test robot
@ 2026-02-08 11:12 ` kernel test robot
2 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2026-02-08 11:12 UTC (permalink / raw)
To: Uwe Kleine-König, Helge Deller
Cc: oe-kbuild-all, Chen Ni, linux-fbdev, dri-devel
Hi Uwe,
kernel test robot noticed the following build errors:
[auto build test ERROR on 0636e6205beed850d985276dc56fd73d785bea5c]
url: https://github.com/intel-lab-lkp/linux/commits/Uwe-Kleine-K-nig/fbdev-au1100fb-Don-t-store-device-specific-data-in-global-variables/20260208-011505
base: 0636e6205beed850d985276dc56fd73d785bea5c
patch link: https://lore.kernel.org/r/b894247689a7a920d9caa465dbcb840bca806cbf.1770483674.git.u.kleine-koenig%40baylibre.com
patch subject: [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms
config: mips-randconfig-r123-20260208 (https://download.01.org/0day-ci/archive/20260208/202602081811.HrSb1oUf-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260208/202602081811.HrSb1oUf-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602081811.HrSb1oUf-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
>> drivers/video/fbdev/au1100fb.c:447:39: error: call to undeclared function 'KSEG1ADDR'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
447 | fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start);
| ^
>> drivers/video/fbdev/au1100fb.c:447:16: warning: cast to 'struct au1100fb_regs *' from smaller integer type 'int' [-Wint-to-pointer-cast]
447 | fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
vim +/KSEG1ADDR +447 drivers/video/fbdev/au1100fb.c
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 403
48c68c4f1b5424 drivers/video/au1100fb.c Greg Kroah-Hartman 2012-12-21 404 static int au1100fb_drv_probe(struct platform_device *dev)
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 405 {
46953e6aab262d drivers/video/fbdev/au1100fb.c Markus Elfring 2018-03-28 406 struct au1100fb_device *fbdev;
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 407 struct resource *regs_res;
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 408 struct clk *c;
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 409
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 410 /* Allocate new device private */
db66f0252e2f17 drivers/video/fbdev/au1100fb.c Markus Elfring 2018-03-28 411 fbdev = devm_kzalloc(&dev->dev, sizeof(*fbdev), GFP_KERNEL);
29914badc59b23 drivers/video/fbdev/au1100fb.c Markus Elfring 2018-03-28 412 if (!fbdev)
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 413 return -ENOMEM;
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 414
d121c3f3cedb84 drivers/video/au1100fb.c Manuel Lauss 2011-09-30 415 if (au1100fb_setup(fbdev))
d121c3f3cedb84 drivers/video/au1100fb.c Manuel Lauss 2011-09-30 416 goto failed;
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 417
7a192ec334cab9 drivers/video/au1100fb.c Ming Lei 2009-02-06 418 platform_set_drvdata(dev, (void *)fbdev);
67f30ad19c4b32 drivers/video/fbdev/au1100fb.c Christoph Hellwig 2019-04-28 419 fbdev->dev = &dev->dev;
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 420
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 421 /* Allocate region for our registers and map them */
d121c3f3cedb84 drivers/video/au1100fb.c Manuel Lauss 2011-09-30 422 regs_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
d121c3f3cedb84 drivers/video/au1100fb.c Manuel Lauss 2011-09-30 423 if (!regs_res) {
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 424 print_err("fail to retrieve registers resource");
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 425 return -EFAULT;
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 426 }
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 427
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 428 fbdev->info.fix = (struct fb_fix_screeninfo) {
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 429 .mmio_start = regs_res->start,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 430 .mmio_len = resource_size(regs_res),
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 431 .id = "AU1100 FB",
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 432 .xpanstep = 1,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 433 .ypanstep = 1,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 434 .type = FB_TYPE_PACKED_PIXELS,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 435 .accel = FB_ACCEL_NONE,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 436 };
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 437
93019734555f8d drivers/video/au1100fb.c Manuel Lauss 2012-03-24 438 if (!devm_request_mem_region(&dev->dev,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 439 fbdev->info.fix.mmio_start,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 440 fbdev->info.fix.mmio_len,
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 441 DRIVER_NAME)) {
c05b7f3d12b945 drivers/video/au1100fb.c Rodolfo Giometti 2006-05-30 442 print_err("fail to lock memory region at 0x%08lx",
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 443 fbdev->info.fix.mmio_start);
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 444 return -EBUSY;
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 445 }
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 446
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 @447 fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start);
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 448
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 449 print_dbg("Register memory map at %p", fbdev->regs);
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 450 print_dbg("phys=0x%08x, size=%d", fbdev->regs_phys, fbdev->regs_len);
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 451
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 452 c = clk_get(NULL, "lcd_intclk");
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 453 if (!IS_ERR(c)) {
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 454 fbdev->lcdclk = c;
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 455 clk_set_rate(c, 48000000);
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 456 clk_prepare_enable(c);
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 457 }
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 458
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 459 /* Allocate the framebuffer to the maximum screen size * nbr of video buffers */
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 460 fbdev->fb_len = fbdev->panel->xres * fbdev->panel->yres *
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 461 (fbdev->panel->bpp >> 3) * AU1100FB_NBR_VIDEO_BUFFERS;
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 462
93019734555f8d drivers/video/au1100fb.c Manuel Lauss 2012-03-24 463 fbdev->fb_mem = dmam_alloc_coherent(&dev->dev,
1c16697bf9d5b2 drivers/video/au1100fb.c Julia Lawall 2012-01-21 464 PAGE_ALIGN(fbdev->fb_len),
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 465 &fbdev->fb_phys, GFP_KERNEL);
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 466 if (!fbdev->fb_mem) {
4bad214934b5f7 drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 467 print_err("fail to allocate framebuffer (size: %zuK))",
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 468 fbdev->fb_len / 1024);
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 469 return -ENOMEM;
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 470 }
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 471
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 472 fbdev->info.fix.smem_start = fbdev->fb_phys;
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 473 fbdev->info.fix.smem_len = fbdev->fb_len;
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 474
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 475 print_dbg("Framebuffer memory map at %p", fbdev->fb_mem);
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 476 print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 477
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 478 /* load the panel info into the var struct */
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 479 fbdev->info.var = (struct fb_var_screeninfo) {
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 480 .activate = FB_ACTIVATE_NOW,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 481 .height = -1,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 482 .width = -1,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 483 .vmode = FB_VMODE_NONINTERLACED,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 484 .bits_per_pixel = fbdev->panel->bpp,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 485 .xres = fbdev->panel->xres,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 486 .xres_virtual = fbdev->panel->xres,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 487 .yres = fbdev->panel->yres,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 488 .yres_virtual = fbdev->panel->yres,
fe1835daa1ae0e drivers/video/fbdev/au1100fb.c Uwe Kleine-König 2026-02-07 489 };
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 490
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 491 fbdev->info.screen_base = fbdev->fb_mem;
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 492 fbdev->info.fbops = &au1100fb_ops;
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 493
1c16697bf9d5b2 drivers/video/au1100fb.c Julia Lawall 2012-01-21 494 fbdev->info.pseudo_palette =
a86854d0c599b3 drivers/video/fbdev/au1100fb.c Kees Cook 2018-06-12 495 devm_kcalloc(&dev->dev, 16, sizeof(u32), GFP_KERNEL);
1c16697bf9d5b2 drivers/video/au1100fb.c Julia Lawall 2012-01-21 496 if (!fbdev->info.pseudo_palette)
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 497 return -ENOMEM;
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 498
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 499 if (fb_alloc_cmap(&fbdev->info.cmap, AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) {
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 500 print_err("Fail to allocate colormap (%d entries)",
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 501 AU1100_LCD_NBR_PALETTE_ENTRIES);
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 502 return -EFAULT;
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 503 }
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 504
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 505 /* Set h/w registers */
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 506 au1100fb_setmode(fbdev);
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 507
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 508 /* Register new framebuffer */
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 509 if (register_framebuffer(&fbdev->info) < 0) {
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 510 print_err("cannot register new framebuffer");
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 511 goto failed;
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 512 }
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 513
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 514 return 0;
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 515
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 516 failed:
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 517 if (fbdev->lcdclk) {
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 518 clk_disable_unprepare(fbdev->lcdclk);
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 519 clk_put(fbdev->lcdclk);
6b1889c14b4606 drivers/video/fbdev/au1100fb.c Manuel Lauss 2014-07-23 520 }
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 521 if (fbdev->info.cmap.len != 0) {
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 522 fb_dealloc_cmap(&fbdev->info.cmap);
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 523 }
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 524
1c16697bf9d5b2 drivers/video/au1100fb.c Julia Lawall 2012-01-21 525 return -ENODEV;
3b495f2bb749b8 drivers/video/au1100fb.c Pete Popov 2005-04-04 526 }
^1da177e4c3f41 drivers/video/au1100fb.c Linus Torvalds 2005-04-16 527
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] fbdev: au1100fb: Don't store device specific data in global variables
2026-02-07 21:34 ` Uwe Kleine-König
@ 2026-02-08 17:48 ` Uwe Kleine-König
0 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2026-02-08 17:48 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
[-- Attachment #1: Type: text/plain, Size: 749 bytes --]
Hello,
On Sat, Feb 07, 2026 at 10:34:21PM +0100, Uwe Kleine-König wrote:
> > > @@ -559,7 +554,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
> > > clk_disable(fbdev->lcdclk);
> > > - memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
> > > + memcpy(&fbdev->pm_regs, fbdev->regs, sizeof(struct au1100fb_regs));
> >
> > Although memcpy() was used before, isn't this:
> > fbdev->pm_regs = *fbdev->regs;
> > sufficient and better?
>
> Probably yes, that's a separate patch then.
Thinking again: this is copying from io memory. So both memcpy and
struct assignment might be a bad idea. I'll keep it as is, this driver
already occupies me much longer than I intended.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-02-08 17:48 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-07 17:12 [PATCH v2 0/4] fbdev: au1100fb: support COMPILE_TEST and fix multi-device support Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 1/4] fbdev: au1100fb: Don't store device specific data in global variables Uwe Kleine-König
2026-02-07 19:04 ` Helge Deller
2026-02-07 21:34 ` Uwe Kleine-König
2026-02-08 17:48 ` Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 2/4] fbdev: au1100fb: Mark several local functions as static Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 3/4] fbdev: au1100fb: Use %zu to printk a value of type size_t Uwe Kleine-König
2026-02-07 19:06 ` Helge Deller
2026-02-07 21:32 ` Uwe Kleine-König
2026-02-07 17:12 ` [PATCH v2 4/4] fbdev: au1100fb: Make driver compilable on non-mips platforms Uwe Kleine-König
2026-02-07 22:02 ` kernel test robot
2026-02-07 23:04 ` kernel test robot
2026-02-08 11:12 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox