intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: Praveen Paneri <praveen.paneri@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Akash Goel <akash.goel@intel.com>
Subject: Re: [PATCH v2 4/7] lib/igt_draw: Add Y-tiling support for IGT_DRAW_BLT method
Date: Thu, 13 Jul 2017 16:59:04 -0300	[thread overview]
Message-ID: <1499975944.2649.25.camel@intel.com> (raw)
In-Reply-To: <1493390254-5232-5-git-send-email-praveen.paneri@intel.com>

Em Sex, 2017-04-28 às 20:07 +0530, Praveen Paneri escreveu:
> From: Akash Goel <akash.goel@intel.com>
> 
> v2: Moved identical code into a single function (Paulo)

My MI-fu is not very strong, but I tried to check this against BSpec
and I believe this patch is correct. I also tested it, and it
definitely solves the problems with the BLT operations on Y tiling.

There's only a minor nitpick with a line going beyond 80 columns, but I
can fix that while applying.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

> 
> Signed-off-by: Akash Goel <akash.goel@intel.com>
> Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
> ---
>  lib/igt_draw.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/lib/igt_draw.c b/lib/igt_draw.c
> index fcf8fba..27a69cd 100644
> --- a/lib/igt_draw.c
> +++ b/lib/igt_draw.c
> @@ -31,6 +31,7 @@
>  #include "igt_core.h"
>  #include "igt_fb.h"
>  #include "ioctl_wrappers.h"
> +#include "i830_reg.h"
>  
>  /**
>   * SECTION:igt_draw
> @@ -242,6 +243,34 @@ static void set_pixel(void *_ptr, int index,
> uint32_t color, int bpp)
>  	}
>  }
>  
> +static void switch_blt_tiling(struct intel_batchbuffer *batch,
> uint32_t tiling, bool on)
> +{
> +	uint32_t bcs_swctrl;
> +
> +	/* Default is X-tile */
> +	if (tiling != I915_TILING_Y)
> +		return;
> +
> +	bcs_swctrl = (0x3 << 16) | (on ? 0x3 : 0x0);
> +
> +	/* To change the tile register, insert an MI_FLUSH_DW
> followed by an
> +	 * MI_LOAD_REGISTER_IMM
> +	 */
> +	BEGIN_BATCH(4, 0);
> +	OUT_BATCH(MI_FLUSH_DW | 2);
> +	OUT_BATCH(0x0);
> +	OUT_BATCH(0x0);
> +	OUT_BATCH(0x0);
> +	ADVANCE_BATCH();
> +
> +	BEGIN_BATCH(4, 0);
> +	OUT_BATCH(MI_LOAD_REGISTER_IMM);
> +	OUT_BATCH(0x22200); /* BCS_SWCTRL */
> +	OUT_BATCH(bcs_swctrl);
> +	OUT_BATCH(MI_NOOP);
> +	ADVANCE_BATCH();
> +}
> +
>  static void draw_rect_ptr_linear(void *ptr, uint32_t stride,
>  				 struct rect *rect, uint32_t color,
> int bpp)
>  {
> @@ -487,6 +516,8 @@ static void draw_rect_blt(int fd, struct cmd_data
> *cmd_data,
>  	blt_cmd_tiling = (tiling) ? XY_COLOR_BLT_TILED : 0;
>  	pitch = (tiling) ? buf->stride / 4 : buf->stride;
>  
> +	switch_blt_tiling(batch, tiling, true);
> +
>  	BEGIN_BATCH(6, 1);
>  	OUT_BATCH(XY_COLOR_BLT_CMD_NOLEN | XY_COLOR_BLT_WRITE_ALPHA
> |
>  		  XY_COLOR_BLT_WRITE_RGB | blt_cmd_tiling |
> blt_cmd_len);
> @@ -497,6 +528,8 @@ static void draw_rect_blt(int fd, struct cmd_data
> *cmd_data,
>  	OUT_BATCH(color);
>  	ADVANCE_BATCH();
>  
> +	switch_blt_tiling(batch, tiling, false);
> +
>  	intel_batchbuffer_flush(batch);
>  	intel_batchbuffer_free(batch);
>  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-07-13 19:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28 14:37 [PATCH v2 0/7] Add Y-tiling support into IGTs Praveen Paneri
2017-04-28 14:37 ` [PATCH v2 1/7] lib/igt_fb: Let others use igt_get_fb_tile_size Praveen Paneri
2017-07-11 18:41   ` Paulo Zanoni
2017-04-28 14:37 ` [PATCH v2 2/7] lib/igt_fb: Add helper function for tile_to_mod Praveen Paneri
2017-07-11 18:44   ` Paulo Zanoni
2017-04-28 14:37 ` [PATCH v2 3/7] lib/igt_draw: Add Y-tiling support Praveen Paneri
2017-06-09 10:18   ` [PATCH] " Praveen Paneri
2017-06-23  5:16     ` Praveen Paneri
2017-07-13 21:33     ` Paulo Zanoni
2017-07-14 14:02       ` Praveen Paneri
2017-04-28 14:37 ` [PATCH v2 4/7] lib/igt_draw: Add Y-tiling support for IGT_DRAW_BLT method Praveen Paneri
2017-07-13 19:59   ` Paulo Zanoni [this message]
2017-07-14 13:57     ` Praveen Paneri
2017-04-28 14:37 ` [PATCH v2 5/7] tests/kms_draw_crc: add support for Y tiling Praveen Paneri
2017-07-11 19:03   ` Paulo Zanoni
2017-07-12  8:15     ` Praveen Paneri
2017-07-13 20:19       ` Paulo Zanoni
2017-07-14 14:00         ` Praveen Paneri
2017-04-28 14:37 ` [PATCH v2 6/7] igt/kms_frontbuffer_tracking: Add Y-tiling support Praveen Paneri
2017-07-12 20:17   ` Paulo Zanoni
2017-07-14 10:15     ` Praveen Paneri
2017-04-28 14:37 ` [PATCH v2 7/7] igt/kms_fbc_crc.c : Add Y-tile tests Praveen Paneri
2017-07-12 21:01   ` Paulo Zanoni
2017-07-14 13:55     ` Praveen Paneri
2017-07-14 14:25       ` Paulo Zanoni
2017-07-17 13:33         ` Praveen Paneri
2017-04-28 19:21 ` [PATCH v2 0/7] Add Y-tiling support into IGTs Paulo Zanoni
2017-04-29  3:14   ` Praveen Paneri
2017-06-06 16:58     ` Paulo Zanoni
2017-06-15 11:03       ` Praveen Paneri

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=1499975944.2649.25.camel@intel.com \
    --to=paulo.r.zanoni@intel.com \
    --cc=akash.goel@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=praveen.paneri@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).