From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Chris Wilson <chris@chris-wilson.co.uk>,
Tvrtko Ursulin <tursulin@ursulin.net>
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 13/14] drm/i915: Use binary search when looking for shadowed registers
Date: Mon, 3 Oct 2016 09:33:18 +0100 [thread overview]
Message-ID: <5ddfc7d1-241f-a94a-cde5-69b00236aecd@linux.intel.com> (raw)
In-Reply-To: <1475481935.3067.21.camel@linux.intel.com>
On 03/10/2016 09:05, Joonas Lahtinen wrote:
> On pe, 2016-09-30 at 19:08 +0100, Chris Wilson wrote:
>> On Fri, Sep 30, 2016 at 06:48:48PM +0100, Tvrtko Ursulin wrote:
>>> +static int mmio_reg_cmp(const void *key, const void *elt)
>>> +{
>>> + u32 offset = (u32)(unsigned long)key;
>>> + i915_reg_t *reg = (i915_reg_t *)elt;
>>> +
>>> + if (offset < i915_mmio_reg_offset(*reg))
>>> + return -1;
>>> + else if (offset > i915_mmio_reg_offset(*reg))
>>> + return 1;
>>> + else
>>> + return 0;
>> There's no issue with using
>>
>> return offset - i915_mmio_reg_offset(*reg)
>>
>> here.
>>
> Why not?
>
>>> + reg = bsearch((void *)(unsigned long)offset,
>>> + (const void *)gen8_shadowed_regs,
>>> + ARRAY_SIZE(gen8_shadowed_regs),
>>> + sizeof(i915_reg_t),
>>> + mmio_reg_cmp);
>>> +
>>> + return reg;
>> Or just return bseearch() ? (Probably like this for easing future
>> patches.)
> Suggested that too, but obviously he has something in mind.
It becomes a direct return in a following patch. It is just a virtue of
me wanting to split out the series a lot for easier review, and then not
picking up all relevant places to tidy when acting on review feedback.
But this one as I said happens in a following patch.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-10-03 8:33 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 17:48 [PATCH v2 00/14] Forcewake binary search & code shrink Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 01/14] drm/i915: Remove redundant hsw_write* mmio functions Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 02/14] drm/i915: Keep track of active forcewake domains in a bitmask Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 03/14] drm/i915: Do not inline forcewake taking in mmio accessors Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 04/14] drm/i915: Data driven register to forcewake domains lookup Tvrtko Ursulin
2016-10-03 7:58 ` Joonas Lahtinen
2016-10-26 9:24 ` Mika Kuoppala
2016-09-30 17:48 ` [PATCH 05/14] drm/i915: Sort forcewake mapping tables Tvrtko Ursulin
2016-09-30 18:05 ` Chris Wilson
2016-10-03 8:37 ` Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 06/14] drm/i915: Use binary search when looking up forcewake domains Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 07/14] drm/i915: Eliminate Gen9 special case Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 08/14] drm/i915: Store the active forcewake range table pointer Tvrtko Ursulin
2016-10-03 8:39 ` Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 09/14] drm/i915: Remove identical macros Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 10/14] drm/i915: Remove identical mmio read functions Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 11/14] drm/i915: Remove identical write mmmio functions Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 12/14] drm/i915: Sort the shadow register table Tvrtko Ursulin
2016-10-03 8:40 ` Tvrtko Ursulin
2016-09-30 17:48 ` [PATCH 13/14] drm/i915: Use binary search when looking for shadowed registers Tvrtko Ursulin
2016-09-30 18:08 ` Chris Wilson
2016-10-03 8:05 ` Joonas Lahtinen
2016-10-03 8:33 ` Tvrtko Ursulin [this message]
2016-09-30 17:48 ` [PATCH 14/14] drm/i915: Inline binary search Tvrtko Ursulin
2016-09-30 18:09 ` [PATCH v2 00/14] Forcewake binary search & code shrink Chris Wilson
2016-09-30 18:49 ` ✗ Fi.CI.BAT: warning for Forcewake binary search & code shrink (rev3) Patchwork
2016-10-03 9:27 ` ✗ Fi.CI.BAT: warning for Forcewake binary search & code shrink (rev6) Patchwork
2016-10-04 8:46 ` Tvrtko Ursulin
2016-10-04 8:55 ` Chris Wilson
2016-10-04 9:18 ` Tvrtko Ursulin
2016-10-04 9:37 ` Joonas Lahtinen
2016-10-04 10:17 ` Tvrtko Ursulin
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=5ddfc7d1-241f-a94a-cde5-69b00236aecd@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chris@chris-wilson.co.uk \
--cc=joonas.lahtinen@linux.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 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.