From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [RFC 27/28] drm/i915: Use IS_GEN in intel_lrc.c
Date: Wed, 14 Apr 2021 12:50:27 +0100 [thread overview]
Message-ID: <20210414115028.168504-28-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20210414115028.168504-1-tvrtko.ursulin@linux.intel.com>
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/intel_lrc.c | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 55df19ec879e..63872514213c 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1413,20 +1413,16 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine)
if (GEM_WARN_ON(engine->id != RCS))
return -EINVAL;
- switch (INTEL_GEN(engine->i915)) {
- case 10:
+ if (IS_GEN10(engine->i915)) {
wa_bb_fn[0] = gen10_init_indirectctx_bb;
wa_bb_fn[1] = NULL;
- break;
- case 9:
+ } else if (IS_GEN9(engine->i915)) {
wa_bb_fn[0] = gen9_init_indirectctx_bb;
wa_bb_fn[1] = NULL;
- break;
- case 8:
+ } else if (IS_GEN8(engine->i915)) {
wa_bb_fn[0] = gen8_init_indirectctx_bb;
wa_bb_fn[1] = NULL;
- break;
- default:
+ } else {
MISSING_CASE(INTEL_GEN(engine->i915));
return 0;
}
@@ -2149,22 +2145,19 @@ static u32 intel_lr_indirect_ctx_offset(struct intel_engine_cs *engine)
{
u32 indirect_ctx_offset;
- switch (INTEL_GEN(engine->i915)) {
- default:
- MISSING_CASE(INTEL_GEN(engine->i915));
- /* fall through */
- case 10:
+ if (IS_GEN10(engine->i915)) {
indirect_ctx_offset =
GEN10_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT;
- break;
- case 9:
+ } else if (IS_GEN9(engine->i915)) {
indirect_ctx_offset =
GEN9_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT;
- break;
- case 8:
+ } else if (IS_GEN8(engine->i915)) {
indirect_ctx_offset =
GEN8_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT;
- break;
+ } else {
+ MISSING_CASE(INTEL_GEN(engine->i915));
+ indirect_ctx_offset =
+ GEN10_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT;
}
return indirect_ctx_offset;
--
2.27.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2021-04-14 11:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 11:50 [Intel-gfx] [RFC 00/28] Old platform/gen kconfig options series Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 01/28] drm/i915: Make I830 platform support optional Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 02/28] drm/i915: Make I845G " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 03/28] drm/i915: Make I85X " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 04/28] drm/i915: Make I865G " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 05/28] drm/i915: Make GEN2 " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 06/28] drm/i915: Make Gen3 platforms " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 07/28] drm/i915: Make Gen4 " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 08/28] drm/i915: Make Ironlake/Gen5 " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 09/28] drm/i915: Make Sandybridge/Gen6 " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 10/28] drm/i915: Make Gen7/7.5 platform " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 11/28] drm/i915: Make Gen8 " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 12/28] drm/i915: Make Gen9 " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 13/28] drm/i915: Make Gen10 " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 14/28] drm/i915: Make Gen11 " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 15/28] drm/i915: Simplify IS_GEN macros Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 16/28] drm/i915: Use INTEL_GEN everywhere Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 17/28] drm/i915: Favour IS_GENx Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 18/28] drm/i915: Use Gen Kconfig items in IS_GEN macro Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 19/28] drm/i915: Replace arithmetic INTEL_GEN checks with the " Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 20/28] drm/i915: Use IS_GEN in execbuffer Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 21/28] drm/i915: Allow render state to be compiled out Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 22/28] drm/i915: Use IS_GEN in stolen Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 23/28] drm/i915: Use IS_GEN in intel_bios.c Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 24/28] drm/i915: Use IS_GEN in intel_fb_pitch_limit Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 25/28] drm/i915: Use IS_GEN in intel_engine_cs.c Tvrtko Ursulin
2021-04-14 11:50 ` [Intel-gfx] [RFC 26/28] drm/i915: Use IS_GEN in intel_guc.c Tvrtko Ursulin
2021-04-14 11:50 ` Tvrtko Ursulin [this message]
2021-04-14 11:50 ` [Intel-gfx] [RFC 28/28] drm/i915: Enable dropping small cores when not enabled Tvrtko Ursulin
2021-04-14 12:25 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Old platform/gen kconfig options series 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=20210414115028.168504-28-tvrtko.ursulin@linux.intel.com \
--to=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox