From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 05/10] drm/i915/crtc: un-inline some crtc functions and move to intel_crtc.[ch]
Date: Wed, 1 Dec 2021 17:12:46 +0200 [thread overview]
Message-ID: <YaeQ7oEeFE92pWF6@intel.com> (raw)
In-Reply-To: <c0be2adc4a7f7e72a47e12a57f742aaa42b813e6.1638366969.git.jani.nikula@intel.com>
On Wed, Dec 01, 2021 at 03:57:07PM +0200, Jani Nikula wrote:
> Move a number of crtc/pipe related functions to intel_crtc.[ch], and
> un-inline to avoid looking into struct drm_i915_private guts in header
> files.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_crtc.c | 42 ++++++++++++++++++
> drivers/gpu/drm/i915/display/intel_crtc.h | 10 +++++
> .../drm/i915/display/intel_display_types.h | 44 -------------------
> 3 files changed, 52 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
> index 243d5cc29734..43554b591904 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> @@ -36,6 +36,48 @@ static void assert_vblank_disabled(struct drm_crtc *crtc)
> drm_crtc_vblank_put(crtc);
> }
>
> +bool intel_pipe_valid(struct drm_i915_private *i915, enum pipe pipe)
> +{
> + return (pipe >= 0 &&
> + pipe < ARRAY_SIZE(i915->pipe_to_crtc_mapping) &&
> + INTEL_INFO(i915)->pipe_mask & BIT(pipe) &&
> + i915->pipe_to_crtc_mapping[pipe]);
> +}
> +
> +struct intel_crtc *intel_get_first_crtc(struct drm_i915_private *i915)
> +{
> + return to_intel_crtc(drm_crtc_from_index(&i915->drm, 0));
> +}
> +
> +struct intel_crtc *intel_crtc_for_pipe(struct drm_i915_private *i915,
> + enum pipe pipe)
> +{
> + /* pipe_to_crtc_mapping may have hole on any of 3 display pipe system */
> + drm_WARN_ON(&i915->drm,
> + !(INTEL_INFO(i915)->pipe_mask & BIT(pipe)));
> + return i915->pipe_to_crtc_mapping[pipe];
> +}
> +
> +struct intel_crtc *intel_crtc_for_plane(struct drm_i915_private *i915,
> + enum i9xx_plane_id plane)
> +{
> + return i915->plane_to_crtc_mapping[plane];
> +}
> +
> +void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc)
> +{
> + drm_crtc_wait_one_vblank(&crtc->base);
> +}
> +
> +void intel_wait_for_vblank_if_active(struct drm_i915_private *i915,
> + enum pipe pipe)
> +{
> + struct intel_crtc *crtc = intel_crtc_for_pipe(i915, pipe);
> +
> + if (crtc->active)
> + intel_crtc_wait_for_next_vblank(crtc);
> +}
> +
> u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)
> {
> struct drm_device *dev = crtc->base.dev;
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.h b/drivers/gpu/drm/i915/display/intel_crtc.h
> index a0039fdb1eb0..23110e91ecd6 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.h
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.h
> @@ -8,6 +8,7 @@
>
> #include <linux/types.h>
>
> +enum i9xx_plane_id;
> enum pipe;
> struct drm_display_mode;
> struct drm_i915_private;
> @@ -28,5 +29,14 @@ void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state);
> void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state);
> void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);
> void intel_wait_for_vblank_workers(struct intel_atomic_state *state);
> +bool intel_pipe_valid(struct drm_i915_private *i915, enum pipe pipe);
> +struct intel_crtc *intel_get_first_crtc(struct drm_i915_private *i915);
> +struct intel_crtc *intel_crtc_for_pipe(struct drm_i915_private *i915,
> + enum pipe pipe);
> +struct intel_crtc *intel_crtc_for_plane(struct drm_i915_private *i915,
> + enum i9xx_plane_id plane);
> +void intel_wait_for_vblank_if_active(struct drm_i915_private *i915,
> + enum pipe pipe);
> +void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc);
>
> #endif
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index a48dfd1474dd..eeaaa101a7b6 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1773,35 +1773,6 @@ vlv_pipe_to_channel(enum pipe pipe)
> }
> }
>
> -static inline bool intel_pipe_valid(struct drm_i915_private *i915, enum pipe pipe)
> -{
> - return (pipe >= 0 &&
> - pipe < ARRAY_SIZE(i915->pipe_to_crtc_mapping) &&
> - INTEL_INFO(i915)->pipe_mask & BIT(pipe) &&
> - i915->pipe_to_crtc_mapping[pipe]);
> -}
> -
> -static inline struct intel_crtc *
> -intel_get_first_crtc(struct drm_i915_private *dev_priv)
> -{
> - return to_intel_crtc(drm_crtc_from_index(&dev_priv->drm, 0));
> -}
> -
> -static inline struct intel_crtc *
> -intel_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
> -{
> - /* pipe_to_crtc_mapping may have hole on any of 3 display pipe system */
> - drm_WARN_ON(&dev_priv->drm,
> - !(INTEL_INFO(dev_priv)->pipe_mask & BIT(pipe)));
> - return dev_priv->pipe_to_crtc_mapping[pipe];
> -}
> -
> -static inline struct intel_crtc *
> -intel_crtc_for_plane(struct drm_i915_private *dev_priv, enum i9xx_plane_id plane)
> -{
> - return dev_priv->plane_to_crtc_mapping[plane];
> -}
> -
> struct intel_load_detect_pipe {
> struct drm_atomic_state *restore_state;
> };
> @@ -2019,21 +1990,6 @@ intel_crtc_needs_modeset(const struct intel_crtc_state *crtc_state)
> return drm_atomic_crtc_needs_modeset(&crtc_state->uapi);
> }
>
> -static inline void
> -intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc)
> -{
> - drm_crtc_wait_one_vblank(&crtc->base);
> -}
> -
> -static inline void
> -intel_wait_for_vblank_if_active(struct drm_i915_private *dev_priv, enum pipe pipe)
> -{
> - struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
> -
> - if (crtc->active)
> - intel_crtc_wait_for_next_vblank(crtc);
> -}
> -
> static inline bool intel_modifier_uses_dpt(struct drm_i915_private *i915, u64 modifier)
> {
> return DISPLAY_VER(i915) >= 13 && modifier != DRM_FORMAT_MOD_LINEAR;
> --
> 2.30.2
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2021-12-01 15:13 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-01 13:57 [Intel-gfx] [PATCH v2 00/10] drm/i915: break intel_display_types.h dependency on i915_drv.h Jani Nikula
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 01/10] drm/i915/display: add intel_crtc_wait_for_next_vblank() and use it Jani Nikula
2021-12-01 15:10 ` Ville Syrjälä
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 02/10] drm/i915/crtc: rename intel_get_crtc_for_pipe() to intel_crtc_for_pipe() Jani Nikula
2021-12-01 15:11 ` Ville Syrjälä
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 03/10] drm/i915/crtc: rename intel_get_crtc_for_plane() to intel_crtc_for_plane() Jani Nikula
2021-12-01 15:11 ` Ville Syrjälä
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 04/10] drm/i915/display: remove intel_wait_for_vblank() Jani Nikula
2021-12-01 15:12 ` Ville Syrjälä
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 05/10] drm/i915/crtc: un-inline some crtc functions and move to intel_crtc.[ch] Jani Nikula
2021-12-01 15:12 ` Ville Syrjälä [this message]
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 06/10] drm/i915/fb: move intel_fb_uses_dpt to intel_fb.c and un-inline Jani Nikula
2021-12-01 15:13 ` Ville Syrjälä
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 07/10] drm/i915: split out intel_pm_types.h Jani Nikula
2021-12-01 15:14 ` Ville Syrjälä
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 08/10] drm/i915: move enum hpd_pin to intel_display.h Jani Nikula
2021-12-01 15:14 ` Ville Syrjälä
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 09/10] drm/i915/display: convert dp_to_i915() to a macro Jani Nikula
2021-12-01 15:16 ` Ville Syrjälä
2021-12-01 13:57 ` [Intel-gfx] [PATCH v2 10/10] drm/i915/display: stop including i915_drv.h from intel_display_types.h Jani Nikula
2021-12-01 15:21 ` Ville Syrjälä
2021-12-01 14:30 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: break intel_display_types.h dependency on i915_drv.h (rev2) Patchwork
2021-12-01 14:31 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-12-01 15:01 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-12-01 19:28 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-12-03 10:07 ` [Intel-gfx] [PATCH v2 00/10] drm/i915: break intel_display_types.h dependency on i915_drv.h Jani Nikula
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=YaeQ7oEeFE92pWF6@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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