Skip to content

Commit e6b17f5

Browse files
committed
Merge tag 'drm-misc-next-2023-08-10' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for v6.6: UAPI Changes: * nouveau: * Provide several GETPARAM ioctls * Provide VM_BIND ioctls Cross-subsystem Changes: * fbdev: Convert many drivers to fbdev I/O-memory helpers * media/vivid: Convert to fbdev I/O-memory helpers * vfio-dev/mdpy-fb: Convert to fbdev I/O-memory helpers Core Changes: * Documentation fixes * Do not select framebuffer console for fbdev emulation, fixes Kconfig dependencies * exec: * Add test cases for calling drm_exec() multiple times * Fix memory leak in sleftests * Build fixes * gem: * Fix lockdep checking * ttm: * Add Kunit tests * Cleanups Driver Changes: * atmel-hlcdc: * Support inverted pixclock polarity, required by several SoCs * bridge: * dw-hdmi: Update EDID on HDMI detection * sitronix-st7789v: Support panel orientation; Support rotation property; Add support for Jasonic JT240MHQS-HWT-EK-E3 plus DT bindings; Minor fixes * ivpu: * Support VPU4 * Refactorings * loongson: * Fixes * mcde: * Cleanups * nouveau: * Track GPU virtual memory via DRM GPUVA manager, enables Vulkan sparse binding/residency * panfrost: * Fix synchronization in IRQ handling * tve200: * Cleanups Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230810084505.GA14039@linux-uq9g
2 parents 3defb4f + 2799804 commit e6b17f5

File tree

128 files changed

+7537
-1219
lines changed

Some content is hidden

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

128 files changed

+7537
-1219
lines changed

Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ properties:
1818
enum:
1919
- edt,et028013dma
2020
- inanbo,t28cp45tn89-v17
21+
- jasonic,jt240mhqs-hwt-ek-e3
2122
- sitronix,st7789v
2223

2324
reg: true
2425
reset-gpios: true
2526
power-supply: true
2627
backlight: true
2728
port: true
29+
rotation: true
2830

2931
spi-cpha: true
3032
spi-cpol: true
@@ -58,6 +60,7 @@ examples:
5860
reset-gpios = <&pio 6 11 GPIO_ACTIVE_LOW>;
5961
backlight = <&pwm_bl>;
6062
power-supply = <&power>;
63+
rotation = <180>;
6164
spi-max-frequency = <100000>;
6265
spi-cpol;
6366
spi-cpha;

Documentation/devicetree/bindings/vendor-prefixes.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,8 @@ patternProperties:
677677
description: iWave Systems Technologies Pvt. Ltd.
678678
"^jadard,.*":
679679
description: Jadard Technology Inc.
680+
"^jasonic,.*":
681+
description: Jasonic Technology Ltd.
680682
"^jdi,.*":
681683
description: Japan Display Inc.
682684
"^jedec,.*":

Documentation/gpu/driver-uapi.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,14 @@ drm/i915 uAPI
66
=============
77

88
.. kernel-doc:: include/uapi/drm/i915_drm.h
9+
10+
drm/nouveau uAPI
11+
================
12+
13+
VM_BIND / EXEC uAPI
14+
-------------------
15+
16+
.. kernel-doc:: drivers/gpu/drm/nouveau/nouveau_exec.c
17+
:doc: Overview
18+
19+
.. kernel-doc:: include/uapi/drm/nouveau_drm.h

Documentation/gpu/drm-mm.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ DRM Cache Handling and Fast WC memcpy()
520520
.. _drm_sync_objects:
521521

522522
DRM Sync Objects
523-
===========================
523+
================
524524

525525
.. kernel-doc:: drivers/gpu/drm/drm_syncobj.c
526526
:doc: Overview

drivers/accel/ivpu/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ intel_vpu-y := \
77
ivpu_fw.o \
88
ivpu_fw_log.o \
99
ivpu_gem.o \
10-
ivpu_hw_mtl.o \
10+
ivpu_hw_37xx.o \
11+
ivpu_hw_40xx.o \
1112
ivpu_ipc.o \
1213
ivpu_job.o \
1314
ivpu_jsm_msg.o \

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ void ivpu_file_priv_put(struct ivpu_file_priv **link)
115115
kref_put(&file_priv->ref, file_priv_release);
116116
}
117117

