[Mesa-dev] [PATCH V3 17/22] i965/gen9: Add XY_FAST_COPY_BLT support to intelEmitCopyBlit()

Matt Turner mattst88 at gmail.com
Tue Jun 2 16:13:04 PDT 2015


On Tue, Jun 2, 2015 at 4:04 PM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
> This patch enables using XY_FAST_COPY_BLT only for Yf/Ys tiled buffers.
> It can be later turned on for other tiling patterns (X,Y) too.
>
> V3: Flush in between sequential fast copy blits.
>     Fix src/dst alignment requirements.
>     Make can_fast_copy_blit() helper.
>     Use ffs(), is_power_of_two()
>     Move overlap computation inside intel_miptree_blit().
>     Use XY_FAST prefix for the macros.
>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> Cc: Ben Widawsky <ben at bwidawsk.net>
> ---
>  src/mesa/drivers/dri/i965/intel_blit.c       | 306 +++++++++++++++++++++++----
>  src/mesa/drivers/dri/i965/intel_blit.h       |   2 +
>  src/mesa/drivers/dri/i965/intel_copy_image.c |   2 +
>  src/mesa/drivers/dri/i965/intel_reg.h        |  36 ++++
>  4 files changed, 299 insertions(+), 47 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
> index cd89f9d..8f0b48b 100644
> --- a/src/mesa/drivers/dri/i965/intel_blit.c
> +++ b/src/mesa/drivers/dri/i965/intel_blit.c
> @@ -43,6 +43,23 @@
>
>  #define FILE_DEBUG_FLAG DEBUG_BLIT
>
> +#define SET_TILING_XY_FAST_COPY_BLT(tiling, tr_mode, type)           \
> +({                                                                   \
> +   switch (tiling) {                                                 \
> +   case I915_TILING_X:                                               \
> +      CMD |= type ## _TILED_X;                                       \
> +      break;                                                         \
> +   case I915_TILING_Y:                                               \
> +      if (tr_mode == INTEL_MIPTREE_TRMODE_YS)                        \
> +         CMD |= type ## _TILED_64K;                                  \
> +      else                                                           \
> +         CMD |= type ## _TILED_Y;                                    \
> +      break;                                                         \
> +   default:                                                          \
> +      unreachable("not reached");                                    \
> +   }                                                                 \
> +})
> +
>  static void
>  intel_miptree_set_alpha_to_one(struct brw_context *brw,
>                                 struct intel_mipmap_tree *mt,
> @@ -75,6 +92,10 @@ static uint32_t
>  br13_for_cpp(int cpp)
>  {
>     switch (cpp) {
> +   case 16:
> +      return BR13_32323232;
> +   case 8:
> +      return BR13_16161616;
>     case 4:
>        return BR13_8888;
>     case 2:
> @@ -86,6 +107,81 @@ br13_for_cpp(int cpp)
>     }
>  }
>
> +static uint32_t
> +get_tr_horizontal_align(uint32_t tr_mode, uint32_t cpp, bool is_src) {
> +   /*Alignment tables for YF/YS tiled surfaces. */

Missing a space after /*


More information about the mesa-dev mailing list