Skip to content

Commit 9af07af

Browse files
committed
Merge tag 'topic/drm-misc-2016-07-22' of git://anongit.freedesktop.org/drm-intel into drm-next
Suddenly everyone shows up with their trivial patch series! - piles of if (!ptr) check removals from Markus Elfring - more of_node_put fixes from Peter Chen - make fbdev support really optional in all drivers (except vmwgfx), somehow this fell through the cracks when we did all the hard prep work a while ago. Patches from Tobias Jakobi. - leftover patches for the connector reg/unreg cleanup (required that I backmerged drm-next) from Chris - last vgem fence patch from Chris - fix up warnings in the new sphinx gpu docs build - misc other small bits * tag 'topic/drm-misc-2016-07-22' of git://anongit.freedesktop.org/drm-intel: (57 commits) GPU-DRM-Exynos: Delete an unnecessary check before the function call "vunmap" GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() drm/atomic: Delete an unnecessary check before drm_property_unreference_blob() drm/rockchip: analogix_dp: add missing clk_disable_unprepare() on error drm: drm_connector->s/connector_id/index/ for consistency drm/virtio: Fix non static symbol warning drm/arc: Remove redundant dev_err call in arcpgu_load() drm/arc: Fix some sparse warnings drm/vgem: Fix non static symbol warning drm/doc: Spinx leftovers drm/dp-mst: Missing kernel doc drm/dp-mst: Remove tx_down_in_progress drm/doc: Fix missing kerneldoc for drm_dp_helper.c drm: Extract&Document drm_irq.h drm/doc: document all the properties in drm_mode_config drm/drm-kms.rst: Remove unused drm_fourcc.h include directive drm/doc: Add kerneldoc for @index drm: Unexport drm_connector_unregister_all() drm/sun4i: Remove redundant call to drm_connector_unregister_all() drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy" ...
2 parents 5e58052 + e8d3ef0 commit 9af07af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+988
-361
lines changed

Documentation/gpu/drm-internals.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ Manual IRQ Registration
188188
Drivers that require multiple interrupt handlers can't use the managed
189189
IRQ registration functions. In that case IRQs must be registered and
190190
unregistered manually (usually with the :c:func:`request_irq()` and
191-
:c:func:`free_irq()` functions, or their devm_\* equivalent).
191+
:c:func:`free_irq()` functions, or their :c:func:`devm_request_irq()` and
192+
:c:func:`devm_free_irq()` equivalents).
192193

193194
When manually registering IRQs, drivers must not set the
194195
DRIVER_HAVE_IRQ driver feature flag, and must not provide the
@@ -242,11 +243,13 @@ Open/Close, File Operations and IOCTLs
242243
Open and Close
243244
--------------
244245

245-
int (\*firstopen) (struct drm_device \*); void (\*lastclose) (struct
246-
drm_device \*); int (\*open) (struct drm_device \*, struct drm_file
247-
\*); void (\*preclose) (struct drm_device \*, struct drm_file \*);
248-
void (\*postclose) (struct drm_device \*, struct drm_file \*);
249-
Open and close handlers. None of those methods are mandatory.
246+
Open and close handlers. None of those methods are mandatory::
247+
248+
int (*firstopen) (struct drm_device *);
249+
void (*lastclose) (struct drm_device *);
250+
int (*open) (struct drm_device *, struct drm_file *);
251+
void (*preclose) (struct drm_device *, struct drm_file *);
252+
void (*postclose) (struct drm_device *, struct drm_file *);
250253

251254
The firstopen method is called by the DRM core for legacy UMS (User Mode
252255
Setting) drivers only when an application opens a device that has no

Documentation/gpu/drm-kms.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ drivers can manually clean up a framebuffer at module unload time with
6767
DRM Format Handling
6868
-------------------
6969

70-
.. kernel-doc:: include/drm/drm_fourcc.h
71-
:internal:
72-
7370
.. kernel-doc:: drivers/gpu/drm/drm_fourcc.c
7471
:export:
7572

@@ -652,5 +649,5 @@ Vertical Blanking and Interrupt Handling Functions Reference
652649
.. kernel-doc:: drivers/gpu/drm/drm_irq.c
653650
:export:
654651

655-
.. kernel-doc:: include/drm/drmP.h
656-
:functions: drm_crtc_vblank_waitqueue
652+
.. kernel-doc:: include/drm/drm_irq.h
653+
:internal:

drivers/dma-buf/dma-buf.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)
334334
struct reservation_object *resv = exp_info->resv;
335335
struct file *file;
336336
size_t alloc_size = sizeof(struct dma_buf);
337+
int ret;
337338

338339
if (!exp_info->resv)
339340
alloc_size += sizeof(struct reservation_object);
@@ -357,8 +358,8 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)
357358

358359
dmabuf = kzalloc(alloc_size, GFP_KERNEL);
359360
if (!dmabuf) {
360-
module_put(exp_info->owner);
361-
return ERR_PTR(-ENOMEM);
361+
ret = -ENOMEM;
362+
goto err_module;
362363
}
363364

364365
dmabuf->priv = exp_info->priv;
@@ -379,8 +380,8 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)
379380
file = anon_inode_getfile("dmabuf", &dma_buf_fops, dmabuf,
380381
exp_info->flags);
381382
if (IS_ERR(file)) {
382-
kfree(dmabuf);
383-
return ERR_CAST(file);
383+
ret = PTR_ERR(file);
384+
goto err_dmabuf;
384385
}
385386

386387
file->f_mode |= FMODE_LSEEK;
@@ -394,6 +395,12 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)
394395
mutex_unlock(&db_list.lock);
395396

396397
return dmabuf;
398+
399+
err_dmabuf:
400+
kfree(dmabuf);
401+
err_module:
402+
module_put(exp_info->owner);
403+
return ERR_PTR(ret);
397404
}
398405
EXPORT_SYMBOL_GPL(dma_buf_export);
399406

drivers/gpu/drm/arc/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ config DRM_ARCPGU
22
tristate "ARC PGU"
33
depends on DRM && OF
44
select DRM_KMS_CMA_HELPER
5-
select DRM_KMS_FB_HELPER
65
select DRM_KMS_HELPER
76
help
87
Choose this option if you have an ARC PGU controller.

drivers/gpu/drm/arc/arcpgu_drv.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ static void arcpgu_fb_output_poll_changed(struct drm_device *dev)
2828
{
2929
struct arcpgu_drm_private *arcpgu = dev->dev_private;
3030

31-
if (arcpgu->fbdev)
32-
drm_fbdev_cma_hotplug_event(arcpgu->fbdev);
31+
drm_fbdev_cma_hotplug_event(arcpgu->fbdev);
3332
}
3433

3534
static struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
@@ -49,7 +48,7 @@ static void arcpgu_setup_mode_config(struct drm_device *drm)
4948
drm->mode_config.funcs = &arcpgu_drm_modecfg_funcs;
5049
}
5150

52-
int arcpgu_gem_mmap(struct file *filp, struct vm_area_struct *vma)
51+
static int arcpgu_gem_mmap(struct file *filp, struct vm_area_struct *vma)
5352
{
5453
int ret;
5554

@@ -104,10 +103,8 @@ static int arcpgu_load(struct drm_device *drm)
104103

105104
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
106105
arcpgu->regs = devm_ioremap_resource(&pdev->dev, res);
107-
if (IS_ERR(arcpgu->regs)) {
108-
dev_err(drm->dev, "Could not remap IO mem\n");
106+
if (IS_ERR(arcpgu->regs))
109107
return PTR_ERR(arcpgu->regs);
110-
}
111108

112109
dev_info(drm->dev, "arc_pgu ID: 0x%x\n",
113110
arc_pgu_read(arcpgu, ARCPGU_REG_ID));
@@ -127,10 +124,11 @@ static int arcpgu_load(struct drm_device *drm)
127124
encoder_node = of_parse_phandle(drm->dev->of_node, "encoder-slave", 0);
128125
if (encoder_node) {
129126
ret = arcpgu_drm_hdmi_init(drm, encoder_node);
127+
of_node_put(encoder_node);
130128
if (ret < 0)
131129
return ret;
132130
} else {
133-
ret = arcpgu_drm_sim_init(drm, 0);
131+
ret = arcpgu_drm_sim_init(drm, NULL);
134132
if (ret < 0)
135133
return ret;
136134
}
@@ -151,7 +149,7 @@ static int arcpgu_load(struct drm_device *drm)
151149
return 0;
152150
}
153151

