Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: Katarzyna Dec <katarzyna.dec@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 4/4] lib: Adjust media_spin and gpu_fill to our code style
Date: Thu, 26 Apr 2018 15:25:43 -0700	[thread overview]
Message-ID: <6ed97d62-ded1-6ca5-3921-371836b834a9@intel.com> (raw)
In-Reply-To: <20180425132650.26247-4-katarzyna.dec@intel.com>



On 25/04/18 06:26, Katarzyna Dec wrote:
> Let's adjust code to our coding style during refactoring
> media_spin code.
> 
> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>

>   
> @@ -399,9 +406,8 @@ gen8_fill_surface_state(struct intel_batchbuffer *batch,
>   	ss->ss8.base_addr = buf->bo->offset;
>   
>   	ret = drm_intel_bo_emit_reloc(batch->bo,
> -				intel_batchbuffer_subdata_offset(batch, ss) + 8 * 4,
> -				buf->bo, 0,
> -				read_domain, write_domain);
> +				intel_batchbuffer_subdata_offset(batch, ss) +
> +				8 * 4, buf->bo, 0, read_domain, write_domain);

Here I would have kept the 'add' statement on one single line to 
increase readability.

>   	igt_assert(ret == 0);
>   
>   	ss->ss2.height = igt_buf_height(buf) - 1;

