Module: Mesa
Branch: main
Commit: b7c35f59986f8bd15d197bf3e269706ec6c31830
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b7c35f59986f8bd15d197bf3e269706ec6c31830

Author: Alejandro PiƱeiro <[email protected]>
Date:   Mon May 22 23:39:10 2023 +0200

v3d: use more an auxiliar devinfo

Improve readability by using an auxiliar
        struct v3d_device_info *devinfo = &screen->devinfo;

this was triggered by the use of the v3d_X macro, where just having a
devinfo makes is more friendly. As we are here, we used it on other
places of the code.

Acked-by: Iago Toral Quiroga <[email protected]>
Reviewed-by: Juan A. Suarez <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23172>

---

 src/gallium/drivers/v3d/v3d_blit.c    | 13 +++++++------
 src/gallium/drivers/v3d/v3d_context.c |  5 +++--
 src/gallium/drivers/v3d/v3d_job.c     |  7 ++++---
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/v3d/v3d_blit.c 
b/src/gallium/drivers/v3d/v3d_blit.c
index 0b0990c75b5..bbb644fa73a 100644
--- a/src/gallium/drivers/v3d/v3d_blit.c
+++ b/src/gallium/drivers/v3d/v3d_blit.c
@@ -432,8 +432,9 @@ v3d_tlb_blit(struct pipe_context *pctx, struct 
pipe_blit_info *info)
 {
         struct v3d_context *v3d = v3d_context(pctx);
         struct v3d_screen *screen = v3d->screen;
+        struct v3d_device_info *devinfo = &screen->devinfo;
 
-        if (screen->devinfo.ver < 40 || !info->mask)
+        if (devinfo->ver < 40 || !info->mask)
                 return;
 
         bool is_color_blit = info->mask & PIPE_MASK_RGBA;
@@ -459,11 +460,11 @@ v3d_tlb_blit(struct pipe_context *pctx, struct 
pipe_blit_info *info)
             util_format_is_depth_or_stencil(info->dst.format))
                 return;
 
-        if (!v3d_rt_format_supported(&screen->devinfo, info->src.format))
+        if (!v3d_rt_format_supported(devinfo, info->src.format))
                 return;
 
-        if (v3d_get_rt_format(&screen->devinfo, info->src.format) !=
-            v3d_get_rt_format(&screen->devinfo, info->dst.format))
+        if (v3d_get_rt_format(devinfo, info->src.format) !=
+            v3d_get_rt_format(devinfo, info->dst.format))
                 return;
 
         bool msaa = (info->src.resource->nr_samples > 1 ||
@@ -472,7 +473,7 @@ v3d_tlb_blit(struct pipe_context *pctx, struct 
pipe_blit_info *info)
                                 info->dst.resource->nr_samples < 2);
 
         if (is_msaa_resolve &&
-            !v3d_format_supports_tlb_msaa_resolve(&screen->devinfo, 
info->src.format))
+            !v3d_format_supports_tlb_msaa_resolve(devinfo, info->src.format))
                 return;
 
         v3d_flush_jobs_writing_resource(v3d, info->src.resource, 
V3D_FLUSH_DEFAULT, false);
@@ -554,7 +555,7 @@ v3d_tlb_blit(struct pipe_context *pctx, struct 
pipe_blit_info *info)
                 info->mask &= ~PIPE_MASK_S;
         }
 
-        v3d_X(&v3d->screen->devinfo, start_binning)(v3d, job);
+        v3d_X(devinfo, start_binning)(v3d, job);
 
         v3d_job_submit(v3d, job);
 
diff --git a/src/gallium/drivers/v3d/v3d_context.c 
b/src/gallium/drivers/v3d/v3d_context.c
index 2a3324b8796..a28be460e7a 100644
--- a/src/gallium/drivers/v3d/v3d_context.c
+++ b/src/gallium/drivers/v3d/v3d_context.c
@@ -343,6 +343,7 @@ v3d_context_create(struct pipe_screen *pscreen, void *priv, 
unsigned flags)
 {
         struct v3d_screen *screen = v3d_screen(pscreen);
         struct v3d_context *v3d;
+        struct v3d_device_info *devinfo = &screen->devinfo;
 
         /* Prevent dumping of the shaders built during context setup. */
         uint32_t saved_shaderdb_flag = v3d_mesa_debug & V3D_DEBUG_SHADERDB;
@@ -371,8 +372,8 @@ v3d_context_create(struct pipe_screen *pscreen, void *priv, 
unsigned flags)
         pctx->invalidate_resource = v3d_invalidate_resource;
         pctx->get_sample_position = v3d_get_sample_position;
 
-        v3d_X(&screen->devinfo, draw_init)(pctx);
-        v3d_X(&screen->devinfo, state_init)(pctx);
+        v3d_X(devinfo, draw_init)(pctx);
+        v3d_X(devinfo, state_init)(pctx);
         v3d_program_init(pctx);
         v3d_query_init(pctx);
         v3d_resource_context_init(pctx);
diff --git a/src/gallium/drivers/v3d/v3d_job.c 
b/src/gallium/drivers/v3d/v3d_job.c
index 10c7861d8ce..43ae7206808 100644
--- a/src/gallium/drivers/v3d/v3d_job.c
+++ b/src/gallium/drivers/v3d/v3d_job.c
@@ -493,6 +493,7 @@ void
 v3d_job_submit(struct v3d_context *v3d, struct v3d_job *job)
 {
         struct v3d_screen *screen = v3d->screen;
+        struct v3d_device_info *devinfo = &screen->devinfo;
 
         if (!job->needs_flush)
                 goto done;
@@ -507,10 +508,10 @@ v3d_job_submit(struct v3d_context *v3d, struct v3d_job 
*job)
         if (job->needs_primitives_generated)
                 v3d_ensure_prim_counts_allocated(v3d);
 
-        v3d_X(&screen->devinfo, emit_rcl)(job);
+        v3d_X(devinfo, emit_rcl)(job);
 
         if (cl_offset(&job->bcl) > 0)
-                v3d_X(&screen->devinfo, bcl_epilogue)(v3d, job);
+                v3d_X(devinfo, bcl_epilogue)(v3d, job);
 
         /* While the RCL will implicitly depend on the last RCL to have
          * finished, we also need to block on any previous TFU job we may have
@@ -545,7 +546,7 @@ v3d_job_submit(struct v3d_context *v3d, struct v3d_job *job)
         /* On V3D 4.1, the tile alloc/state setup moved to register writes
          * instead of binner packets.
          */
-        if (screen->devinfo.ver >= 41) {
+        if (devinfo->ver >= 41) {
                 v3d_job_add_bo(job, job->tile_alloc);
                 job->submit.qma = job->tile_alloc->offset;
                 job->submit.qms = job->tile_alloc->size;

Reply via email to