Skip to content

Commit e20bb85

Browse files
committed
Merge tag 'exynos-drm-next-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
Check imported buffer mapping in generic way - This patch reworks exynos_drm_gem_prime_import_sg_table function, which checks if the imported buffer has been mapped as contiguous or not in generic way, and flag a exynos gem buffer type properly according to the mapped way. Fixups - Drop a reference count to in_bridge_node correctly. - Enable the runtime power management correctly. . The runtime pm should be enabled before calling compont_add(). Cleanups - Do not register "by hand" a sysfs file, and use dev_groups instead. - Drop internal 'pages' array which aren't needed. - Remove dead-code. - Correct type casting. - Drop unnecessary error messages. Signed-off-by: Dave Airlie <[email protected]> From: Inki Dae <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 6cf9916 + f84e1ba commit e20bb85

File tree

10 files changed

+103
-192
lines changed

10 files changed

+103
-192
lines changed

drivers/gpu/drm/exynos/exynos_drm_drv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
7676
}
7777

7878
static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
79-
.fault = exynos_drm_gem_fault,
8079
.open = drm_gem_vm_open,
8180
.close = drm_gem_vm_close,
8281
};

drivers/gpu/drm/exynos/exynos_drm_dsi.c

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212

213213
#define OLD_SCLK_MIPI_CLK_NAME "pll_clk"
214214

215-
static char *clk_names[5] = { "bus_clk", "sclk_mipi",
215+
static const char *const clk_names[5] = { "bus_clk", "sclk_mipi",
216216
"phyclk_mipidphy0_bitclkdiv8", "phyclk_mipidphy0_rxclkesc0",
217217
"sclk_rgb_vclk_to_dsim0" };
218218

@@ -1759,10 +1759,6 @@ static int exynos_dsi_probe(struct platform_device *pdev)
17591759
dsi->dev = dev;
17601760
dsi->driver_data = of_device_get_match_data(dev);
17611761

1762-
ret = exynos_dsi_parse_dt(dsi);
1763-
if (ret)
1764-
return ret;
1765-
17661762
dsi->supplies[0].supply = "vddcore";
17671763
dsi->supplies[1].supply = "vddio";
17681764
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(dsi->supplies),
@@ -1809,10 +1805,8 @@ static int exynos_dsi_probe(struct platform_device *pdev)
18091805
}
18101806

18111807
dsi->irq = platform_get_irq(pdev, 0);
1812-
if (dsi->irq < 0) {
1813-
dev_err(dev, "failed to request dsi irq resource\n");
1808+
if (dsi->irq < 0)
18141809
return dsi->irq;
1815-
}
18161810

18171811
irq_set_status_flags(dsi->irq, IRQ_NOAUTOEN);
18181812
ret = devm_request_threaded_irq(dev, dsi->irq, NULL,
@@ -1823,11 +1817,25 @@ static int exynos_dsi_probe(struct platform_device *pdev)
18231817
return ret;
18241818
}
18251819

1820+
ret = exynos_dsi_parse_dt(dsi);
1821+
if (ret)
1822+
return ret;
1823+
18261824
platform_set_drvdata(pdev, &dsi->encoder);
18271825

18281826
pm_runtime_enable(dev);
18291827

1830-
return component_add(dev, &exynos_dsi_component_ops);
1828+
ret = component_add(dev, &exynos_dsi_component_ops);
1829+
if (ret)
1830+
goto err_disable_runtime;
1831+
1832+
return 0;
1833+
1834+
err_disable_runtime:
1835+
pm_runtime_disable(dev);
1836+
of_node_put(dsi->in_bridge_node);
1837+
1838+
return ret;
18311839
}
18321840

18331841
static int exynos_dsi_remove(struct platform_device *pdev)

drivers/gpu/drm/exynos/exynos_drm_fbdev.c

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
7676
struct fb_info *fbi;
7777
struct drm_framebuffer *fb = helper->fb;
7878
unsigned int size = fb->width * fb->height * fb->format->cpp[0];
79-
unsigned int nr_pages;
8079
unsigned long offset;
8180

8281
fbi = drm_fb_helper_alloc_fbi(helper);
@@ -90,16 +89,6 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
9089

9190
drm_fb_helper_fill_info(fbi, helper, sizes);
9291

93-
nr_pages = exynos_gem->size >> PAGE_SHIFT;
94-
95-
exynos_gem->kvaddr = (void __iomem *) vmap(exynos_gem->pages, nr_pages,
96-
VM_MAP, pgprot_writecombine(PAGE_KERNEL));
97-
if (!exynos_gem->kvaddr) {
98-
DRM_DEV_ERROR(to_dma_dev(helper->dev),
99-
"failed to map pages to kernel space.\n");
100-
return -EIO;
101-
}
102-
10392
offset = fbi->var.xoffset * fb->format->cpp[0];
10493
offset += fbi->var.yoffset * fb->pitches[0];
10594

@@ -133,18 +122,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
133122

134123
size = mode_cmd.pitches[0] * mode_cmd.height;
135124

136-
exynos_gem = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG, size);
137-
/*
138-
* If physically contiguous memory allocation fails and if IOMMU is
139-
* supported then try to get buffer from non physically contiguous
140-
* memory area.
141-
*/
142-
if (IS_ERR(exynos_gem) && is_drm_iommu_supported(dev)) {
143-
dev_warn(dev->dev, "contiguous FB allocation failed, falling back to non-contiguous\n");
144-
exynos_gem = exynos_drm_gem_create(dev, EXYNOS_BO_NONCONTIG,
145-
size);
146-
}
147-
125+
exynos_gem = exynos_drm_gem_create(dev, EXYNOS_BO_WC, size, true);
148126
if (IS_ERR(exynos_gem))
149127
return PTR_ERR(exynos_gem);
150128

@@ -229,12 +207,8 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
229207
static void exynos_drm_fbdev_destroy(struct drm_device *dev,
230208
struct drm_fb_helper *fb_helper)
231209
{
232-
struct exynos_drm_fbdev *exynos_fbd = to_exynos_fbdev(fb_helper);
233-
struct exynos_drm_gem *exynos_gem = exynos_fbd->exynos_gem;
234210
struct drm_framebuffer *fb;
235211

236-
vunmap(exynos_gem->kvaddr);
237-
238212
/* release drm framebuffer and real buffer */
239213
if (fb_helper->fb && fb_helper->fb->funcs) {
240214
fb = fb_helper->fb;

0 commit comments

Comments
 (0)