Skip to content

Commit 0bda8d8

Browse files
committed
Merge tag 'drm-intel-next-fixes-2022-09-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
- Fix release build bug in 'remove GuC log size module parameters' (John Harrison) - Remove ipc_enabled from struct drm_i915_private (Jani Nikula) - Do not cleanup obj with NULL bo->resource (Nirmoy Das) - Fix device info for devices without display (Jani Nikula) - Force DPLL calculation for TC ports after readout (Ville Syrjälä) - Use i915_vm_put on ppgtt_create error paths (Chris Wilson) Signed-off-by: Dave Airlie <[email protected]> From: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/YzWqtwPNxAe+r9FO@tursulin-desk
2 parents e857300 + 20e377e commit 0bda8d8

File tree

9 files changed

+70
-71
lines changed

9 files changed

+70
-71
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3600,10 +3600,22 @@ static void intel_ddi_sync_state(struct intel_encoder *encoder,
36003600
static bool intel_ddi_initial_fastset_check(struct intel_encoder *encoder,
36013601
struct intel_crtc_state *crtc_state)
36023602
{
3603-
if (intel_crtc_has_dp_encoder(crtc_state))
3604-
return intel_dp_initial_fastset_check(encoder, crtc_state);
3603+
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3604+
enum phy phy = intel_port_to_phy(i915, encoder->port);
3605+
bool fastset = true;
36053606

3606-
return true;
3607+
if (intel_phy_is_tc(i915, phy)) {
3608+
drm_dbg_kms(&i915->drm, "[ENCODER:%d:%s] Forcing full modeset to compute TC port DPLLs\n",
3609+
encoder->base.base.id, encoder->base.name);
3610+
crtc_state->uapi.mode_changed = true;
3611+
fastset = false;
3612+
}
3613+
3614+
if (intel_crtc_has_dp_encoder(crtc_state) &&
3615+
!intel_dp_initial_fastset_check(encoder, crtc_state))
3616+
fastset = false;
3617+
3618+
return fastset;
36073619
}
36083620

36093621
static enum intel_output_type

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static void i915_ttm_delete_mem_notify(struct ttm_buffer_object *bo)
511511
struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);
512512
intel_wakeref_t wakeref = 0;
513513

514-
if (likely(obj)) {
514+
if (bo->resource && likely(obj)) {
515515
/* ttm_bo_release() already has dma_resv_lock */
516516
if (i915_ttm_cpu_maps_iomem(bo->resource))
517517
wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm);

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ static int gen6_ppgtt_init_scratch(struct gen6_ppgtt *ppgtt)
247247
i915_gem_object_put(vm->scratch[1]);
248248
err_scratch0:
249249
i915_gem_object_put(vm->scratch[0]);
250+
vm->scratch[0] = NULL;
250251
return ret;
251252
}
252253

@@ -268,9 +269,10 @@ static void gen6_ppgtt_cleanup(struct i915_address_space *vm)
268269
gen6_ppgtt_free_pd(ppgtt);
269270
free_scratch(vm);
270271

271-
mutex_destroy(&ppgtt->flush);
272+
if (ppgtt->base.pd)
273+
free_pd(&ppgtt->base.vm, ppgtt->base.pd);
272274

273-
free_pd(&ppgtt->base.vm, ppgtt->base.pd);
275+
mutex_destroy(&ppgtt->flush);
274276
}
275277

276278
static void pd_vma_bind(struct i915_address_space *vm,
@@ -449,19 +451,17 @@ struct i915_ppgtt *gen6_ppgtt_create(struct intel_gt *gt)
449451

450452
err = gen6_ppgtt_init_scratch(ppgtt);
451453
if (err)
452-
goto err_free;
454+
goto err_put;
453455

454456
ppgtt->base.pd = gen6_alloc_top_pd(ppgtt);
455457
if (IS_ERR(ppgtt->base.pd)) {
456458
err = PTR_ERR(ppgtt->base.pd);
457-
goto err_scratch;
459+
goto err_put;
458460
}
459461

460462
return &ppgtt->base;
461463

462-
err_scratch:
463-
free_scratch(&ppgtt->base.vm);
464-
err_free:
465-
kfree(ppgtt);
464+
err_put:
465+
i915_vm_put(&ppgtt->base.vm);
466466
return ERR_PTR(err);
467467
}

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

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ static void gen8_ppgtt_cleanup(struct i915_address_space *vm)
196196
if (intel_vgpu_active(vm->i915))
197197
gen8_ppgtt_notify_vgt(ppgtt, false);
198198

199-
__gen8_ppgtt_cleanup(vm, ppgtt->pd, gen8_pd_top_count(vm), vm->top);
199+
if (ppgtt->pd)
200+
__gen8_ppgtt_cleanup(vm, ppgtt->pd,
201+
gen8_pd_top_count(vm), vm->top);
202+
200203
free_scratch(vm);
201204
}
202205

