[Intel-gfx] [PATCH RFC] Revert "drm/i915: Try to use fast+narrow link on eDP again and fall back to the old max strategy on failure"

2021-05-10 Thread Paul Zimmerman
This reverts commit 2bbd6dba84d44219387df051a1c799b7bac46099.

Since 5.12-rc2, my Dell XPS-15 laptop has had a blank screen on boot.
The system seems to run fine other than having no display, I am able
to ssh into the machine. I don't see anything interesting in the dmesg
log. I bisected the problem down to this commit, and reverting it fixes
the problem.

Signed-off-by: Paul Zimmerman 
---
I am attaching the dmesg log from 5.12.0 when the problem occurs. Any
other debugging info you want me to provide?

 .../drm/i915/display/intel_display_types.h|  1 -
 drivers/gpu/drm/i915/display/intel_dp.c   | 75 +++
 2 files changed, 9 insertions(+), 67 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
b/drivers/gpu/drm/i915/display/intel_display_types.h
index 184ecbbcec99..196900100689 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1424,7 +1424,6 @@ struct intel_dp {
bool has_hdmi_sink;
bool has_audio;
bool reset_link_params;
-   bool use_max_params;
u8 dpcd[DP_RECEIVER_CAP_SIZE];
u8 psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
b/drivers/gpu/drm/i915/display/intel_dp.c
index 775d89b6c3fc..238ae1099132 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -480,13 +480,6 @@ int intel_dp_get_link_train_fallback_values(struct 
intel_dp *intel_dp,
return -1;
}
 
-   if (intel_dp_is_edp(intel_dp) && !intel_dp->use_max_params) {
-   drm_dbg_kms(&i915->drm,
-   "Retrying Link training for eDP with max 
parameters\n");
-   intel_dp->use_max_params = true;
-   return 0;
-   }
-
index = intel_dp_rate_index(intel_dp->common_rates,
intel_dp->num_common_rates,
link_rate);
@@ -1174,44 +1167,6 @@ intel_dp_compute_link_config_wide(struct intel_dp 
*intel_dp,
return -EINVAL;
 }
 
-/* Optimize link config in order: max bpp, min lanes, min clock */
-static int
-intel_dp_compute_link_config_fast(struct intel_dp *intel_dp,
- struct intel_crtc_state *pipe_config,
- const struct link_config_limits *limits)
-{
-   const struct drm_display_mode *adjusted_mode = 
&pipe_config->hw.adjusted_mode;
-   int bpp, clock, lane_count;
-   int mode_rate, link_clock, link_avail;
-
-   for (bpp = limits->max_bpp; bpp >= limits->min_bpp; bpp -= 2 * 3) {
-   int output_bpp = 
intel_dp_output_bpp(pipe_config->output_format, bpp);
-
-   mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock,
-  output_bpp);
-
-   for (lane_count = limits->min_lane_count;
-lane_count <= limits->max_lane_count;
-lane_count <<= 1) {
-   for (clock = limits->min_clock; clock <= 
limits->max_clock; clock++) {
-   link_clock = intel_dp->common_rates[clock];
-   link_avail = intel_dp_max_data_rate(link_clock,
-   lane_count);
-
-   if (mode_rate <= link_avail) {
-   pipe_config->lane_count = lane_count;
-   pipe_config->pipe_bpp = bpp;
-   pipe_config->port_clock = link_clock;
-
-   return 0;
-   }
-   }
-   }
-   }
-
-   return -EINVAL;
-}
-
 static int intel_dp_dsc_compute_bpp(struct intel_dp *intel_dp, u8 dsc_max_bpc)
 {
int i, num_bpc;
@@ -1435,14 +1390,13 @@ intel_dp_compute_link_config(struct intel_encoder 
*encoder,
limits.min_bpp = intel_dp_min_bpp(pipe_config->output_format);
limits.max_bpp = intel_dp_max_bpp(intel_dp, pipe_config);
 
-   if (intel_dp->use_max_params) {
+   if (intel_dp_is_edp(intel_dp)) {
/*
 * Use the maximum clock and number of lanes the eDP panel
-* advertizes being capable of in case the initial fast
-* optimal params failed us. The panels are generally
+* advertizes being capable of. The panels are generally
 * designed to support only a single clock and lane
-* configuration, and typically on older panels these
-* values correspond to the native resolution of the panel.
+* 

Re: [Intel-gfx] [PATCH RFC] Revert "drm/i915: Try to use fast+narrow link on eDP again and fall back to the old max strategy on failure"

2021-05-10 Thread Paul Zimmerman
On Sat, May 8, 2021 at 9:44 PM Paul Zimmerman  wrote:
>
> This reverts commit 2bbd6dba84d44219387df051a1c799b7bac46099.
>
> Since 5.12-rc2, my Dell XPS-15 laptop has had a blank screen on boot.
> The system seems to run fine other than having no display, I am able
> to ssh into the machine. I don't see anything interesting in the dmesg
> log. I bisected the problem down to this commit, and reverting it fixes
> the problem.
>
> Signed-off-by: Paul Zimmerman 

Replying to myself, to say that I just tested kernel 5.13-rc1, and the
problem still exists there, and the same revert fixes the problem.

- Paul

> ---
> I am attaching the dmesg log from 5.12.0 when the problem occurs. Any
> other debugging info you want me to provide?
>
>  .../drm/i915/display/intel_display_types.h|  1 -
>  drivers/gpu/drm/i915/display/intel_dp.c   | 75 +++
>  2 files changed, 9 insertions(+), 67 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
> b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 184ecbbcec99..196900100689 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1424,7 +1424,6 @@ struct intel_dp {
> bool has_hdmi_sink;
> bool has_audio;
> bool reset_link_params;
> -   bool use_max_params;
> u8 dpcd[DP_RECEIVER_CAP_SIZE];
> u8 psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
> u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 775d89b6c3fc..238ae1099132 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -480,13 +480,6 @@ int intel_dp_get_link_train_fallback_values(struct 
> intel_dp *intel_dp,
> return -1;
> }
>
> -   if (intel_dp_is_edp(intel_dp) && !intel_dp->use_max_params) {
> -   drm_dbg_kms(&i915->drm,
> -   "Retrying Link training for eDP with max 
> parameters\n");
> -   intel_dp->use_max_params = true;
> -   return 0;
> -   }
> -
> index = intel_dp_rate_index(intel_dp->common_rates,
> intel_dp->num_common_rates,
> link_rate);
> @@ -1174,44 +1167,6 @@ intel_dp_compute_link_config_wide(struct intel_dp 
> *intel_dp,
> return -EINVAL;
>  }
>
> -/* Optimize link config in order: max bpp, min lanes, min clock */
> -static int
> -intel_dp_compute_link_config_fast(struct intel_dp *intel_dp,
> - struct intel_crtc_state *pipe_config,
> - const struct link_config_limits *limits)
> -{
> -   const struct drm_display_mode *adjusted_mode = 
> &pipe_config->hw.adjusted_mode;
> -   int bpp, clock, lane_count;
> -   int mode_rate, link_clock, link_avail;
> -
> -   for (bpp = limits->max_bpp; bpp >= limits->min_bpp; bpp -= 2 * 3) {
> -   int output_bpp = 
> intel_dp_output_bpp(pipe_config->output_format, bpp);
> -
> -   mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock,
> -  output_bpp);
> -
> -   for (lane_count = limits->min_lane_count;
> -lane_count <= limits->max_lane_count;
> -lane_count <<= 1) {
> -   for (clock = limits->min_clock; clock <= 
> limits->max_clock; clock++) {
> -   link_clock = intel_dp->common_rates[clock];
> -   link_avail = 
> intel_dp_max_data_rate(link_clock,
> -   
> lane_count);
> -
> -   if (mode_rate <= link_avail) {
> -   pipe_config->lane_count = lane_count;
> -   pipe_config->pipe_bpp = bpp;
> -   pipe_config->port_clock = link_clock;
> -
> -   return 0;
> -   }
> -   }
> -   }
> -   }
> -
> -   return -EINVAL;
> -}
> -
>  static int intel_dp_dsc_compute_bpp(struct intel_dp *intel_dp, u8 
> dsc_max_bpc)
>  {
> int i, num_bpc;
> @@ -1435,14 +1390,13 @@ intel_dp_compute_link_config(struct intel_encoder 
> *encoder,
> limits.min_bpp = intel_dp_min_bpp(pip

Re: [Intel-gfx] [PATCH RFC] Revert "drm/i915: Try to use fast+narrow link on eDP again and fall back to the old max strategy on failure"

2021-05-11 Thread Paul Zimmerman
On Mon, May 10, 2021 at 7:00 AM Timo Aaltonen  wrote:
>
> On 9.5.2021 7.43, Paul Zimmerman wrote:
> > This reverts commit 2bbd6dba84d44219387df051a1c799b7bac46099.
> >
> > Since 5.12-rc2, my Dell XPS-15 laptop has had a blank screen on boot.
> > The system seems to run fine other than having no display, I am able
> > to ssh into the machine. I don't see anything interesting in the dmesg
> > log. I bisected the problem down to this commit, and reverting it fixes
> > the problem.
>
> Have you tried with drm-tip? It has acca7762eb71bc0 which hopefully
> helps here.

I picked that one commit from the drm-tip tree (wasn't sure how to merge
the entire tree into the kernel) and can confirm that it does fix the problem.
Thank you! I hope the fix will be sent to Linus pretty soon, and it will need
backporting to the 5.12 kernel as well.

- Paul
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] Regression: bisected: commit 7c510133d93 breaks video

2013-09-20 Thread Paul Zimmerman
I have an ASUS P6X58D-Premium mobo with a GeForce 9400GT PCIe video card.
With kernel 3.12-rc1, I get scrambled video on boot. Kernel 3.11 works
fine.

Bisecting this, I found 7c510133d93dd6f15ca040733ba7b2891ed61fd1 "drm:
mark context support as a legacy subsystem" is the guilty commit. If I
revert that commit, the video works fine.

Is there any more info I can provide?

-- 
Paul

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] Regression: bisected: commit 7c510133d93 breaks video

2013-09-20 Thread Paul Zimmerman
> From: Paul Zimmerman
> Sent: Thursday, September 19, 2013 11:21 AM
> 
> > From: Dave Airlie [mailto:airl...@gmail.com]
> > Sent: Wednesday, September 18, 2013 7:40 PM
> >
> > On Thu, Sep 19, 2013 at 12:02 PM, Paul Zimmerman
> >  wrote:
> > > I have an ASUS P6X58D-Premium mobo with a GeForce 9400GT PCIe video card.
> > > With kernel 3.12-rc1, I get scrambled video on boot. Kernel 3.11 works
> > > fine.
> > >
> > > Bisecting this, I found 7c510133d93dd6f15ca040733ba7b2891ed61fd1 "drm:
> > > mark context support as a legacy subsystem" is the guilty commit. If I
> > > revert that commit, the video works fine.
> > >
> > > Is there any more info I can provide?
> >
> > Full dmesg, and what driver you are using.
> 
> Driver is nouveau.
> 
> The dmesg from a good boot with the commit reverted is attached.
> 
> For the bad boot, the dmesg log is filled with messages like this:
> 
> [   15.871667] nouveau E[ PFB][:03:00.0] trapped write at 
> 0x01010010a0 on channel 0x0001fed0
> [unknown] BAR/PFIFO_WRITE/IN reason: PAGE_NOT_PRESENT
> [   15.871698] nouveau E[ PFB][:03:00.0] trapped write at 
> 0x010100b2e0 on channel 0x0001fed0
> [unknown] BAR/PFIFO_WRITE/IN reason: PAGE_NOT_PRESENT
> [   15.871781] nouveau E[ PFB][:03:00.0] trapped write at 
> 0x0101011600 on channel 0x0001fed0
> [unknown] BAR/PFIFO_WRITE/IN reason: PAGE_NOT_PRESENT
> 
> I will try next with the patch series you sent to Linus yesterday, to
> see if that happens to fix this.

Nope, with your patch series from yesterday the problem still exists.

-- 
Paul

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] Regression: bisected: commit 7c510133d93 breaks video

2013-09-20 Thread Paul Zimmerman
> From: Dave Airlie [mailto:airl...@gmail.com]
> Sent: Thursday, September 19, 2013 1:15 PM
> 
> On Fri, Sep 20, 2013 at 6:10 AM, Daniel Vetter  wrote:
> > On Thu, Sep 19, 2013 at 06:32:47PM +0000, Paul Zimmerman wrote:
> >> > From: Paul Zimmerman
> >> > Sent: Thursday, September 19, 2013 11:21 AM
> >> >
> >> > > From: Dave Airlie [mailto:airl...@gmail.com]
> >> > > Sent: Wednesday, September 18, 2013 7:40 PM
> >> > >
> >> > > On Thu, Sep 19, 2013 at 12:02 PM, Paul Zimmerman
> >> > >  wrote:
> >> > > > I have an ASUS P6X58D-Premium mobo with a GeForce 9400GT PCIe video 
> >> > > > card.
> >> > > > With kernel 3.12-rc1, I get scrambled video on boot. Kernel 3.11 
> >> > > > works
> >> > > > fine.
> >> > > >
> >> > > > Bisecting this, I found 7c510133d93dd6f15ca040733ba7b2891ed61fd1 
> >> > > > "drm:
> >> > > > mark context support as a legacy subsystem" is the guilty commit. If 
> >> > > > I
> >> > > > revert that commit, the video works fine.
> >> > > >
> >> > > > Is there any more info I can provide?
> >> > >
> >> > > Full dmesg, and what driver you are using.
> >> >
> >> > Driver is nouveau.
> >> >
> >> > The dmesg from a good boot with the commit reverted is attached.
> >> >
> >> > For the bad boot, the dmesg log is filled with messages like this:
> >> >
> >> > [   15.871667] nouveau E[ PFB][:03:00.0] trapped write at 
> >> > 0x01010010a0 on channel
> 0x0001fed0
> >> > [unknown] BAR/PFIFO_WRITE/IN reason: PAGE_NOT_PRESENT
> >> > [   15.871698] nouveau E[ PFB][:03:00.0] trapped write at 
> >> > 0x010100b2e0 on channel
> 0x0001fed0
> >> > [unknown] BAR/PFIFO_WRITE/IN reason: PAGE_NOT_PRESENT
> >> > [   15.871781] nouveau E[ PFB][:03:00.0] trapped write at 
> >> > 0x0101011600 on channel
> 0x0001fed0
> >> > [unknown] BAR/PFIFO_WRITE/IN reason: PAGE_NOT_PRESENT
> >> >
> >> > I will try next with the patch series you sent to Linus yesterday, to
> >> > see if that happens to fix this.
> >>
> >> Nope, with your patch series from yesterday the problem still exists.
> >
> > Just to double-check: Does the revert still work, even on latest upstream
> > git + Dave's pull request?
> 
> Also what versions of userspace have you got, libdrm +
> xf86-video-nouveau and mesa?

Yes, the revert still works.

I have pretty old userspace, Fedora 14.

libdrm is 2.4.22-1.fc14, mesa is 7.9-5.fc14.

I don't have xf86-video-nouveau, I have
xorg-x11-drv-nouveau.x86_64 1:0.0.16-14.20101010git8c8f15c.fc14

-- 
Paul

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx