[PATCH] drm/i915/dp: Enable AUX based backlight for HDR

2024-03-14 Thread Suraj Kandpal
As of now whenerver HDR is switched on we use the PWM to change the
backlight as opposed to AUX based backlight changes in terms of nits.
This patch writes to the appropriate DPCD registers to enable aux
based backlight using values in nits.

--v2
-Fix max_cll and max_fall assignment [Jani]
-Fix the size sent in drm_dpcd_write [Jani]

--v3
-Content Luminance needs to be sent only for pre-ICL after that
it is directly picked up from hdr metadata [Ville]

--v4
-Add checks for HDR TCON cap bits [Ville]
-Check eotf of hdr_output_data and sets bits base of that value.

--v5
-Fix capability check bits.
-Check colorspace before setting BT2020

Signed-off-by: Suraj Kandpal 
---
 .../drm/i915/display/intel_display_types.h|  3 +
 .../drm/i915/display/intel_dp_aux_backlight.c | 57 ---
 2 files changed, 52 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
b/drivers/gpu/drm/i915/display/intel_display_types.h
index e67cd5b02e84..271bb609106d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -401,6 +401,9 @@ struct intel_panel {
} vesa;
struct {
bool sdr_uses_aux;
+   bool supports_2084_decode;
+   bool supports_2020_gamut;
+   bool supports_segmented_backlight;
} intel;
} edp;
 
diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c 
b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
index 4f58efdc688a..f927e259b540 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -40,11 +40,6 @@
 #include "intel_dp.h"
 #include "intel_dp_aux_backlight.h"
 
-/* TODO:
- * Implement HDR, right now we just implement the bare minimum to bring us 
back into SDR mode so we
- * can make people's backlights work in the mean time
- */
-
 /*
  * DP AUX registers for Intel's proprietary HDR backlight interface. We define
  * them here since we'll likely be the only driver to ever use these.
@@ -158,6 +153,12 @@ intel_dp_aux_supports_hdr_backlight(struct intel_connector 
*connector)
 
panel->backlight.edp.intel.sdr_uses_aux =
tcon_cap[2] & INTEL_EDP_SDR_TCON_BRIGHTNESS_AUX_CAP;
+   panel->backlight.edp.intel.supports_2084_decode =
+   tcon_cap[1] & INTEL_EDP_HDR_TCON_2084_DECODE_CAP;
+   panel->backlight.edp.intel.supports_2020_gamut =
+   tcon_cap[1] & INTEL_EDP_HDR_TCON_2020_GAMUT_CAP;
+   panel->backlight.edp.intel.supports_segmented_backlight =
+   tcon_cap[1] & INTEL_EDP_HDR_TCON_SEGMENTED_BACKLIGHT_CAP;
 
return true;
 }
@@ -206,6 +207,9 @@ intel_dp_aux_hdr_set_aux_backlight(const struct 
drm_connector_state *conn_state,
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
u8 buf[4] = {};
 
+   if (level < 20)
+   level = 20;
+
buf[0] = level & 0xFF;
buf[1] = (level & 0xFF00) >> 8;
 
@@ -221,7 +225,7 @@ intel_dp_aux_hdr_set_backlight(const struct 
drm_connector_state *conn_state, u32
struct intel_connector *connector = 
to_intel_connector(conn_state->connector);
struct intel_panel *panel = >panel;
 
-   if (panel->backlight.edp.intel.sdr_uses_aux) {
+   if (panel->backlight.edp.intel.sdr_uses_aux || 
conn_state->hdr_output_metadata) {
intel_dp_aux_hdr_set_aux_backlight(conn_state, level);
} else {
const u32 pwm_level = intel_backlight_level_to_pwm(connector, 
level);
@@ -251,8 +255,30 @@ intel_dp_aux_hdr_enable_backlight(const struct 
intel_crtc_state *crtc_state,
}
 
ctrl = old_ctrl;
-   if (panel->backlight.edp.intel.sdr_uses_aux) {
+   if (panel->backlight.edp.intel.sdr_uses_aux || 
conn_state->hdr_output_metadata) {
ctrl |= INTEL_EDP_HDR_TCON_BRIGHTNESS_AUX_ENABLE;
+
+   if (conn_state->hdr_output_metadata) {
+   struct hdr_output_metadata *hdr_metadata =
+   conn_state->hdr_output_metadata->data;
+
+   if 
(panel->backlight.edp.intel.supports_segmented_backlight &&
+   hdr_metadata->hdmi_metadata_type1.eotf >=
+   HDMI_EOTF_TRADITIONAL_GAMMA_HDR)
+   ctrl |= 
INTEL_EDP_HDR_TCON_SEGMENTED_BACKLIGHT_ENABLE;
+   if (panel->backlight.edp.intel.supports_2084_decode &&
+   hdr_metadata->hdmi_metadata_type1.eotf ==
+   HDMI_EOTF_SMPTE_ST2084)
+   ctrl |= INTEL_EDP_HDR_TCON_2084_DECODE_ENABLE;
+   if (panel->backlight.edp.intel.supports_2020_gamut &&
+   

[PULL] drm-xe-next-fixes

2024-03-14 Thread Lucas De Marchi

Hi Dave and Sima,

Here are the drm-xe fixes for the 6.9 cycle. Just 3 fixes: one trivial
fix for error path handling, one to avoid pinning all VMAs in
drm_gpuvm_exec_lock() when num_batch_buffer passed to xe_exec is 0 and
the other to allow userspace to free userptr while still having
bindings.

Lucas De Marchi

drm-xe-next-fixes-2024-03-14:
Driver changes:

- Invalidate userptr VMA on page pin fault, allowing userspace
  to free userptr while still having bindings
- Fail early on sysfs file creation error
- Skip VMA pinning on xe_exec with num_batch_buffer == 0

The following changes since commit e62d2e00780b4a465c77d2229837495fcbc480d3:

  drm/xe: Replace 'grouped target' in Makefile with pattern rule (2024-03-04 
08:41:28 -0600)

are available in the Git repository at:

  https://gitlab.freedesktop.org/drm/xe/kernel.git 
tags/drm-xe-next-fixes-2024-03-14

for you to fetch changes up to dd8a07f06dfd946e0eea1a3323d52e7c28a6ed80:

  drm/xe: Skip VMAs pin when requesting signal to the last XE_EXEC (2024-03-14 
14:29:42 -0500)


Driver changes:

- Invalidate userptr VMA on page pin fault, allowing userspace
  to free userptr while still having bindings
- Fail early on sysfs file creation error
- Skip VMA pinning on xe_exec with num_batch_buffer == 0


Himal Prasad Ghimiray (1):
  drm/xe: Return if kobj creation is failed

José Roberto de Souza (1):
  drm/xe: Skip VMAs pin when requesting signal to the last XE_EXEC

Matthew Brost (1):
  drm/xe: Invalidate userptr VMA on page pin fault

 drivers/gpu/drm/xe/xe_exec.c | 41 
 drivers/gpu/drm/xe/xe_gt_pagefault.c |  4 ++--
 drivers/gpu/drm/xe/xe_trace.h|  2 +-
 drivers/gpu/drm/xe/xe_vm.c   | 32 +---
 drivers/gpu/drm/xe/xe_vm_types.h |  7 ++
 drivers/gpu/drm/xe/xe_vram_freq.c|  4 +++-
 6 files changed, 55 insertions(+), 35 deletions(-)


✗ Fi.CI.IGT: failure for drm/xe/display: fix type of intel_uncore_read*() functions

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/xe/display: fix type of intel_uncore_read*() functions
URL   : https://patchwork.freedesktop.org/series/131122/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_14429_full -> Patchwork_131122v1_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_131122v1_full absolutely need 
to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_131122v1_full, please notify your bug team 
(i915-ci-in...@lists.freedesktop.org) to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Participating hosts (9 -> 8)
--

  Missing(1): shard-snb-0 

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_131122v1_full:

### IGT changes ###

 Possible regressions 

  * igt@kms_flip@2x-flip-vs-blocking-wf-vblank@ab-vga1-hdmi-a1:
- shard-snb:  [PASS][1] -> [ABORT][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/shard-snb4/igt@kms_flip@2x-flip-vs-blocking-wf-vbl...@ab-vga1-hdmi-a1.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-snb4/igt@kms_flip@2x-flip-vs-blocking-wf-vbl...@ab-vga1-hdmi-a1.html

  
Known issues


  Here are the changes found in Patchwork_131122v1_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@api_intel_bb@blit-reloc-purge-cache:
- shard-dg2:  NOTRUN -> [SKIP][3] ([i915#8411])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-dg2-8/igt@api_intel...@blit-reloc-purge-cache.html

  * igt@debugfs_test@basic-hwmon:
- shard-mtlp: NOTRUN -> [SKIP][4] ([i915#9318])
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-mtlp-1/igt@debugfs_t...@basic-hwmon.html

  * igt@drm_fdinfo@busy-hang@rcs0:
- shard-mtlp: NOTRUN -> [SKIP][5] ([i915#8414]) +5 other tests skip
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-mtlp-1/igt@drm_fdinfo@busy-h...@rcs0.html

  * igt@drm_fdinfo@most-busy-idle-check-all@vecs1:
- shard-dg2:  NOTRUN -> [SKIP][6] ([i915#8414]) +19 other tests skip
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-dg2-8/igt@drm_fdinfo@most-busy-idle-check-...@vecs1.html

  * igt@drm_fdinfo@virtual-idle:
- shard-rkl:  [PASS][7] -> [FAIL][8] ([i915#7742]) +2 other tests 
fail
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/shard-rkl-5/igt@drm_fdi...@virtual-idle.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-rkl-4/igt@drm_fdi...@virtual-idle.html

  * igt@gem_basic@multigpu-create-close:
- shard-tglu: NOTRUN -> [SKIP][9] ([i915#7697]) +1 other test skip
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-tglu-2/igt@gem_ba...@multigpu-create-close.html

  * igt@gem_busy@semaphore:
- shard-mtlp: NOTRUN -> [SKIP][10] ([i915#3936])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-mtlp-6/igt@gem_b...@semaphore.html

  * igt@gem_close_race@multigpu-basic-threads:
- shard-dg2:  NOTRUN -> [SKIP][11] ([i915#7697])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-dg2-4/igt@gem_close_r...@multigpu-basic-threads.html

  * igt@gem_create@create-ext-set-pat:
- shard-dg1:  NOTRUN -> [SKIP][12] ([i915#8562])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-dg1-15/igt@gem_cre...@create-ext-set-pat.html

  * igt@gem_ctx_exec@basic-nohangcheck:
- shard-tglu: [PASS][13] -> [FAIL][14] ([i915#6268])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/shard-tglu-10/igt@gem_ctx_e...@basic-nohangcheck.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-tglu-6/igt@gem_ctx_e...@basic-nohangcheck.html

  * igt@gem_ctx_persistence@file:
- shard-snb:  NOTRUN -> [SKIP][15] ([i915#1099]) +1 other test skip
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-snb5/igt@gem_ctx_persiste...@file.html

  * igt@gem_ctx_persistence@heartbeat-hang:
- shard-dg2:  NOTRUN -> [SKIP][16] ([i915#8555])
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-dg2-8/igt@gem_ctx_persiste...@heartbeat-hang.html

  * igt@gem_ctx_sseu@mmap-args:
- shard-dg1:  NOTRUN -> [SKIP][17] ([i915#280])
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-dg1-15/igt@gem_ctx_s...@mmap-args.html

  * igt@gem_eio@unwedge-stress:
- shard-snb:  NOTRUN -> [FAIL][18] ([i915#8898])
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/shard-snb1/igt@gem_...@unwedge-stress.html

  * 

Re: [PATCH] drm/i915/guc: Update w/a 14019159160

2024-03-14 Thread Matt Roper
On Tue, Mar 12, 2024 at 04:43:06PM -0700, John Harrison wrote:
> On 3/12/2024 09:24, Matt Roper wrote:
> > On Thu, Mar 07, 2024 at 06:01:29PM -0800, john.c.harri...@intel.com wrote:
> > > From: John Harrison 
> > > 
> > > An existing workaround has been extended in both platforms affected
> > > and implementation complexity.
> > > 
> > > Signed-off-by: John Harrison 
> > > ---
> > >   drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h |  3 ++-
> > >   drivers/gpu/drm/i915/gt/uc/intel_guc.c|  3 ++-
> > >   drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c| 21 ++-
> > >   3 files changed, 15 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h 
> > > b/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
> > > index bebf28e3c4794..3e7060e859794 100644
> > > --- a/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
> > > +++ b/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
> > > @@ -105,7 +105,8 @@ enum {
> > >* Workaround keys:
> > >*/
> > >   enum {
> > > - GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE   = 
> > > 0x9001,
> > > + GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE   = 
> > > 0x9001,   /* Wa_14019159160 */
> > > + GUC_WORKAROUND_KLV_AVOID_GFX_CLEAR_WHILE_ACTIVE = 
> > > 0x9006,   /* Wa_14019159160 */
> > >   };
> > >   #endif /* _ABI_GUC_KLVS_ABI_H */
> > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c 
> > > b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> > > index 0c67d674c94de..4c3dae98656af 100644
> > > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> > > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> > > @@ -296,7 +296,8 @@ static u32 guc_ctl_wa_flags(struct intel_guc *guc)
> > >   /* Wa_16019325821 */
> > >   /* Wa_14019159160 */
> > > - if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)))
> > > + if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)) ||
> >  From what I can see, this workaround is also needed on Xe_LPG+ (12.74)
> Isn't that an Xe platform? Or is 12.74 just ARL?

12.74 / Xe_LPG+ is used in some ARL, which is being officially supported
by i915.


Matt

> 
> John.
> 
> > now.
> > 
> > 
> > Matt
> > 
> > > + IS_DG2(gt->i915))
> > >   flags |= GUC_WA_RCS_CCS_SWITCHOUT;
> > >   /*
> > > 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 5c9908b56616e..00fe3c21a9b1c 100644
> > > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
> > > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
> > > @@ -815,23 +815,23 @@ guc_capture_prep_lists(struct intel_guc *guc)
> > >   return PAGE_ALIGN(total_size);
> > >   }
> > > -/* Wa_14019159160 */
> > > -static u32 guc_waklv_ra_mode(struct intel_guc *guc, u32 offset, u32 
> > > remain)
> > > +static void guc_waklv_enable_simple(struct intel_guc *guc, u32 *offset, 
> > > u32 *remain, u32 klv_id)
> > >   {
> > >   u32 size;
> > >   u32 klv_entry[] = {
> > >   /* 16:16 key/length */
> > > - FIELD_PREP(GUC_KLV_0_KEY, 
> > > GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE) |
> > > + FIELD_PREP(GUC_KLV_0_KEY, klv_id) |
> > >   FIELD_PREP(GUC_KLV_0_LEN, 0),
> > >   /* 0 dwords data */
> > >   };
> > >   size = sizeof(klv_entry);
> > > - GEM_BUG_ON(remain < size);
> > > + GEM_BUG_ON(*remain < size);
> > > - iosys_map_memcpy_to(>ads_map, offset, klv_entry, size);
> > > + iosys_map_memcpy_to(>ads_map, *offset, klv_entry, size);
> > > - return size;
> > > + *offset += size;
> > > + *remain -= size;
> > >   }
> > >   static void guc_waklv_init(struct intel_guc *guc)
> > > @@ -850,10 +850,11 @@ static void guc_waklv_init(struct intel_guc *guc)
> > >   remain = guc_ads_waklv_size(guc);
> > >   /* Wa_14019159160 */
> > > - if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) {
> > > - size = guc_waklv_ra_mode(guc, offset, remain);
> > > - offset += size;
> > > - remain -= size;
> > > + if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)) || 
> > > IS_DG2(gt->i915)) {
> > > + guc_waklv_enable_simple(guc, , ,
> > > + GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE);
> > > + guc_waklv_enable_simple(guc, , ,
> > > + 
> > > GUC_WORKAROUND_KLV_AVOID_GFX_CLEAR_WHILE_ACTIVE);
> > >   }
> > >   size = guc_ads_waklv_size(guc) - remain;
> > > -- 
> > > 2.43.0
> > > 
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


Re: [PATCH v2 6/6] drm/i915: Remove special handling for !RCS_MASK()

