From: Tom Rix <trix@redhat.com>
To: jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com,
airlied@gmail.com, daniel@ffwll.ch, nathan@kernel.org,
ndesaulniers@google.com, ville.syrjala@linux.intel.com,
imre.deak@intel.com, arun.r.murthy@intel.com,
lucas.demarchi@intel.com
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
Tom Rix <trix@redhat.com>
Subject: [PATCH] drm/i915: simplify switch to if-elseif
Date: Tue, 23 May 2023 08:51:16 -0400 [thread overview]
Message-ID: <20230523125116.1669057-1-trix@redhat.com> (raw)
clang with W=1 reports
drivers/gpu/drm/i915/display/intel_display.c:6012:3: error: unannotated
fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
case I915_FORMAT_MOD_X_TILED:
^
Only one case and the default does anything in this switch, so it should
be changed to an if-elseif.
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 0490c6412ab5..1f852e49fc20 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -5994,8 +5994,7 @@ static int intel_async_flip_check_hw(struct intel_atomic_state *state, struct in
* Need to verify this for all gen9 platforms to enable
* this selectively if required.
*/
- switch (new_plane_state->hw.fb->modifier) {
- case DRM_FORMAT_MOD_LINEAR:
+ if (new_plane_state->hw.fb->modifier == DRM_FORMAT_MOD_LINEAR) {
/*
* FIXME: Async on Linear buffer is supported on ICL as
* but with additional alignment and fbc restrictions
@@ -6008,13 +6007,10 @@ static int intel_async_flip_check_hw(struct intel_atomic_state *state, struct in
plane->base.base.id, plane->base.name);
return -EINVAL;
}
-
- case I915_FORMAT_MOD_X_TILED:
- case I915_FORMAT_MOD_Y_TILED:
- case I915_FORMAT_MOD_Yf_TILED:
- case I915_FORMAT_MOD_4_TILED:
- break;
- default:
+ } else if (!(new_plane_state->hw.fb->modifier == I915_FORMAT_MOD_X_TILED ||
+ new_plane_state->hw.fb->modifier == I915_FORMAT_MOD_Y_TILED ||
+ new_plane_state->hw.fb->modifier == I915_FORMAT_MOD_Yf_TILED ||
+ new_plane_state->hw.fb->modifier == I915_FORMAT_MOD_4_TILED)) {
drm_dbg_kms(&i915->drm,
"[PLANE:%d:%s] Modifier does not support async flips\n",
plane->base.base.id, plane->base.name);
--
2.27.0
next reply other threads:[~2023-05-23 12:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-23 12:51 Tom Rix [this message]
2023-05-23 13:26 ` [PATCH] drm/i915: simplify switch to if-elseif Jani Nikula
2023-05-26 9:27 ` [Intel-gfx] " 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=20230523125116.1669057-1-trix@redhat.com \
--to=trix@redhat.com \
--cc=airlied@gmail.com \
--cc=arun.r.murthy@intel.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=lucas.demarchi@intel.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=rodrigo.vivi@intel.com \
--cc=tvrtko.ursulin@linux.intel.com \
--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