Skip to content

Commit 4940c15

Browse files
committed
Merge tag 'drm-fixes-2023-10-06' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Regular weekly pull, all seems pretty normal, i915 and amdgpu mostly. There is one small new uAPI addition for nouveau but getting it in now avoids a bunch of userspace dances, and it's for a userspace that hasn't yet released, so should have no side effects. i915: - Fix for OpenGL CTS regression on Compute Shaders - Fix for default engines initialization - Fix TLB invalidation for Multi-GT devices amdgpu: - Add missing unique_id for GC 11.0.3 - Fix memory leak in FRU error path - Fix PCIe link reporting on some SMU 11 parts - Fix ACPI _PR3 detection - Fix DISPCLK WDIVIDER handling in OTG code tests: - Fix kunit release panel: - panel-orientation: Add quirk for One Mix 25 nouveau: - Report IB limit via getparams - Replace some magic numbers with constants - small clean up" * tag 'drm-fixes-2023-10-06' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: apply edge-case DISPCLK WDIVIDER changes to master OTG pipes only drm/amd: Fix detection of _PR3 on the PCIe root port drm/amd: Fix logic error in sienna_cichlid_update_pcie_parameters() drm/amdgpu: Fix a memory leak drm/amd/pm: add unique_id for gc 11.0.3 drm/i915: Invalidate the TLBs on each GT drm/i915: Register engines early to avoid type confusion drm/i915: Don't set PIPE_CONTROL_FLUSH_L3 for aux inval drm/nouveau: exec: report max pushs through getparam drm/nouveau: chan: use channel class definitions drm/nouveau: chan: use struct nvif_mclass drm: panel-orientation-quirks: Add quirk for One Mix 2S drm/tests: Fix kunit_release_action ctx argument
2 parents b78b18f + 67f35a4 commit 4940c15

File tree

17 files changed

+120
-39
lines changed

17 files changed

+120
-39
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
20932093
adev->flags |= AMD_IS_PX;
20942094

