Commit 5e9af4b4 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fbdev-for-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes from Helge Deller:

 - Fix Matrox G200eW initialization failure

 - Fix build failure of offb driver when built as module

 - Optimize stack usage in omapfb

* tag 'fbdev-for-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: omapfb: avoid stack overflow warning
  fbdev: matroxfb: G200eW: Increase max memory from 1 MB to 16 MB
  fbdev: atyfb: use strscpy() to instead of strncpy()
  fbdev: omapfb: use strscpy() to instead of strncpy()
  fbdev: make offb driver tristate
parents 41c03ba9 634cf6ea
...@@ -456,8 +456,8 @@ config FB_ATARI ...@@ -456,8 +456,8 @@ config FB_ATARI
chipset found in Ataris. chipset found in Ataris.
config FB_OF config FB_OF
bool "Open Firmware frame buffer device support" tristate "Open Firmware frame buffer device support"
depends on (FB = y) && PPC && (!PPC_PSERIES || PCI) depends on FB && PPC && (!PPC_PSERIES || PCI)
depends on !DRM_OFDRM depends on !DRM_OFDRM
select APERTURE_HELPERS select APERTURE_HELPERS
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
......
...@@ -3192,8 +3192,7 @@ static void aty_init_lcd(struct atyfb_par *par, u32 bios_base) ...@@ -3192,8 +3192,7 @@ static void aty_init_lcd(struct atyfb_par *par, u32 bios_base)
* which we print to the screen. * which we print to the screen.
*/ */
id = *(u8 *)par->lcd_table; id = *(u8 *)par->lcd_table;
strncpy(model, (char *)par->lcd_table+1, 24); strscpy(model, (char *)par->lcd_table+1, sizeof(model));
model[23] = 0;
width = par->lcd_width = *(u16 *)(par->lcd_table+25); width = par->lcd_width = *(u16 *)(par->lcd_table+25);
height = par->lcd_height = *(u16 *)(par->lcd_table+27); height = par->lcd_height = *(u16 *)(par->lcd_table+27);
......
...@@ -1378,8 +1378,8 @@ static struct video_board vbG200 = { ...@@ -1378,8 +1378,8 @@ static struct video_board vbG200 = {
.lowlevel = &matrox_G100 .lowlevel = &matrox_G100
}; };
static struct video_board vbG200eW = { static struct video_board vbG200eW = {
.maxvram = 0x100000, .maxvram = 0x1000000,
.maxdisplayable = 0x800000, .maxdisplayable = 0x0800000,
.accelID = FB_ACCEL_MATROX_MGAG200, .accelID = FB_ACCEL_MATROX_MGAG200,
.lowlevel = &matrox_G100 .lowlevel = &matrox_G100
}; };
......
...@@ -1447,7 +1447,7 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info) ...@@ -1447,7 +1447,7 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
info->fbops = &omapfb_ops; info->fbops = &omapfb_ops;
info->flags = FBINFO_FLAG_DEFAULT; info->flags = FBINFO_FLAG_DEFAULT;
strncpy(fix->id, MODULE_NAME, sizeof(fix->id)); strscpy(fix->id, MODULE_NAME, sizeof(fix->id));
info->pseudo_palette = fbdev->pseudo_palette; info->pseudo_palette = fbdev->pseudo_palette;
...@@ -1573,8 +1573,7 @@ static int omapfb_find_ctrl(struct omapfb_device *fbdev) ...@@ -1573,8 +1573,7 @@ static int omapfb_find_ctrl(struct omapfb_device *fbdev)
fbdev->ctrl = NULL; fbdev->ctrl = NULL;
strncpy(name, conf->lcd.ctrl_name, sizeof(name) - 1); strscpy(name, conf->lcd.ctrl_name, sizeof(name));
name[sizeof(name) - 1] = '\0';
if (strcmp(name, "internal") == 0) { if (strcmp(name, "internal") == 0) {
fbdev->ctrl = fbdev->int_ctrl; fbdev->ctrl = fbdev->int_ctrl;
......
...@@ -1536,22 +1536,28 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, ...@@ -1536,22 +1536,28 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev,
{ {
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
unsigned long flags; unsigned long flags;
struct dsi_irq_stats stats; struct dsi_irq_stats *stats;
stats = kzalloc(sizeof(*stats), GFP_KERNEL);
if (!stats) {
seq_printf(s, "out of memory\n");
return;
}
spin_lock_irqsave(&dsi->irq_stats_lock, flags); spin_lock_irqsave(&dsi->irq_stats_lock, flags);
stats = dsi->irq_stats; *stats = dsi->irq_stats;
memset(&dsi->irq_stats, 0, sizeof(dsi->irq_stats)); memset(&dsi->irq_stats, 0, sizeof(dsi->irq_stats));
dsi->irq_stats.last_reset = jiffies; dsi->irq_stats.last_reset = jiffies;
spin_unlock_irqrestore(&dsi->irq_stats_lock, flags); spin_unlock_irqrestore(&dsi->irq_stats_lock, flags);
seq_printf(s, "period %u ms\n", seq_printf(s, "period %u ms\n",
jiffies_to_msecs(jiffies - stats.last_reset)); jiffies_to_msecs(jiffies - stats->last_reset));
seq_printf(s, "irqs %d\n", stats.irq_count); seq_printf(s, "irqs %d\n", stats->irq_count);
#define PIS(x) \ #define PIS(x) \
seq_printf(s, "%-20s %10d\n", #x, stats.dsi_irqs[ffs(DSI_IRQ_##x)-1]) seq_printf(s, "%-20s %10d\n", #x, stats->dsi_irqs[ffs(DSI_IRQ_##x)-1])
seq_printf(s, "-- DSI%d interrupts --\n", dsi->module_id + 1); seq_printf(s, "-- DSI%d interrupts --\n", dsi->module_id + 1);
PIS(VC0); PIS(VC0);
...@@ -1575,10 +1581,10 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, ...@@ -1575,10 +1581,10 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev,
#define PIS(x) \ #define PIS(x) \
seq_printf(s, "%-20s %10d %10d %10d %10d\n", #x, \ seq_printf(s, "%-20s %10d %10d %10d %10d\n", #x, \
stats.vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \ stats->vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \
stats.vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \ stats->vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \
stats.vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \ stats->vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \
stats.vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]); stats->vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]);
seq_printf(s, "-- VC interrupts --\n"); seq_printf(s, "-- VC interrupts --\n");
PIS(CS); PIS(CS);
...@@ -1594,7 +1600,7 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, ...@@ -1594,7 +1600,7 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev,
#define PIS(x) \ #define PIS(x) \
seq_printf(s, "%-20s %10d\n", #x, \ seq_printf(s, "%-20s %10d\n", #x, \
stats.cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]); stats->cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]);
seq_printf(s, "-- CIO interrupts --\n"); seq_printf(s, "-- CIO interrupts --\n");
PIS(ERRSYNCESC1); PIS(ERRSYNCESC1);
...@@ -1618,6 +1624,8 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, ...@@ -1618,6 +1624,8 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev,
PIS(ULPSACTIVENOT_ALL0); PIS(ULPSACTIVENOT_ALL0);
PIS(ULPSACTIVENOT_ALL1); PIS(ULPSACTIVENOT_ALL1);
#undef PIS #undef PIS
kfree(stats);
} }
static void dsi1_dump_irqs(struct seq_file *s) static void dsi1_dump_irqs(struct seq_file *s)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment