[Mesa-dev] [PATCH] i965: Bump aperture tracking to u64
andrey simiklit
asimiklit.work at gmail.com
Fri Sep 7 14:37:04 UTC 2018
On Fri, Sep 7, 2018 at 4:35 PM Chris Wilson <chris at chris-wilson.co.uk>
wrote:
> As a prelude to handling large address spaces, first allow ourselves the
> luxury of handling the full 4G.
>
> Reported-by: Andrey Simiklit <asimiklit.work at gmail.com>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> ---
> src/mesa/drivers/dri/i965/brw_context.h | 2 +-
> src/mesa/drivers/dri/i965/intel_batchbuffer.c | 9 +--------
> src/mesa/drivers/dri/i965/intel_batchbuffer.h | 8 ++++++--
> 3 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h
> b/src/mesa/drivers/dri/i965/brw_context.h
> index d3b96953467..ca1fe8ef0ea 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -509,7 +509,7 @@ struct intel_batchbuffer {
> int exec_array_size;
>
> /** The amount of aperture space (in bytes) used by all exec_bos */
> - int aperture_space;
> + uint64_t aperture_space;
>
There are several fields which are not cleaned when
Mesa managed to save the 'empty batch' and uses
'intel_batchbuffer_reset_to_saved' to restore back to it)
The negative aperture just helped me to find
the root cause of the issue)
But actually you are right I also do not know why
we use the signed 32bit integer there)
>
> struct {
> uint32_t *map_next;
> diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> index 65d2c64e319..4363b146150 100644
> --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> @@ -870,7 +870,7 @@ _intel_batchbuffer_flush_fence(struct brw_context *brw,
> bytes_for_commands, 100.0f * bytes_for_commands / BATCH_SZ,
> bytes_for_state, 100.0f * bytes_for_state / STATE_SZ,
> brw->batch.exec_count,
> - (float) brw->batch.aperture_space / (1024 * 1024),
> + (float) (brw->batch.aperture_space / (1024 * 1024)),
> brw->batch.batch_relocs.reloc_count,
> brw->batch.state_relocs.reloc_count);
>
> @@ -890,13 +890,6 @@ _intel_batchbuffer_flush_fence(struct brw_context
> *brw,
> return ret;
> }
>
> -bool
> -brw_batch_has_aperture_space(struct brw_context *brw, unsigned
> extra_space)
> -{
> - return brw->batch.aperture_space + extra_space <=
> - brw->screen->aperture_threshold;
> -}
> -
> bool
> brw_batch_references(struct intel_batchbuffer *batch, struct brw_bo *bo)
> {
> diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> index d10948f1916..0632142cd31 100644
> --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> @@ -44,8 +44,12 @@ int _intel_batchbuffer_flush_fence(struct brw_context
> *brw,
> void intel_batchbuffer_data(struct brw_context *brw,
> const void *data, GLuint bytes);
>
> -bool brw_batch_has_aperture_space(struct brw_context *brw,
> - unsigned extra_space_in_bytes);
> +static inline bool
> +brw_batch_has_aperture_space(struct brw_context *brw, uint64_t
> extra_space)
> +{
> + return brw->batch.aperture_space + extra_space <=
> + brw->screen->aperture_threshold;
> +}
>
> bool brw_batch_references(struct intel_batchbuffer *batch, struct brw_bo
> *bo);
>
> --
> 2.19.0.rc2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180907/e8b56d8f/attachment.html>
More information about the mesa-dev
mailing list