Skip to content

Commit 71e4a70

Browse files
committed
Merge tag 'drm-misc-fixes-2022-01-14' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
Two DT bindings fixes for meson, a device refcounting fix for sun4i, a probe fix for vga16fb, a locking fix for the CMA dma-buf heap and a compilation fix for ttm. Signed-off-by: Daniel Vetter <[email protected]> [danvet: I made sure I have exactly the same conflict resolution as Linus in 8d0749b ("Merge tag 'drm-next-2022-01-07' of git://anongit.freedesktop.org/drm/drm") to avoid further conflict fun. From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20220114125454.zs46ny52lrxk3ljz@houat
2 parents ad783ff + 016017a commit 71e4a70

File tree

11 files changed

+87
-27
lines changed

11 files changed

+87
-27
lines changed

Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ title: Amlogic specific extensions to the Synopsys Designware HDMI Controller
1010
maintainers:
1111
- Neil Armstrong <[email protected]>
1212

13+
allOf:
14+
- $ref: /schemas/sound/name-prefix.yaml#
15+
1316
description: |
1417
The Amlogic Meson Synopsys Designware Integration is composed of
1518
- A Synopsys DesignWare HDMI Controller IP
@@ -99,6 +102,8 @@ properties:
99102
"#sound-dai-cells":
100103
const: 0
101104

105+
sound-name-prefix: true
106+
102107
required:
103108
- compatible
104109
- reg

Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ properties:
7878
interrupts:
7979
maxItems: 1
8080

81+
amlogic,canvas:
82+
description: should point to a canvas provider node
83+
$ref: /schemas/types.yaml#/definitions/phandle
84+
8185
power-domains:
8286
maxItems: 1
8387
description: phandle to the associated power domain
@@ -106,6 +110,7 @@ required:
106110
- port@1
107111
- "#address-cells"
108112
- "#size-cells"
113+
- amlogic,canvas
109114

110115
additionalProperties: false
111116

@@ -118,6 +123,7 @@ examples:
118123
interrupts = <3>;
119124
#address-cells = <1>;
120125
#size-cells = <0>;
126+
amlogic,canvas = <&canvas>;
121127
122128
/* CVBS VDAC output port */
123129
port@0 {

drivers/dma-buf/heaps/cma_heap.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,11 @@ static int cma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
124124
struct cma_heap_buffer *buffer = dmabuf->priv;
125125
struct dma_heap_attachment *a;
126126

127+
mutex_lock(&buffer->lock);
128+
127129
if (buffer->vmap_cnt)
128130
invalidate_kernel_vmap_range(buffer->vaddr, buffer->len);
129131

130-
mutex_lock(&buffer->lock);
131132
list_for_each_entry(a, &buffer->attachments, list) {
132133
if (!a->mapped)
133134
continue;
@@ -144,10 +145,11 @@ static int cma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf,
144145
struct cma_heap_buffer *buffer = dmabuf->priv;
145146
struct dma_heap_attachment *a;
146147

148+
mutex_lock(&buffer->lock);
149+
147150
if (buffer->vmap_cnt)
148151
flush_kernel_vmap_range(buffer->vaddr, buffer->len);
149152

150-
mutex_lock(&buffer->lock);
151153
list_for_each_entry(a, &buffer->attachments, list) {
152154
if (!a->mapped)
153155
continue;

drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
381381
struct amdgpu_vm_bo_base *bo_base;
382382
int r;
383383

384-
if (bo->tbo.resource->mem_type == TTM_PL_SYSTEM)
384+
if (!bo->tbo.resource || bo->tbo.resource->mem_type == TTM_PL_SYSTEM)
385385
return;
386386

387387
r = ttm_bo_validate(&bo->tbo, &placement, &ctx);

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,10 @@ static void ast_crtc_reset(struct drm_crtc *crtc)
11181118
if (crtc->state)
11191119
crtc->funcs->atomic_destroy_state(crtc, crtc->state);
11201120

1121-
__drm_atomic_helper_crtc_reset(crtc, &ast_state->base);
1121+
if (ast_state)
1122+
__drm_atomic_helper_crtc_reset(crtc, &ast_state->base);
1123+
else
1124+
__drm_atomic_helper_crtc_reset(crtc, NULL);
11221125
}
11231126

11241127
static struct drm_crtc_state *

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,13 @@ void drm_fb_helper_fill_info(struct fb_info *info,
17431743
sizes->fb_width, sizes->fb_height);
17441744

17451745
info->par = fb_helper;
1746-
snprintf(info->fix.id, sizeof(info->fix.id), "%s",
1746+
/*
1747+
* The DRM drivers fbdev emulation device name can be confusing if the
1748+
* driver name also has a "drm" suffix on it. Leading to names such as
1749+
* "simpledrmdrmfb" in /proc/fb. Unfortunately, it's an uAPI and can't
1750+
* be changed due user-space tools (e.g: pm-utils) matching against it.
1751+
*/
1752+
snprintf(info->fix.id, sizeof(info->fix.id), "%sdrmfb",
17471753
fb_helper->dev->driver->name);
17481754

17491755
}

drivers/gpu/drm/nouveau/nouveau_fence.c

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -344,38 +344,48 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan,
344344
{
345345
struct nouveau_fence_chan *fctx = chan->fence;
346346
struct dma_resv *resv = nvbo->bo.base.resv;
347-
struct dma_resv_iter cursor;
348-
struct dma_fence *fence;
349-
struct nouveau_fence *f;
350-
int ret;
347+
int i, ret;
351348

352349
if (!exclusive) {
353350
ret = dma_resv_reserve_shared(resv, 1);
354-
355351
if (ret)
356352
return ret;
357353
}
358354

359-
dma_resv_for_each_fence(&cursor, resv, exclusive, fence) {
360-
struct nouveau_channel *prev = NULL;
361-
bool must_wait = true;
362-
363-
f = nouveau_local_fence(fence, chan->drm);
364-
if (f) {
365-
rcu_read_lock();
366-
prev = rcu_dereference(f->channel);
367-
if (prev && (prev == chan ||
368-
fctx->sync(f, prev, chan) == 0))
369-
must_wait = false;
370-
rcu_read_unlock();
371-
}
355+
/* Waiting for the exclusive fence first causes performance regressions
356+
* under some circumstances. So manually wait for the shared ones first.
357+
*/
358+
for (i = 0; i < 2; ++i) {
359+
struct dma_resv_iter cursor;
360+
struct dma_fence *fence;
361+
362+
dma_resv_for_each_fence(&cursor, resv, exclusive, fence) {
363+
struct nouveau_fence *f;
364+
365+
if (i == 0 && dma_resv_iter_is_exclusive(&cursor))
366+
continue;
367+
368+
f = nouveau_local_fence(fence, chan->drm);
369+
if (f) {
370+
struct nouveau_channel *prev;
371+
bool must_wait = true;
372+
373+
rcu_read_lock();
374+
prev = rcu_dereference(f->channel);
375+
if (prev && (prev == chan ||
376+
fctx->sync(f, prev, chan) == 0))
377+
must_wait = false;
378+
rcu_read_unlock();
379+
if (!must_wait)
380+
continue;
381+
}
372382

373-
if (must_wait) {
374383
ret = dma_fence_wait(fence, intr);
375384
if (ret)
376385
return ret;
377386
}
378387
}
388+
379389
return 0;
380390
}
381391

drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,10 @@ int sun8i_hdmi_phy_get(struct sun8i_dw_hdmi *hdmi, struct device_node *node)
658658
return -EPROBE_DEFER;
659659

660660
phy = platform_get_drvdata(pdev);
661-
if (!phy)
661+
if (!phy) {
662+
put_device(&pdev->dev);
662663
return -EPROBE_DEFER;
664+
}
663665

664666
hdmi->phy = phy;
665667

drivers/gpu/drm/tiny/simpledrm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static struct drm_display_mode simpledrm_mode(unsigned int width,
459459
{
460460
struct drm_display_mode mode = { SIMPLEDRM_MODE(width, height) };
461461

462-
mode.clock = 60 /* Hz */ * mode.hdisplay * mode.vdisplay;
462+
mode.clock = mode.hdisplay * mode.vdisplay * 60 / 1000 /* kHz */;
463463
drm_mode_set_name(&mode);
464464

465465
return mode;

drivers/gpu/drm/ttm/ttm_module.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ pgprot_t ttm_prot_from_caching(enum ttm_caching caching, pgprot_t tmp)
6868
#if defined(__i386__) || defined(__x86_64__)
6969
if (caching == ttm_write_combined)
7070
tmp = pgprot_writecombine(tmp);
71+
#ifndef CONFIG_UML
7172
else if (boot_cpu_data.x86 > 3)
7273
tmp = pgprot_noncached(tmp);
73-
#endif
74+
#endif /* CONFIG_UML */
75+
#endif /* __i386__ || __x86_64__ */
7476
#if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \
7577
defined(__powerpc__) || defined(__mips__)
7678
if (caching == ttm_write_combined)

0 commit comments

Comments
 (0)