Skip to content

Commit 8ab2afa

Browse files
committed
Merge tag 'for-5.19/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev
Pull fbdev fixes and updates from Helge Deller: "A buch of small fixes and cleanups, including: - vesafb: Fix a use-after-free due early fb_info cleanup - clcdfb: Fix refcount leak in clcdfb_of_vram_setup - hyperv_fb: Allow resolutions with size > 64 MB for Gen1 - pxa3xx-gcu: release the resources correctly in pxa3xx_gcu_probe/remove() - omapfb: Prevent compiler warning regarding hwa742_update_window_async()" * tag 'for-5.19/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: video: fbdev: omap: Add prototype for hwa742_update_window_async() video: fbdev: vesafb: Fix a use-after-free due early fb_info cleanup video: fbdev: radeon: Fix spelling typo in comment video: fbdev: xen: remove setting of 'transp' parameter video: fbdev: pxa3xx-gcu: release the resources correctly in pxa3xx_gcu_probe/remove() video: fbdev: omapfb: simplify the return expression of nec_8048_connect() video: fbdev: omapfb: simplify the return expression of dsi_init_pll_data() video: fbdev: clcdfb: Fix refcount leak in clcdfb_of_vram_setup video: fbdev: hyperv_fb: Allow resolutions with size > 64 MB for Gen1
2 parents e11a935 + 79b6612 commit 8ab2afa

File tree

9 files changed

+22
-41
lines changed

9 files changed

+22
-41
lines changed

drivers/video/fbdev/amba-clcd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,15 @@ static int clcdfb_of_vram_setup(struct clcd_fb *fb)
758758
return -ENODEV;
759759

760760
fb->fb.screen_base = of_iomap(memory, 0);
761-
if (!fb->fb.screen_base)
761+
if (!fb->fb.screen_base) {
762+
of_node_put(memory);
762763
return -ENOMEM;
764+
}
763765

764766
fb->fb.fix.smem_start = of_translate_address(memory,
765767
of_get_address(memory, 0, &size, NULL));
766768
fb->fb.fix.smem_len = size;
769+
of_node_put(memory);
767770

768771
return 0;
769772
}

drivers/video/fbdev/hyperv_fb.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
992992
struct pci_dev *pdev = NULL;
993993
void __iomem *fb_virt;
994994
int gen2vm = efi_enabled(EFI_BOOT);
995-
resource_size_t pot_start, pot_end;
996995
phys_addr_t paddr;
997996
int ret;
998997

@@ -1043,23 +1042,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
10431042
dio_fb_size =
10441043
screen_width * screen_height * screen_depth / 8;
10451044