@@ -803,8 +806,10 @@ static int gen8_init_scratch(struct i915_address_space *vm)
803806
struct drm_i915_gem_object *obj;
804807

805808
obj = vm->alloc_pt_dma(vm, I915_GTT_PAGE_SIZE_4K);
806-
if (IS_ERR(obj))
809+
if (IS_ERR(obj)) {
810+
ret = PTR_ERR(obj);
807811
goto free_scratch;
812+
}
808813

809814
ret = map_pt_dma(vm, obj);
810815
if (ret) {
@@ -823,7 +828,8 @@ static int gen8_init_scratch(struct i915_address_space *vm)
823828
free_scratch:
824829
while (i--)
825830
i915_gem_object_put(vm->scratch[i]);
826-
return -ENOMEM;
831+
vm->scratch[0] = NULL;
832+
return ret;
827833
}
828834

829835
static int gen8_preallocate_top_level_pdp(struct i915_ppgtt *ppgtt)
@@ -901,6 +907,7 @@ gen8_alloc_top_pd(struct i915_address_space *vm)
901907
struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt,
902908
unsigned long lmem_pt_obj_flags)
903909
{
910+
struct i915_page_directory *pd;
904911
struct i915_ppgtt *ppgtt;
905912
int err;
906913

@@ -946,21 +953,7 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt,
946953
ppgtt->vm.alloc_scratch_dma = alloc_pt_dma;
947954
}
948955

949-
err = gen8_init_scratch(&ppgtt->vm);
950-
if (err)
951-
goto err_free;
952-
953-
ppgtt->pd = gen8_alloc_top_pd(&ppgtt->vm);
954-
if (IS_ERR(ppgtt->pd)) {
955-
err = PTR_ERR(ppgtt->pd);
956-
goto err_free_scratch;
957-
}
958-
959-
if (!i915_vm_is_4lvl(&ppgtt->vm)) {
960-
err = gen8_preallocate_top_level_pdp(ppgtt);
961-
if (err)
962-
goto err_free_pd;
963-
}
956+
ppgtt->vm.pte_encode = gen8_pte_encode;
964957

965958
ppgtt->vm.bind_async_flags = I915_VMA_LOCAL_BIND;
966959
ppgtt->vm.insert_entries = gen8_ppgtt_insert;
@@ -971,22 +964,31 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt,
971964
ppgtt->vm.allocate_va_range = gen8_ppgtt_alloc;
972965
ppgtt->vm.clear_range = gen8_ppgtt_clear;
973966
ppgtt->vm.foreach = gen8_ppgtt_foreach;
967+
ppgtt->vm.cleanup = gen8_ppgtt_cleanup;
974968

975-
ppgtt->vm.pte_encode = gen8_pte_encode;
969+
err = gen8_init_scratch(&ppgtt->vm);
970+
if (err)
971+
goto err_put;
972+
973+
pd = gen8_alloc_top_pd(&ppgtt->vm);
974+
if (IS_ERR(pd)) {
975+
err = PTR_ERR(pd);
976+
goto err_put;
977+
}
978+
ppgtt->pd = pd;
979+
980+
if (!i915_vm_is_4lvl(&ppgtt->vm)) {
981+
err = gen8_preallocate_top_level_pdp(ppgtt);
982+
if (err)
983+
goto err_put;
984+
}
976985

977986
if (intel_vgpu_active(gt->i915))
978987
gen8_ppgtt_notify_vgt(ppgtt, true);
979988

980-
ppgtt->vm.cleanup = gen8_ppgtt_cleanup;
981-
982989
return ppgtt;
983990

984-
err_free_pd:
985-
__gen8_ppgtt_cleanup(&ppgtt->vm, ppgtt->pd,
986-
gen8_pd_top_count(&ppgtt->vm), ppgtt->vm.top);
987-
err_free_scratch:
988-
free_scratch(&ppgtt->vm);
989-
err_free:
990-
kfree(ppgtt);
991+
err_put:
992+
i915_vm_put(&ppgtt->vm);
991993
return ERR_PTR(err);
992994
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ void free_scratch(struct i915_address_space *vm)
405405
{
406406
int i;
407407

408+
if (!vm->scratch[0])
409+
return;
410+
408411
for (i = 0; i <= vm->top; i++)
409412
i915_gem_object_put(vm->scratch[i]);
410413
}

drivers/gpu/drm/i915/gt/uc/intel_guc_log.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,6 @@ struct guc_log_section {
3636
const char *name;
3737
};
3838

