Skip to content

Commit 8573df3

Browse files
committed
Merge tag 'drm-misc-next-fixes-2023-02-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
Short summary of fixes pull: Contains a number of fixes to vc4 and ivpu. The patches to the probe helpers were cherry-picked from the regular development branch. Signed-off-by: Daniel Vetter <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/Y+S6HBmaRJNPYiBG@linux-uq9g
2 parents 48075a6 + 467fbc7 commit 8573df3

File tree

10 files changed

+165
-111
lines changed

10 files changed

+165
-111
lines changed

Documentation/devicetree/bindings/display/panel/visionox,vtdr6130.yaml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ properties:
1616
compatible:
1717
const: visionox,vtdr6130
1818

19+
reg:
20+
maxItems: 1
21+
description: DSI virtual channel
22+
1923
vddio-supply: true
2024
vci-supply: true
2125
vdd-supply: true
@@ -26,6 +30,7 @@ additionalProperties: false
2630

2731
required:
2832
- compatible
33+
- reg
2934
- vddio-supply
3035
- vci-supply
3136
- vdd-supply
@@ -35,18 +40,23 @@ required:
3540
examples:
3641
- |
3742
#include <dt-bindings/gpio/gpio.h>
38-
panel {
39-
compatible = "visionox,vtdr6130";
40-
41-
vddio-supply = <&vreg_l12b_1p8>;
42-
vci-supply = <&vreg_l13b_3p0>;
43-
vdd-supply = <&vreg_l11b_1p2>;
44-
45-
reset-gpios = <&tlmm 133 GPIO_ACTIVE_LOW>;
46-
47-
port {
48-
panel0_in: endpoint {
49-
remote-endpoint = <&dsi0_out>;
43+
dsi {
44+
#address-cells = <1>;
45+
#size-cells = <0>;
46+
panel@0 {
47+
compatible = "visionox,vtdr6130";
48+
reg = <0>;
49+
50+
vddio-supply = <&vreg_l12b_1p8>;
51+
vci-supply = <&vreg_l13b_3p0>;
52+
vdd-supply = <&vreg_l11b_1p2>;
53+
54+
reset-gpios = <&tlmm 133 GPIO_ACTIVE_LOW>;
55+
56+
port {
57+
panel0_in: endpoint {
58+
remote-endpoint = <&dsi0_out>;
59+
};
5060
};
5161
};
5262
};

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ static void file_priv_release(struct kref *ref)
9090

9191
ivpu_cmdq_release_all(file_priv);
9292
ivpu_bo_remove_all_bos_from_context(&file_priv->ctx);
93+
ivpu_jsm_context_release(vdev, file_priv->ctx.id);
9394
ivpu_mmu_user_context_fini(vdev, &file_priv->ctx);
9495
drm_WARN_ON(&vdev->drm, xa_erase_irq(&vdev->context_xa, file_priv->ctx.id) != file_priv);
9596
mutex_destroy(&file_priv->lock);
@@ -427,6 +428,7 @@ static int ivpu_pci_init(struct ivpu_device *vdev)
427428
ivpu_err(vdev, "Failed to set DMA mask: %d\n", ret);
428429
return ret;
429430
}
431+
dma_set_max_seg_size(vdev->drm.dev, UINT_MAX);
430432

431433
/* Clear any pending errors */
432434
pcie_capability_clear_word(pdev, PCI_EXP_DEVSTA, 0x3f);

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232

3333
#define ADDR_TO_L2_CACHE_CFG(addr) ((addr) >> 31)
3434

35-
#define IVPU_FW_CHECK_API(vdev, fw_hdr, name) ivpu_fw_check_api(vdev, fw_hdr, #name, \
36-
VPU_##name##_API_VER_INDEX, \
37-
VPU_##name##_API_VER_MAJOR, \
38-
VPU_##name##_API_VER_MINOR)
35+
#define IVPU_FW_CHECK_API(vdev, fw_hdr, name, min_major) \
36+
ivpu_fw_check_api(vdev, fw_hdr, #name, \
37+
VPU_##name##_API_VER_INDEX, \
38+
VPU_##name##_API_VER_MAJOR, \
39+
VPU_##name##_API_VER_MINOR, min_major)
3940

4041
static char *ivpu_firmware;
4142
module_param_named_unsafe(firmware, ivpu_firmware, charp, 0644);
@@ -63,19 +64,27 @@ static int ivpu_fw_request(struct ivpu_device *vdev)
6364
return ret;
6465
}
6566

66-
static void
67+
static int
6768
ivpu_fw_check_api(struct ivpu_device *vdev, const struct vpu_firmware_header *fw_hdr,
68-
const char *str, int index, u16 expected_major, u16 expected_minor)
69+
const char *str, int index, u16 expected_major, u16 expected_minor,
70+
u16 min_major)
6971
{
7072
u16 major = (u16)(fw_hdr->api_version[index] >> 16);
7173
u16 minor = (u16)(fw_hdr->api_version[index]);
7274

75+
if (major < min_major) {
76+
ivpu_err(vdev, "Incompatible FW %s API version: %d.%d, required %d.0 or later\n",
77+
str, major, minor, min_major);
78+
return -EINVAL;
79+
}
7380
if (major != expected_major) {
74-
ivpu_warn(vdev, "Incompatible FW %s API version: %d.%d (expected %d.%d)\n",
81+
ivpu_warn(vdev, "Major FW %s API version different: %d.%d (expected %d.%d)\n",
7582
str, major, minor, expected_major, expected_minor);
7683
}
7784
ivpu_dbg(vdev, FW_BOOT, "FW %s API version: %d.%d (expected %d.%d)\n",
7885
str, major, minor, expected_major, expected_minor);
86+
87+
return 0;
7988
}
8089

8190
static int ivpu_fw_parse(struct ivpu_device *vdev)
@@ -131,6 +140,14 @@ static int ivpu_fw_parse(struct ivpu_device *vdev)
131140
ivpu_err(vdev, "Invalid entry point: 0x%llx\n", fw_hdr->entry_point);
132141
return -EINVAL;
133142
}
143+
ivpu_dbg(vdev, FW_BOOT, "Header version: 0x%x, format 0x%x\n",
144+
fw_hdr->header_version, fw_hdr->image_format);
145+
ivpu_dbg(vdev, FW_BOOT, "FW version: %s\n", (char *)fw_hdr + VPU_FW_HEADER_SIZE);
146+
147+
if (IVPU_FW_CHECK_API(vdev, fw_hdr, BOOT, 3))
148+
return -EINVAL;
149+
if (IVPU_FW_CHECK_API(vdev, fw_hdr, JSM, 3))
150+
return -EINVAL;
134151

135152
fw->runtime_addr = runtime_addr;
136153
fw->runtime_size = runtime_size;
@@ -141,16 +158,10 @@ static int ivpu_fw_parse(struct ivpu_device *vdev)
141158
fw->cold_boot_entry_point = fw_hdr->entry_point;
142159
fw->entry_point = fw->cold_boot_entry_point;
143160

144-
ivpu_dbg(vdev, FW_BOOT, "Header version: 0x%x, format 0x%x\n",
145-
fw_hdr->header_version, fw_hdr->image_format);
146161
ivpu_dbg(vdev, FW_BOOT, "Size: file %lu image %u runtime %u shavenn %u\n",
147162
fw->file->size, fw->image_size, fw->runtime_size, fw->shave_nn_size);
148163
ivpu_dbg(vdev, FW_BOOT, "Address: runtime 0x%llx, load 0x%llx, entry point 0x%llx\n",
149164
fw->runtime_addr, image_load_addr, fw->entry_point);
150-
ivpu_dbg(vdev, FW_BOOT, "FW version: %s\n", (char *)fw_hdr + VPU_FW_HEADER_SIZE);
151-
152-
IVPU_FW_CHECK_API(vdev, fw_hdr, BOOT);
153-
IVPU_FW_CHECK_API(vdev, fw_hdr, JSM);
154165

155166
return 0;
156167
}

