v3d: Rename gallium-local limits defines from VC5 to V3D.
authorEric Anholt <eric@anholt.net>
Fri, 18 Jan 2019 23:53:06 +0000 (15:53 -0800)
committerEric Anholt <eric@anholt.net>
Sun, 27 Jan 2019 16:30:03 +0000 (08:30 -0800)
The compiler has its limits under V3D_* (like most V3D stuff), so sync up
with that.

src/gallium/drivers/v3d/v3d_context.c
src/gallium/drivers/v3d/v3d_context.h
src/gallium/drivers/v3d/v3d_job.c
src/gallium/drivers/v3d/v3d_program.c
src/gallium/drivers/v3d/v3d_resource.h
src/gallium/drivers/v3d/v3d_screen.c
src/gallium/drivers/v3d/v3d_screen.h
src/gallium/drivers/v3d/v3dx_draw.c
src/gallium/drivers/v3d/v3dx_emit.c
src/gallium/drivers/v3d/v3dx_rcl.c
src/gallium/drivers/v3d/v3dx_state.c

index 104096d5248dd394190d2ce5f29d5b86420c24ae..7e9bc3d22db01b5ef4f62774aa9838f2fe50bdb2 100644 (file)
@@ -224,7 +224,7 @@ v3d_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
 
         V3D_DEBUG |= saved_shaderdb_flag;
 
-        v3d->sample_mask = (1 << VC5_MAX_SAMPLES) - 1;
+        v3d->sample_mask = (1 << V3D_MAX_SAMPLES) - 1;
         v3d->active_queries = true;
 
         return &v3d->base;
index 136d85065976e1a88846df083eb538dab0f37d67..2ced7c8aa316e1e2b55f302a5fc677569c3ced03 100644 (file)
@@ -190,10 +190,10 @@ struct v3d_vertexbuf_stateobj {
 };
 
 struct v3d_vertex_stateobj {
-        struct pipe_vertex_element pipe[VC5_MAX_ATTRIBUTES];
+        struct pipe_vertex_element pipe[V3D_MAX_ATTRIBUTES];
         unsigned num_elements;
 
-        uint8_t attrs[16 * VC5_MAX_ATTRIBUTES];
+        uint8_t attrs[16 * V3D_MAX_ATTRIBUTES];
         struct pipe_resource *defaults;
         uint32_t defaults_offset;
 };
index 5928e98a71cf9ebebd4645e793df817acb548659..87eede2cd9cdf988d73074fa864d7ab2dde3c467 100644 (file)
@@ -62,7 +62,7 @@ v3d_job_free(struct v3d_context *v3d, struct v3d_job *job)
                 }
         }
 