39-
static s32 scale_log_param(struct intel_guc_log *log, const struct guc_log_section *section,
40-
s32 param)
41-
{
42-
/* -1 means default */
43-
if (param < 0)
44-
return section->default_val;
45-
46-
/* Check for 32-bit overflow */
47-
if (param >= SZ_4K) {
48-
drm_err(&guc_to_gt(log_to_guc(log))->i915->drm, "Size too large for GuC %s log: %dMB!",
49-
section->name, param);
50-
return section->default_val;
51-
}
52-
53-
/* Param units are 1MB */
54-
return param * SZ_1M;
55-
}
56-
5739
static void _guc_log_init_sizes(struct intel_guc_log *log)
5840
{
5941
struct intel_guc *guc = log_to_guc(log);
@@ -78,15 +60,10 @@ static void _guc_log_init_sizes(struct intel_guc_log *log)
7860
"capture",
7961
}
8062
};
81-
s32 params[GUC_LOG_SECTIONS_LIMIT] = {
82-
GUC_LOG_DEFAULT_CRASH_BUFFER_SIZE / SZ_1M,
83-
GUC_LOG_DEFAULT_DEBUG_BUFFER_SIZE / SZ_1M,
84-
GUC_LOG_DEFAULT_CAPTURE_BUFFER_SIZE / SZ_1M,
85-
};
8663
int i;
8764

8865
for (i = 0; i < GUC_LOG_SECTIONS_LIMIT; i++)
89-
log->sizes[i].bytes = scale_log_param(log, sections + i, params[i]);
66+
log->sizes[i].bytes = sections[i].default_val;
9067

9168
/* If debug size > 1MB then bump default crash size to keep the same units */
9269
if (log->sizes[GUC_LOG_SECTIONS_DEBUG].bytes >= SZ_1M &&

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,6 @@ struct drm_i915_private {
397397
*/
398398
u8 snps_phy_failed_calibration;
399399

400-
bool ipc_enabled;
401-
402400
struct i915_pmu pmu;
403401

404402
struct i915_drm_clients clients;

drivers/gpu/drm/i915/i915_pci.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
.__runtime.media.ip.ver = (x), \
4242
.__runtime.display.ip.ver = (x)
4343

44+
#define NO_DISPLAY .__runtime.pipe_mask = 0
45+
4446
#define I845_PIPE_OFFSETS \
4547
.display.pipe_offsets = { \
4648
[TRANSCODER_A] = PIPE_A_OFFSET, \
@@ -519,9 +521,8 @@ static const struct intel_device_info ivb_m_gt2_info = {
519521
static const struct intel_device_info ivb_q_info = {
520522
GEN7_FEATURES,
521523
PLATFORM(INTEL_IVYBRIDGE),
524+
NO_DISPLAY,
522525
.gt = 2,
523-
.__runtime.pipe_mask = 0, /* legal, last one wins */
524-
.__runtime.cpu_transcoder_mask = 0,
525526
.has_l3_dpf = 1,
526527
};
527528

@@ -1039,7 +1040,7 @@ static const struct intel_device_info xehpsdv_info = {
10391040
XE_HPM_FEATURES,
10401041
DGFX_FEATURES,
10411042
PLATFORM(INTEL_XEHPSDV),
1042-
.display = { },
1043+
NO_DISPLAY,
10431044
.has_64k_pages = 1,
10441045
.needs_compact_pt = 1,
10451046
.has_media_ratio_mode = 1,
@@ -1081,7 +1082,7 @@ static const struct intel_device_info dg2_info = {
10811082

10821083
static const struct intel_device_info ats_m_info = {
10831084
DG2_FEATURES,
1084-
.display = { 0 },
1085+
NO_DISPLAY,
10851086
.require_force_probe = 1,
10861087
.tuning_thread_rr_after_dep = 1,
10871088
};
@@ -1103,7 +1104,7 @@ static const struct intel_device_info pvc_info = {
11031104
.__runtime.graphics.ip.rel = 60,
11041105
.__runtime.media.ip.rel = 60,
11051106
PLATFORM(INTEL_PONTEVECCHIO),
1106-
.display = { 0 },
1107+
NO_DISPLAY,
11071108
.has_flat_ccs = 0,
11081109
.__runtime.platform_engine_mask =
11091110
BIT(BCS0) |

drivers/gpu/drm/i915/intel_device_info.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,14 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
433433
dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
434434
DRIVER_ATOMIC);
435435
memset(&info->display, 0, sizeof(info->display));
436+
437+
runtime->cpu_transcoder_mask = 0;
436438
memset(runtime->num_sprites, 0, sizeof(runtime->num_sprites));
437439
memset(runtime->num_scalers, 0, sizeof(runtime->num_scalers));
440+
runtime->fbc_mask = 0;
441+
runtime->has_hdcp = false;
442+
runtime->has_dmc = false;
443+
runtime->has_dsc = false;
438444
}
439445
}
440446

0 commit comments

Comments
 (0)