Skip to content

Commit 0739b8b

Browse files
committed
Merge tag 'drm-misc-next-2025-01-06' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
drm-misc-next for 6.14: UAPI Changes: - Clarify drm memory stats documentation Cross-subsystem Changes: Core Changes: - sched: Documentation fixes, Driver Changes: - amdgpu: Track BO memory stats at runtime - amdxdna: Various fixes - hisilicon: New HIBMC driver - bridges: - Provide default implementation of atomic_check for HDMI bridges - it605: HDCP improvements, MCCS Support Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20250106-augmented-kakapo-of-action-0cf000@houat
2 parents ae7f6d5 + 938fbb1 commit 0739b8b

Some content is hidden

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

79 files changed

+2518
-608
lines changed

Documentation/devicetree/bindings/display/panel/panel-simple.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ properties:
290290
- tianma,tm070jvhg33
291291
# Tianma Micro-electronics TM070RVHG71 7.0" WXGA TFT LCD panel
292292
- tianma,tm070rvhg71
293+
# Topland TIAN-G07017-01 7.0" WSVGA TFT-LCD panel with capacitive touch
294+
- topland,tian-g07017-01
293295
# Toshiba 8.9" WXGA (1280x768) TFT LCD panel
294296
- toshiba,lt089ac29000
295297
# TPK U.S.A. LLC Fusion 7" 800 x 480 (WVGA) LCD panel with capacitive touch

Documentation/devicetree/bindings/vendor-prefixes.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,6 +1524,8 @@ patternProperties:
15241524
description: Topeet
15251525
"^topic,.*":
15261526
description: Topic Embedded Systems
1527+
"^topland,.*":
1528+
description: Topland Electronics (H.K) Co., Ltd.
15271529
"^toppoly,.*":
15281530
description: TPO (deprecated, use tpo)
15291531
deprecated: true

Documentation/gpu/drm-usage-stats.rst

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -145,57 +145,57 @@ both.
145145
Memory
146146
^^^^^^
147147

148-
- drm-memory-<region>: <uint> [KiB|MiB]
149-
150-
Each possible memory type which can be used to store buffer objects by the
151-
GPU in question shall be given a stable and unique name to be returned as the
152-
string here.
148+
Each possible memory type which can be used to store buffer objects by the GPU
149+
in question shall be given a stable and unique name to be used as the "<region>"
150+
string.
153151

154152
The region name "memory" is reserved to refer to normal system memory.
155153

156-
Value shall reflect the amount of storage currently consumed by the buffer
154+
The value shall reflect the amount of storage currently consumed by the buffer
157155
objects belong to this client, in the respective memory region.
158156

159157
Default unit shall be bytes with optional unit specifiers of 'KiB' or 'MiB'
160158
indicating kibi- or mebi-bytes.
161159

162-
This key is deprecated and is an alias for drm-resident-<region>. Only one of
163-
the two should be present in the output.
164-
165-
- drm-shared-<region>: <uint> [KiB|MiB]
160+
- drm-total-<region>: <uint> [KiB|MiB]
166161

167-
The total size of buffers that are shared with another file (e.g., have more
168-
than a single handle).
162+
The total size of all requested buffers, including both shared and private
163+
memory. The backing store for the buffers does not need to be currently
164+
instantiated to count under this category. To avoid double-counting, if a buffer
165+
has multiple regions where it can be allocated to, the implementation should
166+
consistently select a single region for accounting purposes.
169167

170-
- drm-total-<region>: <uint> [KiB|MiB]
168+
- drm-shared-<region>: <uint> [KiB|MiB]
171169

172-
The total size of all created buffers including shared and private memory. The
173-
backing store for the buffers does not have to be currently instantiated to be
174-
counted under this category.
170+
The total size of buffers that are shared with another file (i.e., have more
171+
than one handle). The same requirement to avoid double-counting that applies to
172+
drm-total-<region> also applies here.
175173

176174
- drm-resident-<region>: <uint> [KiB|MiB]
177175

178-
The total size of buffers that are resident (have their backing store present or
179-
instantiated) in the specified region.
176+
The total size of buffers that are resident (i.e., have their backing store
177+
present or instantiated) in the specified region.
178+
179+
- drm-memory-<region>: <uint> [KiB|MiB]
180180

