Skip to content

Commit 353f91b

Browse files
committed
Merge tag 'drm-misc-fixes-2026-01-22' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
drm-msic-fixes for v6.19: imagination: - sync wait for logtype update completion to ensure FW trace is available bridge/synopsis: - Fix error paths in dw_dp_bind nouveau: - Add and implement missing DSB connector types, and improve unknown connector handling. - Set missing atomic function ops. intel/display, amd, vkms: - (intel) Place 3D lut at correct place in colorops pipeline. - (all) Fix a leak during device init where strings were leaked. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patch.msgid.link/4c2f66df-c990-448a-b466-99a66981272b@linux.intel.com
2 parents 24d479d + 0a095b6 commit 353f91b

9 files changed

Lines changed: 192 additions & 74 deletions

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr
7979
goto cleanup;
8080

8181
list->type = ops[i]->base.id;
82-
list->name = kasprintf(GFP_KERNEL, "Color Pipeline %d", ops[i]->base.id);
8382

8483
i++;
8584

@@ -197,6 +196,9 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr
197196
goto cleanup;
198197

199198
drm_colorop_set_next_property(ops[i-1], ops[i]);
199+
200+
list->name = kasprintf(GFP_KERNEL, "Color Pipeline %d", ops[0]->base.id);
201+
200202
return 0;
201203

202204
cleanup:

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,12 +1790,13 @@ dm_atomic_plane_get_property(struct drm_plane *plane,
17901790
static int
17911791
dm_plane_init_colorops(struct drm_plane *plane)
17921792
{
1793-
struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES];
1793+
struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES] = {};
17941794
struct drm_device *dev = plane->dev;
17951795
struct amdgpu_device *adev = drm_to_adev(dev);
17961796
struct dc *dc = adev->dm.dc;
17971797
int len = 0;
1798-
int ret;
1798+
int ret = 0;
1799+
int i;
17991800

18001801
if (plane->type == DRM_PLANE_TYPE_CURSOR)
18011802
return 0;
@@ -1806,15 +1807,19 @@ dm_plane_init_colorops(struct drm_plane *plane)
18061807
if (ret) {
18071808
drm_err(plane->dev, "Failed to create color pipeline for plane %d: %d\n",
18081809
plane->base.id, ret);
1809-
return ret;
1810+
goto out;
18101811
}
18111812
len++;
18121813

18131814
/* Create COLOR_PIPELINE property and attach */
18141815
drm_plane_create_color_pipeline_property(plane, pipelines, len);
18151816
}
18161817

1817-
return 0;
1818+
out:
1819+
for (i = 0; i < len; i++)
1820+
kfree(pipelines[i].name);
1821+
1822+
return ret;
18181823
}
18191824
#endif
18201825

drivers/gpu/drm/bridge/synopsys/dw-dp.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,33 +2062,41 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder,
20622062
}
20632063

20642064
ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
2065-
if (ret)
2065+
if (ret) {
20662066
dev_err_probe(dev, ret, "Failed to attach bridge\n");
2067+
goto unregister_aux;
2068+
}
20672069

20682070
dw_dp_init_hw(dp);
20692071

20702072
ret = phy_init(dp->phy);
20712073
if (ret) {
20722074
dev_err_probe(dev, ret, "phy init failed\n");
2073-
return ERR_PTR(ret);
2075+
goto unregister_aux;
20742076
}
20752077

20762078
ret = devm_add_action_or_reset(dev, dw_dp_phy_exit, dp);
20772079
if (ret)
2078-
return ERR_PTR(ret);
2080+
goto unregister_aux;
20792081

20802082
dp->irq = platform_get_irq(pdev, 0);
2081-
if (dp->irq < 0)
2082-
return ERR_PTR(ret);
2083+
if (dp->irq < 0) {
2084+
ret = dp->irq;
2085+
goto unregister_aux;
2086+
}
20832087

20842088
ret = devm_request_threaded_irq(dev, dp->irq, NULL, dw_dp_irq,
20852089
IRQF_ONESHOT, dev_name(dev), dp);
20862090
if (ret) {
20872091
dev_err_probe(dev, ret, "failed to request irq\n");
2088-
return ERR_PTR(ret);
2092+
goto unregister_aux;
20892093
}
20902094

20912095
return dp;
2096+
2097+
unregister_aux:
2098+
drm_dp_aux_unregister(&dp->aux);
2099+
return ERR_PTR(ret);
20922100
}
20932101
EXPORT_SYMBOL_GPL(dw_dp_bind);
20942102

drivers/gpu/drm/i915/display/intel_color_pipeline.c

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,19 @@ int _intel_color_pipeline_plane_init(struct drm_plane *plane, struct drm_prop_en
3434
return ret;
3535

3636
list->type = colorop->base.base.id;
37-
list->name = kasprintf(GFP_KERNEL, "Color Pipeline %d", colorop->base.base.id);
3837

3938
/* TODO: handle failures and clean up */
4039
prev_op = &colorop->base;
4140

41+
colorop = intel_colorop_create(INTEL_PLANE_CB_CSC);
42+
ret = drm_plane_colorop_ctm_3x4_init(dev, &colorop->base, plane,
43+
DRM_COLOROP_FLAG_ALLOW_BYPASS);
44+
if (ret)
45+
return ret;
46+
47+
drm_colorop_set_next_property(prev_op, &colorop->base);
48+
prev_op = &colorop->base;
49+
4250
if (DISPLAY_VER(display) >= 35 &&
4351
intel_color_crtc_has_3dlut(display, pipe) &&
4452
plane->type == DRM_PLANE_TYPE_PRIMARY) {
@@ -55,15 +63,6 @@ int _intel_color_pipeline_plane_init(struct drm_plane *plane, struct drm_prop_en
5563
prev_op = &colorop->base;
5664
}
5765

58-
colorop = intel_colorop_create(INTEL_PLANE_CB_CSC);
59-
ret = drm_plane_colorop_ctm_3x4_init(dev, &colorop->base, plane,
60-
DRM_COLOROP_FLAG_ALLOW_BYPASS);
61-
if (ret)
62-
return ret;
63-
64-
drm_colorop_set_next_property(prev_op, &colorop->base);
65-
prev_op = &colorop->base;
66-
6766
colorop = intel_colorop_create(INTEL_PLANE_CB_POST_CSC_LUT);
6867
ret = drm_plane_colorop_curve_1d_lut_init(dev, &colorop->base, plane,
6968
PLANE_GAMMA_SIZE,
@@ -74,16 +73,19 @@ int _intel_color_pipeline_plane_init(struct drm_plane *plane, struct drm_prop_en
7473

7574
drm_colorop_set_next_property(prev_op, &colorop->base);
7675

76+
list->name = kasprintf(GFP_KERNEL, "Color Pipeline %d", list->type);
77+
7778
return 0;
7879
}
7980

8081
int intel_color_pipeline_plane_init(struct drm_plane *plane, enum pipe pipe)
8182
{
8283
struct drm_device *dev = plane->dev;
8384
struct intel_display *display = to_intel_display(dev);
84-
struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES];
85+
struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES] = {};
8586
int len = 0;
86-
int ret;
87+
int ret = 0;
88+
int i;
8789

8890
/* Currently expose pipeline only for HDR planes */
8991
if (!icl_is_hdr_plane(display, to_intel_plane(plane)->id))
@@ -92,8 +94,14 @@ int intel_color_pipeline_plane_init(struct drm_plane *plane, enum pipe pipe)
9294
/* Add pipeline consisting of transfer functions */
9395
ret = _intel_color_pipeline_plane_init(plane, &pipelines[len], pipe);
9496
if (ret)
95-
return ret;
97+
goto out;
9698
len++;
9799

98-
return drm_plane_create_color_pipeline_property(plane, pipelines, len);
100+
ret = drm_plane_create_color_pipeline_property(plane, pipelines, len);
101+
102+
for (i = 0; i < len; i++)
103+
kfree(pipelines[i].name);
104+
105+
out:
106+
return ret;
99107
}

drivers/gpu/drm/imagination/pvr_fw_trace.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ update_logtype(struct pvr_device *pvr_dev, u32 group_mask)
137137
struct rogue_fwif_kccb_cmd cmd;
138138
int idx;
139139
int err;
140+
int slot;
140141

141142
if (group_mask)
142143
fw_trace->tracebuf_ctrl->log_type = ROGUE_FWIF_LOG_TYPE_TRACE | group_mask;
@@ -154,8 +155,13 @@ update_logtype(struct pvr_device *pvr_dev, u32 group_mask)
154155
cmd.cmd_type = ROGUE_FWIF_KCCB_CMD_LOGTYPE_UPDATE;
155156
cmd.kccb_flags = 0;
156157

157-
err = pvr_kccb_send_cmd(pvr_dev, &cmd, NULL);
158+
err = pvr_kccb_send_cmd(pvr_dev, &cmd, &slot);
159+
if (err)
160+
goto err_drm_dev_exit;
161+
162+
err = pvr_kccb_wait_for_completion(pvr_dev, slot, HZ, NULL);
158163

164+
err_drm_dev_exit:
159165
drm_dev_exit(idx);
160166

161167
err_up_read:

drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/conn.h

Lines changed: 74 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,81 @@
11
/* SPDX-License-Identifier: MIT */
22
#ifndef __NVBIOS_CONN_H__
33
#define __NVBIOS_CONN_H__
4+
5+
/*
6+
* An enumerator representing all of the possible VBIOS connector types defined
7+
* by Nvidia at
8+
* https://nvidia.github.io/open-gpu-doc/DCB/DCB-4.x-Specification.html.
9+
*
10+
* [1] Nvidia's documentation actually claims DCB_CONNECTOR_HDMI_0 is a "3-Pin
11+
* DIN Stereo Connector". This seems very likely to be a documentation typo
12+
* or some sort of funny historical baggage, because we've treated this
13+
* connector type as HDMI for years without issue.
14+
* TODO: Check with Nvidia what's actually happening here.
15+
*/
416
enum dcb_connector_type {
5-
DCB_CONNECTOR_VGA = 0x00,
6-
DCB_CONNECTOR_TV_0 = 0x10,
7-
DCB_CONNECTOR_TV_1 = 0x11,
8-
DCB_CONNECTOR_TV_3 = 0x13,
9-
DCB_CONNECTOR_DVI_I = 0x30,
10-
DCB_CONNECTOR_DVI_D = 0x31,
11-
DCB_CONNECTOR_DMS59_0 = 0x38,
12-
DCB_CONNECTOR_DMS59_1 = 0x39,
13-
DCB_CONNECTOR_LVDS = 0x40,
14-
DCB_CONNECTOR_LVDS_SPWG = 0x41,
15-
DCB_CONNECTOR_DP = 0x46,
16-
DCB_CONNECTOR_eDP = 0x47,
17-
DCB_CONNECTOR_mDP = 0x48,
18-
DCB_CONNECTOR_HDMI_0 = 0x60,
19-
DCB_CONNECTOR_HDMI_1 = 0x61,
20-
DCB_CONNECTOR_HDMI_C = 0x63,
21-
DCB_CONNECTOR_DMS59_DP0 = 0x64,
22-
DCB_CONNECTOR_DMS59_DP1 = 0x65,
23-
DCB_CONNECTOR_WFD = 0x70,
24-
DCB_CONNECTOR_USB_C = 0x71,
25-
DCB_CONNECTOR_NONE = 0xff
17+
/* Analog outputs */
18+
DCB_CONNECTOR_VGA = 0x00, // VGA 15-pin connector
19+
DCB_CONNECTOR_DVI_A = 0x01, // DVI-A
20+
DCB_CONNECTOR_POD_VGA = 0x02, // Pod - VGA 15-pin connector
21+
DCB_CONNECTOR_TV_0 = 0x10, // TV - Composite Out
22+
DCB_CONNECTOR_TV_1 = 0x11, // TV - S-Video Out
23+
DCB_CONNECTOR_TV_2 = 0x12, // TV - S-Video Breakout - Composite
24+
DCB_CONNECTOR_TV_3 = 0x13, // HDTV Component - YPrPb
25+
DCB_CONNECTOR_TV_SCART = 0x14, // TV - SCART Connector
26+
DCB_CONNECTOR_TV_SCART_D = 0x16, // TV - Composite SCART over D-connector
27+
DCB_CONNECTOR_TV_DTERM = 0x17, // HDTV - D-connector (EIAJ4120)
28+
DCB_CONNECTOR_POD_TV_3 = 0x18, // Pod - HDTV - YPrPb
29+
DCB_CONNECTOR_POD_TV_1 = 0x19, // Pod - S-Video
30+
DCB_CONNECTOR_POD_TV_0 = 0x1a, // Pod - Composite
31+
32+
/* DVI digital outputs */
33+
DCB_CONNECTOR_DVI_I_TV_1 = 0x20, // DVI-I-TV-S-Video
34+
DCB_CONNECTOR_DVI_I_TV_0 = 0x21, // DVI-I-TV-Composite
35+
DCB_CONNECTOR_DVI_I_TV_2 = 0x22, // DVI-I-TV-S-Video Breakout-Composite
36+
DCB_CONNECTOR_DVI_I = 0x30, // DVI-I
37+
DCB_CONNECTOR_DVI_D = 0x31, // DVI-D
38+
DCB_CONNECTOR_DVI_ADC = 0x32, // Apple Display Connector (ADC)
39+
DCB_CONNECTOR_DMS59_0 = 0x38, // LFH-DVI-I-1
40+
DCB_CONNECTOR_DMS59_1 = 0x39, // LFH-DVI-I-2
41+
DCB_CONNECTOR_BNC = 0x3c, // BNC Connector [for SDI?]
42+
43+
/* LVDS / TMDS digital outputs */
44+
DCB_CONNECTOR_LVDS = 0x40, // LVDS-SPWG-Attached [is this name correct?]
45+
DCB_CONNECTOR_LVDS_SPWG = 0x41, // LVDS-OEM-Attached (non-removable)
46+
DCB_CONNECTOR_LVDS_REM = 0x42, // LVDS-SPWG-Detached [following naming above]
47+
DCB_CONNECTOR_LVDS_SPWG_REM = 0x43, // LVDS-OEM-Detached (removable)
48+
DCB_CONNECTOR_TMDS = 0x45, // TMDS-OEM-Attached (non-removable)
49+
50+
/* DP digital outputs */
51+
DCB_CONNECTOR_DP = 0x46, // DisplayPort External Connector
52+
DCB_CONNECTOR_eDP = 0x47, // DisplayPort Internal Connector
53+
DCB_CONNECTOR_mDP = 0x48, // DisplayPort (Mini) External Connector
54+
55+
/* Dock outputs (not used) */
56+
DCB_CONNECTOR_DOCK_VGA_0 = 0x50, // VGA 15-pin if not docked
57+
DCB_CONNECTOR_DOCK_VGA_1 = 0x51, // VGA 15-pin if docked
58+
DCB_CONNECTOR_DOCK_DVI_I_0 = 0x52, // DVI-I if not docked
59+
DCB_CONNECTOR_DOCK_DVI_I_1 = 0x53, // DVI-I if docked
60+
DCB_CONNECTOR_DOCK_DVI_D_0 = 0x54, // DVI-D if not docked
61+
DCB_CONNECTOR_DOCK_DVI_D_1 = 0x55, // DVI-D if docked
62+
DCB_CONNECTOR_DOCK_DP_0 = 0x56, // DisplayPort if not docked
63+
DCB_CONNECTOR_DOCK_DP_1 = 0x57, // DisplayPort if docked
64+
DCB_CONNECTOR_DOCK_mDP_0 = 0x58, // DisplayPort (Mini) if not docked
65+
DCB_CONNECTOR_DOCK_mDP_1 = 0x59, // DisplayPort (Mini) if docked
66+
67+
/* HDMI? digital outputs */
68+
DCB_CONNECTOR_HDMI_0 = 0x60, // HDMI? See [1] in top-level enum comment above
69+
DCB_CONNECTOR_HDMI_1 = 0x61, // HDMI-A connector
70+
DCB_CONNECTOR_SPDIF = 0x62, // Audio S/PDIF connector
71+
DCB_CONNECTOR_HDMI_C = 0x63, // HDMI-C (Mini) connector
72+
73+
/* Misc. digital outputs */
74+
DCB_CONNECTOR_DMS59_DP0 = 0x64, // LFH-DP-1
75+
DCB_CONNECTOR_DMS59_DP1 = 0x65, // LFH-DP-2
76+
DCB_CONNECTOR_WFD = 0x70, // Virtual connector for Wifi Display (WFD)
77+
DCB_CONNECTOR_USB_C = 0x71, // [DP over USB-C; not present in docs]
78+
DCB_CONNECTOR_NONE = 0xff // Skip Entry
2679
};
2780

2881
struct nvbios_connT {

drivers/gpu/drm/nouveau/nouveau_display.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ nouveau_user_framebuffer_create(struct drm_device *dev,
352352

353353
static const struct drm_mode_config_funcs nouveau_mode_config_funcs = {
354354
.fb_create = nouveau_user_framebuffer_create,
355+
.atomic_commit = drm_atomic_helper_commit,
356+
.atomic_check = drm_atomic_helper_check,
355357
};
356358

357359

drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,60 @@ nvkm_uconn_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, struct nv
191191
spin_lock(&disp->client.lock);
192192
if (!conn->object.func) {
193193
switch (conn->info.type) {
194-
case DCB_CONNECTOR_VGA : args->v0.type = NVIF_CONN_V0_VGA; break;
195-
case DCB_CONNECTOR_TV_0 :
196-
case DCB_CONNECTOR_TV_1 :
197-
case DCB_CONNECTOR_TV_3 : args->v0.type = NVIF_CONN_V0_TV; break;
198-
case DCB_CONNECTOR_DMS59_0 :
199-
case DCB_CONNECTOR_DMS59_1 :
200-
case DCB_CONNECTOR_DVI_I : args->v0.type = NVIF_CONN_V0_DVI_I; break;
201-
case DCB_CONNECTOR_DVI_D : args->v0.type = NVIF_CONN_V0_DVI_D; break;
202-
case DCB_CONNECTOR_LVDS : args->v0.type = NVIF_CONN_V0_LVDS; break;
203-
case DCB_CONNECTOR_LVDS_SPWG: args->v0.type = NVIF_CONN_V0_LVDS_SPWG; break;
204-
case DCB_CONNECTOR_DMS59_DP0:
205-
case DCB_CONNECTOR_DMS59_DP1:
206-
case DCB_CONNECTOR_DP :
207-
case DCB_CONNECTOR_mDP :
208-
case DCB_CONNECTOR_USB_C : args->v0.type = NVIF_CONN_V0_DP; break;
209-
case DCB_CONNECTOR_eDP : args->v0.type = NVIF_CONN_V0_EDP; break;
210-
case DCB_CONNECTOR_HDMI_0 :
211-
case DCB_CONNECTOR_HDMI_1 :
212-
case DCB_CONNECTOR_HDMI_C : args->v0.type = NVIF_CONN_V0_HDMI; break;
194+
/* VGA */
195+
case DCB_CONNECTOR_DVI_A :
196+
case DCB_CONNECTOR_POD_VGA :
197+
case DCB_CONNECTOR_VGA : args->v0.type = NVIF_CONN_V0_VGA; break;
198+
199+
/* TV */
200+
case DCB_CONNECTOR_TV_0 :
201+
case DCB_CONNECTOR_TV_1 :
202+
case DCB_CONNECTOR_TV_2 :
203+
case DCB_CONNECTOR_TV_SCART :
204+
case DCB_CONNECTOR_TV_SCART_D :
205+
case DCB_CONNECTOR_TV_DTERM :
206+
case DCB_CONNECTOR_POD_TV_3 :
207+
case DCB_CONNECTOR_POD_TV_1 :
208+
case DCB_CONNECTOR_POD_TV_0 :
209+
case DCB_CONNECTOR_TV_3 : args->v0.type = NVIF_CONN_V0_TV; break;
210+
211+
/* DVI */
212+
case DCB_CONNECTOR_DVI_I_TV_1 :
213+
case DCB_CONNECTOR_DVI_I_TV_0 :
214+
case DCB_CONNECTOR_DVI_I_TV_2 :
215+
case DCB_CONNECTOR_DVI_ADC :
216+
case DCB_CONNECTOR_DMS59_0 :
217+
case DCB_CONNECTOR_DMS59_1 :
218+
case DCB_CONNECTOR_DVI_I : args->v0.type = NVIF_CONN_V0_DVI_I; break;
219+
case DCB_CONNECTOR_TMDS :
220+
case DCB_CONNECTOR_DVI_D : args->v0.type = NVIF_CONN_V0_DVI_D; break;
221+
222+
/* LVDS */
223+
case DCB_CONNECTOR_LVDS : args->v0.type = NVIF_CONN_V0_LVDS; break;
224+
case DCB_CONNECTOR_LVDS_SPWG : args->v0.type = NVIF_CONN_V0_LVDS_SPWG; break;
225+
226+
/* DP */
227+
case DCB_CONNECTOR_DMS59_DP0 :
228+
case DCB_CONNECTOR_DMS59_DP1 :
229+
case DCB_CONNECTOR_DP :
230+
case DCB_CONNECTOR_mDP :
231+
case DCB_CONNECTOR_USB_C : args->v0.type = NVIF_CONN_V0_DP; break;
232+
case DCB_CONNECTOR_eDP : args->v0.type = NVIF_CONN_V0_EDP; break;
233+
234+
/* HDMI */
235+
case DCB_CONNECTOR_HDMI_0 :
236+
case DCB_CONNECTOR_HDMI_1 :
237+
case DCB_CONNECTOR_HDMI_C : args->v0.type = NVIF_CONN_V0_HDMI; break;
238+
239+
/*
240+
* Dock & unused outputs.
241+
* BNC, SPDIF, WFD, and detached LVDS go here.
242+
*/
213243
default:
214-
WARN_ON(1);
244+
nvkm_warn(&disp->engine.subdev,
245+
"unimplemented connector type 0x%02x\n",
246+
conn->info.type);
247+
args->v0.type = NVIF_CONN_V0_VGA;
215248
ret = -EINVAL;
216249
break;
217250
}

0 commit comments

Comments
 (0)