Re: [Intel-gfx] [PATCH v5 03/10] drm/i915/guc: Add DG2 registers for GuC error state capture.
On Wed, Jan 26, 2022 at 02:48:15AM -0800, Alan Previn wrote: Add additional DG2 registers for GuC error state capture. Signed-off-by: Alan Previn --- .../gpu/drm/i915/gt/uc/intel_guc_capture.c| 64 ++- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c index b6882074fc8d..19719daffed4 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c @@ -179,19 +179,23 @@ static struct __ext_steer_reg xelpd_extregs[] = { {"GEN7_ROW_INSTDONE", GEN7_ROW_INSTDONE} }; +static struct __ext_steer_reg xehpg_extregs[] = { + {"XEHPG_INSTDONE_GEOM_SVG", XEHPG_INSTDONE_GEOM_SVG} +}; + static void -guc_capture_alloc_steered_list_xelpd(struct intel_guc *guc, -struct __guc_mmio_reg_descr_group *lists) +guc_capture_alloc_steered_list_xe_lpd_hpg(struct intel_guc *guc, + struct __guc_mmio_reg_descr_group *lists, + u32 ipver) IMO having 2 separate functions would be easier to read and maintain. No ipver logic inside here. { struct intel_gt *gt = guc_to_gt(guc); struct drm_i915_private *i915 = guc_to_gt(guc)->i915; struct sseu_dev_info *sseu; - int slice, subslice, i, num_tot_regs = 0; + int slice, subslice, i, iter, num_steer_regs, num_tot_regs = 0; struct __guc_mmio_reg_descr_group *list; struct __guc_mmio_reg_descr *extarray; - int num_steer_regs = ARRAY_SIZE(xelpd_extregs); - /* In XE_LP we only care about render-class steering registers during error-capture */ + /* In XE_LP / HPG we only have render-class steering registers during error-capture */ list = guc_capture_get_one_list(lists, GUC_CAPTURE_LIST_INDEX_PF, GUC_CAPTURE_LIST_TYPE_ENGINE_CLASS, GUC_RENDER_CLASS); if (!list) @@ -200,10 +204,21 @@ guc_capture_alloc_steered_list_xelpd(struct intel_guc *guc, if (list->ext) return; /* already populated */ nit: if (!list || list->ext) return; + num_steer_regs = ARRAY_SIZE(xelpd_extregs); + if (ipver >= IP_VER(12, 55)) What does this actually mean? 12 55 has both lpd and hpg regs? You could (if possible) use has_lpd_regs/has_hpg_regs in i915_pci.c to simplify the platform specific logic. + num_steer_regs += ARRAY_SIZE(xehpg_extregs); + sseu = >info.sseu; - for_each_instdone_slice_subslice(i915, sseu, slice, subslice) { - num_tot_regs += num_steer_regs; + if (ipver >= IP_VER(12, 50)) { + for_each_instdone_gslice_dss_xehp(i915, sseu, iter, slice, subslice) { + num_tot_regs += num_steer_regs; + } + } else { + for_each_instdone_slice_subslice(i915, sseu, slice, subslice) { + num_tot_regs += num_steer_regs; + } } + if (!num_tot_regs) return; @@ -212,15 +227,31 @@ guc_capture_alloc_steered_list_xelpd(struct intel_guc *guc, return; extarray = list->ext; nit: I would mostly use extarray everywhere and assign it to list->ext at the end of the function. - for_each_instdone_slice_subslice(i915, sseu, slice, subslice) { - for (i = 0; i < num_steer_regs; i++) { - extarray->reg = xelpd_extregs[i].reg; - extarray->flags = FIELD_PREP(GUC_REGSET_STEERING_GROUP, slice); - extarray->flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, subslice); could use helpers extarray->flags |= __steering_flags(slice, subslice); - extarray->regname = xelpd_extregs[i].name; - ++extarray; + +#define POPULATE_NEXT_EXTREG(ext, list, idx, slicenum, subslicenum) \ + { \ + (ext)->reg = list[idx].reg; \ + (ext)->flags = FIELD_PREP(GUC_REGSET_STEERING_GROUP, slicenum); \ + (ext)->flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, subslicenum); \ + (ext)->regname = xelpd_extregs[i].name; \ + ++(ext); \ + } I prefer having an inline for the above assignments and move the ++(ext_ into the for loop itself. + if (ipver >= IP_VER(12, 50)) { + for_each_instdone_gslice_dss_xehp(i915, sseu, iter, slice, subslice) { + for (i = 0; i < ARRAY_SIZE(xelpd_extregs); i++) + POPULATE_NEXT_EXTREG(extarray, xelpd_extregs, i, slice, subslice) + for (i = 0; i < ARRAY_SIZE(xehpg_extregs) && ipver >= IP_VER(12, 55); +i++) + POPULATE_NEXT_EXTREG(extarray, xehpg_extregs, i, slice, subslice) +
Re: [Intel-gfx] [PATCH 10/10] drm/i915: Change bigjoiner state tracking to use the pipe bitmask
On Thu, Feb 03, 2022 at 08:38:23PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä > > Get rid of the inflexible bigjoiner_linked_crtc pointer thing > and just track things as a bitmask of pipes instead. We can > also nuke the bigjoiner_slave boolean as the role of the pipe > can be determined from its position in the bitmask. > > It might be possible to nuke the bigjoiner boolean as well > if we make encoder.compute_config() do the bitmask assignment > directly for the master pipe. But for now I left that alone so > that encoer.compute_config() will just flag the state as needing > bigjoiner, and the intel_atomic_check_bigjoiner() is still > responsible for determining the bitmask. But that may have to change > as the encoder may be in the best position to determine how > exactly we should populate the bitmask. > > Most places that just looked at the single bigjoiner_linked_crtc > now iterate over the whole bitmask, eliminating the singular > slave pipe assumption. Okay so trying to understand the design here: For Pipe A + B Bigjoiner and C + D bigjoiner for example, bitmasks will be as below: A : 0011 B: 0011 C: 1100 D: 1100 Is this correct understanding? Because we would mark both the master pipe and slave pipe in a bitmask right? > > Signed-off-by: Ville Syrjälä > --- > .../gpu/drm/i915/display/intel_atomic_plane.c | 5 +- > drivers/gpu/drm/i915/display/intel_ddi.c | 12 +- > drivers/gpu/drm/i915/display/intel_display.c | 305 -- > drivers/gpu/drm/i915/display/intel_display.h | 2 + > .../drm/i915/display/intel_display_debugfs.c | 5 +- > .../drm/i915/display/intel_display_types.h| 7 +- > .../drm/i915/display/intel_plane_initial.c| 7 - > drivers/gpu/drm/i915/display/intel_vdsc.c | 43 --- > drivers/gpu/drm/i915/display/intel_vdsc.h | 1 - > 9 files changed, 227 insertions(+), 160 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > index 41d52889dfce..0e15fe908855 100644 > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > @@ -404,9 +404,10 @@ int intel_plane_atomic_check(struct intel_atomic_state > *state, > intel_atomic_get_new_crtc_state(state, crtc); > > if (new_crtc_state && intel_crtc_is_bigjoiner_slave(new_crtc_state)) { > + struct intel_crtc *master_crtc = > + intel_master_crtc(new_crtc_state); > struct intel_plane *master_plane = > - > intel_crtc_get_plane(new_crtc_state->bigjoiner_linked_crtc, > - plane->id); > + intel_crtc_get_plane(master_crtc, plane->id); > > new_master_plane_state = > intel_atomic_get_new_plane_state(state, master_plane); > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c > b/drivers/gpu/drm/i915/display/intel_ddi.c > index 3f0e1e127595..9dee12986991 100644 > --- a/drivers/gpu/drm/i915/display/intel_ddi.c > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c > @@ -2703,6 +2703,7 @@ static void intel_ddi_post_disable(struct > intel_atomic_state *state, > struct intel_digital_port *dig_port = enc_to_dig_port(encoder); > enum phy phy = intel_port_to_phy(dev_priv, encoder->port); > bool is_tc_port = intel_phy_is_tc(dev_priv, phy); > + struct intel_crtc *slave_crtc; > > if (!intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DP_MST)) { > intel_crtc_vblank_off(old_crtc_state); > @@ -2721,9 +2722,8 @@ static void intel_ddi_post_disable(struct > intel_atomic_state *state, > ilk_pfit_disable(old_crtc_state); > } > > - if (old_crtc_state->bigjoiner_linked_crtc) { > - struct intel_crtc *slave_crtc = > - old_crtc_state->bigjoiner_linked_crtc; > + for_each_intel_crtc_in_pipe_mask(_priv->drm, slave_crtc, > + > intel_crtc_bigjoiner_slave_pipes(old_crtc_state)) { > const struct intel_crtc_state *old_slave_crtc_state = > intel_atomic_get_old_crtc_state(state, slave_crtc); > > @@ -3041,6 +3041,7 @@ intel_ddi_update_prepare(struct intel_atomic_state > *state, >struct intel_encoder *encoder, >struct intel_crtc *crtc) > { > + struct drm_i915_private *i915 = to_i915(state->base.dev); > struct intel_crtc_state *crtc_state = > crtc ? intel_atomic_get_new_crtc_state(state, crtc) : NULL; > int required_lanes = crtc_state ? crtc_state->lane_count : 1; > @@ -3050,11 +3051,12 @@ intel_ddi_update_prepare(struct intel_atomic_state > *state, > intel_tc_port_get_link(enc_to_dig_port(encoder), > required_lanes); > if (crtc_state && crtc_state->hw.active) { > - struct intel_crtc
[Intel-gfx] ✗ Fi.CI.IGT: failure for dma-buf-map: Rename to iosys-map (rev4)
== Series Details == Series: dma-buf-map: Rename to iosys-map (rev4) URL : https://patchwork.freedesktop.org/series/99612/ State : failure == Summary == CI Bug Log - changes from CI_DRM_11189_full -> Patchwork_22183_full Summary --- **FAILURE** Serious unknown changes coming with Patchwork_22183_full absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_22183_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. Participating hosts (11 -> 11) -- No changes in participating hosts Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_22183_full: ### IGT changes ### Possible regressions * igt@i915_selftest@mock@vma: - shard-skl: NOTRUN -> [INCOMPLETE][1] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-skl10/igt@i915_selftest@m...@vma.html Known issues Here are the changes found in Patchwork_22183_full that come from known issues: ### IGT changes ### Issues hit * igt@gem_ctx_persistence@legacy-engines-hang: - shard-snb: NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#1099]) [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-snb4/igt@gem_ctx_persiste...@legacy-engines-hang.html * igt@gem_ctx_shared@q-in-order: - shard-snb: NOTRUN -> [SKIP][3] ([fdo#109271]) +108 similar issues [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-snb4/igt@gem_ctx_sha...@q-in-order.html * igt@gem_eio@in-flight-10ms: - shard-tglb: [PASS][4] -> [TIMEOUT][5] ([i915#3063]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-tglb6/igt@gem_...@in-flight-10ms.html [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-tglb3/igt@gem_...@in-flight-10ms.html * igt@gem_exec_balancer@parallel-keep-submit-fence: - shard-iclb: [PASS][6] -> [SKIP][7] ([i915#4525]) +2 similar issues [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-iclb1/igt@gem_exec_balan...@parallel-keep-submit-fence.html [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-iclb6/igt@gem_exec_balan...@parallel-keep-submit-fence.html * igt@gem_exec_capture@pi@rcs0: - shard-skl: [PASS][8] -> [INCOMPLETE][9] ([i915#4547]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-skl8/igt@gem_exec_capture@p...@rcs0.html [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-skl4/igt@gem_exec_capture@p...@rcs0.html * igt@gem_exec_fair@basic-none-solo@rcs0: - shard-apl: NOTRUN -> [FAIL][10] ([i915#2842]) [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-apl7/igt@gem_exec_fair@basic-none-s...@rcs0.html * igt@gem_exec_fair@basic-none-vip@rcs0: - shard-glk: [PASS][11] -> [FAIL][12] ([i915#2842]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-glk5/igt@gem_exec_fair@basic-none-...@rcs0.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-glk8/igt@gem_exec_fair@basic-none-...@rcs0.html * igt@gem_exec_fair@basic-pace-solo@rcs0: - shard-kbl: [PASS][13] -> [FAIL][14] ([i915#2842]) +1 similar issue [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-kbl1/igt@gem_exec_fair@basic-pace-s...@rcs0.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-kbl1/igt@gem_exec_fair@basic-pace-s...@rcs0.html * igt@gem_exec_fair@basic-pace@vcs1: - shard-iclb: NOTRUN -> [FAIL][15] ([i915#2842]) [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-iclb4/igt@gem_exec_fair@basic-p...@vcs1.html * igt@gem_lmem_swapping@heavy-random: - shard-skl: NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#4613]) +1 similar issue [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-skl10/igt@gem_lmem_swapp...@heavy-random.html * igt@gem_userptr_blits@input-checking: - shard-skl: NOTRUN -> [DMESG-WARN][17] ([i915#4990]) [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-skl3/igt@gem_userptr_bl...@input-checking.html * igt@i915_pm_dc@dc6-dpms: - shard-skl: NOTRUN -> [FAIL][18] ([i915#454]) [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-skl7/igt@i915_pm...@dc6-dpms.html * igt@i915_pm_dc@dc6-psr: - shard-iclb: [PASS][19] -> [FAIL][20] ([i915#454]) [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-iclb5/igt@i915_pm...@dc6-psr.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/shard-iclb2/igt@i915_pm...@dc6-psr.html * igt@i915_pm_dc@dc9-dpms: -
[Intel-gfx] ✓ Fi.CI.BAT: success for dma-buf-map: Rename to iosys-map (rev4)
== Series Details == Series: dma-buf-map: Rename to iosys-map (rev4) URL : https://patchwork.freedesktop.org/series/99612/ State : success == Summary == CI Bug Log - changes from CI_DRM_11189 -> Patchwork_22183 Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/index.html Participating hosts (47 -> 44) -- Additional (2): fi-kbl-soraka fi-icl-u2 Missing(5): fi-bxt-dsi fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus Known issues Here are the changes found in Patchwork_22183 that come from known issues: ### IGT changes ### Issues hit * igt@amdgpu/amd_cs_nop@fork-gfx0: - fi-icl-u2: NOTRUN -> [SKIP][1] ([fdo#109315]) +17 similar issues [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-icl-u2/igt@amdgpu/amd_cs_...@fork-gfx0.html * igt@amdgpu/amd_cs_nop@nop-compute0: - fi-pnv-d510:NOTRUN -> [SKIP][2] ([fdo#109271]) +17 similar issues [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-pnv-d510/igt@amdgpu/amd_cs_...@nop-compute0.html * igt@gem_exec_fence@basic-busy@bcs0: - fi-kbl-soraka: NOTRUN -> [SKIP][3] ([fdo#109271]) +8 similar issues [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-kbl-soraka/igt@gem_exec_fence@basic-b...@bcs0.html * igt@gem_huc_copy@huc-copy: - fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#2190]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html - fi-icl-u2: NOTRUN -> [SKIP][5] ([i915#2190]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-icl-u2/igt@gem_huc_c...@huc-copy.html * igt@gem_lmem_swapping@parallel-random-engines: - fi-icl-u2: NOTRUN -> [SKIP][6] ([i915#4613]) +3 similar issues [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-icl-u2/igt@gem_lmem_swapp...@parallel-random-engines.html - fi-kbl-soraka: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#4613]) +3 similar issues [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-kbl-soraka/igt@gem_lmem_swapp...@parallel-random-engines.html * igt@i915_selftest@live: - fi-skl-6600u: NOTRUN -> [FAIL][8] ([i915#4547]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-skl-6600u/igt@i915_selft...@live.html * igt@i915_selftest@live@gt_lrc: - fi-bsw-n3050: [PASS][9] -> [DMESG-FAIL][10] ([i915#2373]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-bsw-n3050/igt@i915_selftest@live@gt_lrc.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-bsw-n3050/igt@i915_selftest@live@gt_lrc.html * igt@i915_selftest@live@gt_pm: - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][11] ([i915#1886] / [i915#2291]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html * igt@i915_selftest@live@hangcheck: - bat-dg1-6: [PASS][12] -> [DMESG-FAIL][13] ([i915#4957]) [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html * igt@kms_chamelium@dp-edid-read: - fi-kbl-soraka: NOTRUN -> [SKIP][14] ([fdo#109271] / [fdo#111827]) +8 similar issues [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-kbl-soraka/igt@kms_chamel...@dp-edid-read.html * igt@kms_chamelium@hdmi-hpd-fast: - fi-icl-u2: NOTRUN -> [SKIP][15] ([fdo#111827]) +8 similar issues [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-icl-u2/igt@kms_chamel...@hdmi-hpd-fast.html * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic: - fi-icl-u2: NOTRUN -> [SKIP][16] ([fdo#109278]) +2 similar issues [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-icl-u2/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-atomic.html * igt@kms_force_connector_basic@force-load-detect: - fi-icl-u2: NOTRUN -> [SKIP][17] ([fdo#109285]) [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-icl-u2/igt@kms_force_connector_ba...@force-load-detect.html * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d: - fi-kbl-soraka: NOTRUN -> [SKIP][18] ([fdo#109271] / [i915#533]) [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22183/fi-kbl-soraka/igt@kms_pipe_crc_ba...@compare-crc-sanitycheck-pipe-d.html * igt@kms_pipe_crc_basic@read-crc-pipe-b: - fi-cfl-8109u: [PASS][19] -> [DMESG-WARN][20] ([i915#295]) +11 similar issues [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-cfl-8109u/igt@kms_pipe_crc_ba...@read-crc-pipe-b.html [20]:
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for dma-buf-map: Rename to iosys-map (rev4)
== Series Details == Series: dma-buf-map: Rename to iosys-map (rev4) URL : https://patchwork.freedesktop.org/series/99612/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.
Re: [Intel-gfx] [PATCH] drm/i915/selftests: fix some error codes in __cancel_reset()
On Fri, Feb 04, 2022 at 06:45:51PM +0100, Andi Shyti wrote: > Hi Dan, > > > There were two error paths in __cancel_reset() which return success > > instead of a negative error code as expected. > > > > Fixes: 4e6835466771 ("drm/i915/selftests: Add a cancel request selftest > > that triggers a reset") > > Signed-off-by: Dan Carpenter > > --- > > >From static analysis. I am not 100% sure this. Please review extra > > carefully! > > > > drivers/gpu/drm/i915/selftests/i915_request.c | 7 +-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c > > b/drivers/gpu/drm/i915/selftests/i915_request.c > > index 2a99dd7c2fe8..05e9f977757b 100644 > > --- a/drivers/gpu/drm/i915/selftests/i915_request.c > > +++ b/drivers/gpu/drm/i915/selftests/i915_request.c > > @@ -809,7 +809,8 @@ static int __cancel_reset(struct drm_i915_private *i915, > > preempt_timeout_ms = engine->props.preempt_timeout_ms; > > engine->props.preempt_timeout_ms = 100; > > > > - if (igt_spinner_init(, engine->gt)) > > + err = igt_spinner_init(, engine->gt); > > + if (err) > > goto out_restore; > > > > ce = intel_context_create(engine); > > @@ -838,8 +839,10 @@ static int __cancel_reset(struct drm_i915_private > > *i915, > > } > > > > nop = intel_context_create_request(ce); > > - if (IS_ERR(nop)) > > + if (IS_ERR(nop)) { > > + err = PTR_ERR(nop); > > goto out_rq; > > + } > > Looks correct to me: > > Reviewed-by: Andi Shyti We need a rebased version to be sent... Sorry for the delay here... > > Thank you, > Andi
[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for dma-buf-map: Rename to iosys-map (rev4)
== Series Details == Series: dma-buf-map: Rename to iosys-map (rev4) URL : https://patchwork.freedesktop.org/series/99612/ State : warning == Summary == $ dim checkpatch origin/drm-tip 38b81c31b112 dma-buf-map: Rename to iosys-map -:237: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #237: FILE: drivers/dma-buf/dma-buf.c:1279: + BUG_ON(iosys_map_is_null(>vmap_ptr)); -:243: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #243: FILE: drivers/dma-buf/dma-buf.c:1284: + BUG_ON(iosys_map_is_set(>vmap_ptr)); -:258: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #258: FILE: drivers/dma-buf/dma-buf.c:1311: + BUG_ON(iosys_map_is_null(>vmap_ptr)); -:261: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #261: FILE: drivers/dma-buf/dma-buf.c:1313: + BUG_ON(!iosys_map_is_equal(>vmap_ptr, map)); -:1625: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please. -:1628: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please. -:2598: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #2598: deleted file mode 100644 total: 0 errors, 7 warnings, 0 checks, 2303 lines checked
Re: [Intel-gfx] [PATCH 06/10] drm/i915: Introduce intel_crtc_is_bigjoiner_{slave, master}()
On Thu, Feb 03, 2022 at 08:38:19PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä > > Introduce helpers to query whether the crtc is the slave/master > for bigjoiner. This decouples most places from the exact > state layout we use to track this relationship, allowing us > to change and extend it more easily. So even with the bitmask approach, we still plan to have bools for bigjoiner_slave? > > Performed with cocci: > @@ > expression S, E; > @@ > ( > S->bigjoiner_slave = E; > | > - S->bigjoiner_slave > + intel_crtc_is_bigjoiner_slave(S) > ) > > @@ > expression S, E; > @@ > ( > - E && S->bigjoiner && !intel_crtc_is_bigjoiner_slave(S) > + E && intel_crtc_is_bigjoiner_master(S) > | > - S->bigjoiner && !intel_crtc_is_bigjoiner_slave(S) > + intel_crtc_is_bigjoiner_master(S) > ) > > @@ > expression S; > @@ > - (intel_crtc_is_bigjoiner_master(S)) > + intel_crtc_is_bigjoiner_master(S) > > @@ > expression S, E1, E2, E3; > @@ > - intel_crtc_is_bigjoiner_slave(S) ? E1 : S->bigjoiner ? E2 : E3 > + intel_crtc_is_bigjoiner_slave(S) ? E1 : intel_crtc_is_bigjoiner_master(S) ? > E2 : E3 > > @@ > typedef bool; > @@ > + bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state > *crtc_state) > + { > + return crtc_state->bigjoiner_slave; > + } > + > intel_master_crtc(...) {...} > > @@ > typedef bool; > @@ > + bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state > *crtc_state) > + { > + return crtc_state->bigjoiner && !crtc_state->bigjoiner_slave; > + } > + > intel_master_crtc(...) {...} > > @@ > typedef bool; > identifier S; > @@ > - bool is_trans_port_sync_mode(const struct intel_crtc_state *S); > + bool is_trans_port_sync_mode(const struct intel_crtc_state *state); > + bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state > *crtc_state); > + bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state > *crtc_state); Is all of the above part of the commit message? Dont understand why its changing is_trans_port_sync_mode() ? Manasi > > Signed-off-by: Ville Syrjälä > --- > .../gpu/drm/i915/display/intel_atomic_plane.c | 4 +- > drivers/gpu/drm/i915/display/intel_ddi.c | 2 +- > drivers/gpu/drm/i915/display/intel_display.c | 51 +++ > drivers/gpu/drm/i915/display/intel_display.h | 2 + > .../drm/i915/display/intel_display_debugfs.c | 2 +- > drivers/gpu/drm/i915/display/intel_vdsc.c | 4 +- > 6 files changed, 39 insertions(+), 26 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > index bec02333bdeb..41d52889dfce 100644 > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > @@ -403,7 +403,7 @@ int intel_plane_atomic_check(struct intel_atomic_state > *state, > struct intel_crtc_state *new_crtc_state = > intel_atomic_get_new_crtc_state(state, crtc); > > - if (new_crtc_state && new_crtc_state->bigjoiner_slave) { > + if (new_crtc_state && intel_crtc_is_bigjoiner_slave(new_crtc_state)) { > struct intel_plane *master_plane = > > intel_crtc_get_plane(new_crtc_state->bigjoiner_linked_crtc, >plane->id); > @@ -633,7 +633,7 @@ int intel_atomic_plane_check_clipping(struct > intel_plane_state *plane_state, > } > > /* right side of the image is on the slave crtc, adjust dst to match */ > - if (crtc_state->bigjoiner_slave) > + if (intel_crtc_is_bigjoiner_slave(crtc_state)) > drm_rect_translate(dst, -crtc_state->pipe_src_w, 0); > > /* > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c > b/drivers/gpu/drm/i915/display/intel_ddi.c > index 354b08d6f81d..3f0e1e127595 100644 > --- a/drivers/gpu/drm/i915/display/intel_ddi.c > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c > @@ -2926,7 +2926,7 @@ static void intel_enable_ddi(struct intel_atomic_state > *state, > { > drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder); > > - if (!crtc_state->bigjoiner_slave) > + if (!intel_crtc_is_bigjoiner_slave(crtc_state)) > intel_ddi_enable_transcoder_func(encoder, crtc_state); > > intel_vrr_enable(encoder, crtc_state); > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index d5dc2c25c1f6..9a7f40d17b79 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -337,9 +337,19 @@ is_trans_port_sync_mode(const struct intel_crtc_state > *crtc_state) > is_trans_port_sync_slave(crtc_state); > } > > +bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state) > +{ > + return crtc_state->bigjoiner_slave; > +} > + > +bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state > *crtc_state) > +{ > + return crtc_state->bigjoiner &&
Re: [Intel-gfx] [PATCH 05/10] drm/i915: Nuke some dead code
On Thu, Feb 03, 2022 at 08:38:18PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä > > Remove all the dead code from icl_ddi_bigjoiner_pre_enable(). > > Signed-off-by: Ville Syrjälä Yup good catch here and thank you for cleaning up the dead code Reviewed-by: Manasi Navare Manasi > --- > drivers/gpu/drm/i915/display/intel_display.c | 18 +- > 1 file changed, 1 insertion(+), 17 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index 48869478efc2..d5dc2c25c1f6 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -1974,23 +1974,7 @@ static void hsw_set_frame_start_delay(const struct > intel_crtc_state *crtc_state) > static void icl_ddi_bigjoiner_pre_enable(struct intel_atomic_state *state, >const struct intel_crtc_state > *crtc_state) > { > - struct intel_crtc_state *master_crtc_state; > - struct intel_crtc *master_crtc; > - struct drm_connector_state *conn_state; > - struct drm_connector *conn; > - struct intel_encoder *encoder = NULL; > - int i; > - > - master_crtc = intel_master_crtc(crtc_state); > - master_crtc_state = intel_atomic_get_new_crtc_state(state, master_crtc); > - > - for_each_new_connector_in_state(>base, conn, conn_state, i) { > - if (conn_state->crtc != _crtc->base) > - continue; > - > - encoder = to_intel_encoder(conn_state->best_encoder); > - break; > - } > + struct intel_crtc *master_crtc = intel_master_crtc(crtc_state); > > /* >* Enable sequence steps 1-7 on bigjoiner master > -- > 2.34.1 >
[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/helpers: Make the suballocation manager drm generic.
== Series Details == Series: drm/helpers: Make the suballocation manager drm generic. URL : https://patchwork.freedesktop.org/series/99713/ State : failure == Summary == CI Bug Log - changes from CI_DRM_11189_full -> Patchwork_22182_full Summary --- **FAILURE** Serious unknown changes coming with Patchwork_22182_full absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_22182_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. Participating hosts (11 -> 11) -- No changes in participating hosts Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_22182_full: ### IGT changes ### Possible regressions * igt@i915_selftest@mock@vma: - shard-skl: NOTRUN -> [INCOMPLETE][1] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-skl6/igt@i915_selftest@m...@vma.html Known issues Here are the changes found in Patchwork_22182_full that come from known issues: ### IGT changes ### Issues hit * igt@gem_ctx_persistence@legacy-engines-hang: - shard-snb: NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#1099]) [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-snb2/igt@gem_ctx_persiste...@legacy-engines-hang.html * igt@gem_ctx_shared@q-in-order: - shard-snb: NOTRUN -> [SKIP][3] ([fdo#109271]) +108 similar issues [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-snb2/igt@gem_ctx_sha...@q-in-order.html * igt@gem_exec_balancer@parallel-keep-submit-fence: - shard-iclb: [PASS][4] -> [SKIP][5] ([i915#4525]) +2 similar issues [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-iclb1/igt@gem_exec_balan...@parallel-keep-submit-fence.html [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-iclb3/igt@gem_exec_balan...@parallel-keep-submit-fence.html * igt@gem_exec_capture@pi@vecs0: - shard-skl: [PASS][6] -> [INCOMPLETE][7] ([i915#4547]) [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-skl8/igt@gem_exec_capture@p...@vecs0.html [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-skl10/igt@gem_exec_capture@p...@vecs0.html * igt@gem_exec_endless@dispatch@vecs0: - shard-tglb: [PASS][8] -> [INCOMPLETE][9] ([i915#3778]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-tglb7/igt@gem_exec_endless@dispa...@vecs0.html [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-tglb2/igt@gem_exec_endless@dispa...@vecs0.html * igt@gem_exec_fair@basic-none-vip@rcs0: - shard-glk: [PASS][10] -> [FAIL][11] ([i915#2842]) [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-glk5/igt@gem_exec_fair@basic-none-...@rcs0.html [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-glk2/igt@gem_exec_fair@basic-none-...@rcs0.html * igt@gem_exec_fair@basic-none@vcs0: - shard-kbl: [PASS][12] -> [FAIL][13] ([i915#2842]) +4 similar issues [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-kbl6/igt@gem_exec_fair@basic-n...@vcs0.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-kbl3/igt@gem_exec_fair@basic-n...@vcs0.html * igt@gem_exec_fair@basic-pace@vcs1: - shard-iclb: NOTRUN -> [FAIL][14] ([i915#2842]) [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-iclb1/igt@gem_exec_fair@basic-p...@vcs1.html * igt@gem_exec_whisper@basic-forked-all: - shard-glk: [PASS][15] -> [DMESG-WARN][16] ([i915#118]) [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-glk4/igt@gem_exec_whis...@basic-forked-all.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-glk1/igt@gem_exec_whis...@basic-forked-all.html * igt@gem_lmem_swapping@heavy-random: - shard-skl: NOTRUN -> [SKIP][17] ([fdo#109271] / [i915#4613]) [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-skl6/igt@gem_lmem_swapp...@heavy-random.html * igt@gem_userptr_blits@input-checking: - shard-skl: NOTRUN -> [DMESG-WARN][18] ([i915#4990]) [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-skl4/igt@gem_userptr_bl...@input-checking.html * igt@gem_workarounds@suspend-resume-context: - shard-apl: [PASS][19] -> [DMESG-WARN][20] ([i915#180]) +3 similar issues [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl8/igt@gem_workarou...@suspend-resume-context.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/shard-apl8/igt@gem_workarou...@suspend-resume-context.html - shard-skl:
Re: [Intel-gfx] [PATCH v2 02/10] drm/i915: Fix bigjoiner state copy fails
On Fri, Feb 04, 2022 at 09:20:09AM +0200, Ville Syrjala wrote: > From: Ville Syrjälä > > We seem to be missing a few things from the bigjoiner state copy. > Namely hw.mode isn't getting copied (which probably causes PIPESRC > to be misconfigured), CTM/LUTs aren't getting copied (which could > cause the pipe to produced incorrect output), and we also forgot > to copy over the color_mgmt_changed flag so potentially we fail > to do the actual CTM/LUT programming (assuming we aren't doing > a full modeset or fastset). Fix it all. > > v2: Fix uapi.ctm vs. hw.ctm copy-paste fail > > Signed-off-by: Ville Syrjälä Yup looks good Reviewed-by: Manasi Navare Manasi > --- > drivers/gpu/drm/i915/display/intel_display.c | 14 +- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index 85dce8a093d4..4f5f023417a6 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -5827,8 +5827,10 @@ intel_crtc_copy_uapi_to_hw_state_nomodeset(struct > intel_atomic_state *state, > master_crtc_state = intel_atomic_get_new_crtc_state(state, master_crtc); > > /* No need to copy state if the master state is unchanged */ > - if (master_crtc_state) > + if (master_crtc_state) { > + crtc_state->uapi.color_mgmt_changed = > master_crtc_state->uapi.color_mgmt_changed; > intel_crtc_copy_color_blobs(crtc_state, master_crtc_state); > + } > } > > static void > @@ -5890,13 +5892,23 @@ copy_bigjoiner_crtc_state(struct intel_crtc_state > *crtc_state, > memset(_state->hw, 0, sizeof(saved_state->hw)); > crtc_state->hw.enable = from_crtc_state->hw.enable; > crtc_state->hw.active = from_crtc_state->hw.active; > + crtc_state->hw.mode = from_crtc_state->hw.mode; > crtc_state->hw.pipe_mode = from_crtc_state->hw.pipe_mode; > crtc_state->hw.adjusted_mode = from_crtc_state->hw.adjusted_mode; > + crtc_state->hw.scaling_filter = from_crtc_state->hw.scaling_filter; > + > + drm_property_replace_blob(_state->hw.degamma_lut, > + from_crtc_state->hw.degamma_lut); > + drm_property_replace_blob(_state->hw.gamma_lut, > + from_crtc_state->hw.gamma_lut); > + drm_property_replace_blob(_state->hw.ctm, > + from_crtc_state->hw.ctm); > > /* Some fixups */ > crtc_state->uapi.mode_changed = from_crtc_state->uapi.mode_changed; > crtc_state->uapi.connectors_changed = > from_crtc_state->uapi.connectors_changed; > crtc_state->uapi.active_changed = from_crtc_state->uapi.active_changed; > + crtc_state->uapi.color_mgmt_changed = > from_crtc_state->uapi.color_mgmt_changed; > crtc_state->nv12_planes = crtc_state->c8_planes = > crtc_state->update_planes = 0; > crtc_state->bigjoiner_linked_crtc = > to_intel_crtc(from_crtc_state->uapi.crtc); > crtc_state->bigjoiner_slave = true; > -- > 2.34.1 >
Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Disable unused power wells left enabled by BIOS (rev2)
Hi Imre, I have re-reported below failure: https://patchwork.freedesktop.org/series/99615/ Thanks, Sai Nandan -Original Message- From: Deak, Imre Sent: Thursday, February 3, 2022 4:39 PM To: intel-gfx@lists.freedesktop.org Cc: Vudum, Lakshminarayana ; Sai Nandan, YedireswarapuX ; Ville Syrjälä Subject: Re: ✗ Fi.CI.IGT: failure for drm/i915: Disable unused power wells left enabled by BIOS (rev2) On Wed, Feb 02, 2022 at 10:20:04PM +, Patchwork wrote: > == Series Details == > > Series: drm/i915: Disable unused power wells left enabled by BIOS (rev2) > URL : https://patchwork.freedesktop.org/series/99615/ > State : failure > > == Summary == > > CI Bug Log - changes from CI_DRM_11180_full -> Patchwork_22160_full > > > Summary > --- > > **FAILURE** > > Serious unknown changes coming with Patchwork_22160_full absolutely need to > be > verified manually. > > If you think the reported changes have nothing to do with the changes > introduced in Patchwork_22160_full, please notify your bug team to allow > them > to document this new failure mode, which will reduce false positives in CI. > > Participating hosts (11 -> 11) > -- > > No changes in participating hosts > > Possible new issues > --- > > Here are the unknown changes that may have been introduced in > Patchwork_22160_full: > > ### IGT changes ### > > Possible regressions > > * igt@i915_pm_rpm@system-suspend-devices: > - shard-iclb: [PASS][1] -> [INCOMPLETE][2] >[1]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11180/shard-iclb6/igt@i915_pm_...@system-suspend-devices.html >[2]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-iclb7/i > gt@i915_pm_...@system-suspend-devices.html Unrelated to the change since it didn't have an effect on this machine, no power wells were left enabled by BIOS and got disabled by the driver. Looks like an issue with SSD entering a low power state (after i915 also runtime suspends): <6>[ 774.335425] ata3: hard resetting link <6>[ 774.647894] ata3: SATA link down (SStatus 0 SControl 300) <4>[ 774.647950] ata3.00: disable device <3>[ 774.648328] sd 2:0:0:0: rejecting I/O to offline device <3>[ 774.648694] I/O error, dev sda, sector 9701832 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0 <3>[ 774.650230] I/O error, dev sda, sector 9701832 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 <6>[ 774.650289] sd 2:0:0:0: [sda] tag#5 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=DRIVER_OK cmd_age=44s <6>[ 774.650311] sd 2:0:0:0: [sda] tag#5 Sense Key : 0x2 [current] <6>[ 774.650325] sd 2:0:0:0: [sda] tag#5 ASC=0x4 ASCQ=0x21 <6>[ 774.650339] sd 2:0:0:0: [sda] tag#5 CDB: opcode=0x2a 2a 00 0e ad 77 f0 00 00 50 00 <3>[ 774.650348] I/O error, dev sda, sector 246249456 op 0x1:(WRITE) flags 0x0 phys_seg 9 prio class 0 <4>[ 774.650368] EXT4-fs warning (device sda2): ext4_end_bio:346: I/O error 10 writing to inode 9700553 starting block 30781182) <3>[ 774.650426] Buffer I/O error on device sda2, logical block 30649854 I found similar earlier failures on the same machine: IGTPW_6574/shard-iclb7/19/dmesg-efi-164310156512001 and on another iclb in shards: Patchwork_22116/shard-iclb4/22/dmesg-efi-164324260302001 Patchwork_22133/shard-iclb4/8/dmesg-efi-164333915203001 IGTPW_6596/shard-iclb4/0/dmesg-efi-164387009603001 Patch is pushed, thanks for the review. > > > Known issues > > > Here are the changes found in Patchwork_22160_full that come from known > issues: > > ### IGT changes ### > > Issues hit > > * igt@gem_ctx_sseu@invalid-args: > - shard-tglb: NOTRUN -> [SKIP][3] ([i915#280]) >[3]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-tglb1/i > gt@gem_ctx_s...@invalid-args.html > > * igt@gem_exec_balancer@parallel: > - shard-iclb: [PASS][4] -> [SKIP][5] ([i915#4525]) >[4]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11180/shard-iclb1/igt@gem_exec_balan...@parallel.html >[5]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-iclb8/i > gt@gem_exec_balan...@parallel.html > > * igt@gem_exec_fair@basic-flow@rcs0: > - shard-skl: NOTRUN -> [SKIP][6] ([fdo#109271]) +291 similar > issues >[6]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-skl8/ig > t@gem_exec_fair@basic-f...@rcs0.html > > * igt@gem_exec_fair@basic-none-rrul@rcs0: > - shard-glk: [PASS][7] -> [FAIL][8] ([i915#2842]) +1 similar > issue >[7]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11180/shard-glk5/igt@gem_exec_fair@basic-none-r...@rcs0.html >[8]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-glk2/igt@gem_exec_fair@basic-none-r...@rcs0.html > - shard-tglb: NOTRUN -> [FAIL][9] ([i915#2842]) >[9]: >
Re: [Intel-gfx] [PATCH v2 04/10] drm/i915: Clean up the bigjoiner state copy logic
On Fri, Feb 04, 2022 at 09:20:49AM +0200, Ville Syrjala wrote: > From: Ville Syrjälä > > Currently the bigjoiner state copy logic is kind of > a byzantine mess. > > Clean it up to operate in the following manner during a full > modeset: > 1) master uapi -> hw state copy > 2) master hw -> slave hw state copy > > And during a non-modeset update we do: > 1) master uapi -> hw state light copy > 2) master hw -> slave hw state light copy > > I think that is now easier to reason about since we never do > any kind of master uapi -> slave hw state copy short circuit > that could happen previously. > > Obviously this does now depend on the master uapi->hw copy > always happening before the master hw -> slave hw copy, but > that is guaranteed by the fact that we always add both crtcs > to the state early, the crtcs are registered in pipe > order (so the compute_config loop happens in pipe order), > and the hardware requires the master pipe has to be lower > than the slave pipe as well. And for good measure we shall > add a check+WARN for this before doing the bigjoiner crtc > assignment. > > v2: Fix uapi.ctm vs. hw.ctm copy-paste fail > > Signed-off-by: Ville Syrjälä Looks good to me, jus one question on how we decide what state from orginal slave crtc state to preserve. But in either case Reviewed-by: Manasi Navare > --- > drivers/gpu/drm/i915/display/intel_atomic.c | 11 -- > drivers/gpu/drm/i915/display/intel_atomic.h | 2 - > drivers/gpu/drm/i915/display/intel_display.c | 170 --- > 3 files changed, 108 insertions(+), 75 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c > b/drivers/gpu/drm/i915/display/intel_atomic.c > index 093904065112..e0667d163266 100644 > --- a/drivers/gpu/drm/i915/display/intel_atomic.c > +++ b/drivers/gpu/drm/i915/display/intel_atomic.c > @@ -281,17 +281,6 @@ void intel_crtc_free_hw_state(struct intel_crtc_state > *crtc_state) > intel_crtc_put_color_blobs(crtc_state); > } > > -void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state, > - const struct intel_crtc_state *from_crtc_state) > -{ > - drm_property_replace_blob(_state->hw.degamma_lut, > - from_crtc_state->uapi.degamma_lut); > - drm_property_replace_blob(_state->hw.gamma_lut, > - from_crtc_state->uapi.gamma_lut); > - drm_property_replace_blob(_state->hw.ctm, > - from_crtc_state->uapi.ctm); > -} > - > /** > * intel_crtc_destroy_state - destroy crtc state > * @crtc: drm crtc > diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h > b/drivers/gpu/drm/i915/display/intel_atomic.h > index d2700c74c9da..1dc439983dd9 100644 > --- a/drivers/gpu/drm/i915/display/intel_atomic.h > +++ b/drivers/gpu/drm/i915/display/intel_atomic.h > @@ -44,8 +44,6 @@ struct drm_crtc_state *intel_crtc_duplicate_state(struct > drm_crtc *crtc); > void intel_crtc_destroy_state(struct drm_crtc *crtc, > struct drm_crtc_state *state); > void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state); > -void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state, > - const struct intel_crtc_state > *from_crtc_state); > struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev); > void intel_atomic_state_free(struct drm_atomic_state *state); > void intel_atomic_state_clear(struct drm_atomic_state *state); > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index 349cc3807e8b..b391cb98b12f 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -5818,32 +5818,37 @@ static bool check_digital_port_conflicts(struct > intel_atomic_state *state) > > static void > intel_crtc_copy_uapi_to_hw_state_nomodeset(struct intel_atomic_state *state, > -struct intel_crtc_state *crtc_state) > +struct intel_crtc *crtc) > { > - const struct intel_crtc_state *master_crtc_state; > - struct intel_crtc *master_crtc; > + struct intel_crtc_state *crtc_state = > + intel_atomic_get_new_crtc_state(state, crtc); > > - master_crtc = intel_master_crtc(crtc_state); > - master_crtc_state = intel_atomic_get_new_crtc_state(state, master_crtc); > + WARN_ON(crtc_state->bigjoiner_slave); > > - /* No need to copy state if the master state is unchanged */ > - if (master_crtc_state) { > - crtc_state->uapi.color_mgmt_changed = > master_crtc_state->uapi.color_mgmt_changed; > - intel_crtc_copy_color_blobs(crtc_state, master_crtc_state); > - } > + drm_property_replace_blob(_state->hw.degamma_lut, > + crtc_state->uapi.degamma_lut); > + drm_property_replace_blob(_state->hw.gamma_lut, > +
[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915: Disable unused power wells left enabled by BIOS (rev2)
== Series Details == Series: drm/i915: Disable unused power wells left enabled by BIOS (rev2) URL : https://patchwork.freedesktop.org/series/99615/ State : success == Summary == CI Bug Log - changes from CI_DRM_11180_full -> Patchwork_22160_full Summary --- **SUCCESS** No regressions found. Participating hosts (11 -> 13) -- Additional (2): shard-rkl shard-dg1 Known issues Here are the changes found in Patchwork_22160_full that come from known issues: ### IGT changes ### Issues hit * igt@gem_ctx_sseu@invalid-args: - shard-tglb: NOTRUN -> [SKIP][1] ([i915#280]) [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-tglb1/igt@gem_ctx_s...@invalid-args.html * igt@gem_exec_balancer@parallel: - shard-iclb: [PASS][2] -> [SKIP][3] ([i915#4525]) [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11180/shard-iclb1/igt@gem_exec_balan...@parallel.html [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-iclb8/igt@gem_exec_balan...@parallel.html * igt@gem_exec_fair@basic-flow@rcs0: - shard-skl: NOTRUN -> [SKIP][4] ([fdo#109271]) +291 similar issues [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-skl8/igt@gem_exec_fair@basic-f...@rcs0.html * igt@gem_exec_fair@basic-none-rrul@rcs0: - shard-glk: [PASS][5] -> [FAIL][6] ([i915#2842]) +1 similar issue [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11180/shard-glk5/igt@gem_exec_fair@basic-none-r...@rcs0.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-glk2/igt@gem_exec_fair@basic-none-r...@rcs0.html - shard-tglb: NOTRUN -> [FAIL][7] ([i915#2842]) [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-tglb1/igt@gem_exec_fair@basic-none-r...@rcs0.html * igt@gem_exec_fair@basic-pace-solo@rcs0: - shard-kbl: [PASS][8] -> [FAIL][9] ([i915#2842]) +1 similar issue [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11180/shard-kbl7/igt@gem_exec_fair@basic-pace-s...@rcs0.html [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-kbl6/igt@gem_exec_fair@basic-pace-s...@rcs0.html * igt@gem_exec_fair@basic-pace@bcs0: - shard-tglb: [PASS][10] -> [FAIL][11] ([i915#2842]) [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11180/shard-tglb1/igt@gem_exec_fair@basic-p...@bcs0.html [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-tglb1/igt@gem_exec_fair@basic-p...@bcs0.html * igt@gem_exec_fair@basic-throttle@rcs0: - shard-iclb: [PASS][12] -> [FAIL][13] ([i915#2849]) [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11180/shard-iclb5/igt@gem_exec_fair@basic-throt...@rcs0.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-iclb8/igt@gem_exec_fair@basic-throt...@rcs0.html * igt@gem_huc_copy@huc-copy: - shard-skl: NOTRUN -> [SKIP][14] ([fdo#109271] / [i915#2190]) [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-skl6/igt@gem_huc_c...@huc-copy.html * igt@gem_lmem_swapping@heavy-random: - shard-iclb: NOTRUN -> [SKIP][15] ([i915#4613]) [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-iclb3/igt@gem_lmem_swapp...@heavy-random.html * igt@gem_lmem_swapping@parallel-random: - shard-skl: NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#4613]) +3 similar issues [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-skl8/igt@gem_lmem_swapp...@parallel-random.html * igt@gem_lmem_swapping@verify-random: - shard-apl: NOTRUN -> [SKIP][17] ([fdo#109271] / [i915#4613]) [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-apl8/igt@gem_lmem_swapp...@verify-random.html * igt@gem_mmap_wc@bad-offset: - shard-skl: NOTRUN -> [DMESG-WARN][18] ([i915#1982]) [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-skl6/igt@gem_mmap...@bad-offset.html * igt@gem_pxp@fail-invalid-protected-context: - shard-tglb: NOTRUN -> [SKIP][19] ([i915#4270]) +1 similar issue [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-tglb1/igt@gem_...@fail-invalid-protected-context.html * igt@gem_userptr_blits@dmabuf-unsync: - shard-tglb: NOTRUN -> [SKIP][20] ([i915#3297]) [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-tglb1/igt@gem_userptr_bl...@dmabuf-unsync.html * igt@gem_userptr_blits@input-checking: - shard-skl: NOTRUN -> [DMESG-WARN][21] ([i915#4990]) [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22160/shard-skl10/igt@gem_userptr_bl...@input-checking.html * igt@gem_userptr_blits@vma-merge: - shard-apl: NOTRUN -> [FAIL][22] ([i915#3318]) [22]:
Re: [Intel-gfx] [PATCH 19/21] fbcon: Maintain a private array of fb_info
Hi Daniel, On Mon, Jan 31, 2022 at 10:05:50PM +0100, Daniel Vetter wrote: > Accessing the one in fbmem.c without taking the right locks is a bad > idea. Instead maintain our own private copy, which is fully protected > by console_lock() (like everything else in fbcon.c). That copy is > serialized through fbcon_fb_registered/unregistered() calls. I fail to see why we can make a private copy of registered_fb just like that - are they not somehow shared between fbcon and fbmem. So when fbmem updates it, then fbcon will use the entry or such? I guess I am just ignorant of how registered_fb is used - but please explain. Sam > > Also this means we do not need to hold a full fb_info reference, which > is nice because doing so would mean a refcount loop between the > console and the fb_info. But it's also not nice since it means > console_lock() must be held absolutely everywhere. Well strictly > speaking we could still try to do some refcounting games again by > calling get_fb_info before we drop the console_lock. But things will > get tricky. > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Tetsuo Handa > Cc: Claudio Suarez > Cc: Du Cheng > Cc: Greg Kroah-Hartman > --- > drivers/video/fbdev/core/fbcon.c | 82 +--- > 1 file changed, 43 insertions(+), 39 deletions(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c > b/drivers/video/fbdev/core/fbcon.c > index 22581952b4fd..a0ca34b29615 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -86,10 +86,6 @@ > * - fbcon state itself is protected by the console_lock, and the code does a > * pretty good job at making sure that lock is held everywhere it's needed. > * > - * - access to the registered_fb array is entirely unprotected. This should > use > - * proper object lifetime handling, i.e. get/put_fb_info. This also means > - * switching from indices to proper pointers for fb_info everywhere. > - * > * - fbcon doesn't bother with fb_lock/unlock at all. This is buggy, since it > * means concurrent access to the same fbdev from both fbcon and userspace > * will blow up. To fix this all fbcon calls from fbmem.c need to be moved > out > @@ -107,6 +103,13 @@ enum { > > static struct fbcon_display fb_display[MAX_NR_CONSOLES]; > > +struct fb_info *fbcon_registered_fb[FB_MAX]; > +int fbcon_num_registered_fb; > + > +#define fbcon_for_each_registered_fb(i) \ > + for (i = 0; WARN_CONSOLE_UNLOCKED(), i < FB_MAX; i++) \ > + if (!fbcon_registered_fb[i]) {} else > + > static signed char con2fb_map[MAX_NR_CONSOLES]; > static signed char con2fb_map_boot[MAX_NR_CONSOLES]; > > @@ -114,12 +117,7 @@ static struct fb_info *fbcon_info_from_console(int > console) > { > WARN_CONSOLE_UNLOCKED(); > > - /* > - * Note that only con2fb_map is protected by the console lock, > - * registered_fb is protected by a separate mutex. This lookup can > - * therefore race. > - */ > - return registered_fb[con2fb_map[console]]; > + return fbcon_registered_fb[con2fb_map[console]]; > } > > static int logo_lines; > @@ -516,7 +514,7 @@ static int do_fbcon_takeover(int show_logo) > { > int err, i; > > - if (!num_registered_fb) > + if (!fbcon_num_registered_fb) > return -ENODEV; > > if (!show_logo) > @@ -822,7 +820,7 @@ static int set_con2fb_map(int unit, int newidx, int user) > { > struct vc_data *vc = vc_cons[unit].d; > int oldidx = con2fb_map[unit]; > - struct fb_info *info = registered_fb[newidx]; > + struct fb_info *info = fbcon_registered_fb[newidx]; > struct fb_info *oldinfo = NULL; > int found, err = 0, show_logo; > > @@ -840,7 +838,7 @@ static int set_con2fb_map(int unit, int newidx, int user) > } > > if (oldidx != -1) > - oldinfo = registered_fb[oldidx]; > + oldinfo = fbcon_registered_fb[oldidx]; > > found = search_fb_in_map(newidx); > > @@ -932,13 +930,13 @@ static const char *fbcon_startup(void) >* If num_registered_fb is zero, this is a call for the dummy part. >* The frame buffer devices weren't initialized yet. >*/ > - if (!num_registered_fb || info_idx == -1) > + if (!fbcon_num_registered_fb || info_idx == -1) > return display_desc; > /* >* Instead of blindly using registered_fb[0], we use info_idx, set by >* fbcon_fb_registered(); >*/ > - info = registered_fb[info_idx]; > + info = fbcon_registered_fb[info_idx]; > if (!info) > return NULL; > > @@ -1153,9 +1151,9 @@ static void fbcon_release_all(void) > struct fb_info *info; > int i, j, mapped; > > - for_each_registered_fb(i) { > + fbcon_for_each_registered_fb(i) { > mapped = 0; > - info = registered_fb[i]; > + info = fbcon_registered_fb[i];
Re: [Intel-gfx] [PATCH 18/21] fbcon: untangle fbcon_exit
Hi Daniel, On Mon, Jan 31, 2022 at 10:05:49PM +0100, Daniel Vetter wrote: > There's a bunch of confusions going on here: > - The deferred fbcon setup notifier should only be cleaned up from > fb_console_exit(), to be symmetric with fb_console_init() > - We also need to make sure we don't race with the work, which means > temporarily dropping the console lock (or we can deadlock) > - That also means no point in clearing deferred_takeover, we are > unloading everything anyway. > - Finally rename fbcon_exit to fbcon_release_all and move it, since > that's what's it doing when being called from consw->con_deinit > through fbcon_deinit. > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Greg Kroah-Hartman > Cc: Claudio Suarez > Cc: Du Cheng > Cc: Tetsuo Handa > --- > drivers/video/fbdev/core/fbcon.c | 63 > 1 file changed, 32 insertions(+), 31 deletions(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c > b/drivers/video/fbdev/core/fbcon.c > index 5c14e24d14a1..22581952b4fd 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -185,7 +185,6 @@ static void fbcon_set_disp(struct fb_info *info, struct > fb_var_screeninfo *var, > int unit); > static void fbcon_modechanged(struct fb_info *info); > static void fbcon_set_all_vcs(struct fb_info *info); > -static void fbcon_exit(void); > > static struct device *fbcon_device; > > @@ -1149,6 +1148,27 @@ static void fbcon_free_font(struct fbcon_display *p, > bool freefont) > > static void set_vc_hi_font(struct vc_data *vc, bool set); > > +static void fbcon_release_all(void) > +{ > + struct fb_info *info; > + int i, j, mapped; > + > + for_each_registered_fb(i) { > + mapped = 0; > + info = registered_fb[i]; > + > + for (j = first_fb_vc; j <= last_fb_vc; j++) { > + if (con2fb_map[j] == i) { > + mapped = 1; > + con2fb_map[j] = -1; > + } > + } > + > + if (mapped) > + fbcon_release(info); > + } > +} > + > static void fbcon_deinit(struct vc_data *vc) > { > struct fbcon_display *p = _display[vc->vc_num]; > @@ -1188,7 +1208,7 @@ static void fbcon_deinit(struct vc_data *vc) > set_vc_hi_font(vc, false); > > if (!con_is_bound(_con)) > - fbcon_exit(); > + fbcon_release_all(); > > if (vc->vc_num == logo_shown) > logo_shown = FBCON_LOGO_CANSHOW; > @@ -3316,34 +3336,6 @@ static void fbcon_start(void) > #endif > } > > -static void fbcon_exit(void) > -{ > - struct fb_info *info; > - int i, j, mapped; > - > -#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER > - if (deferred_takeover) { > - dummycon_unregister_output_notifier(_output_nb); > - deferred_takeover = false; > - } > -#endif > - > - for_each_registered_fb(i) { > - mapped = 0; > - info = registered_fb[i]; > - > - for (j = first_fb_vc; j <= last_fb_vc; j++) { > - if (con2fb_map[j] == i) { > - mapped = 1; > - con2fb_map[j] = -1; > - } > - } > - > - if (mapped) > - fbcon_release(info); > - } > -} > - > void __init fb_console_init(void) > { > int i; > @@ -3383,10 +3375,19 @@ static void __exit fbcon_deinit_device(void) > > void __exit fb_console_exit(void) > { > +#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER > + console_lock(); > + if (deferred_takeover) > + dummycon_unregister_output_notifier(_output_nb); > + console_unlock(); > + > + cancel_work_sync(_deferred_takeover_work); > +#endif > + > console_lock(); > fbcon_deinit_device(); > device_destroy(fb_class, MKDEV(0, 0)); > - fbcon_exit(); > + We loose the call to fbcon_release_all() here. We have part of the old fbcon_exit() above, but miss the release parts. Maybe I missed something obvious? The rest looks fine. Sam > do_unregister_con_driver(_con); > console_unlock(); > } > -- > 2.33.0
Re: [Intel-gfx] [PATCH 17/21] fbcon: Move more code into fbcon_release
On Mon, Jan 31, 2022 at 10:05:48PM +0100, Daniel Vetter wrote: > con2fb_release_oldinfo() has a bunch more kfree() calls than > fbcon_exit(), but since kfree() on NULL is harmless doing that in both > places should be ok. This is also a bit more symmetric now again with > fbcon_open also allocating the fbcon_ops structure. > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Tetsuo Handa > Cc: Greg Kroah-Hartman > Cc: Du Cheng > Cc: Claudio Suarez Thanks, like I wrote earlier this makes sense. Acked-by: Sam Ravnborg
Re: [Intel-gfx] [PATCH 16/21] fbcon: Move console_lock for register/unlink/unregister
Hi Daniel. On Mon, Jan 31, 2022 at 10:05:47PM +0100, Daniel Vetter wrote: > Ideally console_lock becomes an implementation detail of fbcon.c and > doesn't show up anywhere in fbmem.c. We're still pretty far from that, > but at least the register/unregister code is there now. > > With this the do_fb_ioctl() handler is the only code in fbmem.c still > calling console_lock(). > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Thomas Zimmermann > Cc: Du Cheng > Cc: Claudio Suarez > Cc: Greg Kroah-Hartman > Cc: Tetsuo Handa > Cc: Matthew Wilcox > Cc: Sam Ravnborg > Cc: Zheyu Ma > Cc: Guenter Roeck > Cc: Alex Deucher > Cc: Zhen Lei > Cc: Xiyu Yang Like how lock_console is now almost local to fbcon. Except the usage outside fbmem + fbcon taht is. Acked-by: Sam Ravnborg > --- > drivers/video/fbdev/core/fbcon.c | 33 ++-- > drivers/video/fbdev/core/fbmem.c | 23 ++ > 2 files changed, 29 insertions(+), 27 deletions(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c > b/drivers/video/fbdev/core/fbcon.c > index 11b9f962af6f..e5e8aaf6f60d 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -2776,10 +2776,12 @@ void fbcon_fb_unbind(struct fb_info *info) > int i, new_idx = -1; > int idx = info->node; > > - WARN_CONSOLE_UNLOCKED(); > + console_lock(); > > - if (!fbcon_has_console_bind) > + if (!fbcon_has_console_bind) { > + console_unlock(); > return; > + } > > for (i = first_fb_vc; i <= last_fb_vc; i++) { > if (con2fb_map[i] != idx && > @@ -2814,6 +2816,8 @@ void fbcon_fb_unbind(struct fb_info *info) > } > fbcon_unbind(); > } > + > + console_unlock(); > } > > /* called with console_lock held */ > @@ -2821,10 +2825,12 @@ void fbcon_fb_unregistered(struct fb_info *info) > { > int i, idx; > > - WARN_CONSOLE_UNLOCKED(); > + console_lock(); > > - if (deferred_takeover) > + if (deferred_takeover) { > + console_unlock(); > return; > + } > > idx = info->node; > for (i = first_fb_vc; i <= last_fb_vc; i++) { > @@ -2853,6 +2859,7 @@ void fbcon_fb_unregistered(struct fb_info *info) > > if (!num_registered_fb) > do_unregister_con_driver(_con); > + console_unlock(); > } > > void fbcon_remap_all(struct fb_info *info) > @@ -2910,19 +2917,27 @@ static inline void fbcon_select_primary(struct > fb_info *info) > } > #endif /* CONFIG_FRAMEBUFFER_DETECT_PRIMARY */ > > +static bool lockless_register_fb; > +module_param_named_unsafe(lockless_register_fb, lockless_register_fb, bool, > 0400); > +MODULE_PARM_DESC(lockless_register_fb, > + "Lockless framebuffer registration for debugging [default=off]"); > + > /* called with console_lock held */ > int fbcon_fb_registered(struct fb_info *info) > { > int ret = 0, i, idx; > > - WARN_CONSOLE_UNLOCKED(); > + if (!lockless_register_fb) > + console_lock(); > + else > + atomic_inc(_console_lock_warning); > > idx = info->node; > fbcon_select_primary(info); > > if (deferred_takeover) { > pr_info("fbcon: Deferring console take-over\n"); > - return 0; > + goto out; > } > > if (info_idx == -1) { > @@ -2942,6 +2957,12 @@ int fbcon_fb_registered(struct fb_info *info) > } > } > > +out: > + if (!lockless_register_fb) > + console_unlock(); > + else > + atomic_dec(_console_lock_warning); > + > return ret; > } > > diff --git a/drivers/video/fbdev/core/fbmem.c > b/drivers/video/fbdev/core/fbmem.c > index fd51d12f2702..904ef1250677 100644 > --- a/drivers/video/fbdev/core/fbmem.c > +++ b/drivers/video/fbdev/core/fbmem.c > @@ -1573,14 +1573,9 @@ static void do_remove_conflicting_framebuffers(struct > apertures_struct *a, > } > } > > -static bool lockless_register_fb; > -module_param_named_unsafe(lockless_register_fb, lockless_register_fb, bool, > 0400); > -MODULE_PARM_DESC(lockless_register_fb, > - "Lockless framebuffer registration for debugging [default=off]"); > - > static int do_register_framebuffer(struct fb_info *fb_info) > { > - int i, ret; > + int i; > struct fb_videomode mode; > > if (fb_check_foreignness(fb_info)) > @@ -1649,17 +1644,7 @@ static int do_register_framebuffer(struct fb_info > *fb_info) > } > #endif > > - if (!lockless_register_fb) > - console_lock(); > - else > - atomic_inc(_console_lock_warning); > - ret = fbcon_fb_registered(fb_info); > - > - if (!lockless_register_fb) > - console_unlock(); > - else > - atomic_dec(_console_lock_warning); > - return ret; > + return fbcon_fb_registered(fb_info); > } > > static void
[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/selftests: Disable runtime pm wakeref tracking for the mock device
== Series Details == Series: drm/i915/selftests: Disable runtime pm wakeref tracking for the mock device URL : https://patchwork.freedesktop.org/series/99708/ State : success == Summary == CI Bug Log - changes from CI_DRM_11189_full -> Patchwork_22180_full Summary --- **SUCCESS** No regressions found. Participating hosts (11 -> 11) -- No changes in participating hosts Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_22180_full: ### IGT changes ### Suppressed The following results come from untrusted machines, tests, or statuses. They do not affect the overall result. * igt@gem_ctx_persistence@smoketest: - {shard-tglu}: [PASS][1] -> [FAIL][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-tglu-1/igt@gem_ctx_persiste...@smoketest.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-tglu-2/igt@gem_ctx_persiste...@smoketest.html Known issues Here are the changes found in Patchwork_22180_full that come from known issues: ### IGT changes ### Issues hit * igt@gem_ctx_persistence@idempotent: - shard-snb: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#1099]) +1 similar issue [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-snb5/igt@gem_ctx_persiste...@idempotent.html * igt@gem_ctx_shared@q-in-order: - shard-snb: NOTRUN -> [SKIP][4] ([fdo#109271]) +129 similar issues [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-snb5/igt@gem_ctx_sha...@q-in-order.html * igt@gem_eio@in-flight-contexts-1us: - shard-tglb: [PASS][5] -> [TIMEOUT][6] ([i915#3063]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-tglb1/igt@gem_...@in-flight-contexts-1us.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-tglb5/igt@gem_...@in-flight-contexts-1us.html * igt@gem_exec_balancer@parallel-keep-submit-fence: - shard-iclb: [PASS][7] -> [SKIP][8] ([i915#4525]) [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-iclb1/igt@gem_exec_balan...@parallel-keep-submit-fence.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-iclb5/igt@gem_exec_balan...@parallel-keep-submit-fence.html * igt@gem_exec_capture@pi@rcs0: - shard-skl: [PASS][9] -> [INCOMPLETE][10] ([i915#4547]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-skl8/igt@gem_exec_capture@p...@rcs0.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-skl1/igt@gem_exec_capture@p...@rcs0.html * igt@gem_exec_fair@basic-none-vip@rcs0: - shard-glk: [PASS][11] -> [FAIL][12] ([i915#2842]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-glk5/igt@gem_exec_fair@basic-none-...@rcs0.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-glk8/igt@gem_exec_fair@basic-none-...@rcs0.html * igt@gem_exec_fair@basic-pace-solo@rcs0: - shard-kbl: [PASS][13] -> [FAIL][14] ([i915#2842]) +2 similar issues [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-kbl1/igt@gem_exec_fair@basic-pace-s...@rcs0.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-kbl4/igt@gem_exec_fair@basic-pace-s...@rcs0.html * igt@gem_exec_whisper@basic-forked-all: - shard-glk: [PASS][15] -> [DMESG-WARN][16] ([i915#118]) [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-glk4/igt@gem_exec_whis...@basic-forked-all.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-glk5/igt@gem_exec_whis...@basic-forked-all.html * igt@gem_lmem_swapping@heavy-random: - shard-skl: NOTRUN -> [SKIP][17] ([fdo#109271] / [i915#4613]) +1 similar issue [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-skl2/igt@gem_lmem_swapp...@heavy-random.html * igt@gem_userptr_blits@input-checking: - shard-skl: NOTRUN -> [DMESG-WARN][18] ([i915#4990]) [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-skl4/igt@gem_userptr_bl...@input-checking.html * igt@gen9_exec_parse@allowed-single: - shard-skl: [PASS][19] -> [DMESG-WARN][20] ([i915#1436] / [i915#716]) [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-skl4/igt@gen9_exec_pa...@allowed-single.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-skl7/igt@gen9_exec_pa...@allowed-single.html * igt@i915_pm_dc@dc6-dpms: - shard-skl: NOTRUN -> [FAIL][21] ([i915#454]) [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/shard-skl6/igt@i915_pm...@dc6-dpms.html * igt@i915_pm_dc@dc9-dpms: - shard-iclb: [PASS][22] -> [SKIP][23] ([i915#4281]) [22]:
[Intel-gfx] ✓ Fi.CI.BAT: success for drm/helpers: Make the suballocation manager drm generic.
== Series Details == Series: drm/helpers: Make the suballocation manager drm generic. URL : https://patchwork.freedesktop.org/series/99713/ State : success == Summary == CI Bug Log - changes from CI_DRM_11189 -> Patchwork_22182 Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/index.html Participating hosts (47 -> 43) -- Additional (1): fi-kbl-soraka Missing(5): fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-kbl-8809g fi-bdw-samus Known issues Here are the changes found in Patchwork_22182 that come from known issues: ### IGT changes ### Issues hit * igt@gem_exec_fence@basic-busy@bcs0: - fi-kbl-soraka: NOTRUN -> [SKIP][1] ([fdo#109271]) +8 similar issues [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-kbl-soraka/igt@gem_exec_fence@basic-b...@bcs0.html * igt@gem_huc_copy@huc-copy: - fi-kbl-soraka: NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#2190]) [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html * igt@gem_lmem_swapping@basic: - fi-kbl-soraka: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#4613]) +3 similar issues [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-kbl-soraka/igt@gem_lmem_swapp...@basic.html * igt@i915_selftest@live@gem: - fi-pnv-d510:NOTRUN -> [DMESG-FAIL][4] ([i915#2927] / [i915#4528]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-pnv-d510/igt@i915_selftest@l...@gem.html * igt@i915_selftest@live@gt_heartbeat: - fi-skl-6700k2: [PASS][5] -> [DMESG-FAIL][6] ([i915#2291] / [i915#541]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-skl-6700k2/igt@i915_selftest@live@gt_heartbeat.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-skl-6700k2/igt@i915_selftest@live@gt_heartbeat.html * igt@i915_selftest@live@gt_pm: - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][7] ([i915#1886] / [i915#2291]) [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html * igt@i915_selftest@live@hangcheck: - fi-hsw-4770:[PASS][8] -> [INCOMPLETE][9] ([i915#4785]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-hsw-4770/igt@i915_selftest@l...@hangcheck.html [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-hsw-4770/igt@i915_selftest@l...@hangcheck.html - bat-dg1-6: [PASS][10] -> [DMESG-FAIL][11] ([i915#4494] / [i915#4957]) [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html * igt@kms_chamelium@common-hpd-after-suspend: - fi-kbl-soraka: NOTRUN -> [SKIP][12] ([fdo#109271] / [fdo#111827]) +8 similar issues [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-kbl-soraka/igt@kms_chamel...@common-hpd-after-suspend.html * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d: - fi-kbl-soraka: NOTRUN -> [SKIP][13] ([fdo#109271] / [i915#533]) [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-kbl-soraka/igt@kms_pipe_crc_ba...@compare-crc-sanitycheck-pipe-d.html * igt@runner@aborted: - fi-bdw-5557u: NOTRUN -> [FAIL][14] ([i915#2426] / [i915#4312]) [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-bdw-5557u/igt@run...@aborted.html - fi-hsw-4770:NOTRUN -> [FAIL][15] ([fdo#109271] / [i915#1436] / [i915#4312]) [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-hsw-4770/igt@run...@aborted.html Possible fixes * igt@gem_exec_suspend@basic-s3@smem: - fi-bdw-5557u: [INCOMPLETE][16] ([i915#146]) -> [PASS][17] [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-bdw-5557u/igt@gem_exec_suspend@basic...@smem.html [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-bdw-5557u/igt@gem_exec_suspend@basic...@smem.html - {bat-rpls-2}: [INCOMPLETE][18] ([i915#4898]) -> [PASS][19] [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/bat-rpls-2/igt@gem_exec_suspend@basic...@smem.html [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/bat-rpls-2/igt@gem_exec_suspend@basic...@smem.html * igt@i915_selftest@live@requests: - fi-pnv-d510:[DMESG-FAIL][20] ([i915#2927] / [i915#4528]) -> [PASS][21] [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-pnv-d510/igt@i915_selftest@l...@requests.html [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22182/fi-pnv-d510/igt@i915_selftest@l...@requests.html Warnings * igt@kms_psr@primary_page_flip: - fi-skl-6600u:
Re: [Intel-gfx] [PATCH 15/21] fbcon: Consistently protect deferred_takeover with console_lock()
On Mon, Jan 31, 2022 at 10:05:46PM +0100, Daniel Vetter wrote: > This shouldn't be a problem in practice since until we've actually > taken over the console there's nothing we've registered with the > console/vt subsystem, so the exit/unbind path that check this can't > do the wrong thing. But it's confusing, so fix it by moving it a tad > later. > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Du Cheng > Cc: Tetsuo Handa > Cc: Claudio Suarez > Cc: Thomas Zimmermann It had helped me if the commitlog was explicit that the deferred_takeover falg is moved to the worker function to reset it as late as possible. With the commit log updated: Acked-by: Sam Ravnborg > --- > drivers/video/fbdev/core/fbcon.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c > b/drivers/video/fbdev/core/fbcon.c > index 496bc5f2133e..11b9f962af6f 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -3247,6 +3247,9 @@ static void fbcon_register_existing_fbs(struct > work_struct *work) > > console_lock(); > > + deferred_takeover = false; > + logo_shown = FBCON_LOGO_DONTSHOW; > + > for_each_registered_fb(i) > fbcon_fb_registered(registered_fb[i]); > > @@ -3264,8 +3267,6 @@ static int fbcon_output_notifier(struct notifier_block > *nb, > pr_info("fbcon: Taking over console\n"); > > dummycon_unregister_output_notifier(_output_nb); > - deferred_takeover = false; > - logo_shown = FBCON_LOGO_DONTSHOW; > > /* We may get called in atomic context */ > schedule_work(_deferred_takeover_work); > -- > 2.33.0
Re: [Intel-gfx] [PATCH 03/19] iosys-map: Add a few more helpers
On Fri, Feb 04, 2022 at 08:05:56PM +0100, Thomas Zimmermann wrote: Hi Am 04.02.22 um 18:44 schrieb Lucas De Marchi: First the simplest ones: - iosys_map_memset(): when abstracting system and I/O memory, just like the memcpy() use case, memset() also has dedicated functions to be called for using IO memory. - iosys_map_memcpy_from(): we may need to copy data from I/O memory, not only to. In certain situations it's useful to be able to read or write to an offset that is calculated by having the memory layout given by a struct declaration. Usually we are going to read/write a u8, u16, u32 or u64. As a pre-requisite for the implementation, add iosys_map_memcpy_from() to be the equivalent of iosys_map_memcpy_to(), but in the other direction. Then add 2 pairs of macros: - iosys_map_rd() / iosys_map_wr() - iosys_map_rd_field() / iosys_map_wr_field() The first pair takes the C-type and offset to read/write. The second pair uses a struct describing the layout of the mapping in order to calculate the offset and size being read/written. We could use readb, readw, readl, readq and the write* counterparts, however due to alignment issues this may not work on all architectures. If alignment needs to be checked to call the right function, it's not possible to decide at compile-time which function to call: so just leave the decision to the memcpy function that will do exactly that. Finally, in order to use the above macros with a map derived from another, add another initializer: IOSYS_MAP_INIT_OFFSET(). Cc: Sumit Semwal Cc: Christian König Cc: Thomas Zimmermann Cc: dri-de...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Lucas De Marchi --- include/linux/iosys-map.h | 154 +- 1 file changed, 153 insertions(+), 1 deletion(-) diff --git a/include/linux/iosys-map.h b/include/linux/iosys-map.h index edd7fa3be9e9..96f8b61ac6fb 100644 --- a/include/linux/iosys-map.h +++ b/include/linux/iosys-map.h @@ -6,6 +6,7 @@ #ifndef __IOSYS_MAP_H__ #define __IOSYS_MAP_H__ +#include #include #include @@ -133,6 +134,45 @@ static inline void iosys_map_set_vaddr(struct iosys_map *map, void *vaddr) map->is_iomem = false; } +/** + * IOSYS_MAP_INIT_OFFSET - Initializes struct iosys_map from another iosys_map + * @map_: The dma-buf mapping structure to copy from + * @offset_: Offset to add to the other mapping + * + * Initializes a new iosys_map struct based on another passed as argument. It + * does a shallow copy of the struct so it's possible to update the back storage + * without changing where the original map points to. It is the equivalent of + * doing: + * + * .. code-block: c + * + * iosys_map map = other_map; + * iosys_map_incr(, ); + * + * Example usage: + * + * .. code-block: c + * + * void foo(struct device *dev, struct iosys_map *base_map) + * { + * ... + * struct iosys_map map = IOSYS_MAP_INIT_OFFSET(base_map, FIELD_OFFSET); + * ... + * } + * + * The advantage of using the initializer over just increasing the offset with + * ``iosys_map_incr()`` like above is that the new map will always point to the + * right place of the buffer during its scope. It reduces the risk of updating + * the wrong part of the buffer and having no compiler warning about that. If + * the assignment to IOSYS_MAP_INIT_OFFSET() is forgotten, the compiler can warn + * using a uninitialized variable. + */ +#define IOSYS_MAP_INIT_OFFSET(map_, offset_) (struct iosys_map) \ + { \ + .vaddr = (map_)->vaddr + (offset_), \ + .is_iomem = (map_)->is_iomem,\ + } I already nak'ed this macro. This works because of the aliasing rules within the union and the fact that there are only plain pointers. But this is fragile. Do anything more complicated and it breaks. There's not even a test that would tell you that it failed. Therefore, struct iosys_map should only be initialized by the code that creates the stored pointer. I wonder if there is an alternative that is not fragile that allows us to have a macro like that. In that thread I and Daniel continued chatting and after my additional explanations he was convinced about that. I only came up with such a macro after doing the rest of the patches and noticing a pattern that is hard to debug otherwise. I expanded the explanation in the doc above this macro. Maybe something like: #define IOSYS_MAP_INIT_OFFSET(map_, offset_) ({ \ struct iosys_map copy = *(map_);\ iosys_map_incr(, offset_); \ copy; \ }) Hopefully the compiler elides the additional copy, but I need to check. However, you won't need the offset'ed iosys_map because
Re: [Intel-gfx] [PATCH 14/21] fbcon: use lock_fb_info in fbcon_open/release
On Mon, Jan 31, 2022 at 10:05:45PM +0100, Daniel Vetter wrote: > Now we get to the real motiviation, because fbmem.c insists that > that's the right lock for these. > > Ofc fbcon.c has a lot more places where it probably should call > lock_fb_info(). But looking at fbmem.c at least most of these seem to > be protected by console_lock() too, which is probably what papers over > any issues. > > Note that this means we're shuffling around a bit the locking sections > for some of the console takeover and unbind paths, but not all: > - console binding/unbinding from the console layer never with > lock_fb_info > - unbind (as opposed to unlink) never bother with lock_fb_info > > Also the real serialization against set_par and set_pan are still > doing by wrapping the entire ioctl code in console_lock(). So this > shuffling shouldn't be worse than what we had from a "can you trigger > races?" pov, but it's at least clearer. > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Claudio Suarez > Cc: Tetsuo Handa > Cc: Thomas Zimmermann > Cc: Greg Kroah-Hartman > Cc: Du Cheng > Cc: Sam Ravnborg > Cc: Matthew Wilcox > Cc: William Kucharski > Cc: Alex Deucher > Cc: Zheyu Ma > Cc: Zhen Lei > Cc: Xiyu Yang Well, the patch does what the commit log says. Acked-by: Sam Ravnborg
Re: [Intel-gfx] [RFC PATCH 1/3] drm: Extract amdgpu_sa.c as a generic suballocation helper
Hi Am 04.02.22 um 19:29 schrieb Christian König: Oh, that's on my TODO list for years! Am 04.02.22 um 18:48 schrieb Maarten Lankhorst: Suballocating a buffer object is something that is not driver generic, and is useful for other drivers as well. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/Makefile | 4 +- drivers/gpu/drm/drm_suballoc.c | 424 + include/drm/drm_suballoc.h | 78 ++ 3 files changed, 505 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/drm_suballoc.c create mode 100644 include/drm/drm_suballoc.h diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 8675c2af7ae1..b848bcf8790c 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -57,7 +57,9 @@ drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \ drm_scdc_helper.o drm_gem_atomic_helper.o \ drm_gem_framebuffer_helper.o \ drm_atomic_state_helper.o drm_damage_helper.o \ - drm_format_helper.o drm_self_refresh_helper.o drm_rect.o + drm_format_helper.o drm_self_refresh_helper.o drm_rect.o \ + drm_suballoc.o + I think we should put that into a separate module like we now do with other helpers as well. Please. KMS helpers are now likely to be linked into the kernel binary. I've already spent time to reduce the size of the module. Best regard Thomas -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev OpenPGP_signature Description: OpenPGP digital signature
Re: [Intel-gfx] [PATCH 13/21] fbcon: move more common code into fb_open()
On Mon, Jan 31, 2022 at 10:05:44PM +0100, Daniel Vetter wrote: > No idea why con2fb_acquire_newinfo() initializes much less than > fbcon_startup(), but so be it. From a quick look most of the > un-initialized stuff should be fairly harmless, but who knows. > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Greg Kroah-Hartman > Cc: Tetsuo Handa > Cc: Thomas Zimmermann > Cc: Claudio Suarez > Cc: Du Cheng > --- > drivers/video/fbdev/core/fbcon.c | 74 +--- > 1 file changed, 31 insertions(+), 43 deletions(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c > b/drivers/video/fbdev/core/fbcon.c > index b83a5a77d8a8..5a3391ff038d 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -680,8 +680,18 @@ static int fbcon_invalid_charcount(struct fb_info *info, > unsigned charcount) > > #endif /* CONFIG_MISC_TILEBLITTING */ > > +static void fbcon_release(struct fb_info *info) > +{ > + if (info->fbops->fb_release) > + info->fbops->fb_release(info, 0); > + > + module_put(info->fbops->owner); > +} > + > static int fbcon_open(struct fb_info *info) > { > + struct fbcon_ops *ops; > + > if (!try_module_get(info->fbops->owner)) > return -ENODEV; > > @@ -691,19 +701,22 @@ static int fbcon_open(struct fb_info *info) > return -ENODEV; > } > > - return 0; > -} > + ops = kzalloc(sizeof(struct fbcon_ops), GFP_KERNEL); > + if (!ops) { > + fbcon_release(info); > + return -ENOMEM; > + } > > -static void fbcon_release(struct fb_info *info) > -{ > - if (info->fbops->fb_release) > - info->fbops->fb_release(info, 0); > + INIT_DELAYED_WORK(>cursor_work, fb_flashcursor); > + ops->info = info; > + info->fbcon_par = ops; > + ops->cur_blink_jiffies = HZ / 5; > > - module_put(info->fbops->owner); > + return 0; > } > > static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info, > - int unit, int oldidx) > + int unit) > { > struct fbcon_ops *ops = NULL; > int err; > @@ -712,27 +725,10 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, > struct fb_info *info, > if (err) > return err; > > - if (!err) { > - ops = kzalloc(sizeof(struct fbcon_ops), GFP_KERNEL); > - if (!ops) > - err = -ENOMEM; > - > - INIT_DELAYED_WORK(>cursor_work, fb_flashcursor); > - } > - > - if (!err) { > - ops->cur_blink_jiffies = HZ / 5; > - ops->info = info; > - info->fbcon_par = ops; > - > - if (vc) > - set_blitting_type(vc, info); > - } > + ops = info->fbcon_par; > > - if (err) { > - con2fb_map[unit] = oldidx; > - fbcon_release(info); > - } > + if (vc) > + set_blitting_type(vc, info); > > return err; > } > @@ -840,9 +836,11 @@ static int set_con2fb_map(int unit, int newidx, int user) > > found = search_fb_in_map(newidx); > > - con2fb_map[unit] = newidx; > - if (!err && !found) > - err = con2fb_acquire_newinfo(vc, info, unit, oldidx); > + if (!err && !found) { > + err = con2fb_acquire_newinfo(vc, info, unit); > + if (!err) > + con2fb_map[unit] = newidx; > + } This looks like an unintentional change of functionality as con2fb_map[unit] is only assigned when we do a con2fb_acquire_newinfo(). Staring at the code I could not say it is wrong, but not nice to hide the change in this patch. Sam > > /* >* If old fb is not mapped to any of the consoles, > @@ -939,20 +937,10 @@ static const char *fbcon_startup(void) > if (fbcon_open(info)) > return NULL; > > - ops = kzalloc(sizeof(struct fbcon_ops), GFP_KERNEL); > - if (!ops) { > - fbcon_release(info); > - return NULL; > - } > - > - INIT_DELAYED_WORK(>cursor_work, fb_flashcursor); > - > + ops = info->fbcon_par; > ops->currcon = -1; > ops->graphics = 1; > ops->cur_rotate = -1; > - ops->cur_blink_jiffies = HZ / 5; > - ops->info = info; > - info->fbcon_par = ops; > > p->con_rotate = initial_rotation; > if (p->con_rotate == -1) > @@ -1022,7 +1010,7 @@ static void fbcon_init(struct vc_data *vc, int init) > return; > > if (!info->fbcon_par) > - con2fb_acquire_newinfo(vc, info, vc->vc_num, -1); > + con2fb_acquire_newinfo(vc, info, vc->vc_num); > > /* If we are not the first console on this > fb, copy the font from that console */ > -- > 2.33.0
Re: [Intel-gfx] [PATCH 02/19] iosys-map: Add offset to iosys_map_memcpy_to()
On Fri, Feb 04, 2022 at 07:48:10PM +0100, Thomas Zimmermann wrote: Hi Am 04.02.22 um 18:44 schrieb Lucas De Marchi: In certain situations it's useful to be able to write to an offset of the mapping. Add a dst_offset to iosys_map_memcpy_to(). Cc: Sumit Semwal Cc: Christian König Cc: Thomas Zimmermann Cc: dri-de...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/drm_cache.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 2 +- include/linux/iosys-map.h | 17 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index 66597e411764..c3e6e615bf09 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c @@ -218,7 +218,7 @@ static void memcpy_fallback(struct iosys_map *dst, if (!dst->is_iomem && !src->is_iomem) { memcpy(dst->vaddr, src->vaddr, len); } else if (!src->is_iomem) { - iosys_map_memcpy_to(dst, src->vaddr, len); + iosys_map_memcpy_to(dst, 0, src->vaddr, len); } else if (!dst->is_iomem) { memcpy_fromio(dst->vaddr, src->vaddr_iomem, len); } else { diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 238f815cb2a0..bf5cc9a42e5a 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -385,7 +385,7 @@ static void drm_fb_helper_damage_blit_real(struct drm_fb_helper *fb_helper, iosys_map_incr(dst, offset); /* go to first pixel within clip rect */ for (y = clip->y1; y < clip->y2; y++) { - iosys_map_memcpy_to(dst, src, len); + iosys_map_memcpy_to(dst, 0, src, len); iosys_map_incr(dst, fb->pitches[0]); src += fb->pitches[0]; } diff --git a/include/linux/iosys-map.h b/include/linux/iosys-map.h index f4186f91caa6..edd7fa3be9e9 100644 --- a/include/linux/iosys-map.h +++ b/include/linux/iosys-map.h @@ -220,22 +220,23 @@ static inline void iosys_map_clear(struct iosys_map *map) } /** - * iosys_map_memcpy_to - Memcpy into iosys mapping + * iosys_map_memcpy_to_offset - Memcpy into offset of iosys_map 'iosys_map_memcpy_to' With that fixed: Reviewed-by: Thomas Zimmermann thanks, I noticed that, but looks like I squashed to the wrong patch. Lucas De Marchi
Re: [Intel-gfx] [PATCH 09/19] drm/i915/guc: Convert engine record to iosys_map
Hi Am 04.02.22 um 18:44 schrieb Lucas De Marchi: Use iosys_map to read fields from the dma_blob so access to IO and system memory is abstracted away. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 14 ++ drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h | 3 ++- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 17 ++--- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 6311b9da87e4..1d21a2d457e0 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -698,18 +698,16 @@ void intel_guc_ads_reset(struct intel_guc *guc) u32 intel_guc_engine_usage_offset(struct intel_guc *guc) { - struct __guc_ads_blob *blob = guc->ads_blob; - u32 base = intel_guc_ggtt_offset(guc, guc->ads_vma); - u32 offset = base + ptr_offset(blob, engine_usage); - - return offset; + return intel_guc_ggtt_offset(guc, guc->ads_vma) + + offsetof(struct __guc_ads_blob, engine_usage); } -struct guc_engine_usage_record *intel_guc_engine_usage(struct intel_engine_cs *engine) +struct iosys_map intel_guc_engine_usage_record_map(struct intel_engine_cs *engine) { struct intel_guc *guc = >gt->uc.guc; - struct __guc_ads_blob *blob = guc->ads_blob; u8 guc_class = engine_class_to_guc_class(engine->class); + size_t offset = offsetof(struct __guc_ads_blob, + engine_usage.engines[guc_class][ilog2(engine->logical_mask)]); - return >engine_usage.engines[guc_class][ilog2(engine->logical_mask)]; + return IOSYS_MAP_INIT_OFFSET(>ads_map, offset); Here's one of the few cases where you can legitimately make a copy of an iosys_map buffer and call iosys_map_incr() on it. Saves you the IOSYS_MAP_INIT_OFFSET(). Best regards Thomas } diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h index e74c110facff..1c64f4d6ea21 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h @@ -7,6 +7,7 @@ #define _INTEL_GUC_ADS_H_ #include +#include struct intel_guc; struct drm_printer; @@ -18,7 +19,7 @@ void intel_guc_ads_init_late(struct intel_guc *guc); void intel_guc_ads_reset(struct intel_guc *guc); void intel_guc_ads_print_policy_info(struct intel_guc *guc, struct drm_printer *p); -struct guc_engine_usage_record *intel_guc_engine_usage(struct intel_engine_cs *engine); +struct iosys_map intel_guc_engine_usage_record_map(struct intel_engine_cs *engine); u32 intel_guc_engine_usage_offset(struct intel_guc *guc); #endif diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index b3a429a92c0d..6d34842f68b4 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -1139,6 +1139,9 @@ __extend_last_switch(struct intel_guc *guc, u64 *prev_start, u32 new_start) *prev_start = ((u64)gt_stamp_hi << 32) | new_start; } +#define record_read(map_, field_) \ + iosys_map_rd_field(map_, struct guc_engine_usage_record, field_) + /* * GuC updates shared memory and KMD reads it. Since this is not synchronized, * we run into a race where the value read is inconsistent. Sometimes the @@ -1153,17 +1156,17 @@ __extend_last_switch(struct intel_guc *guc, u64 *prev_start, u32 new_start) static void __get_engine_usage_record(struct intel_engine_cs *engine, u32 *last_in, u32 *id, u32 *total) { - struct guc_engine_usage_record *rec = intel_guc_engine_usage(engine); + struct iosys_map rec_map = intel_guc_engine_usage_record_map(engine); int i = 0; do { - *last_in = READ_ONCE(rec->last_switch_in_stamp); - *id = READ_ONCE(rec->current_context_index); - *total = READ_ONCE(rec->total_runtime); + *last_in = record_read(_map, last_switch_in_stamp); + *id = record_read(_map, current_context_index); + *total = record_read(_map, total_runtime); - if (READ_ONCE(rec->last_switch_in_stamp) == *last_in && - READ_ONCE(rec->current_context_index) == *id && - READ_ONCE(rec->total_runtime) == *total) + if (record_read(_map, last_switch_in_stamp) == *last_in && + record_read(_map, current_context_index) == *id && + record_read(_map, total_runtime) == *total) break; } while (++i < 6); } -- Thomas Zimmermann Graphics Driver Developer SUSE Software
Re: [Intel-gfx] [PATCH 07/19] drm/i915/guc: Convert golden context init to iosys_map
Hi Am 04.02.22 um 18:44 schrieb Lucas De Marchi: Now the map is saved during creation, so use it to initialize the golden context, reading from shmem and writing to either system or IO memory. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 25 +++--- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 3a0afce7564e..d32b407a2d25 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -473,18 +473,17 @@ static struct intel_engine_cs *find_engine_state(struct intel_gt *gt, u8 engine_ static void guc_init_golden_context(struct intel_guc *guc) { - struct __guc_ads_blob *blob = guc->ads_blob; struct intel_engine_cs *engine; struct intel_gt *gt = guc_to_gt(guc); + struct iosys_map golden_context_map; u32 addr_ggtt, offset; u32 total_size = 0, alloc_size, real_size; u8 engine_class, guc_class; - u8 *ptr; if (!intel_uc_uses_guc_submission(>uc)) return; - GEM_BUG_ON(!blob); + GEM_BUG_ON(iosys_map_is_null(>ads_map)); /* * Go back and fill in the golden context data now that it is @@ -492,15 +491,15 @@ static void guc_init_golden_context(struct intel_guc *guc) */ offset = guc_ads_golden_ctxt_offset(guc); addr_ggtt = intel_guc_ggtt_offset(guc, guc->ads_vma) + offset; - ptr = ((u8 *)blob) + offset; + + golden_context_map = IOSYS_MAP_INIT_OFFSET(>ads_map, offset); for (engine_class = 0; engine_class <= MAX_ENGINE_CLASS; ++engine_class) { if (engine_class == OTHER_CLASS) continue; guc_class = engine_class_to_guc_class(engine_class); - - if (!blob->system_info.engine_enabled_masks[guc_class]) + if (!ads_blob_read(guc, system_info.engine_enabled_masks[guc_class])) continue; real_size = intel_engine_context_size(gt, engine_class); @@ -511,18 +510,20 @@ static void guc_init_golden_context(struct intel_guc *guc) if (!engine) { drm_err(>i915->drm, "No engine state recorded for class %d!\n", engine_class); - blob->ads.eng_state_size[guc_class] = 0; - blob->ads.golden_context_lrca[guc_class] = 0; + ads_blob_write(guc, ads.eng_state_size[guc_class], 0); + ads_blob_write(guc, ads.golden_context_lrca[guc_class], 0); continue; } - GEM_BUG_ON(blob->ads.eng_state_size[guc_class] != + GEM_BUG_ON(ads_blob_read(guc, ads.eng_state_size[guc_class]) != real_size - LRC_SKIP_SIZE); - GEM_BUG_ON(blob->ads.golden_context_lrca[guc_class] != addr_ggtt); + GEM_BUG_ON(ads_blob_read(guc, ads.golden_context_lrca[guc_class]) != addr_ggtt); + addr_ggtt += alloc_size; - shmem_read(engine->default_state, 0, ptr, real_size); - ptr += alloc_size; + shmem_read_to_iosys_map(engine->default_state, 0, + _context_map, real_size); + iosys_map_incr(_context_map, alloc_size); Use an offset to index into iosys_map. Even if that means to add another parameter to shmem_read_to_iosys_map(). This will save you IOSYS_MAP_INIT_OFFSET() and iosys_map_incr(). Best regards Thomas } GEM_BUG_ON(guc->ads_golden_ctxt_size != total_size); -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev OpenPGP_signature Description: OpenPGP digital signature
Re: [Intel-gfx] [PATCH 04/19] drm/i915/gt: Add helper for shmem copy to iosys_map
Hi Am 04.02.22 um 18:44 schrieb Lucas De Marchi: Add a variant of shmem_read() that takes a iosys_map pointer rather than a plain pointer as argument. It's mostly a copy __shmem_rw() but adapting the api and removing the write support since there's currently only need to use iosys_map as destination. Reworking __shmem_rw() to share the implementation was tempting, but finding a good balance between reuse and clarity pushed towards a little code duplication. Since the function is small, just add the similar function with a copy/paste/adapt approach. Cc: Matt Roper Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Cc: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/shmem_utils.c | 33 +++ drivers/gpu/drm/i915/gt/shmem_utils.h | 3 +++ 2 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c index 0683b27a3890..764adefdb4be 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.c +++ b/drivers/gpu/drm/i915/gt/shmem_utils.c @@ -3,6 +3,7 @@ * Copyright © 2020 Intel Corporation */ +#include #include #include #include @@ -123,6 +124,38 @@ static int __shmem_rw(struct file *file, loff_t off, return 0; } Here's a good example of how to avoid iosys_map_incr() and use the memcpy offset: +int shmem_read_to_iosys_map(struct file *file, loff_t off, + struct iosys_map *map, size_t len) +{ + struct iosys_map map_iter = *map; Rather replace map_iter with something like unsigned long map_off = 0; + unsigned long pfn; + + for (pfn = off >> PAGE_SHIFT; len; pfn++) { + unsigned int this = + min_t(size_t, PAGE_SIZE - offset_in_page(off), len); + struct page *page; + void *vaddr; + + page = shmem_read_mapping_page_gfp(file->f_mapping, pfn, + GFP_KERNEL); + if (IS_ERR(page)) + return PTR_ERR(page); + + vaddr = kmap(page); + iosys_map_memcpy_to(_iter, 0, vaddr + offset_in_page(off), + this); Use map_off to index into map directly. + mark_page_accessed(page); + kunmap(page); + put_page(page); + + len -= this; + iosys_map_incr(_iter, this); Raplace iosys_map_incr() with map_off += this; + off = 0; Maybe off += this ? I think this pattern should be applied to all similar code. As you already noted, iosys_map_incr() is problematic. Best regards Thomas + } + + return 0; +} + int shmem_read(struct file *file, loff_t off, void *dst, size_t len) { return __shmem_rw(file, off, dst, len, false); diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.h b/drivers/gpu/drm/i915/gt/shmem_utils.h index c1669170c351..e1784999faee 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.h +++ b/drivers/gpu/drm/i915/gt/shmem_utils.h @@ -8,6 +8,7 @@ #include +struct iosys_map; struct drm_i915_gem_object; struct file; @@ -17,6 +18,8 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj); void *shmem_pin_map(struct file *file); void shmem_unpin_map(struct file *file, void *ptr); +int shmem_read_to_iosys_map(struct file *file, loff_t off, + struct iosys_map *map, size_t len); int shmem_read(struct file *file, loff_t off, void *dst, size_t len); int shmem_write(struct file *file, loff_t off, void *src, size_t len); -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev OpenPGP_signature Description: OpenPGP digital signature
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/helpers: Make the suballocation manager drm generic.
== Series Details == Series: drm/helpers: Make the suballocation manager drm generic. URL : https://patchwork.freedesktop.org/series/99713/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. - +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:315:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/helpers: Make the suballocation manager drm generic.
== Series Details == Series: drm/helpers: Make the suballocation manager drm generic. URL : https://patchwork.freedesktop.org/series/99713/ State : warning == Summary == $ dim checkpatch origin/drm-tip aba5c02e4398 drm: Extract amdgpu_sa.c as a generic suballocation helper -:27: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #27: new file mode 100644 -:32: WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1 #32: FILE: drivers/gpu/drm/drm_suballoc.c:1: +/* -:104: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #104: FILE: drivers/gpu/drm/drm_suballoc.c:73: + BUG_ON(align & (align - 1)); -:133: WARNING:SUSPECT_COMMA_SEMICOLON: Possible comma where semicolon could be used #133: FILE: drivers/gpu/drm/drm_suballoc.c:102: + sa_manager->hole = _manager->olist, + drm_suballoc_try_free(sa_manager); -:149: WARNING:LINE_SPACING: Missing a blank line after declarations #149: FILE: drivers/gpu/drm/drm_suballoc.c:118: + struct drm_suballoc_manager *sa_manager = sa->manager; + if (sa_manager->hole == >olist) { -:149: WARNING:BRACES: braces {} are not necessary for single statement blocks #149: FILE: drivers/gpu/drm/drm_suballoc.c:118: + if (sa_manager->hole == >olist) { + sa_manager->hole = sa->olist.prev; + } -:167: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!sa->fence" #167: FILE: drivers/gpu/drm/drm_suballoc.c:136: + if (sa->fence == NULL || -:175: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #175: FILE: drivers/gpu/drm/drm_suballoc.c:144: +static inline unsigned drm_suballoc_hole_soffset(struct drm_suballoc_manager *sa_manager) -:179: WARNING:BRACES: braces {} are not necessary for single statement blocks #179: FILE: drivers/gpu/drm/drm_suballoc.c:148: + if (hole != _manager->olist) { + return list_entry(hole, struct drm_suballoc, olist)->eoffset; + } -:185: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #185: FILE: drivers/gpu/drm/drm_suballoc.c:154: +static inline unsigned drm_suballoc_hole_eoffset(struct drm_suballoc_manager *sa_manager) -:189: WARNING:BRACES: braces {} are not necessary for single statement blocks #189: FILE: drivers/gpu/drm/drm_suballoc.c:158: + if (hole->next != _manager->olist) { + return list_entry(hole->next, struct drm_suballoc, olist)->soffset; + } -:197: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #197: FILE: drivers/gpu/drm/drm_suballoc.c:166: + unsigned size) -:199: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #199: FILE: drivers/gpu/drm/drm_suballoc.c:168: + unsigned soffset, eoffset; -:229: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #229: FILE: drivers/gpu/drm/drm_suballoc.c:198: + unsigned soffset, eoffset, i; -:238: WARNING:BRACES: braces {} are not necessary for single statement blocks #238: FILE: drivers/gpu/drm/drm_suballoc.c:207: + if ((eoffset - soffset) >= size) { + return true; + } -:247: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int *' to bare use of 'unsigned *' #247: FILE: drivers/gpu/drm/drm_suballoc.c:216: + unsigned *tries) -:250: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #250: FILE: drivers/gpu/drm/drm_suballoc.c:219: + unsigned i, best_idx, soffset, best, tmp; -:274: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #274: FILE: drivers/gpu/drm/drm_suballoc.c:243: + sa = list_first_entry(_manager->flist[i], +struct drm_suballoc, flist); -:282: WARNING:BRACES: braces {} are not necessary for single statement blocks #282: FILE: drivers/gpu/drm/drm_suballoc.c:251: + if (tries[i] > 2) { + continue; + } -:305: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines #305: FILE: drivers/gpu/drm/drm_suballoc.c:274: + /* we knew that this one is signaled, + so it's save to remote it */ -:305: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #305: FILE: drivers/gpu/drm/drm_suballoc.c:274: + so it's save to remote it */ -:327: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #327: FILE: drivers/gpu/drm/drm_suballoc.c:296: + unsigned tries[DRM_SUBALLOC_MAX_QUEUES]; -:328: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #328: FILE: drivers/gpu/drm/drm_suballoc.c:297: + unsigned count; -:336: CHECK:ALLOC_SIZEOF_STRUCT: Prefer kmalloc(sizeof(*sa)...) over kmalloc(sizeof(struct drm_suballoc)...) #336:
[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/guc: Refactor ADS access to use iosys_map
== Series Details == Series: drm/i915/guc: Refactor ADS access to use iosys_map URL : https://patchwork.freedesktop.org/series/99711/ State : failure == Summary == CI Bug Log - changes from CI_DRM_11189 -> Patchwork_22181 Summary --- **FAILURE** Serious unknown changes coming with Patchwork_22181 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_22181, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/index.html Participating hosts (47 -> 44) -- Additional (2): fi-kbl-soraka fi-icl-u2 Missing(5): fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510 fi-bdw-samus Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_22181: ### IGT changes ### Possible regressions * igt@i915_selftest@live@hangcheck: - fi-bdw-5557u: NOTRUN -> [INCOMPLETE][1] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-bdw-5557u/igt@i915_selftest@l...@hangcheck.html Known issues Here are the changes found in Patchwork_22181 that come from known issues: ### IGT changes ### Issues hit * igt@amdgpu/amd_cs_nop@sync-fork-compute0: - fi-snb-2600:NOTRUN -> [SKIP][2] ([fdo#109271]) +17 similar issues [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-snb-2600/igt@amdgpu/amd_cs_...@sync-fork-compute0.html * igt@gem_exec_fence@basic-busy@bcs0: - fi-kbl-soraka: NOTRUN -> [SKIP][3] ([fdo#109271]) +8 similar issues [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-kbl-soraka/igt@gem_exec_fence@basic-b...@bcs0.html * igt@gem_huc_copy@huc-copy: - fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#2190]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html - fi-icl-u2: NOTRUN -> [SKIP][5] ([i915#2190]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-icl-u2/igt@gem_huc_c...@huc-copy.html * igt@gem_lmem_swapping@parallel-random-engines: - fi-icl-u2: NOTRUN -> [SKIP][6] ([i915#4613]) +3 similar issues [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-icl-u2/igt@gem_lmem_swapp...@parallel-random-engines.html - fi-kbl-soraka: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#4613]) +3 similar issues [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-kbl-soraka/igt@gem_lmem_swapp...@parallel-random-engines.html * igt@i915_selftest@live@gem_contexts: - fi-icl-u2: NOTRUN -> [INCOMPLETE][8] ([i915#4994]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-icl-u2/igt@i915_selftest@live@gem_contexts.html * igt@i915_selftest@live@gt_pm: - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][9] ([i915#1886] / [i915#2291]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html * igt@i915_selftest@live@hangcheck: - fi-hsw-4770:[PASS][10] -> [INCOMPLETE][11] ([i915#3303]) [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-hsw-4770/igt@i915_selftest@l...@hangcheck.html [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-hsw-4770/igt@i915_selftest@l...@hangcheck.html * igt@i915_selftest@live@requests: - fi-blb-e6850: [PASS][12] -> [DMESG-FAIL][13] ([i915#5026]) [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-blb-e6850/igt@i915_selftest@l...@requests.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-blb-e6850/igt@i915_selftest@l...@requests.html * igt@kms_chamelium@dp-edid-read: - fi-kbl-soraka: NOTRUN -> [SKIP][14] ([fdo#109271] / [fdo#111827]) +8 similar issues [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-kbl-soraka/igt@kms_chamel...@dp-edid-read.html * igt@kms_chamelium@hdmi-hpd-fast: - fi-icl-u2: NOTRUN -> [SKIP][15] ([fdo#111827]) +8 similar issues [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-icl-u2/igt@kms_chamel...@hdmi-hpd-fast.html * igt@kms_chamelium@vga-edid-read: - fi-bdw-5557u: NOTRUN -> [SKIP][16] ([fdo#109271] / [fdo#111827]) +8 similar issues [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-bdw-5557u/igt@kms_chamel...@vga-edid-read.html * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic: - fi-icl-u2: NOTRUN -> [SKIP][17] ([fdo#109278]) +2 similar issues [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22181/fi-icl-u2/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-atomic.html *
Re: [Intel-gfx] [PATCH 03/19] iosys-map: Add a few more helpers
Hi Am 04.02.22 um 18:44 schrieb Lucas De Marchi: First the simplest ones: - iosys_map_memset(): when abstracting system and I/O memory, just like the memcpy() use case, memset() also has dedicated functions to be called for using IO memory. - iosys_map_memcpy_from(): we may need to copy data from I/O memory, not only to. In certain situations it's useful to be able to read or write to an offset that is calculated by having the memory layout given by a struct declaration. Usually we are going to read/write a u8, u16, u32 or u64. As a pre-requisite for the implementation, add iosys_map_memcpy_from() to be the equivalent of iosys_map_memcpy_to(), but in the other direction. Then add 2 pairs of macros: - iosys_map_rd() / iosys_map_wr() - iosys_map_rd_field() / iosys_map_wr_field() The first pair takes the C-type and offset to read/write. The second pair uses a struct describing the layout of the mapping in order to calculate the offset and size being read/written. We could use readb, readw, readl, readq and the write* counterparts, however due to alignment issues this may not work on all architectures. If alignment needs to be checked to call the right function, it's not possible to decide at compile-time which function to call: so just leave the decision to the memcpy function that will do exactly that. Finally, in order to use the above macros with a map derived from another, add another initializer: IOSYS_MAP_INIT_OFFSET(). Cc: Sumit Semwal Cc: Christian König Cc: Thomas Zimmermann Cc: dri-de...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Lucas De Marchi --- include/linux/iosys-map.h | 154 +- 1 file changed, 153 insertions(+), 1 deletion(-) diff --git a/include/linux/iosys-map.h b/include/linux/iosys-map.h index edd7fa3be9e9..96f8b61ac6fb 100644 --- a/include/linux/iosys-map.h +++ b/include/linux/iosys-map.h @@ -6,6 +6,7 @@ #ifndef __IOSYS_MAP_H__ #define __IOSYS_MAP_H__ +#include #include #include @@ -133,6 +134,45 @@ static inline void iosys_map_set_vaddr(struct iosys_map *map, void *vaddr) map->is_iomem = false; } +/** + * IOSYS_MAP_INIT_OFFSET - Initializes struct iosys_map from another iosys_map + * @map_: The dma-buf mapping structure to copy from + * @offset_: Offset to add to the other mapping + * + * Initializes a new iosys_map struct based on another passed as argument. It + * does a shallow copy of the struct so it's possible to update the back storage + * without changing where the original map points to. It is the equivalent of + * doing: + * + * .. code-block: c + * + * iosys_map map = other_map; + * iosys_map_incr(, ); + * + * Example usage: + * + * .. code-block: c + * + * void foo(struct device *dev, struct iosys_map *base_map) + * { + * ... + * struct iosys_map map = IOSYS_MAP_INIT_OFFSET(base_map, FIELD_OFFSET); + * ... + * } + * + * The advantage of using the initializer over just increasing the offset with + * ``iosys_map_incr()`` like above is that the new map will always point to the + * right place of the buffer during its scope. It reduces the risk of updating + * the wrong part of the buffer and having no compiler warning about that. If + * the assignment to IOSYS_MAP_INIT_OFFSET() is forgotten, the compiler can warn + * using a uninitialized variable. + */ +#define IOSYS_MAP_INIT_OFFSET(map_, offset_) (struct iosys_map) \ + { \ + .vaddr = (map_)->vaddr + (offset_), \ + .is_iomem = (map_)->is_iomem,\ + } I already nak'ed this macro. This works because of the aliasing rules within the union and the fact that there are only plain pointers. But this is fragile. Do anything more complicated and it breaks. There's not even a test that would tell you that it failed. Therefore, struct iosys_map should only be initialized by the code that creates the stored pointer. However, you won't need the offset'ed iosys_map because the memcpy_to/from helpers now have the offset parameter. + /** * iosys_map_set_vaddr_iomem - Sets a iosys mapping structure to an address in I/O memory * @map: The iosys_map structure @@ -220,7 +260,7 @@ static inline void iosys_map_clear(struct iosys_map *map) } /** - * iosys_map_memcpy_to_offset - Memcpy into offset of iosys_map + * iosys_map_memcpy_to - Memcpy into iosys_map That's the fix for the other patch. :) * @dst: The iosys_map structure * @dst_offset: The offset from which to copy * @src: The source buffer @@ -239,6 +279,26 @@ static inline void iosys_map_memcpy_to(struct iosys_map *dst, size_t dst_offset, memcpy(dst->vaddr + dst_offset, src, len); } +/** + *
Re: [Intel-gfx] [PATCH v3 2/2] drm/i915/uapi: Add query for hwconfig table
On 2/4/2022 01:55, Daniel Vetter wrote: On Wed, Jan 19, 2022 at 9:35 PM wrote: From: Rodrigo Vivi GuC contains a consolidated table with a bunch of information about the current device. Previously, this information was spread and hardcoded to all the components including GuC, i915 and various UMDs. The goal here is to consolidate the data into GuC in a way that all interested components can grab the very latest and synchronized information using a simple query. As per most of the other queries, this one can be called twice. Once with item.length=0 to determine the exact buffer size, then allocate the user memory and call it again for to retrieve the table data. For example: struct drm_i915_query_item item = { .query_id = DRM_I915_QUERY_HWCONCFIG_TABLE; }; query.items_ptr = (int64_t) query.num_items = 1; ioctl(fd, DRM_IOCTL_I915_QUERY, query, sizeof(query)); if (item.length <= 0) return -ENOENT; data = malloc(item.length); item.data_ptr = (int64_t) ioctl(fd, DRM_IOCTL_I915_QUERY, query, sizeof(query)); // Parse the data as appropriate... The returned array is a simple and flexible KLV (Key/Length/Value) formatted table. For example, it could be just: enum device_attr { ATTR_SOME_VALUE = 0, ATTR_SOME_MASK = 1, }; static const u32 hwconfig[] = { ATTR_SOME_VALUE, 1, // Value Length in DWords 8, // Value ATTR_SOME_MASK, 3, 0x00, 0x, 0xFF00, }; The attribute ids are defined in a hardware spec. Cc: Tvrtko Ursulin Cc: Kenneth Graunke Cc: Michal Wajdeczko Cc: Slawomir Milczarek Signed-off-by: Rodrigo Vivi Signed-off-by: John Harrison Reviewed-by: Matthew Brost --- drivers/gpu/drm/i915/i915_query.c | 23 +++ include/uapi/drm/i915_drm.h | 1 + 2 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c index 2dfbc22857a3..609e64d5f395 100644 --- a/drivers/gpu/drm/i915/i915_query.c +++ b/drivers/gpu/drm/i915/i915_query.c @@ -479,12 +479,35 @@ static int query_memregion_info(struct drm_i915_private *i915, return total_length; } +static int query_hwconfig_table(struct drm_i915_private *i915, + struct drm_i915_query_item *query_item) +{ + struct intel_gt *gt = to_gt(i915); + struct intel_guc_hwconfig *hwconfig = >uc.guc.hwconfig; + + if (!hwconfig->size || !hwconfig->ptr) + return -ENODEV; + + if (query_item->length == 0) + return hwconfig->size; + + if (query_item->length < hwconfig->size) + return -EINVAL; + + if (copy_to_user(u64_to_user_ptr(query_item->data_ptr), +hwconfig->ptr, hwconfig->size)) + return -EFAULT; + + return hwconfig->size; +} + static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv, struct drm_i915_query_item *query_item) = { query_topology_info, query_engine_info, query_perf_config, query_memregion_info, + query_hwconfig_table, }; int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file) diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 914ebd9290e5..132515199f27 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -2685,6 +2685,7 @@ struct drm_i915_query_item { #define DRM_I915_QUERY_ENGINE_INFO 2 #define DRM_I915_QUERY_PERF_CONFIG 3 #define DRM_I915_QUERY_MEMORY_REGIONS 4 +#define DRM_I915_QUERY_HWCONFIG_TABLE 5 /* Must be kept compact -- no holes and well documented */ New uapi needs kerneldoc in the uapi header, and please fill in any gaps you have (i.e. if the query uapi this is built on top of isn't fully documented yet). Also this holds across the board, so please keep in mind in patch review. -Daniel There is no extra documentation to add. The query interface itself is already documented. This new query does not have any kernel defined data structures associated with it. There is just 'struct drm_i915_query_item' with a length and a pointer, all of which are fully documented. John.
[Intel-gfx] ✗ Fi.CI.IGT: failure for Use drm_clflush* instead of clflush (rev4)
== Series Details == Series: Use drm_clflush* instead of clflush (rev4) URL : https://patchwork.freedesktop.org/series/99450/ State : failure == Summary == CI Bug Log - changes from CI_DRM_11189_full -> Patchwork_22178_full Summary --- **FAILURE** Serious unknown changes coming with Patchwork_22178_full absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_22178_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. Participating hosts (11 -> 13) -- Additional (2): shard-rkl shard-dg1 Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_22178_full: ### IGT changes ### Possible regressions * igt@gem_fence_thrash@bo-write-verify-y: - shard-skl: [PASS][1] -> [INCOMPLETE][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-skl9/igt@gem_fence_thr...@bo-write-verify-y.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/shard-skl3/igt@gem_fence_thr...@bo-write-verify-y.html * igt@i915_selftest@mock@vma: - shard-skl: NOTRUN -> [INCOMPLETE][3] +1 similar issue [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/shard-skl3/igt@i915_selftest@m...@vma.html Suppressed The following results come from untrusted machines, tests, or statuses. They do not affect the overall result. * igt@gem_exec_schedule@u-submit-early-slice@vcs1: - {shard-dg1}:NOTRUN -> [INCOMPLETE][4] [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/shard-dg1-12/igt@gem_exec_schedule@u-submit-early-sl...@vcs1.html * igt@kms_cursor_crc@pipe-a-cursor-128x128-onscreen: - {shard-dg1}:NOTRUN -> [DMESG-WARN][5] [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/shard-dg1-12/igt@kms_cursor_...@pipe-a-cursor-128x128-onscreen.html Known issues Here are the changes found in Patchwork_22178_full that come from known issues: ### CI changes ### Issues hit * boot: - shard-apl: ([PASS][6], [PASS][7], [PASS][8], [PASS][9], [PASS][10], [PASS][11], [PASS][12], [PASS][13], [PASS][14], [PASS][15], [PASS][16], [PASS][17], [PASS][18], [PASS][19], [PASS][20], [PASS][21], [PASS][22], [PASS][23], [PASS][24], [PASS][25], [PASS][26], [PASS][27], [PASS][28], [PASS][29], [PASS][30]) -> ([PASS][31], [PASS][32], [PASS][33], [PASS][34], [PASS][35], [FAIL][36], [PASS][37], [PASS][38], [PASS][39], [PASS][40], [PASS][41], [PASS][42], [PASS][43], [PASS][44], [PASS][45], [PASS][46], [PASS][47], [PASS][48], [PASS][49], [PASS][50], [PASS][51], [PASS][52], [PASS][53], [PASS][54], [PASS][55]) ([i915#4386]) [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl2/boot.html [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl2/boot.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl2/boot.html [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl3/boot.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl3/boot.html [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl3/boot.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl4/boot.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl4/boot.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl4/boot.html [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl6/boot.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl6/boot.html [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl6/boot.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl6/boot.html [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl6/boot.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl7/boot.html [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl7/boot.html [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl7/boot.html [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl8/boot.html [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl8/boot.html [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl8/boot.html [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl1/boot.html [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl1/boot.html [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl1/boot.html [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl1/boot.html [30]:
Re: [Intel-gfx] [PATCH v5 09/10] drm/i915/guc: Follow legacy register names
Squash will be much easier if i also squash all the prior register table additions together Should i do that? Squash XeLP + DG2 + Gen9 and this together? On Thu, 2022-02-03 at 11:09 -0800, Matthew Brost wrote: > On Wed, Jan 26, 2022 at 02:48:21AM -0800, Alan Previn wrote: > > Before we print the GuC provided register dumps, modify the > > register tables to use string names as per the legacy error > > capture execlist codes. > > > > Signed-off-by: Alan Previn > > I'd just squash this to the patches early in the series where these are > initially defined. > > Matt > > > --- > > .../gpu/drm/i915/gt/uc/intel_guc_capture.c| 70 +-- > > 1 file changed, 35 insertions(+), 35 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > > b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > > index 2f5dc413dddc..506496058daf 100644 > > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > > @@ -22,7 +22,7 @@ > > * from the engine-mmio-base > > */ > > #define COMMON_BASE_GLOBAL() \ > > - {FORCEWAKE_MT, 0, 0, "FORCEWAKE_MT"} > > + {FORCEWAKE_MT, 0, 0, "FORCEWAKE"} > > > > #define COMMON_GEN9BASE_GLOBAL() \ > > {GEN8_FAULT_TLB_DATA0, 0, 0, "GEN8_FAULT_TLB_DATA0"}, \ > >
Re: [Intel-gfx] [PATCH 02/19] iosys-map: Add offset to iosys_map_memcpy_to()
Hi Am 04.02.22 um 18:44 schrieb Lucas De Marchi: In certain situations it's useful to be able to write to an offset of the mapping. Add a dst_offset to iosys_map_memcpy_to(). Cc: Sumit Semwal Cc: Christian König Cc: Thomas Zimmermann Cc: dri-de...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/drm_cache.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 2 +- include/linux/iosys-map.h | 17 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index 66597e411764..c3e6e615bf09 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c @@ -218,7 +218,7 @@ static void memcpy_fallback(struct iosys_map *dst, if (!dst->is_iomem && !src->is_iomem) { memcpy(dst->vaddr, src->vaddr, len); } else if (!src->is_iomem) { - iosys_map_memcpy_to(dst, src->vaddr, len); + iosys_map_memcpy_to(dst, 0, src->vaddr, len); } else if (!dst->is_iomem) { memcpy_fromio(dst->vaddr, src->vaddr_iomem, len); } else { diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 238f815cb2a0..bf5cc9a42e5a 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -385,7 +385,7 @@ static void drm_fb_helper_damage_blit_real(struct drm_fb_helper *fb_helper, iosys_map_incr(dst, offset); /* go to first pixel within clip rect */ for (y = clip->y1; y < clip->y2; y++) { - iosys_map_memcpy_to(dst, src, len); + iosys_map_memcpy_to(dst, 0, src, len); iosys_map_incr(dst, fb->pitches[0]); src += fb->pitches[0]; } diff --git a/include/linux/iosys-map.h b/include/linux/iosys-map.h index f4186f91caa6..edd7fa3be9e9 100644 --- a/include/linux/iosys-map.h +++ b/include/linux/iosys-map.h @@ -220,22 +220,23 @@ static inline void iosys_map_clear(struct iosys_map *map) } /** - * iosys_map_memcpy_to - Memcpy into iosys mapping + * iosys_map_memcpy_to_offset - Memcpy into offset of iosys_map 'iosys_map_memcpy_to' With that fixed: Reviewed-by: Thomas Zimmermann Best regards Thomas * @dst: The iosys_map structure + * @dst_offset:The offset from which to copy * @src: The source buffer * @len: The number of byte in src * - * Copies data into a iosys mapping. The source buffer is in system - * memory. Depending on the buffer's location, the helper picks the correct - * method of accessing the memory. + * Copies data into a iosys_map with an offset. The source buffer is in + * system memory. Depending on the buffer's location, the helper picks the + * correct method of accessing the memory. */ -static inline void iosys_map_memcpy_to(struct iosys_map *dst, const void *src, - size_t len) +static inline void iosys_map_memcpy_to(struct iosys_map *dst, size_t dst_offset, + const void *src, size_t len) { if (dst->is_iomem) - memcpy_toio(dst->vaddr_iomem, src, len); + memcpy_toio(dst->vaddr_iomem + dst_offset, src, len); else - memcpy(dst->vaddr, src, len); + memcpy(dst->vaddr + dst_offset, src, len); } /** -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev OpenPGP_signature Description: OpenPGP digital signature
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/guc: Refactor ADS access to use iosys_map
== Series Details == Series: drm/i915/guc: Refactor ADS access to use iosys_map URL : https://patchwork.freedesktop.org/series/99711/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.
[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc: Refactor ADS access to use iosys_map
== Series Details == Series: drm/i915/guc: Refactor ADS access to use iosys_map URL : https://patchwork.freedesktop.org/series/99711/ State : warning == Summary == $ dim checkpatch origin/drm-tip 28297417eba4 dma-buf-map: Rename to iosys-map -:237: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #237: FILE: drivers/dma-buf/dma-buf.c:1279: + BUG_ON(iosys_map_is_null(>vmap_ptr)); -:243: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #243: FILE: drivers/dma-buf/dma-buf.c:1284: + BUG_ON(iosys_map_is_set(>vmap_ptr)); -:258: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #258: FILE: drivers/dma-buf/dma-buf.c:1311: + BUG_ON(iosys_map_is_null(>vmap_ptr)); -:261: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #261: FILE: drivers/dma-buf/dma-buf.c:1313: + BUG_ON(!iosys_map_is_equal(>vmap_ptr, map)); -:1625: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please. -:1628: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please. -:2598: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #2598: deleted file mode 100644 total: 0 errors, 7 warnings, 0 checks, 2303 lines checked fa8fc0cacc71 iosys-map: Add offset to iosys_map_memcpy_to() c756a6ec41f7 iosys-map: Add a few more helpers -:97: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #97: FILE: include/linux/iosys-map.h:170: +#define IOSYS_MAP_INIT_OFFSET(map_, offset_) (struct iosys_map) \ + { \ + .vaddr = (map_)->vaddr + (offset_), \ + .is_iomem = (map_)->is_iomem, \ + } -:97: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'map_' - possible side-effects? #97: FILE: include/linux/iosys-map.h:170: +#define IOSYS_MAP_INIT_OFFSET(map_, offset_) (struct iosys_map) \ + { \ + .vaddr = (map_)->vaddr + (offset_), \ + .is_iomem = (map_)->is_iomem, \ + } -:214: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'struct_type__' may be better as '(struct_type__)' to avoid precedence issues #214: FILE: include/linux/iosys-map.h:386: +#define iosys_map_rd_field(map__, struct_type__, field__) ({ \ + struct_type__ *s; \ + iosys_map_rd(map__, offsetof(struct_type__, field__), \ +typeof(s->field__)); \ +}) -:214: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'field__' - possible side-effects? #214: FILE: include/linux/iosys-map.h:386: +#define iosys_map_rd_field(map__, struct_type__, field__) ({ \ + struct_type__ *s; \ + iosys_map_rd(map__, offsetof(struct_type__, field__), \ +typeof(s->field__)); \ +}) -:232: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'struct_type__' may be better as '(struct_type__)' to avoid precedence issues #232: FILE: include/linux/iosys-map.h:404: +#define iosys_map_wr_field(map__, struct_type__, field__, val__) ({ \ + struct_type__ *s; \ + iosys_map_wr(map__, offsetof(struct_type__, field__), \ +typeof(s->field__), val__); \ +}) -:232: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'field__' - possible side-effects? #232: FILE: include/linux/iosys-map.h:404: +#define iosys_map_wr_field(map__, struct_type__, field__, val__) ({ \ + struct_type__ *s; \ + iosys_map_wr(map__, offsetof(struct_type__, field__), \ +typeof(s->field__), val__); \ +}) total: 1 errors, 0 warnings, 5 checks, 182 lines checked 013c71e03eef drm/i915/gt: Add helper for shmem copy to iosys_map f0e0c6063903 drm/i915/guc: Keep iosys_map of ads_blob around 236fa8217a5b drm/i915/guc: Add read/write helpers for ADS blob 556507f9816d drm/i915/guc: Convert golden context init to iosys_map 0035e0d1e60a drm/i915/guc: Convert policies update to iosys_map e05cdb2d1777 drm/i915/guc: Convert engine record to iosys_map 4cb7807205d5 drm/i915/guc: Convert
[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/selftests: Disable runtime pm wakeref tracking for the mock device
== Series Details == Series: drm/i915/selftests: Disable runtime pm wakeref tracking for the mock device URL : https://patchwork.freedesktop.org/series/99708/ State : success == Summary == CI Bug Log - changes from CI_DRM_11189 -> Patchwork_22180 Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/index.html Participating hosts (47 -> 44) -- Additional (1): fi-kbl-soraka Missing(4): fi-ctg-p8600 fi-bsw-cyan fi-bdw-samus fi-hsw-4200u Known issues Here are the changes found in Patchwork_22180 that come from known issues: ### IGT changes ### Issues hit * igt@amdgpu/amd_cs_nop@nop-compute0: - fi-pnv-d510:NOTRUN -> [SKIP][1] ([fdo#109271]) +17 similar issues [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-pnv-d510/igt@amdgpu/amd_cs_...@nop-compute0.html * igt@gem_exec_fence@basic-busy@bcs0: - fi-kbl-soraka: NOTRUN -> [SKIP][2] ([fdo#109271]) +8 similar issues [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-kbl-soraka/igt@gem_exec_fence@basic-b...@bcs0.html * igt@gem_huc_copy@huc-copy: - fi-kbl-soraka: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#2190]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html * igt@gem_lmem_swapping@parallel-random-engines: - fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#4613]) +3 similar issues [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-kbl-soraka/igt@gem_lmem_swapp...@parallel-random-engines.html * igt@i915_selftest@live@gt_pm: - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][5] ([i915#1886] / [i915#2291]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html * igt@i915_selftest@live@hangcheck: - bat-dg1-6: [PASS][6] -> [DMESG-FAIL][7] ([i915#4494] / [i915#4957]) [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html * igt@kms_chamelium@dp-edid-read: - fi-kbl-soraka: NOTRUN -> [SKIP][8] ([fdo#109271] / [fdo#111827]) +8 similar issues [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-kbl-soraka/igt@kms_chamel...@dp-edid-read.html * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d: - fi-kbl-soraka: NOTRUN -> [SKIP][9] ([fdo#109271] / [i915#533]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-kbl-soraka/igt@kms_pipe_crc_ba...@compare-crc-sanitycheck-pipe-d.html * igt@prime_vgem@basic-userptr: - fi-skl-6600u: NOTRUN -> [SKIP][10] ([fdo#109271]) +18 similar issues [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-skl-6600u/igt@prime_v...@basic-userptr.html * igt@runner@aborted: - fi-bdw-5557u: NOTRUN -> [FAIL][11] ([i915#2426] / [i915#4312]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-bdw-5557u/igt@run...@aborted.html Possible fixes * igt@gem_exec_suspend@basic-s3@smem: - fi-bdw-5557u: [INCOMPLETE][12] ([i915#146]) -> [PASS][13] [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-bdw-5557u/igt@gem_exec_suspend@basic...@smem.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-bdw-5557u/igt@gem_exec_suspend@basic...@smem.html * igt@i915_selftest@live@requests: - fi-pnv-d510:[DMESG-FAIL][14] ([i915#2927] / [i915#4528]) -> [PASS][15] [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-pnv-d510/igt@i915_selftest@l...@requests.html [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-pnv-d510/igt@i915_selftest@l...@requests.html * igt@kms_psr@primary_page_flip: - fi-skl-6600u: [FAIL][16] ([i915#4547]) -> [PASS][17] [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-skl-6600u/igt@kms_psr@primary_page_flip.html [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22180/fi-skl-6600u/igt@kms_psr@primary_page_flip.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827 [i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146 [i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886 [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190 [i915#2291]: https://gitlab.freedesktop.org/drm/intel/issues/2291 [i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426 [i915#2927]:
Re: [Intel-gfx] [PATCH v5 06/10] drm/i915/guc: Update GuC's log-buffer-state access for error capture.
On Wed, Jan 26, 2022 at 02:48:18AM -0800, Alan Previn wrote: > GuC log buffer regions for debug-log-events, crash-dumps and > error-state-capture are all a single bo allocation that includes > the guc_log_buffer_state structures. > > Since the error-capture region is accessed with high priority at non- > deterministic times (as part of gpu coredump) while the debug-log-event > region is populated and accessed with different priorities, timings and > consumers, let's split out separate locks for buffer-state accesses > of each region. > > Also, ensure a global mapping is made up front for the entire bo > throughout GuC operation so that dynamic mapping and unmapping isn't > required for error capture log access if relay-logging isn't running. > > Additionally, while here, make some readibility improvements: > 1. change previous function names with "capture_logs" to >"copy_debug_logs" to help make the distinction clearer. > 2. Update the guc log region mapping comments to order them >according to the enum definition as per the GuC interface. > > Signed-off-by: Alan Previn > --- > drivers/gpu/drm/i915/gt/uc/intel_guc.h| 2 + > .../gpu/drm/i915/gt/uc/intel_guc_capture.c| 47 ++ > .../gpu/drm/i915/gt/uc/intel_guc_capture.h| 1 + > drivers/gpu/drm/i915/gt/uc/intel_guc_log.c| 135 +++--- > drivers/gpu/drm/i915/gt/uc/intel_guc_log.h| 16 ++- > 5 files changed, 141 insertions(+), 60 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h > b/drivers/gpu/drm/i915/gt/uc/intel_guc.h > index 4e819853ec2e..be1ad7fa2bf8 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h > @@ -34,6 +34,8 @@ struct intel_guc { > struct intel_uc_fw fw; > /** @log: sub-structure containing GuC log related data and objects */ > struct intel_guc_log log; > + /** @log_state: states and locks for each subregion of GuC's log buffer > */ > + struct intel_guc_log_stats log_state[GUC_MAX_LOG_BUFFER]; Why move this? This still probably should be sub-structure of intel_guc_log. Most of the access is from functions that pass in intel_guc_log, then retrieve the GuC object, only to access this new intel_guc_log_stats object. That layering seems wrong, if the argument to a function is intel_guc_log it should really try to access members within that object or below. Obv some exceptions exist but here it seems clear to me this is in the wrong place. Another nit, I'd personally break this out into multiple patches. e.g. 1 to rename relay log functions, 1 introducing intel_guc_log_stats + lock, and 1 adding intel_guc_capture_output_min_size_est. Maybe I'm missing another patch or two in there. Not a blocker but it does make reviews easier. Matt > /** @ct: the command transport communication channel */ > struct intel_guc_ct ct; > /** @slpc: sub-structure containing SLPC related data and objects */ > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > index 70d2ee841289..e7f99d051636 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > @@ -651,6 +651,53 @@ int intel_guc_capture_prep_lists(struct intel_guc *guc, > struct guc_ads *blob, u3 > return PAGE_ALIGN(alloc_size); > } > > +#define GUC_CAPTURE_OVERBUFFER_MULTIPLIER 3 > +int intel_guc_capture_output_min_size_est(struct intel_guc *guc) > +{ > + struct intel_gt *gt = guc_to_gt(guc); > + struct intel_engine_cs *engine; > + enum intel_engine_id id; > + int worst_min_size = 0, num_regs = 0; > + u16 tmp = 0; > + > + /* > + * If every single engine-instance suffered a failure in quick > succession but > + * were all unrelated, then a burst of multiple error-capture events > would dump > + * registers for every one engine instance, one at a time. In this > case, GuC > + * would even dump the global-registers repeatedly. > + * > + * For each engine instance, there would be 1 x > guc_state_capture_group_t output > + * followed by 3 x guc_state_capture_t lists. The latter is how the > register > + * dumps are split across different register types (where the '3' are > global vs class > + * vs instance). Finally, let's multiply the whole thing by 3x (just so > we are > + * not limited to just 1 round of data in a worst case full register > dump log) > + * > + * NOTE: intel_guc_log that allocates the log buffer would round this > size up to > + * a power of two. > + */ > + > + for_each_engine(engine, gt, id) { > + worst_min_size += sizeof(struct > guc_state_capture_group_header_t) + > + (3 * sizeof(struct > guc_state_capture_header_t)); > + > + if (!guc_capture_list_count(guc, 0, > GUC_CAPTURE_LIST_TYPE_GLOBAL, 0, )) > + num_regs
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/selftests: Disable runtime pm wakeref tracking for the mock device
== Series Details == Series: drm/i915/selftests: Disable runtime pm wakeref tracking for the mock device URL : https://patchwork.freedesktop.org/series/99708/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.
[Intel-gfx] ✗ Fi.CI.BAT: failure for dma-buf-map: Rename to iosys-map (rev3)
== Series Details == Series: dma-buf-map: Rename to iosys-map (rev3) URL : https://patchwork.freedesktop.org/series/99612/ State : failure == Summary == CI Bug Log - changes from CI_DRM_11189 -> Patchwork_22179 Summary --- **FAILURE** Serious unknown changes coming with Patchwork_22179 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_22179, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/index.html Participating hosts (47 -> 44) -- Additional (2): fi-kbl-soraka fi-icl-u2 Missing(5): fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510 fi-bdw-samus Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_22179: ### IGT changes ### Possible regressions * igt@i915_selftest@live@hangcheck: - fi-bdw-5557u: NOTRUN -> [INCOMPLETE][1] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-bdw-5557u/igt@i915_selftest@l...@hangcheck.html Known issues Here are the changes found in Patchwork_22179 that come from known issues: ### IGT changes ### Issues hit * igt@amdgpu/amd_cs_nop@fork-gfx0: - fi-icl-u2: NOTRUN -> [SKIP][2] ([fdo#109315]) +17 similar issues [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-icl-u2/igt@amdgpu/amd_cs_...@fork-gfx0.html * igt@gem_exec_fence@basic-busy@bcs0: - fi-kbl-soraka: NOTRUN -> [SKIP][3] ([fdo#109271]) +8 similar issues [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-kbl-soraka/igt@gem_exec_fence@basic-b...@bcs0.html * igt@gem_huc_copy@huc-copy: - fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#2190]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html - fi-icl-u2: NOTRUN -> [SKIP][5] ([i915#2190]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-icl-u2/igt@gem_huc_c...@huc-copy.html * igt@gem_lmem_swapping@parallel-random-engines: - fi-icl-u2: NOTRUN -> [SKIP][6] ([i915#4613]) +3 similar issues [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-icl-u2/igt@gem_lmem_swapp...@parallel-random-engines.html - fi-kbl-soraka: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#4613]) +3 similar issues [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-kbl-soraka/igt@gem_lmem_swapp...@parallel-random-engines.html * igt@i915_pm_rpm@module-reload: - fi-icl-u2: NOTRUN -> [FAIL][8] ([i915#3049]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-icl-u2/igt@i915_pm_...@module-reload.html * igt@i915_selftest@live@gt_pm: - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][9] ([i915#1886] / [i915#2291]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html * igt@i915_selftest@live@hangcheck: - fi-icl-u2: NOTRUN -> [DMESG-WARN][10] ([i915#2867]) +6 similar issues [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-icl-u2/igt@i915_selftest@l...@hangcheck.html - bat-dg1-6: [PASS][11] -> [DMESG-FAIL][12] ([i915#4494] / [i915#4957]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html * igt@kms_chamelium@dp-edid-read: - fi-kbl-soraka: NOTRUN -> [SKIP][13] ([fdo#109271] / [fdo#111827]) +8 similar issues [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-kbl-soraka/igt@kms_chamel...@dp-edid-read.html * igt@kms_chamelium@hdmi-hpd-fast: - fi-icl-u2: NOTRUN -> [SKIP][14] ([fdo#111827]) +8 similar issues [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-icl-u2/igt@kms_chamel...@hdmi-hpd-fast.html * igt@kms_chamelium@vga-edid-read: - fi-bdw-5557u: NOTRUN -> [SKIP][15] ([fdo#109271] / [fdo#111827]) +8 similar issues [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-bdw-5557u/igt@kms_chamel...@vga-edid-read.html * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic: - fi-icl-u2: NOTRUN -> [SKIP][16] ([fdo#109278]) +2 similar issues [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22179/fi-icl-u2/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-atomic.html * igt@kms_force_connector_basic@force-load-detect: - fi-icl-u2: NOTRUN -> [SKIP][17] ([fdo#109285]) [17]:
[Intel-gfx] [RFC PATCH 2/3] drm/amd: Convert amdgpu to use suballocation helper.
Now that the suballocation helper is generic, we can use it in amdgpu. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 29 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 21 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 320 ++--- 4 files changed, 39 insertions(+), 336 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 9a53a4de2bb7..a8c7a7ef480c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -61,6 +61,7 @@ #include #include #include +#include #include #include "dm_pp_interface.h" @@ -417,29 +418,11 @@ struct amdgpu_clock { * alignment). */ -#define AMDGPU_SA_NUM_FENCE_LISTS 32 - struct amdgpu_sa_manager { - wait_queue_head_t wq; - struct amdgpu_bo*bo; - struct list_head*hole; - struct list_headflist[AMDGPU_SA_NUM_FENCE_LISTS]; - struct list_headolist; - unsignedsize; - uint64_tgpu_addr; - void*cpu_ptr; - uint32_tdomain; - uint32_talign; -}; - -/* sub-allocation buffer */ -struct amdgpu_sa_bo { - struct list_headolist; - struct list_headflist; - struct amdgpu_sa_manager*manager; - unsignedsoffset; - unsignedeoffset; - struct dma_fence*fence; + struct drm_suballoc_manager base; + struct amdgpu_bo*bo; + uint64_tgpu_addr; + void*cpu_ptr; }; int amdgpu_fence_slab_init(void); @@ -470,7 +453,7 @@ struct amdgpu_flip_work { */ struct amdgpu_ib { - struct amdgpu_sa_bo *sa_bo; + struct drm_suballoc *sa_bo; uint32_tlength_dw; uint64_tgpu_addr; uint32_t*ptr; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index bc1297dcdf97..883828a4988c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -69,7 +69,7 @@ int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, if (size) { r = amdgpu_sa_bo_new(>ib_pools[pool_type], - >sa_bo, size, 256); + >sa_bo, size); if (r) { dev_err(adev->dev, "failed to get a new IB (%d)\n", r); return r; @@ -307,8 +307,7 @@ int amdgpu_ib_pool_init(struct amdgpu_device *adev) for (i = 0; i < AMDGPU_IB_POOL_MAX; i++) { r = amdgpu_sa_bo_manager_init(adev, >ib_pools[i], - AMDGPU_IB_POOL_SIZE, - AMDGPU_GPU_PAGE_SIZE, + AMDGPU_IB_POOL_SIZE, 256, AMDGPU_GEM_DOMAIN_GTT); if (r) goto error; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index 4c9cbdc66995..7db4fe1bc1d6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -337,15 +337,20 @@ uint32_t amdgpu_bo_get_preferred_domain(struct amdgpu_device *adev, /* * sub allocation */ +static inline struct amdgpu_sa_manager * +to_amdgpu_sa_manager(struct drm_suballoc_manager *manager) +{ + return container_of(manager, struct amdgpu_sa_manager, base); +} -static inline uint64_t amdgpu_sa_bo_gpu_addr(struct amdgpu_sa_bo *sa_bo) +static inline uint64_t amdgpu_sa_bo_gpu_addr(struct drm_suballoc *sa_bo) { - return sa_bo->manager->gpu_addr + sa_bo->soffset; + return to_amdgpu_sa_manager(sa_bo->manager)->gpu_addr + sa_bo->soffset; } -static inline void * amdgpu_sa_bo_cpu_addr(struct amdgpu_sa_bo *sa_bo) +static inline void * amdgpu_sa_bo_cpu_addr(struct drm_suballoc *sa_bo) { - return sa_bo->manager->cpu_ptr + sa_bo->soffset; + return to_amdgpu_sa_manager(sa_bo->manager)->cpu_ptr + sa_bo->soffset; } int amdgpu_sa_bo_manager_init(struct amdgpu_device *adev, @@ -356,11 +361,11 @@ void amdgpu_sa_bo_manager_fini(struct amdgpu_device *adev, int amdgpu_sa_bo_manager_start(struct amdgpu_device *adev, struct amdgpu_sa_manager *sa_manager); int amdgpu_sa_bo_new(struct amdgpu_sa_manager *sa_manager, -struct amdgpu_sa_bo **sa_bo, -unsigned size, unsigned align); +struct drm_suballoc **sa_bo, +unsigned size); void
[Intel-gfx] [RFC PATCH 0/3] drm/helpers: Make the suballocation manager drm generic.
The suballocation manager itself is not dependent on any implementation detail, and can be made generic. I want to potentially use it inside i915, as it looks like a clean implementation to do so. :) Looking for feedback and some testing, as I don't have a amdgpu/radeon myself. Only compile tested so far, so some stupid bugs may remain. Maarten Lankhorst (3): drm: Extract amdgpu_sa.c as a generic suballocation helper drm/amd: Convert amdgpu to use suballocation helper. drm/radeon: Use the drm suballocation manager implementation. drivers/gpu/drm/Makefile | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 29 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 21 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 320 +--- drivers/gpu/drm/drm_suballoc.c | 424 + drivers/gpu/drm/radeon/radeon.h| 55 +-- drivers/gpu/drm/radeon/radeon_ib.c | 10 +- drivers/gpu/drm/radeon/radeon_object.h | 23 +- drivers/gpu/drm/radeon/radeon_sa.c | 314 ++- drivers/gpu/drm/radeon/radeon_semaphore.c | 6 +- include/drm/drm_suballoc.h | 78 12 files changed, 595 insertions(+), 694 deletions(-) create mode 100644 drivers/gpu/drm/drm_suballoc.c create mode 100644 include/drm/drm_suballoc.h -- 2.34.1
[Intel-gfx] [RFC PATCH 1/3] drm: Extract amdgpu_sa.c as a generic suballocation helper
Suballocating a buffer object is something that is not driver generic, and is useful for other drivers as well. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/Makefile | 4 +- drivers/gpu/drm/drm_suballoc.c | 424 + include/drm/drm_suballoc.h | 78 ++ 3 files changed, 505 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/drm_suballoc.c create mode 100644 include/drm/drm_suballoc.h diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 8675c2af7ae1..b848bcf8790c 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -57,7 +57,9 @@ drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \ drm_scdc_helper.o drm_gem_atomic_helper.o \ drm_gem_framebuffer_helper.o \ drm_atomic_state_helper.o drm_damage_helper.o \ - drm_format_helper.o drm_self_refresh_helper.o drm_rect.o + drm_format_helper.o drm_self_refresh_helper.o drm_rect.o \ + drm_suballoc.o + drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o diff --git a/drivers/gpu/drm/drm_suballoc.c b/drivers/gpu/drm/drm_suballoc.c new file mode 100644 index ..e0bb35367b71 --- /dev/null +++ b/drivers/gpu/drm/drm_suballoc.c @@ -0,0 +1,424 @@ +/* + * Copyright 2011 Red Hat Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + */ +/* + * Authors: + *Jerome Glisse + */ +/* Algorithm: + * + * We store the last allocated bo in "hole", we always try to allocate + * after the last allocated bo. Principle is that in a linear GPU ring + * progression was is after last is the oldest bo we allocated and thus + * the first one that should no longer be in use by the GPU. + * + * If it's not the case we skip over the bo after last to the closest + * done bo if such one exist. If none exist and we are not asked to + * block we report failure to allocate. + * + * If we are asked to block we wait on all the oldest fence of all + * rings. We just wait for any of those fence to complete. + */ + +#include +#include +#include +#include +#include +#include + +static void drm_suballoc_remove_locked(struct drm_suballoc *sa); +static void drm_suballoc_try_free(struct drm_suballoc_manager *sa_manager); + +/** + * drm_suballoc_manager_init - Initialise the drm_suballoc_manager + * + * @sa_manager: pointer to the sa_manager + * @size: number of bytes we want to suballocate + * @align: alignment for each suballocated chunk + * + * Prepares the suballocation manager for suballocations. + */ +void drm_suballoc_manager_init(struct drm_suballoc_manager *sa_manager, + u32 size, u32 align) +{ + u32 i; + + if (!align) + align = 1; + + /* alignment must be a power of 2 */ + BUG_ON(align & (align - 1)); + + init_waitqueue_head(_manager->wq); + sa_manager->size = size; + sa_manager->align = align; + sa_manager->hole = _manager->olist; + INIT_LIST_HEAD(_manager->olist); + for (i = 0; i < DRM_SUBALLOC_MAX_QUEUES; ++i) + INIT_LIST_HEAD(_manager->flist[i]); +} +EXPORT_SYMBOL(drm_suballoc_manager_init); + +/** + * drm_suballoc_manager_fini - Destroy the drm_suballoc_manager + * + * @sa_manager: pointer to the sa_manager + * + * Cleans up the suballocation manager after use. All fences added + * with drm_suballoc_free() must be signaled, or we cannot clean up + * the entire manager. + */ +void drm_suballoc_manager_fini(struct drm_suballoc_manager *sa_manager) +{ + struct drm_suballoc *sa, *tmp; + + if (!sa_manager->size) + return; + + if (!list_empty(_manager->olist)) { + sa_manager->hole = _manager->olist, +
[Intel-gfx] [RFC PATCH 3/3] drm/radeon: Use the drm suballocation manager implementation.
Use the generic suballocation helper lifted from amdgpu. Note that the generic suballocator only allows a single alignment, so we may waste a few more bytes for radeon_semaphore, shouldn't be a big deal, could be re-added if needed. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/radeon/radeon.h | 55 +--- drivers/gpu/drm/radeon/radeon_ib.c| 10 +- drivers/gpu/drm/radeon/radeon_object.h| 23 +- drivers/gpu/drm/radeon/radeon_sa.c| 314 ++ drivers/gpu/drm/radeon/radeon_semaphore.c | 6 +- 5 files changed, 51 insertions(+), 357 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 895776c421d4..a6339c9e7c47 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -79,6 +79,7 @@ #include #include +#include #include "radeon_family.h" #include "radeon_mode.h" @@ -512,52 +513,12 @@ struct radeon_bo { }; #define gem_to_radeon_bo(gobj) container_of((gobj), struct radeon_bo, tbo.base) -/* sub-allocation manager, it has to be protected by another lock. - * By conception this is an helper for other part of the driver - * like the indirect buffer or semaphore, which both have their - * locking. - * - * Principe is simple, we keep a list of sub allocation in offset - * order (first entry has offset == 0, last entry has the highest - * offset). - * - * When allocating new object we first check if there is room at - * the end total_size - (last_object_offset + last_object_size) >= - * alloc_size. If so we allocate new object there. - * - * When there is not enough room at the end, we start waiting for - * each sub object until we reach object_offset+object_size >= - * alloc_size, this object then become the sub object we return. - * - * Alignment can't be bigger than page size. - * - * Hole are not considered for allocation to keep things simple. - * Assumption is that there won't be hole (all object on same - * alignment). - */ struct radeon_sa_manager { - wait_queue_head_t wq; - struct radeon_bo*bo; - struct list_head*hole; - struct list_headflist[RADEON_NUM_RINGS]; - struct list_headolist; - unsignedsize; - uint64_tgpu_addr; - void*cpu_ptr; - uint32_tdomain; - uint32_talign; -}; - -struct radeon_sa_bo; - -/* sub-allocation buffer */ -struct radeon_sa_bo { - struct list_headolist; - struct list_headflist; - struct radeon_sa_manager*manager; - unsignedsoffset; - unsignedeoffset; - struct radeon_fence *fence; + struct drm_suballoc_manager base; + struct radeon_bo*bo; + uint64_tgpu_addr; + void*cpu_ptr; + u32 domain; }; /* @@ -588,7 +549,7 @@ int radeon_mode_dumb_mmap(struct drm_file *filp, * Semaphores. */ struct radeon_semaphore { - struct radeon_sa_bo *sa_bo; + struct drm_suballoc *sa_bo; signed waiters; uint64_tgpu_addr; }; @@ -817,7 +778,7 @@ void radeon_irq_kms_disable_hpd(struct radeon_device *rdev, unsigned hpd_mask); */ struct radeon_ib { - struct radeon_sa_bo *sa_bo; + struct drm_suballoc *sa_bo; uint32_tlength_dw; uint64_tgpu_addr; uint32_t*ptr; diff --git a/drivers/gpu/drm/radeon/radeon_ib.c b/drivers/gpu/drm/radeon/radeon_ib.c index 62b116727b4f..bca2cbd27abf 100644 --- a/drivers/gpu/drm/radeon/radeon_ib.c +++ b/drivers/gpu/drm/radeon/radeon_ib.c @@ -61,7 +61,7 @@ int radeon_ib_get(struct radeon_device *rdev, int ring, { int r; - r = radeon_sa_bo_new(rdev, >ring_tmp_bo, >sa_bo, size, 256); + r = radeon_sa_bo_new(>ring_tmp_bo, >sa_bo, size); if (r) { dev_err(rdev->dev, "failed to get a new IB (%d)\n", r); return r; @@ -97,7 +97,7 @@ int radeon_ib_get(struct radeon_device *rdev, int ring, void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib) { radeon_sync_free(rdev, >sync, ib->fence); - radeon_sa_bo_free(rdev, >sa_bo, ib->fence); + radeon_sa_bo_free(>sa_bo, ib->fence); radeon_fence_unref(>fence); } @@ -201,8 +201,7 @@ int radeon_ib_pool_init(struct radeon_device *rdev) if (rdev->family >= CHIP_BONAIRE) { r = radeon_sa_bo_manager_init(rdev, >ring_tmp_bo, - RADEON_IB_POOL_SIZE*64*1024, - RADEON_GPU_PAGE_SIZE, + RADEON_IB_POOL_SIZE*64*1024, 256,
Re: [Intel-gfx] [PATCH] drm/i915/selftests: fix some error codes in __cancel_reset()
Hi Dan, > There were two error paths in __cancel_reset() which return success > instead of a negative error code as expected. > > Fixes: 4e6835466771 ("drm/i915/selftests: Add a cancel request selftest that > triggers a reset") > Signed-off-by: Dan Carpenter > --- > >From static analysis. I am not 100% sure this. Please review extra > carefully! > > drivers/gpu/drm/i915/selftests/i915_request.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c > b/drivers/gpu/drm/i915/selftests/i915_request.c > index 2a99dd7c2fe8..05e9f977757b 100644 > --- a/drivers/gpu/drm/i915/selftests/i915_request.c > +++ b/drivers/gpu/drm/i915/selftests/i915_request.c > @@ -809,7 +809,8 @@ static int __cancel_reset(struct drm_i915_private *i915, > preempt_timeout_ms = engine->props.preempt_timeout_ms; > engine->props.preempt_timeout_ms = 100; > > - if (igt_spinner_init(, engine->gt)) > + err = igt_spinner_init(, engine->gt); > + if (err) > goto out_restore; > > ce = intel_context_create(engine); > @@ -838,8 +839,10 @@ static int __cancel_reset(struct drm_i915_private *i915, > } > > nop = intel_context_create_request(ce); > - if (IS_ERR(nop)) > + if (IS_ERR(nop)) { > + err = PTR_ERR(nop); > goto out_rq; > + } Looks correct to me: Reviewed-by: Andi Shyti Thank you, Andi
[Intel-gfx] [PATCH 19/19] drm/i915/guc: Remove plain ads_blob pointer
Now we have the access to content of GuC ADS either using iosys_map API or using a temporary buffer. Remove guc->ads_blob as there shouldn't be updates using the bare pointer anymore. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc.h | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 8 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h index f857e9190750..bf7079480d47 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h @@ -147,8 +147,7 @@ struct intel_guc { /** @ads_vma: object allocated to hold the GuC ADS */ struct i915_vma *ads_vma; - /** @ads_blob: contents of the GuC ADS */ - struct __guc_ads_blob *ads_blob; + /** @ads_map: contents of the GuC ADS */ struct iosys_map ads_map; /** @ads_regset_size: size of the save/restore regsets in the ADS */ u32 ads_regset_size; diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 6262fd4e0d4a..7dd44b6d76da 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -672,6 +672,7 @@ static void __guc_ads_init(struct intel_guc *guc) */ int intel_guc_ads_create(struct intel_guc *guc) { + void *ads_blob; u32 size; int ret; @@ -696,14 +697,14 @@ int intel_guc_ads_create(struct intel_guc *guc) size = guc_ads_blob_size(guc); ret = intel_guc_allocate_and_map_vma(guc, size, >ads_vma, -(void **)>ads_blob); +_blob); if (ret) return ret; if (i915_gem_object_is_lmem(guc->ads_vma->obj)) - iosys_map_set_vaddr_iomem(>ads_map, (void __iomem *)guc->ads_blob); + iosys_map_set_vaddr_iomem(>ads_map, (void __iomem *)ads_blob); else - iosys_map_set_vaddr(>ads_map, guc->ads_blob); + iosys_map_set_vaddr(>ads_map, ads_blob); __guc_ads_init(guc); @@ -725,7 +726,6 @@ void intel_guc_ads_init_late(struct intel_guc *guc) void intel_guc_ads_destroy(struct intel_guc *guc) { i915_vma_unpin_and_release(>ads_vma, I915_VMA_RELEASE_MAP); - guc->ads_blob = NULL; iosys_map_clear(>ads_map); kfree(guc->ads_regset); } -- 2.35.1
[Intel-gfx] [PATCH 15/19] drm/i915/guc: Prepare for error propagation
Currently guc_mmio_reg_add() relies on having enough memory available in the array to add a new slot. It uses `GEM_BUG_ON(count >= regset->size);` to protect going above the threshold. In order to allow guc_mmio_reg_add() to handle the memory allocation by itself, it must return an error in case of failures. Adjust return code so this error can be propagated to the callers of guc_mmio_reg_add() and guc_mmio_regset_init(). No intended change in behavior. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 31 +- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 245b703568ff..3a4558948c31 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -244,8 +244,8 @@ static int guc_mmio_reg_cmp(const void *a, const void *b) return (int)ra->offset - (int)rb->offset; } -static void guc_mmio_reg_add(struct temp_regset *regset, -u32 offset, u32 flags) +static long __must_check guc_mmio_reg_add(struct temp_regset *regset, + u32 offset, u32 flags) { u32 count = regset->used; struct guc_mmio_reg reg = { @@ -264,7 +264,7 @@ static void guc_mmio_reg_add(struct temp_regset *regset, */ if (bsearch(, regset->registers, count, sizeof(reg), guc_mmio_reg_cmp)) - return; + return 0; slot = >registers[count]; regset->used++; @@ -277,6 +277,8 @@ static void guc_mmio_reg_add(struct temp_regset *regset, swap(slot[1], slot[0]); } + + return 0; } #define GUC_MMIO_REG_ADD(regset, reg, masked) \ @@ -284,32 +286,35 @@ static void guc_mmio_reg_add(struct temp_regset *regset, i915_mmio_reg_offset((reg)), \ (masked) ? GUC_REGSET_MASKED : 0) -static void guc_mmio_regset_init(struct temp_regset *regset, -struct intel_engine_cs *engine) +static int guc_mmio_regset_init(struct temp_regset *regset, + struct intel_engine_cs *engine) { const u32 base = engine->mmio_base; struct i915_wa_list *wal = >wa_list; struct i915_wa *wa; unsigned int i; + int ret = 0; regset->used = 0; - GUC_MMIO_REG_ADD(regset, RING_MODE_GEN7(base), true); - GUC_MMIO_REG_ADD(regset, RING_HWS_PGA(base), false); - GUC_MMIO_REG_ADD(regset, RING_IMR(base), false); + ret |= GUC_MMIO_REG_ADD(regset, RING_MODE_GEN7(base), true); + ret |= GUC_MMIO_REG_ADD(regset, RING_HWS_PGA(base), false); + ret |= GUC_MMIO_REG_ADD(regset, RING_IMR(base), false); for (i = 0, wa = wal->list; i < wal->count; i++, wa++) - GUC_MMIO_REG_ADD(regset, wa->reg, wa->masked_reg); + ret |= GUC_MMIO_REG_ADD(regset, wa->reg, wa->masked_reg); /* Be extra paranoid and include all whitelist registers. */ for (i = 0; i < RING_MAX_NONPRIV_SLOTS; i++) - GUC_MMIO_REG_ADD(regset, -RING_FORCE_TO_NONPRIV(base, i), -false); + ret |= GUC_MMIO_REG_ADD(regset, + RING_FORCE_TO_NONPRIV(base, i), + false); /* add in local MOCS registers */ for (i = 0; i < GEN9_LNCFCMOCS_REG_COUNT; i++) - GUC_MMIO_REG_ADD(regset, GEN9_LNCFCMOCS(i), false); + ret |= GUC_MMIO_REG_ADD(regset, GEN9_LNCFCMOCS(i), false); + + return ret ? -1 : 0; } static int guc_mmio_reg_state_query(struct intel_guc *guc) -- 2.35.1
[Intel-gfx] [PATCH 16/19] drm/i915/guc: Use a single pass to calculate regset
The ADS initialitazion was using 2 passes to calculate the regset sent to GuC to initialize each engine: the first pass to just have the final object size and the second to set each register in place in the final gem object. However in order to maintain an ordered set of registers to pass to guc, each register needs to be added and moved in the final array. The second phase may actually happen in IO memory rather than system memory and accessing IO memory by simply dereferencing the pointer doesn't work on all architectures. Other places of the ADS initializaition were converted to use the iosys_map API, but here there may be a lot more accesses to IO memory. So, instead of following that same approach, convert the regset initialization to calculate the final array in 1 pass and in the second pass that array is just copied to its final location, updating the pointers for each engine written to the ADS blob. One important thing is that struct temp_regset now have different semantics: `registers` continues to track the registers of a single engine, however the other fields are updated together, according to the newly added `storage`, which tracks the memory allocated for all the registers. So rename some of these fields and add a __mmio_reg_add(): this function (possibly) allocates memory and operates on the storage pointer while guc_mmio_reg_add() continues to manage the registers pointer. On a Tiger Lake system using enable_guc=3, the following log message is now seen: [ 187.334310] i915 :00:02.0: [drm:intel_guc_ads_create [i915]] Used 4 KB for temporary ADS regset This change has also been tested on an ARM64 host with DG2 and other discrete graphics cards. v2 (Daniele): - Fix leaking tempset on error path - Add comments on struct temp_regset to document the meaning of each field Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc.h | 7 ++ drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 128 + 2 files changed, 90 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h index 9b9ba79f7594..f857e9190750 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h @@ -152,6 +152,13 @@ struct intel_guc { struct iosys_map ads_map; /** @ads_regset_size: size of the save/restore regsets in the ADS */ u32 ads_regset_size; + /** +* @ads_regset_count: number of save/restore registers in the ADS for +* each engine +*/ + u32 ads_regset_count[I915_NUM_ENGINES]; + /** @ads_regset: save/restore regsets in the ADS */ + struct guc_mmio_reg *ads_regset; /** @ads_golden_ctxt_size: size of the golden contexts in the ADS */ u32 ads_golden_ctxt_size; /** @ads_engine_usage_size: size of engine usage in the ADS */ diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 3a4558948c31..c040d8d8d7a4 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -226,14 +226,18 @@ static void guc_mapping_table_init(struct intel_gt *gt, /* * The save/restore register list must be pre-calculated to a temporary - * buffer of driver defined size before it can be generated in place - * inside the ADS. + * buffer before it can be copied inside the ADS. */ -#define MAX_MMIO_REGS 128 /* Arbitrary size, increase as needed */ struct temp_regset { + /* +* ptr to the section of the storage for the engine currently being +* worked on +*/ struct guc_mmio_reg *registers; - u32 used; - u32 size; + /* ptr to the base of the allocated storage for all engines */ + struct guc_mmio_reg *storage; + u32 storage_used; + u32 storage_max; }; static int guc_mmio_reg_cmp(const void *a, const void *b) @@ -244,18 +248,44 @@ static int guc_mmio_reg_cmp(const void *a, const void *b) return (int)ra->offset - (int)rb->offset; } +static struct guc_mmio_reg * __must_check +__mmio_reg_add(struct temp_regset *regset, struct guc_mmio_reg *reg) +{ + u32 pos = regset->storage_used; + struct guc_mmio_reg *slot; + + if (pos >= regset->storage_max) { + size_t size = ALIGN((pos + 1) * sizeof(*slot), PAGE_SIZE); + struct guc_mmio_reg *r = krealloc(regset->storage, + size, GFP_KERNEL); + if (!r) { + WARN_ONCE(1, "Incomplete regset list: can't add register (%d)\n", + -ENOMEM); + return ERR_PTR(-ENOMEM); + } + + regset->registers = r + (regset->registers - regset->storage); +
[Intel-gfx] [PATCH 17/19] drm/i915/guc: Convert guc_mmio_reg_state_init to iosys_map
Now that the regset list is prepared, convert guc_mmio_reg_state_init() to use iosys_map to copy the array to the final location and initialize additional fields in ads.reg_state_list. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 30 +- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index c040d8d8d7a4..cf6fafa1024c 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -383,40 +383,46 @@ static long guc_mmio_reg_state_create(struct intel_guc *guc) return ret; } -static void guc_mmio_reg_state_init(struct intel_guc *guc, - struct __guc_ads_blob *blob) +static void guc_mmio_reg_state_init(struct intel_guc *guc) { + struct iosys_map ads_regset_map; struct intel_gt *gt = guc_to_gt(guc); struct intel_engine_cs *engine; - struct guc_mmio_reg *ads_registers; enum intel_engine_id id; u32 addr_ggtt, offset; offset = guc_ads_regset_offset(guc); addr_ggtt = intel_guc_ggtt_offset(guc, guc->ads_vma) + offset; - ads_registers = (struct guc_mmio_reg *)(((u8 *)blob) + offset); + ads_regset_map = IOSYS_MAP_INIT_OFFSET(>ads_map, offset); - memcpy(ads_registers, guc->ads_regset, guc->ads_regset_size); + iosys_map_memcpy_to(_regset_map, 0, guc->ads_regset, + guc->ads_regset_size); for_each_engine(engine, gt, id) { u32 count = guc->ads_regset_count[id]; - struct guc_mmio_reg_set *ads_reg_set; u8 guc_class; /* Class index is checked in class converter */ GEM_BUG_ON(engine->instance >= GUC_MAX_INSTANCES_PER_CLASS); guc_class = engine_class_to_guc_class(engine->class); - ads_reg_set = >ads.reg_state_list[guc_class][engine->instance]; if (!count) { - ads_reg_set->address = 0; - ads_reg_set->count = 0; + ads_blob_write(guc, + ads.reg_state_list[guc_class][engine->instance].address, + 0); + ads_blob_write(guc, + ads.reg_state_list[guc_class][engine->instance].count, + 0); continue; } - ads_reg_set->address = addr_ggtt; - ads_reg_set->count = count; + ads_blob_write(guc, + ads.reg_state_list[guc_class][engine->instance].address, + addr_ggtt); + ads_blob_write(guc, + ads.reg_state_list[guc_class][engine->instance].count, + count); addr_ggtt += count * sizeof(struct guc_mmio_reg); } @@ -646,7 +652,7 @@ static void __guc_ads_init(struct intel_guc *guc) blob->ads.gt_system_info = base + ptr_offset(blob, system_info); /* MMIO save/restore list */ - guc_mmio_reg_state_init(guc, blob); + guc_mmio_reg_state_init(guc); /* Private Data */ blob->ads.private_data = base + guc_ads_private_data_offset(guc); -- 2.35.1
[Intel-gfx] [PATCH 14/19] drm/i915/guc: Convert capture list to iosys_map
Use iosys_map to write the fields ads.capture_*. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 9e96a44a6bbc..245b703568ff 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -544,7 +544,7 @@ static void guc_init_golden_context(struct intel_guc *guc) GEM_BUG_ON(guc->ads_golden_ctxt_size != total_size); } -static void guc_capture_list_init(struct intel_guc *guc, struct __guc_ads_blob *blob) +static void guc_capture_list_init(struct intel_guc *guc) { int i, j; u32 addr_ggtt, offset; @@ -556,11 +556,11 @@ static void guc_capture_list_init(struct intel_guc *guc, struct __guc_ads_blob * for (i = 0; i < GUC_CAPTURE_LIST_INDEX_MAX; i++) { for (j = 0; j < GUC_MAX_ENGINE_CLASSES; j++) { - blob->ads.capture_instance[i][j] = addr_ggtt; - blob->ads.capture_class[i][j] = addr_ggtt; + ads_blob_write(guc, ads.capture_instance[i][j], addr_ggtt); + ads_blob_write(guc, ads.capture_class[i][j], addr_ggtt); } - blob->ads.capture_global[i] = addr_ggtt; + ads_blob_write(guc, ads.capture_global[i], addr_ggtt); } } @@ -600,7 +600,7 @@ static void __guc_ads_init(struct intel_guc *guc) base = intel_guc_ggtt_offset(guc, guc->ads_vma); /* Capture list for hang debug */ - guc_capture_list_init(guc, blob); + guc_capture_list_init(guc); /* ADS */ blob->ads.scheduler_policies = base + ptr_offset(blob, policies); -- 2.35.1
[Intel-gfx] [PATCH 13/19] drm/i915/guc: Convert mapping table to iosys_map
Use iosys_map to write the fields system_info.mapping_table[][]. Since we already have the info_map around where needed, just use it instead of going through guc->ads_map. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 098a4756e8c5..9e96a44a6bbc 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -204,7 +204,7 @@ int intel_guc_global_policies_update(struct intel_guc *guc) } static void guc_mapping_table_init(struct intel_gt *gt, - struct guc_gt_system_info *system_info) + struct iosys_map *info_map) { unsigned int i, j; struct intel_engine_cs *engine; @@ -213,14 +213,14 @@ static void guc_mapping_table_init(struct intel_gt *gt, /* Table must be set to invalid values for entries not used */ for (i = 0; i < GUC_MAX_ENGINE_CLASSES; ++i) for (j = 0; j < GUC_MAX_INSTANCES_PER_CLASS; ++j) - system_info->mapping_table[i][j] = - GUC_MAX_INSTANCES_PER_CLASS; + info_map_write(info_map, mapping_table[i][j], + GUC_MAX_INSTANCES_PER_CLASS); for_each_engine(engine, gt, id) { u8 guc_class = engine_class_to_guc_class(engine->class); - system_info->mapping_table[guc_class][ilog2(engine->logical_mask)] = - engine->instance; + info_map_write(info_map, mapping_table[guc_class][ilog2(engine->logical_mask)], + engine->instance); } } @@ -595,7 +595,7 @@ static void __guc_ads_init(struct intel_guc *guc) /* Golden contexts for re-initialising after a watchdog reset */ guc_prep_golden_context(guc); - guc_mapping_table_init(guc_to_gt(guc), >system_info); + guc_mapping_table_init(guc_to_gt(guc), _map); base = intel_guc_ggtt_offset(guc, guc->ads_vma); -- 2.35.1
[Intel-gfx] [PATCH 12/19] drm/i915/guc: Replace check for golden context size
In the other places in this function, guc->ads_map is being protected from access when it's not yet set. However the last check is actually about guc->ads_golden_ctxt_size been set before. These checks should always match as the size is initialized on the first call to guc_prep_golden_context(), but it's clearer if we have a single return and check for guc->ads_golden_ctxt_size. This is just a readability improvement, no change in behavior. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 80fbab831536..098a4756e8c5 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -461,10 +461,10 @@ static int guc_prep_golden_context(struct intel_guc *guc) addr_ggtt += alloc_size; } - if (iosys_map_is_null(>ads_map)) - return total_size; + /* Make sure current size matches what we calculated previously */ + if (guc->ads_golden_ctxt_size) + GEM_BUG_ON(guc->ads_golden_ctxt_size != total_size); - GEM_BUG_ON(guc->ads_golden_ctxt_size != total_size); return total_size; } -- 2.35.1
[Intel-gfx] [PATCH 11/19] drm/i915/guc: Convert golden context prep to iosys_map
Use the saved ads_map to prepare the golden context. One difference from the init context is that this function can be called before there is a gem object (and thus the guc->ads_map) to calculare the size of the golden context that should be allocated for that object. So in this case the function needs to be prepared for not having the system_info with enabled engines filled out. To accomplish that an info_map is prepared on the side to point either to the gem object or the local variable on the stack. This allows making fill_engine_enable_masks() operate always with a iosys_map argument. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 52 +- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 973762ce2196..80fbab831536 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -67,6 +67,12 @@ struct __guc_ads_blob { iosys_map_wr_field(&(guc_)->ads_map, struct __guc_ads_blob, \ field_, val_) +#define info_map_write(map_, field_, val_) \ + iosys_map_wr_field(map_, struct guc_gt_system_info, field_, val_) + +#define info_map_read(map_, field_) \ + iosys_map_rd_field(map_, struct guc_gt_system_info, field_) + static u32 guc_ads_regset_size(struct intel_guc *guc) { GEM_BUG_ON(!guc->ads_regset_size); @@ -378,24 +384,24 @@ static void guc_mmio_reg_state_init(struct intel_guc *guc, } static void fill_engine_enable_masks(struct intel_gt *gt, -struct guc_gt_system_info *info) +struct iosys_map *info_map) { - info->engine_enabled_masks[GUC_RENDER_CLASS] = 1; - info->engine_enabled_masks[GUC_BLITTER_CLASS] = 1; - info->engine_enabled_masks[GUC_VIDEO_CLASS] = VDBOX_MASK(gt); - info->engine_enabled_masks[GUC_VIDEOENHANCE_CLASS] = VEBOX_MASK(gt); + info_map_write(info_map, engine_enabled_masks[GUC_RENDER_CLASS], 1); + info_map_write(info_map, engine_enabled_masks[GUC_BLITTER_CLASS], 1); + info_map_write(info_map, engine_enabled_masks[GUC_VIDEO_CLASS], VDBOX_MASK(gt)); + info_map_write(info_map, engine_enabled_masks[GUC_VIDEOENHANCE_CLASS], VEBOX_MASK(gt)); } #define LR_HW_CONTEXT_SIZE (80 * sizeof(u32)) #define LRC_SKIP_SIZE (LRC_PPHWSP_SZ * PAGE_SIZE + LR_HW_CONTEXT_SIZE) -static int guc_prep_golden_context(struct intel_guc *guc, - struct __guc_ads_blob *blob) +static int guc_prep_golden_context(struct intel_guc *guc) { struct intel_gt *gt = guc_to_gt(guc); u32 addr_ggtt, offset; u32 total_size = 0, alloc_size, real_size; u8 engine_class, guc_class; - struct guc_gt_system_info *info, local_info; + struct guc_gt_system_info local_info; + struct iosys_map info_map; /* * Reserve the memory for the golden contexts and point GuC at it but @@ -409,14 +415,15 @@ static int guc_prep_golden_context(struct intel_guc *guc, * GuC will also validate that the LRC base + size fall within the * allowed GGTT range. */ - if (blob) { + if (!iosys_map_is_null(>ads_map)) { offset = guc_ads_golden_ctxt_offset(guc); addr_ggtt = intel_guc_ggtt_offset(guc, guc->ads_vma) + offset; - info = >system_info; + info_map = IOSYS_MAP_INIT_OFFSET(>ads_map, +offsetof(struct __guc_ads_blob, system_info)); } else { memset(_info, 0, sizeof(local_info)); - info = _info; - fill_engine_enable_masks(gt, info); + iosys_map_set_vaddr(_map, _info); + fill_engine_enable_masks(gt, _map); } for (engine_class = 0; engine_class <= MAX_ENGINE_CLASS; ++engine_class) { @@ -425,14 +432,14 @@ static int guc_prep_golden_context(struct intel_guc *guc, guc_class = engine_class_to_guc_class(engine_class); - if (!info->engine_enabled_masks[guc_class]) + if (!info_map_read(_map, engine_enabled_masks[guc_class])) continue; real_size = intel_engine_context_size(gt, engine_class); alloc_size = PAGE_ALIGN(real_size); total_size += alloc_size; - if (!blob) + if (iosys_map_is_null(>ads_map)) continue; /* @@ -446,12 +453,15 @@ static int guc_prep_golden_context(struct intel_guc *guc, * what comes before it in the context image (which is identical * on all engines). */ -
[Intel-gfx] [PATCH 18/19] drm/i915/guc: Convert __guc_ads_init to iosys_map
Now that all the called functions from __guc_ads_init() are converted to use ads_map, stop using ads_blob in __guc_ads_init(). Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 25 -- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index cf6fafa1024c..6262fd4e0d4a 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -613,7 +613,6 @@ static void __guc_ads_init(struct intel_guc *guc) { struct intel_gt *gt = guc_to_gt(guc); struct drm_i915_private *i915 = gt->i915; - struct __guc_ads_blob *blob = guc->ads_blob; struct iosys_map info_map = IOSYS_MAP_INIT_OFFSET(>ads_map, offsetof(struct __guc_ads_blob, system_info)); u32 base; @@ -624,17 +623,18 @@ static void __guc_ads_init(struct intel_guc *guc) /* System info */ fill_engine_enable_masks(gt, _map); - blob->system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_SLICE_ENABLED] = - hweight8(gt->info.sseu.slice_mask); - blob->system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_VDBOX_SFC_SUPPORT_MASK] = - gt->info.vdbox_sfc_access; + ads_blob_write(guc, system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_SLICE_ENABLED], + hweight8(gt->info.sseu.slice_mask)); + ads_blob_write(guc, system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_VDBOX_SFC_SUPPORT_MASK], + gt->info.vdbox_sfc_access); if (GRAPHICS_VER(i915) >= 12 && !IS_DGFX(i915)) { u32 distdbreg = intel_uncore_read(gt->uncore, GEN12_DIST_DBS_POPULATED); - blob->system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_DOORBELL_COUNT_PER_SQIDI] = - ((distdbreg >> GEN12_DOORBELLS_PER_SQIDI_SHIFT) & -GEN12_DOORBELLS_PER_SQIDI) + 1; + ads_blob_write(guc, + system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_DOORBELL_COUNT_PER_SQIDI], + ((distdbreg >> GEN12_DOORBELLS_PER_SQIDI_SHIFT) + & GEN12_DOORBELLS_PER_SQIDI) + 1); } /* Golden contexts for re-initialising after a watchdog reset */ @@ -648,14 +648,17 @@ static void __guc_ads_init(struct intel_guc *guc) guc_capture_list_init(guc); /* ADS */ - blob->ads.scheduler_policies = base + ptr_offset(blob, policies); - blob->ads.gt_system_info = base + ptr_offset(blob, system_info); + ads_blob_write(guc, ads.scheduler_policies, base + + offsetof(struct __guc_ads_blob, policies)); + ads_blob_write(guc, ads.gt_system_info, base + + offsetof(struct __guc_ads_blob, system_info)); /* MMIO save/restore list */ guc_mmio_reg_state_init(guc); /* Private Data */ - blob->ads.private_data = base + guc_ads_private_data_offset(guc); + ads_blob_write(guc, ads.private_data, base + + guc_ads_private_data_offset(guc)); i915_gem_object_flush_map(guc->ads_vma->obj); } -- 2.35.1
[Intel-gfx] [PATCH 04/19] drm/i915/gt: Add helper for shmem copy to iosys_map
Add a variant of shmem_read() that takes a iosys_map pointer rather than a plain pointer as argument. It's mostly a copy __shmem_rw() but adapting the api and removing the write support since there's currently only need to use iosys_map as destination. Reworking __shmem_rw() to share the implementation was tempting, but finding a good balance between reuse and clarity pushed towards a little code duplication. Since the function is small, just add the similar function with a copy/paste/adapt approach. Cc: Matt Roper Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Cc: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/shmem_utils.c | 33 +++ drivers/gpu/drm/i915/gt/shmem_utils.h | 3 +++ 2 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c index 0683b27a3890..764adefdb4be 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.c +++ b/drivers/gpu/drm/i915/gt/shmem_utils.c @@ -3,6 +3,7 @@ * Copyright © 2020 Intel Corporation */ +#include #include #include #include @@ -123,6 +124,38 @@ static int __shmem_rw(struct file *file, loff_t off, return 0; } +int shmem_read_to_iosys_map(struct file *file, loff_t off, + struct iosys_map *map, size_t len) +{ + struct iosys_map map_iter = *map; + unsigned long pfn; + + for (pfn = off >> PAGE_SHIFT; len; pfn++) { + unsigned int this = + min_t(size_t, PAGE_SIZE - offset_in_page(off), len); + struct page *page; + void *vaddr; + + page = shmem_read_mapping_page_gfp(file->f_mapping, pfn, + GFP_KERNEL); + if (IS_ERR(page)) + return PTR_ERR(page); + + vaddr = kmap(page); + iosys_map_memcpy_to(_iter, 0, vaddr + offset_in_page(off), + this); + mark_page_accessed(page); + kunmap(page); + put_page(page); + + len -= this; + iosys_map_incr(_iter, this); + off = 0; + } + + return 0; +} + int shmem_read(struct file *file, loff_t off, void *dst, size_t len) { return __shmem_rw(file, off, dst, len, false); diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.h b/drivers/gpu/drm/i915/gt/shmem_utils.h index c1669170c351..e1784999faee 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.h +++ b/drivers/gpu/drm/i915/gt/shmem_utils.h @@ -8,6 +8,7 @@ #include +struct iosys_map; struct drm_i915_gem_object; struct file; @@ -17,6 +18,8 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj); void *shmem_pin_map(struct file *file); void shmem_unpin_map(struct file *file, void *ptr); +int shmem_read_to_iosys_map(struct file *file, loff_t off, + struct iosys_map *map, size_t len); int shmem_read(struct file *file, loff_t off, void *dst, size_t len); int shmem_write(struct file *file, loff_t off, void *src, size_t len); -- 2.35.1
[Intel-gfx] [PATCH 08/19] drm/i915/guc: Convert policies update to iosys_map
Use iosys_map to write the policies update so access to IO and system memory is abstracted away. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 41 -- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index d32b407a2d25..6311b9da87e4 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -130,33 +130,37 @@ static u32 guc_ads_blob_size(struct intel_guc *guc) guc_ads_private_data_size(guc); } -static void guc_policies_init(struct intel_guc *guc, struct guc_policies *policies) +static void guc_policies_init(struct intel_guc *guc) { struct intel_gt *gt = guc_to_gt(guc); struct drm_i915_private *i915 = gt->i915; + u32 global_flags = 0; - policies->dpc_promote_time = GLOBAL_POLICY_DEFAULT_DPC_PROMOTE_TIME_US; - policies->max_num_work_items = GLOBAL_POLICY_MAX_NUM_WI; + ads_blob_write(guc, policies.dpc_promote_time, + GLOBAL_POLICY_DEFAULT_DPC_PROMOTE_TIME_US); + ads_blob_write(guc, policies.max_num_work_items, + GLOBAL_POLICY_MAX_NUM_WI); - policies->global_flags = 0; if (i915->params.reset < 2) - policies->global_flags |= GLOBAL_POLICY_DISABLE_ENGINE_RESET; + global_flags |= GLOBAL_POLICY_DISABLE_ENGINE_RESET; - policies->is_valid = 1; + ads_blob_write(guc, policies.global_flags, global_flags); + ads_blob_write(guc, policies.is_valid, 1); } void intel_guc_ads_print_policy_info(struct intel_guc *guc, struct drm_printer *dp) { - struct __guc_ads_blob *blob = guc->ads_blob; - - if (unlikely(!blob)) + if (unlikely(iosys_map_is_null(>ads_map))) return; drm_printf(dp, "Global scheduling policies:\n"); - drm_printf(dp, " DPC promote time = %u\n", blob->policies.dpc_promote_time); - drm_printf(dp, " Max num work items = %u\n", blob->policies.max_num_work_items); - drm_printf(dp, " Flags = %u\n", blob->policies.global_flags); + drm_printf(dp, " DPC promote time = %u\n", + ads_blob_read(guc, policies.dpc_promote_time)); + drm_printf(dp, " Max num work items = %u\n", + ads_blob_read(guc, policies.max_num_work_items)); + drm_printf(dp, " Flags = %u\n", + ads_blob_read(guc, policies.global_flags)); } static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset) @@ -171,23 +175,24 @@ static int guc_action_policies_update(struct intel_guc *guc, u32 policy_offset) int intel_guc_global_policies_update(struct intel_guc *guc) { - struct __guc_ads_blob *blob = guc->ads_blob; struct intel_gt *gt = guc_to_gt(guc); + u32 scheduler_policies; intel_wakeref_t wakeref; int ret; - if (!blob) + if (iosys_map_is_null(>ads_map)) return -EOPNOTSUPP; - GEM_BUG_ON(!blob->ads.scheduler_policies); + scheduler_policies = ads_blob_read(guc, ads.scheduler_policies); + GEM_BUG_ON(!scheduler_policies); - guc_policies_init(guc, >policies); + guc_policies_init(guc); if (!intel_guc_is_ready(guc)) return 0; with_intel_runtime_pm(>i915->runtime_pm, wakeref) - ret = guc_action_policies_update(guc, blob->ads.scheduler_policies); + ret = guc_action_policies_update(guc, scheduler_policies); return ret; } @@ -557,7 +562,7 @@ static void __guc_ads_init(struct intel_guc *guc) u32 base; /* GuC scheduling policies */ - guc_policies_init(guc, >policies); + guc_policies_init(guc); /* System info */ fill_engine_enable_masks(gt, >system_info); -- 2.35.1
[Intel-gfx] [PATCH 03/19] iosys-map: Add a few more helpers
First the simplest ones: - iosys_map_memset(): when abstracting system and I/O memory, just like the memcpy() use case, memset() also has dedicated functions to be called for using IO memory. - iosys_map_memcpy_from(): we may need to copy data from I/O memory, not only to. In certain situations it's useful to be able to read or write to an offset that is calculated by having the memory layout given by a struct declaration. Usually we are going to read/write a u8, u16, u32 or u64. As a pre-requisite for the implementation, add iosys_map_memcpy_from() to be the equivalent of iosys_map_memcpy_to(), but in the other direction. Then add 2 pairs of macros: - iosys_map_rd() / iosys_map_wr() - iosys_map_rd_field() / iosys_map_wr_field() The first pair takes the C-type and offset to read/write. The second pair uses a struct describing the layout of the mapping in order to calculate the offset and size being read/written. We could use readb, readw, readl, readq and the write* counterparts, however due to alignment issues this may not work on all architectures. If alignment needs to be checked to call the right function, it's not possible to decide at compile-time which function to call: so just leave the decision to the memcpy function that will do exactly that. Finally, in order to use the above macros with a map derived from another, add another initializer: IOSYS_MAP_INIT_OFFSET(). Cc: Sumit Semwal Cc: Christian König Cc: Thomas Zimmermann Cc: dri-de...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Lucas De Marchi --- include/linux/iosys-map.h | 154 +- 1 file changed, 153 insertions(+), 1 deletion(-) diff --git a/include/linux/iosys-map.h b/include/linux/iosys-map.h index edd7fa3be9e9..96f8b61ac6fb 100644 --- a/include/linux/iosys-map.h +++ b/include/linux/iosys-map.h @@ -6,6 +6,7 @@ #ifndef __IOSYS_MAP_H__ #define __IOSYS_MAP_H__ +#include #include #include @@ -133,6 +134,45 @@ static inline void iosys_map_set_vaddr(struct iosys_map *map, void *vaddr) map->is_iomem = false; } +/** + * IOSYS_MAP_INIT_OFFSET - Initializes struct iosys_map from another iosys_map + * @map_: The dma-buf mapping structure to copy from + * @offset_: Offset to add to the other mapping + * + * Initializes a new iosys_map struct based on another passed as argument. It + * does a shallow copy of the struct so it's possible to update the back storage + * without changing where the original map points to. It is the equivalent of + * doing: + * + * .. code-block: c + * + * iosys_map map = other_map; + * iosys_map_incr(, ); + * + * Example usage: + * + * .. code-block: c + * + * void foo(struct device *dev, struct iosys_map *base_map) + * { + * ... + * struct iosys_map map = IOSYS_MAP_INIT_OFFSET(base_map, FIELD_OFFSET); + * ... + * } + * + * The advantage of using the initializer over just increasing the offset with + * ``iosys_map_incr()`` like above is that the new map will always point to the + * right place of the buffer during its scope. It reduces the risk of updating + * the wrong part of the buffer and having no compiler warning about that. If + * the assignment to IOSYS_MAP_INIT_OFFSET() is forgotten, the compiler can warn + * using a uninitialized variable. + */ +#define IOSYS_MAP_INIT_OFFSET(map_, offset_) (struct iosys_map) \ + { \ + .vaddr = (map_)->vaddr + (offset_), \ + .is_iomem = (map_)->is_iomem, \ + } + /** * iosys_map_set_vaddr_iomem - Sets a iosys mapping structure to an address in I/O memory * @map: The iosys_map structure @@ -220,7 +260,7 @@ static inline void iosys_map_clear(struct iosys_map *map) } /** - * iosys_map_memcpy_to_offset - Memcpy into offset of iosys_map + * iosys_map_memcpy_to - Memcpy into iosys_map * @dst: The iosys_map structure * @dst_offset:The offset from which to copy * @src: The source buffer @@ -239,6 +279,26 @@ static inline void iosys_map_memcpy_to(struct iosys_map *dst, size_t dst_offset, memcpy(dst->vaddr + dst_offset, src, len); } +/** + * iosys_map_memcpy_from - Memcpy from iosys_map into system memory + * @dst: Destination in system memory + * @src: The iosys_map structure + * @src_offset:The offset from which to copy + * @len: The number of byte in src + * + * Copies data from a iosys_map with an offset. The dest buffer is in + * system memory. Depending on the mapping location, the helper picks the + * correct method of accessing the memory. + */ +static inline void iosys_map_memcpy_from(void *dst, const struct iosys_map *src, +size_t src_offset, size_t len) +{ + if
[Intel-gfx] [PATCH 01/19] dma-buf-map: Rename to iosys-map
Rename struct dma_buf_map to struct iosys_map and corresponding APIs. Over time dma-buf-map grew up to more functionality than the one used by dma-buf: in fact it's just a shim layer to abstract system memory, that can be accessed via regular load and store, from IO memory that needs to be acessed via arch helpers. The idea is to extend this API so it can fulfill other needs, internal to a single driver. Example: in the i915 driver it's desired to share the implementation for integrated graphics, which uses mostly system memory, with discrete graphics, which may need to access IO memory. The conversion was mostly done with the following semantic patch: @r1@ @@ - struct dma_buf_map + struct iosys_map @r2@ @@ ( - DMA_BUF_MAP_INIT_VADDR + IOSYS_MAP_INIT_VADDR | - dma_buf_map_set_vaddr + iosys_map_set_vaddr | - dma_buf_map_set_vaddr_iomem + iosys_map_set_vaddr_iomem | - dma_buf_map_is_equal + iosys_map_is_equal | - dma_buf_map_is_null + iosys_map_is_null | - dma_buf_map_is_set + iosys_map_is_set | - dma_buf_map_clear + iosys_map_clear | - dma_buf_map_memcpy_to + iosys_map_memcpy_to | - dma_buf_map_incr + iosys_map_incr ) @@ @@ - #include + #include Then some files had their includes adjusted and some comments were update to remove mentions to dma-buf-map. Since this is not specific to dma-buf anymore, move the documentation to the "Bus-Independent Device Accesses" section. v2: - Squash patches v3: - Fix wrong removal of dma-buf.h from MAINTAINERS - Move documentation from dma-buf.rst to device-io.rst v4: - Change documentation tile and level Signed-off-by: Lucas De Marchi Acked-by: Christian König Acked-by: Sumit Semwal Acked-by: Thomas Zimmermann --- Documentation/driver-api/device-io.rst| 9 + Documentation/driver-api/dma-buf.rst | 9 - Documentation/gpu/todo.rst| 20 +- MAINTAINERS | 9 +- drivers/dma-buf/dma-buf.c | 22 +- drivers/dma-buf/heaps/cma_heap.c | 10 +- drivers/dma-buf/heaps/system_heap.c | 10 +- drivers/gpu/drm/ast/ast_drv.h | 2 +- drivers/gpu/drm/ast/ast_mode.c| 8 +- drivers/gpu/drm/drm_cache.c | 18 +- drivers/gpu/drm/drm_client.c | 9 +- drivers/gpu/drm/drm_fb_helper.c | 12 +- drivers/gpu/drm/drm_gem.c | 12 +- drivers/gpu/drm/drm_gem_cma_helper.c | 9 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 16 +- drivers/gpu/drm/drm_gem_shmem_helper.c| 15 +- drivers/gpu/drm/drm_gem_ttm_helper.c | 4 +- drivers/gpu/drm/drm_gem_vram_helper.c | 25 +- drivers/gpu/drm/drm_internal.h| 6 +- drivers/gpu/drm/drm_mipi_dbi.c| 8 +- drivers/gpu/drm/drm_prime.c | 4 +- drivers/gpu/drm/etnaviv/etnaviv_drv.h | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 8 +- drivers/gpu/drm/gud/gud_pipe.c| 4 +- drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c| 8 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 6 +- .../gpu/drm/i915/gem/selftests/mock_dmabuf.c | 6 +- drivers/gpu/drm/lima/lima_gem.c | 3 +- drivers/gpu/drm/lima/lima_sched.c | 4 +- drivers/gpu/drm/mediatek/mtk_drm_gem.c| 7 +- drivers/gpu/drm/mediatek/mtk_drm_gem.h| 5 +- drivers/gpu/drm/mgag200/mgag200_mode.c| 4 +- drivers/gpu/drm/msm/msm_drv.h | 4 +- drivers/gpu/drm/msm/msm_gem_prime.c | 6 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 13 +- drivers/gpu/drm/qxl/qxl_display.c | 8 +- drivers/gpu/drm/qxl/qxl_draw.c| 6 +- drivers/gpu/drm/qxl/qxl_drv.h | 10 +- drivers/gpu/drm/qxl/qxl_object.c | 8 +- drivers/gpu/drm/qxl/qxl_object.h | 4 +- drivers/gpu/drm/qxl/qxl_prime.c | 4 +- drivers/gpu/drm/radeon/radeon_gem.c | 1 + drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 9 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 5 +- drivers/gpu/drm/tegra/gem.c | 10 +- drivers/gpu/drm/tiny/cirrus.c | 8 +- drivers/gpu/drm/tiny/gm12u320.c | 7 +- drivers/gpu/drm/ttm/ttm_bo_util.c | 16 +- drivers/gpu/drm/ttm/ttm_resource.c| 42 +-- drivers/gpu/drm/ttm/ttm_tt.c | 8 +- drivers/gpu/drm/udl/udl_modeset.c | 3 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 +-
[Intel-gfx] [PATCH 10/19] drm/i915/guc: Convert guc_ads_private_data_reset to iosys_map
Use iosys_map_memset() to zero the private data as ADS may be either on system or IO memory. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 1d21a2d457e0..973762ce2196 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -674,8 +674,8 @@ static void guc_ads_private_data_reset(struct intel_guc *guc) if (!size) return; - memset((void *)guc->ads_blob + guc_ads_private_data_offset(guc), 0, - size); + iosys_map_memset(>ads_map, guc_ads_private_data_offset(guc), +0, size); } /** -- 2.35.1
[Intel-gfx] [PATCH 05/19] drm/i915/guc: Keep iosys_map of ads_blob around
Convert intel_guc_ads_create() and initialization to use iosys_map rather than plain pointer and save it in the guc struct. This will help with additional updates to the ads_blob after the creation/initialization by abstracting the IO vs system memory. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc.h | 4 +++- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 6 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h index 697d9d66acef..9b9ba79f7594 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h @@ -6,8 +6,9 @@ #ifndef _INTEL_GUC_H_ #define _INTEL_GUC_H_ -#include #include +#include +#include #include "intel_uncore.h" #include "intel_guc_fw.h" @@ -148,6 +149,7 @@ struct intel_guc { struct i915_vma *ads_vma; /** @ads_blob: contents of the GuC ADS */ struct __guc_ads_blob *ads_blob; + struct iosys_map ads_map; /** @ads_regset_size: size of the save/restore regsets in the ADS */ u32 ads_regset_size; /** @ads_golden_ctxt_size: size of the golden contexts in the ADS */ diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index e61150adcbe9..13671b186908 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -624,6 +624,11 @@ int intel_guc_ads_create(struct intel_guc *guc) if (ret) return ret; + if (i915_gem_object_is_lmem(guc->ads_vma->obj)) + iosys_map_set_vaddr_iomem(>ads_map, (void __iomem *)guc->ads_blob); + else + iosys_map_set_vaddr(>ads_map, guc->ads_blob); + __guc_ads_init(guc); return 0; @@ -645,6 +650,7 @@ void intel_guc_ads_destroy(struct intel_guc *guc) { i915_vma_unpin_and_release(>ads_vma, I915_VMA_RELEASE_MAP); guc->ads_blob = NULL; + iosys_map_clear(>ads_map); } static void guc_ads_private_data_reset(struct intel_guc *guc) -- 2.35.1
[Intel-gfx] [PATCH 06/19] drm/i915/guc: Add read/write helpers for ADS blob
Add helpers on top of iosys_map_read_field() / iosys_map_write_field() functions so they always use the right arguments and make code easier to read. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 13671b186908..3a0afce7564e 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -60,6 +60,13 @@ struct __guc_ads_blob { struct guc_mmio_reg regset[0]; } __packed; +#define ads_blob_read(guc_, field_)\ + iosys_map_rd_field(&(guc_)->ads_map, struct __guc_ads_blob, field_) + +#define ads_blob_write(guc_, field_, val_) \ + iosys_map_wr_field(&(guc_)->ads_map, struct __guc_ads_blob, \ + field_, val_) + static u32 guc_ads_regset_size(struct intel_guc *guc) { GEM_BUG_ON(!guc->ads_regset_size); -- 2.35.1
[Intel-gfx] [PATCH 09/19] drm/i915/guc: Convert engine record to iosys_map
Use iosys_map to read fields from the dma_blob so access to IO and system memory is abstracted away. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 14 ++ drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h | 3 ++- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 17 ++--- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 6311b9da87e4..1d21a2d457e0 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -698,18 +698,16 @@ void intel_guc_ads_reset(struct intel_guc *guc) u32 intel_guc_engine_usage_offset(struct intel_guc *guc) { - struct __guc_ads_blob *blob = guc->ads_blob; - u32 base = intel_guc_ggtt_offset(guc, guc->ads_vma); - u32 offset = base + ptr_offset(blob, engine_usage); - - return offset; + return intel_guc_ggtt_offset(guc, guc->ads_vma) + + offsetof(struct __guc_ads_blob, engine_usage); } -struct guc_engine_usage_record *intel_guc_engine_usage(struct intel_engine_cs *engine) +struct iosys_map intel_guc_engine_usage_record_map(struct intel_engine_cs *engine) { struct intel_guc *guc = >gt->uc.guc; - struct __guc_ads_blob *blob = guc->ads_blob; u8 guc_class = engine_class_to_guc_class(engine->class); + size_t offset = offsetof(struct __guc_ads_blob, + engine_usage.engines[guc_class][ilog2(engine->logical_mask)]); - return >engine_usage.engines[guc_class][ilog2(engine->logical_mask)]; + return IOSYS_MAP_INIT_OFFSET(>ads_map, offset); } diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h index e74c110facff..1c64f4d6ea21 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.h @@ -7,6 +7,7 @@ #define _INTEL_GUC_ADS_H_ #include +#include struct intel_guc; struct drm_printer; @@ -18,7 +19,7 @@ void intel_guc_ads_init_late(struct intel_guc *guc); void intel_guc_ads_reset(struct intel_guc *guc); void intel_guc_ads_print_policy_info(struct intel_guc *guc, struct drm_printer *p); -struct guc_engine_usage_record *intel_guc_engine_usage(struct intel_engine_cs *engine); +struct iosys_map intel_guc_engine_usage_record_map(struct intel_engine_cs *engine); u32 intel_guc_engine_usage_offset(struct intel_guc *guc); #endif diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index b3a429a92c0d..6d34842f68b4 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -1139,6 +1139,9 @@ __extend_last_switch(struct intel_guc *guc, u64 *prev_start, u32 new_start) *prev_start = ((u64)gt_stamp_hi << 32) | new_start; } +#define record_read(map_, field_) \ + iosys_map_rd_field(map_, struct guc_engine_usage_record, field_) + /* * GuC updates shared memory and KMD reads it. Since this is not synchronized, * we run into a race where the value read is inconsistent. Sometimes the @@ -1153,17 +1156,17 @@ __extend_last_switch(struct intel_guc *guc, u64 *prev_start, u32 new_start) static void __get_engine_usage_record(struct intel_engine_cs *engine, u32 *last_in, u32 *id, u32 *total) { - struct guc_engine_usage_record *rec = intel_guc_engine_usage(engine); + struct iosys_map rec_map = intel_guc_engine_usage_record_map(engine); int i = 0; do { - *last_in = READ_ONCE(rec->last_switch_in_stamp); - *id = READ_ONCE(rec->current_context_index); - *total = READ_ONCE(rec->total_runtime); + *last_in = record_read(_map, last_switch_in_stamp); + *id = record_read(_map, current_context_index); + *total = record_read(_map, total_runtime); - if (READ_ONCE(rec->last_switch_in_stamp) == *last_in && - READ_ONCE(rec->current_context_index) == *id && - READ_ONCE(rec->total_runtime) == *total) + if (record_read(_map, last_switch_in_stamp) == *last_in && + record_read(_map, current_context_index) == *id && + record_read(_map, total_runtime) == *total) break; } while (++i < 6); } -- 2.35.1
[Intel-gfx] [PATCH 07/19] drm/i915/guc: Convert golden context init to iosys_map
Now the map is saved during creation, so use it to initialize the golden context, reading from shmem and writing to either system or IO memory. Cc: Matt Roper Cc: Thomas Hellström Cc: Daniel Vetter Cc: John Harrison Cc: Matthew Brost Cc: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 25 +++--- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index 3a0afce7564e..d32b407a2d25 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -473,18 +473,17 @@ static struct intel_engine_cs *find_engine_state(struct intel_gt *gt, u8 engine_ static void guc_init_golden_context(struct intel_guc *guc) { - struct __guc_ads_blob *blob = guc->ads_blob; struct intel_engine_cs *engine; struct intel_gt *gt = guc_to_gt(guc); + struct iosys_map golden_context_map; u32 addr_ggtt, offset; u32 total_size = 0, alloc_size, real_size; u8 engine_class, guc_class; - u8 *ptr; if (!intel_uc_uses_guc_submission(>uc)) return; - GEM_BUG_ON(!blob); + GEM_BUG_ON(iosys_map_is_null(>ads_map)); /* * Go back and fill in the golden context data now that it is @@ -492,15 +491,15 @@ static void guc_init_golden_context(struct intel_guc *guc) */ offset = guc_ads_golden_ctxt_offset(guc); addr_ggtt = intel_guc_ggtt_offset(guc, guc->ads_vma) + offset; - ptr = ((u8 *)blob) + offset; + + golden_context_map = IOSYS_MAP_INIT_OFFSET(>ads_map, offset); for (engine_class = 0; engine_class <= MAX_ENGINE_CLASS; ++engine_class) { if (engine_class == OTHER_CLASS) continue; guc_class = engine_class_to_guc_class(engine_class); - - if (!blob->system_info.engine_enabled_masks[guc_class]) + if (!ads_blob_read(guc, system_info.engine_enabled_masks[guc_class])) continue; real_size = intel_engine_context_size(gt, engine_class); @@ -511,18 +510,20 @@ static void guc_init_golden_context(struct intel_guc *guc) if (!engine) { drm_err(>i915->drm, "No engine state recorded for class %d!\n", engine_class); - blob->ads.eng_state_size[guc_class] = 0; - blob->ads.golden_context_lrca[guc_class] = 0; + ads_blob_write(guc, ads.eng_state_size[guc_class], 0); + ads_blob_write(guc, ads.golden_context_lrca[guc_class], 0); continue; } - GEM_BUG_ON(blob->ads.eng_state_size[guc_class] != + GEM_BUG_ON(ads_blob_read(guc, ads.eng_state_size[guc_class]) != real_size - LRC_SKIP_SIZE); - GEM_BUG_ON(blob->ads.golden_context_lrca[guc_class] != addr_ggtt); + GEM_BUG_ON(ads_blob_read(guc, ads.golden_context_lrca[guc_class]) != addr_ggtt); + addr_ggtt += alloc_size; - shmem_read(engine->default_state, 0, ptr, real_size); - ptr += alloc_size; + shmem_read_to_iosys_map(engine->default_state, 0, + _context_map, real_size); + iosys_map_incr(_context_map, alloc_size); } GEM_BUG_ON(guc->ads_golden_ctxt_size != total_size); -- 2.35.1
[Intel-gfx] [PATCH 02/19] iosys-map: Add offset to iosys_map_memcpy_to()
In certain situations it's useful to be able to write to an offset of the mapping. Add a dst_offset to iosys_map_memcpy_to(). Cc: Sumit Semwal Cc: Christian König Cc: Thomas Zimmermann Cc: dri-de...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/drm_cache.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 2 +- include/linux/iosys-map.h | 17 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index 66597e411764..c3e6e615bf09 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c @@ -218,7 +218,7 @@ static void memcpy_fallback(struct iosys_map *dst, if (!dst->is_iomem && !src->is_iomem) { memcpy(dst->vaddr, src->vaddr, len); } else if (!src->is_iomem) { - iosys_map_memcpy_to(dst, src->vaddr, len); + iosys_map_memcpy_to(dst, 0, src->vaddr, len); } else if (!dst->is_iomem) { memcpy_fromio(dst->vaddr, src->vaddr_iomem, len); } else { diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 238f815cb2a0..bf5cc9a42e5a 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -385,7 +385,7 @@ static void drm_fb_helper_damage_blit_real(struct drm_fb_helper *fb_helper, iosys_map_incr(dst, offset); /* go to first pixel within clip rect */ for (y = clip->y1; y < clip->y2; y++) { - iosys_map_memcpy_to(dst, src, len); + iosys_map_memcpy_to(dst, 0, src, len); iosys_map_incr(dst, fb->pitches[0]); src += fb->pitches[0]; } diff --git a/include/linux/iosys-map.h b/include/linux/iosys-map.h index f4186f91caa6..edd7fa3be9e9 100644 --- a/include/linux/iosys-map.h +++ b/include/linux/iosys-map.h @@ -220,22 +220,23 @@ static inline void iosys_map_clear(struct iosys_map *map) } /** - * iosys_map_memcpy_to - Memcpy into iosys mapping + * iosys_map_memcpy_to_offset - Memcpy into offset of iosys_map * @dst: The iosys_map structure + * @dst_offset:The offset from which to copy * @src: The source buffer * @len: The number of byte in src * - * Copies data into a iosys mapping. The source buffer is in system - * memory. Depending on the buffer's location, the helper picks the correct - * method of accessing the memory. + * Copies data into a iosys_map with an offset. The source buffer is in + * system memory. Depending on the buffer's location, the helper picks the + * correct method of accessing the memory. */ -static inline void iosys_map_memcpy_to(struct iosys_map *dst, const void *src, - size_t len) +static inline void iosys_map_memcpy_to(struct iosys_map *dst, size_t dst_offset, + const void *src, size_t len) { if (dst->is_iomem) - memcpy_toio(dst->vaddr_iomem, src, len); + memcpy_toio(dst->vaddr_iomem + dst_offset, src, len); else - memcpy(dst->vaddr, src, len); + memcpy(dst->vaddr + dst_offset, src, len); } /** -- 2.35.1
[Intel-gfx] [PATCH 00/19] drm/i915/guc: Refactor ADS access to use iosys_map
2nd version of https://patchwork.freedesktop.org/series/99378/ As first patch I'm including the dma-buf-map rename to iosys-map for completeness and to allow the other patches to be reviewed. However the first patch was also sent by itself. I think all the feedback from v1 was incorporated in this version. All the new helpers in iosys-map were squashed in a single patch as requested. Original cover letter: While porting i915 to arm64 we noticed some issues accessing lmem. Some writes were getting corrupted and the final state of the buffer didn't have exactly what we wrote. This became evident when enabling GuC submission: depending on the number of engines the ADS struct was being corrupted and GuC would reject it, refusin to initialize. >From Documentation/core-api/bus-virt-phys-mapping.rst: This memory is called "PCI memory" or "shared memory" or "IO memory" or whatever, and there is only one way to access it: the readb/writeb and related functions. You should never take the address of such memory, because there is really nothing you can do with such an address: it's not conceptually in the same memory space as "real memory" at all, so you cannot just dereference a pointer. (Sadly, on x86 it **is** in the same memory space, so on x86 it actually works to just deference a pointer, but it's not portable). When reading or writing words directly to IO memory, in order to be portable the Linux kernel provides the abstraction detailed in section "Differences between I/O access functions" of Documentation/driver-api/device-io.rst. This limits our ability to simply overlay our structs on top a buffer and directly access it since that buffer may come from IO memory rather than system memory. Hence the approach taken in intel_guc_ads.c needs to be refactored. This is not the only place in i915 that neeed to be changed, but the one causing the most problems, with a real reproducer. This first set of patch focuses on fixing the gem object to pass the ADS After the addition of a few helpers in the dma_buf_map API, most of intel_guc_ads.c can be converted to use it. The exception is the regset initialization: we'd incur into a lot of extra indirection when reading/writting each register. So the regset is converted to use a temporary buffer allocated on probe, which is then copied to its final location when finishing the initialization or on gt reset. Testing on some discrete cards, after this change we can correctly pass the ADS struct to GuC and have it initialized correctly. thanks, Lucas De Marchi Lucas De Marchi (19): dma-buf-map: Rename to iosys-map iosys-map: Add offset to iosys_map_memcpy_to() iosys-map: Add a few more helpers drm/i915/gt: Add helper for shmem copy to iosys_map drm/i915/guc: Keep iosys_map of ads_blob around drm/i915/guc: Add read/write helpers for ADS blob drm/i915/guc: Convert golden context init to iosys_map drm/i915/guc: Convert policies update to iosys_map drm/i915/guc: Convert engine record to iosys_map drm/i915/guc: Convert guc_ads_private_data_reset to iosys_map drm/i915/guc: Convert golden context prep to iosys_map drm/i915/guc: Replace check for golden context size drm/i915/guc: Convert mapping table to iosys_map drm/i915/guc: Convert capture list to iosys_map drm/i915/guc: Prepare for error propagation drm/i915/guc: Use a single pass to calculate regset drm/i915/guc: Convert guc_mmio_reg_state_init to iosys_map drm/i915/guc: Convert __guc_ads_init to iosys_map drm/i915/guc: Remove plain ads_blob pointer Documentation/driver-api/device-io.rst| 9 + Documentation/driver-api/dma-buf.rst | 9 - Documentation/gpu/todo.rst| 20 +- MAINTAINERS | 9 +- drivers/dma-buf/dma-buf.c | 22 +- drivers/dma-buf/heaps/cma_heap.c | 10 +- drivers/dma-buf/heaps/system_heap.c | 10 +- drivers/gpu/drm/ast/ast_drv.h | 2 +- drivers/gpu/drm/ast/ast_mode.c| 8 +- drivers/gpu/drm/drm_cache.c | 18 +- drivers/gpu/drm/drm_client.c | 9 +- drivers/gpu/drm/drm_fb_helper.c | 12 +- drivers/gpu/drm/drm_gem.c | 12 +- drivers/gpu/drm/drm_gem_cma_helper.c | 9 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 16 +- drivers/gpu/drm/drm_gem_shmem_helper.c| 15 +- drivers/gpu/drm/drm_gem_ttm_helper.c | 4 +- drivers/gpu/drm/drm_gem_vram_helper.c | 25 +- drivers/gpu/drm/drm_internal.h| 6 +- drivers/gpu/drm/drm_mipi_dbi.c| 8 +- drivers/gpu/drm/drm_prime.c | 4 +- drivers/gpu/drm/etnaviv/etnaviv_drv.h | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 8 +- drivers/gpu/drm/gud/gud_pipe.c| 4 +- drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
[Intel-gfx] [Important!] 2022 X.Org Foundation Membership deadline for voting in the election
The 2022 X.Org Foundation elections are rapidly approaching. We will be forwarding instructions on the nomination process to membership in the near future. Please note that only current members can vote in the upcoming election, and that the deadline for new memberships or renewals to vote in the upcoming election is March 17th 2022 at 23:59 UTC. If you are interested in joining the X.Org Foundation or in renewing your membership, please visit the membership system site at: https://members.x.org/ You can find the current election schedule here: https://www.x.org/wiki/BoardOfDirectors/Elections/2022/ Lyude Paul, On behalf of the X.Org elections committee
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for dma-buf-map: Rename to iosys-map (rev3)
== Series Details == Series: dma-buf-map: Rename to iosys-map (rev3) URL : https://patchwork.freedesktop.org/series/99612/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.
[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for dma-buf-map: Rename to iosys-map (rev3)
== Series Details == Series: dma-buf-map: Rename to iosys-map (rev3) URL : https://patchwork.freedesktop.org/series/99612/ State : warning == Summary == $ dim checkpatch origin/drm-tip 22c409c1748c dma-buf-map: Rename to iosys-map -:237: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #237: FILE: drivers/dma-buf/dma-buf.c:1279: + BUG_ON(iosys_map_is_null(>vmap_ptr)); -:243: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #243: FILE: drivers/dma-buf/dma-buf.c:1284: + BUG_ON(iosys_map_is_set(>vmap_ptr)); -:258: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #258: FILE: drivers/dma-buf/dma-buf.c:1311: + BUG_ON(iosys_map_is_null(>vmap_ptr)); -:261: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #261: FILE: drivers/dma-buf/dma-buf.c:1313: + BUG_ON(!iosys_map_is_equal(>vmap_ptr, map)); -:1625: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please. -:1628: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please. -:2598: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #2598: deleted file mode 100644 total: 0 errors, 7 warnings, 0 checks, 2303 lines checked
[Intel-gfx] ✓ Fi.CI.BAT: success for Use drm_clflush* instead of clflush (rev4)
== Series Details == Series: Use drm_clflush* instead of clflush (rev4) URL : https://patchwork.freedesktop.org/series/99450/ State : success == Summary == CI Bug Log - changes from CI_DRM_11189 -> Patchwork_22178 Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/index.html Participating hosts (47 -> 44) -- Additional (1): fi-kbl-soraka Missing(4): fi-ctg-p8600 fi-bsw-cyan fi-bdw-samus fi-hsw-4200u Known issues Here are the changes found in Patchwork_22178 that come from known issues: ### IGT changes ### Issues hit * igt@amdgpu/amd_cs_nop@nop-compute0: - fi-pnv-d510:NOTRUN -> [SKIP][1] ([fdo#109271]) +17 similar issues [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-pnv-d510/igt@amdgpu/amd_cs_...@nop-compute0.html * igt@gem_exec_fence@basic-busy@bcs0: - fi-kbl-soraka: NOTRUN -> [SKIP][2] ([fdo#109271]) +8 similar issues [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-kbl-soraka/igt@gem_exec_fence@basic-b...@bcs0.html * igt@gem_huc_copy@huc-copy: - fi-kbl-soraka: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#2190]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html * igt@gem_lmem_swapping@parallel-random-engines: - fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#4613]) +3 similar issues [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-kbl-soraka/igt@gem_lmem_swapp...@parallel-random-engines.html * igt@i915_selftest@live@gt_pm: - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][5] ([i915#1886] / [i915#2291]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html * igt@i915_selftest@live@hangcheck: - bat-dg1-6: [PASS][6] -> [DMESG-FAIL][7] ([i915#4494] / [i915#4957]) [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html - fi-hsw-4770:[PASS][8] -> [INCOMPLETE][9] ([i915#4785]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-hsw-4770/igt@i915_selftest@l...@hangcheck.html [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-hsw-4770/igt@i915_selftest@l...@hangcheck.html * igt@kms_chamelium@dp-edid-read: - fi-kbl-soraka: NOTRUN -> [SKIP][10] ([fdo#109271] / [fdo#111827]) +8 similar issues [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-kbl-soraka/igt@kms_chamel...@dp-edid-read.html * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d: - fi-kbl-soraka: NOTRUN -> [SKIP][11] ([fdo#109271] / [i915#533]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-kbl-soraka/igt@kms_pipe_crc_ba...@compare-crc-sanitycheck-pipe-d.html * igt@kms_pipe_crc_basic@read-crc-pipe-b: - fi-cfl-8109u: [PASS][12] -> [DMESG-WARN][13] ([i915#295]) +12 similar issues [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-cfl-8109u/igt@kms_pipe_crc_ba...@read-crc-pipe-b.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-cfl-8109u/igt@kms_pipe_crc_ba...@read-crc-pipe-b.html * igt@prime_vgem@basic-userptr: - fi-skl-6600u: NOTRUN -> [SKIP][14] ([fdo#109271]) +18 similar issues [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-skl-6600u/igt@prime_v...@basic-userptr.html * igt@runner@aborted: - fi-hsw-4770:NOTRUN -> [FAIL][15] ([fdo#109271] / [i915#1436] / [i915#4312]) [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-hsw-4770/igt@run...@aborted.html - fi-bdw-5557u: NOTRUN -> [FAIL][16] ([i915#2426] / [i915#4312]) [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-bdw-5557u/igt@run...@aborted.html Possible fixes * igt@gem_exec_suspend@basic-s3@smem: - fi-bdw-5557u: [INCOMPLETE][17] ([i915#146]) -> [PASS][18] [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-bdw-5557u/igt@gem_exec_suspend@basic...@smem.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-bdw-5557u/igt@gem_exec_suspend@basic...@smem.html * igt@i915_selftest@live@requests: - fi-pnv-d510:[DMESG-FAIL][19] ([i915#2927] / [i915#4528]) -> [PASS][20] [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-pnv-d510/igt@i915_selftest@l...@requests.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22178/fi-pnv-d510/igt@i915_selftest@l...@requests.html * igt@kms_frontbuffer_tracking@basic: - fi-cml-u2: [DMESG-WARN][21] ([i915#4269]) -> [PASS][22] [21]:
[Intel-gfx] [PATCH] drm/i915/selftests: Disable runtime pm wakeref tracking for the mock device
From: Ville Syrjälä commit c50df701d49e ("drm/i915: Enable rpm wakeref tracking whether runtime pm is enabled or not") enabled wakeref tracking even for the mock device. Turns out that has somewhat significant overhead, and on the glacial Core m3's we have in CI the vma selftests are now exceeding the allotted time budget. So let's disable the wakeref tracking once again for the mock device in order to avoid blowing up the selftest runtime. Cc: Thomas Hellström Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_runtime_pm.c | 3 +++ drivers/gpu/drm/i915/intel_runtime_pm.h | 1 + drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index 3293ac71bcf8..6ed5786bcd29 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c @@ -77,6 +77,9 @@ track_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm) depot_stack_handle_t stack, *stacks; unsigned long flags; + if (rpm->no_wakeref_tracking) + return -1; + stack = __save_depot_stack(); if (!stack) return -1; diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.h b/drivers/gpu/drm/i915/intel_runtime_pm.h index 47a85fab4130..d9160e3ff4af 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.h +++ b/drivers/gpu/drm/i915/intel_runtime_pm.h @@ -51,6 +51,7 @@ struct intel_runtime_pm { bool available; bool suspended; bool irqs_enabled; + bool no_wakeref_tracking; #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM) /* diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c index 28a0f054009a..573d9b2e1a4a 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c @@ -161,6 +161,8 @@ struct drm_i915_private *mock_gem_device(void) i915_params_copy(>params, _modparams); intel_runtime_pm_init_early(>runtime_pm); + /* wakeref tracking has significant overhead */ + i915->runtime_pm.no_wakeref_tracking = true; /* Using the global GTT may ask questions about KMS users, so prepare */ drm_mode_config_init(>drm); -- 2.34.1
[Intel-gfx] [PATCH v4] dma-buf-map: Rename to iosys-map
Rename struct dma_buf_map to struct iosys_map and corresponding APIs. Over time dma-buf-map grew up to more functionality than the one used by dma-buf: in fact it's just a shim layer to abstract system memory, that can be accessed via regular load and store, from IO memory that needs to be acessed via arch helpers. The idea is to extend this API so it can fulfill other needs, internal to a single driver. Example: in the i915 driver it's desired to share the implementation for integrated graphics, which uses mostly system memory, with discrete graphics, which may need to access IO memory. The conversion was mostly done with the following semantic patch: @r1@ @@ - struct dma_buf_map + struct iosys_map @r2@ @@ ( - DMA_BUF_MAP_INIT_VADDR + IOSYS_MAP_INIT_VADDR | - dma_buf_map_set_vaddr + iosys_map_set_vaddr | - dma_buf_map_set_vaddr_iomem + iosys_map_set_vaddr_iomem | - dma_buf_map_is_equal + iosys_map_is_equal | - dma_buf_map_is_null + iosys_map_is_null | - dma_buf_map_is_set + iosys_map_is_set | - dma_buf_map_clear + iosys_map_clear | - dma_buf_map_memcpy_to + iosys_map_memcpy_to | - dma_buf_map_incr + iosys_map_incr ) @@ @@ - #include + #include Then some files had their includes adjusted and some comments were update to remove mentions to dma-buf-map. Since this is not specific to dma-buf anymore, move the documentation to the "Bus-Independent Device Accesses" section. v2: - Squash patches v3: - Fix wrong removal of dma-buf.h from MAINTAINERS - Move documentation from dma-buf.rst to device-io.rst v4: - Change documentation tile and level Signed-off-by: Lucas De Marchi Acked-by: Christian König Acked-by: Sumit Semwal Acked-by: Thomas Zimmermann --- Documentation/driver-api/device-io.rst| 9 + Documentation/driver-api/dma-buf.rst | 9 - Documentation/gpu/todo.rst| 20 +- MAINTAINERS | 9 +- drivers/dma-buf/dma-buf.c | 22 +- drivers/dma-buf/heaps/cma_heap.c | 10 +- drivers/dma-buf/heaps/system_heap.c | 10 +- drivers/gpu/drm/ast/ast_drv.h | 2 +- drivers/gpu/drm/ast/ast_mode.c| 8 +- drivers/gpu/drm/drm_cache.c | 18 +- drivers/gpu/drm/drm_client.c | 9 +- drivers/gpu/drm/drm_fb_helper.c | 12 +- drivers/gpu/drm/drm_gem.c | 12 +- drivers/gpu/drm/drm_gem_cma_helper.c | 9 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 16 +- drivers/gpu/drm/drm_gem_shmem_helper.c| 15 +- drivers/gpu/drm/drm_gem_ttm_helper.c | 4 +- drivers/gpu/drm/drm_gem_vram_helper.c | 25 +- drivers/gpu/drm/drm_internal.h| 6 +- drivers/gpu/drm/drm_mipi_dbi.c| 8 +- drivers/gpu/drm/drm_prime.c | 4 +- drivers/gpu/drm/etnaviv/etnaviv_drv.h | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 8 +- drivers/gpu/drm/gud/gud_pipe.c| 4 +- drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c| 8 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 6 +- .../gpu/drm/i915/gem/selftests/mock_dmabuf.c | 6 +- drivers/gpu/drm/lima/lima_gem.c | 3 +- drivers/gpu/drm/lima/lima_sched.c | 4 +- drivers/gpu/drm/mediatek/mtk_drm_gem.c| 7 +- drivers/gpu/drm/mediatek/mtk_drm_gem.h| 5 +- drivers/gpu/drm/mgag200/mgag200_mode.c| 4 +- drivers/gpu/drm/msm/msm_drv.h | 4 +- drivers/gpu/drm/msm/msm_gem_prime.c | 6 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 13 +- drivers/gpu/drm/qxl/qxl_display.c | 8 +- drivers/gpu/drm/qxl/qxl_draw.c| 6 +- drivers/gpu/drm/qxl/qxl_drv.h | 10 +- drivers/gpu/drm/qxl/qxl_object.c | 8 +- drivers/gpu/drm/qxl/qxl_object.h | 4 +- drivers/gpu/drm/qxl/qxl_prime.c | 4 +- drivers/gpu/drm/radeon/radeon_gem.c | 1 + drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 9 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 5 +- drivers/gpu/drm/tegra/gem.c | 10 +- drivers/gpu/drm/tiny/cirrus.c | 8 +- drivers/gpu/drm/tiny/gm12u320.c | 7 +- drivers/gpu/drm/ttm/ttm_bo_util.c | 16 +- drivers/gpu/drm/ttm/ttm_resource.c| 42 +-- drivers/gpu/drm/ttm/ttm_tt.c | 8 +- drivers/gpu/drm/udl/udl_modeset.c | 3 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 +-
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for Use drm_clflush* instead of clflush (rev4)
== Series Details == Series: Use drm_clflush* instead of clflush (rev4) URL : https://patchwork.freedesktop.org/series/99450/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.
[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Use drm_clflush* instead of clflush (rev4)
== Series Details == Series: Use drm_clflush* instead of clflush (rev4) URL : https://patchwork.freedesktop.org/series/99450/ State : warning == Summary == $ dim checkpatch origin/drm-tip 09b1c8ee43ad drm/i915/gt: Re-work intel_write_status_page 3f38f2a1e91d drm/i915/gt: Drop invalidate_csb_entries -:49: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #49: FILE: drivers/gpu/drm/i915/gt/intel_execlists_submission.c:2781: + drm_clflush_virt_range(>csb_status[0], + sizeof(>csb_status[reset_value])); -:49: WARNING:SIZEOF_ADDRESS: sizeof(& should be avoided #49: FILE: drivers/gpu/drm/i915/gt/intel_execlists_submission.c:2781: + sizeof(>csb_status[reset_value])); total: 0 errors, 1 warnings, 1 checks, 30 lines checked a18f55ff9cbc drm/i915/gt: Re-work reset_csb -:28: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #28: FILE: drivers/gpu/drm/i915/gt/intel_execlists_submission.c:2948: + drm_clflush_virt_range(execlists->csb_write, + sizeof(execlists->csb_write)); total: 0 errors, 0 warnings, 1 checks, 11 lines checked fab67357e34d drm/i915/: Re-work clflush_write32 0ba361b324ae drm/i915/gt: replace cache_clflush_range -:6: WARNING:TYPO_SPELLING: 'occurance' may be misspelled - perhaps 'occurrence'? #6: Replace all occurance of cache_clflush_range with ^ total: 0 errors, 1 warnings, 0 checks, 77 lines checked
[Intel-gfx] [PATCH v5 4/5] drm/i915/: Re-work clflush_write32
Use drm_clflush_virt_range instead of clflushopt and remove the memory barrier, since drm_clflush_virt_range takes care of that. Signed-off-by: Michael Cheng --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index 498b458fd784..0854276ff7ba 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -1332,10 +1332,8 @@ static void *reloc_vaddr(struct i915_vma *vma, static void clflush_write32(u32 *addr, u32 value, unsigned int flushes) { if (unlikely(flushes & (CLFLUSH_BEFORE | CLFLUSH_AFTER))) { - if (flushes & CLFLUSH_BEFORE) { - clflushopt(addr); - mb(); - } + if (flushes & CLFLUSH_BEFORE) + drm_clflush_virt_range(addr, sizeof(addr)); *addr = value; @@ -1347,7 +1345,7 @@ static void clflush_write32(u32 *addr, u32 value, unsigned int flushes) * to ensure ordering of clflush wrt to the system. */ if (flushes & CLFLUSH_AFTER) - clflushopt(addr); + drm_clflush_virt_range(addr, sizeof(addr)); } else *addr = value; } -- 2.25.1
[Intel-gfx] [PATCH v5 1/5] drm/i915/gt: Re-work intel_write_status_page
Re-work intel_write_status_page to use drm_clflush_virt_range. This will prevent compiler errors when building for non-x86 architectures. Signed-off-by: Michael Cheng --- drivers/gpu/drm/i915/gt/intel_engine.h | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_engine.h b/drivers/gpu/drm/i915/gt/intel_engine.h index 0e353d8c2bc8..986777c2430d 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine.h +++ b/drivers/gpu/drm/i915/gt/intel_engine.h @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -143,15 +144,9 @@ intel_write_status_page(struct intel_engine_cs *engine, int reg, u32 value) * of extra paranoia to try and ensure that the HWS takes the value * we give and that it doesn't end up trapped inside the CPU! */ - if (static_cpu_has(X86_FEATURE_CLFLUSH)) { - mb(); - clflush(>status_page.addr[reg]); - engine->status_page.addr[reg] = value; - clflush(>status_page.addr[reg]); - mb(); - } else { - WRITE_ONCE(engine->status_page.addr[reg], value); - } + drm_clflush_virt_range(>status_page.addr[reg], sizeof(value)); + WRITE_ONCE(engine->status_page.addr[reg], value); + drm_clflush_virt_range(>status_page.addr[reg], sizeof(value)); } /* -- 2.25.1
[Intel-gfx] [PATCH v5 5/5] drm/i915/gt: replace cache_clflush_range
Replace all occurance of cache_clflush_range with drm_clflush_virt_range. This will prevent compile errors on non-x86 platforms. Signed-off-by: Michael Cheng --- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 12 ++-- drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 2 +- drivers/gpu/drm/i915/gt/intel_gtt.c | 2 +- drivers/gpu/drm/i915/gt/intel_ppgtt.c| 2 +- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c| 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c index c43e724afa9f..d0999e92621b 100644 --- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c @@ -444,11 +444,11 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, pd = pdp->entry[gen8_pd_index(idx, 2)]; } - clflush_cache_range(vaddr, PAGE_SIZE); + drm_clflush_virt_range(vaddr, PAGE_SIZE); vaddr = px_vaddr(i915_pt_entry(pd, gen8_pd_index(idx, 1))); } } while (1); - clflush_cache_range(vaddr, PAGE_SIZE); + drm_clflush_virt_range(vaddr, PAGE_SIZE); return idx; } @@ -532,7 +532,7 @@ static void gen8_ppgtt_insert_huge(struct i915_address_space *vm, } } while (rem >= page_size && index < I915_PDES); - clflush_cache_range(vaddr, PAGE_SIZE); + drm_clflush_virt_range(vaddr, PAGE_SIZE); /* * Is it safe to mark the 2M block as 64K? -- Either we have @@ -548,7 +548,7 @@ static void gen8_ppgtt_insert_huge(struct i915_address_space *vm, I915_GTT_PAGE_SIZE_2M { vaddr = px_vaddr(pd); vaddr[maybe_64K] |= GEN8_PDE_IPS_64K; - clflush_cache_range(vaddr, PAGE_SIZE); + drm_clflush_virt_range(vaddr, PAGE_SIZE); page_size = I915_GTT_PAGE_SIZE_64K; /* @@ -569,7 +569,7 @@ static void gen8_ppgtt_insert_huge(struct i915_address_space *vm, for (i = 1; i < index; i += 16) memset64(vaddr + i, encode, 15); - clflush_cache_range(vaddr, PAGE_SIZE); + drm_clflush_virt_range(vaddr, PAGE_SIZE); } } @@ -617,7 +617,7 @@ static void gen8_ppgtt_insert_entry(struct i915_address_space *vm, vaddr = px_vaddr(i915_pt_entry(pd, gen8_pd_index(idx, 1))); vaddr[gen8_pd_index(idx, 0)] = gen8_pte_encode(addr, level, flags); - clflush_cache_range([gen8_pd_index(idx, 0)], sizeof(*vaddr)); + drm_clflush_virt_range([gen8_pd_index(idx, 0)], sizeof(*vaddr)); } static int gen8_init_scratch(struct i915_address_space *vm) diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c index 22505aa428d9..5e74c99d5929 100644 --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c @@ -2822,7 +2822,7 @@ static void execlists_sanitize(struct intel_engine_cs *engine) sanitize_hwsp(engine); /* And scrub the dirty cachelines for the HWSP */ - clflush_cache_range(engine->status_page.addr, PAGE_SIZE); + drm_clflush_virt_range(engine->status_page.addr, PAGE_SIZE); intel_engine_reset_pinned_contexts(engine); } diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c b/drivers/gpu/drm/i915/gt/intel_gtt.c index 0d6bbc8c57f2..9b594be9102f 100644 --- a/drivers/gpu/drm/i915/gt/intel_gtt.c +++ b/drivers/gpu/drm/i915/gt/intel_gtt.c @@ -255,7 +255,7 @@ fill_page_dma(struct drm_i915_gem_object *p, const u64 val, unsigned int count) void *vaddr = __px_vaddr(p); memset64(vaddr, val, count); - clflush_cache_range(vaddr, PAGE_SIZE); + drm_clflush_virt_range(vaddr, PAGE_SIZE); } static void poison_scratch_page(struct drm_i915_gem_object *scratch) diff --git a/drivers/gpu/drm/i915/gt/intel_ppgtt.c b/drivers/gpu/drm/i915/gt/intel_ppgtt.c index 48e6e2f87700..bd474a5123cb 100644 --- a/drivers/gpu/drm/i915/gt/intel_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/intel_ppgtt.c @@ -90,7 +90,7 @@ write_dma_entry(struct drm_i915_gem_object * const pdma, u64 * const vaddr = __px_vaddr(pdma); vaddr[idx] = encoded_entry; - clflush_cache_range([idx], sizeof(u64)); + drm_clflush_virt_range([idx], sizeof(u64)); } void diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index b3a429a92c0d..89020706adc4 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++
[Intel-gfx] [PATCH v5 0/5] Use drm_clflush* instead of clflush
This patch series re-work a few i915 functions to use drm_clflush_virt_range instead of calling clflush or clflushopt directly. This will prevent errors when building for non-x86 architectures. v2: s/PAGE_SIZE/sizeof(value) for Re-work intel_write_status_page and added more patches to convert additional clflush/clflushopt to use drm_clflush*. (Michael Cheng) v3: Drop invalidate_csb_entries and directly invoke drm_clflush_virt_ran v4: Remove extra memory barriers v5: s/cache_clflush_range/drm_clflush_virt_range Michael Cheng (5): drm/i915/gt: Re-work intel_write_status_page drm/i915/gt: Drop invalidate_csb_entries drm/i915/gt: Re-work reset_csb drm/i915/: Re-work clflush_write32 drm/i915/gt: replace cache_clflush_range .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 8 +++- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 12 ++-- drivers/gpu/drm/i915/gt/intel_engine.h| 13 - .../drm/i915/gt/intel_execlists_submission.c | 19 ++- drivers/gpu/drm/i915/gt/intel_gtt.c | 2 +- drivers/gpu/drm/i915/gt/intel_ppgtt.c | 2 +- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 2 +- 7 files changed, 22 insertions(+), 36 deletions(-) -- 2.25.1
[Intel-gfx] [PATCH v5 2/5] drm/i915/gt: Drop invalidate_csb_entries
Drop invalidate_csb_entries and directly call drm_clflush_virt_range. This allows for one less function call, and prevent complier errors when building for non-x86 architectures. v2(Michael Cheng): Drop invalidate_csb_entries function and directly invoke drm_clflush_virt_range. Thanks to Tvrtko for the sugguestion. Signed-off-by: Michael Cheng --- drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c index 9bb7c863172f..7500c06562da 100644 --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c @@ -1646,12 +1646,6 @@ cancel_port_requests(struct intel_engine_execlists * const execlists, return inactive; } -static void invalidate_csb_entries(const u64 *first, const u64 *last) -{ - clflush((void *)first); - clflush((void *)last); -} - /* * Starting with Gen12, the status has a new format: * @@ -1999,7 +1993,7 @@ process_csb(struct intel_engine_cs *engine, struct i915_request **inactive) * the wash as hardware, working or not, will need to do the * invalidation before. */ - invalidate_csb_entries([0], [num_entries - 1]); + drm_clflush_virt_range([0], num_entries * sizeof(buf[0])); /* * We assume that any event reflects a change in context flow @@ -2783,8 +2777,8 @@ static void reset_csb_pointers(struct intel_engine_cs *engine) /* Check that the GPU does indeed update the CSB entries! */ memset(execlists->csb_status, -1, (reset_value + 1) * sizeof(u64)); - invalidate_csb_entries(>csb_status[0], - >csb_status[reset_value]); + drm_clflush_virt_range(>csb_status[0], + sizeof(>csb_status[reset_value])); /* Once more for luck and our trusty paranoia */ ENGINE_WRITE(engine, RING_CONTEXT_STATUS_PTR, -- 2.25.1
[Intel-gfx] [PATCH v5 3/5] drm/i915/gt: Re-work reset_csb
Use drm_clflush_virt_range instead of directly invoking clflush. This will prevent compiler errors when building for non-x86 architectures. v2(Michael Cheng): Remove extra clflush v3(Michael Cheng): Remove memory barrier since drm_clflush_virt_range takes care of it. Signed-off-by: Michael Cheng --- drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c index 7500c06562da..22505aa428d9 100644 --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c @@ -2944,9 +2944,8 @@ reset_csb(struct intel_engine_cs *engine, struct i915_request **inactive) { struct intel_engine_execlists * const execlists = >execlists; - mb(); /* paranoia: read the CSB pointers from after the reset */ - clflush(execlists->csb_write); - mb(); + drm_clflush_virt_range(execlists->csb_write, + sizeof(execlists->csb_write)); inactive = process_csb(engine, inactive); /* drain preemption events */ -- 2.25.1
[Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/3] drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration
== Series Details == Series: series starting with [1/3] drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration URL : https://patchwork.freedesktop.org/series/99702/ State : failure == Summary == CI Bug Log - changes from CI_DRM_11189_full -> Patchwork_22177_full Summary --- **FAILURE** Serious unknown changes coming with Patchwork_22177_full absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_22177_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. Participating hosts (11 -> 12) -- Additional (1): shard-rkl Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_22177_full: ### IGT changes ### Possible regressions * igt@gem_exec_endless@dispatch@rcs0: - shard-apl: [PASS][1] -> [INCOMPLETE][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-apl4/igt@gem_exec_endless@dispa...@rcs0.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-apl3/igt@gem_exec_endless@dispa...@rcs0.html * igt@i915_selftest@mock@vma: - shard-skl: NOTRUN -> [INCOMPLETE][3] +1 similar issue [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-skl6/igt@i915_selftest@m...@vma.html Known issues Here are the changes found in Patchwork_22177_full that come from known issues: ### IGT changes ### Issues hit * igt@gem_ctx_persistence@legacy-engines-hang: - shard-snb: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#1099]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-snb5/igt@gem_ctx_persiste...@legacy-engines-hang.html * igt@gem_ctx_shared@q-in-order: - shard-snb: NOTRUN -> [SKIP][5] ([fdo#109271]) +108 similar issues [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-snb5/igt@gem_ctx_sha...@q-in-order.html * igt@gem_exec_balancer@parallel: - shard-iclb: [PASS][6] -> [SKIP][7] ([i915#4525]) +1 similar issue [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-iclb2/igt@gem_exec_balan...@parallel.html [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-iclb3/igt@gem_exec_balan...@parallel.html * igt@gem_exec_capture@pi@vcs0: - shard-skl: [PASS][8] -> [INCOMPLETE][9] ([i915#4547]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-skl8/igt@gem_exec_capture@p...@vcs0.html [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-skl1/igt@gem_exec_capture@p...@vcs0.html * igt@gem_exec_fair@basic-none-vip@rcs0: - shard-glk: [PASS][10] -> [FAIL][11] ([i915#2842]) [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-glk5/igt@gem_exec_fair@basic-none-...@rcs0.html [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-glk1/igt@gem_exec_fair@basic-none-...@rcs0.html * igt@gem_exec_fair@basic-none@rcs0: - shard-kbl: [PASS][12] -> [FAIL][13] ([i915#2842]) +1 similar issue [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-kbl6/igt@gem_exec_fair@basic-n...@rcs0.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-kbl1/igt@gem_exec_fair@basic-n...@rcs0.html * igt@gem_exec_schedule@smoketest-all: - shard-glk: [PASS][14] -> [DMESG-WARN][15] ([i915#118]) [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-glk9/igt@gem_exec_sched...@smoketest-all.html [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-glk9/igt@gem_exec_sched...@smoketest-all.html * igt@gem_lmem_swapping@heavy-random: - shard-skl: NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#4613]) +1 similar issue [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-skl6/igt@gem_lmem_swapp...@heavy-random.html * igt@gem_userptr_blits@input-checking: - shard-skl: NOTRUN -> [DMESG-WARN][17] ([i915#4990]) [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-skl10/igt@gem_userptr_bl...@input-checking.html * igt@i915_pm_dc@dc6-dpms: - shard-skl: NOTRUN -> [FAIL][18] ([i915#454]) [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-skl6/igt@i915_pm...@dc6-dpms.html * igt@i915_suspend@forcewake: - shard-kbl: [PASS][19] -> [DMESG-WARN][20] ([i915#180]) [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/shard-kbl3/igt@i915_susp...@forcewake.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/shard-kbl6/igt@i915_susp...@forcewake.html * igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip: - shard-skl: NOTRUN -> [SKIP][21]
Re: [Intel-gfx] [PATCH 6/6] drm/amdgpu: use dma_fence_chain_contained
On Fri, Feb 4, 2022 at 5:04 AM Christian König wrote: > > Instead of manually extracting the fence. > > Signed-off-by: Christian König Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c > index f7d8487799b2..40e06745fae9 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c > @@ -261,10 +261,9 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct > amdgpu_sync *sync, > > dma_resv_for_each_fence(, resv, true, f) { > dma_fence_chain_for_each(f, f) { > - struct dma_fence_chain *chain = to_dma_fence_chain(f); > + struct dma_fence *tmp = dma_fence_chain_contained(f); > > - if (amdgpu_sync_test_fence(adev, mode, owner, chain ? > - chain->fence : f)) { > + if (amdgpu_sync_test_fence(adev, mode, owner, tmp)) { > r = amdgpu_sync_fence(sync, f); > dma_fence_put(f); > if (r) > -- > 2.25.1 >
Re: [Intel-gfx] [PATCH v4 0/5] Add driver for GSC controller
On Thu, Jan 27, 2022 at 01:20:58PM +0200, Alexander Usyskin wrote: > GSC is a graphics system controller, it provides > a chassis controller for graphics discrete cards. > > There are two MEI interfaces in GSC: HECI1 and HECI2. > > This series includes instantiation of the auxiliary devices for HECI2 > and mei-gsc auxiliary device driver that binds to the auxiliary device. > > In v2 the platform device was replaced by the auxiliary device. > v3 is the rebase over drm-tip to make public CI running. > In v4 the not needed debug prints and empty line were removed, > 'select' were replaced by 'depends on' in MEI Kconfig, > the new include file now listed in the MAINTATINERS file. > > Greg KH, please review and ACK the MEI patches after main merge window > closure. > We are pushing all through gfx tree as the auxiliary device belongs there. Reviewed-by: Greg Kroah-Hartman
[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/3] drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration
== Series Details == Series: series starting with [1/3] drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration URL : https://patchwork.freedesktop.org/series/99702/ State : failure == Summary == CI Bug Log - changes from CI_DRM_11189 -> Patchwork_22177 Summary --- **FAILURE** Serious unknown changes coming with Patchwork_22177 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_22177, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/index.html Participating hosts (47 -> 45) -- Additional (2): fi-kbl-soraka bat-adlp-4 Missing(4): fi-ctg-p8600 fi-bsw-cyan fi-bdw-samus fi-hsw-4200u Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_22177: ### IGT changes ### Possible regressions * igt@i915_selftest@live@hangcheck: - fi-bdw-5557u: NOTRUN -> [INCOMPLETE][1] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-bdw-5557u/igt@i915_selftest@l...@hangcheck.html Known issues Here are the changes found in Patchwork_22177 that come from known issues: ### IGT changes ### Issues hit * igt@amdgpu/amd_cs_nop@nop-compute0: - fi-pnv-d510:NOTRUN -> [SKIP][2] ([fdo#109271]) +17 similar issues [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-pnv-d510/igt@amdgpu/amd_cs_...@nop-compute0.html * igt@gem_exec_fence@basic-busy@bcs0: - fi-kbl-soraka: NOTRUN -> [SKIP][3] ([fdo#109271]) +8 similar issues [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-kbl-soraka/igt@gem_exec_fence@basic-b...@bcs0.html * igt@gem_exec_suspend@basic-s3@smem: - fi-skl-6600u: [PASS][4] -> [INCOMPLETE][5] ([i915#4547]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-skl-6600u/igt@gem_exec_suspend@basic...@smem.html [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-skl-6600u/igt@gem_exec_suspend@basic...@smem.html * igt@gem_huc_copy@huc-copy: - fi-kbl-soraka: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#2190]) [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html * igt@gem_lmem_swapping@basic: - bat-adlp-4: NOTRUN -> [SKIP][7] ([i915#4613]) +3 similar issues [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/bat-adlp-4/igt@gem_lmem_swapp...@basic.html * igt@gem_lmem_swapping@parallel-random-engines: - fi-kbl-soraka: NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#4613]) +3 similar issues [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-kbl-soraka/igt@gem_lmem_swapp...@parallel-random-engines.html * igt@gem_tiled_pread_basic: - bat-adlp-4: NOTRUN -> [SKIP][9] ([i915#3282]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/bat-adlp-4/igt@gem_tiled_pread_basic.html * igt@i915_selftest@live@gt_pm: - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][10] ([i915#1886] / [i915#2291]) [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html * igt@i915_selftest@live@hangcheck: - bat-dg1-6: [PASS][11] -> [DMESG-FAIL][12] ([i915#4494] / [i915#4957]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/bat-dg1-6/igt@i915_selftest@l...@hangcheck.html - fi-hsw-4770:[PASS][13] -> [INCOMPLETE][14] ([i915#4785]) [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-hsw-4770/igt@i915_selftest@l...@hangcheck.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-hsw-4770/igt@i915_selftest@l...@hangcheck.html * igt@kms_chamelium@dp-edid-read: - fi-kbl-soraka: NOTRUN -> [SKIP][15] ([fdo#109271] / [fdo#111827]) +8 similar issues [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-kbl-soraka/igt@kms_chamel...@dp-edid-read.html * igt@kms_chamelium@vga-edid-read: - fi-bdw-5557u: NOTRUN -> [SKIP][16] ([fdo#109271] / [fdo#111827]) +8 similar issues [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/fi-bdw-5557u/igt@kms_chamel...@vga-edid-read.html * igt@kms_chamelium@vga-hpd-fast: - bat-adlp-4: NOTRUN -> [SKIP][17] ([fdo#111827]) +8 similar issues [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22177/bat-adlp-4/igt@kms_chamel...@vga-hpd-fast.html * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy: - bat-adlp-4: NOTRUN -> [SKIP][18] ([i915#4103]) +1 similar issue [18]:
[Intel-gfx] [PATCH 2/3] drm/i915: Populate pipe dbuf slices more accurately during readout
From: Ville Syrjälä During readout we cannot assume the planes are actually using the slices they are supposed to use. The BIOS may have misprogrammed things and put the planes onto the wrong dbuf slices. So let's do the readout more carefully to make sure we really know which dbuf slices are actually in use by the pipe at the time. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_pm.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 2eb70ec38f6e..79d61a2935ea 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -6663,6 +6663,7 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv) enum pipe pipe = crtc->pipe; unsigned int mbus_offset; enum plane_id plane_id; + u8 slices; skl_pipe_wm_get_hw_state(crtc, _state->wm.skl.optimal); crtc_state->wm.skl.raw = crtc_state->wm.skl.optimal; @@ -6682,20 +6683,22 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv) skl_ddb_entry_union(_state->ddb[pipe], ddb_uv); } - dbuf_state->slices[pipe] = - skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes, - dbuf_state->joined_mbus); - dbuf_state->weight[pipe] = intel_crtc_ddb_weight(crtc_state); /* * Used for checking overlaps, so we need absolute * offsets instead of MBUS relative offsets. */ - mbus_offset = mbus_ddb_offset(dev_priv, dbuf_state->slices[pipe]); + slices = skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes, +dbuf_state->joined_mbus); + mbus_offset = mbus_ddb_offset(dev_priv, slices); crtc_state->wm.skl.ddb.start = mbus_offset + dbuf_state->ddb[pipe].start; crtc_state->wm.skl.ddb.end = mbus_offset + dbuf_state->ddb[pipe].end; + /* The slices actually used by the planes on the pipe */ + dbuf_state->slices[pipe] = + skl_ddb_dbuf_slice_mask(dev_priv, _state->wm.skl.ddb); + drm_dbg_kms(_priv->drm, "[CRTC:%d:%s] dbuf slices 0x%x, ddb (%d - %d), active pipes 0x%x, mbus joined: %s\n", crtc->base.base.id, crtc->base.name, -- 2.34.1
[Intel-gfx] [PATCH 1/3] drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration
From: Ville Syrjälä Reintroduce the !join_mbus single pipe cases for adlp+. Due to the mbus relative dbuf offsets in PLANE_BUF_CFG we need to know the actual slices used by the pipe when doing readout, even when mbus joining isn't enabled. Accurate readout will be needed to properly sanitize invalid BIOS dbuf configurations. This will also make it much easier to play around with the !join_mbus configs for testin/workaround purposes Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_pm.c | 66 +++-- 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 859be750fb22..2eb70ec38f6e 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -4695,6 +4695,10 @@ static const struct dbuf_slice_conf_entry dg2_allowed_dbufs[] = { }; static const struct dbuf_slice_conf_entry adlp_allowed_dbufs[] = { + /* +* Keep the join_mbus cases first so check_mbus_joined() +* will prefer them over the !join_mbus cases. +*/ { .active_pipes = BIT(PIPE_A), .dbuf_mask = { @@ -4709,6 +4713,20 @@ static const struct dbuf_slice_conf_entry adlp_allowed_dbufs[] = { }, .join_mbus = true, }, + { + .active_pipes = BIT(PIPE_A), + .dbuf_mask = { + [PIPE_A] = BIT(DBUF_S1) | BIT(DBUF_S2), + }, + .join_mbus = false, + }, + { + .active_pipes = BIT(PIPE_B), + .dbuf_mask = { + [PIPE_B] = BIT(DBUF_S3) | BIT(DBUF_S4), + }, + .join_mbus = false, + }, { .active_pipes = BIT(PIPE_A) | BIT(PIPE_B), .dbuf_mask = { @@ -4825,13 +4843,14 @@ static bool adlp_check_mbus_joined(u8 active_pipes) return check_mbus_joined(active_pipes, adlp_allowed_dbufs); } -static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes, +static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus, const struct dbuf_slice_conf_entry *dbuf_slices) { int i; for (i = 0; i < dbuf_slices[i].active_pipes; i++) { - if (dbuf_slices[i].active_pipes == active_pipes) + if (dbuf_slices[i].active_pipes == active_pipes && + dbuf_slices[i].join_mbus == join_mbus) return dbuf_slices[i].dbuf_mask[pipe]; } return 0; @@ -4842,7 +4861,7 @@ static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes, * returns correspondent DBuf slice mask as stated in BSpec for particular * platform. */ -static u8 icl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes) +static u8 icl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus) { /* * FIXME: For ICL this is still a bit unclear as prev BSpec revision @@ -4856,37 +4875,41 @@ static u8 icl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes) * still here - we will need it once those additional constraints * pop up. */ - return compute_dbuf_slices(pipe, active_pipes, icl_allowed_dbufs); + return compute_dbuf_slices(pipe, active_pipes, join_mbus, + icl_allowed_dbufs); } -static u8 tgl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes) +static u8 tgl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus) { - return compute_dbuf_slices(pipe, active_pipes, tgl_allowed_dbufs); + return compute_dbuf_slices(pipe, active_pipes, join_mbus, + tgl_allowed_dbufs); } -static u32 adlp_compute_dbuf_slices(enum pipe pipe, u32 active_pipes) +static u8 adlp_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus) { - return compute_dbuf_slices(pipe, active_pipes, adlp_allowed_dbufs); + return compute_dbuf_slices(pipe, active_pipes, join_mbus, + adlp_allowed_dbufs); } -static u32 dg2_compute_dbuf_slices(enum pipe pipe, u32 active_pipes) +static u8 dg2_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus) { - return compute_dbuf_slices(pipe, active_pipes, dg2_allowed_dbufs); + return compute_dbuf_slices(pipe, active_pipes, join_mbus, + dg2_allowed_dbufs); } -static u8 skl_compute_dbuf_slices(struct intel_crtc *crtc, u8 active_pipes) +static u8 skl_compute_dbuf_slices(struct intel_crtc *crtc, u8 active_pipes, bool join_mbus) { struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); enum pipe pipe = crtc->pipe; if (IS_DG2(dev_priv)) - return dg2_compute_dbuf_slices(pipe, active_pipes); + return dg2_compute_dbuf_slices(pipe, active_pipes, join_mbus); else if
[Intel-gfx] [PATCH 3/3] drm/i915: Workaround broken BIOS DBUF configuration on TGL/RKL
From: Ville Syrjälä On TGL/RKL the BIOS likes to use some kind of bogus DBUF layout that doesn't match what the spec recommends. With a single active pipe that is not going to be a problem, but with multiple pipes active skl_commit_modeset_enables() goes into an infinite loop since it can't figure out any order in which it can commit the pipes without causing DBUF overlaps between the planes. We'd need some kind of extra DBUF defrag stage in between to make the transition possible. But that is clearly way too complex a solution, so in the name of simplicity let's just sanitize the DBUF state by simply turning off all planes when we detect a pipe encroaching on its neighbours' DBUF slices. We only have to disable the primary planes as all other planes should have already been disabled (if they somehow were enabled) by earlier sanitization steps. And for good measure let's also sanitize in case the DBUF allocations of the pipes already seem to overlap each other. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4762 Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 1 + drivers/gpu/drm/i915/intel_pm.c | 68 drivers/gpu/drm/i915/intel_pm.h | 1 + 3 files changed, 70 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index df347329d90e..7f512f9e9e5c 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -10649,6 +10649,7 @@ intel_modeset_setup_hw_state(struct drm_device *dev, vlv_wm_sanitize(dev_priv); } else if (DISPLAY_VER(dev_priv) >= 9) { skl_wm_get_hw_state(dev_priv); + skl_wm_sanitize(dev_priv); } else if (HAS_PCH_SPLIT(dev_priv)) { ilk_wm_get_hw_state(dev_priv); } diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 79d61a2935ea..02084652fe3d 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -6710,6 +6710,74 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv) dbuf_state->enabled_slices = dev_priv->dbuf.enabled_slices; } +static bool skl_dbuf_is_misconfigured(struct drm_i915_private *i915) +{ + const struct intel_dbuf_state *dbuf_state = + to_intel_dbuf_state(i915->dbuf.obj.state); + struct skl_ddb_entry entries[I915_MAX_PIPES] = {}; + struct intel_crtc *crtc; + + for_each_intel_crtc(>drm, crtc) { + const struct intel_crtc_state *crtc_state = + to_intel_crtc_state(crtc->base.state); + + entries[crtc->pipe] = crtc_state->wm.skl.ddb; + } + + for_each_intel_crtc(>drm, crtc) { + const struct intel_crtc_state *crtc_state = + to_intel_crtc_state(crtc->base.state); + u8 slices; + + slices = skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes, +dbuf_state->joined_mbus); + if (dbuf_state->slices[crtc->pipe] & ~slices) + return true; + + if (skl_ddb_allocation_overlaps(_state->wm.skl.ddb, entries, + I915_MAX_PIPES, crtc->pipe)) + return true; + } + + return false; +} + +void skl_wm_sanitize(struct drm_i915_private *i915) +{ + struct intel_crtc *crtc; + + /* +* On TGL/RKL (at least) the BIOS likes to assign the planes +* to the wrong DBUF slices. This will cause an infinite loop +* in skl_commit_modeset_enables() as it can't find a way to +* transition between the old bogus DBUF layout to the new +* proper DBUF layout without DBUF allocation overlaps between +* the planes (which cannot be allowed or else the hardware +* may hang). If we detect a bogus DBUF layout just turn off +* all the planes so that skl_commit_modeset_enables() can +* simply ignore them. +*/ + if (!skl_dbuf_is_misconfigured(i915)) + return; + + drm_dbg_kms(>drm, "BIOS has misprogrammed the DBUF, disabling all planes\n"); + + for_each_intel_crtc(>drm, crtc) { + struct intel_plane *plane = to_intel_plane(crtc->base.primary); + const struct intel_plane_state *plane_state = + to_intel_plane_state(plane->base.state); + struct intel_crtc_state *crtc_state = + to_intel_crtc_state(crtc->base.state); + + if (plane_state->uapi.visible) + intel_plane_disable_noatomic(crtc, plane); + + drm_WARN_ON(>drm, crtc_state->active_planes != 0); + + memset(_state->wm.skl.ddb, 0, sizeof(crtc_state->wm.skl.ddb)); + } +} + static void
[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/6] dma-buf: consolidate dma_fence subclass checking
== Series Details == Series: series starting with [1/6] dma-buf: consolidate dma_fence subclass checking URL : https://patchwork.freedesktop.org/series/99700/ State : failure == Summary == CI Bug Log - changes from CI_DRM_11189 -> Patchwork_22176 Summary --- **FAILURE** Serious unknown changes coming with Patchwork_22176 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_22176, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/index.html Participating hosts (47 -> 44) -- Additional (3): fi-kbl-soraka fi-icl-u2 bat-adlp-4 Missing(6): fi-bxt-dsi fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus fi-skl-6600u Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_22176: ### IGT changes ### Possible regressions * igt@i915_selftest@live@workarounds: - fi-rkl-guc: [PASS][1] -> [INCOMPLETE][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-rkl-guc/igt@i915_selftest@l...@workarounds.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-rkl-guc/igt@i915_selftest@l...@workarounds.html - bat-dg1-6: [PASS][3] -> [INCOMPLETE][4] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/bat-dg1-6/igt@i915_selftest@l...@workarounds.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/bat-dg1-6/igt@i915_selftest@l...@workarounds.html Warnings * igt@debugfs_test@read_all_entries: - fi-apl-guc: [DMESG-WARN][5] ([i915#1610]) -> [DMESG-WARN][6] [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11189/fi-apl-guc/igt@debugfs_test@read_all_entries.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-apl-guc/igt@debugfs_test@read_all_entries.html Known issues Here are the changes found in Patchwork_22176 that come from known issues: ### IGT changes ### Issues hit * igt@amdgpu/amd_cs_nop@fork-gfx0: - fi-icl-u2: NOTRUN -> [SKIP][7] ([fdo#109315]) +17 similar issues [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-icl-u2/igt@amdgpu/amd_cs_...@fork-gfx0.html * igt@amdgpu/amd_cs_nop@nop-compute0: - fi-pnv-d510:NOTRUN -> [SKIP][8] ([fdo#109271]) +17 similar issues [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-pnv-d510/igt@amdgpu/amd_cs_...@nop-compute0.html * igt@gem_exec_fence@basic-busy@bcs0: - fi-kbl-soraka: NOTRUN -> [SKIP][9] ([fdo#109271]) +8 similar issues [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-kbl-soraka/igt@gem_exec_fence@basic-b...@bcs0.html * igt@gem_huc_copy@huc-copy: - fi-kbl-soraka: NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#2190]) [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html - fi-icl-u2: NOTRUN -> [SKIP][11] ([i915#2190]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-icl-u2/igt@gem_huc_c...@huc-copy.html * igt@gem_lmem_swapping@basic: - bat-adlp-4: NOTRUN -> [SKIP][12] ([i915#4613]) +3 similar issues [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/bat-adlp-4/igt@gem_lmem_swapp...@basic.html * igt@gem_lmem_swapping@parallel-random-engines: - fi-icl-u2: NOTRUN -> [SKIP][13] ([i915#4613]) +3 similar issues [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-icl-u2/igt@gem_lmem_swapp...@parallel-random-engines.html - fi-kbl-soraka: NOTRUN -> [SKIP][14] ([fdo#109271] / [i915#4613]) +3 similar issues [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-kbl-soraka/igt@gem_lmem_swapp...@parallel-random-engines.html * igt@gem_tiled_pread_basic: - bat-adlp-4: NOTRUN -> [SKIP][15] ([i915#3282]) [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/bat-adlp-4/igt@gem_tiled_pread_basic.html * igt@i915_selftest@live@gt_pm: - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][16] ([i915#1886] / [i915#2291]) [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html * igt@kms_chamelium@dp-edid-read: - fi-kbl-soraka: NOTRUN -> [SKIP][17] ([fdo#109271] / [fdo#111827]) +8 similar issues [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-kbl-soraka/igt@kms_chamel...@dp-edid-read.html * igt@kms_chamelium@hdmi-hpd-fast: - fi-icl-u2: NOTRUN -> [SKIP][18] ([fdo#111827]) +8 similar issues [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22176/fi-icl-u2/igt@kms_chamel...@hdmi-hpd-fast.html *
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/6] dma-buf: consolidate dma_fence subclass checking
== Series Details == Series: series starting with [1/6] dma-buf: consolidate dma_fence subclass checking URL : https://patchwork.freedesktop.org/series/99700/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.
[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] dma-buf: consolidate dma_fence subclass checking
== Series Details == Series: series starting with [1/6] dma-buf: consolidate dma_fence subclass checking URL : https://patchwork.freedesktop.org/series/99700/ State : warning == Summary == $ dim checkpatch origin/drm-tip 45d3d4ee83aa dma-buf: consolidate dma_fence subclass checking -:117: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" ' != 'Signed-off-by: Christian König ' total: 0 errors, 1 warnings, 0 checks, 84 lines checked 942f0dd6ef1f dma-buf: warn about dma_fence_array container rules v2 -:44: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" ' != 'Signed-off-by: Christian König ' total: 0 errors, 1 warnings, 0 checks, 20 lines checked 3bb498287ec8 dma-buf: Warn about dma_fence_chain container rules v2 -:38: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" ' != 'Signed-off-by: Christian König ' total: 0 errors, 1 warnings, 0 checks, 14 lines checked df4941cd23d4 dma-buf: warn about containers in dma_resv object -:31: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" ' != 'Signed-off-by: Christian König ' total: 0 errors, 1 warnings, 0 checks, 11 lines checked 0dc0287ffbd9 dma-buf: add dma_fence_chain_contained helper -:63: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" ' != 'Signed-off-by: Christian König ' total: 0 errors, 1 warnings, 0 checks, 39 lines checked ecce7db0b390 drm/amdgpu: use dma_fence_chain_contained -:29: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" ' != 'Signed-off-by: Christian König ' total: 0 errors, 1 warnings, 0 checks, 12 lines checked
[Intel-gfx] [PATCH 4/6] dma-buf: warn about containers in dma_resv object
Drivers should not add containers as shared fences to the dma_resv object, instead each fence should be added individually. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Reviewed-by: Thomas Hellström --- drivers/dma-buf/dma-resv.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c index ee31f15d633a..b51416405e86 100644 --- a/drivers/dma-buf/dma-resv.c +++ b/drivers/dma-buf/dma-resv.c @@ -256,6 +256,11 @@ void dma_resv_add_shared_fence(struct dma_resv *obj, struct dma_fence *fence) dma_resv_assert_held(obj); + /* Drivers should not add containers here, instead add each fence +* individually. +*/ + WARN_ON(dma_fence_is_container(fence)); + fobj = dma_resv_shared_list(obj); count = fobj->shared_count; -- 2.25.1
[Intel-gfx] [PATCH 5/6] dma-buf: add dma_fence_chain_contained helper
It's a reoccurring pattern that we need to extract the fence from a dma_fence_chain object. Add a helper for this. Signed-off-by: Christian König --- drivers/dma-buf/dma-fence-chain.c | 6 ++ include/linux/dma-fence-chain.h | 15 +++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-buf/dma-fence-chain.c index 084c6927b735..06f8ef97c6e8 100644 --- a/drivers/dma-buf/dma-fence-chain.c +++ b/drivers/dma-buf/dma-fence-chain.c @@ -148,8 +148,7 @@ static bool dma_fence_chain_enable_signaling(struct dma_fence *fence) dma_fence_get(>base); dma_fence_chain_for_each(fence, >base) { - struct dma_fence_chain *chain = to_dma_fence_chain(fence); - struct dma_fence *f = chain ? chain->fence : fence; + struct dma_fence *f = dma_fence_chain_contained(fence); dma_fence_get(f); if (!dma_fence_add_callback(f, >cb, dma_fence_chain_cb)) { @@ -165,8 +164,7 @@ static bool dma_fence_chain_enable_signaling(struct dma_fence *fence) static bool dma_fence_chain_signaled(struct dma_fence *fence) { dma_fence_chain_for_each(fence, fence) { - struct dma_fence_chain *chain = to_dma_fence_chain(fence); - struct dma_fence *f = chain ? chain->fence : fence; + struct dma_fence *f = dma_fence_chain_contained(fence); if (!dma_fence_is_signaled(f)) { dma_fence_put(fence); diff --git a/include/linux/dma-fence-chain.h b/include/linux/dma-fence-chain.h index ee906b659694..10d51bcdf7b7 100644 --- a/include/linux/dma-fence-chain.h +++ b/include/linux/dma-fence-chain.h @@ -66,6 +66,21 @@ to_dma_fence_chain(struct dma_fence *fence) return container_of(fence, struct dma_fence_chain, base); } +/** + * dma_fence_chain_contained - return the contained fence + * @fence: the fence to test + * + * If the fence is a dma_fence_chain the function returns the fence contained + * inside the chain object, otherwise it returns the fence itself. + */ +static inline struct dma_fence * +dma_fence_chain_contained(struct dma_fence *fence) +{ + struct dma_fence_chain *chain = to_dma_fence_chain(fence); + + return chain ? chain->fence : fence; +} + /** * dma_fence_chain_alloc * -- 2.25.1
[Intel-gfx] [PATCH 2/6] dma-buf: warn about dma_fence_array container rules v2
It's not allowed to nest another dma_fence container into a dma_fence_array or otherwise we can run into recursion. Warn about that when we create a dma_fence_array. v2: fix comment style and typo in the warning pointed out by Thomas Signed-off-by: Christian König Reviewed-by: Daniel Vetter Reviewed-by: Thomas Hellström --- drivers/dma-buf/dma-fence-array.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-array.c index 3e07f961e2f3..cb1bacb5a42b 100644 --- a/drivers/dma-buf/dma-fence-array.c +++ b/drivers/dma-buf/dma-fence-array.c @@ -176,6 +176,20 @@ struct dma_fence_array *dma_fence_array_create(int num_fences, array->base.error = PENDING_ERROR; + /* +* dma_fence_array objects should never contain any other fence +* containers or otherwise we run into recursion and potential kernel +* stack overflow on operations on the dma_fence_array. +* +* The correct way of handling this is to flatten out the array by the +* caller instead. +* +* Enforce this here by checking that we don't create a dma_fence_array +* with any container inside. +*/ + while (num_fences--) + WARN_ON(dma_fence_is_container(fences[num_fences])); + return array; } EXPORT_SYMBOL(dma_fence_array_create); -- 2.25.1
[Intel-gfx] [PATCH 3/6] dma-buf: Warn about dma_fence_chain container rules v2
Chaining of dma_fence_chain objects is only allowed through the prev fence and not through the contained fence. Warn about that when we create a dma_fence_chain. v2: fix comment style Signed-off-by: Christian König Reviewed-by: Daniel Vetter Reviewed-by: Thomas Hellström --- drivers/dma-buf/dma-fence-chain.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-buf/dma-fence-chain.c index 1b4cb3e5cec9..084c6927b735 100644 --- a/drivers/dma-buf/dma-fence-chain.c +++ b/drivers/dma-buf/dma-fence-chain.c @@ -254,5 +254,14 @@ void dma_fence_chain_init(struct dma_fence_chain *chain, dma_fence_init(>base, _fence_chain_ops, >lock, context, seqno); + + /* +* Chaining dma_fence_chain container together is only allowed through +* the prev fence and not through the contained fence. +* +* The correct way of handling this is to flatten out the fence +* structure into a dma_fence_array by the caller instead. +*/ + WARN_ON(dma_fence_is_chain(fence)); } EXPORT_SYMBOL(dma_fence_chain_init); -- 2.25.1
Re: [Intel-gfx] [PATCH v11 5/5] drm/amdgpu: add drm buddy support to amdgpu
Am 04.02.22 um 12:22 schrieb Arunpravin: On 28/01/22 7:48 pm, Matthew Auld wrote: On Thu, 27 Jan 2022 at 14:11, Arunpravin wrote: - Remove drm_mm references and replace with drm buddy functionalities - Add res cursor support for drm buddy v2(Matthew Auld): - replace spinlock with mutex as we call kmem_cache_zalloc (..., GFP_KERNEL) in drm_buddy_alloc() function - lock drm_buddy_block_trim() function as it calls mark_free/mark_split are all globally visible v3(Matthew Auld): - remove trim method error handling as we address the failure case at drm_buddy_block_trim() function v4: - fix warnings reported by kernel test robot v5: - fix merge conflict issue v6: - fix warnings reported by kernel test robot Signed-off-by: Arunpravin --- drivers/gpu/drm/Kconfig | 1 + .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 97 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 259 ++ 4 files changed, 231 insertions(+), 133 deletions(-) -/** - * amdgpu_vram_mgr_virt_start - update virtual start address - * - * @mem: ttm_resource to update - * @node: just allocated node - * - * Calculate a virtual BO start address to easily check if everything is CPU - * accessible. - */ -static void amdgpu_vram_mgr_virt_start(struct ttm_resource *mem, - struct drm_mm_node *node) -{ - unsigned long start; - - start = node->start + node->size; - if (start > mem->num_pages) - start -= mem->num_pages; - else - start = 0; - mem->start = max(mem->start, start); -} - /** * amdgpu_vram_mgr_new - allocate new ranges * @@ -366,13 +357,13 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, const struct ttm_place *place, struct ttm_resource **res) { - unsigned long lpfn, num_nodes, pages_per_node, pages_left, pages; + unsigned long lpfn, pages_per_node, pages_left, pages, n_pages; + u64 vis_usage = 0, mem_bytes, max_bytes, min_page_size; struct amdgpu_vram_mgr *mgr = to_vram_mgr(man); struct amdgpu_device *adev = to_amdgpu_device(mgr); - uint64_t vis_usage = 0, mem_bytes, max_bytes; - struct ttm_range_mgr_node *node; - struct drm_mm *mm = >mm; - enum drm_mm_insert_mode mode; + struct amdgpu_vram_mgr_node *node; + struct drm_buddy *mm = >mm; + struct drm_buddy_block *block; unsigned i; int r; @@ -391,10 +382,9 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, goto error_sub; } - if (place->flags & TTM_PL_FLAG_CONTIGUOUS) { + if (place->flags & TTM_PL_FLAG_CONTIGUOUS) pages_per_node = ~0ul; - num_nodes = 1; - } else { + else { #ifdef CONFIG_TRANSPARENT_HUGEPAGE pages_per_node = HPAGE_PMD_NR; #else @@ -403,11 +393,9 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, #endif pages_per_node = max_t(uint32_t, pages_per_node, tbo->page_alignment); - num_nodes = DIV_ROUND_UP_ULL(PFN_UP(mem_bytes), pages_per_node); } - node = kvmalloc(struct_size(node, mm_nodes, num_nodes), - GFP_KERNEL | __GFP_ZERO); + node = kzalloc(sizeof(*node), GFP_KERNEL); if (!node) { r = -ENOMEM; goto error_sub; @@ -415,9 +403,17 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, ttm_resource_init(tbo, place, >base); - mode = DRM_MM_INSERT_BEST; + INIT_LIST_HEAD(>blocks); + if (place->flags & TTM_PL_FLAG_TOPDOWN) - mode = DRM_MM_INSERT_HIGH; + node->flags |= DRM_BUDDY_TOPDOWN_ALLOCATION; + + if (place->fpfn || lpfn != man->size) + /* Allocate blocks in desired range */ + node->flags |= DRM_BUDDY_RANGE_ALLOCATION; + + min_page_size = mgr->default_page_size; + BUG_ON(min_page_size < mm->chunk_size); pages_left = node->base.num_pages; @@ -425,36 +421,61 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, pages = min(pages_left, 2UL << (30 - PAGE_SHIFT)); i = 0; - spin_lock(>lock); while (pages_left) { - uint32_t alignment = tbo->page_alignment; - if (pages >= pages_per_node) - alignment = pages_per_node; - - r = drm_mm_insert_node_in_range(mm, >mm_nodes[i], pages, - alignment, 0, place->fpfn, - lpfn, mode); - if (unlikely(r)) { - if (pages > pages_per_node) { -
[Intel-gfx] Add warning for nesting dma_fence containers
Hi everyone, Since some operations can then lead to recursive handling nesting dma_fence containers into each other is only allowed under some restrictions. dma_fence_array containers can be attached to dma_fence_chain containers and dma_fence_chain containers by chaining them together. In all other cases the individual fences should be extracted with the appropriate iterators and added to the new containers individually. I've separated the i915 cleanup from this change since it is generally a different functionality and the build bots complained about some issues with those patches. Most patches are already reviewd, but especially the first one still needs an rb tag. Please review and comment, Christian.
Re: [Intel-gfx] Add warning for nesting dma_fence containers
Am 04.02.22 um 11:40 schrieb Thomas Hellström: On Fri, 2022-02-04 at 11:04 +0100, Christian König wrote: Hi everyone, Since some operations can then lead to recursive handling nesting dma_fence containers into each other is only allowed under some restrictions. dma_fence_array containers can be attached to dma_fence_chain containers and dma_fence_chain containers by chaining them together. In all other cases the individual fences should be extracted with the appropriate iterators and added to the new containers individually. I've separated the i915 cleanup from this change since it is generally a different functionality and the build bots complained about some issues with those patches. Most patches are already reviewd, but especially the first one still needs an rb tag. Please review and comment, I see you dropped the i915 patch (probably due to lack of reviews?), Got distracted with other things, but I'll see if I can resurrect that and get it reviewed and merged. I was about to send out the i915 patch when that one here is merged. The CI systems yielded some strange error with that one and I wanted to double check what's that all about. Regards, Christian. Thanks, Thomas Christian.
[Intel-gfx] [PATCH 6/6] drm/amdgpu: use dma_fence_chain_contained
Instead of manually extracting the fence. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c index f7d8487799b2..40e06745fae9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c @@ -261,10 +261,9 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync, dma_resv_for_each_fence(, resv, true, f) { dma_fence_chain_for_each(f, f) { - struct dma_fence_chain *chain = to_dma_fence_chain(f); + struct dma_fence *tmp = dma_fence_chain_contained(f); - if (amdgpu_sync_test_fence(adev, mode, owner, chain ? - chain->fence : f)) { + if (amdgpu_sync_test_fence(adev, mode, owner, tmp)) { r = amdgpu_sync_fence(sync, f); dma_fence_put(f); if (r) -- 2.25.1