2024-03-14 Thread Matt Roper
On Tue, Mar 12, 2024 at 04:51:45PM -0700, Lucas De Marchi wrote:
> With both XEHPSDV and PVC removed (as platforms, most of their code
> remain used by others), there's no need to handle !RCS_MASK() as
> other platforms don't ever have fused-off render. Remove those code
> paths and the special WA flag when initializing GuC.
> 
> Signed-off-by: Lucas De Marchi 
> ---
>  drivers/gpu/drm/i915/gt/intel_engine_cs.c   | 5 ++---
>  drivers/gpu/drm/i915/gt/uc/intel_guc.c  | 4 
>  drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 1 -
>  3 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c 
> b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> index 396f5fe993c3..476651bd0a21 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> @@ -497,9 +497,8 @@ static int intel_engine_setup(struct intel_gt *gt, enum 
> intel_engine_id id,
>   engine->logical_mask = BIT(logical_instance);
>   __sprint_engine_name(engine);
>  
> - if ((engine->class == COMPUTE_CLASS && !RCS_MASK(engine->gt) &&
> -  __ffs(CCS_MASK(engine->gt)) == engine->instance) ||
> -  engine->class == RENDER_CLASS)
> + if ((engine->class == COMPUTE_CLASS || engine->class == RENDER_CLASS) &&
> + __ffs(CCS_MASK(engine->gt) | RCS_MASK(engine->gt)) == 
> engine->instance)
>   engine->flags |= I915_ENGINE_FIRST_RENDER_COMPUTE;

Given that we expect all i915 platforms to have a render engine now, we
could simplify this down to just

if (engine->class == RENDER)
engine->flags |= I915_ENGINE_FIRST_RENDER_COMPUTE;

But either way,

Reviewed-by: Matt Roper 

>  
>   /* features common between engines sharing EUs */
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c 
> b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> index 217277329546..3dd7699f2ad3 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> @@ -320,10 +320,6 @@ static u32 guc_ctl_wa_flags(struct intel_guc *guc)
>   if (IS_DG2_G11(gt->i915))
>   flags |= GUC_WA_CONTEXT_ISOLATION;
>  
> - /* Wa_18020744125 */
> - if (!RCS_MASK(gt))
> - flags |= GUC_WA_RCS_REGS_IN_CCS_REGS_LIST;
> -
>   /*
>* Wa_14018913170: Applicable to all platforms supported by i915 so
>* don't bother testing for all X/Y/Z platforms explicitly.
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h 
> b/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h
> index 14797e80bc92..1ad31a743197 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h
> @@ -101,7 +101,6 @@
>  #define   GUC_WA_RCS_CCS_SWITCHOUT   BIT(16)
>  #define   GUC_WA_HOLD_CCS_SWITCHOUT  BIT(17)
>  #define   GUC_WA_POLLCS  BIT(18)
> -#define   GUC_WA_RCS_REGS_IN_CCS_REGS_LIST   BIT(21)
>  #define   GUC_WA_ENABLE_TSC_CHECK_ON_RC6 BIT(22)
>  
>  #define GUC_CTL_FEATURE  2
> -- 
> 2.43.0
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


Re: [PATCH v2 3/6] drm/i915: Stop inheriting IP_VER(12, 50)

2024-03-14 Thread Matt Roper
On Tue, Mar 12, 2024 at 04:51:42PM -0700, Lucas De Marchi wrote:
> All the platforms that inherit the media/graphics version
> from XE_HPM_FEATURES / XE_HP_FEATURES just override it to another
> version. Just set the version directly in the respective struct
> and remove the versions from the _FEATURES macros. Since that was the
> only use for XE_HPM_FEATURES, remove it completely.
> 
> Signed-off-by: Lucas De Marchi 

Reviewed-by: Matt Roper 

> ---
>  drivers/gpu/drm/i915/i915_pci.c | 12 
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index b318b7c6bf73..8b673fdcf178 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -705,8 +705,6 @@ static const struct intel_device_info adl_p_info = {
>   I915_GTT_PAGE_SIZE_2M
>  
>  #define XE_HP_FEATURES \
> - .__runtime.graphics.ip.ver = 12, \
> - .__runtime.graphics.ip.rel = 50, \
>   XE_HP_PAGE_SIZES, \
>   TGL_CACHELEVEL, \
>   .dma_mask_size = 46, \
> @@ -730,15 +728,12 @@ static const struct intel_device_info adl_p_info = {
>   .__runtime.ppgtt_size = 48, \
>   .__runtime.ppgtt_type = INTEL_PPGTT_FULL
>  
> -#define XE_HPM_FEATURES \
> - .__runtime.media.ip.ver = 12, \
> - .__runtime.media.ip.rel = 50
> -
>  #define DG2_FEATURES \
>   XE_HP_FEATURES, \
> - XE_HPM_FEATURES, \
>   DGFX_FEATURES, \
> + .__runtime.graphics.ip.ver = 12, \
>   .__runtime.graphics.ip.rel = 55, \
> + .__runtime.media.ip.ver = 12, \
>   .__runtime.media.ip.rel = 55, \
>   PLATFORM(INTEL_DG2), \
>   .has_64k_pages = 1, \
> @@ -773,9 +768,10 @@ static const struct intel_device_info ats_m_info = {
>  __maybe_unused
>  static const struct intel_device_info pvc_info = {
>   XE_HPC_FEATURES,
> - XE_HPM_FEATURES,
>   DGFX_FEATURES,
> + .__runtime.graphics.ip.ver = 12,
>   .__runtime.graphics.ip.rel = 60,
> + .__runtime.media.ip.ver = 12,
>   .__runtime.media.ip.rel = 60,
>   PLATFORM(INTEL_PONTEVECCHIO),
>   .has_flat_ccs = 0,
> -- 
> 2.43.0
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


Re: [PATCH v2 2/6] drm/i915: Remove XEHP_FWRANGES()

2024-03-14 Thread Matt Roper
On Tue, Mar 12, 2024 at 04:51:41PM -0700, Lucas De Marchi wrote:
> Now that DG2 is the only user of this forcewake table, remove the macro
> and use FORCEWAKE_RENDER explicitly for range 0xd800 - 0xd87f.
> 
> Suggested-by: Matt Roper 
> Signed-off-by: Lucas De Marchi 

Reviewed-by: Matt Roper 

> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 297 ++--
>  1 file changed, 145 insertions(+), 152 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c 
> b/drivers/gpu/drm/i915/intel_uncore.c
> index 7695bb946fff..b525318dbd53 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1471,159 +1471,152 @@ static const struct intel_forcewake_range 
> __gen12_fw_ranges[] = {
>   0x1d3f00 - 0x1d3fff: VD2 */
>  };
>  
> -/*
> - * Graphics IP version 12.55 brings a slight change to the 0xd800 range,
> - * switching it from the GT domain to the render domain.
> - */
> -#define XEHP_FWRANGES(FW_RANGE_D800) \
> - GEN_FW_RANGE(0x0, 0x1fff, 0), /*
> \
> -   0x0 -  0xaff: reserved
> \
> - 0xb00 - 0x1fff: always on */
> \
> - GEN_FW_RANGE(0x2000, 0x26ff, FORCEWAKE_RENDER), 
> \
> - GEN_FW_RANGE(0x2700, 0x4aff, FORCEWAKE_GT), 
> \
> - GEN_FW_RANGE(0x4b00, 0x51ff, 0), /* 
> \
> - 0x4b00 - 0x4fff: reserved   
> \
> - 0x5000 - 0x51ff: always on */   
> \
> - GEN_FW_RANGE(0x5200, 0x7fff, FORCEWAKE_RENDER), 
> \
> - GEN_FW_RANGE(0x8000, 0x813f, FORCEWAKE_GT), 
> \
> - GEN_FW_RANGE(0x8140, 0x815f, FORCEWAKE_RENDER), 
> \
> - GEN_FW_RANGE(0x8160, 0x81ff, 0), /* 
> \
> - 0x8160 - 0x817f: reserved   
> \
> - 0x8180 - 0x81ff: always on */   
> \
> - GEN_FW_RANGE(0x8200, 0x82ff, FORCEWAKE_GT), 
> \
> - GEN_FW_RANGE(0x8300, 0x84ff, FORCEWAKE_RENDER), 
> \
> - GEN_FW_RANGE(0x8500, 0x8cff, FORCEWAKE_GT), /*  
> \
> - 0x8500 - 0x87ff: gt 
> \
> - 0x8800 - 0x8c7f: reserved   
> \
> - 0x8c80 - 0x8cff: gt (DG2 only) */   
> \
> - GEN_FW_RANGE(0x8d00, 0x8fff, FORCEWAKE_RENDER), /*  
> \
> - 0x8d00 - 0x8dff: render (DG2 only)  
> \
> - 0x8e00 - 0x8fff: reserved */
> \
> - GEN_FW_RANGE(0x9000, 0x94cf, FORCEWAKE_GT), /*  
> \
> - 0x9000 - 0x947f: gt 
> \
> - 0x9480 - 0x94cf: reserved */
> \
> - GEN_FW_RANGE(0x94d0, 0x955f, FORCEWAKE_RENDER), 
> \
> - GEN_FW_RANGE(0x9560, 0x967f, 0), /* 
> \
> - 0x9560 - 0x95ff: always on  
> \
> - 0x9600 - 0x967f: reserved */
> \
> - GEN_FW_RANGE(0x9680, 0x97ff, FORCEWAKE_RENDER), /*  
> \
> - 0x9680 - 0x96ff: render (DG2 only)  
> \
> - 0x9700 - 0x97ff: reserved */
> \
> - GEN_FW_RANGE(0x9800, 0xcfff, FORCEWAKE_GT), /*  
> \
> - 0x9800 - 0xb4ff: gt 
> \
> - 0xb500 - 0xbfff: reserved   
> \
> - 0xc000 - 0xcfff: gt */  
> \
> - GEN_FW_RANGE(0xd000, 0xd7ff, 0),
> \
> - GEN_FW_RANGE(0xd800, 0xd87f, FW_RANGE_D800),\
> - GEN_FW_RANGE(0xd880, 0xdbff, FORCEWAKE_GT), 
> \
> - GEN_FW_RANGE(0xdc00, 0xdcff, FORCEWAKE_RENDER), 
> \
> - GEN_FW_RANGE(0xdd00, 0xde7f, FORCEWAKE_GT), /*  
> \
> - 0xdd00 - 0xddff: gt 
> \
> - 0xde00 - 0xde7f: reserved */
> \
> - GEN_FW_RANGE(0xde80, 0xe8ff, FORCEWAKE_RENDER), /*  
> \
> - 0xde80 - 0xdfff: render 
> \
> - 0xe000 - 0xe0ff: reserved 

✗ Fi.CI.BAT: failure for drm/i915/gt: Report full vm address range (rev2)

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915/gt: Report full vm address range (rev2)
URL   : https://patchwork.freedesktop.org/series/131095/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_14433 -> Patchwork_131095v2


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_131095v2 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_131095v2, please notify your bug team 
(i915-ci-in...@lists.freedesktop.org) 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_131095v2/index.html

Participating hosts (37 -> 34)
--

  Missing(3): bat-dg1-7 fi-glk-j4005 fi-snb-2520m 

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_131095v2:

### IGT changes ###

 Possible regressions 

  * igt@gem_softpin@allocator-basic:
- bat-dg2-14: [PASS][1] -> [FAIL][2] +3 other tests fail
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-dg2-14/igt@gem_soft...@allocator-basic.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-dg2-14/igt@gem_soft...@allocator-basic.html

  * igt@gem_softpin@allocator-basic-reserve:
- bat-atsm-1: [PASS][3] -> [FAIL][4] +2 other tests fail
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-atsm-1/igt@gem_soft...@allocator-basic-reserve.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-atsm-1/igt@gem_soft...@allocator-basic-reserve.html
- bat-dg2-9:  [PASS][5] -> [FAIL][6] +2 other tests fail
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-dg2-9/igt@gem_soft...@allocator-basic-reserve.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-dg2-9/igt@gem_soft...@allocator-basic-reserve.html
- bat-dg2-8:  [PASS][7] -> [FAIL][8] +2 other tests fail
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-dg2-8/igt@gem_soft...@allocator-basic-reserve.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-dg2-8/igt@gem_soft...@allocator-basic-reserve.html

  * igt@i915_selftest@live@gtt:
- bat-atsm-1: [PASS][9] -> [DMESG-FAIL][10]
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-atsm-1/igt@i915_selftest@l...@gtt.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-atsm-1/igt@i915_selftest@l...@gtt.html
- fi-cfl-guc: [PASS][11] -> [DMESG-FAIL][12]
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/fi-cfl-guc/igt@i915_selftest@l...@gtt.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/fi-cfl-guc/igt@i915_selftest@l...@gtt.html
- bat-jsl-3:  [PASS][13] -> [DMESG-FAIL][14]
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-jsl-3/igt@i915_selftest@l...@gtt.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-jsl-3/igt@i915_selftest@l...@gtt.html
- bat-dg2-9:  [PASS][15] -> [DMESG-FAIL][16]
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-dg2-9/igt@i915_selftest@l...@gtt.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-dg2-9/igt@i915_selftest@l...@gtt.html
- fi-kbl-x1275:   [PASS][17] -> [DMESG-FAIL][18]
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/fi-kbl-x1275/igt@i915_selftest@l...@gtt.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/fi-kbl-x1275/igt@i915_selftest@l...@gtt.html
- fi-cfl-8109u:   [PASS][19] -> [DMESG-FAIL][20]
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/fi-cfl-8109u/igt@i915_selftest@l...@gtt.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/fi-cfl-8109u/igt@i915_selftest@l...@gtt.html
- bat-adln-1: [PASS][21] -> [DMESG-FAIL][22]
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-adln-1/igt@i915_selftest@l...@gtt.html
   [22]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-adln-1/igt@i915_selftest@l...@gtt.html
- bat-mtlp-8: [PASS][23] -> [DMESG-FAIL][24]
   [23]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-mtlp-8/igt@i915_selftest@l...@gtt.html
   [24]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-mtlp-8/igt@i915_selftest@l...@gtt.html
- bat-dg2-8:  [PASS][25] -> [DMESG-FAIL][26]
   [25]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-dg2-8/igt@i915_selftest@l...@gtt.html
   [26]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131095v2/bat-dg2-8/igt@i915_selftest@l...@gtt.html
- fi-kbl-guc: [PASS][27] -> [DMESG-FAIL][28]
   [27]: 

✗ Fi.CI.CHECKPATCH: warning for drm/i915/gt: Report full vm address range (rev2)

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915/gt: Report full vm address range (rev2)
URL   : https://patchwork.freedesktop.org/series/131095/
State : warning

== Summary ==

Error: dim checkpatch failed
de74046741ce drm/i915/gt: Report full vm address range
-:20: WARNING:BAD_SIGN_OFF: Duplicate signature
#20: 
Signed-off-by: Andi Shyti 

total: 0 errors, 1 warnings, 0 checks, 10 lines checked




✗ Fi.CI.BAT: failure for drm/i915: cleanup dead code (rev2)

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915: cleanup dead code (rev2)
URL   : https://patchwork.freedesktop.org/series/131049/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_14433 -> Patchwork_131049v2


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_131049v2 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_131049v2, please notify your bug team 
(i915-ci-in...@lists.freedesktop.org) 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_131049v2/index.html

Participating hosts (37 -> 36)
--

  Additional (3): bat-kbl-2 bat-dg2-11 fi-kbl-8809g 
  Missing(4): fi-glk-j4005 bat-jsl-1 fi-bsw-nick fi-snb-2520m 

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_131049v2:

### IGT changes ###

 Possible regressions 

  * igt@i915_selftest@live@hangcheck:
- bat-arls-1: [PASS][1] -> [ABORT][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-arls-1/igt@i915_selftest@l...@hangcheck.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/bat-arls-1/igt@i915_selftest@l...@hangcheck.html

  * igt@kms_addfb_basic@too-high:
- fi-kbl-8809g:   NOTRUN -> [FAIL][3] +2 other tests fail
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/fi-kbl-8809g/igt@kms_addfb_ba...@too-high.html

  * igt@kms_force_connector_basic@force-edid:
- fi-kbl-8809g:   NOTRUN -> [DMESG-FAIL][4]
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/fi-kbl-8809g/igt@kms_force_connector_ba...@force-edid.html

  * igt@kms_force_connector_basic@prune-stale-modes:
- fi-kbl-8809g:   NOTRUN -> [DMESG-WARN][5] +2 other tests dmesg-warn
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/fi-kbl-8809g/igt@kms_force_connector_ba...@prune-stale-modes.html

  
Known issues


  Here are the changes found in Patchwork_131049v2 that come from known issues:

### CI changes ###

 Issues hit 

  * boot:
- fi-cfl-8109u:   [PASS][6] -> [FAIL][7] ([i915#8293])
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/fi-cfl-8109u/boot.html
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/fi-cfl-8109u/boot.html

  

### IGT changes ###

 Issues hit 

  * igt@fbdev@info:
- fi-kbl-8809g:   NOTRUN -> [SKIP][8] ([i915#1849])
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/fi-kbl-8809g/igt@fb...@info.html
- bat-kbl-2:  NOTRUN -> [SKIP][9] ([i915#1849])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/bat-kbl-2/igt@fb...@info.html

  * igt@gem_huc_copy@huc-copy:
- fi-kbl-8809g:   NOTRUN -> [SKIP][10] ([i915#2190])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/fi-kbl-8809g/igt@gem_huc_c...@huc-copy.html

  * igt@gem_lmem_swapping@basic:
- fi-kbl-8809g:   NOTRUN -> [SKIP][11] ([i915#4613]) +3 other tests skip
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/fi-kbl-8809g/igt@gem_lmem_swapp...@basic.html

  * igt@gem_lmem_swapping@parallel-random-engines:
- bat-kbl-2:  NOTRUN -> [SKIP][12] +39 other tests skip
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/bat-kbl-2/igt@gem_lmem_swapp...@parallel-random-engines.html

  * igt@gem_mmap@basic:
- bat-dg2-11: NOTRUN -> [SKIP][13] ([i915#4083])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/bat-dg2-11/igt@gem_m...@basic.html

  * igt@gem_tiled_fence_blits@basic:
- bat-dg2-11: NOTRUN -> [SKIP][14] ([i915#4077]) +2 other tests skip
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/bat-dg2-11/igt@gem_tiled_fence_bl...@basic.html

  * igt@gem_tiled_pread_basic:
- bat-dg2-11: NOTRUN -> [SKIP][15] ([i915#4079]) +1 other test skip
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/bat-dg2-11/igt@gem_tiled_pread_basic.html

  * igt@i915_pm_rps@basic-api:
- bat-dg2-11: NOTRUN -> [SKIP][16] ([i915#6621])
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/bat-dg2-11/igt@i915_pm_...@basic-api.html

  * igt@kms_addfb_basic@addfb25-x-tiled-mismatch-legacy:
- bat-dg2-11: NOTRUN -> [SKIP][17] ([i915#4212]) +7 other tests skip
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131049v2/bat-dg2-11/igt@kms_addfb_ba...@addfb25-x-tiled-mismatch-legacy.html

  * igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- bat-dg2-11: NOTRUN -> [SKIP][18] ([i915#5190])
   [18]: 

✗ Fi.CI.SPARSE: warning for drm/i915: cleanup dead code (rev2)

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915: cleanup dead code (rev2)
URL   : https://patchwork.freedesktop.org/series/131049/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.




✗ Fi.CI.CHECKPATCH: warning for drm/i915: cleanup dead code (rev2)

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915: cleanup dead code (rev2)
URL   : https://patchwork.freedesktop.org/series/131049/
State : warning

== Summary ==

Error: dim checkpatch failed
8c0c8bf0df8f drm/i915: Drop dead code for xehpsdv
-:918: WARNING:LINE_CONTINUATIONS: Avoid unnecessary line continuations
#918: FILE: drivers/gpu/drm/i915/intel_uncore.c:1538:
+   0x13400 - 0x147ff: reserved */  
\

-:928: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#928: FILE: drivers/gpu/drm/i915/intel_uncore.c:1544:
+   GEN_FW_RANGE(0x16e00, 0x21fff, FORCEWAKE_RENDER), /*
\
+   0x16e00 - 0x1: render   
\

-:929: WARNING:LINE_CONTINUATIONS: Avoid unnecessary line continuations
#929: FILE: drivers/gpu/drm/i915/intel_uncore.c:1545:
+   0x2 - 0x21fff: reserved */  
\

total: 0 errors, 3 warnings, 0 checks, 818 lines checked
53e7df647789 drm/i915: Remove XEHP_FWRANGES()
-:174: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#174: FILE: drivers/gpu/drm/i915/intel_uncore.c:1476:
+   GEN_FW_RANGE(0x0, 0x1fff, 0), /*
+ 0x0 -  0xaff: reserved

-:175: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a 
separate line
#175: FILE: drivers/gpu/drm/i915/intel_uncore.c:1477:
+   0xb00 - 0x1fff: always on */

-:179: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#179: FILE: drivers/gpu/drm/i915/intel_uncore.c:1481:
+   GEN_FW_RANGE(0x4b00, 0x51ff, 0), /*
+   0x4b00 - 0x4fff: reserved

-:180: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a 
separate line
#180: FILE: drivers/gpu/drm/i915/intel_uncore.c:1482:
+   0x5000 - 0x51ff: always on */

-:185: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#185: FILE: drivers/gpu/drm/i915/intel_uncore.c:1487:
+   GEN_FW_RANGE(0x8160, 0x81ff, 0), /*
+   0x8160 - 0x817f: reserved

-:186: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a 
separate line
#186: FILE: drivers/gpu/drm/i915/intel_uncore.c:1488:
+   0x8180 - 0x81ff: always on */

-:190: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#190: FILE: drivers/gpu/drm/i915/intel_uncore.c:1492:
+   GEN_FW_RANGE(0x8500, 0x8cff, FORCEWAKE_GT), /*
+   0x8500 - 0x87ff: gt

-:192: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a 
separate line
#192: FILE: drivers/gpu/drm/i915/intel_uncore.c:1494:
+   0x8c80 - 0x8cff: gt (DG2 only) */

-:194: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#194: FILE: drivers/gpu/drm/i915/intel_uncore.c:1496:
+   GEN_FW_RANGE(0x8d00, 0x8fff, FORCEWAKE_RENDER), /*
+   0x8d00 - 0x8dff: render (DG2 only)

-:195: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a 
separate line
#195: FILE: drivers/gpu/drm/i915/intel_uncore.c:1497:
+   0x8e00 - 0x8fff: reserved */

-:197: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#197: FILE: drivers/gpu/drm/i915/intel_uncore.c:1499:
+   GEN_FW_RANGE(0x9000, 0x94cf, FORCEWAKE_GT), /*
+   0x9000 - 0x947f: gt

-:198: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a 
separate line
#198: FILE: drivers/gpu/drm/i915/intel_uncore.c:1500:
+   0x9480 - 0x94cf: reserved */

-:201: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#201: FILE: drivers/gpu/drm/i915/intel_uncore.c:1503:
+   GEN_FW_RANGE(0x9560, 0x967f, 0), /*
+   0x9560 - 0x95ff: always on

-:202: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a 
separate line
#202: FILE: drivers/gpu/drm/i915/intel_uncore.c:1504:
+   0x9600 - 0x967f: reserved */

-:204: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#204: FILE: drivers/gpu/drm/i915/intel_uncore.c:1506:
+   GEN_FW_RANGE(0x9680, 0x97ff, FORCEWAKE_RENDER), /*
+   0x9680 - 0x96ff: render

-:205: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a 
separate line
#205: FILE: drivers/gpu/drm/i915/intel_uncore.c:1507:
+   0x9700 - 0x97ff: reserved */

-:207: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#207: FILE: drivers/gpu/drm/i915/intel_uncore.c:1509:
+   GEN_FW_RANGE(0x9800, 0xcfff, FORCEWAKE_GT), /*
+   0x9800 - 0xb4ff: gt

-:209: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a 
separate line
#209: FILE: drivers/gpu/drm/i915/intel_uncore.c:1511:
+   0xc000 - 0xcfff: gt */