1046-
if (gen2vm) {
1047-
pot_start = 0;
1048-
pot_end = -1;
1049-
} else {
1050-
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
1051-
pci_resource_len(pdev, 0) < screen_fb_size) {
1052-
pr_err("Resource not available or (0x%lx < 0x%lx)\n",
1053-
(unsigned long) pci_resource_len(pdev, 0),
1054-
(unsigned long) screen_fb_size);
1055-
goto err1;
1056-
}
1057-
1058-
pot_end = pci_resource_end(pdev, 0);
1059-
pot_start = pot_end - screen_fb_size + 1;
1060-
}
1061-
1062-
ret = vmbus_allocate_mmio(&par->mem, hdev, pot_start, pot_end,
1045+
ret = vmbus_allocate_mmio(&par->mem, hdev, 0, -1,
10631046
screen_fb_size, 0x100000, true);
10641047
if (ret != 0) {
10651048
pr_err("Unable to allocate framebuffer memory\n");

drivers/video/fbdev/omap/omapfb.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,5 +231,9 @@ extern int omapfb_update_window_async(struct fb_info *fbi,
231231
struct omapfb_update_window *win,
232232
void (*callback)(void *),
233233
void *callback_data);
234+
extern int hwa742_update_window_async(struct fb_info *fbi,
235+
struct omapfb_update_window *win,
236+
void (*callback)(void *),
237+
void *callback_data);
234238

235239
#endif /* __OMAPFB_H */

drivers/video/fbdev/omap2/omapfb/displays/panel-nec-nl8048hl11.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,11 @@ static int nec_8048_connect(struct omap_dss_device *dssdev)
117117
{
118118
struct panel_drv_data *ddata = to_panel_data(dssdev);
119119
struct omap_dss_device *in = ddata->in;
120-
int r;
121120

122121
if (omapdss_device_is_connected(dssdev))
123122
return 0;
124123

125-
r = in->ops.dpi->connect(in, dssdev);
126-
if (r)
127-
return r;
128-
129-
return 0;
124+
return in->ops.dpi->connect(in, dssdev);
130125
}
131126

132127
static void nec_8048_disconnect(struct omap_dss_device *dssdev)

drivers/video/fbdev/omap2/omapfb/dss/hdmi_pll.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ static int dsi_init_pll_data(struct platform_device *pdev, struct hdmi_pll_data
173173
{
174174
struct dss_pll *pll = &hpll->pll;
175175
struct clk *clk;
176-
int r;
177176

178177
clk = devm_clk_get(&pdev->dev, "sys_clk");
179178
if (IS_ERR(clk)) {
@@ -203,12 +202,7 @@ static int dsi_init_pll_data(struct platform_device *pdev, struct hdmi_pll_data
203202
}
204203

205204
pll->ops = &dsi_pll_ops;
206-
207-
r = dss_pll_register(pll);
208-
if (r)
209-
return r;
210-
211-
return 0;
205+
return dss_pll_register(pll);
212206
}
213207

214208
int hdmi_pll_init(struct platform_device *pdev, struct hdmi_pll_data *pll,

drivers/video/fbdev/pxa3xx-gcu.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
646646
for (i = 0; i < 8; i++) {
647647
ret = pxa3xx_gcu_add_buffer(dev, priv);
648648
if (ret) {
649+
pxa3xx_gcu_free_buffers(dev, priv);
649650
dev_err(dev, "failed to allocate DMA memory\n");
650651
goto err_disable_clk;
651652
}
@@ -662,15 +663,15 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
662663
SHARED_SIZE, irq);
663664
return 0;
664665

665-
err_free_dma:
666-
dma_free_coherent(dev, SHARED_SIZE,
667-
priv->shared, priv->shared_phys);
666+
err_disable_clk:
667+
clk_disable_unprepare(priv->clk);
668668

669669
err_misc_deregister:
670670
misc_deregister(&priv->misc_dev);
671671

672-
err_disable_clk:
673-
clk_disable_unprepare(priv->clk);
672+
err_free_dma:
673+
dma_free_coherent(dev, SHARED_SIZE,
674+
priv->shared, priv->shared_phys);
674675

675676
return ret;
676677
}
@@ -683,6 +684,7 @@ static int pxa3xx_gcu_remove(struct platform_device *pdev)
683684
pxa3xx_gcu_wait_idle(priv);
684685
misc_deregister(&priv->misc_dev);
685686
dma_free_coherent(dev, SHARED_SIZE, priv->shared, priv->shared_phys);
687+
clk_disable_unprepare(priv->clk);
686688
pxa3xx_gcu_free_buffers(dev, priv);
687689

688690
return 0;

drivers/video/fbdev/vesafb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,12 @@ static int vesafb_remove(struct platform_device *pdev)
490490
{
491491
struct fb_info *info = platform_get_drvdata(pdev);
492492

493-
/* vesafb_destroy takes care of info cleanup */
494-
unregister_framebuffer(info);
495493
if (((struct vesafb_par *)(info->par))->region)
496494
release_region(0x3c0, 32);
497495

496+
/* vesafb_destroy takes care of info cleanup */
497+
unregister_framebuffer(info);
498+
498499
return 0;
499500
}
500501

drivers/video/fbdev/xen-fbfront.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ static int xenfb_setcolreg(unsigned regno, unsigned red, unsigned green,
223223
red = CNVT_TOHW(red, info->var.red.length);
224224
green = CNVT_TOHW(green, info->var.green.length);
225225
blue = CNVT_TOHW(blue, info->var.blue.length);
226-
transp = CNVT_TOHW(transp, info->var.transp.length);
227226
#undef CNVT_TOHW
228227

229228
v = (red << info->var.red.offset) |

include/video/radeon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@
750750
#define WAIT_DMA_GUI_IDLE (1 << 9)
751751
#define WAIT_2D_IDLECLEAN (1 << 16)
752752

753-
/* SURFACE_CNTL bit consants */
753+
/* SURFACE_CNTL bit constants */
754754
#define SURF_TRANSLATION_DIS (1 << 8)
755755
#define NONSURF_AP0_SWP_16BPP (1 << 20)
756756
#define NONSURF_AP0_SWP_32BPP (1 << 21)

0 commit comments

Comments
 (0)