20952095
if (!(adev->flags & AMD_IS_APU)) {
2096-
parent = pci_upstream_bridge(adev->pdev);
2096+
parent = pcie_find_root_port(adev->pdev);
20972097
adev->has_pr3 = parent ? pci_pr3_present(parent) : false;
20982098
}
20992099

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)
170170
csum += pia[size - 1];
171171
if (csum) {
172172
DRM_ERROR("Bad Product Info Area checksum: 0x%02x", csum);
173+
kfree(pia);
173174
return -EIO;
174175
}
175176

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void dcn20_update_clocks_update_dentist(struct clk_mgr_internal *clk_mgr, struct
157157
int32_t N;
158158
int32_t j;
159159

160-
if (!pipe_ctx->stream)
160+
if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
161161
continue;
162162
/* Virtual encoders don't have this function */
163163
if (!stream_enc->funcs->get_fifo_cal_average_level)
@@ -188,7 +188,7 @@ void dcn20_update_clocks_update_dentist(struct clk_mgr_internal *clk_mgr, struct
188188
int32_t N;
189189
int32_t j;
190190

191-
if (!pipe_ctx->stream)
191+
if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
192192
continue;
193193
/* Virtual encoders don't have this function */
194194
if (!stream_enc->funcs->get_fifo_cal_average_level)

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static void dcn32_update_clocks_update_dentist(
355355
int32_t N;
356356
int32_t j;
357357

358-
if (!pipe_ctx->stream)
358+
if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
359359
continue;
360360
/* Virtual encoders don't have this function */
361361
if (!stream_enc->funcs->get_fifo_cal_average_level)
@@ -401,7 +401,7 @@ static void dcn32_update_clocks_update_dentist(
401401
int32_t N;
402402
int32_t j;
403403

404-
if (!pipe_ctx->stream)
404+
if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
405405
continue;
406406
/* Virtual encoders don't have this function */
407407
if (!stream_enc->funcs->get_fifo_cal_average_level)

drivers/gpu/drm/amd/pm/amdgpu_pm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,6 +2040,7 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
20402040
case IP_VERSION(11, 0, 0):
20412041
case IP_VERSION(11, 0, 1):
20422042
case IP_VERSION(11, 0, 2):
2043+
case IP_VERSION(11, 0, 3):
20432044
*states = ATTR_STATE_SUPPORTED;
20442045
break;
20452046
default:

drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,36 +2082,41 @@ static int sienna_cichlid_display_disable_memory_clock_switch(struct smu_context
20822082
return ret;
20832083
}
20842084

2085+
#define MAX(a, b) ((a) > (b) ? (a) : (b))
2086+
20852087
static int sienna_cichlid_update_pcie_parameters(struct smu_context *smu,
20862088
uint32_t pcie_gen_cap,
20872089
uint32_t pcie_width_cap)
20882090
{
20892091
struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
20902092
struct smu_11_0_pcie_table *pcie_table = &dpm_context->dpm_tables.pcie_table;
2091-
u32 smu_pcie_arg;
2093+
uint8_t *table_member1, *table_member2;
2094+
uint32_t min_gen_speed, max_gen_speed;
2095+
uint32_t min_lane_width, max_lane_width;
2096+
uint32_t smu_pcie_arg;
20922097
int ret, i;
20932098

2094-
/* PCIE gen speed and lane width override */
2095-
if (!amdgpu_device_pcie_dynamic_switching_supported()) {
2096-
if (pcie_table->pcie_gen[NUM_LINK_LEVELS - 1] < pcie_gen_cap)
2097-
pcie_gen_cap = pcie_table->pcie_gen[NUM_LINK_LEVELS - 1];
2099+
GET_PPTABLE_MEMBER(PcieGenSpeed, &table_member1);
2100+
GET_PPTABLE_MEMBER(PcieLaneCount, &table_member2);
20982101

2099-
if (pcie_table->pcie_lane[NUM_LINK_LEVELS - 1] < pcie_width_cap)
2100-
pcie_width_cap = pcie_table->pcie_lane[NUM_LINK_LEVELS - 1];
2102+
min_gen_speed = MAX(0, table_member1[0]);
2103+
max_gen_speed = MIN(pcie_gen_cap, table_member1[1]);
2104+
min_gen_speed = min_gen_speed > max_gen_speed ?
2105+
max_gen_speed : min_gen_speed;
2106+
min_lane_width = MAX(1, table_member2[0]);
2107+
max_lane_width = MIN(pcie_width_cap, table_member2[1]);
2108+
min_lane_width = min_lane_width > max_lane_width ?
2109+
max_lane_width : min_lane_width;
21012110

2102-
/* Force all levels to use the same settings */
2103-
for (i = 0; i < NUM_LINK_LEVELS; i++) {
2104-
pcie_table->pcie_gen[i] = pcie_gen_cap;
2105-
pcie_table->pcie_lane[i] = pcie_width_cap;
2106-
}
2111+
if (!amdgpu_device_pcie_dynamic_switching_supported()) {
2112+
pcie_table->pcie_gen[0] = max_gen_speed;
2113+
pcie_table->pcie_lane[0] = max_lane_width;
21072114
} else {
2108-
for (i = 0; i < NUM_LINK_LEVELS; i++) {
2109-
if (pcie_table->pcie_gen[i] > pcie_gen_cap)
2110-
pcie_table->pcie_gen[i] = pcie_gen_cap;
2111-
if (pcie_table->pcie_lane[i] > pcie_width_cap)
2112-
pcie_table->pcie_lane[i] = pcie_width_cap;
2113-
}
2115+
pcie_table->pcie_gen[0] = min_gen_speed;
2116+
pcie_table->pcie_lane[0] = min_lane_width;
21142117
}
2118+
pcie_table->pcie_gen[1] = max_gen_speed;
2119+
pcie_table->pcie_lane[1] = max_lane_width;
21152120

21162121
for (i = 0; i < NUM_LINK_LEVELS; i++) {
21172122
smu_pcie_arg = (i << 16 |

drivers/gpu/drm/drm_panel_orientation_quirks.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ static const struct drm_dmi_panel_orientation_data gpd_micropc = {
3838
.orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
3939
};
4040

41+
static const struct drm_dmi_panel_orientation_data gpd_onemix2s = {
42+
.width = 1200,
43+
.height = 1920,
44+
.bios_dates = (const char * const []){ "05/21/2018", "10/26/2018",
45+
"03/04/2019", NULL },
46+
.orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
47+
};
48+
4149
static const struct drm_dmi_panel_orientation_data gpd_pocket = {
4250
.width = 1200,
4351
.height = 1920,
@@ -401,6 +409,14 @@ static const struct dmi_system_id orientation_data[] = {
401409
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LTH17"),
402410
},
403411
.driver_data = (void *)&lcd800x1280_rightside_up,
412+
}, { /* One Mix 2S (generic strings, also match on bios date) */
413+
.matches = {
414+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"),
415+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"),
416+
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"),
417+
DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"),
418+
},
419+
.driver_data = (void *)&gpd_onemix2s,
404420
},
405421
{}
406422
};

drivers/gpu/drm/i915/gem/i915_gem_pages.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static void flush_tlb_invalidate(struct drm_i915_gem_object *obj)
198198

199199
for_each_gt(gt, i915, id) {
200200
if (!obj->mm.tlb[id])
201-
return;
201+
continue;
202202

203203
intel_gt_invalidate_tlb_full(gt, obj->mm.tlb[id]);
204204
obj->mm.tlb[id] = 0;

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,17 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
271271
if (GRAPHICS_VER_FULL(rq->i915) >= IP_VER(12, 70))
272272
bit_group_0 |= PIPE_CONTROL_CCS_FLUSH;
273273

274+
/*
275+
* L3 fabric flush is needed for AUX CCS invalidation
276+
* which happens as part of pipe-control so we can
277+
* ignore PIPE_CONTROL_FLUSH_L3. Also PIPE_CONTROL_FLUSH_L3
278+
* deals with Protected Memory which is not needed for
279+
* AUX CCS invalidation and lead to unwanted side effects.
280+
*/
281+
if (mode & EMIT_FLUSH)
282+
bit_group_1 |= PIPE_CONTROL_FLUSH_L3;
283+
274284
bit_group_1 |= PIPE_CONTROL_TILE_CACHE_FLUSH;
275-
bit_group_1 |= PIPE_CONTROL_FLUSH_L3;
276285
bit_group_1 |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
277286
bit_group_1 |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
278287
/* Wa_1409600907:tgl,adl-p */

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,13 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
11991199
goto err_unlock;
12001200
}
12011201

1202+
/*
1203+
* Register engines early to ensure the engine list is in its final
1204+
* rb-tree form, lowering the amount of code that has to deal with
1205+
* the intermediate llist state.
1206+
*/
1207+
intel_engines_driver_register(dev_priv);
1208+
12021209
return 0;
12031210

12041211
/*
@@ -1246,8 +1253,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
12461253
void i915_gem_driver_register(struct drm_i915_private *i915)
12471254
{
12481255
i915_gem_driver_register__shrinker(i915);
1249-
1250-
intel_engines_driver_register(i915);
12511256
}
12521257

12531258
void i915_gem_driver_unregister(struct drm_i915_private *i915)

0 commit comments

Comments
 (0)