All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Make IS_GENx macros work on a mask
Date: Fri, 6 May 2016 15:43:39 +0100	[thread overview]
Message-ID: <20160506144339.GG30822@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <572CABEA.2000300@linux.intel.com>

On Fri, May 06, 2016 at 03:36:26PM +0100, Tvrtko Ursulin wrote:
> 
> On 06/05/16 15:28, Chris Wilson wrote:
> >On Fri, May 06, 2016 at 02:43:49PM +0100, Tvrtko Ursulin wrote:
> >>From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >>
> >>If instead of numerical comparison me make these test a
> >>bitmask, we enable the compiler to optimize all instances
> >>of IS_GENx || IS_GENy.
> >>
> >>Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >>---
> >>  drivers/gpu/drm/i915/i915_dma.c |  3 +++
> >>  drivers/gpu/drm/i915/i915_drv.h | 17 +++++++++--------
> >>  2 files changed, 12 insertions(+), 8 deletions(-)
> >>
> >>diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> >>index ad7abe517700..01163da51b1d 100644
> >>--- a/drivers/gpu/drm/i915/i915_dma.c
> >>+++ b/drivers/gpu/drm/i915/i915_dma.c
> >>@@ -1071,6 +1071,9 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
> >>  	memcpy(device_info, info, sizeof(dev_priv->info));
> >>  	device_info->device_id = dev->pdev->device;
> >>
> >>+	BUG_ON(device_info->gen > sizeof(device_info->gen_mask) * 8);
> >
> >Should be gen >= num_bits
> >BITS_PER_BYTE
> 
> Hm yes, or..
> 
> >>+	device_info->gen_mask = 1 << device_info->gen;
> >
> >device_info->gen_mask = BIT(device_info->gen) for consistency;
> 
> .. maybe better BIT(device_info->gen - 1) ? There is no Gen0 presumably?

i740 would be gen0
i810 is gen1 (which is an on-chipset version of i740 really)

One day we may achieve a goal a completely unified driver if Daniel
hasn't lost his i810 yet.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2016-05-06 14:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 13:43 [PATCH 1/3] drm/i915: Make IS_GENx macros work on a mask Tvrtko Ursulin
2016-05-06 13:43 ` [PATCH 2/3] drm/i915: Promote IS_BROADWELL to a simple macro Tvrtko Ursulin
2016-05-06 14:00   ` Ville Syrjälä
2016-05-06 14:18     ` Tvrtko Ursulin
2016-05-06 14:29       ` Ville Syrjälä
2016-05-06 14:44         ` Tvrtko Ursulin
2016-05-06 14:51           ` Chris Wilson
2016-05-06 14:58           ` Ville Syrjälä
2016-05-06 13:43 ` [PATCH 3/3] drm/i915: Replace "INTEL_INFO->gen == x" checks with IS_GENx Tvrtko Ursulin
2016-05-06 13:59   ` Chris Wilson
2016-05-06 14:16     ` Tvrtko Ursulin
2016-05-06 14:20       ` Tvrtko Ursulin
2016-05-09 14:18   ` Dave Gordon
2016-05-10  7:47   ` Jani Nikula
2016-05-06 14:16 ` [PATCH 1/2] drm/i915: Introduce INTEL_GEN_RANGE macro Tvrtko Ursulin
2016-05-06 14:16   ` [PATCH 2/2] drm/i915: Do not use a bitfield for INTEL_INFO->num_pipes Tvrtko Ursulin
2016-05-06 19:21     ` Dave Gordon
2016-05-06 14:33   ` [PATCH 1/2] drm/i915: Introduce INTEL_GEN_RANGE macro Chris Wilson
2016-05-06 19:11     ` Dave Gordon
2016-05-09 12:32       ` Jani Nikula
2016-05-09 14:26         ` Dave Gordon
2016-05-09 14:40           ` Jani Nikula
2016-05-09 15:23             ` Chris Wilson
2016-05-10  7:54               ` Jani Nikula
2016-05-06 14:28 ` [PATCH 1/3] drm/i915: Make IS_GENx macros work on a mask Chris Wilson
2016-05-06 14:36   ` Tvrtko Ursulin
2016-05-06 14:43     ` Chris Wilson [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=20160506144339.GG30822@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@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 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.