From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 03/28] drm/i915: Keep ggtt->probe() as a local
Date: Wed, 03 Aug 2016 17:00:01 +0300 [thread overview]
Message-ID: <1470232801.3860.29.camel@linux.intel.com> (raw)
In-Reply-To: <1470231801-1577-4-git-send-email-chris@chris-wilson.co.uk>
On ke, 2016-08-03 at 14:42 +0100, Chris Wilson wrote:
> The ggtt->probe() vfunc is only called once during GGTT initialisation.
> We can keep it in a local for the function, sparing a few bytes in our
> i915_ggtt persistent struct.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 15 ++++++++-------
> drivers/gpu/drm/i915/i915_gem_gtt.h | 2 --
> 2 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 3fc77776d89b..70178a77d0c8 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3215,13 +3215,17 @@ int i915_ggtt_probe_hw(struct drm_device *dev)
> {
> struct drm_i915_private *dev_priv = to_i915(dev);
> struct i915_ggtt *ggtt = &dev_priv->ggtt;
> + int (*probe)(struct i915_ggtt *ggtt);
> int ret;
>
> + ggtt->base.dev = dev;
> + ggtt->base.is_ggtt = true;
> +
> if (INTEL_INFO(dev)->gen <= 5) {
> - ggtt->probe = i915_gmch_probe;
> + probe = i915_gmch_probe;
> ggtt->base.cleanup = i915_gmch_remove;
> } else if (INTEL_INFO(dev)->gen < 8) {
> - ggtt->probe = gen6_gmch_probe;
> + probe = gen6_gmch_probe;
> ggtt->base.cleanup = gen6_gmch_remove;
>
> if (HAS_EDRAM(dev))
> @@ -3235,14 +3239,11 @@ int i915_ggtt_probe_hw(struct drm_device *dev)
> else
> ggtt->base.pte_encode = snb_pte_encode;
> } else {
> - ggtt->probe = gen8_gmch_probe;
> + probe = gen8_gmch_probe;
> ggtt->base.cleanup = gen6_gmch_remove;
> }
>
I'm pretty sure I already saw a version of this with no function
pointer at all? I preferred that version.
Regards, Joonas
> - ggtt->base.dev = dev;
> - ggtt->base.is_ggtt = true;
> -
> - ret = ggtt->probe(ggtt);
> + ret = probe(ggtt);
> if (ret)
> return ret;
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
> index 5b6744a5c944..defb274f3ba5 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.h
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
> @@ -365,8 +365,6 @@ struct i915_ggtt {
> bool do_idle_maps;
>
> int mtrr;
> -
> - int (*probe)(struct i915_ggtt *ggtt);
> };
>
> struct i915_hw_ppgtt {
--
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
next prev parent reply other threads:[~2016-08-03 14:00 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 13:42 Next batch of almost reviewed patches, up to the VMA leak fix Chris Wilson
2016-08-03 13:42 ` [PATCH 01/28] drm/i915: Amalgamate GGTT/ppGTT vma debug list walkers Chris Wilson
2016-08-03 13:42 ` [PATCH 02/28] drm/i915: Split GGTT initialisation between probing and setup Chris Wilson
2016-08-03 13:54 ` Joonas Lahtinen
2016-08-03 13:42 ` [PATCH 03/28] drm/i915: Keep ggtt->probe() as a local Chris Wilson
2016-08-03 14:00 ` Joonas Lahtinen [this message]
2016-08-03 14:07 ` Chris Wilson
2016-08-03 17:14 ` [PATCH 1/3] drm/i915: Update GGTT initialisation functions to take drm_i915_private Chris Wilson
2016-08-03 17:14 ` [PATCH 2/3] drm/i915: Split early global GTT initialisation Chris Wilson
2016-08-03 17:14 ` [PATCH 3/3] drm/i915: Rearrange GGTT probing to avoid needing a vfunc Chris Wilson
2016-08-04 6:34 ` Joonas Lahtinen
2016-08-04 6:18 ` [PATCH 1/3] drm/i915: Update GGTT initialisation functions to take drm_i915_private Joonas Lahtinen
2016-08-03 13:42 ` [PATCH 04/28] " Chris Wilson
2016-08-03 14:05 ` Joonas Lahtinen
2016-08-03 13:42 ` [PATCH 05/28] drm/i915: Split early global GTT initialisation Chris Wilson
2016-08-03 14:17 ` Joonas Lahtinen
2016-08-03 13:42 ` [PATCH 06/28] drm/i915: Store owning file on the i915_address_space Chris Wilson
2016-08-03 13:43 ` [PATCH 07/28] drm/i915: Count how many VMA are bound for an object Chris Wilson
2016-08-03 13:43 ` [PATCH 08/28] drm/i915: Be more careful when unbinding vma Chris Wilson
2016-08-03 13:43 ` [PATCH 09/28] drm/i915: Kill drop_pages() Chris Wilson
2016-08-03 13:43 ` [PATCH 10/28] drm/i915: Introduce i915_gem_active for request tracking Chris Wilson
2016-08-03 13:43 ` [PATCH 11/28] drm/i915: Prepare i915_gem_active for annotations Chris Wilson
2016-08-03 13:43 ` [PATCH 12/28] drm/i915: Mark up i915_gem_active for locking annotation Chris Wilson
2016-08-03 13:43 ` [PATCH 13/28] drm/i915: Refactor blocking waits Chris Wilson
2016-08-03 13:43 ` [PATCH 14/28] drm/i915: Rename request->list to link for consistency Chris Wilson
2016-08-03 13:43 ` [PATCH 15/28] drm/i915: Remove obsolete i915_gem_object_flush_active() Chris Wilson
2016-08-03 13:43 ` [PATCH 16/28] drm/i915: Refactor activity tracking for requests Chris Wilson
2016-08-03 13:43 ` [PATCH 17/28] drm/i915: Track requests inside each intel_ring Chris Wilson
2016-08-03 13:43 ` [PATCH 18/28] drm/i915: Convert intel_overlay to request tracking Chris Wilson
2016-08-03 13:43 ` [PATCH 19/28] drm/i915: Move the special case wait-request handling to its one caller Chris Wilson
2016-08-03 13:43 ` [PATCH 20/28] drm/i915: Disable waitboosting for a saturated engine Chris Wilson
2016-08-03 13:43 ` [PATCH 21/28] drm/i915: s/__i915_wait_request/i915_wait_request/ Chris Wilson
2016-08-03 13:43 ` [PATCH 22/28] drm/i915: Double check activity before relocations Chris Wilson
2016-08-03 13:43 ` [PATCH 23/28] drm/i915: Move request list retirement to i915_gem_request.c Chris Wilson
2016-08-03 13:43 ` [PATCH 24/28] drm/i915: i915_vma_move_to_active prep patch Chris Wilson
2016-08-03 13:43 ` [PATCH 25/28] drm/i915: Track active vma requests Chris Wilson
2016-08-03 13:43 ` [PATCH 26/28] drm/i915: Release vma when the handle is closed Chris Wilson
2016-08-03 13:43 ` [PATCH 27/28] drm/i915: Mark the context and address space as closed Chris Wilson
2016-08-03 13:43 ` [PATCH 28/28] Revert "drm/i915: Clean up associated VMAs on context destruction" Chris Wilson
2016-08-03 14:15 ` ✗ Ro.CI.BAT: failure for series starting with [01/28] drm/i915: Amalgamate GGTT/ppGTT vma debug list walkers Patchwork
2016-08-04 5:19 ` ✗ Ro.CI.BAT: failure for series starting with [01/28] drm/i915: Amalgamate GGTT/ppGTT vma debug list walkers (rev4) 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=1470232801.3860.29.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--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 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.