From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 01/10] drm/i915: Grab intel_display from the encoder to avoid potential oopsies
Date: Fri, 08 Nov 2024 15:00:21 +0200 [thread overview]
Message-ID: <87v7wxev8a.fsf@intel.com> (raw)
In-Reply-To: <20241107161123.16269-2-ville.syrjala@linux.intel.com>
On Thu, 07 Nov 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Grab the intel_display from 'encoder' rather than 'state'
> in the encoder hooks to avoid the massive footgun that is
> intel_sanitize_encoder(), which passes NULL as the 'state'
> argument to encoder .disable() and .post_disable().
>
> TODO: figure out how to actually fix intel_sanitize_encoder()...
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Whoopsies.
Do we need a Fixes: tag? I presume the changes are headed to v6.13 and
without the tag this one isn't.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_crt.c | 10 +++++-----
> drivers/gpu/drm/i915/display/intel_tv.c | 4 ++--
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c
> index 74c1983fe07e..1be55bdb48b9 100644
> --- a/drivers/gpu/drm/i915/display/intel_crt.c
> +++ b/drivers/gpu/drm/i915/display/intel_crt.c
> @@ -244,7 +244,7 @@ static void hsw_disable_crt(struct intel_atomic_state *state,
> const struct intel_crtc_state *old_crtc_state,
> const struct drm_connector_state *old_conn_state)
> {
> - struct intel_display *display = to_intel_display(state);
> + struct intel_display *display = to_intel_display(encoder);
> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>
> drm_WARN_ON(display->drm, !old_crtc_state->has_pch_encoder);
> @@ -257,7 +257,7 @@ static void hsw_post_disable_crt(struct intel_atomic_state *state,
> const struct intel_crtc_state *old_crtc_state,
> const struct drm_connector_state *old_conn_state)
> {
> - struct intel_display *display = to_intel_display(state);
> + struct intel_display *display = to_intel_display(encoder);
> struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>
> @@ -287,7 +287,7 @@ static void hsw_pre_pll_enable_crt(struct intel_atomic_state *state,
> const struct intel_crtc_state *crtc_state,
> const struct drm_connector_state *conn_state)
> {
> - struct intel_display *display = to_intel_display(state);
> + struct intel_display *display = to_intel_display(encoder);
> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>
> drm_WARN_ON(display->drm, !crtc_state->has_pch_encoder);
> @@ -300,7 +300,7 @@ static void hsw_pre_enable_crt(struct intel_atomic_state *state,
> const struct intel_crtc_state *crtc_state,
> const struct drm_connector_state *conn_state)
> {
> - struct intel_display *display = to_intel_display(state);
> + struct intel_display *display = to_intel_display(encoder);
> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> enum pipe pipe = crtc->pipe;
> @@ -319,7 +319,7 @@ static void hsw_enable_crt(struct intel_atomic_state *state,
> const struct intel_crtc_state *crtc_state,
> const struct drm_connector_state *conn_state)
> {
> - struct intel_display *display = to_intel_display(state);
> + struct intel_display *display = to_intel_display(encoder);
> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> enum pipe pipe = crtc->pipe;
> diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c
> index bfd16054ca05..27c530218ee6 100644
> --- a/drivers/gpu/drm/i915/display/intel_tv.c
> +++ b/drivers/gpu/drm/i915/display/intel_tv.c
> @@ -929,7 +929,7 @@ intel_enable_tv(struct intel_atomic_state *state,
> const struct intel_crtc_state *pipe_config,
> const struct drm_connector_state *conn_state)
> {
> - struct intel_display *display = to_intel_display(state);
> + struct intel_display *display = to_intel_display(encoder);
>
> /* Prevents vblank waits from timing out in intel_tv_detect_type() */
> intel_crtc_wait_for_next_vblank(to_intel_crtc(pipe_config->uapi.crtc));
> @@ -943,7 +943,7 @@ intel_disable_tv(struct intel_atomic_state *state,
> const struct intel_crtc_state *old_crtc_state,
> const struct drm_connector_state *old_conn_state)
> {
> - struct intel_display *display = to_intel_display(state);
> + struct intel_display *display = to_intel_display(encoder);
>
> intel_de_rmw(display, TV_CTL, TV_ENC_ENABLE, 0);
> }
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-11-08 13:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 16:11 [PATCH 00/10] drm/i915: Potential boot oops fix and some cleanups Ville Syrjala
2024-11-07 16:11 ` [PATCH 01/10] drm/i915: Grab intel_display from the encoder to avoid potential oopsies Ville Syrjala
2024-11-08 13:00 ` Jani Nikula [this message]
2024-11-11 22:03 ` Ville Syrjälä
2024-11-07 16:11 ` [PATCH 02/10] drm/i915/crt: Split long line Ville Syrjala
2024-11-08 13:01 ` Jani Nikula
2024-11-07 16:11 ` [PATCH 03/10] drm/i915/crt: Drop the unused ADPA_DPMS bit definitions Ville Syrjala
2024-11-08 13:02 ` Jani Nikula
2024-11-07 16:11 ` [PATCH 04/10] drm/i915/crt: Use REG_BIT() & co Ville Syrjala
2024-11-08 13:08 ` Jani Nikula
2024-11-07 16:11 ` [PATCH 05/10] drm/i915/crt: Clean up ADPA_HOTPLUG_BITS definitions Ville Syrjala
2024-11-08 13:12 ` Jani Nikula
2024-11-07 16:11 ` [PATCH 06/10] drm/i915/crt: Extract intel_crt_regs.h Ville Syrjala
2024-11-08 13:13 ` Jani Nikula
2024-11-07 16:11 ` [PATCH 07/10] drm/i915/crt: s/pipe_config/crtc_state/ Ville Syrjala
2024-11-08 13:14 ` Jani Nikula
2024-11-07 16:11 ` [PATCH 08/10] drm/i915/crt: Drop pointless drm_device variables Ville Syrjala
2024-11-08 13:15 ` Jani Nikula
2024-11-07 16:11 ` [PATCH 09/10] drm/i915/crt: Rename some variables Ville Syrjala
2024-11-08 13:16 ` Jani Nikula
2024-11-07 16:11 ` [PATCH 10/10] drm/i915/crt: Nuke unused crt->connector Ville Syrjala
2024-11-08 13:16 ` Jani Nikula
2024-11-08 4:56 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Potential boot oops fix and some cleanups (rev2) Patchwork
2024-11-08 4:56 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-08 5:10 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-11-08 17:08 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Potential boot oops fix and some cleanups (rev3) Patchwork
2024-11-08 17:08 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-08 17:24 ` ✓ Fi.CI.BAT: success " Patchwork
2024-11-08 18:22 ` ✓ Fi.CI.IGT: " 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=87v7wxev8a.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