From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Tvrtko Ursulin <tursulin@ursulin.net>, Intel-gfx@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Subject: Re: [PATCH v2] drm/i915: Allow optimized platform checks
Date: Fri, 29 Sep 2017 11:59:53 +0300 [thread overview]
Message-ID: <1506675593.4729.27.camel@linux.intel.com> (raw)
In-Reply-To: <20170927164138.15474-1-tvrtko.ursulin@linux.intel.com>
On Wed, 2017-09-27 at 17:41 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> If we store the platform as a bitmask, and convert the
> IS_PLATFORM macro to use it, we allow the compiler to
> merge the IS_PLATFORM(a) || IS_PLATFORM(b) || ... checks
> into a single conditional.
>
> As a secondary benefit this saves almost 1k of text:
>
> text data bss dec hex filename
> -1460254 60014 3656 1523924 1740d4 drivers/gpu/drm/i915/i915.ko
> +1459260 60026 3656 1522942 173cfe drivers/gpu/drm/i915/i915.ko
>
> v2: Removed the infamous -1.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
<SNIP>
> @@ -2986,7 +2987,7 @@ intel_info(const struct drm_i915_private *dev_priv)
> #define IS_REVID(p, since, until) \
> (INTEL_REVID(p) >= (since) && INTEL_REVID(p) <= (until))
>
> -#define IS_PLATFORM(dev_priv, p) ((dev_priv)->info.platform == (p))
> +#define IS_PLATFORM(dev_priv, p) ((dev_priv)->info.platform_mask & BIT(p))
|| BUILD_BUG_ON_ZERO(__builtin_constant_p(p))
To enforce it?
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2017-09-29 8:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 16:41 [PATCH v2] drm/i915: Allow optimized platform checks Tvrtko Ursulin
2017-09-27 17:03 ` Chris Wilson
2017-09-27 17:07 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-28 11:49 ` Tvrtko Ursulin
2017-09-27 21:25 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-28 7:34 ` [PATCH v2] " Jani Nikula
2017-09-29 8:59 ` Joonas Lahtinen [this message]
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=1506675593.4729.27.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=tursulin@ursulin.net \
/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;
as well as URLs for NNTP newsgroup(s).