[Mesa-dev] [PATCH 4/6] i965: Extract blit height max

Anuj Phogat anuj.phogat at gmail.com
Tue Mar 10 08:39:39 PDT 2015


On Mon, Mar 9, 2015 at 9:43 PM, Ben Widawsky
<benjamin.widawsky at intel.com> wrote:
> The blit engine in GEN hardware has constraints. These constraints are a
> function of tile parameters as well as height. The current code is very dumb in
> terms of determine max blit parameters. Since we'll be expanding on it, having
determining
> the abstraction makes things easier.
>
> Note that this doesn't change all places which check blitter requirements. I
> will be adding those as a separate patch(es) since the original series, which
> was well tested, did not include those.
>
> This was requested by Jordan and Jason.
>
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> ---
>  src/mesa/drivers/dri/i965/intel_blit.c | 12 +++++-------
>  src/mesa/drivers/dri/i965/intel_blit.h | 10 ++++++++++
>  2 files changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
> index b93794b..c7f4cf3 100644
> --- a/src/mesa/drivers/dri/i965/intel_blit.c
> +++ b/src/mesa/drivers/dri/i965/intel_blit.c
> @@ -240,14 +240,12 @@ intel_miptree_blit(struct brw_context *brw,
>     dst_x += dst_image_x;
>     dst_y += dst_image_y;
>
> -   /* The blitter interprets the 16-bit destination x/y as a signed 16-bit
> -    * value. The values we're working with are unsigned, so make sure we don't
> -    * overflow.
> -    */
> -   if (src_x >= INTEL_MAX_BLIT_PITCH || src_y >= INTEL_MAX_BLIT_ROWS ||
> -       dst_x >= INTEL_MAX_BLIT_PITCH || dst_y >= INTEL_MAX_BLIT_ROWS) {
> +   if (src_x >= INTEL_MAX_BLIT_PITCH || dst_x >= INTEL_MAX_BLIT_PITCH ||
> +       src_y >= intel_blit_max_height() ||
> +       dst_y >= intel_blit_max_height()) {
>        perf_debug("Falling back due to >=%dk offset [src(%d, %d) dst(%d, %d)]\n",
> -                 src_x, src_y, dst_x, dst_y, INTEL_MAX_BLIT_PITCH >> 20);
> +                 src_x, src_y, dst_x, dst_y,
> +                 MAX2(intel_blit_max_height(), INTEL_MAX_BLIT_PITCH) >> 20);
I think you mean to do below changes:
+                 MAX2(intel_blit_max_height(), INTEL_MAX_BLIT_PITCH) >> 10,
+                 src_x, src_y, dst_x, dst_y);

>        return false;
>     }
>
> diff --git a/src/mesa/drivers/dri/i965/intel_blit.h b/src/mesa/drivers/dri/i965/intel_blit.h
> index 531d329..52dd67c 100644
> --- a/src/mesa/drivers/dri/i965/intel_blit.h
> +++ b/src/mesa/drivers/dri/i965/intel_blit.h
> @@ -78,4 +78,14 @@ void intel_emit_linear_blit(struct brw_context *brw,
>                             unsigned int src_offset,
>                             unsigned int size);
>
> +static inline uint32_t
> +intel_blit_max_height(void)
> +{
> +   /* The docs say that the blitter is capable of transferring 65536 scanlines
> +    * per blit, however the commands we use only have a signed 16b value thus
> +    * making the practical limit 15b.
> +    */
> +   return INTEL_MAX_BLIT_ROWS;
> +}
> +
>  #endif
> --
> 2.3.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list