Re: [Intel-gfx] [PATCHv3] drm/i915/display/dp: On AUX xfer timeout restart freshly

2023-06-19 Thread Murthy, Arun R
> -Original Message-
> From: Deak, Imre 
> Sent: Tuesday, June 13, 2023 4:19 PM
> To: Murthy, Arun R 
> Cc: intel-gfx@lists.freedesktop.org; Nikula, Jani 
> Subject: Re: [PATCHv3] drm/i915/display/dp: On AUX xfer timeout restart
> freshly
> 
> On Tue, Jun 13, 2023 at 10:12:39AM +0530, Arun R Murthy wrote:
> > On AUX transfer timeout, as per DP spec need to retry for 3 times and
> > has to be restarted freshly.
> >
> > v3: handle timeout and dont rely on register value on timeout (Imre)
> >
> > Signed-off-by: Arun R Murthy 
> > ---
> >  .../drm/i915/display/intel_display_types.h|  1 -
> >  drivers/gpu/drm/i915/display/intel_dp_aux.c   | 72 +--
> >  2 files changed, 34 insertions(+), 39 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h
> > b/drivers/gpu/drm/i915/display/intel_display_types.h
> > index 2d8297f8d088..0942b109b4ca 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > @@ -1741,7 +1741,6 @@ struct intel_dp {
> > /* sink or branch descriptor */
> > struct drm_dp_desc desc;
> > struct drm_dp_aux aux;
> > -   u32 aux_busy_last_status;
> > u8 train_set[4];
> >
> > struct intel_pps pps;
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > index 0c27db8ae4f1..244b4d7d716d 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > @@ -36,25 +36,24 @@ static void intel_dp_aux_unpack(u32 src, u8 *dst,
> int dst_bytes)
> > dst[i] = src >> ((3 - i) * 8);
> >  }
> >
> > -static u32
> > -intel_dp_aux_wait_done(struct intel_dp *intel_dp)
> > +static int
> > +intel_dp_aux_wait_done(struct intel_dp *intel_dp, u32 *status)
> >  {
> > struct drm_i915_private *i915 = dp_to_i915(intel_dp);
> > i915_reg_t ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
> > const unsigned int timeout_ms = 10;
> > -   u32 status;
> > int ret;
> >
> > ret = __intel_de_wait_for_register(i915, ch_ctl,
> >DP_AUX_CH_CTL_SEND_BUSY, 0,
> > -  2, timeout_ms, &status);
> > +  50, timeout_ms, status);
> >
> > if (ret == -ETIMEDOUT)
> > drm_err(&i915->drm,
> > "%s: did not complete or timeout within %ums
> (status 0x%08x)\n",
> > -   intel_dp->aux.name, timeout_ms, status);
> > +   intel_dp->aux.name, timeout_ms, *status);
> >
> > -   return status;
> > +   return ret;
> >  }
> >
> >  static u32 g4x_get_aux_clock_divider(struct intel_dp *intel_dp, int
> > index) @@ -186,10 +185,7 @@ static u32 skl_get_aux_send_ctl(struct
> intel_dp *intel_dp,
> >  */
> > ret = DP_AUX_CH_CTL_SEND_BUSY |
> > DP_AUX_CH_CTL_DONE |
> > -   DP_AUX_CH_CTL_INTERRUPT |
> 
> The above one-liner change, also applied in g4x_get_aux_send_ctl() should
> be a separate patch.
> 
> > -   DP_AUX_CH_CTL_TIME_OUT_ERROR |
> > DP_AUX_CH_CTL_TIME_OUT_MAX |
> > -   DP_AUX_CH_CTL_RECEIVE_ERROR |
> > DP_AUX_CH_CTL_MESSAGE_SIZE(send_bytes) |
> >
>   DP_AUX_CH_CTL_FW_SYNC_PULSE_SKL(intel_dp_aux_fw_sync_len())
> |
> >
>   DP_AUX_CH_CTL_SYNC_PULSE_SKL(intel_dp_aux_sync_len());
> > @@ -273,30 +269,6 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
> >  * it using the same AUX CH simultaneously
> >  */
> >
> > -   /* Try to wait for any previous AUX channel activity */
> > -   for (try = 0; try < 3; try++) {
> > -   status = intel_de_read_notrace(i915, ch_ctl);
> > -   if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
> > -   break;
> > -   msleep(1);
> > -   }
> > -   /* just trace the final value */
> > -   trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
> > -
> > -   if (try == 3) {
> > -   const u32 status = intel_de_read(i915, ch_ctl);
> > -
> > -   if (status != intel_dp->aux_busy_last_status) {
> > -   drm_WARN(&i915->drm, 1,
> > -"%s: not started (status 0x%08x)\n",
> > -intel_dp->aux.name, status);
> > -   intel_dp->aux_busy_last_status = status;
> > -   }
> > -
> > -   ret = -EBUSY;
> > -   goto out;
> > -   }
> > -
> > /* Only 5 data registers! */
> > if (drm_WARN_ON(&i915->drm, send_bytes > 20 || recv_size > 20)) {
> > ret = -E2BIG;
> > @@ -304,14 +276,31 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
> > }
> >
> > while ((aux_clock_divider = intel_dp-
> >get_aux_clock_divider(intel_dp, clock++))) {
> > -   u32 send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
> > +   /* Must try at least 3 times according to DP spec */
> > +   for (try = 0; try < 5; try++) {
> > +   u32 send_

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/display/dp: On AUX xfer timeout restart freshly (rev6)

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915/display/dp: On AUX xfer timeout restart freshly (rev6)
URL   : https://patchwork.freedesktop.org/series/119055/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13290 -> Patchwork_119055v6


Summary
---

  **SUCCESS**

  No regressions found.

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

Participating hosts (42 -> 41)
--

  Missing(1): fi-snb-2520m 

Known issues


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

### IGT changes ###

 Issues hit 

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

  * igt@gem_tiled_pread_basic:
- bat-adlp-11:NOTRUN -> [SKIP][2] ([i915#3282])
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-adlp-11/igt@gem_tiled_pread_basic.html

  * igt@i915_selftest@live@slpc:
- bat-rpls-2: NOTRUN -> [DMESG-WARN][3] ([i915#6367])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-rpls-2/igt@i915_selftest@l...@slpc.html

  * igt@i915_suspend@basic-s2idle-without-i915:
- bat-rpls-2: NOTRUN -> [ABORT][4] ([i915#6687] / [i915#8668])
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-rpls-2/igt@i915_susp...@basic-s2idle-without-i915.html

  * igt@i915_suspend@basic-s3-without-i915:
- bat-rpls-1: NOTRUN -> [ABORT][5] ([i915#6687] / [i915#7978])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-rpls-1/igt@i915_susp...@basic-s3-without-i915.html

  * igt@kms_chamelium_frames@hdmi-crc-fast:
- bat-adlp-11:NOTRUN -> [SKIP][6] ([i915#7828]) +7 similar issues
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-adlp-11/igt@kms_chamelium_fra...@hdmi-crc-fast.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- bat-adlp-11:NOTRUN -> [SKIP][7] ([i915#4103]) +1 similar issue
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-adlp-11/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-legacy.html

  * igt@kms_force_connector_basic@prune-stale-modes:
- bat-adlp-11:NOTRUN -> [SKIP][8] ([i915#4093]) +3 similar issues
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-adlp-11/igt@kms_force_connector_ba...@prune-stale-modes.html

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-d-hdmi-a-3:
- bat-dg2-11: [PASS][9] -> [INCOMPLETE][10] ([i915#7908])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-dg2-11/igt@kms_pipe_crc_basic@suspend-read-...@pipe-d-hdmi-a-3.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-dg2-11/igt@kms_pipe_crc_basic@suspend-read-...@pipe-d-hdmi-a-3.html

  
 Possible fixes 

  * igt@core_auth@basic-auth:
- bat-adlp-11:[ABORT][11] ([i915#8011]) -> [PASS][12]
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-adlp-11/igt@core_a...@basic-auth.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-adlp-11/igt@core_a...@basic-auth.html

  * igt@i915_module_load@load:
- bat-adlp-11:[DMESG-WARN][13] ([i915#4423]) -> [PASS][14]
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-adlp-11/igt@i915_module_l...@load.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-adlp-11/igt@i915_module_l...@load.html

  * igt@i915_selftest@live@gt_mocs:
- bat-mtlp-6: [DMESG-FAIL][15] ([i915#7059]) -> [PASS][16]
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html

  * igt@i915_selftest@live@migrate:
- bat-atsm-1: [DMESG-FAIL][17] ([i915#7699] / [i915#7913]) -> 
[PASS][18]
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-atsm-1/igt@i915_selftest@l...@migrate.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-atsm-1/igt@i915_selftest@l...@migrate.html

  * igt@i915_selftest@live@reset:
- bat-rpls-1: [ABORT][19] ([i915#4983] / [i915#7461] / [i915#7981] 
/ [i915#8347] / [i915#8384]) -> [PASS][20]
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-rpls-1/igt@i915_selftest@l...@reset.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v6/bat-rpls-1/igt@i915_selftest@l...@reset.html
- bat-rpls-2: [ABORT][21] ([i915#4983] / [i915#7461] / [i915#7913] 
/ [i915#7981] / [i915#8347]) -> [PASS][22]
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-rpls-2/igt@i915_selftest@l...@reset.html
   [22]:

[Intel-gfx] [NOT_FOR_REVIEW PATCH] drm/i915/display/dp: On AUX xfer timeout restart freshly

2023-06-19 Thread Arun R Murthy
At the beginning of the aux transfer a check for aux control busy bit is
done. Then as per the spec on aux transfer timeout, need to retry
freshly for 3 times with a delay which is taken care by the control
register.
On each of these 3 trials a check for busy has to be done so as to start
freshly.

v2: updated the commit message
v4: check for SEND_BUSY after write (Imre)
v5: reverted the send_ctl to the while loop (Jani)

Signed-off-by: Arun R Murthy 
---
 drivers/gpu/drm/i915/display/intel_dp_aux.c | 55 ++---
 1 file changed, 25 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c 
b/drivers/gpu/drm/i915/display/intel_dp_aux.c
index 21b50a5c8a85..ca86b59b57f8 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
@@ -226,6 +226,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
int i, ret, recv_bytes;
int try, clock = 0;
u32 status;
+   u32 send_ctl;
bool vdd;
 
ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
@@ -273,30 +274,6 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
 * it using the same AUX CH simultaneously
 */
 
-   /* Try to wait for any previous AUX channel activity */
-   for (try = 0; try < 3; try++) {
-   status = intel_de_read_notrace(i915, ch_ctl);
-   if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
-   break;
-   msleep(1);
-   }
-   /* just trace the final value */
-   trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
-
-   if (try == 3) {
-   const u32 status = intel_de_read(i915, ch_ctl);
-
-   if (status != intel_dp->aux_busy_last_status) {
-   drm_WARN(&i915->drm, 1,
-"%s: not started (status 0x%08x)\n",
-intel_dp->aux.name, status);
-   intel_dp->aux_busy_last_status = status;
-   }
-
-   ret = -EBUSY;
-   goto out;
-   }
-
/* Only 5 data registers! */
if (drm_WARN_ON(&i915->drm, send_bytes > 20 || recv_size > 20)) {
ret = -E2BIG;
@@ -304,14 +281,31 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
}
 
while ((aux_clock_divider = intel_dp->get_aux_clock_divider(intel_dp, 
clock++))) {
-   u32 send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
- send_bytes,
- aux_clock_divider);
+   /* FIXME: Must try at least 3 times according to DP spec */
+   for (try = 0; try < 5; try++) {
+   send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
+ send_bytes,
+ 
aux_clock_divider);
+   send_ctl |= aux_send_ctl_flags;
 
-   send_ctl |= aux_send_ctl_flags;
+   /* Try to wait for any previous AUX channel activity */
+   status = intel_dp_aux_wait_done(intel_dp);
+   /* just trace the final value */
+   trace_i915_reg_rw(false, ch_ctl, status, 
sizeof(status), true);
+
+   if (status & DP_AUX_CH_CTL_SEND_BUSY) {
+   drm_WARN(&i915->drm, 1,
+"%s: not started, previous Tx still in 
process (status 0x%08x)\n",
+intel_dp->aux.name, status);
+   intel_dp->aux_busy_last_status = status;
+   if (try > 3) {
+   ret = -EBUSY;
+   goto out;
+   } else {
+   continue;
+   }
+   }
 
-   /* Must try at least 3 times according to DP spec */
-   for (try = 0; try < 5; try++) {
/* Load the send data into the aux channel data 
registers */
for (i = 0; i < send_bytes; i += 4)
intel_de_write(i915, ch_data[i >> 2],
@@ -321,6 +315,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
/* Send the command and wait for it to complete */
intel_de_write(i915, ch_ctl, send_ctl);
 
+   /* TODO: if typeC then 4.2ms else 800us. For DG2 add 
1.5ms for both cases */
status = intel_dp_aux_wait_done(intel_dp);
 
/* Clear done status and any errors */
-- 
2.25.1



[Intel-gfx] [linux-next:master] BUILD REGRESSION 47045630bc409ce6606d97b790895210dd1d517d

2023-06-19 Thread kernel test robot
tree/branch: 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
branch HEAD: 47045630bc409ce6606d97b790895210dd1d517d  Add linux-next specific 
files for 20230619

Error/Warning reports:

https://lore.kernel.org/oe-kbuild-all/20230613.hher4zoo-...@intel.com
https://lore.kernel.org/oe-kbuild-all/202306141934.ukmm9bfx-...@intel.com
https://lore.kernel.org/oe-kbuild-all/202306151954.rsz6hp7h-...@intel.com
https://lore.kernel.org/oe-kbuild-all/202306191640.ne97q8g3-...@intel.com
https://lore.kernel.org/oe-kbuild-all/202306200328.nx4jlbdv-...@intel.com

Error/Warning: (recently discovered and may have been fixed)

arch/parisc/kernel/pdt.c:65:6: warning: no previous prototype for 
'arch_report_meminfo' [-Wmissing-prototypes]
arch/riscv/kvm/aia_imsic.c:237:9: error: call to undeclared function 
'arch_atomic_long_fetch_or'; ISO C99 and later do not support implicit function 
declarations [-Wimplicit-function-declaration]
drivers/char/mem.c:164:25: error: implicit declaration of function 
'unxlate_dev_mem_ptr'; did you mean 'xlate_dev_mem_ptr'? 
[-Werror=implicit-function-declaration]
drivers/gpu/drm/i915/display/intel_display_power.h:255:70: error: declaration 
of 'struct seq_file' will not be visible outside of this function 
[-Werror,-Wvisibility]
drivers/leds/leds-cht-wcove.c:144:21: warning: no previous prototype for 
'cht_wc_leds_brightness_get' [-Wmissing-prototypes]
lib/kunit/executor_test.c:138:4: warning: cast from 'void (*)(const void *)' to 
'kunit_action_t *' (aka 'void (*)(void *)') converts to incompatible function 
type [-Wcast-function-type-strict]
lib/kunit/test.c:775:38: warning: cast from 'void (*)(const void *)' to 
'kunit_action_t *' (aka 'void (*)(void *)') converts to incompatible function 
type [-Wcast-function-type-strict]
security/apparmor/policy_unpack.c:1173: warning: expecting prototype for 
verify_dfa_accept_xindex(). Prototype was for verify_dfa_accept_index() instead

Unverified Error/Warning (likely false positive, please contact us if 
interested):

drivers/staging/media/atomisp/pci/atomisp_fops.c:517 atomisp_open() warn: 
missing unwind goto?
drivers/usb/cdns3/cdns3-starfive.c:23: warning: expecting prototype for 
cdns3(). Prototype was for USB_STRAP_HOST() instead
fs/smb/client/cifsfs.c:984 cifs_smb3_do_mount() warn: possible memory leak of 
'cifs_sb'
fs/smb/client/cifssmb.c:4089 CIFSFindFirst() warn: missing error code? 'rc'
fs/smb/client/cifssmb.c:4216 CIFSFindNext() warn: missing error code? 'rc'
fs/smb/client/connect.c:2775 cifs_match_super() error: 'tlink' dereferencing 
possible ERR_PTR()
fs/smb/client/connect.c:2974 generic_ip_connect() error: we previously assumed 
'socket' could be null (see line 2962)
{standard input}: Error: local label `"2" (instance number 9 of a fb label)' is 
not defined
{standard input}:1097: Error: pcrel too far

Error/Warning ids grouped by kconfigs:

gcc_recent_errors
|-- i386-allyesconfig
|   `-- 
drivers-leds-leds-cht-wcove.c:warning:no-previous-prototype-for-cht_wc_leds_brightness_get
|-- i386-randconfig-m021-20230618
|   |-- 
drivers-staging-media-atomisp-pci-atomisp_fops.c-atomisp_open()-warn:missing-unwind-goto
|   |-- 
fs-smb-client-cifsfs.c-cifs_smb3_do_mount()-warn:possible-memory-leak-of-cifs_sb
|   |-- fs-smb-client-cifssmb.c-CIFSFindFirst()-warn:missing-error-code-rc
|   |-- fs-smb-client-cifssmb.c-CIFSFindNext()-warn:missing-error-code-rc
|   |-- 
fs-smb-client-connect.c-cifs_match_super()-error:tlink-dereferencing-possible-ERR_PTR()
|   `-- 
fs-smb-client-connect.c-generic_ip_connect()-error:we-previously-assumed-socket-could-be-null-(see-line-)
|-- parisc-allyesconfig
|   `-- 
arch-parisc-kernel-pdt.c:warning:no-previous-prototype-for-arch_report_meminfo
|-- parisc-defconfig
|   `-- 
arch-parisc-kernel-pdt.c:warning:no-previous-prototype-for-arch_report_meminfo
|-- parisc-randconfig-r001-20230619
|   `-- 
arch-parisc-kernel-pdt.c:warning:no-previous-prototype-for-arch_report_meminfo
|-- parisc-randconfig-s042-20230618
|   `-- 
arch-parisc-kernel-pdt.c:warning:no-previous-prototype-for-arch_report_meminfo
|-- parisc64-defconfig
|   `-- 
arch-parisc-kernel-pdt.c:warning:no-previous-prototype-for-arch_report_meminfo
|-- riscv-allmodconfig
|   `-- 
drivers-usb-cdns3-cdns3-starfive.c:warning:expecting-prototype-for-cdns3().-Prototype-was-for-USB_STRAP_HOST()-instead
|-- riscv-allyesconfig
|   `-- 
drivers-usb-cdns3-cdns3-starfive.c:warning:expecting-prototype-for-cdns3().-Prototype-was-for-USB_STRAP_HOST()-instead
|-- riscv-randconfig-s051-20230618
|   `-- 
arch-riscv-kernel-signal.c:sparse:sparse:incorrect-type-in-initializer-(different-address-spaces)-expected-void-__val-got-void-noderef-__user-assigned-datap
|-- sh-allmodconfig
|   |-- 
drivers-char-mem.c:error:implicit-declaration-of-function-unxlate_dev_mem_pt

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/display/dp: On AUX xfer timeout restart freshly (rev5)

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915/display/dp: On AUX xfer timeout restart freshly (rev5)
URL   : https://patchwork.freedesktop.org/series/119055/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13290 -> Patchwork_119055v5


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_119055v5 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_119055v5, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

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

Participating hosts (42 -> 42)
--

  Additional (1): fi-kbl-soraka 
  Missing(1): fi-snb-2520m 

Possible new issues
---

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

### IGT changes ###

 Possible regressions 

  * igt@prime_self_import@basic-llseek-size:
- fi-kbl-soraka:  NOTRUN -> [INCOMPLETE][1]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/fi-kbl-soraka/igt@prime_self_imp...@basic-llseek-size.html

  
Known issues


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

### IGT changes ###

 Issues hit 

  * igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka:  NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#2190])
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html

  * igt@gem_lmem_swapping@basic:
- fi-kbl-soraka:  NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#4613]) +3 
similar issues
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/fi-kbl-soraka/igt@gem_lmem_swapp...@basic.html

  * igt@i915_selftest@live@gt_heartbeat:
- fi-kbl-soraka:  NOTRUN -> [DMESG-FAIL][4] ([i915#5334] / [i915#7872])
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html

  * igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka:  NOTRUN -> [DMESG-FAIL][5] ([i915#1886] / [i915#7913])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html

  * igt@i915_selftest@live@guc:
- bat-rpls-1: NOTRUN -> [DMESG-WARN][6] ([i915#7852])
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/bat-rpls-1/igt@i915_selftest@l...@guc.html

  * igt@i915_selftest@live@requests:
- bat-mtlp-8: [PASS][7] -> [DMESG-FAIL][8] ([i915#8497])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-mtlp-8/igt@i915_selftest@l...@requests.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/bat-mtlp-8/igt@i915_selftest@l...@requests.html

  * igt@i915_selftest@live@slpc:
- bat-rpls-2: NOTRUN -> [DMESG-WARN][9] ([i915#6367])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/bat-rpls-2/igt@i915_selftest@l...@slpc.html
- bat-rpls-1: NOTRUN -> [DMESG-WARN][10] ([i915#6367])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/bat-rpls-1/igt@i915_selftest@l...@slpc.html

  * igt@i915_suspend@basic-s2idle-without-i915:
- bat-rpls-2: NOTRUN -> [ABORT][11] ([i915#6687] / [i915#8668])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/bat-rpls-2/igt@i915_susp...@basic-s2idle-without-i915.html

  * igt@i915_suspend@basic-s3-without-i915:
- bat-rpls-1: NOTRUN -> [ABORT][12] ([i915#6687] / [i915#7978])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/bat-rpls-1/igt@i915_susp...@basic-s3-without-i915.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-kbl-soraka:  NOTRUN -> [SKIP][13] ([fdo#109271]) +14 similar issues
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/fi-kbl-soraka/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_setmode@basic-clone-single-crtc:
- fi-kbl-soraka:  NOTRUN -> [SKIP][14] ([fdo#109271] / [i915#4579])
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/fi-kbl-soraka/igt@kms_setm...@basic-clone-single-crtc.html

  
 Possible fixes 

  * igt@i915_selftest@live@migrate:
- bat-atsm-1: [DMESG-FAIL][15] ([i915#7699] / [i915#7913]) -> 
[PASS][16]
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-atsm-1/igt@i915_selftest@l...@migrate.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v5/bat-atsm-1/igt@i915_selftest@l...@migrate.html

  * igt@i915_selftest@live@reset:
- bat-rpls-1: [ABORT][17] ([i915#4983] / [i915#7461] / [i915#7981] 
/ [i915#8347] / [i915#8384]) -> [PASS][18]
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-rpls-1/igt@i915_selftest@l

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/display/dp: Remove support for UHBR13.5

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915/display/dp: Remove support for UHBR13.5
URL   : https://patchwork.freedesktop.org/series/119555/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13290 -> Patchwork_119555v1


Summary
---

  **SUCCESS**

  No regressions found.

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

Participating hosts (42 -> 41)
--

  Additional (1): fi-kbl-soraka 
  Missing(2): fi-snb-2520m fi-pnv-d510 

Known issues


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

### IGT changes ###

 Issues hit 

  * igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka:  NOTRUN -> [SKIP][1] ([fdo#109271] / [i915#2190])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html

  * igt@gem_lmem_swapping@basic:
- fi-kbl-soraka:  NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#4613]) +3 
similar issues
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/fi-kbl-soraka/igt@gem_lmem_swapp...@basic.html

  * igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka:  NOTRUN -> [DMESG-FAIL][3] ([i915#1886] / [i915#7913])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html

  * igt@i915_selftest@live@slpc:
- bat-rpls-2: NOTRUN -> [DMESG-WARN][4] ([i915#6367])
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/bat-rpls-2/igt@i915_selftest@l...@slpc.html

  * igt@i915_suspend@basic-s2idle-without-i915:
- bat-rpls-2: NOTRUN -> [ABORT][5] ([i915#6687] / [i915#8668])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/bat-rpls-2/igt@i915_susp...@basic-s2idle-without-i915.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-kbl-soraka:  NOTRUN -> [SKIP][6] ([fdo#109271]) +14 similar issues
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/fi-kbl-soraka/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_pipe_crc_basic@nonblocking-crc@pipe-c-dp-1:
- bat-dg2-8:  [PASS][7] -> [FAIL][8] ([i915#7932])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-...@pipe-c-dp-1.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-...@pipe-c-dp-1.html

  * igt@kms_setmode@basic-clone-single-crtc:
- fi-kbl-soraka:  NOTRUN -> [SKIP][9] ([fdo#109271] / [i915#4579])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/fi-kbl-soraka/igt@kms_setm...@basic-clone-single-crtc.html

  
 Possible fixes 

  * igt@i915_selftest@live@gt_mocs:
- bat-mtlp-6: [DMESG-FAIL][10] ([i915#7059]) -> [PASS][11]
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html

  * igt@i915_selftest@live@migrate:
- bat-atsm-1: [DMESG-FAIL][12] ([i915#7699] / [i915#7913]) -> 
[PASS][13]
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-atsm-1/igt@i915_selftest@l...@migrate.html
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/bat-atsm-1/igt@i915_selftest@l...@migrate.html

  * igt@i915_selftest@live@reset:
- bat-rpls-2: [ABORT][14] ([i915#4983] / [i915#7461] / [i915#7913] 
/ [i915#7981] / [i915#8347]) -> [PASS][15]
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-rpls-2/igt@i915_selftest@l...@reset.html
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/bat-rpls-2/igt@i915_selftest@l...@reset.html

  * igt@i915_selftest@live@workarounds:
- bat-mtlp-6: [DMESG-FAIL][16] ([i915#6763]) -> [PASS][17]
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-mtlp-6/igt@i915_selftest@l...@workarounds.html
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/bat-mtlp-6/igt@i915_selftest@l...@workarounds.html

  
 Warnings 

  * igt@i915_module_load@load:
- bat-adlp-11:[DMESG-WARN][18] ([i915#4423]) -> [ABORT][19] 
([i915#4423])
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-adlp-11/igt@i915_module_l...@load.html
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119555v1/bat-adlp-11/igt@i915_module_l...@load.html

  * igt@i915_selftest@live@reset:
- bat-rpls-1: [ABORT][20] ([i915#4983] / [i915#7461] / [i915#7981] 
/ [i915#8347] / [i915#8384]) -> [ABORT][21] ([i915#4983] / [i915#7461] / 
[i915#8347] / [i915#8384])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13290/bat-rpls-1/igt@i915_selftest@l...@reset.html
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwor

[Intel-gfx] [PATCHv5] drm/i915/display/dp: On AUX xfer timeout restart freshly

2023-06-19 Thread Arun R Murthy
At the beginning of the aux transfer a check for aux control busy bit is
done. Then as per the spec on aux transfer timeout, need to retry
freshly for 3 times with a delay which is taken care by the control
register.
On each of these 3 trials a check for busy has to be done so as to start
freshly.

v2: updated the commit message
v4: check for SEND_BUSY after write (Imre)
v5: reverted the send_ctl to the while loop (Jani)

Signed-off-by: Arun R Murthy 
---
 drivers/gpu/drm/i915/display/intel_dp_aux.c | 56 ++---
 1 file changed, 26 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c 
b/drivers/gpu/drm/i915/display/intel_dp_aux.c
index 21b50a5c8a85..495e7b91db58 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
@@ -226,6 +226,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
int i, ret, recv_bytes;
int try, clock = 0;
u32 status;
+   u32 send_ctl;
bool vdd;
 
ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
@@ -273,30 +274,6 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
 * it using the same AUX CH simultaneously
 */
 
-   /* Try to wait for any previous AUX channel activity */
-   for (try = 0; try < 3; try++) {
-   status = intel_de_read_notrace(i915, ch_ctl);
-   if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
-   break;
-   msleep(1);
-   }
-   /* just trace the final value */
-   trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
-
-   if (try == 3) {
-   const u32 status = intel_de_read(i915, ch_ctl);
-
-   if (status != intel_dp->aux_busy_last_status) {
-   drm_WARN(&i915->drm, 1,
-"%s: not started (status 0x%08x)\n",
-intel_dp->aux.name, status);
-   intel_dp->aux_busy_last_status = status;
-   }
-
-   ret = -EBUSY;
-   goto out;
-   }
-
/* Only 5 data registers! */
if (drm_WARN_ON(&i915->drm, send_bytes > 20 || recv_size > 20)) {
ret = -E2BIG;
@@ -304,14 +281,31 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
}
 
while ((aux_clock_divider = intel_dp->get_aux_clock_divider(intel_dp, 
clock++))) {
-   u32 send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
- send_bytes,
- aux_clock_divider);
-
+   send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
+ send_bytes,
+ aux_clock_divider);
send_ctl |= aux_send_ctl_flags;
 
-   /* Must try at least 3 times according to DP spec */
+   /* FIXME: Must try at least 3 times according to DP spec */
for (try = 0; try < 5; try++) {
+   /* Try to wait for any previous AUX channel activity */
+   status = intel_dp_aux_wait_done(intel_dp);
+   /* just trace the final value */
+   trace_i915_reg_rw(false, ch_ctl, status, 
sizeof(status), true);
+
+   if (status & DP_AUX_CH_CTL_SEND_BUSY) {
+   drm_WARN(&i915->drm, 1,
+"%s: not started, previous Tx still in 
process (status 0x%08x)\n",
+intel_dp->aux.name, status);
+   intel_dp->aux_busy_last_status = status;
+   if (try > 3) {
+   ret = -EBUSY;
+   goto out;
+   } else {
+   continue;
+   }
+   }
+
/* Load the send data into the aux channel data 
registers */
for (i = 0; i < send_bytes; i += 4)
intel_de_write(i915, ch_data[i >> 2],
@@ -321,6 +315,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
/* Send the command and wait for it to complete */
intel_de_write(i915, ch_ctl, send_ctl);
 
+   /* TODO: if typeC then 4.2ms else 800us. For DG2 add 
1.5ms for both cases */
status = intel_dp_aux_wait_done(intel_dp);
 
/* Clear done status and any errors */
@@ -335,7 +330,8 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
 *   Timeout errors from the HW already meet this
 *   requirement so skip to next iteration
 */
-   if (status & DP_AUX_CH_CTL_TIME_OUT_ERROR

Re: [Intel-gfx] [PATCH v6 2/8] PCI/VGA: Deal only with VGA class devices

2023-06-19 Thread Sui Jingfeng

Hi,

On 2023/6/20 02:12, Limonciello, Mario wrote:


On 6/12/2023 2:25 PM, Sui Jingfeng wrote:

From: Sui Jingfeng 

Deal only with the VGA devcie(pdev->class == 0x0300), so replace the
pci_get_subsys() function with pci_get_class(). Filter the non-PCI 
display
device(pdev->class != 0x0300) out. There no need to process the 
non-display

PCI device.

Signed-off-by: Sui Jingfeng 
---

This also means that deleting a PCI device no longer needs
to walk the list.

Reviewed-by: Mario Limonciello 


Thanks a lot,

can you help to resend this precious R-B to the V7 of this series [1],

This is V6.

[1] https://patchwork.freedesktop.org/series/119250/


  drivers/pci/vgaarb.c | 22 --
  1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index c1bc6c983932..22a505e877dc 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -754,10 +754,6 @@ static bool vga_arbiter_add_pci_device(struct 
pci_dev *pdev)

  struct pci_dev *bridge;
  u16 cmd;
  -    /* Only deal with VGA class devices */
-    if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
-    return false;
-
  /* Allocate structure */
  vgadev = kzalloc(sizeof(struct vga_device), GFP_KERNEL);
  if (vgadev == NULL) {
@@ -1500,7 +1496,9 @@ static int pci_notify(struct notifier_block 
*nb, unsigned long action,

  struct pci_dev *pdev = to_pci_dev(dev);
  bool notify = false;
  -    vgaarb_dbg(dev, "%s\n", __func__);
+    /* Only deal with VGA class devices */
+    if (pdev->class != PCI_CLASS_DISPLAY_VGA << 8)
+    return 0;
    /* For now we're only intereted in devices added and removed. 
I didn't

   * test this thing here, so someone needs to double check for the
@@ -1510,6 +1508,8 @@ static int pci_notify(struct notifier_block 
*nb, unsigned long action,

  else if (action == BUS_NOTIFY_DEL_DEVICE)
  notify = vga_arbiter_del_pci_device(pdev);
  +    vgaarb_dbg(dev, "%s: action = %lu\n", __func__, action);
+
  if (notify)
  vga_arbiter_notify_clients();
  return 0;
@@ -1534,8 +1534,8 @@ static struct miscdevice vga_arb_device = {
    static int __init vga_arb_device_init(void)
  {
+    struct pci_dev *pdev = NULL;
  int rc;
-    struct pci_dev *pdev;
    rc = misc_register(&vga_arb_device);
  if (rc < 0)
@@ -1545,11 +1545,13 @@ static int __init vga_arb_device_init(void)
    /* We add all PCI devices satisfying VGA class in the arbiter by
   * default */
-    pdev = NULL;
-    while ((pdev =
-    pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-   PCI_ANY_ID, pdev)) != NULL)
+    while (1) {
+    pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev);
+    if (!pdev)
+    break;
+
  vga_arbiter_add_pci_device(pdev);
+    }
    pr_info("loaded\n");
  return rc;


--
Jingfeng



[Intel-gfx] [PATCH] drm/i915/display/dp: Remove support for UHBR13.5

2023-06-19 Thread Arun R Murthy
As per the DP2.1 Spec support for UHBR13.5 is optional. Hence removing
the support for UHBR13.5
UHBR10 can be used for 6k panels.

Signed-off-by: Arun R Murthy 
---
 drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
b/drivers/gpu/drm/i915/display/intel_dp.c
index 9f40da20e88d..54ddc953e5bc 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -465,7 +465,7 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp)
};
static const int icl_rates[] = {
162000, 216000, 27, 324000, 432000, 54, 648000, 81,
-   100, 135,
+   100,
};
static const int bxt_rates[] = {
162000, 216000, 243000, 27, 324000, 432000, 54
-- 
2.25.1



[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/mtl: Update workaround 14018778641

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915/mtl: Update workaround 14018778641
URL   : https://patchwork.freedesktop.org/series/119517/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13289 -> Patchwork_119517v1


Summary
---

  **SUCCESS**

  No regressions found.

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

Participating hosts (41 -> 41)
--

  Additional (2): fi-tgl-1115g4 fi-pnv-d510 
  Missing(2): fi-kbl-soraka fi-snb-2520m 

Known issues


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

### IGT changes ###

 Issues hit 

  * igt@debugfs_test@basic-hwmon:
- fi-tgl-1115g4:  NOTRUN -> [SKIP][1] ([i915#7456])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/fi-tgl-1115g4/igt@debugfs_t...@basic-hwmon.html

  * igt@gem_huc_copy@huc-copy:
- fi-tgl-1115g4:  NOTRUN -> [SKIP][2] ([i915#2190])
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/fi-tgl-1115g4/igt@gem_huc_c...@huc-copy.html

  * igt@gem_lmem_swapping@parallel-random-engines:
- fi-tgl-1115g4:  NOTRUN -> [SKIP][3] ([i915#4613]) +3 similar issues
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/fi-tgl-1115g4/igt@gem_lmem_swapp...@parallel-random-engines.html

  * igt@i915_pm_backlight@basic-brightness:
- fi-tgl-1115g4:  NOTRUN -> [SKIP][4] ([i915#3546] / [i915#7561])
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/fi-tgl-1115g4/igt@i915_pm_backli...@basic-brightness.html

  * igt@i915_selftest@live@gt_mocs:
- bat-mtlp-8: [PASS][5] -> [DMESG-FAIL][6] ([i915#7059])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13289/bat-mtlp-8/igt@i915_selftest@live@gt_mocs.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/bat-mtlp-8/igt@i915_selftest@live@gt_mocs.html

  * igt@i915_selftest@live@requests:
- bat-mtlp-6: [PASS][7] -> [DMESG-FAIL][8] ([i915#7269])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13289/bat-mtlp-6/igt@i915_selftest@l...@requests.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/bat-mtlp-6/igt@i915_selftest@l...@requests.html

  * igt@i915_selftest@live@slpc:
- bat-mtlp-8: [PASS][9] -> [DMESG-WARN][10] ([i915#6367])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13289/bat-mtlp-8/igt@i915_selftest@l...@slpc.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/bat-mtlp-8/igt@i915_selftest@l...@slpc.html
- bat-rpls-1: [PASS][11] -> [DMESG-WARN][12] ([i915#6367])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13289/bat-rpls-1/igt@i915_selftest@l...@slpc.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/bat-rpls-1/igt@i915_selftest@l...@slpc.html

  * igt@i915_selftest@live@workarounds:
- bat-mtlp-6: [PASS][13] -> [DMESG-FAIL][14] ([i915#6763])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13289/bat-mtlp-6/igt@i915_selftest@l...@workarounds.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/bat-mtlp-6/igt@i915_selftest@l...@workarounds.html
- bat-rpls-2: [PASS][15] -> [DMESG-WARN][16] ([i915#7852])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13289/bat-rpls-2/igt@i915_selftest@l...@workarounds.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/bat-rpls-2/igt@i915_selftest@l...@workarounds.html

  * igt@i915_suspend@basic-s3-without-i915:
- fi-tgl-1115g4:  NOTRUN -> [INCOMPLETE][17] ([i915#7443] / [i915#8102])
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/fi-tgl-1115g4/igt@i915_susp...@basic-s3-without-i915.html
- bat-atsm-1: NOTRUN -> [SKIP][18] ([i915#6645])
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/bat-atsm-1/igt@i915_susp...@basic-s3-without-i915.html

  * igt@kms_chamelium_frames@dp-crc-fast:
- fi-tgl-1115g4:  NOTRUN -> [SKIP][19] ([i915#7828]) +7 similar issues
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/fi-tgl-1115g4/igt@kms_chamelium_fra...@dp-crc-fast.html

  * igt@kms_chamelium_hpd@common-hpd-after-suspend:
- bat-atsm-1: NOTRUN -> [SKIP][20] ([i915#6078])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/bat-atsm-1/igt@kms_chamelium_...@common-hpd-after-suspend.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-tgl-1115g4:  NOTRUN -> [SKIP][21] ([i915#4103]) +1 similar issue
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119517v1/fi-tgl-1115g4/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_force_connector_basic@force-load-detect:
- fi-tgl-1115g4:  NOTRUN -> [SKIP][22] ([fdo#109285])
   [22]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork

[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/display/dp: On AUX xfer timeout restart freshly (rev4)

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915/display/dp: On AUX xfer timeout restart freshly (rev4)
URL   : https://patchwork.freedesktop.org/series/119055/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13285_full -> Patchwork_119055v4_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_119055v4_full absolutely need 
to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_119055v4_full, please notify your bug team to allow 
them
  to document this new failure mode, which will reduce false positives in CI.

  

Participating hosts (7 -> 7)
--

  No changes in participating hosts

Possible new issues
---

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

### IGT changes ###

 Possible regressions 

  * igt@gem_eio@kms:
- shard-snb:  [PASS][1] -> [DMESG-WARN][2] +34 similar issues
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/shard-snb2/igt@gem_...@kms.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-snb1/igt@gem_...@kms.html

  * igt@kms_flip@flip-vs-expired-vblank@b-hdmi-a1:
- shard-snb:  NOTRUN -> [DMESG-WARN][3] +13 similar issues
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-snb1/igt@kms_flip@flip-vs-expired-vbl...@b-hdmi-a1.html

  
 Warnings 

  * igt@kms_dp_aux_dev:
- shard-snb:  [SKIP][4] ([fdo#109271]) -> [DMESG-FAIL][5]
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/shard-snb5/igt@kms_dp_aux_dev.html
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-snb5/igt@kms_dp_aux_dev.html

  
Known issues


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

### IGT changes ###

 Issues hit 

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

  * igt@gem_barrier_race@remote-request@rcs0:
- shard-glk:  [PASS][8] -> [ABORT][9] ([i915#7461] / [i915#8211])
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/shard-glk5/igt@gem_barrier_race@remote-requ...@rcs0.html
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-glk9/igt@gem_barrier_race@remote-requ...@rcs0.html

  * igt@gem_exec_whisper@basic-fds-priority-all:
- shard-tglu: [PASS][10] -> [INCOMPLETE][11] ([i915#6755] / 
[i915#7392])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/shard-tglu-5/igt@gem_exec_whis...@basic-fds-priority-all.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-tglu-9/igt@gem_exec_whis...@basic-fds-priority-all.html

  * igt@i915_pm_dc@dc6-dpms:
- shard-tglu: [PASS][12] -> [FAIL][13] ([i915#3989] / [i915#454])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/shard-tglu-9/igt@i915_pm...@dc6-dpms.html
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-tglu-3/igt@i915_pm...@dc6-dpms.html

  * igt@i915_pm_rpm@dpms-lpsp:
- shard-rkl:  [PASS][14] -> [SKIP][15] ([i915#1397]) +1 similar 
issue
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/shard-rkl-7/igt@i915_pm_...@dpms-lpsp.html
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-rkl-6/igt@i915_pm_...@dpms-lpsp.html

  * igt@kms_cursor_legacy@forked-move@pipe-b:
- shard-rkl:  [PASS][16] -> [INCOMPLETE][17] ([i915#8011]) +1 
similar issue
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/shard-rkl-1/igt@kms_cursor_legacy@forked-m...@pipe-b.html
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-rkl-7/igt@kms_cursor_legacy@forked-m...@pipe-b.html

  * igt@kms_flip@flip-vs-suspend-interruptible@c-dp1:
- shard-apl:  [PASS][18] -> [ABORT][19] ([i915#180])
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/shard-apl1/igt@kms_flip@flip-vs-suspend-interrupti...@c-dp1.html
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-apl6/igt@kms_flip@flip-vs-suspend-interrupti...@c-dp1.html

  * igt@kms_hdr@invalid-hdr:
- shard-rkl:  NOTRUN -> [SKIP][20] ([i915#4579] / [i915#6953] / 
[i915#8228])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/shard-rkl-1/igt@kms_...@invalid-hdr.html

  * 
igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-a-hdmi-a-2:
- shard-rkl:  NOTRUN -> [SKIP][21] ([i915#5176]) +2 similar issues
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patch

Re: [Intel-gfx] [PATCH v6 2/8] PCI/VGA: Deal only with VGA class devices

2023-06-19 Thread Limonciello, Mario



On 6/12/2023 2:25 PM, Sui Jingfeng wrote:

From: Sui Jingfeng 

Deal only with the VGA devcie(pdev->class == 0x0300), so replace the
pci_get_subsys() function with pci_get_class(). Filter the non-PCI display
device(pdev->class != 0x0300) out. There no need to process the non-display
PCI device.

Signed-off-by: Sui Jingfeng 
---

This also means that deleting a PCI device no longer needs
to walk the list.

Reviewed-by: Mario Limonciello 


  drivers/pci/vgaarb.c | 22 --
  1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index c1bc6c983932..22a505e877dc 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -754,10 +754,6 @@ static bool vga_arbiter_add_pci_device(struct pci_dev 
*pdev)
struct pci_dev *bridge;
u16 cmd;
  
-	/* Only deal with VGA class devices */

-   if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
-   return false;
-
/* Allocate structure */
vgadev = kzalloc(sizeof(struct vga_device), GFP_KERNEL);
if (vgadev == NULL) {
@@ -1500,7 +1496,9 @@ static int pci_notify(struct notifier_block *nb, unsigned 
long action,
struct pci_dev *pdev = to_pci_dev(dev);
bool notify = false;
  
-	vgaarb_dbg(dev, "%s\n", __func__);

+   /* Only deal with VGA class devices */
+   if (pdev->class != PCI_CLASS_DISPLAY_VGA << 8)
+   return 0;
  
  	/* For now we're only intereted in devices added and removed. I didn't

 * test this thing here, so someone needs to double check for the
@@ -1510,6 +1508,8 @@ static int pci_notify(struct notifier_block *nb, unsigned 
long action,
else if (action == BUS_NOTIFY_DEL_DEVICE)
notify = vga_arbiter_del_pci_device(pdev);
  
+	vgaarb_dbg(dev, "%s: action = %lu\n", __func__, action);

+
if (notify)
vga_arbiter_notify_clients();
return 0;
@@ -1534,8 +1534,8 @@ static struct miscdevice vga_arb_device = {
  
  static int __init vga_arb_device_init(void)

  {
+   struct pci_dev *pdev = NULL;
int rc;
-   struct pci_dev *pdev;
  
  	rc = misc_register(&vga_arb_device);

if (rc < 0)
@@ -1545,11 +1545,13 @@ static int __init vga_arb_device_init(void)
  
  	/* We add all PCI devices satisfying VGA class in the arbiter by

 * default */
-   pdev = NULL;
-   while ((pdev =
-   pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-  PCI_ANY_ID, pdev)) != NULL)
+   while (1) {
+   pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev);
+   if (!pdev)
+   break;
+
vga_arbiter_add_pci_device(pdev);
+   }
  
  	pr_info("loaded\n");

return rc;


Re: [Intel-gfx] [PATCHv4] drm/i915/display/dp: On AUX xfer timeout restart freshly

2023-06-19 Thread Murthy, Arun R


> -Original Message-
> From: Nikula, Jani 
> Sent: Monday, June 19, 2023 5:37 PM
> To: Murthy, Arun R ; intel-
> g...@lists.freedesktop.org
> Cc: Deak, Imre ; Kahola, Mika
> ; Murthy, Arun R 
> Subject: Re: [PATCHv4] drm/i915/display/dp: On AUX xfer timeout restart
> freshly
> 
> On Mon, 19 Jun 2023, Arun R Murthy  wrote:
> > At the beginning of the aux transfer a check for aux control busy bit
> > is done. Then as per the spec on aux transfer timeout, need to retry
> > freshly for 3 times with a delay which is taken care by the control
> > register.
> > On each of these 3 trials a check for busy has to be done so as to
> > start freshly.
> >
> > v2: updated the commit message
> > v4: check for SEND_BUSY after write (Imre)
> >
> > Signed-off-by: Arun R Murthy 
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_aux.c | 58
> > +
> >  1 file changed, 26 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > index 21b50a5c8a85..abe8047fac39 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > @@ -226,6 +226,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
> > int i, ret, recv_bytes;
> > int try, clock = 0;
> > u32 status;
> > +   u32 send_ctl;
> > bool vdd;
> >
> > ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
> > @@ -273,45 +274,36 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
> >  * it using the same AUX CH simultaneously
> >  */
> >
> > -   /* Try to wait for any previous AUX channel activity */
> > -   for (try = 0; try < 3; try++) {
> > -   status = intel_de_read_notrace(i915, ch_ctl);
> > -   if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
> > -   break;
> > -   msleep(1);
> > -   }
> > -   /* just trace the final value */
> > -   trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
> > -
> > -   if (try == 3) {
> > -   const u32 status = intel_de_read(i915, ch_ctl);
> > -
> > -   if (status != intel_dp->aux_busy_last_status) {
> > -   drm_WARN(&i915->drm, 1,
> > -"%s: not started (status 0x%08x)\n",
> > -intel_dp->aux.name, status);
> > -   intel_dp->aux_busy_last_status = status;
> > -   }
> > -
> > -   ret = -EBUSY;
> > -   goto out;
> > -   }
> > -
> > /* Only 5 data registers! */
> > if (drm_WARN_ON(&i915->drm, send_bytes > 20 || recv_size > 20)) {
> > ret = -E2BIG;
> > goto out;
> > }
> > +   send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
> > + send_bytes,
> > + aux_clock_divider);
> > +   send_ctl |= aux_send_ctl_flags;
> >
> > while ((aux_clock_divider = intel_dp-
> >get_aux_clock_divider(intel_dp, clock++))) {
> > -   u32 send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
> > - send_bytes,
> > - aux_clock_divider);
> > -
> > -   send_ctl |= aux_send_ctl_flags;
> 
> You can't move the send_ctl assignment outside the loop, because the loop
> changes aux_clock_divider which affects send_ctl.
> 
> Please take your time with the next version, and don't try to rush it, and 
> we'll
> get this done quicker.

Sure.

> 
> > -
> > -   /* Must try at least 3 times according to DP spec */
> > +   /* Re-visit : Must try at least 3 times according to DP spec */
> 
> How is this change helpful?

There was a comment on the earlier patch for the retry count. Here we are 
retrying for 5 times but the spec says retry for 3 times. Need to revisit this 
to see if there is any WA/recommendation in Bspec and to update the same with 
link or revert it to 3 times.

> 
> > for (try = 0; try < 5; try++) {
> > +   /* Try to wait for any previous AUX channel activity
> */
> > +   status = intel_dp_aux_wait_done(intel_dp);
> > +   /* just trace the final value */
> > +   trace_i915_reg_rw(false, ch_ctl, status, sizeof(status),
> true);
> > +
> > +   if (status & DP_AUX_CH_CTL_SEND_BUSY) {
> > +   drm_WARN(&i915->drm, 1,
> > +"%s: not started, previous Tx still in
> process (status 0x%08x)\n",
> > +intel_dp->aux.name, status);
> > +   intel_dp->aux_busy_last_status = status;
> > +   if (try > 3) {
> > +   ret = -EBUSY;
> > +   goto out;
> > +   } else
> > +   continue;
> 
> If one branch needs braces, all of them do.
> 
Ok.

Thanks and Re

Re: [Intel-gfx] [RFC 2/3] drm/i915/display: Configure and initialize HDMI audio capabilities

2023-06-19 Thread Jani Nikula
On Mon, 19 Jun 2023, Kai Vehmanen  wrote:
> Hey,
>
> replying to 9th June version (my mistake), but I checked the 15th June
> patch version and comments applied to that one as well:
>
> On Fri, 9 Jun 2023, Mitul Golani wrote:
>
>> Initialize the source audio capabilities for HDMI in crtc_state
>> property by setting them to their maximum supported values,
>> including max_channel and max_frequency. This allows for the
>> calculation of HDMI audio source capabilities with respect to
>> the available mode bandwidth. These capabilities encompass
>> parameters such as supported frequency and channel configurations.
> [...]
>> @@ -1131,6 +1131,12 @@ struct intel_crtc_state {
>>  
>>  struct {
>>  bool has_audio;
>> +
>> +/* Audio rate in Hz */
>> +int max_frequency;
>> +
>> +/* Number of audio channels */
>> +int max_channel;
>>  } audio;
>
> Comment on this below.
>
>> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
>> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
>> @@ -2277,6 +2277,40 @@ bool intel_hdmi_compute_has_hdmi_sink(struct 
>> intel_encoder *encoder,
>>  !intel_hdmi_is_cloned(crtc_state);
>>  }
>>  
>> +static unsigned int calc_audio_bw(int channel, int frequency)
>> +{
>> +int bits_per_sample = 32;
>> +unsigned int bandwidth = channel * frequency * bits_per_sample;
>
> Maybe unsigned for bits_per_sample as well?

Personally, I'd always go for signed ints. Integer promotions are hard.

BR,
Jani.


> And not sure how fixed this 
> is, but having 32 as a define at start file with more descriptive name
> might be a good idea as well. I.e. this is the audio sample container
> size used in all calculations.
>
>> +void
>> +intel_hdmi_audio_compute_config(struct intel_crtc_state *pipe_config)
>> +{
>> +struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
>> +int num_of_channel, aud_rates[7] = {192000, 176000, 96000, 88000, 
>> 48000, 44100, 32000};
>> +unsigned int audio_req_bandwidth, available_blank_bandwidth, vblank, 
>> hblank;
>> +
>> +hblank = adjusted_mode->htotal - adjusted_mode->hdisplay;
>> +vblank = adjusted_mode->vtotal - adjusted_mode->vdisplay;
>> +available_blank_bandwidth = hblank * vblank *
>> +drm_mode_vrefresh(adjusted_mode) * 
>> pipe_config->pipe_bpp;
>> +for (num_of_channel = 8; num_of_channel > 0; num_of_channel--) {
>
> The maximum channel count of 8 would deserve its own define. It's pretty
> much a constant coming from the specs, but still avoid magic numbers in 
> code would be preferable. Or we remove this altoghter, see below...
>
>> +for (int index = 0; index < 7; index++) {
>> +audio_req_bandwidth = calc_audio_bw(num_of_channel,
>> +aud_rates[index]);
>> +if (audio_req_bandwidth < available_blank_bandwidth) {
>
> <= ?
>
>> +pipe_config->audio.max_frequency = 
>> aud_rates[index];
>> +pipe_config->audio.max_channel = num_of_channel;
>> +return;
>> +}
>
> This will hit a problem if we have a case where bandwidth is not enough 
> for 5.1 at 192kHz, but it is enough for 2ch 192kHz audio. This approach
> forces us to give preference to either channel acount or sampling rate.
>
> What if we just store the 'max audio samples per second' into pipe config:
>
>  - have "int max_audio_samples_per_second;" in pipe_config
>  - pipe_config->audio.max_audio_samples_per_second = 
> available_blank_bandwidth / 32; 
>
> Then when filtering SADs, the invidial channels+rate combination 
> of each SAD is compared to the max_audio_samples_per_second and based
> on that, the SAD is either filter or passed on. What do you think?
>
> Br, Kai
>

-- 
Jani Nikula, Intel Open Source Graphics Center


[Intel-gfx] [PATCH v2 6/6] drm/ttm: Don't shadow the operation context

2023-06-19 Thread Thomas Hellström
ttm_bo_swapout() shadows the ttm operation context which may cause
major confusion in driver callbacks when swapping out !TTM_PL_SYSTEM
memory. Fix this by reusing the operation context argument to
ttm_bo_swapout().

Cc: "Christian König" 
Cc: 
Cc: 
Signed-off-by: Thomas Hellström 
Acked-by: Matthew Brost 
---
 drivers/gpu/drm/ttm/ttm_bo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index bd5dae4d1624..615d30c4262d 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1154,7 +1154,6 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct 
ttm_operation_ctx *ctx,
 * Move to system cached
 */
if (bo->resource->mem_type != TTM_PL_SYSTEM) {
-   struct ttm_operation_ctx ctx = { false, false };
struct ttm_resource *evict_mem;
struct ttm_place hop;
 
@@ -1164,7 +1163,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct 
ttm_operation_ctx *ctx,
if (unlikely(ret))
goto out;
 
-   ret = ttm_bo_handle_move_mem(bo, evict_mem, true, &ctx, &hop);
+   ret = ttm_bo_handle_move_mem(bo, evict_mem, true, ctx, &hop);
if (unlikely(ret != 0)) {
WARN(ret == -EMULTIHOP, "Unexpected multihop in swaput 
- likely driver bug.\n");
goto out;
-- 
2.40.1



Re: [Intel-gfx] [PATCH] drm/i915: Fix a NULL vs IS_ERR() bug

2023-06-19 Thread Nirmoy Das

Pushed to gt-next.


Thanks,

Nirmoy

On 6/6/2023 11:22 AM, Andi Shyti wrote:

Hi Dan,

On Tue, Jun 06, 2023 at 11:23:56AM +0300, Dan Carpenter wrote:

The mmap_offset_attach() function returns error pointers, it doesn't
return NULL.

Fixes: eaee1c085863 ("drm/i915: Add a function to mmap framebuffer obj")
Signed-off-by: Dan Carpenter 

Thanks for this series of fixes!

Reviewed-by: Andi Shyti 

Andi


[Intel-gfx] Requests For Proposals for hosting XDC 2024 are now open

2023-06-19 Thread Ricardo Garcia
Hello everyone!

The X.org board is soliciting proposals to host XDC in 2024. Since XDC
2023 is being held in Europe this year, we've decided to host in North
America. However, the board is open to other locations, especially if
there's an interesting co-location with another conference.

If you're considering hosting XDC, we've assembled a wiki page with
what's generally expected and needed:

https://www.x.org/wiki/Events/RFP/

When submitting your proposal, please make sure to include at least the
key information about the potential location in question, possible
dates along with estimated costs. Proposals can be submitted to board
at foundation.x.org until the deadline of *September 17th, 2023*. 

Additionally, an quirk early heads-up to the board if you're
considering hosting would be appreciated, in case we need to adjust the
schedule a bit. Also, earlier is better since there generally will be a
bit of Q&A with organizers.

And if you just have some questions about what organizing XDC entails,
please feel free to chat with previous organizers, or someone from the
board.

Thanks,
Ricardo Garcia, on behalf of X.Org


[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Replace kmap() with kmap_local_page() (rev4)

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915: Replace kmap() with kmap_local_page() (rev4)
URL   : https://patchwork.freedesktop.org/series/107277/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13286 -> Patchwork_107277v4


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_107277v4 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_107277v4, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

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

Participating hosts (41 -> 42)
--

  Additional (2): bat-atsm-1 fi-pnv-d510 
  Missing(1): fi-snb-2520m 

Possible new issues
---

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

### IGT changes ###

 Possible regressions 

  * igt@gem_exec_fence@basic-await@vcs1:
- bat-dg2-9:  [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13286/bat-dg2-9/igt@gem_exec_fence@basic-aw...@vcs1.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-dg2-9/igt@gem_exec_fence@basic-aw...@vcs1.html

  
Known issues


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

### IGT changes ###

 Issues hit 

  * igt@gem_mmap@basic:
- bat-atsm-1: NOTRUN -> [SKIP][3] ([i915#4083])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-atsm-1/igt@gem_m...@basic.html

  * igt@gem_render_tiled_blits@basic:
- bat-atsm-1: NOTRUN -> [SKIP][4] ([i915#4079]) +1 similar issue
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-atsm-1/igt@gem_render_tiled_bl...@basic.html

  * igt@gem_tiled_fence_blits@basic:
- bat-atsm-1: NOTRUN -> [SKIP][5] ([i915#4077]) +2 similar issues
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-atsm-1/igt@gem_tiled_fence_bl...@basic.html

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

  * igt@i915_selftest@live@gt_mocs:
- bat-mtlp-6: [PASS][7] -> [DMESG-FAIL][8] ([i915#7059])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13286/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html

  * igt@i915_selftest@live@requests:
- bat-mtlp-8: [PASS][9] -> [DMESG-FAIL][10] ([i915#8497])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13286/bat-mtlp-8/igt@i915_selftest@l...@requests.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-mtlp-8/igt@i915_selftest@l...@requests.html

  * igt@i915_selftest@live@slpc:
- bat-rpls-1: [PASS][11] -> [DMESG-WARN][12] ([i915#6367])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13286/bat-rpls-1/igt@i915_selftest@l...@slpc.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-rpls-1/igt@i915_selftest@l...@slpc.html

  * igt@i915_selftest@live@workarounds:
- bat-mtlp-6: [PASS][13] -> [DMESG-FAIL][14] ([i915#6763])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13286/bat-mtlp-6/igt@i915_selftest@l...@workarounds.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-mtlp-6/igt@i915_selftest@l...@workarounds.html

  * igt@i915_suspend@basic-s2idle-without-i915:
- bat-rpls-2: NOTRUN -> [ABORT][15] ([i915#6687] / [i915#8668])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-rpls-2/igt@i915_susp...@basic-s2idle-without-i915.html

  * igt@i915_suspend@basic-s3-without-i915:
- bat-atsm-1: NOTRUN -> [SKIP][16] ([i915#6645])
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-atsm-1/igt@i915_susp...@basic-s3-without-i915.html

  * igt@kms_addfb_basic@size-max:
- bat-atsm-1: NOTRUN -> [SKIP][17] ([i915#6077]) +36 similar issues
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-atsm-1/igt@kms_addfb_ba...@size-max.html

  * igt@kms_cursor_legacy@basic-flip-after-cursor-atomic:
- bat-atsm-1: NOTRUN -> [SKIP][18] ([i915#6078]) +19 similar issues
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-atsm-1/igt@kms_cursor_leg...@basic-flip-after-cursor-atomic.html

  * igt@kms_flip@basic-flip-vs-wf_vblank:
- bat-atsm-1: NOTRUN -> [SKIP][19] ([i915#6166]) +3 similar issues
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_107277v4/bat-atsm-1/igt@kms_flip@basic-flip-vs-wf_vblank.html

  * igt@kms_force_c

[Intel-gfx] ✗ Fi.CI.DOCS: warning for drm/i915: Replace kmap() with kmap_local_page() (rev4)

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915: Replace kmap() with kmap_local_page() (rev4)
URL   : https://patchwork.freedesktop.org/series/107277/
State : warning

== Summary ==

Error: git fetch origin failed




[Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Replace kmap() with kmap_local_page() (rev4)

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915: Replace kmap() with kmap_local_page() (rev4)
URL   : https://patchwork.freedesktop.org/series/107277/
State : warning

== Summary ==

Error: git fetch origin failed




[Intel-gfx] ✗ Fi.CI.BUILD: warning for drm/i915: Replace kmap() with kmap_local_page() (rev4)

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915: Replace kmap() with kmap_local_page() (rev4)
URL   : https://patchwork.freedesktop.org/series/107277/
State : warning

== Summary ==

Error: git fetch origin failed




Re: [Intel-gfx] [RFC 2/3] drm/i915/display: Configure and initialize HDMI audio capabilities

2023-06-19 Thread Kai Vehmanen
Hey,

replying to 9th June version (my mistake), but I checked the 15th June
patch version and comments applied to that one as well:

On Fri, 9 Jun 2023, Mitul Golani wrote:

> Initialize the source audio capabilities for HDMI in crtc_state
> property by setting them to their maximum supported values,
> including max_channel and max_frequency. This allows for the
> calculation of HDMI audio source capabilities with respect to
> the available mode bandwidth. These capabilities encompass
> parameters such as supported frequency and channel configurations.
[...]
> @@ -1131,6 +1131,12 @@ struct intel_crtc_state {
>  
>   struct {
>   bool has_audio;
> +
> + /* Audio rate in Hz */
> + int max_frequency;
> +
> + /* Number of audio channels */
> + int max_channel;
>   } audio;

Comment on this below.

> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -2277,6 +2277,40 @@ bool intel_hdmi_compute_has_hdmi_sink(struct 
> intel_encoder *encoder,
>   !intel_hdmi_is_cloned(crtc_state);
>  }
>  
> +static unsigned int calc_audio_bw(int channel, int frequency)
> +{
> + int bits_per_sample = 32;
> + unsigned int bandwidth = channel * frequency * bits_per_sample;

Maybe unsigned for bits_per_sample as well? And not sure how fixed this 
is, but having 32 as a define at start file with more descriptive name
might be a good idea as well. I.e. this is the audio sample container
size used in all calculations.

> +void
> +intel_hdmi_audio_compute_config(struct intel_crtc_state *pipe_config)
> +{
> + struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
> + int num_of_channel, aud_rates[7] = {192000, 176000, 96000, 88000, 
> 48000, 44100, 32000};
> + unsigned int audio_req_bandwidth, available_blank_bandwidth, vblank, 
> hblank;
> +
> + hblank = adjusted_mode->htotal - adjusted_mode->hdisplay;
> + vblank = adjusted_mode->vtotal - adjusted_mode->vdisplay;
> + available_blank_bandwidth = hblank * vblank *
> + drm_mode_vrefresh(adjusted_mode) * 
> pipe_config->pipe_bpp;
> + for (num_of_channel = 8; num_of_channel > 0; num_of_channel--) {

The maximum channel count of 8 would deserve its own define. It's pretty
much a constant coming from the specs, but still avoid magic numbers in 
code would be preferable. Or we remove this altoghter, see below...

> + for (int index = 0; index < 7; index++) {
> + audio_req_bandwidth = calc_audio_bw(num_of_channel,
> + aud_rates[index]);
> + if (audio_req_bandwidth < available_blank_bandwidth) {

<= ?

> + pipe_config->audio.max_frequency = 
> aud_rates[index];
> + pipe_config->audio.max_channel = num_of_channel;
> + return;
> + }

This will hit a problem if we have a case where bandwidth is not enough 
for 5.1 at 192kHz, but it is enough for 2ch 192kHz audio. This approach
forces us to give preference to either channel acount or sampling rate.

What if we just store the 'max audio samples per second' into pipe config:

 - have "int max_audio_samples_per_second;" in pipe_config
 - pipe_config->audio.max_audio_samples_per_second = 
available_blank_bandwidth / 32; 

Then when filtering SADs, the invidial channels+rate combination 
of each SAD is compared to the max_audio_samples_per_second and based
on that, the SAD is either filter or passed on. What do you think?

Br, Kai



[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/display/dp: On AUX xfer timeout restart freshly (rev4)

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915/display/dp: On AUX xfer timeout restart freshly (rev4)
URL   : https://patchwork.freedesktop.org/series/119055/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13285 -> Patchwork_119055v4


Summary
---

  **SUCCESS**

  No regressions found.

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

Participating hosts (43 -> 42)
--

  Missing(1): fi-snb-2520m 

Known issues


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

### IGT changes ###

 Issues hit 

  * igt@i915_module_load@load:
- bat-adlp-11:[PASS][1] -> [ABORT][2] ([i915#4423])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/bat-adlp-11/igt@i915_module_l...@load.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-adlp-11/igt@i915_module_l...@load.html

  * igt@i915_selftest@live@gt_heartbeat:
- fi-apl-guc: [PASS][3] -> [DMESG-FAIL][4] ([i915#5334])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html

  * igt@i915_selftest@live@gt_lrc:
- bat-dg2-11: [PASS][5] -> [INCOMPLETE][6] ([i915#7609] / 
[i915#7913])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/bat-dg2-11/igt@i915_selftest@live@gt_lrc.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-dg2-11/igt@i915_selftest@live@gt_lrc.html

  * igt@i915_selftest@live@gt_pm:
- bat-rpls-2: [PASS][7] -> [DMESG-FAIL][8] ([i915#4258] / 
[i915#7913])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/bat-rpls-2/igt@i915_selftest@live@gt_pm.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-rpls-2/igt@i915_selftest@live@gt_pm.html

  * igt@i915_selftest@live@guc:
- bat-rpls-1: [PASS][9] -> [DMESG-WARN][10] ([i915#7852])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/bat-rpls-1/igt@i915_selftest@l...@guc.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-rpls-1/igt@i915_selftest@l...@guc.html

  * igt@i915_selftest@live@hangcheck:
- bat-dg1-7:  [PASS][11] -> [ABORT][12] ([i915#4983])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/bat-dg1-7/igt@i915_selftest@l...@hangcheck.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-dg1-7/igt@i915_selftest@l...@hangcheck.html

  * igt@i915_selftest@live@requests:
- bat-mtlp-8: [PASS][13] -> [DMESG-FAIL][14] ([i915#8497])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/bat-mtlp-8/igt@i915_selftest@l...@requests.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-mtlp-8/igt@i915_selftest@l...@requests.html

  * igt@i915_selftest@live@reset:
- bat-rpls-1: [PASS][15] -> [DMESG-WARN][16] ([i915#7794])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/bat-rpls-1/igt@i915_selftest@l...@reset.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-rpls-1/igt@i915_selftest@l...@reset.html

  * igt@i915_selftest@live@slpc:
- bat-rpls-2: NOTRUN -> [DMESG-WARN][17] ([i915#6367])
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-rpls-2/igt@i915_selftest@l...@slpc.html

  * igt@i915_selftest@live@workarounds:
- bat-dg1-5:  [PASS][18] -> [ABORT][19] ([i915#4983])
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/bat-dg1-5/igt@i915_selftest@l...@workarounds.html
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-dg1-5/igt@i915_selftest@l...@workarounds.html

  * igt@i915_suspend@basic-s2idle-without-i915:
- bat-rpls-2: NOTRUN -> [ABORT][20] ([i915#6687] / [i915#8668])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-rpls-2/igt@i915_susp...@basic-s2idle-without-i915.html

  * igt@kms_chamelium_hpd@common-hpd-after-suspend:
- fi-bsw-n3050:   NOTRUN -> [SKIP][21] ([fdo#109271])
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/fi-bsw-n3050/igt@kms_chamelium_...@common-hpd-after-suspend.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-1:
- bat-dg2-8:  [PASS][22] -> [FAIL][23] ([i915#7932])
   [22]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13285/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-seque...@pipe-c-dp-1.html
   [23]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119055v4/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-seque...@pipe-c-dp-1.html

  * igt@kms_pipe_crc_basic@suspend-read-crc:
- fi-bsw-nick:NOTRUN -> [SKIP][24] ([fdo#109271]) +1 similar issue
   [24]: 
https://i

Re: [Intel-gfx] [PATCHv4] drm/i915/display/dp: On AUX xfer timeout restart freshly

2023-06-19 Thread Jani Nikula
On Mon, 19 Jun 2023, Arun R Murthy  wrote:
> At the beginning of the aux transfer a check for aux control busy bit is
> done. Then as per the spec on aux transfer timeout, need to retry
> freshly for 3 times with a delay which is taken care by the control
> register.
> On each of these 3 trials a check for busy has to be done so as to start
> freshly.
>
> v2: updated the commit message
> v4: check for SEND_BUSY after write (Imre)
>
> Signed-off-by: Arun R Murthy 
> ---
>  drivers/gpu/drm/i915/display/intel_dp_aux.c | 58 +
>  1 file changed, 26 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c 
> b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> index 21b50a5c8a85..abe8047fac39 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> @@ -226,6 +226,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
>   int i, ret, recv_bytes;
>   int try, clock = 0;
>   u32 status;
> + u32 send_ctl;
>   bool vdd;
>  
>   ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
> @@ -273,45 +274,36 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
>* it using the same AUX CH simultaneously
>*/
>  
> - /* Try to wait for any previous AUX channel activity */
> - for (try = 0; try < 3; try++) {
> - status = intel_de_read_notrace(i915, ch_ctl);
> - if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
> - break;
> - msleep(1);
> - }
> - /* just trace the final value */
> - trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
> -
> - if (try == 3) {
> - const u32 status = intel_de_read(i915, ch_ctl);
> -
> - if (status != intel_dp->aux_busy_last_status) {
> - drm_WARN(&i915->drm, 1,
> -  "%s: not started (status 0x%08x)\n",
> -  intel_dp->aux.name, status);
> - intel_dp->aux_busy_last_status = status;
> - }
> -
> - ret = -EBUSY;
> - goto out;
> - }
> -
>   /* Only 5 data registers! */
>   if (drm_WARN_ON(&i915->drm, send_bytes > 20 || recv_size > 20)) {
>   ret = -E2BIG;
>   goto out;
>   }
> + send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
> +   send_bytes,
> +   aux_clock_divider);
> + send_ctl |= aux_send_ctl_flags;
>  
>   while ((aux_clock_divider = intel_dp->get_aux_clock_divider(intel_dp, 
> clock++))) {
> - u32 send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
> -   send_bytes,
> -   aux_clock_divider);
> -
> - send_ctl |= aux_send_ctl_flags;

You can't move the send_ctl assignment outside the loop, because the
loop changes aux_clock_divider which affects send_ctl.

Please take your time with the next version, and don't try to rush it,
and we'll get this done quicker.

> -
> - /* Must try at least 3 times according to DP spec */
> + /* Re-visit : Must try at least 3 times according to DP spec */

How is this change helpful?

>   for (try = 0; try < 5; try++) {
> + /* Try to wait for any previous AUX channel activity */
> + status = intel_dp_aux_wait_done(intel_dp);
> + /* just trace the final value */
> + trace_i915_reg_rw(false, ch_ctl, status, 
> sizeof(status), true);
> +
> + if (status & DP_AUX_CH_CTL_SEND_BUSY) {
> + drm_WARN(&i915->drm, 1,
> +  "%s: not started, previous Tx still in 
> process (status 0x%08x)\n",
> +  intel_dp->aux.name, status);
> + intel_dp->aux_busy_last_status = status;
> + if (try > 3) {
> + ret = -EBUSY;
> + goto out;
> + } else
> + continue;

If one branch needs braces, all of them do.

> + }
> +
>   /* Load the send data into the aux channel data 
> registers */
>   for (i = 0; i < send_bytes; i += 4)
>   intel_de_write(i915, ch_data[i >> 2],
> @@ -321,6 +313,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
>   /* Send the command and wait for it to complete */
>   intel_de_write(i915, ch_ctl, send_ctl);
>  
> + /* TODO: if typeC then 4.2ms else 800us. For DG2 add 
> 1.5ms for both cases */
>   status = intel_dp_aux_wait_done(intel_dp);
>  
>   /* Clear done st

Re: [Intel-gfx] [PATCH] drm/i915/adlp+: Allow DC states along with PW2 only for PWB functionality

2023-06-19 Thread Shankar, Uma



> -Original Message-
> From: Intel-gfx  On Behalf Of Imre 
> Deak
> Sent: Tuesday, June 6, 2023 10:58 PM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH] drm/i915/adlp+: Allow DC states along with PW2 
> only
> for PWB functionality
> 
> A recent bspec update added a restriction on when DC states can be enabled:
> 
> [Before enabling DC states:]
> 
> """
> PG2 can be kept enabled only because PGB requires PG2.
> Do not use PG2 functions, such as type-C DDIs.
> 
> DMC will dynamically control PG1, PGA, PG2, PGB.
> """
> 
> Accordingly prevent DC states if PW2 (aka PG2) is enabled for any other
> functionality.
> 
> Bpsec: 49193

Change looks good to me.
Reviewed-by: Uma Shankar 

> Signed-off-by: Imre Deak 
> ---
>  .../drm/i915/display/intel_display_power_map.c   | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power_map.c
> b/drivers/gpu/drm/i915/display/intel_display_power_map.c
> index 1118ee9d224ca..5ad04cd42c158 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power_map.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_power_map.c
> @@ -1252,10 +1252,18 @@ I915_DECL_PW_DOMAINS(xelpd_pwdoms_pw_a,
>   POWER_DOMAIN_INIT);
> 
>  #define XELPD_DC_OFF_PORT_POWER_DOMAINS \
> + POWER_DOMAIN_PORT_DDI_LANES_C, \
> + POWER_DOMAIN_PORT_DDI_LANES_D, \
> + POWER_DOMAIN_PORT_DDI_LANES_E, \
>   POWER_DOMAIN_PORT_DDI_LANES_TC1, \
>   POWER_DOMAIN_PORT_DDI_LANES_TC2, \
>   POWER_DOMAIN_PORT_DDI_LANES_TC3, \
>   POWER_DOMAIN_PORT_DDI_LANES_TC4, \
> + POWER_DOMAIN_VGA, \
> + POWER_DOMAIN_AUDIO_PLAYBACK, \
> + POWER_DOMAIN_AUX_IO_C, \
> + POWER_DOMAIN_AUX_IO_D, \
> + POWER_DOMAIN_AUX_IO_E, \
>   POWER_DOMAIN_AUX_C, \
>   POWER_DOMAIN_AUX_D, \
>   POWER_DOMAIN_AUX_E, \
> @@ -1272,14 +1280,6 @@ I915_DECL_PW_DOMAINS(xelpd_pwdoms_pw_a,
>   XELPD_PW_B_POWER_DOMAINS, \
>   XELPD_PW_C_POWER_DOMAINS, \
>   XELPD_PW_D_POWER_DOMAINS, \
> - POWER_DOMAIN_PORT_DDI_LANES_C, \
> - POWER_DOMAIN_PORT_DDI_LANES_D, \
> - POWER_DOMAIN_PORT_DDI_LANES_E, \
> - POWER_DOMAIN_VGA, \
> - POWER_DOMAIN_AUDIO_PLAYBACK, \
> - POWER_DOMAIN_AUX_IO_C, \
> - POWER_DOMAIN_AUX_IO_D, \
> - POWER_DOMAIN_AUX_IO_E, \
>   XELPD_DC_OFF_PORT_POWER_DOMAINS
> 
>  I915_DECL_PW_DOMAINS(xelpd_pwdoms_pw_2,
> --
> 2.37.2



[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display/dp: On AUX xfer timeout restart freshly (rev4)

2023-06-19 Thread Patchwork
== Series Details ==

Series: drm/i915/display/dp: On AUX xfer timeout restart freshly (rev4)
URL   : https://patchwork.freedesktop.org/series/119055/
State : warning

== Summary ==

Error: dim checkpatch failed
c655062f3d72 drm/i915/display/dp: On AUX xfer timeout restart freshly
-:91: CHECK:BRACES: Unbalanced braces around else statement
#91: FILE: drivers/gpu/drm/i915/display/intel_dp_aux.c:303:
+   } else

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




Re: [Intel-gfx] [RFC 3/3] drm/i915/display: Add wrapper to Compute SAD

2023-06-19 Thread Kai Vehmanen
Hi,

[+Jyri]

On Fri, 9 Jun 2023, Mitul Golani wrote:

> Compute SADs that takes into account the supported rate and channel
> based on the capabilities of the audio source. This wrapper function
> should encapsulate the logic for determining the supported rate and
> channel and should return a set of SADs that are compatible with the
> source.

In general looks good. A few minor comments inline:

> +static u8 get_supported_freq_mask(struct intel_crtc_state *crtc_state)
> +{
> + int audio_freq_hz[] = {32000, 44100, 48000, 88000, 96000, 176000, 
> 192000, 0};
> + u8 mask = 0;
> +
> + for (u8 index = 0; index < ARRAY_SIZE(audio_freq_hz); index++) {

Minor nitpick: the use of "u8" in many places seems a bit misleading. It 
seems for many places (like the "index" here), you can just use int. 
But right, the SAD mask is 8bit, so maybe the get_support_freq_mask()
is still warranted to return a u8 mask.

> +void intel_audio_compute_eld(struct intel_crtc_state *crtc_state)
> +{
> + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
> + u8 *eld, *sad, index, mask = 0;
> +
> + eld = crtc_state->eld;
> + if (!eld) {
> + drm_err(&i915->drm, "failed to locate eld\n");
> + return;
> + }
> +
> + sad = (u8 *)parse_sad(eld);
> + if (sad) {
> + mask = get_supported_freq_mask(crtc_state);
> +
> + for (index = 0; index < drm_eld_sad_count(eld); index++, sad += 
> 3) {
> + /*
> +  *  Respect to source restrictions. If source limit is 
> greater than sink
> +  *  capabilities then follow to sink's highest 
> supported rate.
> +  */

Minor: maybe reword "Respect source restricitions. Limit capabilities to a 
subset that is supported both by the source and the sink."?

> + if (drm_sad_to_channels(sad) >= 
> crtc_state->audio.max_channel) {
> + sad[0] &= ~0x7;
> + sad[0] |= crtc_state->audio.max_channel - 1;

Can we add a debug trace here in case the channel count is limited? 

Br, Kai


Re: [Intel-gfx] [PATCHv4] drm/i915/display/dp: On AUX xfer timeout restart freshly

2023-06-19 Thread kernel test robot
Hi Arun,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-tip/drm-tip]

url:
https://github.com/intel-lab-lkp/linux/commits/Arun-R-Murthy/drm-i915-display-dp-On-AUX-xfer-timeout-restart-freshly/20230619-163622
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
patch link:
https://lore.kernel.org/r/20230619082715.922094-1-arun.r.murthy%40intel.com
patch subject: [Intel-gfx] [PATCHv4] drm/i915/display/dp: On AUX xfer timeout 
restart freshly
config: x86_64-rhel-8.3-rust 
(https://download.01.org/0day-ci/archive/20230619/202306191845.ymtzbdgg-...@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 
8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: 
(https://download.01.org/0day-ci/archive/20230619/202306191845.ymtzbdgg-...@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot 
| Closes: 
https://lore.kernel.org/oe-kbuild-all/202306191845.ymtzbdgg-...@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/i915/display/intel_dp_aux.c:284:12: warning: variable 
>> 'aux_clock_divider' is uninitialized when used here [-Wuninitialized]
 aux_clock_divider);
 ^
   drivers/gpu/drm/i915/display/intel_dp_aux.c:222:23: note: initialize the 
variable 'aux_clock_divider' to silence this warning
   u32 aux_clock_divider;
^
 = 0
   1 warning generated.


vim +/aux_clock_divider +284 drivers/gpu/drm/i915/display/intel_dp_aux.c

   209  
   210  static int
   211  intel_dp_aux_xfer(struct intel_dp *intel_dp,
   212const u8 *send, int send_bytes,
   213u8 *recv, int recv_size,
   214u32 aux_send_ctl_flags)
   215  {
   216  struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
   217  struct drm_i915_private *i915 =
   218  to_i915(dig_port->base.base.dev);
   219  enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
   220  bool is_tc_port = intel_phy_is_tc(i915, phy);
   221  i915_reg_t ch_ctl, ch_data[5];
   222  u32 aux_clock_divider;
   223  enum intel_display_power_domain aux_domain;
   224  intel_wakeref_t aux_wakeref;
   225  intel_wakeref_t pps_wakeref;
   226  int i, ret, recv_bytes;
   227  int try, clock = 0;
   228  u32 status;
   229  u32 send_ctl;
   230  bool vdd;
   231  
   232  ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
   233  for (i = 0; i < ARRAY_SIZE(ch_data); i++)
   234  ch_data[i] = intel_dp->aux_ch_data_reg(intel_dp, i);
   235  
   236  if (is_tc_port) {
   237  intel_tc_port_lock(dig_port);
   238  /*
   239   * Abort transfers on a disconnected port as required by
   240   * DP 1.4a link CTS 4.2.1.5, also avoiding the long AUX
   241   * timeouts that would otherwise happen.
   242   * TODO: abort the transfer on non-TC ports as well.
   243   */
   244  if (!intel_tc_port_connected_locked(&dig_port->base)) {
   245  ret = -ENXIO;
   246  goto out_unlock;
   247  }
   248  }
   249  
   250  aux_domain = intel_aux_power_domain(dig_port);
   251  
   252  aux_wakeref = intel_display_power_get(i915, aux_domain);
   253  pps_wakeref = intel_pps_lock(intel_dp);
   254  
   255  /*
   256   * We will be called with VDD already enabled for dpcd/edid/oui 
reads.
   257   * In such cases we want to leave VDD enabled and it's up to 
upper layers
   258   * to turn it off. But for eg. i2c-dev access we need to turn 
it on/off
   259   * ourselves.
   260   */
   261  vdd = intel_pps_vdd_on_unlocked(intel_dp);
   262  
   263  /*
   264   * dp aux is extremely sensitive to irq latency, hence request 
the
   265   * lowest possible wakeup latency and so prevent the cpu from 
going into
   266   * deep sleep states.
   267   */
   268  cpu_latency_qos_update_request(&intel_dp->pm_qos, 0);
   269  
   270  intel_pps_check_power_unlocked(intel_dp);
   271  
   272  /*
   273   * FIXME PSR should be disabled here to prevent
   274   * it using the same AUX CH simultaneously
   275   */
   276  
   277  /* Only 5 data registers! */
   278  if (drm_WARN_ON(&i915->drm, send

Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/4] drm/i915: Add missing forward declarations/includes to display power headers

2023-06-19 Thread Imre Deak
On Sat, Jun 17, 2023 at 01:10:42PM +, Patchwork wrote:
> == Series Details ==
> 
> Series: series starting with [1/4] drm/i915: Add missing forward 
> declarations/includes to display power headers
> URL   : https://patchwork.freedesktop.org/series/119480/
> State : failure
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_13279_full -> Patchwork_119480v1_full
> 
> 
> Summary
> ---
> 
>   **FAILURE**
> 
>   Serious unknown changes coming with Patchwork_119480v1_full absolutely need 
> to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_119480v1_full, please notify your bug team to allow 
> them
>   to document this new failure mode, which will reduce false positives in CI.
> 
>   
> 
> Participating hosts (8 -> 7)
> --
> 
>   Missing(1): shard-rkl0 
> 
> Possible new issues
> ---
> 
>   Here are the unknown changes that may have been introduced in 
> Patchwork_119480v1_full:
> 
> ### IGT changes ###
> 
>  Possible regressions 
> 
>   * igt@kms_flip@2x-flip-vs-dpms-off-vs-modeset-interruptible:
> - shard-snb:  NOTRUN -> [ABORT][1]
>[1]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-snb5/igt@kms_f...@2x-flip-vs-dpms-off-vs-modeset-interruptible.html

DEBUG_LOCKS_WARN_ON(debug_atomic_read(nr_unused_locks) != nr_unused)

SNB doesn't support DC states, so the change on this machine causes only
dropping the runtime PM reference after a 17 ms delay. However the
corresponding runtime suspend happens anyway in a delayed manner
already, so it's hard to imagine how the change would be related to the
other failure.

There is a ticket for the same WARN at
https://gitlab.freedesktop.org/drm/intel/-/issues/8189

which also happened on SNB.

> Known issues
> 
> 
>   Here are the changes found in Patchwork_119480v1_full that come from known 
> issues:
> 
> ### IGT changes ###
> 
>  Issues hit 
> 
>   * igt@gem_close_race@multigpu-basic-process:
> - shard-rkl:  NOTRUN -> [SKIP][2] ([i915#7697])
>[2]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-rkl-7/igt@gem_close_r...@multigpu-basic-process.html
> 
>   * igt@gem_eio@hibernate:
> - shard-snb:  [PASS][3] -> [SKIP][4] ([fdo#109271])
>[3]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13279/shard-snb6/igt@gem_...@hibernate.html
>[4]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-snb6/igt@gem_...@hibernate.html
> - shard-rkl:  NOTRUN -> [ABORT][5] ([i915#7975] / [i915#8213])
>[5]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-rkl-7/igt@gem_...@hibernate.html
> 
>   * igt@gem_exec_fair@basic-none-solo@rcs0:
> - shard-apl:  [PASS][6] -> [FAIL][7] ([i915#2842])
>[6]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13279/shard-apl2/igt@gem_exec_fair@basic-none-s...@rcs0.html
>[7]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-apl3/igt@gem_exec_fair@basic-none-s...@rcs0.html
> 
>   * igt@gem_exec_fair@basic-pace-share@rcs0:
> - shard-tglu: [PASS][8] -> [FAIL][9] ([i915#2842])
>[8]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13279/shard-tglu-5/igt@gem_exec_fair@basic-pace-sh...@rcs0.html
>[9]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-tglu-9/igt@gem_exec_fair@basic-pace-sh...@rcs0.html
> 
>   * igt@gem_exec_fair@basic-pace@rcs0:
> - shard-rkl:  [PASS][10] -> [FAIL][11] ([i915#2842]) +2 similar 
> issues
>[10]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13279/shard-rkl-6/igt@gem_exec_fair@basic-p...@rcs0.html
>[11]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-rkl-7/igt@gem_exec_fair@basic-p...@rcs0.html
> 
>   * igt@gem_exec_reloc@basic-wc-read:
> - shard-rkl:  NOTRUN -> [SKIP][12] ([i915#3281])
>[12]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-rkl-7/igt@gem_exec_re...@basic-wc-read.html
> 
>   * igt@gem_ppgtt@blt-vs-render-ctx0:
> - shard-snb:  [PASS][13] -> [INCOMPLETE][14] ([i915#8295])
>[13]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13279/shard-snb6/igt@gem_pp...@blt-vs-render-ctx0.html
>[14]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-snb6/igt@gem_pp...@blt-vs-render-ctx0.html
> 
>   * igt@gem_set_tiling_vs_blt@untiled-to-tiled:
> - shard-rkl:  NOTRUN -> [SKIP][15] ([i915#8411])
>[15]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119480v1/shard-rkl-7/igt@gem_set_tiling_vs_...@untiled-to-tiled.html
> 
>   * igt@gem_spin_batch@spin-each:
> - shard-apl:  [PASS][16] -> [FAIL][17] ([i915#2898])
>[16]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13279/shard-apl6/igt@gem_spin_ba...@spin-each.html
>[17]:

Re: [Intel-gfx] [PATCH] drm/i915: make i915_drm_client_fdinfo() reference conditional again

2023-06-19 Thread Tvrtko Ursulin



On 16/06/2023 12:17, Tvrtko Ursulin wrote:


On 16/06/2023 11:16, Andi Shyti wrote:

Hi Arnd,

On Fri, Jun 16, 2023 at 11:31:47AM +0200, Arnd Bergmann wrote:

From: Arnd Bergmann 

The function is only defined if CONFIG_PROC_FS is enabled:

ld.lld: error: undefined symbol: i915_drm_client_fdinfo

referenced by i915_driver.c
   
drivers/gpu/drm/i915/i915_driver.o:(i915_drm_driver) in archive 
vmlinux.a


Use the PTR_IF() helper to make the reference NULL otherwise.

Fixes: e894b724c316d ("drm/i915: Use the fdinfo helper")
Signed-off-by: Arnd Bergmann 
---
  drivers/gpu/drm/i915/i915_driver.c | 2 +-
  drivers/gpu/drm/i915/i915_drm_client.h | 2 --
  2 files changed, 1 insertion(+), 3 deletions(-)

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

index 75cbc43b326dd..0ad0c5885ec27 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1816,7 +1816,7 @@ static const struct drm_driver i915_drm_driver = {
  .open = i915_driver_open,
  .lastclose = i915_driver_lastclose,
  .postclose = i915_driver_postclose,
-    .show_fdinfo = i915_drm_client_fdinfo,
+    .show_fdinfo = PTR_IF(IS_ENABLED(CONFIG_PROC_FS), 
i915_drm_client_fdinfo),

  .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
  .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
diff --git a/drivers/gpu/drm/i915/i915_drm_client.h 
b/drivers/gpu/drm/i915/i915_drm_client.h

index 4c18b99e10a4e..67816c912bca1 100644
--- a/drivers/gpu/drm/i915/i915_drm_client.h
+++ b/drivers/gpu/drm/i915/i915_drm_client.h
@@ -47,8 +47,6 @@ static inline void i915_drm_client_put(struct 
i915_drm_client *client)

  struct i915_drm_client *i915_drm_client_alloc(void);
-#ifdef CONFIG_PROC_FS
  void i915_drm_client_fdinfo(struct drm_printer *p, struct drm_file 
*file);

-#endif


nice! This is becoming the new trend now.

Reviewed-by: Andi Shyti 


Thanks for the fix and review! (And I got to learn about existence of 
PTR_IF too.)


Andi will you merge once green or should I?


Pushed, thanks for the fixup and review!

Regards,

Tvrtko



Re: [Intel-gfx] [PATCH] drm/i915: make i915_drm_client_fdinfo() reference conditional again

2023-06-19 Thread Andi Shyti
Hi Tvrtko,

On Fri, Jun 16, 2023 at 12:17:50PM +0100, Tvrtko Ursulin wrote:
> 
> On 16/06/2023 11:16, Andi Shyti wrote:
> > Hi Arnd,
> > 
> > On Fri, Jun 16, 2023 at 11:31:47AM +0200, Arnd Bergmann wrote:
> > > From: Arnd Bergmann 
> > > 
> > > The function is only defined if CONFIG_PROC_FS is enabled:
> > > 
> > > ld.lld: error: undefined symbol: i915_drm_client_fdinfo
> > > > > > referenced by i915_driver.c
> > > > > >drivers/gpu/drm/i915/i915_driver.o:(i915_drm_driver) 
> > > > > > in archive vmlinux.a
> > > 
> > > Use the PTR_IF() helper to make the reference NULL otherwise.
> > > 
> > > Fixes: e894b724c316d ("drm/i915: Use the fdinfo helper")
> > > Signed-off-by: Arnd Bergmann 
> > > ---
> > >   drivers/gpu/drm/i915/i915_driver.c | 2 +-
> > >   drivers/gpu/drm/i915/i915_drm_client.h | 2 --
> > >   2 files changed, 1 insertion(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_driver.c 
> > > b/drivers/gpu/drm/i915/i915_driver.c
> > > index 75cbc43b326dd..0ad0c5885ec27 100644
> > > --- a/drivers/gpu/drm/i915/i915_driver.c
> > > +++ b/drivers/gpu/drm/i915/i915_driver.c
> > > @@ -1816,7 +1816,7 @@ static const struct drm_driver i915_drm_driver = {
> > >   .open = i915_driver_open,
> > >   .lastclose = i915_driver_lastclose,
> > >   .postclose = i915_driver_postclose,
> > > - .show_fdinfo = i915_drm_client_fdinfo,
> > > + .show_fdinfo = PTR_IF(IS_ENABLED(CONFIG_PROC_FS), 
> > > i915_drm_client_fdinfo),
> > >   .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
> > >   .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
> > > diff --git a/drivers/gpu/drm/i915/i915_drm_client.h 
> > > b/drivers/gpu/drm/i915/i915_drm_client.h
> > > index 4c18b99e10a4e..67816c912bca1 100644
> > > --- a/drivers/gpu/drm/i915/i915_drm_client.h
> > > +++ b/drivers/gpu/drm/i915/i915_drm_client.h
> > > @@ -47,8 +47,6 @@ static inline void i915_drm_client_put(struct 
> > > i915_drm_client *client)
> > >   struct i915_drm_client *i915_drm_client_alloc(void);
> > > -#ifdef CONFIG_PROC_FS
> > >   void i915_drm_client_fdinfo(struct drm_printer *p, struct drm_file 
> > > *file);
> > > -#endif
> > 
> > nice! This is becoming the new trend now.
> > 
> > Reviewed-by: Andi Shyti 
> 
> Thanks for the fix and review! (And I got to learn about existence of PTR_IF
> too.)
> 
> Andi will you merge once green or should I?

will do! Thanks!

Andi

> Regards,
> 
> Tvrtko


[Intel-gfx] [PATCH] drm/i915/mtl: Update workaround 14018778641

2023-06-19 Thread Tejas Upadhyay
WA 14018778641 needs an update after recent
performance data on MTL, aligning driver here with
HW WA update.

Signed-off-by: Tejas Upadhyay 
---
 drivers/gpu/drm/i915/gt/intel_workarounds.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c 
b/drivers/gpu/drm/i915/gt/intel_workarounds.c
index 4d2dece96011..5bef3fe0cd74 100644
--- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
@@ -1710,7 +1710,6 @@ static void
 xelpg_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
 {
/* Wa_14018778641 / Wa_18018781329 */
-   wa_mcr_write_or(wal, RENDER_MOD_CTRL, FORCE_MISS_FTLB);
wa_mcr_write_or(wal, COMP_MOD_CTRL, FORCE_MISS_FTLB);
 
/* Wa_22016670082 */
@@ -1743,8 +1742,6 @@ xelpmp_gt_workarounds_init(struct intel_gt *gt, struct 
i915_wa_list *wal)
 * GT, the media GT's versions are regular singleton registers.
 */
wa_write_or(wal, XELPMP_GSC_MOD_CTRL, FORCE_MISS_FTLB);
-   wa_write_or(wal, XELPMP_VDBX_MOD_CTRL, FORCE_MISS_FTLB);
-   wa_write_or(wal, XELPMP_VEBX_MOD_CTRL, FORCE_MISS_FTLB);
 
debug_dump_steering(gt);
 }
-- 
2.25.1



Re: [Intel-gfx] [PATCH 04/11] drm/i915/JSL: s/JSL/JASPERLAKE for platform/subplatform defines

2023-06-19 Thread Jani Nikula
On Thu, 15 Jun 2023, Dnyaneshwar Bhadane  wrote:
> Follow consistent naming convention. Replace JSL with
> JASPERLAKE.
>
> Signed-off-by: Dnyaneshwar Bhadane 

> -#define IS_JSL_EHL(i915) (IS_PLATFORM(i915, INTEL_JASPERLAKE) || \
> +#define IS_JASPERLAKE_EHL(i915)  (IS_PLATFORM(i915, INTEL_JASPERLAKE) || 
> \
>   IS_PLATFORM(i915, INTEL_ELKHARTLAKE))

The new name for this is just dumb. This matches two platforms, JSL and
EHL, and there's no point in one of them being an acronym and the other
one not.

And IS_JASPERLAKE_ELKHARTLAKE() would be too long.


BR,
Jani.

-- 
Jani Nikula, Intel Open Source Graphics Center


[Intel-gfx] [CI] drm/i915: Replace kmap() with kmap_local_page()

2023-06-19 Thread Tvrtko Ursulin
From: Sumitra Sharma 

kmap() has been deprecated in favor of the kmap_local_page()
due to high cost, restricted mapping space, the overhead of a
global lock for synchronization, and making the process sleep
in the absence of free slots.

kmap_local_page() is faster than kmap() and offers thread-local
and CPU-local mappings, take pagefaults in a local kmap region
and preserves preemption by saving the mappings of outgoing tasks
and restoring those of the incoming one during a context switch.

The mapping is kept thread local in the function
“i915_vma_coredump_create” in i915_gpu_error.c

Therefore, replace kmap() with kmap_local_page().

Suggested-by: Ira Weiny 
Signed-off-by: Sumitra Sharma 
Reviewed-by: Thomas Hellström 
Reviewed-by: Ira Weiny 
Signed-off-by: Tvrtko Ursulin 
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
b/drivers/gpu/drm/i915/i915_gpu_error.c
index ec368e700235..4749f99e6320 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1173,9 +1173,9 @@ i915_vma_coredump_create(const struct intel_gt *gt,
 
drm_clflush_pages(&page, 1);
 
-   s = kmap(page);
+   s = kmap_local_page(page);
ret = compress_page(compress, s, dst, false);
-   kunmap(page);
+   kunmap_local(s);
 
drm_clflush_pages(&page, 1);
 
-- 
2.39.2



Re: [Intel-gfx] [PATCH v2] drm/i915: Replace kmap() with kmap_local_page()

2023-06-19 Thread Tvrtko Ursulin



On 19/06/2023 08:59, Thomas Hellström (Intel) wrote:


On 6/18/23 20:11, Ira Weiny wrote:

Sumitra Sharma wrote:

kmap() has been deprecated in favor of the kmap_local_page()
due to high cost, restricted mapping space, the overhead of a
global lock for synchronization, and making the process sleep
in the absence of free slots.

kmap_local_page() is faster than kmap() and offers thread-local
and CPU-local mappings, take pagefaults in a local kmap region
and preserves preemption by saving the mappings of outgoing tasks
and restoring those of the incoming one during a context switch.

The mapping is kept thread local in the function
“i915_vma_coredump_create” in i915_gpu_error.c

Therefore, replace kmap() with kmap_local_page().

Suggested-by: Ira Weiny 

NIT: No need for the line break between Suggested-by and your signed 
off line.



Signed-off-by: Sumitra Sharma 
---

Changes in v2:
- Replace kmap() with kmap_local_page().

Generally it is customary to attribute a change like this to those who
suggested it in a V1 review.

For example:

  - Tvrtko/Thomas: Use kmap_local_page() instead of page_address()

Also I don't see Thomas on the new email list.  Since he took the time to
review V1 he might want to check this version out.  I've added him to the
'To:' list.


Thanks.



Also a link to V1 is nice.  B4 formats it like this:

- Link to v1: 
https://lore.kernel.org/all/20230614123556.ga381...@sumitra.com/


All that said the code looks good to me.  So with the above changes.

Reviewed-by: Ira Weiny 


LGTM. Reviewed-by: Thomas Hellström 


Thanks all! I'll just re-send the patch for our CI, since it didn't get 
picked up automatically (stuck in moderation perhaps), with all r-b tags 
added and extra line space removed and merge it if results will be green.


Regards,

Tvrtko


[Intel-gfx] [PATCHv4] drm/i915/display/dp: On AUX xfer timeout restart freshly

2023-06-19 Thread Arun R Murthy
At the beginning of the aux transfer a check for aux control busy bit is
done. Then as per the spec on aux transfer timeout, need to retry
freshly for 3 times with a delay which is taken care by the control
register.
On each of these 3 trials a check for busy has to be done so as to start
freshly.

v2: updated the commit message
v4: check for SEND_BUSY after write (Imre)

Signed-off-by: Arun R Murthy 
---
 drivers/gpu/drm/i915/display/intel_dp_aux.c | 58 +
 1 file changed, 26 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c 
b/drivers/gpu/drm/i915/display/intel_dp_aux.c
index 21b50a5c8a85..abe8047fac39 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
@@ -226,6 +226,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
int i, ret, recv_bytes;
int try, clock = 0;
u32 status;
+   u32 send_ctl;
bool vdd;
 
ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
@@ -273,45 +274,36 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
 * it using the same AUX CH simultaneously
 */
 
-   /* Try to wait for any previous AUX channel activity */
-   for (try = 0; try < 3; try++) {
-   status = intel_de_read_notrace(i915, ch_ctl);
-   if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
-   break;
-   msleep(1);
-   }
-   /* just trace the final value */
-   trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
-
-   if (try == 3) {
-   const u32 status = intel_de_read(i915, ch_ctl);
-
-   if (status != intel_dp->aux_busy_last_status) {
-   drm_WARN(&i915->drm, 1,
-"%s: not started (status 0x%08x)\n",
-intel_dp->aux.name, status);
-   intel_dp->aux_busy_last_status = status;
-   }
-
-   ret = -EBUSY;
-   goto out;
-   }
-
/* Only 5 data registers! */
if (drm_WARN_ON(&i915->drm, send_bytes > 20 || recv_size > 20)) {
ret = -E2BIG;
goto out;
}
+   send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
+ send_bytes,
+ aux_clock_divider);
+   send_ctl |= aux_send_ctl_flags;
 
while ((aux_clock_divider = intel_dp->get_aux_clock_divider(intel_dp, 
clock++))) {
-   u32 send_ctl = intel_dp->get_aux_send_ctl(intel_dp,
- send_bytes,
- aux_clock_divider);
-
-   send_ctl |= aux_send_ctl_flags;
-
-   /* Must try at least 3 times according to DP spec */
+   /* Re-visit : Must try at least 3 times according to DP spec */
for (try = 0; try < 5; try++) {
+   /* Try to wait for any previous AUX channel activity */
+   status = intel_dp_aux_wait_done(intel_dp);
+   /* just trace the final value */
+   trace_i915_reg_rw(false, ch_ctl, status, 
sizeof(status), true);
+
+   if (status & DP_AUX_CH_CTL_SEND_BUSY) {
+   drm_WARN(&i915->drm, 1,
+"%s: not started, previous Tx still in 
process (status 0x%08x)\n",
+intel_dp->aux.name, status);
+   intel_dp->aux_busy_last_status = status;
+   if (try > 3) {
+   ret = -EBUSY;
+   goto out;
+   } else
+   continue;
+   }
+
/* Load the send data into the aux channel data 
registers */
for (i = 0; i < send_bytes; i += 4)
intel_de_write(i915, ch_data[i >> 2],
@@ -321,6 +313,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
/* Send the command and wait for it to complete */
intel_de_write(i915, ch_ctl, send_ctl);
 
+   /* TODO: if typeC then 4.2ms else 800us. For DG2 add 
1.5ms for both cases */
status = intel_dp_aux_wait_done(intel_dp);
 
/* Clear done status and any errors */
@@ -335,7 +328,8 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
 *   Timeout errors from the HW already meet this
 *   requirement so skip to next iteration
 */
-   if (status & DP_AUX_CH_CTL_TIME_OUT_ERROR)
+   if (status & (DP_AUX_CH_CTL_TIME_OUT_ERROR |
+   

Re: [Intel-gfx] [PATCH v2] drm/i915: Replace kmap() with kmap_local_page()

2023-06-19 Thread Intel



On 6/18/23 20:11, Ira Weiny wrote:

Sumitra Sharma wrote:

kmap() has been deprecated in favor of the kmap_local_page()
due to high cost, restricted mapping space, the overhead of a
global lock for synchronization, and making the process sleep
in the absence of free slots.

kmap_local_page() is faster than kmap() and offers thread-local
and CPU-local mappings, take pagefaults in a local kmap region
and preserves preemption by saving the mappings of outgoing tasks
and restoring those of the incoming one during a context switch.

The mapping is kept thread local in the function
“i915_vma_coredump_create” in i915_gpu_error.c

Therefore, replace kmap() with kmap_local_page().

Suggested-by: Ira Weiny 


NIT: No need for the line break between Suggested-by and your signed off line.


Signed-off-by: Sumitra Sharma 
---

Changes in v2:
- Replace kmap() with kmap_local_page().

Generally it is customary to attribute a change like this to those who
suggested it in a V1 review.

For example:

- Tvrtko/Thomas: Use kmap_local_page() instead of page_address()

Also I don't see Thomas on the new email list.  Since he took the time to
review V1 he might want to check this version out.  I've added him to the
'To:' list.


Thanks.



Also a link to V1 is nice.  B4 formats it like this:

- Link to v1: https://lore.kernel.org/all/20230614123556.ga381...@sumitra.com/

All that said the code looks good to me.  So with the above changes.

Reviewed-by: Ira Weiny 


LGTM. Reviewed-by: Thomas Hellström 






- Change commit subject and message.

  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
b/drivers/gpu/drm/i915/i915_gpu_error.c
index f020c0086fbc..bc41500eedf5 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1164,9 +1164,9 @@ i915_vma_coredump_create(const struct intel_gt *gt,
  
  			drm_clflush_pages(&page, 1);
  
-			s = kmap(page);

+   s = kmap_local_page(page);
ret = compress_page(compress, s, dst, false);
-   kunmap(page);
+   kunmap_local(s);
  
  			drm_clflush_pages(&page, 1);
  
--

2.25.1