Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Nischal Varide <nischal.varide@intel.com>,
	intel-gfx@lists.freedesktop.org, nischal.varide@intel.com
Subject: Re: [Intel-gfx] [PATCH] drm/i915/display: mode clock check related to max dotclk frequency
Date: Wed, 09 Nov 2022 12:36:44 +0200	[thread overview]
Message-ID: <87r0yc76tf.fsf@intel.com> (raw)
In-Reply-To: <20221109040324.17675-1-nischal.varide@intel.com>

On Wed, 09 Nov 2022, Nischal Varide <nischal.varide@intel.com> wrote:
> A check on mode->clock to see if is greater than i915->max_dotclk_freq
> or greater than 2 * (i915_max_dotclk_freq) in case of big-joiner and
> return an -EINVAL in both the cases

The commit message should explain *why* the change is being done.

>
> Signed-off-by: Nischal Varide <nischal.varide@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 7400d6b4c587..813f4c369dda 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -995,6 +995,10 @@ intel_dp_mode_valid(struct drm_connector *_connector,
>  		bigjoiner = true;
>  		max_dotclk *= 2;
>  	}
> +
> +	if (mode->clock > max_dotclk)
> +		return -EINVAL;
> +

The return type of this function is enum drm_mode_status, which
indicates the reason for rejecting the mode. It's not a negative error
code.

Near the top of the function we have "target_clock = mode->clock;"
making the above identical to the check we already have below. Apart
from the incorrect return code.

What are you trying to do?

BR,
Jani.


>  	if (target_clock > max_dotclk)
>  		return MODE_CLOCK_HIGH;




-- 
Jani Nikula, Intel Open Source Graphics Center

  parent reply	other threads:[~2022-11-09 10:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09  4:03 [Intel-gfx] [PATCH] drm/i915/display: mode clock check related to max dotclk frequency Nischal Varide
2022-11-09  4:24 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for " Patchwork
2022-11-09  4:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-09 10:36 ` Jani Nikula [this message]
2022-11-10  0:00   ` [Intel-gfx] [PATCH] " Navare, Manasi
2022-11-09 12:57 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork

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=87r0yc76tf.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=nischal.varide@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