Skip to content

Commit a74229b

Browse files
committed
Merge tag 'drm-misc-fixes-2023-11-29' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Fixes for v6.7-rc4: - Revert panel fixes as they require exporting device_is_dependent. - Do not double add fences in dma_resv_add_fence. - Fix GPUVM license identifier. - Assorted nouveau fixes. - Fix error check for nt36523. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/561f807e-f9d3-43c1-80d3-8b41ba83c9ec@linux.intel.com
2 parents 5400133 + fb18fe0 commit a74229b

File tree

10 files changed

+27
-29
lines changed

10 files changed

+27
-29
lines changed

drivers/dma-buf/dma-resv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void dma_resv_add_fence(struct dma_resv *obj, struct dma_fence *fence,
301301

302302
dma_resv_list_entry(fobj, i, obj, &old, &old_usage);
303303
if ((old->context == fence->context && old_usage >= usage &&
304-
dma_fence_is_later(fence, old)) ||
304+
dma_fence_is_later_or_same(fence, old)) ||
305305
dma_fence_is_signaled(old)) {
306306
dma_resv_list_set(fobj, i, fence, usage);
307307
dma_fence_put(old);

drivers/gpu/drm/bridge/panel.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Copyright (C) 2017 Broadcom
55
*/
66

7-
#include <linux/device.h>
8-
97
#include <drm/drm_atomic_helper.h>
108
#include <drm/drm_bridge.h>
119
#include <drm/drm_connector.h>
@@ -21,7 +19,6 @@ struct panel_bridge {
2119
struct drm_bridge bridge;
2220
struct drm_connector connector;
2321
struct drm_panel *panel;
24-
struct device_link *link;
2522
u32 connector_type;
2623
};
2724

@@ -63,24 +60,13 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
6360
{
6461
struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
6562
struct drm_connector *connector = &panel_bridge->connector;
66-
struct drm_panel *panel = panel_bridge->panel;
67-
struct drm_device *drm_dev = bridge->dev;
6863
int ret;
6964

70-
panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
71-
DL_FLAG_STATELESS);
72-
if (!panel_bridge->link) {
73-
DRM_ERROR("Failed to add device link between %s and %s\n",
74-
dev_name(drm_dev->dev), dev_name(panel->dev));
75-
return -EINVAL;
76-
}
77-
7865
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
7966
return 0;
8067

8168
if (!bridge->encoder) {
8269
DRM_ERROR("Missing encoder\n");
83-
device_link_del(panel_bridge->link);
8470
return -ENODEV;
8571
}
8672

@@ -92,7 +78,6 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
9278
panel_bridge->connector_type);
9379
if (ret) {
9480
DRM_ERROR("Failed to initialize connector\n");
95-
device_link_del(panel_bridge->link);
9681
return ret;
9782
}
9883

@@ -115,8 +100,6 @@ static void panel_bridge_detach(struct drm_bridge *bridge)
115100
struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
116101
struct drm_connector *connector = &panel_bridge->connector;
117102

118-
device_link_del(panel_bridge->link);
119-
120103
/*
121104
* Cleanup the connector if we know it was initialized.
122105
*

drivers/gpu/drm/drm_gpuvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-License-Identifier: GPL-2.0 OR MIT
1+
// SPDX-License-Identifier: GPL-2.0-only OR MIT
22
/*
33
* Copyright (c) 2022 Red Hat.
44
*

drivers/gpu/drm/nouveau/include/nvrm/535.113.01/nvidia/generated/g_os_nvoc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef struct PACKED_REGISTRY_TABLE
3838
{
3939
NvU32 size;
4040
NvU32 numEntries;
41-
PACKED_REGISTRY_ENTRY entries[0];
41+
PACKED_REGISTRY_ENTRY entries[] __counted_by(numEntries);
4242
} PACKED_REGISTRY_TABLE;
4343

4444
#endif

drivers/gpu/drm/nouveau/nouveau_bo.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,9 @@ nouveau_bo_alloc(struct nouveau_cli *cli, u64 *size, int *align, u32 domain,
318318
(!vmm->page[i].host || vmm->page[i].shift > PAGE_SHIFT))
319319
continue;
320320

321-
if (pi < 0)
322-
pi = i;
321+
/* pick the last one as it will be smallest. */
322+
pi = i;
323+
323324
/* Stop once the buffer is larger than the current page size. */
324325
if (*size >= 1ULL << vmm->page[i].shift)
325326
break;

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,8 @@ r535_gsp_rpc_send(struct nvkm_gsp *gsp, void *argv, bool wait, u32 repc)
365365
}
366366