drivers/accel/ivpu/ivpu_gem.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ static int prime_map_pages_locked(struct ivpu_bo *bo)
4242
struct ivpu_device *vdev = ivpu_bo_to_vdev(bo);
4343
struct sg_table *sgt;
4444

45-
WARN_ON(!bo->base.import_attach);
46-
47-
sgt = dma_buf_map_attachment(bo->base.import_attach, DMA_BIDIRECTIONAL);
45+
sgt = dma_buf_map_attachment_unlocked(bo->base.import_attach, DMA_BIDIRECTIONAL);
4846
if (IS_ERR(sgt)) {
4947
ivpu_err(vdev, "Failed to map attachment: %ld\n", PTR_ERR(sgt));
5048
return PTR_ERR(sgt);
@@ -56,9 +54,7 @@ static int prime_map_pages_locked(struct ivpu_bo *bo)
5654

5755
static void prime_unmap_pages_locked(struct ivpu_bo *bo)
5856
{
59-
WARN_ON(!bo->base.import_attach);
60-
61-
dma_buf_unmap_attachment(bo->base.import_attach, bo->sgt, DMA_BIDIRECTIONAL);
57+
dma_buf_unmap_attachment_unlocked(bo->base.import_attach, bo->sgt, DMA_BIDIRECTIONAL);
6258
bo->sgt = NULL;
6359
}
6460

drivers/accel/ivpu/ivpu_job.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,9 @@ static int ivpu_direct_job_submission(struct ivpu_job *job)
400400
if (ret)
401401
goto err_xa_erase;
402402

403-
ivpu_dbg(vdev, JOB, "Job submitted: id %3u ctx %2d engine %d next %d\n",
404-
job->job_id, file_priv->ctx.id, job->engine_idx, cmdq->jobq->header.tail);
403+
ivpu_dbg(vdev, JOB, "Job submitted: id %3u addr 0x%llx ctx %2d engine %d next %d\n",
404+
job->job_id, job->cmd_buf_vpu_addr, file_priv->ctx.id,
405+
job->engine_idx, cmdq->jobq->header.tail);
405406

406407
if (ivpu_test_mode == IVPU_TEST_MODE_NULL_HW) {
407408
ivpu_job_done(vdev, job->job_id, VPU_JSM_STATUS_SUCCESS);

drivers/accel/ivpu/ivpu_jsm_msg.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,14 @@ int ivpu_jsm_trace_set_config(struct ivpu_device *vdev, u32 trace_level, u32 tra
167167

168168
return ret;
169169
}
170+
171+
int ivpu_jsm_context_release(struct ivpu_device *vdev, u32 host_ssid)
172+
{
173+
struct vpu_jsm_msg req = { .type = VPU_JSM_MSG_SSID_RELEASE };
174+
struct vpu_jsm_msg resp;
175+
176+
req.payload.ssid_release.host_ssid = host_ssid;
177+
178+
return ivpu_ipc_send_receive(vdev, &req, VPU_JSM_MSG_SSID_RELEASE_DONE, &resp,
179+
VPU_IPC_CHAN_ASYNC_CMD, vdev->timeout.jsm);
180+
}

drivers/accel/ivpu/ivpu_jsm_msg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ int ivpu_jsm_trace_get_capability(struct ivpu_device *vdev, u32 *trace_destinati
1919
u64 *trace_hw_component_mask);
2020
int ivpu_jsm_trace_set_config(struct ivpu_device *vdev, u32 trace_level, u32 trace_destination_mask,
2121
u64 trace_hw_component_mask);
22-
22+
int ivpu_jsm_context_release(struct ivpu_device *vdev, u32 host_ssid);
2323
#endif

0 commit comments

Comments
 (0)