>   
> diff --git a/lib/media_spin.c b/lib/media_spin.c
> index b4414bee..e203b25c 100644
> --- a/lib/media_spin.c
> +++ b/lib/media_spin.c
> @@ -34,16 +34,26 @@
>   #include "gpu_fill.h"
>   
>   static const uint32_t spin_kernel[][4] = {
> -	{ 0x00600001, 0x20800208, 0x008d0000, 0x00000000 }, /* mov (8)r4.0<1>:ud r0.0<8;8;1>:ud */
> -	{ 0x00200001, 0x20800208, 0x00450040, 0x00000000 }, /* mov (2)r4.0<1>.ud r2.0<2;2;1>:ud */
> -	{ 0x00000001, 0x20880608, 0x00000000, 0x00000003 }, /* mov (1)r4.8<1>:ud 0x3 */
> -	{ 0x00000001, 0x20a00608, 0x00000000, 0x00000000 }, /* mov (1)r5.0<1>:ud 0 */
> -	{ 0x00000040, 0x20a00208, 0x060000a0, 0x00000001 }, /* add (1)r5.0<1>:ud r5.0<0;1;0>:ud 1 */
> -	{ 0x01000010, 0x20000200, 0x02000020, 0x000000a0 }, /* cmp.e.f0.0 (1)null<1> r1<0;1;0> r5<0;1;0> */
> -	{ 0x00110027, 0x00000000, 0x00000000, 0xffffffe0 }, /* ~f0.0 while (1) -32 */
> -	{ 0x0c800031, 0x20000a00, 0x0e000080, 0x040a8000 }, /* send.dcdp1 (16)null<1> r4.0<0;1;0> 0x040a8000 */
> -	{ 0x00600001, 0x2e000208, 0x008d0000, 0x00000000 }, /* mov (8)r112<1>:ud r0.0<8;8;1>:ud */
> -	{ 0x07800031, 0x20000a40, 0x0e000e00, 0x82000010 }, /* send.ts (16)null<1> r112<0;1;0>:d 0x82000010 */

I think the format above is more readable than the one below.

Thanks,
Antonio

> +	/* mov (8)r4.0<1>:ud r0.0<8;8;1>:ud */
> +	{ 0x00600001, 0x20800208, 0x008d0000, 0x00000000 },
> +	/* mov (2)r4.0<1>.ud r2.0<2;2;1>:ud */
> +	{ 0x00200001, 0x20800208, 0x00450040, 0x00000000 },
> +	/* mov (1)r4.8<1>:ud 0x3 */
> +	{ 0x00000001, 0x20880608, 0x00000000, 0x00000003 },
> +	/* mov (1)r5.0<1>:ud 0 */
> +	{ 0x00000001, 0x20a00608, 0x00000000, 0x00000000 },
> +	/* add (1)r5.0<1>:ud r5.0<0;1;0>:ud 1 */
> +	{ 0x00000040, 0x20a00208, 0x060000a0, 0x00000001 },
> +	/* cmp.e.f0.0 (1)null<1> r1<0;1;0> r5<0;1;0> */
> +	{ 0x01000010, 0x20000200, 0x02000020, 0x000000a0 },
> +	/* ~f0.0 while (1) -32 */
> +	{ 0x00110027, 0x00000000, 0x00000000, 0xffffffe0 },
> +	/* send.dcdp1 (16)null<1> r4.0<0;1;0> 0x040a8000 */
> +	{ 0x0c800031, 0x20000a00, 0x0e000080, 0x040a8000 },
> +	/* mov (8)r112<1>:ud r0.0<8;8;1>:ud */
> +	{ 0x00600001, 0x2e000208, 0x008d0000, 0x00000000 },
> +	/* send.ts (16)null<1> r112<0;1;0>:d 0x82000010 */
> +	{ 0x07800031, 0x20000a40, 0x0e000e00, 0x82000010 },
>   };
>   
>   /*
> @@ -81,7 +91,8 @@ gen8_media_spinfunc(struct intel_batchbuffer *batch,
>   	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
>   
>   	curbe_buffer = gen8_spin_curbe_buffer_data(batch, spins);
> -	interface_descriptor = gen8_fill_interface_descriptor(batch, dst, spin_kernel, sizeof(spin_kernel));
> +	interface_descriptor = gen8_fill_interface_descriptor(batch, dst,
> +					      spin_kernel, sizeof(spin_kernel));
>   	igt_assert(batch->ptr < &batch->buffer[4095]);
>   
>   	/* media pipeline */
> @@ -119,7 +130,8 @@ gen9_media_spinfunc(struct intel_batchbuffer *batch,
>   	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
>   
>   	curbe_buffer = gen8_spin_curbe_buffer_data(batch, spins);
> -	interface_descriptor = gen8_fill_interface_descriptor(batch, dst, spin_kernel, sizeof(spin_kernel));
> +	interface_descriptor = gen8_fill_interface_descriptor(batch, dst,
> +					      spin_kernel, sizeof(spin_kernel));
>   	igt_assert(batch->ptr < &batch->buffer[4095]);
>   
>   	/* media pipeline */
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-04-26 22:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25 13:26 [igt-dev] [PATCH i-g-t 1/4] lib/media_spin: Move helper functions to gpu_fill library Katarzyna Dec
2018-04-25 13:26 ` [igt-dev] [PATCH i-g-t 2/4] lib: Remove duplications in gpu_fill used by media_spin Katarzyna Dec
2018-04-25 21:49   ` Daniele Ceraolo Spurio
2018-04-26 11:11     ` Katarzyna Dec
2018-04-26 13:32     ` Katarzyna Dec
2018-04-25 13:26 ` [igt-dev] [PATCH i-g-t 3/4] lib/media_spin: Remove gen8lp_media_spin function Katarzyna Dec
2018-04-26 16:35   ` Daniele Ceraolo Spurio
2018-04-25 13:26 ` [igt-dev] [PATCH i-g-t 4/4] lib: Adjust media_spin and gpu_fill to our code style Katarzyna Dec
2018-04-26 22:25   ` Antonio Argenziano [this message]
2018-04-25 13:50 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/4] lib/media_spin: Move helper functions to gpu_fill library Patchwork
2018-04-25 20:01 ` [igt-dev] [PATCH i-g-t 1/4] " Daniele Ceraolo Spurio
2018-04-26 11:08   ` Katarzyna Dec

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=6ed97d62-ded1-6ca5-3921-371836b834a9@intel.com \
    --to=antonio.argenziano@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=katarzyna.dec@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