-:215: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
#215: FILE: drivers/gpu/drm/i915/intel_uncore.c:1517:
+   GEN_FW_RANGE(0xdd00, 0xde7f, FORCEWAKE_GT), /*
+   0xdd00 - 0xddff: gt

-:216: 

✗ Fi.CI.BAT: failure for series starting with [01/11] drm/xe: Introduce xe_pm_runtime_get_noresume for inner callers

2024-03-14 Thread Patchwork
== Series Details ==

Series: series starting with [01/11] drm/xe: Introduce 
xe_pm_runtime_get_noresume for inner callers
URL   : https://patchwork.freedesktop.org/series/131141/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_14433 -> Patchwork_131141v1


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_131141v1 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_131141v1, please notify your bug team 
(i915-ci-in...@lists.freedesktop.org) 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_131141v1/index.html

Participating hosts (37 -> 36)
--

  Additional (1): fi-kbl-8809g 
  Missing(2): bat-dg1-7 fi-snb-2520m 

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_131141v1:

### IGT changes ###

 Possible regressions 

  * igt@gem_busy@busy@all-engines:
- fi-kbl-8809g:   NOTRUN -> [ABORT][1]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/fi-kbl-8809g/igt@gem_busy@b...@all-engines.html

  * igt@gem_close_race@basic-process:
- bat-dg2-8:  [PASS][2] -> [INCOMPLETE][3]
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-dg2-8/igt@gem_close_r...@basic-process.html
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/bat-dg2-8/igt@gem_close_r...@basic-process.html
- bat-mtlp-6: [PASS][4] -> [DMESG-WARN][5]
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-mtlp-6/igt@gem_close_r...@basic-process.html
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/bat-mtlp-6/igt@gem_close_r...@basic-process.html

  * igt@i915_module_load@load:
- bat-atsm-1: [PASS][6] -> [INCOMPLETE][7]
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-atsm-1/igt@i915_module_l...@load.html
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/bat-atsm-1/igt@i915_module_l...@load.html
- bat-dg2-9:  [PASS][8] -> [INCOMPLETE][9]
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-dg2-9/igt@i915_module_l...@load.html
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/bat-dg2-9/igt@i915_module_l...@load.html
- fi-kbl-guc: [PASS][10] -> [ABORT][11]
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/fi-kbl-guc/igt@i915_module_l...@load.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/fi-kbl-guc/igt@i915_module_l...@load.html

  * igt@kms_busy@basic@flip:
- fi-pnv-d510:[PASS][12] -> [ABORT][13]
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/fi-pnv-d510/igt@kms_busy@ba...@flip.html
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/fi-pnv-d510/igt@kms_busy@ba...@flip.html

  * igt@kms_busy@basic@modeset:
- bat-adln-1: [PASS][14] -> [INCOMPLETE][15]
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-adln-1/igt@kms_busy@ba...@modeset.html
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/bat-adln-1/igt@kms_busy@ba...@modeset.html
- bat-rplp-1: [PASS][16] -> [INCOMPLETE][17]
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-rplp-1/igt@kms_busy@ba...@modeset.html
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/bat-rplp-1/igt@kms_busy@ba...@modeset.html
- fi-ivb-3770:[PASS][18] -> [INCOMPLETE][19]
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/fi-ivb-3770/igt@kms_busy@ba...@modeset.html
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/fi-ivb-3770/igt@kms_busy@ba...@modeset.html
- bat-adls-6: [PASS][20] -> [ABORT][21]
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-adls-6/igt@kms_busy@ba...@modeset.html
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/bat-adls-6/igt@kms_busy@ba...@modeset.html
- fi-ilk-650: [PASS][22] -> [INCOMPLETE][23]
   [22]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/fi-ilk-650/igt@kms_busy@ba...@modeset.html
   [23]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/fi-ilk-650/igt@kms_busy@ba...@modeset.html
- bat-arls-1: [PASS][24] -> [ABORT][25]
   [24]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-arls-1/igt@kms_busy@ba...@modeset.html
   [25]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131141v1/bat-arls-1/igt@kms_busy@ba...@modeset.html

  * igt@kms_flip@basic-flip-vs-dpms@b-dp2:
- bat-rpls-3: [PASS][26] -> [ABORT][27]
   [26]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-rpls-3/igt@kms_flip@basic-flip-vs-d...@b-dp2.html
   [27]: 

✗ Fi.CI.SPARSE: warning for series starting with [01/11] drm/xe: Introduce xe_pm_runtime_get_noresume for inner callers

2024-03-14 Thread Patchwork
== Series Details ==

Series: series starting with [01/11] drm/xe: Introduce 
xe_pm_runtime_get_noresume for inner callers
URL   : https://patchwork.freedesktop.org/series/131141/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
-
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:179:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:181:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:181:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:185:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:187:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:191:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:194:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:194:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:236:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:238:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:166:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:168:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:169:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:170:9: warning: unreplaced 
symbol 'val'
+./include/asm-generic/bitops/generic-non-atomic.h:172:19: warning: unreplaced 
symbol 'val'
+./include/asm-generic/bitops/generic-non-atomic.h:172:25: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:172:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:28:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:30:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:31:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:33:10: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:33:16: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:37:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:39:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:40:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:42:10: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:42:16: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:55:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:57:9: warning: unreplaced 
symbol 'mask'

✓ Fi.CI.IGT: success for Enable LNL display (rev2)

2024-03-14 Thread Patchwork
== Series Details ==

Series: Enable LNL display (rev2)
URL   : https://patchwork.freedesktop.org/series/130689/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_14421_full -> Patchwork_130689v2_full


Summary
---

  **SUCCESS**

  No regressions found.

  

Participating hosts (8 -> 8)
--

  No changes in participating hosts

New tests
-

  New tests have been introduced between CI_DRM_14421_full and 
Patchwork_130689v2_full:

### New IGT tests (1) ###

  * igt@kms_cursor_crc@cursor-random-64x64@pipe-d-dp-4:
- Statuses : 1 pass(s)
- Exec time: [4.40] s

  

Known issues


  Here are the changes found in Patchwork_130689v2_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@api_intel_bb@crc32:
- shard-dg1:  NOTRUN -> [SKIP][1] ([i915#6230])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg1-16/igt@api_intel...@crc32.html

  * igt@drm_fdinfo@busy-check-all@bcs0:
- shard-dg1:  NOTRUN -> [SKIP][2] ([i915#8414]) +11 other tests skip
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg1-15/igt@drm_fdinfo@busy-check-...@bcs0.html

  * igt@drm_fdinfo@most-busy-idle-check-all@rcs0:
- shard-rkl:  [PASS][3] -> [FAIL][4] ([i915#7742])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14421/shard-rkl-5/igt@drm_fdinfo@most-busy-idle-check-...@rcs0.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-rkl-7/igt@drm_fdinfo@most-busy-idle-check-...@rcs0.html

  * igt@drm_fdinfo@virtual-busy-all:
- shard-dg2:  NOTRUN -> [SKIP][5] ([i915#8414])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg2-8/igt@drm_fdi...@virtual-busy-all.html

  * igt@gem_busy@semaphore:
- shard-dg1:  NOTRUN -> [SKIP][6] ([i915#3936])
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg1-17/igt@gem_b...@semaphore.html

  * igt@gem_ccs@block-multicopy-inplace:
- shard-dg1:  NOTRUN -> [SKIP][7] ([i915#3555] / [i915#9323]) +1 
other test skip
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg1-15/igt@gem_...@block-multicopy-inplace.html

  * igt@gem_ccs@suspend-resume:
- shard-rkl:  NOTRUN -> [SKIP][8] ([i915#9323])
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-rkl-5/igt@gem_...@suspend-resume.html

  * igt@gem_ctx_persistence@engines-hostile-preempt:
- shard-snb:  NOTRUN -> [SKIP][9] ([i915#1099])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-snb5/igt@gem_ctx_persiste...@engines-hostile-preempt.html

  * igt@gem_ctx_sseu@invalid-sseu:
- shard-rkl:  NOTRUN -> [SKIP][10] ([i915#280])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-rkl-5/igt@gem_ctx_s...@invalid-sseu.html

  * igt@gem_eio@kms:
- shard-dg1:  NOTRUN -> [FAIL][11] ([i915#5784])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg1-15/igt@gem_...@kms.html

  * igt@gem_eio@reset-stress:
- shard-dg2:  [PASS][12] -> [FAIL][13] ([i915#5784])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14421/shard-dg2-5/igt@gem_...@reset-stress.html
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg2-5/igt@gem_...@reset-stress.html

  * igt@gem_exec_balancer@bonded-sync:
- shard-dg1:  NOTRUN -> [SKIP][14] ([i915#4771])
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg1-12/igt@gem_exec_balan...@bonded-sync.html

  * igt@gem_exec_balancer@bonded-true-hang:
- shard-dg2:  NOTRUN -> [SKIP][15] ([i915#4812])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg2-8/igt@gem_exec_balan...@bonded-true-hang.html

  * igt@gem_exec_capture@capture-recoverable:
- shard-rkl:  NOTRUN -> [SKIP][16] ([i915#6344])
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-rkl-5/igt@gem_exec_capt...@capture-recoverable.html

  * igt@gem_exec_capture@many-4k-incremental:
- shard-tglu: NOTRUN -> [FAIL][17] ([i915#9606])
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-tglu-6/igt@gem_exec_capt...@many-4k-incremental.html

  * igt@gem_exec_capture@many-4k-zero:
- shard-dg1:  NOTRUN -> [FAIL][18] ([i915#9606]) +1 other test fail
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-dg1-19/igt@gem_exec_capt...@many-4k-zero.html
- shard-glk:  NOTRUN -> [FAIL][19] ([i915#9606])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130689v2/shard-glk4/igt@gem_exec_capt...@many-4k-zero.html

  * igt@gem_exec_fair@basic-deadline:
- shard-dg1:  NOTRUN -> [SKIP][20] ([i915#3539] / [i915#4852]) +5 
other tests skip
   [20]: 

✓ Fi.CI.BAT: success for Disable automatic load CCS load balancing (rev10)

2024-03-14 Thread Patchwork
== Series Details ==

Series: Disable automatic load CCS load balancing (rev10)
URL   : https://patchwork.freedesktop.org/series/129951/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_14433 -> Patchwork_129951v10


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129951v10/index.html

Participating hosts (37 -> 35)
--

  Additional (1): bat-kbl-2 
  Missing(3): bat-mtlp-8 fi-glk-j4005 fi-snb-2520m 

Known issues


  Here are the changes found in Patchwork_129951v10 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@fbdev@info:
- bat-kbl-2:  NOTRUN -> [SKIP][1] ([i915#1849])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129951v10/bat-kbl-2/igt@fb...@info.html

  * igt@gem_lmem_swapping@basic@lmem0:
- bat-dg2-8:  [PASS][2] -> [FAIL][3] ([i915#10378])
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-dg2-8/igt@gem_lmem_swapping@ba...@lmem0.html
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129951v10/bat-dg2-8/igt@gem_lmem_swapping@ba...@lmem0.html

  * igt@gem_lmem_swapping@parallel-random-engines:
- bat-kbl-2:  NOTRUN -> [SKIP][4] +39 other tests skip
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129951v10/bat-kbl-2/igt@gem_lmem_swapp...@parallel-random-engines.html

  * igt@i915_selftest@live@evict:
- bat-atsm-1: [PASS][5] -> [ABORT][6] ([i915#10366])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-atsm-1/igt@i915_selftest@l...@evict.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129951v10/bat-atsm-1/igt@i915_selftest@l...@evict.html

  * igt@i915_selftest@live@gt_engines:
- bat-adls-6: [PASS][7] -> [TIMEOUT][8] ([i915#10026])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14433/bat-adls-6/igt@i915_selftest@live@gt_engines.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129951v10/bat-adls-6/igt@i915_selftest@live@gt_engines.html

  
  [i915#10026]: https://gitlab.freedesktop.org/drm/intel/issues/10026
  [i915#10366]: https://gitlab.freedesktop.org/drm/intel/issues/10366
  [i915#10378]: https://gitlab.freedesktop.org/drm/intel/issues/10378
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849


Build changes
-

  * Linux: CI_DRM_14433 -> Patchwork_129951v10

  CI-20190529: 20190529
  CI_DRM_14433: f5246a1cf97dd1b9bf955148b0ca2cbf0b18d31e @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7765: 67615901aedcc79d8d1523c6484c67c11ba0e316 @ 
https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_129951v10: f5246a1cf97dd1b9bf955148b0ca2cbf0b18d31e @ 
git://anongit.freedesktop.org/gfx-ci/linux


### Linux commits

ce6fd5803ee0 drm/i915/gt: Enable only one CCS for compute workload
55dcb4a1cfb0 drm/i915/gt: Do not generate the command streamer for all the CCS
03bd96097699 drm/i915/gt: Disable HW load balancing for CCS

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129951v10/index.html


Recall: ✗ Fi.CI.IGT: failure for drm/i915/dp: Increase idle pattern wait timeout to 2ms (rev4)

2024-03-14 Thread Illipilli, TejasreeX
Illipilli, TejasreeX would like to recall the message, "✗ Fi.CI.IGT: failure 
for drm/i915/dp: Increase idle pattern wait timeout to 2ms (rev4)".

Re: [FYI][PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-03-14 Thread Steven Rostedt
On Thu, 14 Mar 2024 09:57:57 -0700
Alison Schofield  wrote:

> On Fri, Feb 23, 2024 at 12:56:34PM -0500, Steven Rostedt wrote:
> > From: "Steven Rostedt (Google)" 
> > 
> > [
> >This is a treewide change. I will likely re-create this patch again in
> >the second week of the merge window of v6.9 and submit it then. Hoping
> >to keep the conflicts that it will cause to a minimum.
> > ]

Note, change of plans. I plan on sending this in the next merge window, as
this merge window I have this patch:

  
https://lore.kernel.org/linux-trace-kernel/20240312113002.00031...@gandalf.local.home/

That will warn if the source string of __string() is different than the
source string of __assign_str(). I want to make sure they are identical
before just dropping one of them.


> 
> > diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h
> > index bdf117a33744..07ba4e033347 100644
> > --- a/drivers/cxl/core/trace.h
> > +++ b/drivers/cxl/core/trace.h  
> 
> snip to poison
> 
> > @@ -668,8 +668,8 @@ TRACE_EVENT(cxl_poison,
> > ),
> >  
> > TP_fast_assign(
> > -   __assign_str(memdev, dev_name(>dev));
> > -   __assign_str(host, dev_name(cxlmd->dev.parent));
> > +   __assign_str(memdev);
> > +   __assign_str(host);  
> 
> I think I get that the above changes work because the TP_STRUCT__entry for
> these did:
>   __string(memdev, dev_name(>dev))
>   __string(host, dev_name(cxlmd->dev.parent))

That's the point. They have to be identical or you will likely bug.

The __string(name, src) is used to find the string length of src which
allocates the necessary length on the ring buffer. The __assign_str(name, src)
will copy src into the ring buffer.

Similar to:

len = strlen(src);
buf = malloc(len);
strcpy(buf, str);

Where __string() is strlen() and __assign_str() is strcpy(). It doesn't
make sense to use two different strings, and if you did, it would likely be
a bug.

But the magic behind __string() does much more than just get the length of
the string, and it could easily save the pointer to the string (along with
its length) and have it copy that in the __assign_str() call, making the
src parameter of __assign_str() useless.

> 
> > __entry->serial = cxlmd->cxlds->serial;
> > __entry->overflow_ts = cxl_poison_overflow(flags, overflow_ts);
> > __entry->dpa = cxl_poison_record_dpa(record);
> > @@ -678,12 +678,12 @@ TRACE_EVENT(cxl_poison,
> > __entry->trace_type = trace_type;
> > __entry->flags = flags;
> > if (region) {
> > -   __assign_str(region, dev_name(>dev));
> > +   __assign_str(region);
> > memcpy(__entry->uuid, >params.uuid, 16);
> > __entry->hpa = cxl_trace_hpa(region, cxlmd,
> >  __entry->dpa);
> > } else {
> > -   __assign_str(region, "");
> > +   __assign_str(region);
> > memset(__entry->uuid, 0, 16);
> > __entry->hpa = ULLONG_MAX;  
> 
> For the above 2, there was no helper in TP_STRUCT__entry. A recently
> posted patch is fixing that up to be __string(region, NULL) See [1],
> with the actual assignment still happening in TP_fast_assign.

__string(region, NULL) doesn't make sense. It's like:

len = strlen(NULL);
buf = malloc(len);
strcpy(buf, NULL);

??

I'll reply to that email.

-- Steve

> 
> Does that assign logic need to move to the TP_STRUCT__entry definition
> when you merge these changes? I'm not clear how much logic is able to be
> included, ie like 'C' style code in the TP_STRUCT__entry.
> 
> [1]
> https://lore.kernel.org/linux-cxl/20240314044301.2108650-1-alison.schofi...@intel.com/


✗ Fi.CI.SPARSE: warning for Disable automatic load CCS load balancing (rev10)

2024-03-14 Thread Patchwork
== Series Details ==

Series: Disable automatic load CCS load balancing (rev10)
URL   : https://patchwork.freedesktop.org/series/129951/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:179:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:181:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:181:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:185:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:187:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:191:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:194:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:194:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:236:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:238:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:166:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:168:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:169:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:170:9: warning: unreplaced 
symbol 'val'
+./include/asm-generic/bitops/generic-non-atomic.h:172:19: warning: unreplaced 
symbol 'val'
+./include/asm-generic/bitops/generic-non-atomic.h:172:25: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:172:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:28:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:30:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:31:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:33:10: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:33:16: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:37:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:39:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:40:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:42:10: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:42:16: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:55:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:57:9: warning: unreplaced 
symbol 'mask'

✗ Fi.CI.CHECKPATCH: warning for Disable automatic load CCS load balancing (rev10)

2024-03-14 Thread Patchwork
== Series Details ==

Series: Disable automatic load CCS load balancing (rev10)
URL   : https://patchwork.freedesktop.org/series/129951/
State : warning

== Summary ==

Error: dim checkpatch failed
67800c9b3ada drm/i915/gt: Disable HW load balancing for CCS
6b604822e329 drm/i915/gt: Do not generate the command streamer for all the CCS
a7377b24b2ec drm/i915/gt: Enable only one CCS for compute workload
Traceback (most recent call last):
  File "scripts/spdxcheck.py", line 6, in 
from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
Traceback (most recent call last):
  File "scripts/spdxcheck.py", line 6, in 
from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
-:35: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does 
MAINTAINERS need updating?
#35: 
new file mode 100644

-:109: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'cslice' may be better as 
'(cslice)' to avoid precedence issues
#109: FILE: drivers/gpu/drm/i915/gt/intel_gt_regs.h:1486:
+#define   XEHP_CCS_MODE_CSLICE(cslice, ccs)(ccs << (cslice * 
XEHP_CCS_MODE_CSLICE_WIDTH))

-:109: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'ccs' may be better as 
'(ccs)' to avoid precedence issues
#109: FILE: drivers/gpu/drm/i915/gt/intel_gt_regs.h:1486:
+#define   XEHP_CCS_MODE_CSLICE(cslice, ccs)(ccs << (cslice * 
XEHP_CCS_MODE_CSLICE_WIDTH))

total: 0 errors, 1 warnings, 2 checks, 89 lines checked




Re: [PATCH 03/11] drm/i915/display: convert inner wakeref get towards get_if_in_use

2024-03-14 Thread Francois Dugast
On Thu, Mar 14, 2024 at 10:10:13AM -0400, Rodrigo Vivi wrote:
> This patch brings no functional change. Since at this point of
> the code we are already asserting a wakeref was held, it means
> that we are with runtime_pm 'in_use' and in practical terms we
> are only bumping the pm_runtime usage counter and moving on.
> 
> However, xe driver has a lockdep annotation that warned us that
> if a sync resume was actually called at this point, we could have
> a deadlock because we are inside the power_domains->lock locked
> area and the resume would call the irq_reset, which would also
> try to get the power_domains->lock.
> 
> For this reason, let's convert this call to a safer option and
> calm lockdep on.
> 
> v2: use _noresume variant instead of get_in_use (Ville, Imre)
> 
> Cc: Ville Syrjälä 
> Acked-by: Imre Deak 
> Cc: Matthew Auld 
> Signed-off-by: Rodrigo Vivi 

Reviewed-by: Francois Dugast 

> ---
>  drivers/gpu/drm/i915/display/intel_display_power.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c 
> b/drivers/gpu/drm/i915/display/intel_display_power.c
> index 6fd4fa52253a..048943d0a881 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_power.c
> @@ -646,7 +646,7 @@ release_async_put_domains(struct i915_power_domains 
> *power_domains,
>* power well disabling.
>*/
>   assert_rpm_raw_wakeref_held(rpm);
> - wakeref = intel_runtime_pm_get(rpm);
> + wakeref = intel_runtime_pm_get_noresume(rpm);
>  
>   for_each_power_domain(domain, mask) {
>   /* Clear before put, so put's sanity check is happy. */
> -- 
> 2.44.0
> 


Re: [PATCH 02/11] drm/xe: Introduce intel_runtime_pm_get_noresume at compat-i915-headers for display

2024-03-14 Thread Francois Dugast
Hi,

On Thu, Mar 14, 2024 at 10:10:12AM -0400, Rodrigo Vivi wrote:
> The i915-display will start using the intel_runtime_pm_noresume.
> So we need to add the compat header before it.

Or "So we need to add it to the compat header before"?

> 
> Signed-off-by: Rodrigo Vivi 
> ---
>  drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h 
> b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
> index fef969112b1d..ecaaef3df4bf 100644
> --- a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
> +++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
> @@ -176,6 +176,14 @@ static inline intel_wakeref_t 
> intel_runtime_pm_get_if_in_use(struct xe_runtime_p
>   return xe_pm_runtime_get_if_in_use(xe);
>  }
>  
> +static inline intel_wakeref_t intel_runtime_pm_get_noresume(struct 
> xe_runtime_pm *pm)
> +{
> + struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
> +
> + xe_pm_runtime_get_noresume(xe);
> + return true;
> +}
> +

LGTM but wondering if this and the next patch in the series should be
combined in order to have at least one use of this new definition.

Either way:
Reviewed-by: Francois Dugast 

Francois

>  static inline void intel_runtime_pm_put_unchecked(struct xe_runtime_pm *pm)
>  {
>   struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
> -- 
> 2.44.0
> 


Re: [FYI][PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-03-14 Thread Alison Schofield
On Fri, Feb 23, 2024 at 12:56:34PM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" 
> 
> [
>This is a treewide change. I will likely re-create this patch again in
>the second week of the merge window of v6.9 and submit it then. Hoping
>to keep the conflicts that it will cause to a minimum.
> ]
> 
> With the rework of how the __string() handles dynamic strings where it
> saves off the source string in field in the helper structure[1], the
> assignment of that value to the trace event field is stored in the helper
> value and does not need to be passed in again.
> 
> This means that with:
> 
>   __string(field, mystring)
> 
> Which use to be assigned with __assign_str(field, mystring), no longer
> needs the second parameter and it is unused. With this, __assign_str()
> will now only get a single parameter.
> 
> There's over 700 users of __assign_str() and because coccinelle does not
> handle the TRACE_EVENT() macro I ended up using the following sed script:
> 
>   git grep -l __assign_str | while read a ; do
>   sed -e 's/\(__assign_str([^,]*[^ ,]\) *,[^;]*/\1)/' $a > /tmp/test-file;
>   mv /tmp/test-file $a;
>   done
> 
> I then searched for __assign_str() that did not end with ';' as those
> were multi line assignments that the sed script above would fail to catch.
> 
> Note, the same updates will need to be done for:
> 
>   __assign_str_len()
>   __assign_rel_str()
>   __assign_rel_str_len()
>   __assign_bitmask()
>   __assign_rel_bitmask()
>   __assign_cpumask()
>   __assign_rel_cpumask()
> 
> [1] 
> https://lore.kernel.org/linux-trace-kernel/2024011442.634192...@goodmis.org/
> 
> Signed-off-by: Steven Rostedt (Google) 
> ---
>  arch/arm64/kernel/trace-events-emulation.h|   2 +-
>  arch/powerpc/include/asm/trace.h  |   4 +-
>  arch/x86/kvm/trace.h  |   2 +-
>  drivers/base/regmap/trace.h   |  18 +--
>  drivers/base/trace.h  |   2 +-
>  drivers/block/rnbd/rnbd-srv-trace.h   |  12 +-
>  drivers/cxl/core/trace.h  |  24 ++--

snip to CXL


> diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h
> index bdf117a33744..07ba4e033347 100644
> --- a/drivers/cxl/core/trace.h
> +++ b/drivers/cxl/core/trace.h

snip to poison

> @@ -668,8 +668,8 @@ TRACE_EVENT(cxl_poison,
>   ),
>  
>   TP_fast_assign(
> - __assign_str(memdev, dev_name(>dev));
> - __assign_str(host, dev_name(cxlmd->dev.parent));
> + __assign_str(memdev);
> + __assign_str(host);

I think I get that the above changes work because the TP_STRUCT__entry for
these did:
__string(memdev, dev_name(>dev))
__string(host, dev_name(cxlmd->dev.parent))

>   __entry->serial = cxlmd->cxlds->serial;
>   __entry->overflow_ts = cxl_poison_overflow(flags, overflow_ts);
>   __entry->dpa = cxl_poison_record_dpa(record);
> @@ -678,12 +678,12 @@ TRACE_EVENT(cxl_poison,
>   __entry->trace_type = trace_type;
>   __entry->flags = flags;
>   if (region) {
> - __assign_str(region, dev_name(>dev));
> + __assign_str(region);
>   memcpy(__entry->uuid, >params.uuid, 16);
>   __entry->hpa = cxl_trace_hpa(region, cxlmd,
>__entry->dpa);
>   } else {
> - __assign_str(region, "");
> + __assign_str(region);
>   memset(__entry->uuid, 0, 16);
>   __entry->hpa = ULLONG_MAX;

For the above 2, there was no helper in TP_STRUCT__entry. A recently
posted patch is fixing that up to be __string(region, NULL) See [1],
with the actual assignment still happening in TP_fast_assign.

Does that assign logic need to move to the TP_STRUCT__entry definition
when you merge these changes? I'm not clear how much logic is able to be
included, ie like 'C' style code in the TP_STRUCT__entry.

[1]
https://lore.kernel.org/linux-cxl/20240314044301.2108650-1-alison.schofi...@intel.com/

Thanks for helping,
Alison


>   }





Re: [PATCH v2] drm/i915/gem: Execbuffer objects must have struct pages.

2024-03-14 Thread Nirmoy Das



On 3/12/2024 3:55 PM, Jonathan Cavitt wrote:

We cannot write requests to objects without struct pages, so escape
early if the requests are bound to objects that lack them.

Signed-off-by: Jonathan Cavitt 
---

v2: s/vma-obj/vma->obj

  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 7 +++
  1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index d3a771afb083e..adb4f9e78cb49 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -3313,6 +3313,13 @@ eb_requests_create(struct i915_execbuffer *eb, struct 
dma_fence *in_fence,
unsigned int i;
  
  	for_each_batch_create_order(eb, i) {

+   /* Do not write requests to objects without struct pages. */
+   if (eb->batches[i]->vma &&
+   !i915_gem_object_has_struct_page(eb->batches[i]->vma->obj)) 
{


As far as I understand, motivation of this patch is to avoid doing 
execbuf on dmabuf imported BO which are in error state of something. 
i915_gem_object_has_struct_page()  checks "obj->mem_flags & 
I915_BO_FLAG_STRUCT_PAGE" which is very i915 specific.


So I think this will not work and will cause regression in existing 
program which are trying to do the same with valid BO. Unfortunately I 
don't have any idea how to better detect that at this moment.



Regards,

Nirmoy


+   out_fence = ERR_PTR(-EINVAL);
+   return out_fence;
+   }
+
/* Allocate a request for this batch buffer nice and early. */
eb->requests[i] = i915_request_create(eb_find_context(eb, i));
if (IS_ERR(eb->requests[i])) {


Re: [PATCH] drm/i915/gt: Report full vm address range

2024-03-14 Thread Nirmoy Das



On 3/14/2024 3:04 PM, Lionel Landwerlin wrote:

Hi Andi,

In Mesa we've been relying on I915_CONTEXT_PARAM_GTT_SIZE so as long 
as that is adjusted by the kernel


What do you mean by adjusted by, should it be a aligned size?

I915_CONTEXT_PARAM_GTT_SIZE ioctl is returning vm->total which is 
adjusted(reduced by a page).


This patch might cause silent error as it is not removing WABB which is 
using the reserved page to add dummy blt and if userspace is using that


page then it will be overwritten.


Regards,

Nirmoy


, we should be able to continue working without issues.

Acked-by: Lionel Landwerlin 

Thanks,

-Lionel

On 13/03/2024 21:39, Andi Shyti wrote:

Commit 9bb66c179f50 ("drm/i915: Reserve some kernel space per
vm") has reserved an object for kernel space usage.

Userspace, though, needs to know the full address range.

Fixes: 9bb66c179f50 ("drm/i915: Reserve some kernel space per vm")
Signed-off-by: Andi Shyti 
Cc: Andrzej Hajda 
Cc: Chris Wilson 
Cc: Lionel Landwerlin 
Cc: Michal Mrozek 
Cc: Nirmoy Das 
Cc:  # v6.2+
---
  drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c 
b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c

index fa46d2308b0e..d76831f50106 100644
--- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
+++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
@@ -982,8 +982,9 @@ static int gen8_init_rsvd(struct 
i915_address_space *vm)

    vm->rsvd.vma = i915_vma_make_unshrinkable(vma);
  vm->rsvd.obj = obj;
-    vm->total -= vma->node.size;
+
  return 0;
+
  unref:
  i915_gem_object_put(obj);
  return ret;





Re: [PATCH v6 4/4] drm/i915/display: Increase number of fast wake precharge pulses

2024-03-14 Thread Hogander, Jouni
On Wed, 2024-03-13 at 16:01 +0200, Ville Syrjälä wrote:
> On Wed, Mar 13, 2024 at 03:32:21PM +0200, Jouni Högander wrote:
> > Increasing number of fast wake sync pulses seem to fix problems
> > with
> > certain PSR panels. This should be ok for other panels as well as
> > the eDP
> > specification allows 10...16 precharge pulses and we are still
> > within that
> > range.
> > 
> > v2: add comment explaining pulse count is increased
> > 
> > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9739
> > Signed-off-by: Jouni Högander 
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_aux.c | 7 ++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > index 7e69be100d90..3264026454b2 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > @@ -145,7 +145,12 @@ static int intel_dp_aux_sync_len(void)
> >  
> >  int intel_dp_aux_fw_sync_len(void)
> >  {
> > -   int precharge = 10; /* 10-16 */
> > +   /*
> > +    * We faced some glitches on MTL with one PSR2 panel when
> > using HW
> > +    * default 18. Using 20 is fixing these problems with the
> > panel. It is
> > +    * still within range mentioned in eDP specification.
> > +    */
> 
> "MTL with one PSR2 panel" is super vague. Please mention the
> actual machine model here.
> 
> With that 
> Acked-by: Ville Syrjälä 

Thank you Ville for your review here. Patch set pushed to drm-intel-
next with comment updated.

BR,

Jouni Högander

> 
> > +   int precharge = 12; /* 10-16 */
> > int preamble = 8;
> >  
> > return precharge + preamble;
> > -- 
> > 2.34.1
> 



[PATCH 11/11] drm/xe: Kill xe_device_mem_access_{get*,put}

2024-03-14 Thread Rodrigo Vivi
Let's simply convert all the current callers towards direct
xe_pm_runtime access and remove this extra layer of indirection.

v2: Convert all the current callers instead of a big refactor
at once.

Signed-off-by: Rodrigo Vivi 
Reviewed-by: Matthew Auld 
---
 drivers/gpu/drm/xe/display/xe_fb_pin.c |  7 ++---
 drivers/gpu/drm/xe/xe_bo.c |  8 +++---
 drivers/gpu/drm/xe/xe_device.c | 36 --
 drivers/gpu/drm/xe/xe_device.h |  3 ---
 drivers/gpu/drm/xe/xe_device_types.h   |  3 ---
 drivers/gpu/drm/xe/xe_exec_queue.c |  6 ++---
 drivers/gpu/drm/xe/xe_ggtt.c   |  9 ---
 drivers/gpu/drm/xe/xe_sched_job.c  |  5 ++--
 drivers/gpu/drm/xe/xe_vm.c |  6 ++---
 9 files changed, 22 insertions(+), 61 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c 
b/drivers/gpu/drm/xe/display/xe_fb_pin.c
index 722c84a56607..403ed2d42f6b 100644
--- a/drivers/gpu/drm/xe/display/xe_fb_pin.c
+++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c
@@ -10,6 +10,7 @@
 #include "intel_fb_pin.h"
 #include "xe_ggtt.h"
 #include "xe_gt.h"
+#include "xe_pm.h"
 
 #include 
 
@@ -190,7 +191,7 @@ static int __xe_pin_fb_vma_ggtt(struct intel_framebuffer 
*fb,
/* TODO: Consider sharing framebuffer mapping?
 * embed i915_vma inside intel_framebuffer
 */
-   xe_device_mem_access_get(tile_to_xe(ggtt->tile));
+   xe_pm_runtime_get_noresume(tile_to_xe(ggtt->tile));
ret = mutex_lock_interruptible(>lock);
if (ret)
goto out;
@@ -242,7 +243,7 @@ static int __xe_pin_fb_vma_ggtt(struct intel_framebuffer 
*fb,
 out_unlock:
mutex_unlock(>lock);
 out:
-   xe_device_mem_access_put(tile_to_xe(ggtt->tile));
+   xe_pm_runtime_put(tile_to_xe(ggtt->tile));
return ret;
 }
 
@@ -381,4 +382,4 @@ struct i915_address_space *intel_dpt_create(struct 
intel_framebuffer *fb)
 void intel_dpt_destroy(struct i915_address_space *vm)
 {
return;
-}
\ No newline at end of file
+}
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 7ee4406da127..4c9a8ab4e840 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -716,7 +716,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, 
bool evict,
 
xe_assert(xe, migrate);
trace_xe_bo_move(bo, new_mem->mem_type, old_mem_type, 
move_lacks_source);
-   xe_device_mem_access_get(xe);
+   xe_pm_runtime_get_noresume(xe);
 
if (xe_bo_is_pinned(bo) && !xe_bo_is_user(bo)) {
/*
@@ -740,7 +740,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, 
bool evict,
 
if (XE_WARN_ON(new_mem->start == 
XE_BO_INVALID_OFFSET)) {
ret = -EINVAL;
-   xe_device_mem_access_put(xe);
+   xe_pm_runtime_put(xe);
goto out;
}
 
@@ -758,7 +758,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, 
bool evict,
new_mem, handle_system_ccs);
if (IS_ERR(fence)) {
ret = PTR_ERR(fence);
-   xe_device_mem_access_put(xe);
+   xe_pm_runtime_put(xe);
goto out;
}
if (!move_lacks_source) {
@@ -783,7 +783,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, 
bool evict,
dma_fence_put(fence);
}
 
-   xe_device_mem_access_put(xe);
+   xe_pm_runtime_put(xe);
 
 out:
return ret;
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 6ab402153242..31182ebe0b89 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -655,42 +655,6 @@ void xe_device_assert_mem_access(struct xe_device *xe)
xe_assert(xe, !xe_pm_runtime_suspended(xe));
 }
 
-void xe_device_mem_access_get(struct xe_device *xe)
-{
-   int ref;
-
-   /*
-* This looks racy, but should be fine since the pm_callback_task only
-* transitions from NULL -> current (and back to NULL again), during the
-* runtime_resume() or runtime_suspend() callbacks, for which there can
-* only be a single one running for our device. We only need to prevent
-* recursively calling the runtime_get or runtime_put from those
-* callbacks, as well as preventing triggering any access_ongoing
-* asserts.
-*/
-   if (xe_pm_read_callback_task(xe) == current)
-   return;
-
-   xe_pm_runtime_get_noresume(xe);
-   ref = atomic_inc_return(>mem_access.ref);
-
-   xe_assert(xe, ref != S32_MAX);
-
-}
-
-void xe_device_mem_access_put(struct xe_device *xe)
-{
-   int ref;
-
-   if (xe_pm_read_callback_task(xe) == current)
-   return;
-
-   ref = 

[PATCH 10/11] drm/xe: Ensure all the inner access are using the _noresume variant

2024-03-14 Thread Rodrigo Vivi
At this point mem_access references should be only used as inner
points of the execution and a get with synchronous resume previously
called at an outer point.

So, before killing mem_acces in favor of direct accsess, let's
ensure that we first convert them towards the new _noresume
variant that will WARN us if no inner caller happened.

Signed-off-by: Rodrigo Vivi 
Reviewed-by: Matthew Auld 
---
 drivers/gpu/drm/xe/xe_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 0a51eddd264b..6ab402153242 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -671,7 +671,7 @@ void xe_device_mem_access_get(struct xe_device *xe)
if (xe_pm_read_callback_task(xe) == current)
return;
 
-   xe_pm_runtime_get(xe);
+   xe_pm_runtime_get_noresume(xe);
ref = atomic_inc_return(>mem_access.ref);
 
xe_assert(xe, ref != S32_MAX);
-- 
2.44.0



[PATCH 09/11] drm/xe: Convert mem_access_if_ongoing to direct xe_pm_runtime_get_if_active

2024-03-14 Thread Rodrigo Vivi
Now that assert_mem_access is relying directly on the pm_runtime state
instead of the counters, there's no reason why we cannot use
the pm_runtime functions directly.

Signed-off-by: Rodrigo Vivi 
Reviewed-by: Matthew Auld 
---
 drivers/gpu/drm/xe/xe_device.c | 17 -
 drivers/gpu/drm/xe/xe_device.h |  1 -
 drivers/gpu/drm/xe/xe_guc_ct.c |  8 
 3 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 4754da58c112..0a51eddd264b 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -655,23 +655,6 @@ void xe_device_assert_mem_access(struct xe_device *xe)
xe_assert(xe, !xe_pm_runtime_suspended(xe));
 }
 
-bool xe_device_mem_access_get_if_ongoing(struct xe_device *xe)
-{
-   bool active;
-
-   if (xe_pm_read_callback_task(xe) == current)
-   return true;
-
-   active = xe_pm_runtime_get_if_active(xe);
-   if (active) {
-   int ref = atomic_inc_return(>mem_access.ref);
-
-   xe_assert(xe, ref != S32_MAX);
-   }
-
-   return active;
-}
-
 void xe_device_mem_access_get(struct xe_device *xe)
 {
int ref;
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 2327b6c0ae6a..b45592b0bf19 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -134,7 +134,6 @@ static inline struct xe_force_wake *gt_to_fw(struct xe_gt 
*gt)
 }
 
 void xe_device_mem_access_get(struct xe_device *xe);
-bool xe_device_mem_access_get_if_ongoing(struct xe_device *xe);
 void xe_device_mem_access_put(struct xe_device *xe);
 
 void xe_device_assert_mem_access(struct xe_device *xe);
diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
index 355edd4d758a..8d7b1b42b2e6 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct.c
+++ b/drivers/gpu/drm/xe/xe_guc_ct.c
@@ -1203,7 +1203,7 @@ void xe_guc_ct_fast_path(struct xe_guc_ct *ct)
bool ongoing;
int len;
 
-   ongoing = xe_device_mem_access_get_if_ongoing(ct_to_xe(ct));
+   ongoing = xe_pm_runtime_get_if_active(ct_to_xe(ct));
if (!ongoing && xe_pm_read_callback_task(ct_to_xe(ct)) == NULL)
return;
 
@@ -1216,7 +1216,7 @@ void xe_guc_ct_fast_path(struct xe_guc_ct *ct)
spin_unlock(>fast_lock);
 
if (ongoing)
-   xe_device_mem_access_put(xe);
+   xe_pm_runtime_put(xe);
 }
 
 /* Returns less than zero on error, 0 on done, 1 on more available */
@@ -1273,7 +1273,7 @@ static void g2h_worker_func(struct work_struct *w)
 * responses, if the worker here is blocked on those callbacks
 * completing, creating a deadlock.
 */
-   ongoing = xe_device_mem_access_get_if_ongoing(ct_to_xe(ct));
+   ongoing = xe_pm_runtime_get_if_active(ct_to_xe(ct));
if (!ongoing && xe_pm_read_callback_task(ct_to_xe(ct)) == NULL)
return;
 
@@ -1292,7 +1292,7 @@ static void g2h_worker_func(struct work_struct *w)
} while (ret == 1);
 
if (ongoing)
-   xe_device_mem_access_put(ct_to_xe(ct));
+   xe_pm_runtime_put(ct_to_xe(ct));
 }
 
 static void guc_ctb_snapshot_capture(struct xe_device *xe, struct guc_ctb *ctb,
-- 
2.44.0



[PATCH 08/11] drm/xe: Removing extra mem_access protection from runtime pm

2024-03-14 Thread Rodrigo Vivi
This is not needed any longer, now that we have all the protection
in place with the runtime pm itself.

Signed-off-by: Rodrigo Vivi 
Reviewed-by: Matthew Auld 
---
 drivers/gpu/drm/xe/xe_device.c | 8 
 drivers/gpu/drm/xe/xe_device.h | 1 -
 drivers/gpu/drm/xe/xe_pm.c | 3 ---
 3 files changed, 12 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 82f686595b16..4754da58c112 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -639,14 +639,6 @@ u32 xe_device_ccs_bytes(struct xe_device *xe, u64 size)
DIV_ROUND_UP_ULL(size, NUM_BYTES_PER_CCS_BYTE(xe)) : 0;
 }
 
-bool xe_device_mem_access_ongoing(struct xe_device *xe)
-{
-   if (xe_pm_read_callback_task(xe) != NULL)
-   return true;
-
-   return atomic_read(>mem_access.ref);
-}
-
 /**
  * xe_device_assert_mem_access - Inspect the current runtime_pm state.
  * @xe: xe device instance
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 2653f53bee4e..2327b6c0ae6a 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -138,7 +138,6 @@ bool xe_device_mem_access_get_if_ongoing(struct xe_device 
*xe);
 void xe_device_mem_access_put(struct xe_device *xe);
 
 void xe_device_assert_mem_access(struct xe_device *xe);
-bool xe_device_mem_access_ongoing(struct xe_device *xe);
 
 static inline bool xe_device_in_fault_mode(struct xe_device *xe)
 {
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 9d87a68ba6eb..92e159a8d52e 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -296,9 +296,6 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
u8 id;
int err = 0;
 
-   if (xe->d3cold.allowed && xe_device_mem_access_ongoing(xe))
-   return -EBUSY;
-
/* Disable access_ongoing asserts and prevent recursive pm calls */
xe_pm_write_callback_task(xe, current);
 
-- 
2.44.0



[PATCH 07/11] drm/xe: Convert xe_gem_fault to use direct xe_pm_runtime calls

2024-03-14 Thread Rodrigo Vivi
The gem page fault is one of the outer bound protections where
we want to ensure that the hardware is in D0 before proceeding
with memory access. Let's convert it towards the xe_pm_runtime
functions directly so we can then convert the mem_access to be
inner protection only and then Kill it for good.

Signed-off-by: Rodrigo Vivi 
Reviewed-by: Matthew Auld 
---
 drivers/gpu/drm/xe/xe_bo.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index d7e0deb1b869..7ee4406da127 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -22,6 +22,7 @@
 #include "xe_gt.h"
 #include "xe_map.h"
 #include "xe_migrate.h"
+#include "xe_pm.h"
 #include "xe_preempt_fence.h"
 #include "xe_res_cursor.h"
 #include "xe_trace.h"
@@ -1107,7 +1108,7 @@ static vm_fault_t xe_gem_fault(struct vm_fault *vmf)
int idx;
 
if (needs_rpm)
-   xe_device_mem_access_get(xe);
+   xe_pm_runtime_get(xe);
 
ret = ttm_bo_vm_reserve(tbo, vmf);
if (ret)
@@ -1138,7 +1139,7 @@ static vm_fault_t xe_gem_fault(struct vm_fault *vmf)
dma_resv_unlock(tbo->base.resv);
 out:
if (needs_rpm)
-   xe_device_mem_access_put(xe);
+   xe_pm_runtime_put(xe);
 
return ret;
 }
-- 
2.44.0



[PATCH 05/11] drm/xe: Convert GSC HDCP from mem_access to direct xe_pm_runtime calls

2024-03-14 Thread Rodrigo Vivi
We need to convert so we can continue to kill the mem_access.

At this point we should be protected by the display wakerefs already,
so let's use the noresume variant.

Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/xe/display/xe_hdcp_gsc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c 
b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
index 25c73602ef55..a221f0cf4bac 100644
--- a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
+++ b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
@@ -217,7 +217,7 @@ ssize_t intel_hdcp_gsc_msg_send(struct xe_device *xe, u8 
*msg_in,
addr_out_off = PAGE_SIZE;
 
host_session_id = xe_gsc_create_host_session_id();
-   xe_device_mem_access_get(xe);
+   xe_pm_runtime_get_noresume(xe);
addr_in_wr_off = xe_gsc_emit_header(xe, _message->hdcp_bo->vmap,
addr_in_wr_off, HECI_MEADDRESS_HDCP,
host_session_id, msg_in_len);
@@ -249,6 +249,6 @@ ssize_t intel_hdcp_gsc_msg_send(struct xe_device *xe, u8 
*msg_in,
   msg_out_len);
 
 out:
-   xe_device_mem_access_put(xe);
+   xe_pm_runtime_put(xe);
return ret;
 }
-- 
2.44.0



[PATCH 06/11] drm/xe: Remove useless mem_access during probe

2024-03-14 Thread Rodrigo Vivi
xe_pm_init is the very last thing during the xe_pci_probe(),
hence these protections are useless from the point of view
of ensuring that the device is awake.

Let's remove it so we continue towards the goal of killing
xe_device_mem_access.

v2: Adding more cases
v3: Provide a separate fix for xe_tile_init_noalloc return (Matt)
Adding a new case where display HDCP init calls which
are also called at display probe time.

Cc: Matthew Auld 
Reviewed-by: Matthew Auld 
Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/xe/display/xe_hdcp_gsc.c |  2 --
 drivers/gpu/drm/xe/xe_ggtt.c |  2 --
 drivers/gpu/drm/xe/xe_gt.c   |  9 -
 drivers/gpu/drm/xe/xe_tile.c | 15 +--
 drivers/gpu/drm/xe/xe_uc.c   | 11 ---
 5 files changed, 5 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c 
b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
index a221f0cf4bac..b2bd56a9b76d 100644
--- a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
+++ b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
@@ -70,7 +70,6 @@ static int intel_hdcp_gsc_initialize_message(struct xe_device 
*xe,
int ret = 0;
 
/* allocate object of two page for HDCP command memory and store it */
-   xe_device_mem_access_get(xe);
bo = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe), NULL, 
PAGE_SIZE * 2,
  ttm_bo_type_kernel,
  XE_BO_CREATE_SYSTEM_BIT |
@@ -90,7 +89,6 @@ static int intel_hdcp_gsc_initialize_message(struct xe_device 
*xe,
hdcp_message->hdcp_cmd_in = cmd_in;
hdcp_message->hdcp_cmd_out = cmd_out;
 out:
-   xe_device_mem_access_put(xe);
return ret;
 }
 
diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
index 325337c38961..0f96b7db6dcc 100644
--- a/drivers/gpu/drm/xe/xe_ggtt.c
+++ b/drivers/gpu/drm/xe/xe_ggtt.c
@@ -206,14 +206,12 @@ static void xe_ggtt_initial_clear(struct xe_ggtt *ggtt)
u64 start, end;
 
/* Display may have allocated inside ggtt, so be careful with clearing 
here */
-   xe_device_mem_access_get(tile_to_xe(ggtt->tile));
mutex_lock(>lock);
drm_mm_for_each_hole(hole, >mm, start, end)
xe_ggtt_clear(ggtt, start, end - start);
 
xe_ggtt_invalidate(ggtt);
mutex_unlock(>lock);
-   xe_device_mem_access_put(tile_to_xe(ggtt->tile));
 }
 
 int xe_ggtt_init(struct xe_ggtt *ggtt)
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 85408e7a932b..063b710a8c7b 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -347,7 +347,6 @@ static int gt_fw_domain_init(struct xe_gt *gt)
 {
int err, i;
 
-   xe_device_mem_access_get(gt_to_xe(gt));
err = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
if (err)
goto err_hw_fence_irq;
@@ -389,7 +388,6 @@ static int gt_fw_domain_init(struct xe_gt *gt)
 
err = xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
XE_WARN_ON(err);
-   xe_device_mem_access_put(gt_to_xe(gt));
 
return 0;
 
@@ -399,7 +397,6 @@ static int gt_fw_domain_init(struct xe_gt *gt)
 err_hw_fence_irq:
for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
xe_hw_fence_irq_finish(>fence_irq[i]);
-   xe_device_mem_access_put(gt_to_xe(gt));
 
return err;
 }
@@ -408,7 +405,6 @@ static int all_fw_domain_init(struct xe_gt *gt)
 {
int err, i;
 
-   xe_device_mem_access_get(gt_to_xe(gt));
err = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
if (err)
goto err_hw_fence_irq;
@@ -474,7 +470,6 @@ static int all_fw_domain_init(struct xe_gt *gt)
 
err = xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
XE_WARN_ON(err);
-   xe_device_mem_access_put(gt_to_xe(gt));
 
return 0;
 
@@ -483,7 +478,6 @@ static int all_fw_domain_init(struct xe_gt *gt)
 err_hw_fence_irq:
for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
xe_hw_fence_irq_finish(>fence_irq[i]);
-   xe_device_mem_access_put(gt_to_xe(gt));
 
return err;
 }
@@ -496,7 +490,6 @@ int xe_gt_init_hwconfig(struct xe_gt *gt)
 {
int err;
 
-   xe_device_mem_access_get(gt_to_xe(gt));
err = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
if (err)
goto out;
@@ -519,8 +512,6 @@ int xe_gt_init_hwconfig(struct xe_gt *gt)
 out_fw:
xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
 out:
-   xe_device_mem_access_put(gt_to_xe(gt));
-
return err;
 }
 
diff --git a/drivers/gpu/drm/xe/xe_tile.c b/drivers/gpu/drm/xe/xe_tile.c
index 0650b2fa75ef..74ecb5f39438 100644
--- a/drivers/gpu/drm/xe/xe_tile.c
+++ b/drivers/gpu/drm/xe/xe_tile.c
@@ -160,24 +160,19 @@ int xe_tile_init_noalloc(struct xe_tile *tile)
 {
int err;
 
-   xe_device_mem_access_get(tile_to_xe(tile));
-
err = tile_ttm_mgr_init(tile);
if (err)
-   goto 

[PATCH 04/11] drm/xe: Move lockdep protection from mem_access to xe_pm_runtime

2024-03-14 Thread Rodrigo Vivi
The mem_access itself is not holding any lock, but attempting
to train lockdep with possible scarring locks happening during
runtime pm. We are going soon to kill the mem_access get and put
helpers in favor of direct xe_pm_runtime calls, so let's just
move this lock around to where it now belongs.

v2: s/lockdep_training/lockdep_prime (Matt Auld)

Reviewed-by: Matthew Auld 
Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/xe/xe_device.c | 23 -
 drivers/gpu/drm/xe/xe_device.h |  4 ---
 drivers/gpu/drm/xe/xe_pm.c | 45 --
 3 files changed, 37 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index b0bfe75eb59f..82f686595b16 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -45,12 +45,6 @@
 #include "xe_vm.h"
 #include "xe_wait_user_fence.h"
 
-#ifdef CONFIG_LOCKDEP
-struct lockdep_map xe_device_mem_access_lockdep_map = {
-   .name = "xe_device_mem_access_lockdep_map"
-};
-#endif
-
 static int xe_file_open(struct drm_device *dev, struct drm_file *file)
 {
struct xe_device *xe = to_xe_device(dev);
@@ -702,23 +696,6 @@ void xe_device_mem_access_get(struct xe_device *xe)
if (xe_pm_read_callback_task(xe) == current)
return;
 
-   /*
-* Since the resume here is synchronous it can be quite easy to deadlock
-* if we are not careful. Also in practice it might be quite timing
-* sensitive to ever see the 0 -> 1 transition with the callers locks
-* held, so deadlocks might exist but are hard for lockdep to ever see.
-* With this in mind, help lockdep learn about the potentially scary
-* stuff that can happen inside the runtime_resume callback by acquiring
-* a dummy lock (it doesn't protect anything and gets compiled out on
-* non-debug builds).  Lockdep then only needs to see the
-* mem_access_lockdep_map -> runtime_resume callback once, and then can
-* hopefully validate all the (callers_locks) -> mem_access_lockdep_map.
-* For example if the (callers_locks) are ever grabbed in the
-* runtime_resume callback, lockdep should give us a nice splat.
-*/
-   lock_map_acquire(_device_mem_access_lockdep_map);
-   lock_map_release(_device_mem_access_lockdep_map);
-
xe_pm_runtime_get(xe);
ref = atomic_inc_return(>mem_access.ref);
 
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 14be34d9f543..2653f53bee4e 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -16,10 +16,6 @@ struct xe_file;
 #include "xe_force_wake.h"
 #include "xe_macros.h"
 
-#ifdef CONFIG_LOCKDEP
-extern struct lockdep_map xe_device_mem_access_lockdep_map;
-#endif
-
 static inline struct xe_device *to_xe_device(const struct drm_device *dev)
 {
return container_of(dev, struct xe_device, drm);
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 2e1362cf8deb..9d87a68ba6eb 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -68,6 +68,12 @@
  * management (RPS).
  */
 
+#ifdef CONFIG_LOCKDEP
+struct lockdep_map xe_pm_runtime_lockdep_map = {
+   .name = "xe_pm_runtime_lockdep_map"
+};
+#endif
+
 /**
  * xe_pm_suspend - Helper for System suspend, i.e. S0->S3 / S0->S2idle
  * @xe: xe device instance
@@ -297,11 +303,11 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
xe_pm_write_callback_task(xe, current);
 
/*
-* The actual xe_device_mem_access_put() is always async underneath, so
+* The actual xe_pm_runtime_put() is always async underneath, so
 * exactly where that is called should makes no difference to us. 
However
 * we still need to be very careful with the locks that this callback
 * acquires and the locks that are acquired and held by any callers of
-* xe_device_mem_access_get(). We already have the matching annotation
+* xe_runtime_pm_get(). We already have the matching annotation
 * on that side, but we also need it here. For example lockdep should be
 * able to tell us if the following scenario is in theory possible:
 *
@@ -309,15 +315,15 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
 * lock(A)   |
 *   | xe_pm_runtime_suspend()
 *   |  lock(A)
-* xe_device_mem_access_get()|
+* xe_pm_runtime_get()   |
 *
 * This will clearly deadlock since rpm core needs to wait for
 * xe_pm_runtime_suspend() to complete, but here we are holding lock(A)
 * on CPU0 which prevents CPU1 making forward progress.  With the
-* annotation here and in xe_device_mem_access_get() lockdep will see
+* annotation here and in xe_pm_runtime_get() lockdep will see
 * the 

[PATCH 03/11] drm/i915/display: convert inner wakeref get towards get_if_in_use

2024-03-14 Thread Rodrigo Vivi
This patch brings no functional change. Since at this point of
the code we are already asserting a wakeref was held, it means
that we are with runtime_pm 'in_use' and in practical terms we
are only bumping the pm_runtime usage counter and moving on.

However, xe driver has a lockdep annotation that warned us that
if a sync resume was actually called at this point, we could have
a deadlock because we are inside the power_domains->lock locked
area and the resume would call the irq_reset, which would also
try to get the power_domains->lock.

For this reason, let's convert this call to a safer option and
calm lockdep on.

v2: use _noresume variant instead of get_in_use (Ville, Imre)

Cc: Ville Syrjälä 
Acked-by: Imre Deak 
Cc: Matthew Auld 
Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/i915/display/intel_display_power.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c 
b/drivers/gpu/drm/i915/display/intel_display_power.c
index 6fd4fa52253a..048943d0a881 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power.c
+++ b/drivers/gpu/drm/i915/display/intel_display_power.c
@@ -646,7 +646,7 @@ release_async_put_domains(struct i915_power_domains 
*power_domains,
 * power well disabling.
 */
assert_rpm_raw_wakeref_held(rpm);
-   wakeref = intel_runtime_pm_get(rpm);
+   wakeref = intel_runtime_pm_get_noresume(rpm);
 
for_each_power_domain(domain, mask) {
/* Clear before put, so put's sanity check is happy. */
-- 
2.44.0



[PATCH 02/11] drm/xe: Introduce intel_runtime_pm_get_noresume at compat-i915-headers for display

2024-03-14 Thread Rodrigo Vivi
The i915-display will start using the intel_runtime_pm_noresume.
So we need to add the compat header before it.

Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h 
b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
index fef969112b1d..ecaaef3df4bf 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
@@ -176,6 +176,14 @@ static inline intel_wakeref_t 
intel_runtime_pm_get_if_in_use(struct xe_runtime_p
return xe_pm_runtime_get_if_in_use(xe);
 }
 
+static inline intel_wakeref_t intel_runtime_pm_get_noresume(struct 
xe_runtime_pm *pm)
+{
+   struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
+
+   xe_pm_runtime_get_noresume(xe);
+   return true;
+}
+
 static inline void intel_runtime_pm_put_unchecked(struct xe_runtime_pm *pm)
 {
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
-- 
2.44.0



[PATCH 01/11] drm/xe: Introduce xe_pm_runtime_get_noresume for inner callers

2024-03-14 Thread Rodrigo Vivi
Let's ensure that we have an option for inner callers that will
raise WARN if device is not active and not protected by outer callers.

Make this also a void function forcing every caller to unconditionally
put the reference back afterwards.

This will be very important for cases where we want to hold the
reference before scheduling a work in a queue. Then the work job
will be responsible for putting it back.

While at this, already convert a case from mem_access_ongoing where
it is not checking for the reference and put it back, what would
cause the underflow.

v2: Fix identation.

Reviewed-by: Matthew Auld 
Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/xe/xe_exec_queue.c |  2 +-
 drivers/gpu/drm/xe/xe_pm.c | 20 
 drivers/gpu/drm/xe/xe_pm.h |  1 +
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c 
b/drivers/gpu/drm/xe/xe_exec_queue.c
index 6a83bc57826a..f69a9c99329c 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -128,7 +128,7 @@ static int __xe_exec_queue_init(struct xe_exec_queue *q)
 * already grabbed the rpm ref outside any sensitive locks.
 */
if (!(q->flags & EXEC_QUEUE_FLAG_PERMANENT) && (q->flags & 
EXEC_QUEUE_FLAG_VM || !q->vm))
-   drm_WARN_ON(>drm, !xe_device_mem_access_get_if_ongoing(xe));
+   xe_pm_runtime_get_noresume(xe);
 
return 0;
 
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 9fbb6f6c598a..2e1362cf8deb 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -477,6 +477,26 @@ bool xe_pm_runtime_get_if_in_use(struct xe_device *xe)
return pm_runtime_get_if_in_use(xe->drm.dev) > 0;
 }
 
+/**
+ * xe_pm_runtime_get_noresume - Bump runtime PM usage counter without resuming
+ * @xe: xe device instance
+ *
+ * This function should be used in inner places where it is surely already
+ * protected by outer-bound callers of `xe_pm_runtime_get`.
+ * It will warn if not protected.
+ * The reference should be put back after this function regardless, since it
+ * will always bump the usage counter, regardless.
+ */
+void xe_pm_runtime_get_noresume(struct xe_device *xe)
+{
+   bool ref;
+
+   ref = xe_pm_runtime_get_if_in_use(xe);
+
+   if (drm_WARN(>drm, !ref, "Missing outer runtime PM protection\n"))
+   pm_runtime_get_noresume(xe->drm.dev);
+}
+
 /**
  * xe_pm_runtime_resume_and_get - Resume, then get a runtime_pm ref if awake.
  * @xe: xe device instance
diff --git a/drivers/gpu/drm/xe/xe_pm.h b/drivers/gpu/drm/xe/xe_pm.h
index 0cb38ca244fe..119b630ad1d1 100644
--- a/drivers/gpu/drm/xe/xe_pm.h
+++ b/drivers/gpu/drm/xe/xe_pm.h
@@ -31,6 +31,7 @@ int xe_pm_runtime_get_ioctl(struct xe_device *xe);
 void xe_pm_runtime_put(struct xe_device *xe);
 int xe_pm_runtime_get_if_active(struct xe_device *xe);
 bool xe_pm_runtime_get_if_in_use(struct xe_device *xe);
+void xe_pm_runtime_get_noresume(struct xe_device *xe);
 bool xe_pm_runtime_resume_and_get(struct xe_device *xe);
 void xe_pm_assert_unbounded_bridge(struct xe_device *xe);
 int xe_pm_set_vram_threshold(struct xe_device *xe, u32 threshold);
-- 
2.44.0



Re: [PATCH] drm/i915/gt: Report full vm address range

2024-03-14 Thread Lionel Landwerlin

Hi Andi,

In Mesa we've been relying on I915_CONTEXT_PARAM_GTT_SIZE so as long as 
that is adjusted by the kernel, we should be able to continue working 
without issues.


Acked-by: Lionel Landwerlin 

Thanks,

-Lionel

On 13/03/2024 21:39, Andi Shyti wrote:

Commit 9bb66c179f50 ("drm/i915: Reserve some kernel space per
vm") has reserved an object for kernel space usage.

Userspace, though, needs to know the full address range.

Fixes: 9bb66c179f50 ("drm/i915: Reserve some kernel space per vm")
Signed-off-by: Andi Shyti 
Cc: Andrzej Hajda 
Cc: Chris Wilson 
Cc: Lionel Landwerlin 
Cc: Michal Mrozek 
Cc: Nirmoy Das 
Cc:  # v6.2+
---
  drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c 
b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
index fa46d2308b0e..d76831f50106 100644
--- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
+++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
@@ -982,8 +982,9 @@ static int gen8_init_rsvd(struct i915_address_space *vm)
  
  	vm->rsvd.vma = i915_vma_make_unshrinkable(vma);

vm->rsvd.obj = obj;
-   vm->total -= vma->node.size;
+
return 0;
+
  unref:
i915_gem_object_put(obj);
return ret;





Re: [PATCH v2] drm/i915/gem: Execbuffer objects must have struct pages.

2024-03-14 Thread Andi Shyti
Hi Jonathan,

On Tue, Mar 12, 2024 at 07:55:06AM -0700, Jonathan Cavitt wrote:
> We cannot write requests to objects without struct pages, so escape
> early if the requests are bound to objects that lack them.
> 
> Signed-off-by: Jonathan Cavitt 

is this a fix? Do you need

Fixes: 544460c33821 ("drm/i915: Multi-BB execbuf")
Cc: Matthew Brost 
Cc:  # v5.16+

?

Andi

> ---
> 
> v2: s/vma-obj/vma->obj
> 
>  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c 
> b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index d3a771afb083e..adb4f9e78cb49 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -3313,6 +3313,13 @@ eb_requests_create(struct i915_execbuffer *eb, struct 
> dma_fence *in_fence,
>   unsigned int i;
>  
>   for_each_batch_create_order(eb, i) {
> + /* Do not write requests to objects without struct pages. */
> + if (eb->batches[i]->vma &&
> + !i915_gem_object_has_struct_page(eb->batches[i]->vma->obj)) 
> {
> + out_fence = ERR_PTR(-EINVAL);
> + return out_fence;
> + }
> +
>   /* Allocate a request for this batch buffer nice and early. */
>   eb->requests[i] = i915_request_create(eb_find_context(eb, i));
>   if (IS_ERR(eb->requests[i])) {
> -- 
> 2.25.1


✓ Fi.CI.BAT: success for drm/i915: Fix VMA UAF on destroy against deactivate race (rev8)

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915: Fix VMA UAF on destroy against deactivate race (rev8)
URL   : https://patchwork.freedesktop.org/series/129026/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_14430 -> Patchwork_129026v8


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/index.html

Participating hosts (39 -> 37)
--

  Additional (1): fi-kbl-8809g 
  Missing(3): bat-mtlp-8 bat-kbl-2 fi-snb-2520m 

Known issues


  Here are the changes found in Patchwork_129026v8 that come from known issues:

### CI changes ###

 Issues hit 

  * boot:
- bat-jsl-1:  [PASS][1] -> [FAIL][2] ([i915#8293])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14430/bat-jsl-1/boot.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/bat-jsl-1/boot.html
- fi-kbl-8809g:   NOTRUN -> [FAIL][3] ([i915#8293])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/fi-kbl-8809g/boot.html

  
 Possible fixes 

  * boot:
- fi-cfl-8109u:   [FAIL][4] ([i915#8293]) -> [PASS][5]
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14430/fi-cfl-8109u/boot.html
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/fi-cfl-8109u/boot.html

  

### IGT changes ###

 Issues hit 

  * igt@gem_huc_copy@huc-copy:
- fi-cfl-8109u:   NOTRUN -> [SKIP][6] ([i915#2190])
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/fi-cfl-8109u/igt@gem_huc_c...@huc-copy.html

  * igt@gem_lmem_swapping@verify-random:
- fi-cfl-8109u:   NOTRUN -> [SKIP][7] ([i915#4613]) +3 other tests skip
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/fi-cfl-8109u/igt@gem_lmem_swapp...@verify-random.html

  * igt@i915_selftest@live@execlists:
- fi-bsw-nick:[PASS][8] -> [ABORT][9] ([i915#7911])
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14430/fi-bsw-nick/igt@i915_selftest@l...@execlists.html
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/fi-bsw-nick/igt@i915_selftest@l...@execlists.html

  * igt@i915_selftest@live@hangcheck:
- bat-rpls-3: [PASS][10] -> [DMESG-WARN][11] ([i915#5591])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14430/bat-rpls-3/igt@i915_selftest@l...@hangcheck.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/bat-rpls-3/igt@i915_selftest@l...@hangcheck.html

  * igt@i915_selftest@live@objects:
- bat-dg2-11: [PASS][12] -> [ABORT][13] ([i915#10366])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14430/bat-dg2-11/igt@i915_selftest@l...@objects.html
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/bat-dg2-11/igt@i915_selftest@l...@objects.html

  * igt@kms_pm_backlight@basic-brightness:
- fi-cfl-8109u:   NOTRUN -> [SKIP][14] +11 other tests skip
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/fi-cfl-8109u/igt@kms_pm_backli...@basic-brightness.html

  
 Possible fixes 

  * igt@gem_lmem_swapping@basic@lmem0:
- bat-dg2-11: [FAIL][15] ([i915#10378]) -> [PASS][16]
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14430/bat-dg2-11/igt@gem_lmem_swapping@ba...@lmem0.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/bat-dg2-11/igt@gem_lmem_swapping@ba...@lmem0.html

  * igt@i915_pm_rpm@module-reload:
- {bat-mtlp-9}:   [WARN][17] -> [PASS][18]
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14430/bat-mtlp-9/igt@i915_pm_...@module-reload.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/bat-mtlp-9/igt@i915_pm_...@module-reload.html

  * igt@i915_selftest@live@gt_timelines:
- bat-dg2-8:  [ABORT][19] ([i915#10366]) -> [PASS][20]
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14430/bat-dg2-8/igt@i915_selftest@live@gt_timelines.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129026v8/bat-dg2-8/igt@i915_selftest@live@gt_timelines.html

  
  {name}: This element is suppressed. This means it is ignored when computing
  the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#10366]: https://gitlab.freedesktop.org/drm/intel/issues/10366
  [i915#10378]: https://gitlab.freedesktop.org/drm/intel/issues/10378
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#5591]: https://gitlab.freedesktop.org/drm/intel/issues/5591
  [i915#7911]: https://gitlab.freedesktop.org/drm/intel/issues/7911
  [i915#8293]: https://gitlab.freedesktop.org/drm/intel/issues/8293


Build changes
-

  * Linux: CI_DRM_14430 -> Patchwork_129026v8

  CI-20190529: 20190529
  CI_DRM_14430: 9bedef916cef04bba9e98430c1c1de637219a573 @ 

✗ Fi.CI.SPARSE: warning for drm/i915: Fix VMA UAF on destroy against deactivate race (rev8)

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915: Fix VMA UAF on destroy against deactivate race (rev8)
URL   : https://patchwork.freedesktop.org/series/129026/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:179:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:181:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:181:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:185:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:187:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:191:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:194:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:194:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:236:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:238:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/uaccess_64.h:88:24: warning: cast removes address space 
'__user' of expression
+./arch/x86/include/asm/uaccess_64.h:88:24: warning: cast removes address space 
'__user' of expression
+./arch/x86/include/asm/uaccess_64.h:88:24: warning: cast removes address space 
'__user' of expression
+./arch/x86/include/asm/uaccess_64.h:88:24: warning: cast removes address space 
'__user' of expression
+./arch/x86/include/asm/uaccess_64.h:88:24: warning: cast removes address space 
'__user' of expression
+./arch/x86/include/asm/uaccess_64.h:88:24: warning: cast removes address space 
'__user' of expression
+./arch/x86/include/asm/uaccess_64.h:88:24: warning: cast removes address space 
'__user' of expression
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:166:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:168:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:169:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:170:9: warning: unreplaced 
symbol 'val'
+./include/asm-generic/bitops/generic-non-atomic.h:172:19: warning: unreplaced 
symbol 'val'
+./include/asm-generic/bitops/generic-non-atomic.h:172:25: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:172:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:28:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:30:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:31:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:33:10: warning: unreplaced 
symbol 'p'

Re: [PATCH] drm/i915: Add includes for BUG_ON/BUILD_BUG_ON in i915_memcpy.c

2024-03-14 Thread Joonas Lahtinen
Quoting Rodrigo Vivi (2024-03-08 16:58:04)
> On Fri, Mar 08, 2024 at 04:46:43PM +0200, Joonas Lahtinen wrote:
> > Add standalone includes for BUG_ON and BUILD_BUG_ON to avoid build failure
> > after linux-next include refactoring.
> 
> any lore link so we can use with a 'Closes:' tag?
> and perhaps a reported-by?

The build failure seems to have happened in intel-gfx-ci.01.org but the
failing build results are not uploaded so it's only visible in the
background.

>From the CI page[1] we can see next-20240304 is the last successful build[2].
Failure seems to have started next-20240305 after which the results are
not uploaded due to the failure.

For future, I asked if we could improve the CI dashboard by alos showing the
failing builds in the CI view. 

However, for now we don't have a reference, I guess.

[1] https://intel-gfx-ci.01.org/tree/linux-next/combined-alt.html?
[2] https://intel-gfx-ci.01.org/tree/linux-next/next-20240304/filelist.html

> 
> > 
> > Signed-off-by: Joonas Lahtinen 
> > Cc: Chris Wilson 
> > Cc: Jani Nikula 
> > Cc: Rodrigo Vivi 
> > Cc: Tvrtko Ursulin 
> > ---
> >  drivers/gpu/drm/i915/i915_memcpy.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_memcpy.c 
> > b/drivers/gpu/drm/i915/i915_memcpy.c
> > index ba82277254b7..cc41974cee74 100644
> > --- a/drivers/gpu/drm/i915/i915_memcpy.c
> > +++ b/drivers/gpu/drm/i915/i915_memcpy.c
> > @@ -25,6 +25,8 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> > +#include 
> 
> git grep BUILD_BUG_ON drivers/gpu/drm/i915/
> output
> 
> vs
> 
> git grep build_bug.h drivers/gpu/drm/i915/
> output
> 
> tells me that we likely need this in many more files...
> 
> but not opposed to move with this faster and come back later with
> other fixes if this unblocks people:

Yeah, I made the same observation.

Are you fine to merge this with the R-b even without the reference?

Regards, Joonas

> 
> Reviewed-by: Rodrigo Vivi 
> 
> >  #include 
> >  
> >  #include "i915_memcpy.h"
> > -- 
> > 2.43.2
> > 


Re: [PATCH 0/6] drm: debug logging improvements

2024-03-14 Thread Jani Nikula
On Thu, 07 Mar 2024, Jani Nikula  wrote:
> Switch a handful of places over to drm device based logging and WARNs,
> unify connector and crtc logging, etc.

Ping for review, please. :)


>
> Jani Nikula (6):
>   drm/modes: add drm_mode_print() to dump mode in drm_printer
>   drm/probe-helper: switch to drm device based logging
>   drm/modes: switch drm_mode_prune_invalid() to use struct drm_printer
>   drm/modes: switch to drm device based error logging
>   drm/sysfs: switch to drm device based logging
>   drm/client: switch to drm device based logging, and more
>
>  drivers/gpu/drm/drm_client_modeset.c | 129 +++
>  drivers/gpu/drm/drm_modes.c  |  51 +++
>  drivers/gpu/drm/drm_probe_helper.c   |  41 -
>  drivers/gpu/drm/drm_sysfs.c  |  21 +++--
>  include/drm/drm_modes.h  |   2 +
>  5 files changed, 137 insertions(+), 107 deletions(-)

-- 
Jani Nikula, Intel


Re: [PATCH i-g-t v2 1/2] lib/kunit: Execute test cases synchronously

2024-03-14 Thread Janusz Krzysztofik
On Thursday, 14 March 2024 11:29:38 CET Kamil Konieczny wrote:
> Hi Janusz,
> On 2024-02-27 at 16:10:41 +0100, Janusz Krzysztofik wrote:
> > Up to now we were loading a KUnit test module in test execution mode only
> > once per subtest, in background, and then, in parallel with execution of
> > test cases while the module was loading, we were looking through dmesg for
> > KTAP results from each expected test case.  As a consequence, our IGT
> > messages were more or less delayed, never in full sync with kernel
> > messages.  Moreover, parsing of KTAP results from already completed test
> > cases could be abandoned on a failure from loading the test module or
> > kernel taint caused by a subsequent test case.  Also, parsing of KTAP
> > results from all subsequent test cases could be abandoned on a failure of
> > the parser caused by any test case.  Other than that, if a user requested
> > a single dynamic sub-subtest, all test cases were executed anyway while
> > results from only one of them that corresponded to the selected dynamic
> > sub-subtest were reported.  That way, kernel messages from unrelated test
> > cases, not only the selected one, could contribute to dmesg-fail or dmesg-
> > warn CI results from that sub-subtest.
> > 
> > Since recent KUnit implementation is capable of executing only those test
> > cases that match a user filter, stop executing all of them asynchronously
> 
> Could you do that with igt_until_timeout(timeout) guards?
> So our test listing/executing will end in reasonable time, even
> when it will stuck in system call?

OK, good idea, and I think I'll do that in a separate patch which will be the 
first one in the series.  That way I'll first address the issue of indefinite 
waits that we observed when it happened that no KUnit test suite matched a 
non-default IGT subtest name provided by IGT test code, then no KTAP report 
appeared in dmesg.

NB, my patch (or series) planned as next, if accepted, will invalidate that 
issue of indefinite waits.  Instead of extracting KTAP reports from dmesg, 
we will be fetching them from debugfs files, one per test suite, then we won't 
be waiting for anything but just fail if the file doesn't appear after KUnit 
modules are loaded.  That's why I didn't prioritise fixing that issue.

Thanks,
Janusz

> 
> Regards,
> Kamil
> 
> > and parsing their KTAP results as they appear.  Instead, reload the test
> > module once per each dynamic sub-subtest with a filter that selects a
> > specific test case and wait for its completion.  If successful and no
> > kernel taint has occurred then parse the whole KTAP report from a single
> > test case it has produced and translate it to IGT result of that single
> > corresponding sub-subtest.
> > 
> > With that in place, we no longer need to skip the whole subtest on a
> > failure from module loading or KTAP reading or parsing.  Since such event
> > is now local to execution of an individual test case, only fail its
> > corresponding dynamic sub-subtests and continue with subsequent ones.
> > However, still omit execution of subsequent test cases once the kernel
> > gets tainted.
> > 
> > v2: Refresh on top of changes to KUnit filters handling,
> >   - include the code of a new helper from a previously separate patch,
> >   - actually limit the scope of the helper to fetching a KTAP report from
> > a file descriptor, and let the caller decide on how other steps, like
> > setting up filters or loading a test module, and errors they return
> > are handled,
> >   - similar to kernel taint handling, just omit any remaining dynamic sub-
> > subtests if unloading the test module fails,
> >   - update commit description with a more detailed justification of why we
> > need these changes.
> > 
> > Signed-off-by: Janusz Krzysztofik 
> > Cc: Mauro Carvalho Chehab 
> > ---
> >  lib/igt_kmod.c | 157 -
> >  1 file changed, 52 insertions(+), 105 deletions(-)
> > 
> > diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> > index cc242838fa..e9e00ac5b2 100644
> > --- a/lib/igt_kmod.c
> > +++ b/lib/igt_kmod.c
> > @@ -1018,6 +1018,25 @@ static void kunit_results_free(struct igt_list_head 
> > *results,
> > free(*suite_name);
> >  }
> >  
> > +static int kunit_get_results(struct igt_list_head *results, int kmsg_fd)
> > +{
> > +   struct igt_ktap_results *ktap;
> > +   int err;
> > +
> > +   ktap = igt_ktap_alloc(results);
> > +   if (igt_debug_on(!ktap))
> > +   return -ENOMEM;
> > +
> > +   do
> > +   igt_debug_on((err = kunit_kmsg_result_get(results, NULL, 
> > kmsg_fd, ktap),
> > + err && err != -EINPROGRESS));
> > +   while (err == -EINPROGRESS);
> > +
> > +   igt_ktap_free(ktap);
> > +
> > +   return err;
> > +}
> > +
> >  static void __igt_kunit_legacy(struct igt_ktest *tst,
> >const char *subtest,
> >const char *opts)
> > @@ -1211,86 +1230,51 @@ static void 

Re: [PATCH v3] Fix divide-by-zero regression on DP MST unplug with nouveau

2024-03-14 Thread Imre Deak
On Wed, Mar 13, 2024 at 10:06:30PM +, Chris Bainbridge wrote:
> Fix a regression when using nouveau and unplugging a StarTech MSTDP122DP
> DisplayPort 1.2 MST hub (the same regression does not appear when using
> a Cable Matters DisplayPort 1.4 MST hub). Trace:
> 
>  divide error:  [#1] PREEMPT SMP PTI
>  CPU: 7 PID: 2962 Comm: Xorg Not tainted 6.8.0-rc3+ #744
>  Hardware name: Razer Blade/DANA_MB, BIOS 01.01 08/31/2018
>  RIP: 0010:drm_dp_bw_overhead+0xb4/0x110 [drm_display_helper]
>  Code: c6 b8 01 00 00 00 75 61 01 c6 41 0f af f3 41 0f af f1 c1 e1 04 48 63 
> c7 31 d2 89 ff 48 8b 5d f8 c9 48 0f af f1 48 8d 44 06 ff <48> f7 f7 31 d2 31 
> c9 31 f6 31 ff 45 31 c0 45 31 c9 45 31 d2 45 31
>  RSP: 0018:b2c5c211fa30 EFLAGS: 00010206
>  RAX:  RBX:  RCX: 00f59b00
>  RDX:  RSI:  RDI: 
>  RBP: b2c5c211fa48 R08: 0001 R09: 0020
>  R10: 0004 R11:  R12: 00023b4a
>  R13: 91d37d165800 R14: 91d36fac6d80 R15: 91d34a764010
>  FS:  7f4a1ca3fa80() GS:91d6edbc() knlGS:
>  CS:  0010 DS:  ES:  CR0: 80050033
>  CR2: 559491d49000 CR3: 00011d180002 CR4: 003706f0
>  Call Trace:
>   
>   ? show_regs+0x6d/0x80
>   ? die+0x37/0xa0
>   ? do_trap+0xd4/0xf0
>   ? do_error_trap+0x71/0xb0
>   ? drm_dp_bw_overhead+0xb4/0x110 [drm_display_helper]
>   ? exc_divide_error+0x3a/0x70
>   ? drm_dp_bw_overhead+0xb4/0x110 [drm_display_helper]
>   ? asm_exc_divide_error+0x1b/0x20
>   ? drm_dp_bw_overhead+0xb4/0x110 [drm_display_helper]
>   ? drm_dp_calc_pbn_mode+0x2e/0x70 [drm_display_helper]
>   nv50_msto_atomic_check+0xda/0x120 [nouveau]
>   drm_atomic_helper_check_modeset+0xa87/0xdf0 [drm_kms_helper]
>   drm_atomic_helper_check+0x19/0xa0 [drm_kms_helper]
>   nv50_disp_atomic_check+0x13f/0x2f0 [nouveau]
>   drm_atomic_check_only+0x668/0xb20 [drm]
>   ? drm_connector_list_iter_next+0x86/0xc0 [drm]
>   drm_atomic_commit+0x58/0xd0 [drm]
>   ? __pfx___drm_printfn_info+0x10/0x10 [drm]
>   drm_atomic_connector_commit_dpms+0xd7/0x100 [drm]
>   drm_mode_obj_set_property_ioctl+0x1c5/0x450 [drm]
>   ? __pfx_drm_connector_property_set_ioctl+0x10/0x10 [drm]
>   drm_connector_property_set_ioctl+0x3b/0x60 [drm]
>   drm_ioctl_kernel+0xb9/0x120 [drm]
>   drm_ioctl+0x2d0/0x550 [drm]
>   ? __pfx_drm_connector_property_set_ioctl+0x10/0x10 [drm]
>   nouveau_drm_ioctl+0x61/0xc0 [nouveau]
>   __x64_sys_ioctl+0xa0/0xf0
>   do_syscall_64+0x76/0x140
>   ? do_syscall_64+0x85/0x140
>   ? do_syscall_64+0x85/0x140
>   entry_SYSCALL_64_after_hwframe+0x6e/0x76
>  RIP: 0033:0x7f4a1cd1a94f
>  Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 
> 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 
> ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00
>  RSP: 002b:7ffd2f1df520 EFLAGS: 0246 ORIG_RAX: 0010
>  RAX: ffda RBX: 7ffd2f1df5b0 RCX: 7f4a1cd1a94f
>  RDX: 7ffd2f1df5b0 RSI: c01064ab RDI: 000f
>  RBP: c01064ab R08: 56347932deb8 R09: 56347a7d99c0
>  R10:  R11: 0246 R12: 56347938a220
>  R13: 000f R14: 563479d9f3f0 R15: 
>   
>  Modules linked in: rfcomm xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat 
> nf_conntrack_netlink nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xfrm_user 
> xfrm_algo xt_addrtype nft_compat nf_tables nfnetlink br_netfilter bridge stp 
> llc ccm cmac algif_hash overlay algif_skcipher af_alg bnep binfmt_misc 
> snd_sof_pci_intel_cnl snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_pci 
> snd_sof_xtensa_dsp snd_sof_intel_hda snd_sof snd_sof_utils 
> snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_compress 
> snd_sof_intel_hda_mlink snd_hda_ext_core iwlmvm intel_rapl_msr 
> intel_rapl_common intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp 
> mac80211 coretemp kvm_intel snd_hda_codec_hdmi kvm snd_hda_codec_realtek 
> snd_hda_codec_generic uvcvideo libarc4 snd_hda_intel snd_intel_dspcfg 
> snd_hda_codec iwlwifi videobuf2_vmalloc videobuf2_memops uvc irqbypass btusb 
> videobuf2_v4l2 snd_seq_midi crct10dif_pclmul hid_multitouch crc32_pclmul 
> snd_seq_midi_event btrtl snd_hwdep videodev polyval_clmulni polyval_generic 
> snd_rawmidi
>   ghash_clmulni_intel aesni_intel btintel crypto_simd snd_hda_core cryptd 
> snd_seq btbcm ee1004 8250_dw videobuf2_common btmtk rapl nls_iso8859_1 
> mei_hdcp thunderbolt bluetooth intel_cstate wmi_bmof intel_wmi_thunderbolt 
> cfg80211 snd_pcm mc snd_seq_device i2c_i801 r8169 ecdh_generic snd_timer 
> i2c_smbus ecc snd mei_me intel_lpss_pci mei ahci intel_lpss soundcore realtek 
> libahci idma64 intel_pch_thermal i2c_hid_acpi i2c_hid acpi_pad sch_fq_codel 
> msr parport_pc ppdev lp parport efi_pstore ip_tables x_tables autofs4 
> dm_crypt raid10 raid456 libcrc32c async_raid6_recov 

Re: [PATCH i-g-t v2 1/2] lib/kunit: Execute test cases synchronously

2024-03-14 Thread Kamil Konieczny
Hi Janusz,
On 2024-02-27 at 16:10:41 +0100, Janusz Krzysztofik wrote:
> Up to now we were loading a KUnit test module in test execution mode only
> once per subtest, in background, and then, in parallel with execution of
> test cases while the module was loading, we were looking through dmesg for
> KTAP results from each expected test case.  As a consequence, our IGT
> messages were more or less delayed, never in full sync with kernel
> messages.  Moreover, parsing of KTAP results from already completed test
> cases could be abandoned on a failure from loading the test module or
> kernel taint caused by a subsequent test case.  Also, parsing of KTAP
> results from all subsequent test cases could be abandoned on a failure of
> the parser caused by any test case.  Other than that, if a user requested
> a single dynamic sub-subtest, all test cases were executed anyway while
> results from only one of them that corresponded to the selected dynamic
> sub-subtest were reported.  That way, kernel messages from unrelated test
> cases, not only the selected one, could contribute to dmesg-fail or dmesg-
> warn CI results from that sub-subtest.
> 
> Since recent KUnit implementation is capable of executing only those test
> cases that match a user filter, stop executing all of them asynchronously

Could you do that with igt_until_timeout(timeout) guards?
So our test listing/executing will end in reasonable time, even
when it will stuck in system call?

Regards,
Kamil

> and parsing their KTAP results as they appear.  Instead, reload the test
> module once per each dynamic sub-subtest with a filter that selects a
> specific test case and wait for its completion.  If successful and no
> kernel taint has occurred then parse the whole KTAP report from a single
> test case it has produced and translate it to IGT result of that single
> corresponding sub-subtest.
> 
> With that in place, we no longer need to skip the whole subtest on a
> failure from module loading or KTAP reading or parsing.  Since such event
> is now local to execution of an individual test case, only fail its
> corresponding dynamic sub-subtests and continue with subsequent ones.
> However, still omit execution of subsequent test cases once the kernel
> gets tainted.
> 
> v2: Refresh on top of changes to KUnit filters handling,
>   - include the code of a new helper from a previously separate patch,
>   - actually limit the scope of the helper to fetching a KTAP report from
> a file descriptor, and let the caller decide on how other steps, like
> setting up filters or loading a test module, and errors they return
> are handled,
>   - similar to kernel taint handling, just omit any remaining dynamic sub-
> subtests if unloading the test module fails,
>   - update commit description with a more detailed justification of why we
> need these changes.
> 
> Signed-off-by: Janusz Krzysztofik 
> Cc: Mauro Carvalho Chehab 
> ---
>  lib/igt_kmod.c | 157 -
>  1 file changed, 52 insertions(+), 105 deletions(-)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index cc242838fa..e9e00ac5b2 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -1018,6 +1018,25 @@ static void kunit_results_free(struct igt_list_head 
> *results,
>   free(*suite_name);
>  }
>  
> +static int kunit_get_results(struct igt_list_head *results, int kmsg_fd)
> +{
> + struct igt_ktap_results *ktap;
> + int err;
> +
> + ktap = igt_ktap_alloc(results);
> + if (igt_debug_on(!ktap))
> + return -ENOMEM;
> +
> + do
> + igt_debug_on((err = kunit_kmsg_result_get(results, NULL, 
> kmsg_fd, ktap),
> +   err && err != -EINPROGRESS));
> + while (err == -EINPROGRESS);
> +
> + igt_ktap_free(ktap);
> +
> + return err;
> +}
> +
>  static void __igt_kunit_legacy(struct igt_ktest *tst,
>  const char *subtest,
>  const char *opts)
> @@ -1211,86 +1230,51 @@ static void __igt_kunit(struct igt_ktest *tst,
>   const char *opts,
>   struct igt_list_head *tests)
>  {
> - struct modprobe_data modprobe = { tst->kmod, opts, 0, pthread_self(), };
> - char *suite_name = NULL, *case_name = NULL;
> - struct igt_ktap_result *t, *r = NULL;
> - struct igt_ktap_results *ktap;
> - pthread_mutexattr_t attr;
> - IGT_LIST_HEAD(results);
> - int ret = -EINPROGRESS;
> - unsigned long taints;
> -
> - igt_skip_on(lseek(tst->kmsg, 0, SEEK_END) < 0);
> -
> - ktap = igt_ktap_alloc();
> - igt_require(ktap);
> + struct igt_ktap_result *t;
>  
>   igt_list_for_each_entry(t, tests, link) {
> + char *suite_name = NULL, *case_name = NULL;
> + IGT_LIST_HEAD(results);
> + unsigned long taints;
> +
>   igt_dynamic_f("%s%s%s",
> strcmp(t->suite_name, subtest) ?  

Re: [PATCH v5] drm/i915/dp: Increase idle pattern wait timeout to 2ms

2024-03-14 Thread Jani Nikula
On Mon, 11 Mar 2024, Gustavo Sousa  wrote:
> Quoting Shekhar Chauhan (2024-03-11 01:15:04-03:00)
>>The driver currently waits 1ms for idle patterns,
>>but for Xe2LPD and possibly future display IPs,
>>it requires a 1640us (rounded up to 2ms) timeout
>>whilst waiting for idle patterns for MST streams.
>>
>>To simplify the code, the timeout is uniformly
>>increased by 1ms across all platforms/display IPs.
>>
>>v1: Introduced the 2ms wait timeout.
>>v2: Segregated the wait timeout for platforms before & after LNL.
>>v3: Fixed 2 cosmetic changes.
>>v4: Revert to v2 design with commit message enhancements.
>>v5: Minor cosmetic changes to the commit message.
>>
>>BSpec: 68849
>>Signed-off-by: Shekhar Chauhan 
>
> Reviewed-by: Gustavo Sousa 

Thanks for the patch and review, pushed to drm-intel-next.

BR,
Jani.

>
>>---
>> drivers/gpu/drm/i915/display/intel_ddi.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c 
>>b/drivers/gpu/drm/i915/display/intel_ddi.c
>>index bea441590204..05ba3642d486 100644
>>--- a/drivers/gpu/drm/i915/display/intel_ddi.c
>>+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
>>@@ -3680,7 +3680,7 @@ static void intel_ddi_set_idle_link_train(struct 
>>intel_dp *intel_dp,
>> 
>> if (intel_de_wait_for_set(dev_priv,
>>   dp_tp_status_reg(encoder, crtc_state),
>>-  DP_TP_STATUS_IDLE_DONE, 1))
>>+  DP_TP_STATUS_IDLE_DONE, 2))
>> drm_err(_priv->drm,
>> "Timed out waiting for DP idle patterns\n");
>> }
>>-- 
>>2.34.1
>>

-- 
Jani Nikula, Intel


Re: [PATCH v18 8/9] drm/i915/display: Compute vrr_vsync params

2024-03-14 Thread Nautiyal, Ankit K



On 3/13/2024 9:26 AM, Mitul Golani wrote:

Compute vrr_vsync_start/end, which sets the position
for hardware to send the Vsync at a fixed position
relative to the end of the Vblank.

--v2:
- Updated VSYNC_START/END macros to VRR_VSYNC_START/END. (Ankit)
- Updated bit fields of VRR_VSYNC_START/END. (Ankit)

--v3:
- Add PIPE_CONF_CHECK_I(vrr.vsync_start/end).
- Read/write vrr_vsync params only when we intend to send
adaptive_sync sdp.

--v4:
- Use VRR_SYNC_START/END macros correctly.

Signed-off-by: Mitul Golani 
---
  drivers/gpu/drm/i915/display/intel_display.c  |  2 ++
  .../drm/i915/display/intel_display_types.h|  1 +
  drivers/gpu/drm/i915/display/intel_vrr.c  | 30 +--
  drivers/gpu/drm/i915/i915_reg.h   |  7 +
  4 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c 
b/drivers/gpu/drm/i915/display/intel_display.c
index 8f1d948408d3..fed4ed18d53b 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -5377,6 +5377,8 @@ intel_pipe_config_compare(const struct intel_crtc_state 
*current_config,
PIPE_CONF_CHECK_I(vrr.flipline);
PIPE_CONF_CHECK_I(vrr.pipeline_full);
PIPE_CONF_CHECK_I(vrr.guardband);
+   PIPE_CONF_CHECK_I(vrr.vsync_start);
+   PIPE_CONF_CHECK_I(vrr.vsync_end);
}
  
  #undef PIPE_CONF_CHECK_X

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
b/drivers/gpu/drm/i915/display/intel_display_types.h
index 8a286751dc39..c2e08f641989 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1430,6 +1430,7 @@ struct intel_crtc_state {
bool enable, in_range;
u8 pipeline_full;
u16 flipline, vmin, vmax, guardband;
+   u32 vsync_end, vsync_start;
} vrr;
  
  	/* Stream Splitter for eDP MSO */

diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c 
b/drivers/gpu/drm/i915/display/intel_vrr.c
index eb5bd0743902..ed38fee196b8 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -9,6 +9,7 @@
  #include "intel_de.h"
  #include "intel_display_types.h"
  #include "intel_vrr.h"
+#include "intel_dp.h"
  
  bool intel_vrr_is_capable(struct intel_connector *connector)

  {
@@ -113,6 +114,7 @@ intel_vrr_compute_config(struct intel_crtc_state 
*crtc_state,
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
struct intel_connector *connector =
to_intel_connector(conn_state->connector);
+   struct intel_dp *intel_dp = intel_attached_dp(connector);
struct drm_display_mode *adjusted_mode = _state->hw.adjusted_mode;
const struct drm_display_info *info = >base.display_info;
int vmin, vmax;
@@ -165,6 +167,15 @@ intel_vrr_compute_config(struct intel_crtc_state 
*crtc_state,
if (crtc_state->uapi.vrr_enabled) {
crtc_state->vrr.enable = true;
crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
+
+   if (intel_dp_as_sdp_supported(intel_dp)) {
+   crtc_state->vrr.vsync_start =
+   (crtc_state->hw.adjusted_mode.crtc_vtotal -
+   
crtc_state->hw.adjusted_mode.vsync_start);
+   crtc_state->vrr.vsync_end =
+   (crtc_state->hw.adjusted_mode.crtc_vtotal -
+   crtc_state->hw.adjusted_mode.vsync_end);
+   }
}
  }
  
@@ -204,6 +215,11 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state)

intel_de_write(dev_priv, TRANS_VRR_VMAX(cpu_transcoder), 
crtc_state->vrr.vmax - 1);
intel_de_write(dev_priv, TRANS_VRR_CTL(cpu_transcoder), 
trans_vrr_ctl(crtc_state));
intel_de_write(dev_priv, TRANS_VRR_FLIPLINE(cpu_transcoder), 
crtc_state->vrr.flipline - 1);
+
+   if (crtc_state->vrr.vsync_end && crtc_state->vrr.vsync_start)
+   intel_de_write(dev_priv, TRANS_VRR_VSYNC(cpu_transcoder),
+  
VRR_VSYNC_END(crtc_state->hw.adjusted_mode.vsync_end) |
+  
VRR_VSYNC_START(crtc_state->hw.adjusted_mode.vsync_start));


Typo here, need to use crtc_state->vrr.vsync_end, 
crtc_state->vrr.vsync_start.


That also explains the mismatch in bat-arls-2

Regards,

Ankit



  }
  
  void intel_vrr_send_push(const struct intel_crtc_state *crtc_state)

@@ -264,7 +280,7 @@ void intel_vrr_get_config(struct intel_crtc_state 
*crtc_state)
  {
struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
-   u32 trans_vrr_ctl;
+   u32 trans_vrr_ctl, trans_vrr_vsync;
  
  	trans_vrr_ctl = intel_de_read(dev_priv, 

✓ Fi.CI.BAT: success for drm/i915/display: DMC wakelock implementation

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915/display: DMC wakelock implementation
URL   : https://patchwork.freedesktop.org/series/131124/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_14429 -> Patchwork_131124v1


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/index.html

Participating hosts (35 -> 33)
--

  Missing(2): bat-dg1-7 fi-snb-2520m 

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_131124v1:

### IGT changes ###

 Suppressed 

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_pm_rpm@module-reload:
- {bat-mtlp-9}:   [PASS][1] -> [WARN][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/bat-mtlp-9/igt@i915_pm_...@module-reload.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-mtlp-9/igt@i915_pm_...@module-reload.html

  
Known issues


  Here are the changes found in Patchwork_131124v1 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@gem_lmem_swapping@parallel-random-engines:
- bat-adlm-1: NOTRUN -> [SKIP][3] ([i915#4613]) +3 other tests skip
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@gem_lmem_swapp...@parallel-random-engines.html

  * igt@i915_pm_rps@basic-api:
- bat-adlm-1: NOTRUN -> [SKIP][4] ([i915#6621])
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@i915_pm_...@basic-api.html

  * igt@i915_selftest@live@gt_lrc:
- bat-atsm-1: [PASS][5] -> [INCOMPLETE][6] ([i915#10094])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/bat-atsm-1/igt@i915_selftest@live@gt_lrc.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-atsm-1/igt@i915_selftest@live@gt_lrc.html

  * igt@kms_force_connector_basic@force-load-detect:
- bat-adlm-1: NOTRUN -> [SKIP][7]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@kms_force_connector_ba...@force-load-detect.html

  * igt@kms_frontbuffer_tracking@basic:
- bat-adlm-1: NOTRUN -> [SKIP][8] ([i915#1849] / [i915#4342])
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@kms_frontbuffer_track...@basic.html

  * igt@kms_pipe_crc_basic@hang-read-crc:
- bat-adlm-1: NOTRUN -> [SKIP][9] ([i915#9875] / [i915#9900]) +6 
other tests skip
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@kms_pipe_crc_ba...@hang-read-crc.html

  * igt@kms_pm_backlight@basic-brightness:
- bat-adlm-1: NOTRUN -> [SKIP][10] ([i915#5354])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@kms_pm_backli...@basic-brightness.html

  * igt@kms_psr@psr-sprite-plane-onoff:
- bat-adlm-1: NOTRUN -> [SKIP][11] ([i915#9673] / [i915#9732]) +3 
other tests skip
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@kms_...@psr-sprite-plane-onoff.html

  * igt@kms_setmode@basic-clone-single-crtc:
- bat-adlm-1: NOTRUN -> [SKIP][12] ([i915#3555])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@kms_setm...@basic-clone-single-crtc.html

  * igt@prime_vgem@basic-fence-flip:
- bat-adlm-1: NOTRUN -> [SKIP][13] ([i915#3708] / [i915#9900])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@prime_v...@basic-fence-flip.html

  * igt@prime_vgem@basic-write:
- bat-adlm-1: NOTRUN -> [SKIP][14] ([i915#3708]) +2 other tests skip
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-adlm-1/igt@prime_v...@basic-write.html

  
 Possible fixes 

  * igt@i915_selftest@live@evict:
- bat-arls-1: [DMESG-WARN][15] -> [PASS][16]
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/bat-arls-1/igt@i915_selftest@l...@evict.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-arls-1/igt@i915_selftest@l...@evict.html

  * igt@i915_selftest@live@execlists:
- bat-arls-1: [DMESG-FAIL][17] ([i915#10262]) -> [PASS][18] +14 
other tests pass
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/bat-arls-1/igt@i915_selftest@l...@execlists.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131124v1/bat-arls-1/igt@i915_selftest@l...@execlists.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-legacy:
- {bat-mtlp-9}:   [DMESG-WARN][19] -> [PASS][20]
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/bat-mtlp-9/igt@kms_cursor_leg...@basic-flip-before-cursor-legacy.html
   [20]: 

✗ Fi.CI.SPARSE: warning for drm/i915/display: DMC wakelock implementation

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915/display: DMC wakelock implementation
URL   : https://patchwork.freedesktop.org/series/131124/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.




✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: DMC wakelock implementation

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/i915/display: DMC wakelock implementation
URL   : https://patchwork.freedesktop.org/series/131124/
State : warning

== Summary ==

Error: dim checkpatch failed
80db5bb4bd35 drm/i915/display: add support for DMC wakelocks
Traceback (most recent call last):
  File "scripts/spdxcheck.py", line 6, in 
from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
-:237: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does 
MAINTAINERS need updating?
#237: 
new file mode 100644

-:242: WARNING:SPDX_LICENSE_TAG: Improper SPDX comment style for 
'drivers/gpu/drm/i915/display/intel_dmc_wl.c', please use '//' instead
#242: FILE: drivers/gpu/drm/i915/display/intel_dmc_wl.c:1:
+/* SPDX-License-Identifier: MIT */

-:242: WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier 
tag in line 1
#242: FILE: drivers/gpu/drm/i915/display/intel_dmc_wl.c:1:
+/* SPDX-License-Identifier: MIT */

-:381: WARNING:RETURN_VOID: void function return statements are not generally 
useful
#381: FILE: drivers/gpu/drm/i915/display/intel_dmc_wl.c:140:
+   return;
+}

-:410: WARNING:RETURN_VOID: void function return statements are not generally 
useful
#410: FILE: drivers/gpu/drm/i915/display/intel_dmc_wl.c:169:
+   return;
+}

-:458: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#458: FILE: drivers/gpu/drm/i915/display/intel_dmc_wl.c:217:
+   if (WARN_RATELIMIT(!refcount_read(>refcount),
+   "Tried to put wakelock with refcount zero\n"))

-:493: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment
#493: FILE: drivers/gpu/drm/i915/display/intel_dmc_wl.h:18:
+   spinlock_t lock;

total: 0 errors, 5 warnings, 2 checks, 452 lines checked
6aad00635acd drm/i915/display: don't allow DMC wakelock on older hardware
60597a92ce84 drm/i915/display: add module parameter to enable DMC wakelock
-:21: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#21: FILE: drivers/gpu/drm/i915/display/intel_display_params.c:120:
+intel_display_param_named_unsafe(enable_dmc_wl, bool, 0400,
+   "Enable DMC wakelock "

total: 0 errors, 0 warnings, 1 checks, 54 lines checked
971e6ab0cf23 drm/i915/display: tie DMC wakelock to DC5/6 state transitions




[PULL] drm-misc-next-fixes

2024-03-14 Thread Thomas Zimmermann
Hi Dave, Sima,

here's the PR for drm-misc-next-fixes for this week. There's a fix
for nouveau BOs and quite a few fixes for get_modes() functions.

Best regards
Thomas

drm-misc-next-fixes-2024-03-14:
Short summary of fixes pull:

probe-helper:
- never return negative values from .get_modes() plus driver fixes

nouveau:
- clear bo resource bus after eviction
- documentation fixes
The following changes since commit 838f865802b9f26135ea7df4e30f89ac2f50c23e:

  arch/powerpc: Remove  from backlight code (2024-03-07 13:34:14 
+0100)

are available in the Git repository at:

  https://gitlab.freedesktop.org/drm/misc/kernel.git 
tags/drm-misc-next-fixes-2024-03-14

for you to fetch changes up to 9dd81b2e1ec72a3759f8d6bb6e9cbef93aab6227:

  drm/exynos: simplify the return value handling in exynos_dp_get_modes() 
(2024-03-13 10:44:14 +0200)


Short summary of fixes pull:

probe-helper:
- never return negative values from .get_modes() plus driver fixes

nouveau:
- clear bo resource bus after eviction
- documentation fixes


Dave Airlie (1):
  nouveau: reset the bo resource bus info after an eviction

Jani Nikula (8):
  drm/probe-helper: warn about negative .get_modes()
  drm/panel: do not return negative error codes from drm_panel_get_modes()
  drm/exynos: do not return negative values from .get_modes()
  drm/bridge: lt8912b: do not return negative values from .get_modes()
  drm/imx/ipuv3: do not return negative values from .get_modes()
  drm/vc4: hdmi: do not return negative values from .get_modes()
  drm/bridge: lt9611uxc: use int for holding number of modes
  drm/exynos: simplify the return value handling in exynos_dp_get_modes()

Timur Tabi (1):
  drm/nouveau: fix kerneldoc warnings

 drivers/gpu/drm/bridge/lontium-lt8912b.c   | 16 +++-
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c |  2 +-
 drivers/gpu/drm/drm_panel.c| 17 +++--
 drivers/gpu/drm/drm_probe_helper.c |  7 +++
 drivers/gpu/drm/exynos/exynos_dp.c |  7 +++
 drivers/gpu/drm/exynos/exynos_drm_vidi.c   |  4 ++--
 drivers/gpu/drm/exynos/exynos_hdmi.c   |  4 ++--
 drivers/gpu/drm/imx/ipuv3/parallel-display.c   |  4 ++--
 drivers/gpu/drm/nouveau/nouveau_bo.c   |  2 ++
 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c |  9 +
 drivers/gpu/drm/vc4/vc4_hdmi.c |  2 +-
 include/drm/drm_modeset_helper_vtables.h   |  3 ++-
 12 files changed, 49 insertions(+), 28 deletions(-)

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


✓ Fi.CI.BAT: success for drm/xe/display: fix type of intel_uncore_read*() functions

2024-03-14 Thread Patchwork
== Series Details ==

Series: drm/xe/display: fix type of intel_uncore_read*() functions
URL   : https://patchwork.freedesktop.org/series/131122/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_14429 -> Patchwork_131122v1


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/index.html

Participating hosts (35 -> 32)
--

  Missing(3): bat-mtlp-8 bat-dg1-7 fi-snb-2520m 

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_131122v1:

### IGT changes ###

 Suppressed 

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_pm_rpm@module-reload:
- {bat-mtlp-9}:   [PASS][1] -> [WARN][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/bat-mtlp-9/igt@i915_pm_...@module-reload.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-mtlp-9/igt@i915_pm_...@module-reload.html

  
Known issues


  Here are the changes found in Patchwork_131122v1 that come from known issues:

### CI changes ###

 Possible fixes 

  * boot:
- bat-jsl-1:  [FAIL][3] ([i915#8293]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/bat-jsl-1/boot.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-jsl-1/boot.html

  

### IGT changes ###

 Issues hit 

  * igt@debugfs_test@basic-hwmon:
- bat-jsl-1:  NOTRUN -> [SKIP][5] ([i915#9318])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-jsl-1/igt@debugfs_t...@basic-hwmon.html

  * igt@gem_huc_copy@huc-copy:
- bat-jsl-1:  NOTRUN -> [SKIP][6] ([i915#2190])
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-jsl-1/igt@gem_huc_c...@huc-copy.html

  * igt@gem_lmem_swapping@parallel-random-engines:
- bat-adlm-1: NOTRUN -> [SKIP][7] ([i915#4613]) +3 other tests skip
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-adlm-1/igt@gem_lmem_swapp...@parallel-random-engines.html

  * igt@gem_lmem_swapping@verify-random:
- bat-jsl-1:  NOTRUN -> [SKIP][8] ([i915#4613]) +3 other tests skip
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-jsl-1/igt@gem_lmem_swapp...@verify-random.html

  * igt@i915_pm_rps@basic-api:
- bat-adlm-1: NOTRUN -> [SKIP][9] ([i915#6621])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-adlm-1/igt@i915_pm_...@basic-api.html

  * igt@i915_selftest@live@hangcheck:
- bat-rpls-3: [PASS][10] -> [DMESG-WARN][11] ([i915#5591])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/bat-rpls-3/igt@i915_selftest@l...@hangcheck.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-rpls-3/igt@i915_selftest@l...@hangcheck.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- bat-jsl-1:  NOTRUN -> [SKIP][12] ([i915#4103]) +1 other test skip
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-jsl-1/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-legacy.html

  * igt@kms_dsc@dsc-basic:
- bat-jsl-1:  NOTRUN -> [SKIP][13] ([i915#3555] / [i915#9886])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-jsl-1/igt@kms_...@dsc-basic.html

  * igt@kms_force_connector_basic@force-load-detect:
- bat-adlm-1: NOTRUN -> [SKIP][14]
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-adlm-1/igt@kms_force_connector_ba...@force-load-detect.html
- bat-jsl-1:  NOTRUN -> [SKIP][15]
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-jsl-1/igt@kms_force_connector_ba...@force-load-detect.html

  * igt@kms_frontbuffer_tracking@basic:
- bat-adlm-1: NOTRUN -> [SKIP][16] ([i915#1849] / [i915#4342])
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-adlm-1/igt@kms_frontbuffer_track...@basic.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-d-dp-2:
- bat-rpls-3: [PASS][17] -> [FAIL][18] ([i915#9666]) +2 other tests 
fail
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14429/bat-rpls-3/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-n...@pipe-d-dp-2.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-rpls-3/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-n...@pipe-d-dp-2.html

  * igt@kms_pipe_crc_basic@hang-read-crc:
- bat-adlm-1: NOTRUN -> [SKIP][19] ([i915#9875] / [i915#9900]) +6 
other tests skip
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_131122v1/bat-adlm-1/igt@kms_pipe_crc_ba...@hang-read-crc.html

  * igt@kms_pm_backlight@basic-brightness:
- bat-adlm-1: 

[PATCH v2 4/4] drm/i915/display: tie DMC wakelock to DC5/6 state transitions

2024-03-14 Thread Luca Coelho
We only need DMC wakelocks when we allow DC5 and DC6 states.  Add the
calls to enable and disable DMC wakelock accordingly.

Signed-off-by: Luca Coelho 
---
 drivers/gpu/drm/i915/display/intel_display_power_well.c | 7 +++
 drivers/gpu/drm/i915/display/intel_dmc.c| 4 
 2 files changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c 
b/drivers/gpu/drm/i915/display/intel_display_power_well.c
index 217f82f1da84..367464f5c5cd 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power_well.c
+++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c
@@ -17,6 +17,7 @@
 #include "intel_dkl_phy.h"
 #include "intel_dkl_phy_regs.h"
 #include "intel_dmc.h"
+#include "intel_dmc_wl.h"
 #include "intel_dp_aux_regs.h"
 #include "intel_dpio_phy.h"
 #include "intel_dpll.h"
@@ -821,6 +822,8 @@ void gen9_enable_dc5(struct drm_i915_private *dev_priv)
intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1,
 0, SKL_SELECT_ALTERNATE_DC_EXIT);
 
+   intel_dmc_wl_enable(dev_priv);
+
gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC5);
 }
 
@@ -850,6 +853,8 @@ void skl_enable_dc6(struct drm_i915_private *dev_priv)
intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1,
 0, SKL_SELECT_ALTERNATE_DC_EXIT);
 
+   intel_dmc_wl_enable(dev_priv);
+
gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
 }
 
@@ -970,6 +975,8 @@ void gen9_disable_dc_states(struct drm_i915_private 
*dev_priv)
if (!HAS_DISPLAY(dev_priv))
return;
 
+   intel_dmc_wl_disable(dev_priv);
+
intel_cdclk_get_cdclk(dev_priv, _config);
/* Can't read out voltage_level so can't use intel_cdclk_changed() */
drm_WARN_ON(_priv->drm,
diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c 
b/drivers/gpu/drm/i915/display/intel_dmc.c
index 3fa851b5c7a6..b20cc018b9a8 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -550,6 +550,8 @@ void intel_dmc_disable_program(struct drm_i915_private 
*i915)
pipedmc_clock_gating_wa(i915, true);
disable_all_event_handlers(i915);
pipedmc_clock_gating_wa(i915, false);
+
+   intel_dmc_wl_disable(i915);
 }
 
 void assert_dmc_loaded(struct drm_i915_private *i915)
@@ -1079,6 +1081,8 @@ void intel_dmc_suspend(struct drm_i915_private *i915)
if (dmc)
flush_work(>work);
 
+   intel_dmc_wl_disable(i915);
+
/* Drop the reference held in case DMC isn't loaded. */
if (!intel_dmc_has_payload(i915))
intel_dmc_runtime_pm_put(i915);
-- 
2.39.2



[PATCH v2 3/4] drm/i915/display: add module parameter to enable DMC wakelock

2024-03-14 Thread Luca Coelho
This feature should be disabled by default until properly tested and
mature.  Add a module parameter to enable the feature for testing,
while keeping it disabled by default for now.

Signed-off-by: Luca Coelho 
---
 drivers/gpu/drm/i915/display/intel_display_params.c |  5 +
 drivers/gpu/drm/i915/display/intel_display_params.h |  1 +
 drivers/gpu/drm/i915/display/intel_dmc_wl.c | 12 
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_params.c 
b/drivers/gpu/drm/i915/display/intel_display_params.c
index 11e03cfb774d..f40b223cc8a1 100644
--- a/drivers/gpu/drm/i915/display/intel_display_params.c
+++ b/drivers/gpu/drm/i915/display/intel_display_params.c
@@ -116,6 +116,11 @@ intel_display_param_named_unsafe(enable_psr2_sel_fetch, 
bool, 0400,
"(0=disabled, 1=enabled) "
"Default: 1");
 
+intel_display_param_named_unsafe(enable_dmc_wl, bool, 0400,
+   "Enable DMC wakelock "
+   "(0=disabled, 1=enabled) "
+   "Default: 0");
+
 __maybe_unused
 static void _param_print_bool(struct drm_printer *p, const char *driver_name,
  const char *name, bool val)
diff --git a/drivers/gpu/drm/i915/display/intel_display_params.h 
b/drivers/gpu/drm/i915/display/intel_display_params.h
index 6206cc51df04..bf8dbbdb20a1 100644
--- a/drivers/gpu/drm/i915/display/intel_display_params.h
+++ b/drivers/gpu/drm/i915/display/intel_display_params.h
@@ -46,6 +46,7 @@ struct drm_i915_private;
param(int, enable_psr, -1, 0600) \
param(bool, psr_safest_params, false, 0400) \
param(bool, enable_psr2_sel_fetch, true, 0400) \
+   param(bool, enable_dmc_wl, false, 0400) \
 
 #define MEMBER(T, member, ...) T member;
 struct intel_display_params {
diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c 
b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
index 6eea81a76fa4..8ad6d70a01b0 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
@@ -120,7 +120,8 @@ void intel_dmc_wl_enable(struct drm_i915_private *i915)
struct intel_dmc_wl *wl = >display.wl;
unsigned long flags;
 
-   if (DISPLAY_VER(i915) < 20)
+   if (!i915->display.params.enable_dmc_wl ||
+   DISPLAY_VER(i915) < 20)
return;
 
spin_lock_irqsave(>lock, flags);
@@ -147,7 +148,8 @@ void intel_dmc_wl_disable(struct drm_i915_private *i915)
struct intel_dmc_wl *wl = >display.wl;
unsigned long flags;
 
-   if (DISPLAY_VER(i915) < 20)
+   if (!i915->display.params.enable_dmc_wl ||
+   DISPLAY_VER(i915) < 20)
return;
 
flush_delayed_work(>work);
@@ -179,7 +181,8 @@ void intel_dmc_wl_get(struct drm_i915_private *i915, 
i915_reg_t reg)
struct intel_dmc_wl *wl = >display.wl;
unsigned long flags;
 
-   if (DISPLAY_VER(i915) < 20)
+   if (!i915->display.params.enable_dmc_wl ||
+   DISPLAY_VER(i915) < 20)
return;
 
if (!intel_dmc_wl_check_range(reg.reg))
@@ -214,7 +217,8 @@ void intel_dmc_wl_put(struct drm_i915_private *i915, 
i915_reg_t reg)
struct intel_dmc_wl *wl = >display.wl;
unsigned long flags;
 
-   if (DISPLAY_VER(i915) < 20)
+   if (!i915->display.params.enable_dmc_wl ||
+   DISPLAY_VER(i915) < 20)
return;
 
if (!intel_dmc_wl_check_range(reg.reg))
-- 
2.39.2



[PATCH v2 2/4] drm/i915/display: don't allow DMC wakelock on older hardware

2024-03-14 Thread Luca Coelho
Only allow running DMC wakelock code if the display version is 20 or
greater.

Signed-off-by: Luca Coelho 
---
 drivers/gpu/drm/i915/display/intel_dmc_wl.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c 
b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
index 7e5d325f5d55..6eea81a76fa4 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
@@ -120,6 +120,9 @@ void intel_dmc_wl_enable(struct drm_i915_private *i915)
struct intel_dmc_wl *wl = >display.wl;
unsigned long flags;
 
+   if (DISPLAY_VER(i915) < 20)
+   return;
+
spin_lock_irqsave(>lock, flags);
 
if (wl->enabled)
@@ -144,6 +147,9 @@ void intel_dmc_wl_disable(struct drm_i915_private *i915)
struct intel_dmc_wl *wl = >display.wl;
unsigned long flags;
 
+   if (DISPLAY_VER(i915) < 20)
+   return;
+
flush_delayed_work(>work);
 
spin_lock_irqsave(>lock, flags);
@@ -173,6 +179,9 @@ void intel_dmc_wl_get(struct drm_i915_private *i915, 
i915_reg_t reg)
struct intel_dmc_wl *wl = >display.wl;
unsigned long flags;
 
+   if (DISPLAY_VER(i915) < 20)
+   return;
+
if (!intel_dmc_wl_check_range(reg.reg))
return;
 
@@ -205,6 +214,9 @@ void intel_dmc_wl_put(struct drm_i915_private *i915, 
i915_reg_t reg)
struct intel_dmc_wl *wl = >display.wl;
unsigned long flags;
 
+   if (DISPLAY_VER(i915) < 20)
+   return;
+
if (!intel_dmc_wl_check_range(reg.reg))
return;
 
-- 
2.39.2



[PATCH v2 1/4] drm/i915/display: add support for DMC wakelocks

2024-03-14 Thread Luca Coelho
In order to reduce the DC5->DC2 restore time, wakelocks have been
introduced in DMC so the driver can tell it when registers and other
memory areas are going to be accessed and keep their respective blocks
awake.

Implement this in the driver by adding the concept of DMC wakelocks.
When the driver needs to access memory which lies inside pre-defined
ranges, it will tell DMC to set the wakelock, access the memory, then
wait for a while and clear the wakelock.

The wakelock state is protected in the driver with spinlocks to
prevent concurrency issues.

BSpec: 71583
Signed-off-by: Luca Coelho 
---
 drivers/gpu/drm/i915/Makefile |   1 +
 drivers/gpu/drm/i915/display/intel_de.h   |  97 +++-
 .../gpu/drm/i915/display/intel_display_core.h |   2 +
 .../drm/i915/display/intel_display_driver.c   |   1 +
 drivers/gpu/drm/i915/display/intel_dmc_regs.h |   6 +
 drivers/gpu/drm/i915/display/intel_dmc_wl.c   | 228 ++
 drivers/gpu/drm/i915/display/intel_dmc_wl.h   |  30 +++
 drivers/gpu/drm/xe/Makefile   |   1 +
 8 files changed, 358 insertions(+), 8 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_dmc_wl.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_dmc_wl.h

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 3ef6ed41e62b..af83ea94c771 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -270,6 +270,7 @@ i915-y += \
display/intel_display_rps.o \
display/intel_display_wa.o \
display/intel_dmc.o \
+   display/intel_dmc_wl.o \
display/intel_dpio_phy.o \
display/intel_dpll.o \
display/intel_dpll_mgr.o \
diff --git a/drivers/gpu/drm/i915/display/intel_de.h 
b/drivers/gpu/drm/i915/display/intel_de.h
index 42552d8c151e..6728a0077793 100644
--- a/drivers/gpu/drm/i915/display/intel_de.h
+++ b/drivers/gpu/drm/i915/display/intel_de.h
@@ -13,52 +13,125 @@
 static inline u32
 intel_de_read(struct drm_i915_private *i915, i915_reg_t reg)
 {
-   return intel_uncore_read(>uncore, reg);
+   u32 val;
+
+   intel_dmc_wl_get(i915, reg);
+
+   val = intel_uncore_read(>uncore, reg);
+
+   intel_dmc_wl_put(i915, reg);
+
+   return val;
 }
 
 static inline u8
 intel_de_read8(struct drm_i915_private *i915, i915_reg_t reg)
 {
-   return intel_uncore_read8(>uncore, reg);
+   u8 val;
+
+   intel_dmc_wl_get(i915, reg);
+
+   val = intel_uncore_read8(>uncore, reg);
+
+   intel_dmc_wl_put(i915, reg);
+
+   return val;
 }
 
 static inline u64
 intel_de_read64_2x32(struct drm_i915_private *i915,
 i915_reg_t lower_reg, i915_reg_t upper_reg)
 {
-   return intel_uncore_read64_2x32(>uncore, lower_reg, upper_reg);
+   u64 val;
+
+   intel_dmc_wl_get(i915, lower_reg);
+   intel_dmc_wl_get(i915, upper_reg);
+
+   val = intel_uncore_read64_2x32(>uncore, lower_reg, upper_reg);
+
+   intel_dmc_wl_put(i915, upper_reg);
+   intel_dmc_wl_put(i915, lower_reg);
+
+   return val;
 }
 
 static inline void
 intel_de_posting_read(struct drm_i915_private *i915, i915_reg_t reg)
 {
+   intel_dmc_wl_get(i915, reg);
+
intel_uncore_posting_read(>uncore, reg);
+
+   intel_dmc_wl_put(i915, reg);
 }
 
 static inline void
 intel_de_write(struct drm_i915_private *i915, i915_reg_t reg, u32 val)
 {
+   intel_dmc_wl_get(i915, reg);
+
intel_uncore_write(>uncore, reg, val);
+
+   intel_dmc_wl_put(i915, reg);
 }
 
 static inline u32
-intel_de_rmw(struct drm_i915_private *i915, i915_reg_t reg, u32 clear, u32 set)
+__intel_de_rmw_nowl(struct drm_i915_private *i915, i915_reg_t reg,
+   u32 clear, u32 set)
 {
return intel_uncore_rmw(>uncore, reg, clear, set);
 }
 
+static inline u32
+intel_de_rmw(struct drm_i915_private *i915, i915_reg_t reg, u32 clear, u32 set)
+{
+   u32 val;
+
+   intel_dmc_wl_get(i915, reg);
+
+   val = __intel_de_rmw_nowl(i915, reg, clear, set);
+
+   intel_dmc_wl_put(i915, reg);
+
+   return val;
+}
+
+static inline int
+__intel_wait_for_register_nowl(struct drm_i915_private *i915, i915_reg_t reg,
+  u32 mask, u32 value, unsigned int timeout)
+{
+   return intel_wait_for_register(>uncore, reg, mask,
+  value, timeout);
+}
+
 static inline int
 intel_de_wait_for_register(struct drm_i915_private *i915, i915_reg_t reg,
   u32 mask, u32 value, unsigned int timeout)
 {
-   return intel_wait_for_register(>uncore, reg, mask, value, 
timeout);
+   int ret;
+
+   intel_dmc_wl_get(i915, reg);
+
+   ret = __intel_wait_for_register_nowl(i915, reg, mask, value, timeout);
+
+   intel_dmc_wl_put(i915, reg);
+
+   return ret;
 }
 
 static inline int
 intel_de_wait_for_register_fw(struct drm_i915_private *i915, i915_reg_t reg,
  u32 mask, u32 value, unsigned int timeout)
 {
- 

[PATCH v2 0/4] drm/i915/display: DMC wakelock implementation

2024-03-14 Thread Luca Coelho
Hi,

This is the fourth version of my series, the second as a proper
patchset.  Now sent for the drm-tip (intel-gfx).

The changes comparing to v1 are just addressing Gustavo's comments.
The major changes are:

  * Enable/disable the wakelocks on DC5-6 entry and exit instead of on
DMC load and unload;
  * Added bspec link to the commit message;
  * A bunch of other small changes.

For the complete list of changes and discussions, please look at the
patchset in patchwork: https://patchwork.freedesktop.org/series/128628/

Please review.

Cheers,
Luca.


Luca Coelho (4):
  drm/i915/display: add support for DMC wakelocks
  drm/i915/display: don't allow DMC wakelock on older hardware
  drm/i915/display: add module parameter to enable DMC wakelock
  drm/i915/display: tie DMC wakelock to DC5/6 state transitions

 drivers/gpu/drm/i915/Makefile |   1 +
 drivers/gpu/drm/i915/display/intel_de.h   |  97 ++-
 .../gpu/drm/i915/display/intel_display_core.h |   2 +
 .../drm/i915/display/intel_display_driver.c   |   1 +
 .../drm/i915/display/intel_display_params.c   |   5 +
 .../drm/i915/display/intel_display_params.h   |   1 +
 .../i915/display/intel_display_power_well.c   |   7 +
 drivers/gpu/drm/i915/display/intel_dmc.c  |   4 +
 drivers/gpu/drm/i915/display/intel_dmc_regs.h |   6 +
 drivers/gpu/drm/i915/display/intel_dmc_wl.c   | 244 ++
 drivers/gpu/drm/i915/display/intel_dmc_wl.h   |  30 +++
 drivers/gpu/drm/xe/Makefile   |   1 +
 12 files changed, 391 insertions(+), 8 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_dmc_wl.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_dmc_wl.h

-- 
2.39.2



[PATCH] drm/xe/display: fix type of intel_uncore_read*() functions

2024-03-14 Thread Luca Coelho
Some of the backported intel_uncore_read*() functions used the wrong
types.  Change the function declarations accordingly.

Reviewed-by: Gustavo Sousa 
Signed-off-by: Luca Coelho 
---
 drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h 
b/drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h
index cd26ddc0f69e..ef79793caa72 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h
@@ -25,15 +25,15 @@ static inline u32 intel_uncore_read(struct intel_uncore 
*uncore,
return xe_mmio_read32(__compat_uncore_to_gt(uncore), reg);
 }
 
-static inline u32 intel_uncore_read8(struct intel_uncore *uncore,
-i915_reg_t i915_reg)
+static inline u8 intel_uncore_read8(struct intel_uncore *uncore,
+   i915_reg_t i915_reg)
 {
struct xe_reg reg = XE_REG(i915_mmio_reg_offset(i915_reg));
 
return xe_mmio_read8(__compat_uncore_to_gt(uncore), reg);
 }
 
-static inline u32 intel_uncore_read16(struct intel_uncore *uncore,
+static inline u16 intel_uncore_read16(struct intel_uncore *uncore,
  i915_reg_t i915_reg)
 {
struct xe_reg reg = XE_REG(i915_mmio_reg_offset(i915_reg));
-- 
2.39.2