118+
static int ivpu_get_capabilities(struct ivpu_device *vdev, struct drm_ivpu_param *args)
119+
{
120+
switch (args->index) {
121+
case DRM_IVPU_CAP_METRIC_STREAMER:
122+
args->value = 0;
123+
break;
124+
case DRM_IVPU_CAP_DMA_MEMORY_RANGE:
125+
args->value = 1;
126+
break;
127+
default:
128+
return -EINVAL;
129+
}
130+
131+
return 0;
132+
}
133+
118134
static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
119135
{
120136
struct ivpu_file_priv *file_priv = file->driver_priv;
@@ -144,7 +160,7 @@ static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_f
144160
args->value = ivpu_get_context_count(vdev);
145161
break;
146162
case DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS:
147-
args->value = vdev->hw->ranges.user_low.start;
163+
args->value = vdev->hw->ranges.user.start;
148164
break;
149165
case DRM_IVPU_PARAM_CONTEXT_PRIORITY:
150166
args->value = file_priv->priority;
@@ -174,6 +190,9 @@ static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_f
174190
case DRM_IVPU_PARAM_SKU:
175191
args->value = vdev->hw->sku;
176192
break;
193+
case DRM_IVPU_PARAM_CAPABILITIES:
194+
ret = ivpu_get_capabilities(vdev, args);
195+
break;
177196
default:
178197
ret = -EINVAL;
179198
break;
@@ -443,8 +462,8 @@ static int ivpu_pci_init(struct ivpu_device *vdev)
443462
/* Clear any pending errors */
444463
pcie_capability_clear_word(pdev, PCI_EXP_DEVSTA, 0x3f);
445464

446-
/* VPU MTL does not require PCI spec 10m D3hot delay */
447-
if (ivpu_is_mtl(vdev))
465+
/* VPU 37XX does not require 10m D3hot delay */
466+
if (ivpu_hw_gen(vdev) == IVPU_HW_37XX)
448467
pdev->d3hot_delay = 0;
449468

450469
ret = pcim_enable_device(pdev);
@@ -482,8 +501,13 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
482501
if (!vdev->pm)
483502
return -ENOMEM;
484503

485-
vdev->hw->ops = &ivpu_hw_mtl_ops;
486-
vdev->hw->dma_bits = 38;
504+
if (ivpu_hw_gen(vdev) >= IVPU_HW_40XX) {
505+
vdev->hw->ops = &ivpu_hw_40xx_ops;
506+
vdev->hw->dma_bits = 48;
507+
} else {
508+
vdev->hw->ops = &ivpu_hw_37xx_ops;
509+
vdev->hw->dma_bits = 38;
510+
}
487511

488512
vdev->platform = IVPU_PLATFORM_INVALID;
489513
vdev->context_xa_limit.min = IVPU_USER_CONTEXT_MIN_SSID;
@@ -610,6 +634,7 @@ static void ivpu_dev_fini(struct ivpu_device *vdev)
610634

611635
static struct pci_device_id ivpu_pci_ids[] = {
612636
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_MTL) },
637+
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_LNL) },
613638
{ }
614639
};
615640
MODULE_DEVICE_TABLE(pci, ivpu_pci_ids);

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#define DRIVER_DATE "20230117"
2424

2525
#define PCI_DEVICE_ID_MTL 0x7d1d
26+
#define PCI_DEVICE_ID_LNL 0x643e
27+
28+
#define IVPU_HW_37XX 37
29+
#define IVPU_HW_40XX 40
2630

2731
#define IVPU_GLOBAL_CONTEXT_MMU_SSID 0
2832
/* SSID 1 is used by the VPU to represent invalid context */
@@ -76,6 +80,7 @@ struct ivpu_wa_table {
7680
bool clear_runtime_mem;
7781
bool d3hot_after_power_off;
7882
bool interrupt_clear_with_0;
83+
bool disable_clock_relinquish;
7984
};
8085

8186
struct ivpu_hw_info;
@@ -146,11 +151,6 @@ void ivpu_file_priv_put(struct ivpu_file_priv **link);
146151
int ivpu_boot(struct ivpu_device *vdev);
147152
int ivpu_shutdown(struct ivpu_device *vdev);
148153

