From: Ben Widawsky <benjamin.widawsky@intel.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: mesa-dev <mesa-dev@lists.freedesktop.org>,
Intel GFX <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] i965: First step toward prelocation
Date: Fri, 22 Aug 2014 10:14:54 -0700 [thread overview]
Message-ID: <20140822171454.GA10603@intel.com> (raw)
In-Reply-To: <CADnq5_OzCO0ue4JYqEEZZBqw=3ntPd0-Wabgj0B1=guhc3A=Kg@mail.gmail.com>
On Fri, Aug 22, 2014 at 08:15:28AM -0400, Alex Deucher wrote:
> On Thu, Aug 21, 2014 at 11:12 PM, Ben Widawsky
> <benjamin.widawsky@intel.com> wrote:
> > This was a quick proof of concept to show the new API for prelocating
> > buffers.
> >
>
> What are prelocated buffers?
http://lists.freedesktop.org/archives/mesa-dev/2014-August/066432.html
>
> Alex
>
> > It needs way more testing, to not ifdef the no-relocs, and to do a
> > libdrm ABI dep bump.
> > ---
> > src/mesa/drivers/dri/i965/Makefile.am | 1 +
> > src/mesa/drivers/dri/i965/brw_performance_monitor.c | 6 +++---
> > src/mesa/drivers/dri/i965/brw_program.c | 5 +++--
> > src/mesa/drivers/dri/i965/brw_queryobj.c | 6 +++---
> > src/mesa/drivers/dri/i965/brw_state_cache.c | 4 ++--
> > src/mesa/drivers/dri/i965/intel_batchbuffer.c | 3 +++
> > src/mesa/drivers/dri/i965/intel_batchbuffer.h | 8 ++++++++
> > 7 files changed, 23 insertions(+), 10 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/Makefile.am b/src/mesa/drivers/dri/i965/Makefile.am
> > index 5809dc6..4b20d36 100644
> > --- a/src/mesa/drivers/dri/i965/Makefile.am
> > +++ b/src/mesa/drivers/dri/i965/Makefile.am
> > @@ -24,6 +24,7 @@
> > include Makefile.sources
> >
> > AM_CFLAGS = \
> > + -DNO_RELOC \
> > -I$(top_srcdir)/include \
> > -I$(top_srcdir)/src/ \
> > -I$(top_srcdir)/src/mapi \
> > diff --git a/src/mesa/drivers/dri/i965/brw_performance_monitor.c b/src/mesa/drivers/dri/i965/brw_performance_monitor.c
> > index edfa3d2..e30c527 100644
> > --- a/src/mesa/drivers/dri/i965/brw_performance_monitor.c
> > +++ b/src/mesa/drivers/dri/i965/brw_performance_monitor.c
> > @@ -1105,13 +1105,13 @@ brw_begin_perf_monitor(struct gl_context *ctx,
> > * wasting memory for contexts that don't use performance monitors.
> > */
> > if (!brw->perfmon.bookend_bo) {
> > - brw->perfmon.bookend_bo = drm_intel_bo_alloc(brw->bufmgr,
> > + brw->perfmon.bookend_bo = drm_intel_bo_alloc_wrapper(brw->bufmgr,
> > "OA bookend BO",
> > BOOKEND_BO_SIZE_BYTES, 64);
> > }
> >
> > monitor->oa_bo =
> > - drm_intel_bo_alloc(brw->bufmgr, "perf. monitor OA bo", 4096, 64);
> > + drm_intel_bo_alloc_wrapper(brw->bufmgr, "perf. monitor OA bo", 4096, 64);
> > #ifdef DEBUG
> > /* Pre-filling the BO helps debug whether writes landed. */
> > drm_intel_bo_map(monitor->oa_bo, true);
> > @@ -1146,7 +1146,7 @@ brw_begin_perf_monitor(struct gl_context *ctx,
> >
> > if (monitor_needs_statistics_registers(brw, m)) {
> > monitor->pipeline_stats_bo =
> > - drm_intel_bo_alloc(brw->bufmgr, "perf. monitor stats bo", 4096, 64);
> > + drm_intel_bo_alloc_wrapper(brw->bufmgr, "perf. monitor stats bo", 4096, 64);
> >
> > /* Take starting snapshots. */
> > snapshot_statistics_registers(brw, monitor, 0);
> > diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
> > index d782b4f..74ff40c 100644
> > --- a/src/mesa/drivers/dri/i965/brw_program.c
> > +++ b/src/mesa/drivers/dri/i965/brw_program.c
> > @@ -43,6 +43,7 @@
> >
> > #include "brw_context.h"
> > #include "brw_wm.h"
> > +#include "intel_batchbuffer.h"
> >
> > static unsigned
> > get_new_program_id(struct intel_screen *screen)
> > @@ -242,7 +243,7 @@ brw_get_scratch_bo(struct brw_context *brw,
> > }
> >
> > if (!old_bo) {
> > - *scratch_bo = drm_intel_bo_alloc(brw->bufmgr, "scratch bo", size, 4096);
> > + *scratch_bo = drm_intel_bo_alloc_wrapper(brw->bufmgr, "scratch bo", size, 4096);
> > }
> > }
> >
> > @@ -265,7 +266,7 @@ void
> > brw_init_shader_time(struct brw_context *brw)
> > {
> > const int max_entries = 4096;
> > - brw->shader_time.bo = drm_intel_bo_alloc(brw->bufmgr, "shader time",
> > + brw->shader_time.bo = drm_intel_bo_alloc_wrapper(brw->bufmgr, "shader time",
> > max_entries * SHADER_TIME_STRIDE,
> > 4096);
> > brw->shader_time.shader_programs = rzalloc_array(brw, struct gl_shader_program *,
> > diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
> > index c053c34..cf5a2a5 100644
> > --- a/src/mesa/drivers/dri/i965/brw_queryobj.c
> > +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
> > @@ -230,7 +230,7 @@ brw_begin_query(struct gl_context *ctx, struct gl_query_object *q)
> > * the system was doing other work, such as running other applications.
> > */
> > drm_intel_bo_unreference(query->bo);
> > - query->bo = drm_intel_bo_alloc(brw->bufmgr, "timer query", 4096, 4096);
> > + query->bo = drm_intel_bo_alloc_wrapper(brw->bufmgr, "timer query", 4096, 4096);
> > brw_write_timestamp(brw, query->bo, 0);
> > break;
> >
> > @@ -388,7 +388,7 @@ ensure_bo_has_space(struct gl_context *ctx, struct brw_query_object *query)
> > brw_queryobj_get_results(ctx, query);
> > }
> >
> > - query->bo = drm_intel_bo_alloc(brw->bufmgr, "query", 4096, 1);
> > + query->bo = drm_intel_bo_alloc_wrapper(brw->bufmgr, "query", 4096, 1);
> > query->last_index = 0;
> > }
> > }
> > @@ -474,7 +474,7 @@ brw_query_counter(struct gl_context *ctx, struct gl_query_object *q)
> > assert(q->Target == GL_TIMESTAMP);
> >
> > drm_intel_bo_unreference(query->bo);
> > - query->bo = drm_intel_bo_alloc(brw->bufmgr, "timestamp query", 4096, 4096);
> > + query->bo = drm_intel_bo_alloc_wrapper(brw->bufmgr, "timestamp query", 4096, 4096);
> > brw_write_timestamp(brw, query->bo, 0);
> > }
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
> > index b0986ea..daf5a11 100644
> > --- a/src/mesa/drivers/dri/i965/brw_state_cache.c
> > +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
> > @@ -171,7 +171,7 @@ brw_cache_new_bo(struct brw_cache *cache, uint32_t new_size)
> > struct brw_context *brw = cache->brw;
> > drm_intel_bo *new_bo;
> >
> > - new_bo = drm_intel_bo_alloc(brw->bufmgr, "program cache", new_size, 64);
> > + new_bo = drm_intel_bo_alloc_wrapper(brw->bufmgr, "program cache", new_size, 64);
> >
> > /* Copy any existing data that needs to be saved. */
> > if (cache->next_offset != 0) {
> > @@ -335,7 +335,7 @@ brw_init_caches(struct brw_context *brw)
> > cache->items =
> > calloc(1, cache->size * sizeof(struct brw_cache_item *));
> >
> > - cache->bo = drm_intel_bo_alloc(brw->bufmgr,
> > + cache->bo = drm_intel_bo_alloc_wrapper(brw->bufmgr,
> > "program cache",
> > 4096, 64);
> >
> > diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> > index 71dc268..50834c2 100644
> > --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> > +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> > @@ -253,6 +253,9 @@ do_flush_locked(struct brw_context *brw)
> >
> > if (!brw->intelScreen->no_hw) {
> > int flags;
> > +#ifdef NO_RELOC
> > + flags |= I915_EXEC_NO_RELOC;
> > +#endif
> >
> > if (brw->gen >= 6 && batch->ring == BLT_RING) {
> > flags = I915_EXEC_BLT;
> > diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> > index 7bdd836..2670d22 100644
> > --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> > +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> > @@ -11,6 +11,14 @@
> > extern "C" {
> > #endif
> >
> > +#ifdef NO_RELOC
> > + #define drm_intel_bo_alloc_wrapper(bufmgr, name, size, align) \
> > + drm_intel_bo_alloc_prelocated(bufmgr, name, size, 1)
> > +#else
> > + #define drm_intel_bo_alloc_wrapper drm_intel_bo_alloc
> > +#endif
> > +
> > +
> > /**
> > * Number of bytes to reserve for commands necessary to complete a batch.
> > *
> > --
> > 2.0.4
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
--
Ben Widawsky, Intel Open Source Technology Center
next prev parent reply other threads:[~2014-08-22 17:14 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 3:11 [PATCH 00/68] Broadwell 48b addressing and prelocations (no relocs) Ben Widawsky
2014-08-22 3:11 ` [PATCH 01/68] drm/i915: Split up do_switch Ben Widawsky
2014-08-22 3:11 ` [PATCH 02/68] drm/i915: Extract l3 remapping out of ctx switch Ben Widawsky
2014-08-22 3:11 ` [PATCH 03/68] drm/i915/ppgtt: Load address space after mi_set_context Ben Widawsky
2014-08-22 3:11 ` [PATCH 04/68] drm/i915: Fix another another use-after-free in do_switch Ben Widawsky
2014-08-22 3:11 ` [PATCH 05/68] drm/i915/ctx: Return earlier on failure Ben Widawsky
2014-08-22 3:11 ` [PATCH 06/68] drm/i915/error: vma error capture prettyify Ben Widawsky
2014-08-22 3:11 ` [PATCH 07/68] drm/i915/error: Do a better job of disambiguating VMAs Ben Widawsky
2014-08-22 3:11 ` [PATCH 08/68] drm/i915/error: Capture vmas instead of BOs Ben Widawsky
2014-08-22 3:11 ` [PATCH 09/68] drm/i915: Add some extra guards in evict_vm Ben Widawsky
2014-08-22 3:11 ` [PATCH 10/68] drm/i915: Make an uninterruptible evict Ben Widawsky
2014-08-22 3:11 ` [PATCH 11/68] drm/i915: More correct (slower) ppgtt cleanup Ben Widawsky
2014-08-22 3:11 ` [PATCH 12/68] drm/i915: Defer PPGTT cleanup Ben Widawsky
2014-08-22 3:11 ` [PATCH 13/68] drm/i915/bdw: Enable full PPGTT Ben Widawsky
2014-08-22 3:11 ` [PATCH 14/68] drm/i915: Get the error state over the wire (HACKish) Ben Widawsky
2014-08-22 3:11 ` [PATCH 15/68] drm/i915/gen8: Invalidate TLBs before PDP reload Ben Widawsky
2014-08-22 3:11 ` [PATCH 16/68] drm/i915: Remove false assertion in ppgtt_release Ben Widawsky
2014-08-22 3:11 ` [PATCH 17/68] Revert "drm/i915/bdw: Use timeout mode for RC6 on bdw" Ben Widawsky
2014-10-31 19:45 ` Rodrigo Vivi
2014-10-31 21:10 ` Rodrigo Vivi
2014-08-22 3:11 ` [PATCH 18/68] drm/i915/trace: Fix offsets for 64b Ben Widawsky
2014-08-22 3:11 ` [PATCH 19/68] drm/i915: Wrap VMA binding Ben Widawsky
2014-08-22 3:11 ` [PATCH 20/68] drm/i915: Make pin global flags explicit Ben Widawsky
2014-08-22 3:11 ` [PATCH 21/68] drm/i915: Split out aliasing binds Ben Widawsky
2014-08-22 3:11 ` [PATCH 22/68] drm/i915: fix gtt_total_entries() Ben Widawsky
2014-08-22 3:11 ` [PATCH 23/68] drm/i915: Rename to GEN8_LEGACY_PDPES Ben Widawsky
2014-08-22 3:11 ` [PATCH 24/68] drm/i915: Split out verbose PPGTT dumping Ben Widawsky
2014-08-22 3:11 ` [PATCH 25/68] drm/i915: s/pd/pdpe, s/pt/pde Ben Widawsky
2014-08-22 3:11 ` [PATCH 26/68] drm/i915: rename map/unmap to dma_map/unmap Ben Widawsky
2014-08-22 3:11 ` [PATCH 27/68] drm/i915: Setup less PPGTT on failed pagedir Ben Widawsky
2014-08-22 3:11 ` [PATCH 28/68] drm/i915: clean up PPGTT init error path Ben Widawsky
2014-08-22 3:11 ` [PATCH 29/68] drm/i915: Un-hardcode number of page directories Ben Widawsky
2014-08-22 3:11 ` [PATCH 30/68] drm/i915: Make gen6_write_pdes gen6_map_page_tables Ben Widawsky
2014-08-22 3:11 ` [PATCH 31/68] drm/i915: Range clearing is PPGTT agnostic Ben Widawsky
2014-08-22 3:11 ` [PATCH 32/68] drm/i915: Page table helpers, and define renames Ben Widawsky
2014-08-22 3:11 ` [PATCH 33/68] drm/i915: construct page table abstractions Ben Widawsky
2014-08-22 3:11 ` [PATCH 34/68] drm/i915: Complete page table structures Ben Widawsky
2014-08-22 3:11 ` [PATCH 35/68] drm/i915: Create page table allocators Ben Widawsky
2014-08-22 3:11 ` [PATCH 36/68] drm/i915: Generalize GEN6 mapping Ben Widawsky
2014-08-22 3:12 ` [PATCH 37/68] drm/i915: Clean up pagetable DMA map & unmap Ben Widawsky
2014-08-22 3:12 ` [PATCH 38/68] drm/i915: Always dma map page table allocations Ben Widawsky
2014-08-22 3:12 ` [PATCH 39/68] drm/i915: Consolidate dma mappings Ben Widawsky
2014-08-22 3:12 ` [PATCH 40/68] drm/i915: Always dma map page directory allocations Ben Widawsky
2014-08-22 3:12 ` [PATCH 41/68] drm/i915: Track GEN6 page table usage Ben Widawsky
2014-08-22 3:12 ` [PATCH 42/68] drm/i915: Extract context switch skip logic Ben Widawsky
2014-08-22 3:12 ` [PATCH 43/68] drm/i915: Track page table reload need Ben Widawsky
2014-08-22 3:12 ` [PATCH 44/68] drm/i915: Initialize all contexts Ben Widawsky
2014-08-22 3:12 ` [PATCH 45/68] drm/i915: Finish gen6/7 dynamic page table allocation Ben Widawsky
2014-08-22 3:12 ` [PATCH 46/68] drm/i915/bdw: Use dynamic allocation idioms on free Ben Widawsky
2014-08-22 3:12 ` [PATCH 47/68] drm/i915/bdw: pagedirs rework allocation Ben Widawsky
2014-08-22 3:12 ` [PATCH 48/68] drm/i915/bdw: pagetable allocation rework Ben Widawsky
2014-08-22 3:12 ` [PATCH 49/68] drm/i915/bdw: Make the pdp switch a bit less hacky Ben Widawsky
2014-08-22 3:12 ` [PATCH 50/68] drm/i915: num_pd_pages/num_pd_entries isn't useful Ben Widawsky
2014-08-22 3:12 ` [PATCH 51/68] drm/i915: Extract PPGTT param from pagedir alloc Ben Widawsky
2014-08-22 3:12 ` [PATCH 52/68] drm/i915/bdw: Split out mappings Ben Widawsky
2014-08-22 3:12 ` [PATCH 53/68] drm/i915/bdw: begin bitmap tracking Ben Widawsky
2014-08-22 3:12 ` [PATCH 54/68] drm/i915/bdw: Dynamic page table allocations Ben Widawsky
2014-08-22 3:12 ` [PATCH 55/68] drm/i915/bdw: Make pdp allocation more dynamic Ben Widawsky
2014-08-22 3:12 ` [PATCH 56/68] drm/i915/bdw: Abstract PDP usage Ben Widawsky
2014-08-22 3:12 ` [PATCH 57/68] drm/i915/bdw: Add dynamic page trace events Ben Widawsky
2014-08-22 3:12 ` [PATCH 58/68] drm/i915/bdw: Add ppgtt info for dynamic pages Ben Widawsky
2014-08-22 3:12 ` [PATCH 59/68] drm/i915/bdw: implement alloc/teardown for 4lvl Ben Widawsky
2014-08-22 3:12 ` [PATCH 60/68] drm/i915/bdw: Add 4 level switching infrastructure Ben Widawsky
2014-08-22 3:12 ` [PATCH 61/68] drm/i915/bdw: Generalize PTE writing for GEN8 PPGTT Ben Widawsky
2014-08-22 3:12 ` [PATCH 62/68] drm/i915: Plumb sg_iter through va allocation ->maps Ben Widawsky
2014-08-22 3:12 ` [PATCH 63/68] drm/i915: Introduce map and unmap for VMAs Ben Widawsky
2014-08-22 3:12 ` [PATCH 64/68] drm/i915: Depend exclusively on map and unmap_vma Ben Widawsky
2014-08-22 3:12 ` [PATCH 65/68] drm/i915: Expand error state's address width to 64b Ben Widawsky
2014-08-22 3:12 ` [PATCH 66/68] drm/i915/bdw: Flip the 48b switch Ben Widawsky
2014-08-22 3:12 ` [PATCH 67/68] drm/i915: Provide a soft_pin hook Ben Widawsky
2014-08-22 3:12 ` [PATCH 68/68] XXX: drm/i915: Unexplained workarounds Ben Widawsky
2014-08-22 3:12 ` [PATCH 1/2] intel: Split out bo allocation Ben Widawsky
2014-08-22 3:12 ` [PATCH 2/2] intel: Add prelocation support Ben Widawsky
2014-08-22 3:12 ` [PATCH] i965: First step toward prelocation Ben Widawsky
2014-08-22 12:15 ` [Mesa-dev] " Alex Deucher
2014-08-22 17:14 ` Ben Widawsky [this message]
2014-08-22 3:12 ` [PATCH] no_reloc: test case Ben Widawsky
2014-08-22 6:30 ` [Intel-gfx] [PATCH 00/68] Broadwell 48b addressing and prelocations (no relocs) Chris Wilson
2014-08-22 6:59 ` Kenneth Graunke
2014-08-22 7:03 ` Chris Wilson
2014-08-22 13:30 ` Daniel Vetter
2014-08-22 13:38 ` [Intel-gfx] " Chris Wilson
2014-08-22 20:29 ` Daniel Vetter
2014-08-22 20:38 ` [Intel-gfx] " Daniel Vetter
2014-08-25 22:42 ` Jesse Barnes
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=20140822171454.GA10603@intel.com \
--to=benjamin.widawsky@intel.com \
--cc=alexdeucher@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mesa-dev@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