From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 1/6] drm/i915: Generalize planes_{enabling, disabling}()
Date: Mon, 20 Mar 2023 22:33:47 +0200 [thread overview]
Message-ID: <20230320203352.19515-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20230320203352.19515-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
I want to use the same logic that planes_{enabling,disabling}()
are using for other features as well. Generlize the thing
into a pair of macros.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 121990ba2a28..3356b0724e1e 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -1069,20 +1069,28 @@ static bool needs_async_flip_vtd_wa(const struct intel_crtc_state *crtc_state)
(DISPLAY_VER(i915) == 9 || IS_BROADWELL(i915) || IS_HASWELL(i915));
}
+#define is_enabling(feature, old_crtc_state, new_crtc_state) \
+ ((!(old_crtc_state)->feature || intel_crtc_needs_modeset(new_crtc_state)) && \
+ (new_crtc_state)->feature)
+#define is_disabling(feature, old_crtc_state, new_crtc_state) \
+ ((old_crtc_state)->feature && \
+ (!(new_crtc_state)->feature || intel_crtc_needs_modeset(new_crtc_state)))
+
static bool planes_enabling(const struct intel_crtc_state *old_crtc_state,
const struct intel_crtc_state *new_crtc_state)
{
- return (!old_crtc_state->active_planes || intel_crtc_needs_modeset(new_crtc_state)) &&
- new_crtc_state->active_planes;
+ return is_enabling(active_planes, old_crtc_state, new_crtc_state);
}
static bool planes_disabling(const struct intel_crtc_state *old_crtc_state,
const struct intel_crtc_state *new_crtc_state)
{
- return old_crtc_state->active_planes &&
- (!new_crtc_state->active_planes || intel_crtc_needs_modeset(new_crtc_state));
+ return is_disabling(active_planes, old_crtc_state, new_crtc_state);
}
+#undef is_disabling
+#undef is_enabling
+
static void intel_post_plane_update(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{
--
2.39.2
next prev parent reply other threads:[~2023-03-20 20:34 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 20:33 [Intel-gfx] [PATCH 0/6] drm/i915/vrr: Allow fastset to enable/disable VRR Ville Syrjala
2023-03-20 20:33 ` Ville Syrjala [this message]
2023-04-05 7:31 ` [Intel-gfx] [PATCH 1/6] drm/i915: Generalize planes_{enabling, disabling}() Golani, Mitulkumar Ajitkumar
2023-03-20 20:33 ` [Intel-gfx] [PATCH 2/6] drm/i915/vrr: Eliminate redundant function arguments Ville Syrjala
2023-04-05 6:58 ` Golani, Mitulkumar Ajitkumar
2023-03-20 20:33 ` [Intel-gfx] [PATCH 3/6] drm/i915/vrr: Make delayed vblank operational in VRR mode on adl/dg2 Ville Syrjala
2023-04-05 7:05 ` Golani, Mitulkumar Ajitkumar
2023-03-20 20:33 ` [Intel-gfx] [PATCH 4/6] drm/i915/vrr: Tell intel_crtc_update_active_timings() about VRR explicitly Ville Syrjala
2023-04-05 7:10 ` Golani, Mitulkumar Ajitkumar
2023-03-20 20:33 ` [Intel-gfx] [PATCH 5/6] drm/i915/vrr: Relocate VRR enable/disable Ville Syrjala
2023-03-21 13:56 ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2023-03-27 20:05 ` Golani, Mitulkumar Ajitkumar
2023-04-11 5:41 ` Ville Syrjälä
2023-04-12 7:45 ` Ville Syrjälä
2023-04-12 14:14 ` Golani, Mitulkumar Ajitkumar
2023-04-12 14:16 ` Golani, Mitulkumar Ajitkumar
2023-04-12 15:05 ` Ville Syrjälä
2023-04-12 14:11 ` Golani, Mitulkumar Ajitkumar
2023-04-12 14:20 ` Ville Syrjälä
2023-03-20 20:33 ` [Intel-gfx] [PATCH 6/6] drm/i915/vrr: Allow VRR to be toggled during fastsets Ville Syrjala
2023-04-05 7:27 ` Golani, Mitulkumar Ajitkumar
2023-03-21 12:50 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/vrr: Allow fastset to enable/disable VRR Patchwork
2023-03-21 12:50 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-21 12:50 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-03-21 13:09 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-03-21 15:34 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning for drm/i915/vrr: Allow fastset to enable/disable VRR (rev2) Patchwork
2023-03-21 15:34 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: " Patchwork
2023-03-21 15:34 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-21 15:34 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-03-21 15:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-21 21:07 ` [Intel-gfx] ✓ 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=20230320203352.19515-2-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.