154-
int arcpgu_unload(struct drm_device *drm)
152+
static int arcpgu_unload(struct drm_device *drm)
155153
{
156154
struct arcpgu_drm_private *arcpgu = drm->dev_private;
157155

drivers/gpu/drm/arm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ config DRM_HDLCD
99
depends on COMMON_CLK
1010
select DRM_ARM
1111
select DRM_KMS_HELPER
12-
select DRM_KMS_FB_HELPER
1312
select DRM_KMS_CMA_HELPER
1413
help
1514
Choose this option if you have an ARM High Definition Colour LCD

drivers/gpu/drm/arm/hdlcd_drv.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ static void hdlcd_fb_output_poll_changed(struct drm_device *drm)
102102
{
103103
struct hdlcd_drm_private *hdlcd = drm->dev_private;
104104

105-
if (hdlcd->fbdev)
106-
drm_fbdev_cma_hotplug_event(hdlcd->fbdev);
105+
drm_fbdev_cma_hotplug_event(hdlcd->fbdev);
107106
}
108107

109108
static const struct drm_mode_config_funcs hdlcd_mode_config_funcs = {

drivers/gpu/drm/armada/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
config DRM_ARMADA
22
tristate "DRM support for Marvell Armada SoCs"
33
depends on DRM && HAVE_CLK && ARM
4-
select FB_CFB_FILLRECT
5-
select FB_CFB_COPYAREA
6-
select FB_CFB_IMAGEBLIT
74
select DRM_KMS_HELPER
8-
select DRM_KMS_FB_HELPER
95
help
106
Support the "LCD" controllers found on the Marvell Armada 510
117
devices. There are two controllers on the device, each controller

drivers/gpu/drm/ast/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ config DRM_AST
22
tristate "AST server chips"
33
depends on DRM && PCI
44
select DRM_TTM
5-
select FB_SYS_COPYAREA
6-
select FB_SYS_FILLRECT
7-
select FB_SYS_IMAGEBLIT
85
select DRM_KMS_HELPER
9-
select DRM_KMS_FB_HELPER
106
select DRM_TTM
117
help
128
Say yes for experimental AST GPU driver. Do not enable

drivers/gpu/drm/ast/ast_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,8 @@ static int ast_get_dram_info(struct drm_device *dev)
295295
static void ast_user_framebuffer_destroy(struct drm_framebuffer *fb)
296296
{
297297
struct ast_framebuffer *ast_fb = to_ast_framebuffer(fb);
298-
if (ast_fb->obj)
299-
drm_gem_object_unreference_unlocked(ast_fb->obj);
300298

299+
drm_gem_object_unreference_unlocked(ast_fb->obj);
301300
drm_framebuffer_cleanup(fb);
302301
kfree(fb);
303302
}

drivers/gpu/drm/atmel-hlcdc/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ config DRM_ATMEL_HLCDC
33
depends on DRM && OF && COMMON_CLK && MFD_ATMEL_HLCDC && ARM
44
select DRM_GEM_CMA_HELPER
55
select DRM_KMS_HELPER
6-
select DRM_KMS_FB_HELPER
76
select DRM_KMS_CMA_HELPER
87
select DRM_PANEL
98
help

drivers/gpu/drm/bochs/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ config DRM_BOCHS
22
tristate "DRM Support for bochs dispi vga interface (qemu stdvga)"
33
depends on DRM && PCI
44
select DRM_KMS_HELPER
5-
select DRM_KMS_FB_HELPER
6-
select FB_SYS_FILLRECT
7-
select FB_SYS_COPYAREA
8-
select FB_SYS_IMAGEBLIT
95
select DRM_TTM
106
help
117
Choose this option for qemu.

drivers/gpu/drm/bochs/bochs_mm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ int bochs_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev,
465465
static void bochs_user_framebuffer_destroy(struct drm_framebuffer *fb)
466466
{
467467
struct bochs_framebuffer *bochs_fb = to_bochs_framebuffer(fb);
468-
if (bochs_fb->obj)
469-
drm_gem_object_unreference_unlocked(bochs_fb->obj);
468+
469+
drm_gem_object_unreference_unlocked(bochs_fb->obj);
470470
drm_framebuffer_cleanup(fb);
471471
kfree(fb);
472472
}

drivers/gpu/drm/cirrus/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
config DRM_CIRRUS_QEMU
22
tristate "Cirrus driver for QEMU emulated device"
33
depends on DRM && PCI
4-
select FB_SYS_FILLRECT
5-
select FB_SYS_COPYAREA
6-
select FB_SYS_IMAGEBLIT
74
select DRM_KMS_HELPER
8-
select DRM_KMS_FB_HELPER
95
select DRM_TTM
106
help
117
This is a KMS driver for emulated cirrus device in qemu.

drivers/gpu/drm/cirrus/cirrus_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
static void cirrus_user_framebuffer_destroy(struct drm_framebuffer *fb)
1818
{
1919
struct cirrus_framebuffer *cirrus_fb = to_cirrus_framebuffer(fb);
20-
if (cirrus_fb->obj)
21-
drm_gem_object_unreference_unlocked(cirrus_fb->obj);
20+
21+
drm_gem_object_unreference_unlocked(cirrus_fb->obj);
2222
drm_framebuffer_cleanup(fb);
2323
kfree(fb);
2424
}

drivers/gpu/drm/drm_atomic.c

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,7 @@ drm_atomic_replace_property_blob(struct drm_property_blob **blob,
404404
if (old_blob == new_blob)
405405
return;
406406

407-
if (old_blob)
408-
drm_property_unreference_blob(old_blob);
407+
drm_property_unreference_blob(old_blob);
409408
if (new_blob)
410409
drm_property_reference_blob(new_blob);
411410
*blob = new_blob;
@@ -1589,72 +1588,6 @@ void drm_atomic_clean_old_fb(struct drm_device *dev,
15891588
}
15901589
EXPORT_SYMBOL(drm_atomic_clean_old_fb);
15911590

1592-
int drm_atomic_remove_fb(struct drm_framebuffer *fb)
1593-
{
1594-
struct drm_modeset_acquire_ctx ctx;
1595-
struct drm_device *dev = fb->dev;
1596-
struct drm_atomic_state *state;
1597-
struct drm_plane *plane;
1598-
int ret = 0;
1599-
unsigned plane_mask;
1600-
1601-
state = drm_atomic_state_alloc(dev);
1602-
if (!state)
1603-
return -ENOMEM;
1604-
1605-
drm_modeset_acquire_init(&ctx, 0);
1606-
state->acquire_ctx = &ctx;
1607-
1608-
retry:
1609-
plane_mask = 0;
1610-
ret = drm_modeset_lock_all_ctx(dev, &ctx);
1611-
if (ret)
1612-
goto unlock;
1613-
1614-
drm_for_each_plane(plane, dev) {
1615-
struct drm_plane_state *plane_state;
1616-
1617-
if (plane->state->fb != fb)
1618-
continue;
1619-
1620-
plane_state = drm_atomic_get_plane_state(state, plane);
1621-
if (IS_ERR(plane_state)) {
1622-
ret = PTR_ERR(plane_state);
1623-
goto unlock;
1624-
}
1625-
1626-
drm_atomic_set_fb_for_plane(plane_state, NULL);
1627-
ret = drm_atomic_set_crtc_for_plane(plane_state, NULL);
1628-
if (ret)
1629-
goto unlock;
1630-
1631-
plane_mask |= BIT(drm_plane_index(plane));
1632-
1633-
plane->old_fb = plane->fb;
1634-
plane->fb = NULL;
1635-
}
1636-
1637-
if (plane_mask)
1638-
ret = drm_atomic_commit(state);
1639-
1640-
unlock:
1641-
if (plane_mask)
1642-
drm_atomic_clean_old_fb(dev, plane_mask, ret);
1643-
1644-
if (ret == -EDEADLK) {
1645-
drm_modeset_backoff(&ctx);
1646-
goto retry;
1647-
}
1648-
1649-
if (ret || !plane_mask)
1650-
drm_atomic_state_free(state);
1651-
1652-
drm_modeset_drop_locks(&ctx);
1653-
drm_modeset_acquire_fini(&ctx);
1654-
1655-
return ret;
1656-
}
1657-
16581591
int drm_mode_atomic_ioctl(struct drm_device *dev,
16591592
void *data, struct drm_file *file_priv)
16601593
{

0 commit comments

Comments
 (0)