-        for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+        for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 if (job->cbufs[i]) {
                         remove_from_ht(v3d->write_jobs, job->cbufs[i]->texture);
                         pipe_surface_reference(&job->cbufs[i], NULL);
@@ -204,7 +204,7 @@ v3d_job_set_tile_buffer_size(struct v3d_job *job)
                 tile_size_index++;
 
         int max_bpp = RENDER_TARGET_MAXIMUM_32BPP;
-        for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+        for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 if (job->cbufs[i]) {
                         struct v3d_surface *surf = v3d_surface(job->cbufs[i]);
                         max_bpp = MAX2(max_bpp, surf->internal_bpp);
@@ -251,7 +251,7 @@ v3d_get_job(struct v3d_context *v3d,
          */
         struct v3d_job *job = v3d_job_create(v3d);
 
-        for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+        for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 if (cbufs[i]) {
                         v3d_flush_jobs_reading_resource(v3d, cbufs[i]->texture);
                         pipe_surface_reference(&job->cbufs[i], cbufs[i]);
@@ -267,7 +267,7 @@ v3d_get_job(struct v3d_context *v3d,
                         job->msaa = true;
         }
 
-        for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+        for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 if (cbufs[i])
                         _mesa_hash_table_insert(v3d->write_jobs,
                                                 cbufs[i]->texture, job);
index a5b3f2ebfd9730dfc96d49cc9a27336a04f8ca4b..567af2ead440bdadfa5ac971107a5a797d5434ea 100644 (file)
@@ -515,7 +515,7 @@ v3d_update_compiled_fs(struct v3d_context *v3d, uint8_t prim_mode)
         if (job->msaa) {
                 key->msaa = v3d->rasterizer->base.multisample;
                 key->sample_coverage = (v3d->rasterizer->base.multisample &&
-                                        v3d->sample_mask != (1 << VC5_MAX_SAMPLES) - 1);
+                                        v3d->sample_mask != (1 << V3D_MAX_SAMPLES) - 1);
                 key->sample_alpha_to_coverage = v3d->blend->base.alpha_to_coverage;
                 key->sample_alpha_to_one = v3d->blend->base.alpha_to_one;
         }
index 2aa28627338644f15ff40f339bd96d19b58ce01a..f0b7c26e04886444a6c3dda70f61454a1c496dfb 100644 (file)
@@ -123,7 +123,7 @@ struct v3d_resource {
         struct pipe_resource base;
         struct v3d_bo *bo;
         struct renderonly_scanout *scanout;
-        struct v3d_resource_slice slices[VC5_MAX_MIP_LEVELS];
+        struct v3d_resource_slice slices[V3D_MAX_MIP_LEVELS];
         uint32_t cube_map_stride;
         uint32_t size;
         int cpp;
index bee036a96d3ae416386a5005b6be79aff5beefee..81392c9ff833916b61b518a57086a789276dc829 100644 (file)
@@ -181,7 +181,7 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
         case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
         case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
-                return VC5_MAX_MIP_LEVELS;
+                return V3D_MAX_MIP_LEVELS;
         case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
                 return 2048;
 
@@ -260,14 +260,14 @@ v3d_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
 
         case PIPE_SHADER_CAP_MAX_INPUTS:
                 if (shader == PIPE_SHADER_FRAGMENT)
-                        return VC5_MAX_FS_INPUTS / 4;
+                        return V3D_MAX_FS_INPUTS / 4;
                 else
-                        return VC5_MAX_ATTRIBUTES;
+                        return V3D_MAX_ATTRIBUTES;
         case PIPE_SHADER_CAP_MAX_OUTPUTS:
                 if (shader == PIPE_SHADER_FRAGMENT)
                         return 4;
                 else
-                        return VC5_MAX_FS_INPUTS / 4;
+                        return V3D_MAX_FS_INPUTS / 4;
         case PIPE_SHADER_CAP_MAX_TEMPS:
                 return 256; /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
         case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
@@ -300,7 +300,7 @@ v3d_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
                 return 1;
         case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
         case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
-                return VC5_MAX_TEXTURE_SAMPLERS;
+                return V3D_MAX_TEXTURE_SAMPLERS;
 
         case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
                 return PIPE_MAX_SHADER_BUFFERS;
@@ -340,7 +340,7 @@ v3d_screen_is_format_supported(struct pipe_screen *pscreen,
         if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
                 return false;
 
-        if (sample_count > 1 && sample_count != VC5_MAX_SAMPLES)
+        if (sample_count > 1 && sample_count != V3D_MAX_SAMPLES)
                 return FALSE;
 
         if (target >= PIPE_MAX_TEXTURE_TYPES) {
index 6cb33429067fc0c539a669d0d4767cbb6036dd81..0975da2032fbd8d7ee2657966e45468e1d4e9878 100644 (file)
 
 struct v3d_bo;
 
-#define VC5_MAX_MIP_LEVELS 12
-#define VC5_MAX_TEXTURE_SAMPLERS 32
-#define VC5_MAX_SAMPLES 4
-#define VC5_MAX_DRAW_BUFFERS 4
-#define VC5_MAX_ATTRIBUTES 16
+#define V3D_MAX_MIP_LEVELS 12
+#define V3D_MAX_TEXTURE_SAMPLERS 32
+#define V3D_MAX_SAMPLES 4
+#define V3D_MAX_DRAW_BUFFERS 4
+#define V3D_MAX_ATTRIBUTES 16
 
 /* These are tunable parameters in the HW design, but all the V3D
  * implementations agree.
index 7ec687031d661637610c630f7b7cfb23982d71f8..5ad4710876f9e1a3b6a4857be94fa48892d2a1da 100644 (file)
@@ -317,7 +317,7 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d,
                         attr.maximum_index = 0xffffff;
 #endif
                 }
-                STATIC_ASSERT(sizeof(vtx->attrs) >= VC5_MAX_ATTRIBUTES * size);
+                STATIC_ASSERT(sizeof(vtx->attrs) >= V3D_MAX_ATTRIBUTES * size);
         }
 
         if (vtx->num_elements == 0) {
@@ -700,7 +700,7 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
                 rsc->initialized_buffers |= PIPE_CLEAR_STENCIL;
         }
 
-        for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+        for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 uint32_t bit = PIPE_CLEAR_COLOR0 << i;
                 int blend_rt = v3d->blend->base.independent_blend_enable ? i : 0;
 
@@ -780,7 +780,7 @@ v3d_tlb_clear(struct v3d_job *job, unsigned buffers,
                 buffers &= ~PIPE_CLEAR_DEPTHSTENCIL;
         }
 
-        for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+        for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 uint32_t bit = PIPE_CLEAR_COLOR0 << i;
                 if (!(buffers & bit))
                         continue;
index adaf5f6c1394b3d1930a44cc9b85d8f816d71d5f..2063f5e1162a0cb0ae89d54bdaf68b0eb69f1089 100644 (file)
@@ -291,7 +291,7 @@ emit_rt_blend(struct v3d_context *v3d, struct v3d_job *job,
                 if (blend->independent_blend_enable)
                         config.render_target_mask = 1 << rt;
                 else
-                        config.render_target_mask = (1 << VC5_MAX_DRAW_BUFFERS) - 1;
+                        config.render_target_mask = (1 << V3D_MAX_DRAW_BUFFERS) - 1;
 #else
                 assert(rt == 0);
 #endif
@@ -588,7 +588,7 @@ v3dX(emit_state)(struct pipe_context *pctx)
 #endif
 
                         if (blend->base.independent_blend_enable) {
-                                for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++)
+                                for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++)
                                         emit_rt_blend(v3d, job, &blend->base, i);
                         } else {
                                 emit_rt_blend(v3d, job, &blend->base, 0);
index 17750cc75f4d6664f9a93e93686ed970e2141d95..8706ac0fc3ff506376d424f990f17b1a4aa99f1e 100644 (file)
@@ -207,7 +207,7 @@ v3d_rcl_emit_loads(struct v3d_job *job, struct v3d_cl *cl)
 {
         uint32_t loads_pending = job->load;
 
-        for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+        for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 uint32_t bit = PIPE_CLEAR_COLOR0 << i;
                 if (!(loads_pending & bit))
                         continue;
@@ -305,7 +305,7 @@ v3d_rcl_emit_stores(struct v3d_job *job, struct v3d_cl *cl)
          * perspective.  Non-MSAA surfaces will use
          * STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_EXTENDED.
          */
-        for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+        for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 uint32_t bit = PIPE_CLEAR_COLOR0 << i;
                 if (!(job->store & bit))
                         continue;
@@ -507,7 +507,7 @@ v3dX(emit_rcl)(struct v3d_job *job)
         v3d_job_add_bo(job, job->rcl.bo);
 
         int nr_cbufs = 0;
-        for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+        for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 if (job->cbufs[i])
                         nr_cbufs = i + 1;
         }
index 5377f6173c33eee42331c2e863ddfa1bfaad58ce..b66569c25e721e8407635156f5365d1c43d24aa6 100644 (file)
@@ -78,7 +78,7 @@ static void
 v3d_set_sample_mask(struct pipe_context *pctx, unsigned sample_mask)
 {
         struct v3d_context *v3d = v3d_context(pctx);
-        v3d->sample_mask = sample_mask & ((1 << VC5_MAX_SAMPLES) - 1);
+        v3d->sample_mask = sample_mask & ((1 << V3D_MAX_SAMPLES) - 1);
         v3d->dirty |= VC5_DIRTY_SAMPLE_STATE;
 }
 
@@ -131,7 +131,7 @@ v3d_create_blend_state(struct pipe_context *pctx,
         so->base = *cso;
 
         if (cso->independent_blend_enable) {
-                for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+                for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                         so->blend_enables |= cso->rt[i].blend_enable << i;
 
                         /* V3D 4.x is when we got independent blend enables. */
@@ -140,7 +140,7 @@ v3d_create_blend_state(struct pipe_context *pctx,
                 }
         } else {
                 if (cso->rt[0].blend_enable)
-                        so->blend_enables = (1 << VC5_MAX_DRAW_BUFFERS) - 1;
+                        so->blend_enables = (1 << V3D_MAX_DRAW_BUFFERS) - 1;
         }
 
         return so;
@@ -407,10 +407,10 @@ v3d_vertex_state_create(struct pipe_context *pctx, unsigned num_elements,
          */
         uint32_t *attrs;
         u_upload_alloc(v3d->state_uploader, 0,
-                       VC5_MAX_ATTRIBUTES * 4 * sizeof(float), 16,
+                       V3D_MAX_ATTRIBUTES * 4 * sizeof(float), 16,
                        &so->defaults_offset, &so->defaults, (void **)&attrs);
 
-        for (int i = 0; i < VC5_MAX_ATTRIBUTES; i++) {
+        for (int i = 0; i < V3D_MAX_ATTRIBUTES; i++) {
                 attrs[i * 4 + 0] = 0;
                 attrs[i * 4 + 1] = 0;
                 attrs[i * 4 + 2] = 0;