stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: gregkh@linuxfoundation.org, bskeggs@redhat.com,
	stable@vger.kernel.org, ville.syrjala@linux.intel.com
Subject: Re: FAILED: patch "[PATCH] drm/nouveau/kms/nv50-: Get rid of bogus" failed to apply to 5.9-stable tree
Date: Fri, 06 Nov 2020 15:56:04 -0500	[thread overview]
Message-ID: <db280b0e49cef626c69f1a90eb7201c0135115d2.camel@redhat.com> (raw)
In-Reply-To: <160459060724988@kroah.com>

Actually - this fix caused some problems, and there's a follow-up fix in linus's
tree now that we want to make sure to apply at the same time. It looks like I
forgot to Cc it to stable though, so I'll backport both this and the subsequent
fix and send them to you in just a bit

On Thu, 2020-11-05 at 16:36 +0100, gregkh@linuxfoundation.org wrote:
> 
> The patch below does not apply to the 5.9-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
> 
> thanks,
> 
> greg k-h
> 
> ------------------ original commit in Linus's tree ------------------
> 
> From 2d831155cf0607566e43d8465da33774b2dc7221 Mon Sep 17 00:00:00 2001
> From: Lyude Paul <lyude@redhat.com>
> Date: Tue, 29 Sep 2020 18:31:31 -0400
> Subject: [PATCH] drm/nouveau/kms/nv50-: Get rid of bogus
>  nouveau_conn_mode_valid()
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> Ville also pointed out that I got a lot of the logic here wrong as well,
> whoops.
> While I don't think anyone's likely using 3D output with nouveau, the next
> patch
> will make nouveau_conn_mode_valid() make a lot less sense. So, let's just get
> rid of it and open-code it like before, while taking care to move the 3D frame
> packing calculations on the dot clock into the right place.
> 
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Fixes: d6a9efece724 ("drm/nouveau/kms/nv50-: Share DP SST mode_valid()
> handling with MST")
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: <stable@vger.kernel.org> # v5.8+
> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c
> b/drivers/gpu/drm/nouveau/nouveau_connector.c
> index 49dd0cbc332f..6f21f36719fc 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_connector.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
> @@ -1023,29 +1023,6 @@ get_tmds_link_bandwidth(struct drm_connector
> *connector)
>                 return 112000 * duallink_scale;
>  }
>  
> -enum drm_mode_status
> -nouveau_conn_mode_clock_valid(const struct drm_display_mode *mode,
> -                             const unsigned min_clock,
> -                             const unsigned max_clock,
> -                             unsigned int *clock_out)
> -{
> -       unsigned int clock = mode->clock;
> -
> -       if ((mode->flags & DRM_MODE_FLAG_3D_MASK) ==
> -           DRM_MODE_FLAG_3D_FRAME_PACKING)
> -               clock *= 2;
> -
> -       if (clock < min_clock)
> -               return MODE_CLOCK_LOW;
> -       if (clock > max_clock)
> -               return MODE_CLOCK_HIGH;
> -
> -       if (clock_out)
> -               *clock_out = clock;
> -
> -       return MODE_OK;
> -}
> -
>  static enum drm_mode_status
>  nouveau_connector_mode_valid(struct drm_connector *connector,
>                              struct drm_display_mode *mode)
> @@ -1053,7 +1030,7 @@ nouveau_connector_mode_valid(struct drm_connector
> *connector,
>         struct nouveau_connector *nv_connector = nouveau_connector(connector);
>         struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder;
>         struct drm_encoder *encoder = to_drm_encoder(nv_encoder);
> -       unsigned min_clock = 25000, max_clock = min_clock;
> +       unsigned int min_clock = 25000, max_clock = min_clock, clock = mode-
> >clock;
>  
>         switch (nv_encoder->dcb->type) {
>         case DCB_OUTPUT_LVDS:
> @@ -1082,8 +1059,15 @@ nouveau_connector_mode_valid(struct drm_connector
> *connector,
>                 return MODE_BAD;
>         }
>  
> -       return nouveau_conn_mode_clock_valid(mode, min_clock, max_clock,
> -                                            NULL);
> +       if ((mode->flags & DRM_MODE_FLAG_3D_MASK) ==
> DRM_MODE_FLAG_3D_FRAME_PACKING)
> +               clock *= 2;
> +
> +       if (clock < min_clock)
> +               return MODE_CLOCK_LOW;
> +       if (clock > max_clock)
> +               return MODE_CLOCK_HIGH;
> +
> +       return MODE_OK;
>  }
>  
>  static struct drm_encoder *
> diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c
> b/drivers/gpu/drm/nouveau/nouveau_dp.c
> index 7b640e05bd4c..93e3751ad7f1 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_dp.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_dp.c
> @@ -232,12 +232,14 @@ nv50_dp_mode_valid(struct drm_connector *connector,
>                    unsigned *out_clock)
>  {
>         const unsigned min_clock = 25000;
> -       unsigned max_clock, ds_clock, clock;
> -       enum drm_mode_status ret;
> +       unsigned max_clock, ds_clock, clock = mode->clock;
>  
>         if (mode->flags & DRM_MODE_FLAG_INTERLACE && !outp->caps.dp_interlace)
>                 return MODE_NO_INTERLACE;
>  
> +       if ((mode->flags & DRM_MODE_FLAG_3D_MASK) ==
> DRM_MODE_FLAG_3D_FRAME_PACKING)
> +               clock *= 2;
> +
>         max_clock = outp->dp.link_nr * outp->dp.link_bw;
>         ds_clock = drm_dp_downstream_max_dotclock(outp->dp.dpcd,
>                                                   outp->dp.downstream_ports);
> @@ -245,9 +247,13 @@ nv50_dp_mode_valid(struct drm_connector *connector,
>                 max_clock = min(max_clock, ds_clock);
>  
>         clock = mode->clock * (connector->display_info.bpc * 3) / 10;
> -       ret = nouveau_conn_mode_clock_valid(mode, min_clock, max_clock,
> -                                           &clock);
> +       if (clock < min_clock)
> +               return MODE_CLOCK_LOW;
> +       if (clock > max_clock)
> +               return MODE_CLOCK_HIGH;
> +
>         if (out_clock)
>                 *out_clock = clock;
> -       return ret;
> +
> +       return MODE_OK;
>  }
> 

-- 
Sincerely,
   Lyude Paul (she/her)
   Software Engineer at Red Hat
   
Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've
asked me a question, are waiting for a review/merge on a patch, etc. and I
haven't responded in a while, please feel free to send me another email to check
on my status. I don't bite!


  reply	other threads:[~2020-11-06 20:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 15:36 FAILED: patch "[PATCH] drm/nouveau/kms/nv50-: Get rid of bogus" failed to apply to 5.9-stable tree gregkh
2020-11-06 20:56 ` Lyude Paul [this message]
2020-11-06 23:30 ` [PATCH 0/2] drm/nouveau: Stable backport of DP clock fixes for v5.9 Lyude Paul
2020-11-06 23:30   ` [PATCH 1/2] drm/nouveau/kms/nv50-: Get rid of bogus nouveau_conn_mode_valid() Lyude Paul
2020-11-06 23:30   ` [PATCH 2/2] drm/nouveau/kms/nv50-: Fix clock checking algorithm in nv50_dp_mode_valid() Lyude Paul
2020-11-07 15:30   ` [PATCH 0/2] drm/nouveau: Stable backport of DP clock fixes for v5.9 Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db280b0e49cef626c69f1a90eb7201c0135115d2.camel@redhat.com \
    --to=lyude@redhat.com \
    --cc=bskeggs@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).