Re: [Intel-gfx] [PATCH i-g-t] lib/rendercopy: Refactoring rendercopy libraries

2018-01-04 Thread Katarzyna Dec
On Wed, Dec 06, 2017 at 04:58:07PM +0100, Lukasz Kalamarz wrote:
> Current implementation of those libraries is not alligned with our
> coding style. Some methods were copied from other gens and were
> only renamed.
> This patch is fixing those. No functional changes were made.
> 
> Signed-off-by: Lukasz Kalamarz 
> Cc: Arkadiusz Hiler 
> Cc: Imre Deak 

LGTM. More changes are going to come to this library and other similar
(media and gpgpu). 
Reviewed-by: Katarzyna Dec 


> -- 
> 2.9.5
> 
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t] lib/rendercopy: Refactoring rendercopy libraries

2017-12-06 Thread Lukasz Kalamarz
Current implementation of those libraries is not alligned with our
coding style. Some methods were copied from other gens and were
only renamed.
This patch is fixing those. No functional changes were made.

Signed-off-by: Lukasz Kalamarz 
Cc: Arkadiusz Hiler 
Cc: Imre Deak 
---
 lib/rendercopy_gen7.c |   4 +-
 lib/rendercopy_gen8.c | 165 +++---
 lib/rendercopy_gen9.c |  79 
 3 files changed, 117 insertions(+), 131 deletions(-)

diff --git a/lib/rendercopy_gen7.c b/lib/rendercopy_gen7.c
index 3b92406..d76bb8d 100644
--- a/lib/rendercopy_gen7.c
+++ b/lib/rendercopy_gen7.c
@@ -68,7 +68,7 @@ batch_copy(struct intel_batchbuffer *batch, const void *ptr, 
uint32_t size, uint
 }
 
 static void
-gen7_render_flush(struct intel_batchbuffer *batch,
+gen6_render_flush(struct intel_batchbuffer *batch,
  drm_intel_context *context, uint32_t batch_end)
 {
int ret;
@@ -581,6 +581,6 @@ void gen7_render_copyfunc(struct intel_batchbuffer *batch,
batch_end = ALIGN(batch_end, 8);
igt_assert(batch_end < BATCH_STATE_SPLIT);
 
-   gen7_render_flush(batch, context, batch_end);
+   gen6_render_flush(batch, context, batch_end);
intel_batchbuffer_reset(batch);
 }
diff --git a/lib/rendercopy_gen8.c b/lib/rendercopy_gen8.c
index a7fc2c4..c871b2f 100644
--- a/lib/rendercopy_gen8.c
+++ b/lib/rendercopy_gen8.c
@@ -77,15 +77,15 @@ struct annotations_context {
drm_intel_aub_annotation annotations[MAX_ANNOTATIONS];
int index;
uint32_t offset;
-};
+} aub_annotations;
 
-static void annotation_init(struct annotations_context *aub)
+static void annotation_init(struct annotations_context *ctx)
 {
-   /* aub->annotations is an array keeping a list of annotations of the
-* batch buffer ordered by offset. aub->annotations[0] is thus left
+   /* ctx->annotations is an array keeping a list of annotations of the
+* batch buffer ordered by offset. ctx->annotations[0] is thus left
 * for the command stream and will be filled just before executing
 * the batch buffer with annotations_add_batch() */
-   aub->index = 1;
+   ctx->index = 1;
 }
 
 static void add_annotation(drm_intel_aub_annotation *a,
@@ -97,36 +97,36 @@ static void add_annotation(drm_intel_aub_annotation *a,
a->ending_offset = ending_offset;
 }
 
-static void annotation_add_batch(struct annotations_context *aub, size_t size)
+static void annotation_add_batch(struct annotations_context *ctx, size_t size)
 {
-   add_annotation(>annotations[0], AUB_TRACE_TYPE_BATCH, 0, size);
+   add_annotation(>annotations[0], AUB_TRACE_TYPE_BATCH, 0, size);
 }
 
-static void annotation_add_state(struct annotations_context *aub,
+static void annotation_add_state(struct annotations_context *ctx,
 uint32_t state_type,
 uint32_t start_offset,
 size_t   size)
 {
-   igt_assert(aub->index < MAX_ANNOTATIONS);
+   igt_assert(ctx->index < MAX_ANNOTATIONS);
 
-   add_annotation(>annotations[aub->index++],
+   add_annotation(>annotations[ctx->index++],
   AUB_TRACE_TYPE_NOTYPE, 0,
   start_offset);
-   add_annotation(>annotations[aub->index++],
+   add_annotation(>annotations[ctx->index++],
   AUB_TRACE_TYPE(state_type),
   AUB_TRACE_SUBTYPE(state_type),
   start_offset + size);
 }
 
-static void annotation_flush(struct annotations_context *aub,
+static void annotation_flush(struct annotations_context *ctx,
 struct intel_batchbuffer *batch)
 {
if (!igt_aub_dump_enabled())
return;
 
drm_intel_bufmgr_gem_set_aub_annotations(batch->bo,
-aub->annotations,
-aub->index);
+ctx->annotations,
+ctx->index);
 }
 
 static uint32_t
@@ -179,11 +179,8 @@ gen6_render_flush(struct intel_batchbuffer *batch,
 
 /* Mostly copy+paste from gen6, except height, width, pitch moved */
 static uint32_t
-gen8_bind_buf(struct intel_batchbuffer *batch,
- struct annotations_context *aub,
- struct igt_buf *buf,
- uint32_t format, int is_dst)
-{
+gen8_bind_buf(struct intel_batchbuffer *batch, struct igt_buf *buf,
+ uint32_t format, int is_dst) {
struct gen8_surface_state *ss;
uint32_t write_domain, read_domain, offset;
int ret;
@@ -197,7 +194,8 @@ gen8_bind_buf(struct intel_batchbuffer *batch,
 
ss = batch_alloc(batch, sizeof(*ss), 64);
offset = batch_offset(batch, ss);
-   annotation_add_state(aub,