149-
static inline bool ivpu_is_mtl(struct ivpu_device *vdev)
150-
{
151-
return to_pci_dev(vdev->drm.dev)->device == PCI_DEVICE_ID_MTL;
152-
}
153-
154154
static inline u8 ivpu_revision(struct ivpu_device *vdev)
155155
{
156156
return to_pci_dev(vdev->drm.dev)->revision;
@@ -161,6 +161,19 @@ static inline u16 ivpu_device_id(struct ivpu_device *vdev)
161161
return to_pci_dev(vdev->drm.dev)->device;
162162
}
163163

164+
static inline int ivpu_hw_gen(struct ivpu_device *vdev)
165+
{
166+
switch (ivpu_device_id(vdev)) {
167+
case PCI_DEVICE_ID_MTL:
168+
return IVPU_HW_37XX;
169+
case PCI_DEVICE_ID_LNL:
170+
return IVPU_HW_40XX;
171+
default:
172+
ivpu_err(vdev, "Unknown VPU device\n");
173+
return 0;
174+
}
175+
}
176+
164177
static inline struct ivpu_device *to_ivpu_device(struct drm_device *dev)
165178
{
166179
return container_of(dev, struct ivpu_device, drm);

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,20 @@ static char *ivpu_firmware;
4343
module_param_named_unsafe(firmware, ivpu_firmware, charp, 0644);
4444
MODULE_PARM_DESC(firmware, "VPU firmware binary in /lib/firmware/..");
4545

46+
/* TODO: Remove mtl_vpu.bin from names after transition to generation based FW names */
47+
static struct {
48+
int gen;
49+
const char *name;
50+
} fw_names[] = {
51+
{ IVPU_HW_37XX, "vpu_37xx.bin" },
52+
{ IVPU_HW_37XX, "mtl_vpu.bin" },
53+
{ IVPU_HW_37XX, "intel/vpu/vpu_37xx_v0.0.bin" },
54+
{ IVPU_HW_40XX, "vpu_40xx.bin" },
55+
{ IVPU_HW_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
56+
};
57+
4658
static int ivpu_fw_request(struct ivpu_device *vdev)
4759
{
48-
static const char * const fw_names[] = {
49-
"mtl_vpu.bin",
50-
"intel/vpu/mtl_vpu_v0.0.bin"
51-
};
5260
int ret = -ENOENT;
5361
int i;
5462

@@ -60,9 +68,12 @@ static int ivpu_fw_request(struct ivpu_device *vdev)
6068
}
6169

6270
for (i = 0; i < ARRAY_SIZE(fw_names); i++) {
63-
ret = firmware_request_nowarn(&vdev->fw->file, fw_names[i], vdev->drm.dev);
71+
if (fw_names[i].gen != ivpu_hw_gen(vdev))
72+
continue;
73+
74+
ret = firmware_request_nowarn(&vdev->fw->file, fw_names[i].name, vdev->drm.dev);
6475
if (!ret) {
65-
vdev->fw->name = fw_names[i];
76+
vdev->fw->name = fw_names[i].name;
6677
return 0;
6778
}
6879
}
@@ -195,7 +206,7 @@ static int ivpu_fw_update_global_range(struct ivpu_device *vdev)
195206
return -EINVAL;
196207
}
197208

198-
ivpu_hw_init_range(&vdev->hw->ranges.global_low, start, size);
209+
ivpu_hw_init_range(&vdev->hw->ranges.global, start, size);
199210
return 0;
200211
}
201212

@@ -236,7 +247,7 @@ static int ivpu_fw_mem_init(struct ivpu_device *vdev)
236247
}
237248

