Commit a74229bc authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave 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
parents 54001331 fb18fe0f
...@@ -301,7 +301,7 @@ void dma_resv_add_fence(struct dma_resv *obj, struct dma_fence *fence, ...@@ -301,7 +301,7 @@ void dma_resv_add_fence(struct dma_resv *obj, struct dma_fence *fence,
dma_resv_list_entry(fobj, i, obj, &old, &old_usage); dma_resv_list_entry(fobj, i, obj, &old, &old_usage);
if ((old->context == fence->context && old_usage >= usage && if ((old->context == fence->context && old_usage >= usage &&
dma_fence_is_later(fence, old)) || dma_fence_is_later_or_same(fence, old)) ||
dma_fence_is_signaled(old)) { dma_fence_is_signaled(old)) {
dma_resv_list_set(fobj, i, fence, usage); dma_resv_list_set(fobj, i, fence, usage);
dma_fence_put(old); dma_fence_put(old);
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
* Copyright (C) 2017 Broadcom * Copyright (C) 2017 Broadcom
*/ */
#include <linux/device.h>
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h> #include <drm/drm_bridge.h>
#include <drm/drm_connector.h> #include <drm/drm_connector.h>
...@@ -21,7 +19,6 @@ struct panel_bridge { ...@@ -21,7 +19,6 @@ struct panel_bridge {
struct drm_bridge bridge; struct drm_bridge bridge;
struct drm_connector connector; struct drm_connector connector;
struct drm_panel *panel; struct drm_panel *panel;
struct device_link *link;
u32 connector_type; u32 connector_type;
}; };
...@@ -63,24 +60,13 @@ static int panel_bridge_attach(struct drm_bridge *bridge, ...@@ -63,24 +60,13 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
{ {
struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
struct drm_connector *connector = &panel_bridge->connector; struct drm_connector *connector = &panel_bridge->connector;
struct drm_panel *panel = panel_bridge->panel;
struct drm_device *drm_dev = bridge->dev;
int ret; int ret;
panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
DL_FLAG_STATELESS);
if (!panel_bridge->link) {
DRM_ERROR("Failed to add device link between %s and %s\n",
dev_name(drm_dev->dev), dev_name(panel->dev));
return -EINVAL;
}
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
return 0; return 0;
if (!bridge->encoder) { if (!bridge->encoder) {
DRM_ERROR("Missing encoder\n"); DRM_ERROR("Missing encoder\n");
device_link_del(panel_bridge->link);
return -ENODEV; return -ENODEV;
} }
...@@ -92,7 +78,6 @@ static int panel_bridge_attach(struct drm_bridge *bridge, ...@@ -92,7 +78,6 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
panel_bridge->connector_type); panel_bridge->connector_type);
if (ret) { if (ret) {
DRM_ERROR("Failed to initialize connector\n"); DRM_ERROR("Failed to initialize connector\n");
device_link_del(panel_bridge->link);
return ret; return ret;
} }
...@@ -115,8 +100,6 @@ static void panel_bridge_detach(struct drm_bridge *bridge) ...@@ -115,8 +100,6 @@ static void panel_bridge_detach(struct drm_bridge *bridge)
struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
struct drm_connector *connector = &panel_bridge->connector; struct drm_connector *connector = &panel_bridge->connector;
device_link_del(panel_bridge->link);
/* /*
* Cleanup the connector if we know it was initialized. * Cleanup the connector if we know it was initialized.
* *
......
// SPDX-License-Identifier: GPL-2.0 OR MIT // SPDX-License-Identifier: GPL-2.0-only OR MIT
/* /*
* Copyright (c) 2022 Red Hat. * Copyright (c) 2022 Red Hat.
* *
......
...@@ -38,7 +38,7 @@ typedef struct PACKED_REGISTRY_TABLE ...@@ -38,7 +38,7 @@ typedef struct PACKED_REGISTRY_TABLE
{ {
NvU32 size; NvU32 size;
NvU32 numEntries; NvU32 numEntries;
PACKED_REGISTRY_ENTRY entries[0]; PACKED_REGISTRY_ENTRY entries[] __counted_by(numEntries);
} PACKED_REGISTRY_TABLE; } PACKED_REGISTRY_TABLE;
#endif #endif
...@@ -318,8 +318,9 @@ nouveau_bo_alloc(struct nouveau_cli *cli, u64 *size, int *align, u32 domain, ...@@ -318,8 +318,9 @@ nouveau_bo_alloc(struct nouveau_cli *cli, u64 *size, int *align, u32 domain,
(!vmm->page[i].host || vmm->page[i].shift > PAGE_SHIFT)) (!vmm->page[i].host || vmm->page[i].shift > PAGE_SHIFT))
continue; continue;
if (pi < 0) /* pick the last one as it will be smallest. */
pi = i; pi = i;
/* Stop once the buffer is larger than the current page size. */ /* Stop once the buffer is larger than the current page size. */
if (*size >= 1ULL << vmm->page[i].shift) if (*size >= 1ULL << vmm->page[i].shift)
break; break;
......
...@@ -365,10 +365,8 @@ r535_gsp_rpc_send(struct nvkm_gsp *gsp, void *argv, bool wait, u32 repc) ...@@ -365,10 +365,8 @@ r535_gsp_rpc_send(struct nvkm_gsp *gsp, void *argv, bool wait, u32 repc)
} }
ret = r535_gsp_cmdq_push(gsp, rpc); ret = r535_gsp_cmdq_push(gsp, rpc);
if (ret) { if (ret)
mutex_unlock(&gsp->cmdq.mutex);
return ERR_PTR(ret); return ERR_PTR(ret);
}
if (wait) { if (wait) {
msg = r535_gsp_msg_recv(gsp, fn, repc); msg = r535_gsp_msg_recv(gsp, fn, repc);
...@@ -1048,7 +1046,7 @@ r535_gsp_rpc_set_registry(struct nvkm_gsp *gsp) ...@@ -1048,7 +1046,7 @@ r535_gsp_rpc_set_registry(struct nvkm_gsp *gsp)
char *strings; char *strings;
int str_offset; int str_offset;
int i; int i;
size_t rpc_size = sizeof(*rpc) + sizeof(rpc->entries[0]) * NV_GSP_REG_NUM_ENTRIES; size_t rpc_size = struct_size(rpc, entries, NV_GSP_REG_NUM_ENTRIES);
/* add strings + null terminator */ /* add strings + null terminator */
for (i = 0; i < NV_GSP_REG_NUM_ENTRIES; i++) for (i = 0; i < NV_GSP_REG_NUM_ENTRIES; i++)
......
...@@ -1764,6 +1764,7 @@ static const struct panel_desc starry_qfh032011_53g_desc = { ...@@ -1764,6 +1764,7 @@ static const struct panel_desc starry_qfh032011_53g_desc = {
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
MIPI_DSI_MODE_LPM, MIPI_DSI_MODE_LPM,
.init_cmds = starry_qfh032011_53g_init_cmd, .init_cmds = starry_qfh032011_53g_init_cmd,
.lp11_before_reset = true,
}; };
static const struct drm_display_mode starry_himax83102_j02_default_mode = { static const struct drm_display_mode starry_himax83102_j02_default_mode = {
......
...@@ -1254,9 +1254,9 @@ static int nt36523_probe(struct mipi_dsi_device *dsi) ...@@ -1254,9 +1254,9 @@ static int nt36523_probe(struct mipi_dsi_device *dsi)
return dev_err_probe(dev, -EPROBE_DEFER, "cannot get secondary DSI host\n"); return dev_err_probe(dev, -EPROBE_DEFER, "cannot get secondary DSI host\n");
pinfo->dsi[1] = mipi_dsi_device_register_full(dsi1_host, info); pinfo->dsi[1] = mipi_dsi_device_register_full(dsi1_host, info);
if (!pinfo->dsi[1]) { if (IS_ERR(pinfo->dsi[1])) {
dev_err(dev, "cannot get secondary DSI device\n"); dev_err(dev, "cannot get secondary DSI device\n");
return -ENODEV; return PTR_ERR(pinfo->dsi[1]);
} }
} }
......
/* SPDX-License-Identifier: GPL-2.0 OR MIT */ /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
#ifndef __DRM_GPUVM_H__ #ifndef __DRM_GPUVM_H__
#define __DRM_GPUVM_H__ #define __DRM_GPUVM_H__
......
...@@ -498,6 +498,21 @@ static inline bool dma_fence_is_later(struct dma_fence *f1, ...@@ -498,6 +498,21 @@ static inline bool dma_fence_is_later(struct dma_fence *f1,
return __dma_fence_is_later(f1->seqno, f2->seqno, f1->ops); return __dma_fence_is_later(f1->seqno, f2->seqno, f1->ops);
} }
/**
* dma_fence_is_later_or_same - return true if f1 is later or same as f2
* @f1: the first fence from the same context
* @f2: the second fence from the same context
*
* Returns true if f1 is chronologically later than f2 or the same fence. Both
* fences must be from the same context, since a seqno is not re-used across
* contexts.
*/
static inline bool dma_fence_is_later_or_same(struct dma_fence *f1,
struct dma_fence *f2)
{
return f1 == f2 || dma_fence_is_later(f1, f2);
}
/** /**
* dma_fence_later - return the chronologically later fence * dma_fence_later - return the chronologically later fence
* @f1: the first fence from the same context * @f1: the first fence from the same context
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment