Skip to content

Commit 92c3bb3

Browse files
committed
Merge tag 'drm-fixes-2025-01-03' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Happy New Year. It was fairly quiet for holidays period, certainly nothing that worth getting off the couch before I needed to, this is for the past two weeks, i915, xe and some adv7511, I expect we will see some amdgpu etc happening next week, but otherwise all quiet. i915: - Fix C10 pll programming sequence [cx0_phy] - Fix power gate sequence. [dg1] xe: - uapi: Revert some devcoredump file format changes breaking a mesa debug tool - Fixes around waits when moving to system - Fix a typo when checking for LMEM provisioning - Fix a fault on fd close after unbind - A couple of OA fixes squashed for stable backporting adv7511: - fix UAF - drop single lane support - audio infoframe fix" * tag 'drm-fixes-2025-01-03' of https://gitlab.freedesktop.org/drm/kernel: xe/oa: Fix query mode of operation for OAR/OAC drm/i915/dg1: Fix power gate sequence. drm/i915/cx0_phy: Fix C10 pll programming sequence drm/xe: Fix fault on fd close after unbind drm/xe/pf: Use correct function to check LMEM provisioning drm/xe: Wait for migration job before unmapping pages drm/xe: Use non-interruptible wait when moving BO to system drm/xe: Revert some changes that break a mesa debug tool drm: adv7511: Drop dsi single lane support dt-bindings: display: adi,adv7533: Drop single lane support drm: adv7511: Fix use-after-free in adv7533_attach_dsi() drm/bridge: adv7511_audio: Update Audio InfoFrame properly
2 parents e30dd21 + 273b3eb commit 92c3bb3

File tree

13 files changed

+112
-111
lines changed

13 files changed

+112
-111
lines changed

Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ properties:
9090
adi,dsi-lanes:
9191
description: Number of DSI data lanes connected to the DSI host.
9292
$ref: /schemas/types.yaml#/definitions/uint32
93-
enum: [ 1, 2, 3, 4 ]
93+
enum: [ 2, 3, 4 ]
9494

9595
"#sound-dai-cells":
9696
const: 0

drivers/gpu/drm/bridge/adv7511/adv7511_audio.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,16 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data,
153153
ADV7511_AUDIO_CFG3_LEN_MASK, len);
154154
regmap_update_bits(adv7511->regmap, ADV7511_REG_I2C_FREQ_ID_CFG,
155155
ADV7511_I2C_FREQ_ID_CFG_RATE_MASK, rate << 4);
156-
regmap_write(adv7511->regmap, 0x73, 0x1);
156+
157+
/* send current Audio infoframe values while updating */
158+
regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
159+
BIT(5), BIT(5));
160+
161+
regmap_write(adv7511->regmap, ADV7511_REG_AUDIO_INFOFRAME(0), 0x1);
162+
163+
/* use Audio infoframe updated info */
164+
regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
165+
BIT(5), 0);
157166

158167
return 0;
159168
}
@@ -184,8 +193,9 @@ static int audio_startup(struct device *dev, void *data)
184193
regmap_update_bits(adv7511->regmap, ADV7511_REG_GC(0),
185194
BIT(7) | BIT(6), BIT(7));
186195
/* use Audio infoframe updated info */
187-
regmap_update_bits(adv7511->regmap, ADV7511_REG_GC(1),
196+
regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
188197
BIT(5), 0);
198+
189199
/* enable SPDIF receiver */
190200
if (adv7511->audio_source == ADV7511_AUDIO_SOURCE_SPDIF)
191201
regmap_update_bits(adv7511->regmap, ADV7511_REG_AUDIO_CONFIG,

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,10 @@ static int adv7511_probe(struct i2c_client *i2c)
12411241
return ret;
12421242

12431243
ret = adv7511_init_regulators(adv7511);
1244-
if (ret)
1245-
return dev_err_probe(dev, ret, "failed to init regulators\n");
1244+
if (ret) {
1245+
dev_err_probe(dev, ret, "failed to init regulators\n");
1246+
goto err_of_node_put;
1247+
}
12461248

12471249
/*
12481250
* The power down GPIO is optional. If present, toggle it from active to
@@ -1363,6 +1365,8 @@ static int adv7511_probe(struct i2c_client *i2c)
13631365
i2c_unregister_device(adv7511->i2c_edid);
13641366
uninit_regulators:
13651367
adv7511_uninit_regulators(adv7511);
1368+
err_of_node_put:
1369+
of_node_put(adv7511->host_node);
13661370

13671371
return ret;
13681372
}
@@ -1371,6 +1375,8 @@ static void adv7511_remove(struct i2c_client *i2c)
13711375
{
13721376
struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
13731377

1378+
of_node_put(adv7511->host_node);
1379+
13741380
adv7511_uninit_regulators(adv7511);
13751381

13761382
drm_bridge_remove(&adv7511->bridge);

drivers/gpu/drm/bridge/adv7511/adv7533.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv)
172172

173173
of_property_read_u32(np, "adi,dsi-lanes", &num_lanes);
174174

175-
if (num_lanes < 1 || num_lanes > 4)
175+
if (num_lanes < 2 || num_lanes > 4)
176176
return -EINVAL;
177177

178178
adv->num_dsi_lanes = num_lanes;
@@ -181,8 +181,6 @@ int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv)
181181
if (!adv->host_node)
182182
return -ENODEV;
183183

184-
of_node_put(adv->host_node);
185-
186184
adv->use_timing_gen = !of_property_read_bool(np,
187185
"adi,disable-timing-generator");
188186

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,14 +2115,6 @@ static void intel_c10_pll_program(struct intel_display *display,
21152115
0, C10_VDR_CTRL_MSGBUS_ACCESS,
21162116
MB_WRITE_COMMITTED);
21172117

2118-
/* Custom width needs to be programmed to 0 for both the phy lanes */
2119-
intel_cx0_rmw(encoder, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CUSTOM_WIDTH,
2120-
C10_VDR_CUSTOM_WIDTH_MASK, C10_VDR_CUSTOM_WIDTH_8_10,
2121-
MB_WRITE_COMMITTED);
2122-
intel_cx0_rmw(encoder, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CONTROL(1),
2123-
0, C10_VDR_CTRL_UPDATE_CFG,
2124-
MB_WRITE_COMMITTED);
2125-
21262118
/* Program the pll values only for the master lane */
21272119
for (i = 0; i < ARRAY_SIZE(pll_state->pll); i++)
21282120
intel_cx0_write(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_PLL(i),
@@ -2132,6 +2124,10 @@ static void intel_c10_pll_program(struct intel_display *display,
21322124
intel_cx0_write(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_CMN(0), pll_state->cmn, MB_WRITE_COMMITTED);
21332125
intel_cx0_write(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_TX(0), pll_state->tx, MB_WRITE_COMMITTED);
21342126

2127+
/* Custom width needs to be programmed to 0 for both the phy lanes */
2128+
intel_cx0_rmw(encoder, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CUSTOM_WIDTH,
2129+
C10_VDR_CUSTOM_WIDTH_MASK, C10_VDR_CUSTOM_WIDTH_8_10,
2130+
MB_WRITE_COMMITTED);
21352131
intel_cx0_rmw(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_CONTROL(1),
21362132
0, C10_VDR_CTRL_MASTER_LANE | C10_VDR_CTRL_UPDATE_CFG,
21372133
MB_WRITE_COMMITTED);

drivers/gpu/drm/i915/gt/intel_rc6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static void gen11_rc6_enable(struct intel_rc6 *rc6)
133133
GEN9_MEDIA_PG_ENABLE |
134134
GEN11_MEDIA_SAMPLER_PG_ENABLE;
135135

136-
if (GRAPHICS_VER(gt->i915) >= 12) {
136+
if (GRAPHICS_VER(gt->i915) >= 12 && !IS_DG1(gt->i915)) {
137137
for (i = 0; i < I915_MAX_VCS; i++)
138138
if (HAS_ENGINE(gt, _VCS(i)))
139139
pg_enable |= (VDN_HCP_POWERGATE_ENABLE(i) |

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
724724
new_mem->mem_type == XE_PL_SYSTEM) {
725725
long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,
726726
DMA_RESV_USAGE_BOOKKEEP,
727-
true,
727+
false,
728728
MAX_SCHEDULE_TIMEOUT);
729729
if (timeout < 0) {
730730
ret = timeout;
@@ -848,8 +848,16 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
848848

849849
out:
850850
if ((!ttm_bo->resource || ttm_bo->resource->mem_type == XE_PL_SYSTEM) &&
851-
ttm_bo->ttm)
851+
ttm_bo->ttm) {
852+
long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,
853+
DMA_RESV_USAGE_KERNEL,
854+
false,
855+
MAX_SCHEDULE_TIMEOUT);
856+
if (timeout < 0)
857+
ret = timeout;
858+
852859
xe_tt_unmap_sg(ttm_bo->ttm);
860+
}
853861

854862
return ret;
855863
}

drivers/gpu/drm/xe/xe_devcoredump.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ static ssize_t __xe_devcoredump_read(char *buffer, size_t count,
109109
drm_puts(&p, "\n**** GuC CT ****\n");
110110
xe_guc_ct_snapshot_print(ss->guc.ct, &p);
111111

112-
drm_puts(&p, "\n**** Contexts ****\n");
112+
/*
113+
* Don't add a new section header here because the mesa debug decoder
114+
* tool expects the context information to be in the 'GuC CT' section.
115+
*/
116+
/* drm_puts(&p, "\n**** Contexts ****\n"); */
113117
xe_guc_exec_queue_snapshot_print(ss->ge, &p);
114118

115119
drm_puts(&p, "\n**** Job ****\n");
@@ -363,6 +367,15 @@ void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix,
363367
char buff[ASCII85_BUFSZ], *line_buff;
364368
size_t line_pos = 0;
365369

370+
/*
371+
* Splitting blobs across multiple lines is not compatible with the mesa
372+
* debug decoder tool. Note that even dropping the explicit '\n' below
373+
* doesn't help because the GuC log is so big some underlying implementation
374+
* still splits the lines at 512K characters. So just bail completely for
375+
* the moment.
376+
*/
377+
return;
378+
366379
#define DMESG_MAX_LINE_LEN 800
367380
#define MIN_SPACE (ASCII85_BUFSZ + 2) /* 85 + "\n\0" */
368381

drivers/gpu/drm/xe/xe_exec_queue.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/nospec.h>
99

1010
#include <drm/drm_device.h>
11+
#include <drm/drm_drv.h>
1112
#include <drm/drm_file.h>
1213
#include <uapi/drm/xe_drm.h>
1314

@@ -762,9 +763,11 @@ bool xe_exec_queue_is_idle(struct xe_exec_queue *q)
762763
*/
763764
void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
764765
{
766+
struct xe_device *xe = gt_to_xe(q->gt);
765767
struct xe_file *xef;
766768
struct xe_lrc *lrc;
767769
u32 old_ts, new_ts;
770+
int idx;
768771

769772
/*
770773
* Jobs that are run during driver load may use an exec_queue, but are
@@ -774,6 +777,10 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
774777
if (!q->vm || !q->vm->xef)
775778
return;
776779

780+
/* Synchronize with unbind while holding the xe file open */
781+
if (!drm_dev_enter(&xe->drm, &idx))
782+
return;
783+
777784
xef = q->vm->xef;
778785

779786
/*
@@ -787,6 +794,8 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
787794
lrc = q->lrc[0];
788795
new_ts = xe_lrc_update_timestamp(lrc, &old_ts);
789796
xef->run_ticks[q->class] += (new_ts - old_ts) * q->width;
797+
798+
drm_dev_exit(idx);
790799
}
791800

792801
/**

drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,7 @@ static int pf_validate_vf_config(struct xe_gt *gt, unsigned int vfid)
20462046
valid_any = valid_any || (valid_ggtt && is_primary);
20472047

20482048
if (IS_DGFX(xe)) {
2049-
bool valid_lmem = pf_get_vf_config_ggtt(primary_gt, vfid);
2049+
bool valid_lmem = pf_get_vf_config_lmem(primary_gt, vfid);
20502050

20512051
valid_any = valid_any || (valid_lmem && is_primary);
20522052
valid_all = valid_all && valid_lmem;

0 commit comments

Comments
 (0)