nvc0: move nvc0_validate_global_residents() to nvc0_compute.c
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 24 Feb 2016 17:44:54 +0000 (18:44 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 26 Feb 2016 13:00:18 +0000 (14:00 +0100)
While we are at it, rename it to nvc0_compute_validate_globals() and
update its prototype.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre Moreau <pierre.morrow@free.fr>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
src/gallium/drivers/nouveau/nvc0/nvc0_context.h
src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
src/gallium/drivers/nouveau/nvc0/nve4_compute.c

index 0f1265f5db59c63dbb9d21f5feab1bf6b7c9dc95..7809a11eeae6a89764ce70f1360a3323453777a8 100644 (file)
@@ -274,6 +274,21 @@ nvc0_compute_validate_buffers(struct nvc0_context *nvc0)
    }
 }
 
+void
+nvc0_compute_validate_globals(struct nvc0_context *nvc0)
+{
+   unsigned i;
+
+   for (i = 0; i < nvc0->global_residents.size / sizeof(struct pipe_resource *);
+        ++i) {
+      struct pipe_resource *res = *util_dynarray_element(
+         &nvc0->global_residents, struct pipe_resource *, i);
+      if (res)
+         nvc0_add_resident(nvc0->bufctx_cp, NVC0_BIND_CP_GLOBAL,
+                           nv04_resource(res), NOUVEAU_BO_RDWR);
+   }
+}
+
 static bool
 nvc0_compute_state_validate(struct nvc0_context *nvc0)
 {
index d3e3a818910657a1b7d37d76578c330d1b531fb6..7aa4b62363863e53a4b879ae0fa928f485f36e1e 100644 (file)
@@ -261,8 +261,6 @@ void nvc0_tfb_validate(struct nvc0_context *);
 extern void nvc0_init_state_functions(struct nvc0_context *);
 
 /* nvc0_state_validate.c */
-void nvc0_validate_global_residents(struct nvc0_context *,
-                                    struct nouveau_bufctx *, int bin);
 bool nvc0_state_validate(struct nvc0_context *, uint32_t state_mask);
 
 /* nvc0_surface.c */
@@ -342,5 +340,6 @@ void nve4_launch_grid(struct pipe_context *, const struct pipe_grid_info *);
 
 /* nvc0_compute.c */
 void nvc0_launch_grid(struct pipe_context *, const struct pipe_grid_info *);
+void nvc0_compute_validate_globals(struct nvc0_context *);
 
 #endif
index 18e79e36b8522d4ace61fa49ed0f6a97e6b70773..fbf45ceca2ddb1c8e55170d9f6c245511634a180 100644 (file)
@@ -559,21 +559,6 @@ nvc0_validate_driverconst(struct nvc0_context *nvc0)
    nvc0->dirty_cp |= NVC0_NEW_CP_DRIVERCONST;
 }
 
-void
-nvc0_validate_global_residents(struct nvc0_context *nvc0,
-                               struct nouveau_bufctx *bctx, int bin)
-{
-   unsigned i;
-
-   for (i = 0; i < nvc0->global_residents.size / sizeof(struct pipe_resource *);
-        ++i) {
-      struct pipe_resource *res = *util_dynarray_element(
-         &nvc0->global_residents, struct pipe_resource *, i);
-      if (res)
-         nvc0_add_resident(bctx, bin, nv04_resource(res), NOUVEAU_BO_RDWR);
-   }
-}
-
 static void
 nvc0_validate_derived_1(struct nvc0_context *nvc0)
 {
index 652bc6d83d6b065290cfeee83f52afed8747704e..5c73740d2ddfec0adcd31e65f5f6c5dfd401d2e8 100644 (file)
@@ -317,8 +317,7 @@ nve4_compute_state_validate(struct nvc0_context *nvc0)
    if (nvc0->dirty_cp & NVC0_NEW_CP_SURFACES)
       nve4_compute_validate_surfaces(nvc0);
    if (nvc0->dirty_cp & NVC0_NEW_CP_GLOBALS)
-      nvc0_validate_global_residents(nvc0,
-                                     nvc0->bufctx_cp, NVC0_BIND_CP_GLOBAL);
+      nvc0_compute_validate_globals(nvc0);
 
    nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, false);