367367
ret = r535_gsp_cmdq_push(gsp, rpc);
368-
if (ret) {
369-
mutex_unlock(&gsp->cmdq.mutex);
368+
if (ret)
370369
return ERR_PTR(ret);
371-
}
372370

373371
if (wait) {
374372
msg = r535_gsp_msg_recv(gsp, fn, repc);
@@ -1048,7 +1046,7 @@ r535_gsp_rpc_set_registry(struct nvkm_gsp *gsp)
10481046
char *strings;
10491047
int str_offset;
10501048
int i;
1051-
size_t rpc_size = sizeof(*rpc) + sizeof(rpc->entries[0]) * NV_GSP_REG_NUM_ENTRIES;
1049+
size_t rpc_size = struct_size(rpc, entries, NV_GSP_REG_NUM_ENTRIES);
10521050

10531051
/* add strings + null terminator */
10541052
for (i = 0; i < NV_GSP_REG_NUM_ENTRIES; i++)

drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,7 @@ static const struct panel_desc starry_qfh032011_53g_desc = {
17641764
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
17651765
MIPI_DSI_MODE_LPM,
17661766
.init_cmds = starry_qfh032011_53g_init_cmd,
1767+
.lp11_before_reset = true,
17671768
};
17681769

17691770
static const struct drm_display_mode starry_himax83102_j02_default_mode = {

drivers/gpu/drm/panel/panel-novatek-nt36523.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,9 +1254,9 @@ static int nt36523_probe(struct mipi_dsi_device *dsi)
12541254
return dev_err_probe(dev, -EPROBE_DEFER, "cannot get secondary DSI host\n");
12551255

12561256
pinfo->dsi[1] = mipi_dsi_device_register_full(dsi1_host, info);
1257-
if (!pinfo->dsi[1]) {
1257+
if (IS_ERR(pinfo->dsi[1])) {
12581258
dev_err(dev, "cannot get secondary DSI device\n");
1259-
return -ENODEV;
1259+
return PTR_ERR(pinfo->dsi[1]);
12601260
}
12611261
}
12621262

include/drm/drm_gpuvm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1+
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
22

33
#ifndef __DRM_GPUVM_H__
44
#define __DRM_GPUVM_H__

include/linux/dma-fence.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,21 @@ static inline bool dma_fence_is_later(struct dma_fence *f1,
498498
return __dma_fence_is_later(f1->seqno, f2->seqno, f1->ops);
499499
}
500500

501+
/**
502+
* dma_fence_is_later_or_same - return true if f1 is later or same as f2
503+
* @f1: the first fence from the same context
504+
* @f2: the second fence from the same context
505+
*
506+
* Returns true if f1 is chronologically later than f2 or the same fence. Both
507+
* fences must be from the same context, since a seqno is not re-used across
508+
* contexts.
509+
*/
510+
static inline bool dma_fence_is_later_or_same(struct dma_fence *f1,
511+
struct dma_fence *f2)
512+
{
513+
return f1 == f2 || dma_fence_is_later(f1, f2);
514+
}
515+
501516
/**
502517
* dma_fence_later - return the chronologically later fence
503518
* @f1: the first fence from the same context

0 commit comments

Comments
 (0)