[Mesa-dev] [PATCH v2 26/27] i965/miptree: More conservatively resolve external images
Chad Versace
chadversary at chromium.org
Wed Jul 12 18:39:16 UTC 2017
On Thu 29 Jun 2017, Jason Ekstrand wrote:
> Instead of always doing a full resolve, only resolve the bits that are
> needed. This means that we only do a partial resolve when the miptree
> modifier is I915_FORMAT_MOD_Y_TILED_CCS.
>
> Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
> src/mesa/drivers/dri/i965/brw_context.c | 2 +-
> src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 37 +++++++++++++++++++++++++++
> src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 9 +++++++
> 3 files changed, 47 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index 2525320..f086ed1 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -1338,7 +1338,7 @@ intel_resolve_for_dri2_flush(struct brw_context *brw,
> if (rb->mt->num_samples <= 1) {
> assert(rb->mt_layer == 0 && rb->mt_level == 0 &&
> rb->layer_count == 1);
> - intel_miptree_prepare_access(brw, rb->mt, 0, 1, 0, 1, false, false);
> + intel_miptree_prepare_external(brw, rb->mt);
Yes! Now it should be easy to hook up EGL_EXT_image_flush_external for CrOS.
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> index c4ed525..c1bd3af 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> @@ -636,6 +636,12 @@ struct intel_mipmap_tree
> */
> bool is_scanout;
>
> + /**
> + * For external surfaces, this is DRM format modifier that was used to
> + * create or import the surface.
> + */
> + uint64_t drm_modifier;
My natural question was "and what about non-external surfaces?". The
question has a non-obvious answer since default initialization sets
drm_modifier to a valid modifier (DRM_FORMAT_MOD_LINEAR). Please
mention here that the modifier may be DRM_FORMAT_MOD_INVALID for
non-external surfaces.
With that extra comment, this is
Reviewed-by: Chad Versace <chadversary at chromium.org>
More information about the mesa-dev
mailing list