181-
This is an alias for drm-memory-<region> and only one of the two should be
182-
present in the output.
181+
This key is deprecated and is only printed by amdgpu; it is an alias for
182+
drm-resident-<region>.
183183

184184
- drm-purgeable-<region>: <uint> [KiB|MiB]
185185

186-
The total size of buffers that are purgeable.
186+
The total size of buffers that are resident and purgeable.
187187

188-
For example drivers which implement a form of 'madvise' like functionality can
189-
here count buffers which have instantiated backing store, but have been marked
190-
with an equivalent of MADV_DONTNEED.
188+
For example, drivers that implement functionality similar to 'madvise' can count
189+
buffers that have instantiated backing stores but have been marked with an
190+
equivalent of MADV_DONTNEED.
191191

192192
- drm-active-<region>: <uint> [KiB|MiB]
193193

194194
The total size of buffers that are active on one or more engines.
195195

196-
One practical example of this can be presence of unsignaled fences in an GEM
197-
buffer reservation object. Therefore the active category is a subset of
198-
resident.
196+
One practical example of this could be the presence of unsignaled fences in a
197+
GEM buffer reservation object. Therefore, the active category is a subset of the
198+
resident category.
199199

200200
Implementation Details
201201
======================

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7081,7 +7081,8 @@ T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
70817081
F: drivers/gpu/drm/sun4i/sun8i*
70827082

70837083
DRM DRIVER FOR ARM PL111 CLCD
7084-
S: Orphan
7084+
M: Linus Walleij <[email protected]>
7085+
S: Maintained
70857086
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
70867087
F: drivers/gpu/drm/pl111/
70877088

drivers/accel/amdxdna/aie2_ctx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "amdxdna_mailbox.h"
2323
#include "amdxdna_pci_drv.h"
2424

25-
bool force_cmdlist;
25+
static bool force_cmdlist;
2626
module_param(force_cmdlist, bool, 0600);
2727
MODULE_PARM_DESC(force_cmdlist, "Force use command list (Default false)");
2828

drivers/accel/amdxdna/aie2_pci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "amdxdna_mailbox.h"
2626
#include "amdxdna_pci_drv.h"
2727

28-
int aie2_max_col = XRS_MAX_COL;
28+
static int aie2_max_col = XRS_MAX_COL;
2929
module_param(aie2_max_col, uint, 0600);
3030
MODULE_PARM_DESC(aie2_max_col, "Maximum column could be used");
3131

@@ -380,9 +380,9 @@ static int aie2_hw_start(struct amdxdna_dev *xdna)
380380
goto stop_psp;
381381
}
382382

383-
mbox_res.ringbuf_base = (u64)ndev->sram_base;
383+
mbox_res.ringbuf_base = ndev->sram_base;
384384
mbox_res.ringbuf_size = pci_resource_len(pdev, xdna->dev_info->sram_bar);
385-
mbox_res.mbox_base = (u64)ndev->mbox_base;
385+
mbox_res.mbox_base = ndev->mbox_base;
386386
mbox_res.mbox_size = MBOX_SIZE(ndev);
387387
mbox_res.name = "xdna_mailbox";
388388
ndev->mbox = xdnam_mailbox_create(&xdna->ddev, &mbox_res);

drivers/accel/amdxdna/aie2_pci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ int aie2_query_firmware_version(struct amdxdna_dev_hdl *ndev,
269269
int aie2_create_context(struct amdxdna_dev_hdl *ndev, struct amdxdna_hwctx *hwctx);
270270
int aie2_destroy_context(struct amdxdna_dev_hdl *ndev, struct amdxdna_hwctx *hwctx);
271271
int aie2_map_host_buf(struct amdxdna_dev_hdl *ndev, u32 context_id, u64 addr, u64 size);
272-
int aie2_query_status(struct amdxdna_dev_hdl *ndev, char *buf, u32 size, u32 *cols_filled);
272+
int aie2_query_status(struct amdxdna_dev_hdl *ndev, char __user *buf, u32 size, u32 *cols_filled);
273273
int aie2_register_asyn_event_msg(struct amdxdna_dev_hdl *ndev, dma_addr_t addr, u32 size,
274274
void *handle, int (*cb)(void*, const u32 *, size_t));
275275
int aie2_config_cu(struct amdxdna_hwctx *hwctx);

drivers/accel/amdxdna/amdxdna_mailbox.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,27 @@ struct mailbox_msg {
9898
static void mailbox_reg_write(struct mailbox_channel *mb_chann, u32 mbox_reg, u32 data)
9999
{
100100
struct xdna_mailbox_res *mb_res = &mb_chann->mb->res;
101-
u64 ringbuf_addr = mb_res->mbox_base + mbox_reg;
101+
void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg;
102102

103-
writel(data, (void *)ringbuf_addr);
103+
writel(data, ringbuf_addr);
104104
}
105105

106106
static u32 mailbox_reg_read(struct mailbox_channel *mb_chann, u32 mbox_reg)
107107
{
108108
struct xdna_mailbox_res *mb_res = &mb_chann->mb->res;
109-
u64 ringbuf_addr = mb_res->mbox_base + mbox_reg;
109+
void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg;
110110

111-
return readl((void *)ringbuf_addr);
111+
return readl(ringbuf_addr);
112112
}
113113

114114
static int mailbox_reg_read_non_zero(struct mailbox_channel *mb_chann, u32 mbox_reg, u32 *val)
115115
{
116116
struct xdna_mailbox_res *mb_res = &mb_chann->mb->res;
117-
u64 ringbuf_addr = mb_res->mbox_base + mbox_reg;
117+
void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg;
118118
int ret, value;
119119

120120
/* Poll till value is not zero */
121-
ret = readx_poll_timeout(readl, (void *)ringbuf_addr, value,
121+
ret = readx_poll_timeout(readl, ringbuf_addr, value,
122122
value, 1 /* us */, 100);
123123
if (ret < 0)
124124
return ret;
@@ -200,10 +200,10 @@ static void mailbox_release_msg(struct mailbox_channel *mb_chann,
200200
static int
201201
mailbox_send_msg(struct mailbox_channel *mb_chann, struct mailbox_msg *mb_msg)
202202
{
203+
void __iomem *write_addr;
203204
u32 ringbuf_size;
204205
u32 head, tail;
205206
u32 start_addr;
206-
u64 write_addr;
207207
u32 tmp_tail;
208208

209209
head = mailbox_get_headptr(mb_chann, CHAN_RES_X2I);
@@ -221,14 +221,14 @@ mailbox_send_msg(struct mailbox_channel *mb_chann, struct mailbox_msg *mb_msg)
221221

222222
if (tail >= head && tmp_tail > ringbuf_size - sizeof(u32)) {
223223
write_addr = mb_chann->mb->res.ringbuf_base + start_addr + tail;
224-
writel(TOMBSTONE, (void *)write_addr);
224+
writel(TOMBSTONE, write_addr);
225225

226226
/* tombstone is set. Write from the start of the ringbuf */
227227
tail = 0;
228228
}
229229

230230
write_addr = mb_chann->mb->res.ringbuf_base + start_addr + tail;
231-
memcpy_toio((void *)write_addr, &mb_msg->pkg, mb_msg->pkg_size);
231+
memcpy_toio(write_addr, &mb_msg->pkg, mb_msg->pkg_size);
232232
mailbox_set_tailptr(mb_chann, tail + mb_msg->pkg_size);
233233

234234
trace_mbox_set_tail(MAILBOX_NAME, mb_chann->msix_irq,
@@ -275,11 +275,11 @@ mailbox_get_resp(struct mailbox_channel *mb_chann, struct xdna_msg_header *heade
275275
static int mailbox_get_msg(struct mailbox_channel *mb_chann)
276276
{
277277
struct xdna_msg_header header;
278+
void __iomem *read_addr;
278279
u32 msg_size, rest;
279280
u32 ringbuf_size;
280281
u32 head, tail;
281282
u32 start_addr;
282-
u64 read_addr;
283283
int ret;
284284

285285
if (mailbox_reg_read_non_zero(mb_chann, mb_chann->res[CHAN_RES_I2X].mb_tail_ptr_reg, &tail))
@@ -302,7 +302,7 @@ static int mailbox_get_msg(struct mailbox_channel *mb_chann)
302302

303303
/* Peek size of the message or TOMBSTONE */
304304
read_addr = mb_chann->mb->res.ringbuf_base + start_addr + head;
305-
header.total_size = readl((void *)read_addr);
305+
header.total_size = readl(read_addr);
306306
/* size is TOMBSTONE, set next read from 0 */
307307
if (header.total_size == TOMBSTONE) {
308308
if (head < tail) {
@@ -328,7 +328,7 @@ static int mailbox_get_msg(struct mailbox_channel *mb_chann)
328328

329329
rest = sizeof(header) - sizeof(u32);
330330
read_addr += sizeof(u32);
331-
memcpy_fromio((u32 *)&header + 1, (void *)read_addr, rest);
331+
memcpy_fromio((u32 *)&header + 1, read_addr, rest);
332332
read_addr += rest;
333333

334334
ret = mailbox_get_resp(mb_chann, &header, (u32 *)read_addr);

drivers/accel/amdxdna/amdxdna_mailbox.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ struct xdna_mailbox_msg {
3939
* @mbox_size: mailbox size
4040
*/
4141
struct xdna_mailbox_res {
42-
u64 ringbuf_base;
42+
void __iomem *ringbuf_base;
4343
size_t ringbuf_size;
44-
u64 mbox_base;
44+
void __iomem *mbox_base;
4545
size_t mbox_size;
4646
const char *name;
4747
};

drivers/accel/amdxdna/amdxdna_pci_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static int amdxdna_drm_open(struct drm_device *ddev, struct drm_file *filp)
6161
goto put_rpm;
6262
}
6363

64-
client->pid = pid_nr(filp->pid);
64+
client->pid = pid_nr(rcu_access_pointer(filp->pid));
6565
client->xdna = xdna;
6666

6767
client->sva = iommu_sva_bind_device(xdna->ddev.dev, current->mm);

drivers/accel/amdxdna/npu1_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const struct dpm_clk_freq npu1_dpm_clk_table[] = {
6262
{ 0 }
6363
};
6464

65-
const struct amdxdna_dev_priv npu1_dev_priv = {
65+
static const struct amdxdna_dev_priv npu1_dev_priv = {
6666
.fw_path = "amdnpu/1502_00/npu.sbin",
6767
.protocol_major = 0x5,
6868
.protocol_minor = 0x7,

drivers/accel/amdxdna/npu2_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#define NPU2_SMU_BAR_BASE MMNPU_APERTURE4_BASE
6262
#define NPU2_SRAM_BAR_BASE MMNPU_APERTURE1_BASE
6363

64-
const struct amdxdna_dev_priv npu2_dev_priv = {
64+
static const struct amdxdna_dev_priv npu2_dev_priv = {
6565
.fw_path = "amdnpu/17f0_00/npu.sbin",
6666
.protocol_major = 0x6,
6767
.protocol_minor = 0x6,

drivers/accel/amdxdna/npu4_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const struct dpm_clk_freq npu4_dpm_clk_table[] = {
8282
{ 0 }
8383
};
8484

85-
const struct amdxdna_dev_priv npu4_dev_priv = {
85+
static const struct amdxdna_dev_priv npu4_dev_priv = {
8686
.fw_path = "amdnpu/17f0_10/npu.sbin",
8787
.protocol_major = 0x6,
8888
.protocol_minor = 12,

drivers/accel/amdxdna/npu5_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#define NPU5_SMU_BAR_BASE MMNPU_APERTURE4_BASE
6262
#define NPU5_SRAM_BAR_BASE MMNPU_APERTURE1_BASE
6363

64-
const struct amdxdna_dev_priv npu5_dev_priv = {
64+
static const struct amdxdna_dev_priv npu5_dev_priv = {
6565
.fw_path = "amdnpu/17f0_11/npu.sbin",
6666
.protocol_major = 0x6,
6767
.protocol_minor = 12,

drivers/accel/amdxdna/npu6_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#define NPU6_SMU_BAR_BASE MMNPU_APERTURE4_BASE
6262
#define NPU6_SRAM_BAR_BASE MMNPU_APERTURE1_BASE
6363

64-
const struct amdxdna_dev_priv npu6_dev_priv = {
64+
static const struct amdxdna_dev_priv npu6_dev_priv = {
6565
.fw_path = "amdnpu/17f0_10/npu.sbin",
6666
.protocol_major = 0x6,
6767
.protocol_minor = 12,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
11051105
* We can't use gang submit on with reserved VMIDs when the VM changes
11061106
* can't be invalidated by more than one engine at the same time.
11071107
*/
1108-
if (p->gang_size > 1 && !p->adev->vm_manager.concurrent_flush) {
1108+
if (p->gang_size > 1 && !adev->vm_manager.concurrent_flush) {
11091109
for (i = 0; i < p->gang_size; ++i) {
11101110
struct drm_sched_entity *entity = p->entities[i];
11111111
struct drm_gpu_scheduler *sched = entity->rq->sched;
@@ -1189,7 +1189,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
11891189
if (!bo)
11901190
continue;
11911191

1192-
amdgpu_vm_bo_invalidate(adev, bo, false);
1192+
amdgpu_vm_bo_invalidate(bo, false);
11931193
}
11941194
}
11951195

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "amdgpu_gem.h"
3737
#include "amdgpu_dma_buf.h"
3838
#include "amdgpu_xgmi.h"
39+
#include "amdgpu_vm.h"
3940
#include <drm/amdgpu_drm.h>
4041
#include <drm/ttm/ttm_tt.h>
4142
#include <linux/dma-buf.h>
@@ -60,6 +61,8 @@ static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf,
6061
if (pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0)
6162
attach->peer2peer = false;
6263

64+
amdgpu_vm_bo_update_shared(bo);
65+
6366
return 0;
6467
}
6568

@@ -345,7 +348,7 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
345348
/* FIXME: This should be after the "if", but needs a fix to make sure
346349
* DMABuf imports are initialized in the right VM list.
347350
*/
348-
amdgpu_vm_bo_invalidate(adev, bo, false);
351+
amdgpu_vm_bo_invalidate(bo, false);
349352
if (!bo->tbo.resource || bo->tbo.resource->mem_type == TTM_PL_SYSTEM)
350353
return;
351354

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
6060
struct amdgpu_fpriv *fpriv = file->driver_priv;
6161
struct amdgpu_vm *vm = &fpriv->vm;
6262

63-
struct amdgpu_mem_stats stats[__AMDGPU_PL_LAST + 1] = { };
63+
struct amdgpu_mem_stats stats[__AMDGPU_PL_NUM];
6464
ktime_t usage[AMDGPU_HW_IP_NUM];
6565
const char *pl_name[] = {
6666
[TTM_PL_VRAM] = "vram",
@@ -72,15 +72,8 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
7272
[AMDGPU_PL_DOORBELL] = "doorbell",
7373
};
7474
unsigned int hw_ip, i;
75-
int ret;
76-
77-
ret = amdgpu_bo_reserve(vm->root.bo, false);
78-
if (ret)
79-
return;
80-
81-
amdgpu_vm_get_memory(vm, stats, ARRAY_SIZE(stats));
82-
amdgpu_bo_unreserve(vm->root.bo);
8375

76+
amdgpu_vm_get_memory(vm, stats);
8477
amdgpu_ctx_mgr_usage(&fpriv->ctx_mgr, usage);
8578

8679
/*
@@ -114,9 +107,11 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
114107
drm_printf(p, "amd-evicted-vram:\t%llu KiB\n",
115108
stats[TTM_PL_VRAM].evicted/1024UL);
116109
drm_printf(p, "amd-requested-vram:\t%llu KiB\n",
117-
stats[TTM_PL_VRAM].requested/1024UL);
110+
(stats[TTM_PL_VRAM].drm.shared +
111+
stats[TTM_PL_VRAM].drm.private) / 1024UL);
118112
drm_printf(p, "amd-requested-gtt:\t%llu KiB\n",
119-
stats[TTM_PL_TT].requested/1024UL);
113+
(stats[TTM_PL_TT].drm.shared +
114+
stats[TTM_PL_TT].drm.private) / 1024UL);
120115

121116
for (hw_ip = 0; hw_ip < AMDGPU_HW_IP_NUM; ++hw_ip) {
122117
if (!usage[hw_ip])

0 commit comments

Comments
 (0)