From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 06/11] drm/i915/cdclk: Extract vlv_dsi_min_cdclk()
Date: Wed, 30 Oct 2024 19:55:23 +0200 [thread overview]
Message-ID: <87cyjhlblg.fsf@intel.com> (raw)
In-Reply-To: <ZyIzCZ1f7QDQPB5G@intel.com>
On Wed, 30 Oct 2024, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Wed, Oct 30, 2024 at 01:34:38PM +0200, Jani Nikula wrote:
>> On Tue, 29 Oct 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
>> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> >
>> > Pull the DSI min cdclk calculation into a helper and hide
>> > it inside vlv_dsi.c in order to keep most DSI related
>> > details in one place.
>> >
>> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> > ---
>> > drivers/gpu/drm/i915/display/intel_cdclk.c | 23 ++------------------
>> > drivers/gpu/drm/i915/display/vlv_dsi.c | 25 ++++++++++++++++++++++
>> > drivers/gpu/drm/i915/display/vlv_dsi.h | 8 +++++++
>> > 3 files changed, 35 insertions(+), 21 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
>> > index 89d12c521411..e10378744607 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
>> > @@ -46,6 +46,7 @@
>> > #include "intel_vdsc.h"
>> > #include "skl_watermark.h"
>> > #include "skl_watermark_regs.h"
>> > +#include "vlv_dsi.h"
>> > #include "vlv_sideband.h"
>> >
>> > /**
>> > @@ -2849,8 +2850,6 @@ static int intel_vdsc_min_cdclk(const struct intel_crtc_state *crtc_state)
>> >
>> > int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
>> > {
>> > - struct intel_display *display = to_intel_display(crtc_state);
>> > - struct drm_i915_private *dev_priv = to_i915(display->drm);
>> > int min_cdclk;
>> >
>> > if (!crtc_state->hw.enable)
>> > @@ -2859,25 +2858,7 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
>> > min_cdclk = intel_pixel_rate_to_cdclk(crtc_state);
>> > min_cdclk = max(hsw_ips_min_cdclk(crtc_state), min_cdclk);
>> > min_cdclk = max(intel_audio_min_cdclk(crtc_state), min_cdclk);
>> > -
>> > - /*
>> > - * On Valleyview some DSI panels lose (v|h)sync when the clock is lower
>> > - * than 320000KHz.
>> > - */
>> > - if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI) &&
>> > - IS_VALLEYVIEW(dev_priv))
>> > - min_cdclk = max(320000, min_cdclk);
>> > -
>> > - /*
>> > - * On Geminilake once the CDCLK gets as low as 79200
>> > - * picture gets unstable, despite that values are
>> > - * correct for DSI PLL and DE PLL.
>> > - */
>> > - if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI) &&
>> > - IS_GEMINILAKE(dev_priv))
>> > - min_cdclk = max(158400, min_cdclk);
>> > -
>> > - /* Account for additional needs from the planes */
>> > + min_cdclk = max(vlv_dsi_min_cdclk(crtc_state), min_cdclk);
>> > min_cdclk = max(intel_planes_min_cdclk(crtc_state), min_cdclk);
>> >
>> > if (crtc_state->dsc.compression_enable)
>> > diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c
>> > index 9383eedee2d4..49a895589150 100644
>> > --- a/drivers/gpu/drm/i915/display/vlv_dsi.c
>> > +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c
>> > @@ -1760,6 +1760,31 @@ static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
>> > intel_dsi_log_params(intel_dsi);
>> > }
>> >
>> > +int vlv_dsi_min_cdclk(const struct intel_crtc_state *crtc_state)
>> > +{
>> > + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
>> > + int min_cdclk = 0;
>> > +
>> > + /*
>> > + * On Valleyview some DSI panels lose (v|h)sync when the clock is lower
>> > + * than 320000KHz.
>> > + */
>> > + if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI) &&
>> > + IS_VALLEYVIEW(dev_priv))
>> > + min_cdclk = max(320000, min_cdclk);
>> > +
>> > + /*
>> > + * On Geminilake once the CDCLK gets as low as 79200
>> > + * picture gets unstable, despite that values are
>> > + * correct for DSI PLL and DE PLL.
>> > + */
>> > + if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI) &&
>> > + IS_GEMINILAKE(dev_priv))
>> > + min_cdclk = max(158400, min_cdclk);
>> > +
>> > + return min_cdclk;
>> > +}
>> > +
>> > typedef void (*vlv_dsi_dmi_quirk_func)(struct intel_dsi *intel_dsi);
>> >
>> > /*
>> > diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.h b/drivers/gpu/drm/i915/display/vlv_dsi.h
>> > index cf9d7b82f288..5f99059b4c48 100644
>> > --- a/drivers/gpu/drm/i915/display/vlv_dsi.h
>> > +++ b/drivers/gpu/drm/i915/display/vlv_dsi.h
>> > @@ -8,13 +8,17 @@
>> >
>> > #include <linux/types.h>
>> >
>> > +#include <drm/drm_mipi_dsi.h>
>> > +
>>
>> Huh, why is this required? At least it's unrelated to the patch.
>
> Sorry meant to note that in the commit msg, but forgot.
>
> xe fails to build without this:
> ../drivers/gpu/drm/i915/display/vlv_dsi.h:28:42: error: return type is an incomplete type
>
> It looks like a forward declaration is not enough for
> return types of static inline functions. i915 on the other
> hand builds fine.
>
> I suppose one alternative would be to declare is as just
> 'int' for xe.
I think I've actually snuck in some of those int usages in the past,
because in the end it doesn't really matter for the inline stubs.
BR,
Jani.
>
>>
>> Other than that,
>>
>> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>>
>>
>> > enum port;
>> > struct drm_i915_private;
>> > +struct intel_crtc_state;
>> > struct intel_dsi;
>> >
>> > #ifdef I915
>> > void vlv_dsi_wait_for_fifo_empty(struct intel_dsi *intel_dsi, enum port port);
>> > enum mipi_dsi_pixel_format pixel_format_from_register_bits(u32 fmt);
>> > +int vlv_dsi_min_cdclk(const struct intel_crtc_state *crtc_state);
>> > void vlv_dsi_init(struct drm_i915_private *dev_priv);
>> > #else
>> > static inline void vlv_dsi_wait_for_fifo_empty(struct intel_dsi *intel_dsi, enum port port)
>> > @@ -24,6 +28,10 @@ static inline enum mipi_dsi_pixel_format pixel_format_from_register_bits(u32 fmt
>> > {
>> > return 0;
>> > }
>> > +static inline int vlv_dsi_min_cdclk(const struct intel_crtc_state *crtc_state)
>> > +{
>> > + return 0;
>> > +}
>> > static inline void vlv_dsi_init(struct drm_i915_private *dev_priv)
>> > {
>> > }
>>
>> --
>> Jani Nikula, Intel
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-10-30 17:55 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 21:52 [PATCH 00/11] drm/i915/cdclk: Declutter CDCLK code Ville Syrjala
2024-10-29 21:52 ` [PATCH 01/11] drm/i915: Introduce HAS_DOUBLE_WIDE() Ville Syrjala
2024-10-30 11:23 ` Jani Nikula
2024-10-29 21:52 ` [PATCH 02/11] drm/i915/cdclk: Extract intel_cdclk_guardband() and intel_cdclk_ppc() Ville Syrjala
2024-10-30 11:23 ` Jani Nikula
2024-10-29 21:52 ` [PATCH 03/11] drm/i915/cdclk: Extract hsw_ips_min_cdclk() Ville Syrjala
2024-10-30 11:26 ` Jani Nikula
2024-10-29 21:52 ` [PATCH 04/11] drm/i915/cdclk: Extract intel_audio_min_cdclk() Ville Syrjala
2024-10-30 11:30 ` Jani Nikula
2024-10-29 21:52 ` [PATCH 05/11] drm/i915/cdclk: Factor out has_audio check in intel_audio_min_cdclk() Ville Syrjala
2024-10-30 11:30 ` Jani Nikula
2024-10-29 21:52 ` [PATCH 06/11] drm/i915/cdclk: Extract vlv_dsi_min_cdclk() Ville Syrjala
2024-10-30 11:34 ` Jani Nikula
2024-10-30 13:22 ` Ville Syrjälä
2024-10-30 17:55 ` Jani Nikula [this message]
2024-10-29 21:52 ` [PATCH 07/11] drm/i915/cdclk: Factor out INTEL_OUTPUT_DSI check in vlv_dsi_min_cdclk() Ville Syrjala
2024-10-30 11:35 ` Jani Nikula
2024-10-29 21:52 ` [PATCH 08/11] drm/i915/cdclk: Suck the compression_enable check into intel_vdsc_min_cdclk() Ville Syrjala
2024-10-30 11:37 ` Jani Nikula
2024-10-29 21:52 ` [PATCH 09/11] drm/i915/cdclk: Drop pointles max_t() usage in intel_vdsc_min_cdclk() Ville Syrjala
2024-10-30 11:39 ` Jani Nikula
2024-10-29 21:52 ` [PATCH 10/11] drm/i915/cdclk: Relocate intel_vdsc_min_cdclk() Ville Syrjala
2024-10-30 11:40 ` Jani Nikula
2024-10-29 21:52 ` [PATCH 11/11] drm/i915/cdclk: Unify cdclk max() parameter order Ville Syrjala
2024-10-30 11:41 ` Jani Nikula
2024-10-30 1:30 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/cdclk: Declutter CDCLK code Patchwork
2024-10-30 1:30 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-10-30 1:46 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-10-31 13:20 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/cdclk: Declutter CDCLK code (rev2) Patchwork
2024-10-31 13:20 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-10-31 14:16 ` ✓ Fi.CI.BAT: success " Patchwork
2024-10-31 21:02 ` ✗ Fi.CI.IGT: failure " 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=87cyjhlblg.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.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