238249
if (fw->shave_nn_size) {
239-
fw->mem_shave_nn = ivpu_bo_alloc_internal(vdev, vdev->hw->ranges.global_high.start,
250+
fw->mem_shave_nn = ivpu_bo_alloc_internal(vdev, vdev->hw->ranges.shave.start,
240251
fw->shave_nn_size, DRM_IVPU_BO_UNCACHED);
241252
if (!fw->mem_shave_nn) {
242253
ivpu_err(vdev, "Failed to allocate shavenn buffer\n");
@@ -434,28 +445,26 @@ void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params
434445
* Uncached region of VPU address space, covers IPC buffers, job queues
435446
* and log buffers, programmable to L2$ Uncached by VPU MTRR
436447
*/
437-
boot_params->shared_region_base = vdev->hw->ranges.global_low.start;
438-
boot_params->shared_region_size = vdev->hw->ranges.global_low.end -
439-
vdev->hw->ranges.global_low.start;
448+
boot_params->shared_region_base = vdev->hw->ranges.global.start;
449+
boot_params->shared_region_size = vdev->hw->ranges.global.end -
450+
vdev->hw->ranges.global.start;
440451

441452
boot_params->ipc_header_area_start = ipc_mem_rx->vpu_addr;
442453
boot_params->ipc_header_area_size = ipc_mem_rx->base.size / 2;
443454

444455
boot_params->ipc_payload_area_start = ipc_mem_rx->vpu_addr + ipc_mem_rx->base.size / 2;
445456
boot_params->ipc_payload_area_size = ipc_mem_rx->base.size / 2;
446457

447-
boot_params->global_aliased_pio_base =
448-
vdev->hw->ranges.global_aliased_pio.start;
449-
boot_params->global_aliased_pio_size =
450-
ivpu_hw_range_size(&vdev->hw->ranges.global_aliased_pio);
458+
boot_params->global_aliased_pio_base = vdev->hw->ranges.user.start;
459+
boot_params->global_aliased_pio_size = ivpu_hw_range_size(&vdev->hw->ranges.user);
451460

452461
/* Allow configuration for L2C_PAGE_TABLE with boot param value */
453462
boot_params->autoconfig = 1;
454463

455464
/* Enable L2 cache for first 2GB of high memory */
456465
boot_params->cache_defaults[VPU_BOOT_L2_CACHE_CFG_NN].use = 1;
457466
boot_params->cache_defaults[VPU_BOOT_L2_CACHE_CFG_NN].cfg =
458-
ADDR_TO_L2_CACHE_CFG(vdev->hw->ranges.global_high.start);
467+
ADDR_TO_L2_CACHE_CFG(vdev->hw->ranges.shave.start);
459468

460469
if (vdev->fw->mem_shave_nn)
461470
boot_params->shave_nn_fw_base = vdev->fw->mem_shave_nn->vpu_addr;

drivers/accel/ivpu/ivpu_gem.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,12 @@ ivpu_bo_alloc_vpu_addr(struct ivpu_bo *bo, struct ivpu_mmu_context *ctx,
279279
int ret;
280280

281281
if (!range) {
282-
if (bo->flags & DRM_IVPU_BO_HIGH_MEM)
283-
range = &vdev->hw->ranges.user_high;
282+
if (bo->flags & DRM_IVPU_BO_SHAVE_MEM)
283+
range = &vdev->hw->ranges.shave;
284+
else if (bo->flags & DRM_IVPU_BO_DMA_MEM)
285+
range = &vdev->hw->ranges.dma;
284286
else
285-
range = &vdev->hw->ranges.user_low;
287+
range = &vdev->hw->ranges.user;
286288
}
287289

288290
mutex_lock(&ctx->lock);
@@ -570,7 +572,7 @@ ivpu_bo_alloc_internal(struct ivpu_device *vdev, u64 vpu_addr, u64 size, u32 fla
570572
fixed_range.end = vpu_addr + size;
571573
range = &fixed_range;
572574
} else {
573-
range = &vdev->hw->ranges.global_low;
575+
range = &vdev->hw->ranges.global;
574576
}
575577

576578
bo = ivpu_bo_alloc(vdev, &vdev->gctx, size, flags, &internal_ops, range, 0);

drivers/accel/ivpu/ivpu_hw.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ struct ivpu_addr_range {
3838
struct ivpu_hw_info {
3939
const struct ivpu_hw_ops *ops;
4040
struct {
41-
struct ivpu_addr_range global_low;
42-
struct ivpu_addr_range global_high;
43-
struct ivpu_addr_range user_low;
44-
struct ivpu_addr_range user_high;
45-
struct ivpu_addr_range global_aliased_pio;
41+
struct ivpu_addr_range global;
42+
struct ivpu_addr_range user;
43+
struct ivpu_addr_range shave;
44+
struct ivpu_addr_range dma;
4645
} ranges;
4746
struct {
4847
u8 min_ratio;
@@ -60,7 +59,8 @@ struct ivpu_hw_info {
6059
int dma_bits;
6160
};
6261

63-
extern const struct ivpu_hw_ops ivpu_hw_mtl_ops;
62+
extern const struct ivpu_hw_ops ivpu_hw_37xx_ops;
63+
extern const struct ivpu_hw_ops ivpu_hw_40xx_ops;
6464

6565
static inline int ivpu_hw_info_init(struct ivpu_device *vdev)
6666
{

0 commit comments

Comments
 (0)