[Mesa-dev] [PATCH 3/9] i965: Replace brw->gen and devinfo->gen with GEN_GEN.

Kenneth Graunke kenneth at whitecape.org
Thu May 11 23:32:00 UTC 2017


---
 src/mesa/drivers/dri/i965/genX_state_upload.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c
index 39801ecb259..a0695510b0c 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -1868,8 +1868,7 @@ const struct brw_tracked_state genX(cc_vp) = {
 
 #if GEN_GEN >= 6
 static void
-brw_calculate_guardband_size(const struct gen_device_info *devinfo,
-                             uint32_t fb_width, uint32_t fb_height,
+brw_calculate_guardband_size(uint32_t fb_width, uint32_t fb_height,
                              float m00, float m11, float m30, float m31,
                              float *xmin, float *xmax,
                              float *ymin, float *ymax)
@@ -1910,7 +1909,7 @@ brw_calculate_guardband_size(const struct gen_device_info *devinfo,
     *
     * So, limit the guardband to 16K on Gen7+ and 8K on Sandybridge.
     */
-   const float gb_size = devinfo->gen >= 7 ? 16384.0f : 8192.0f;
+   const float gb_size = GEN_GEN >= 7 ? 16384.0f : 8192.0f;
 
    if (m00 != 0 && m11 != 0) {
       /* First, we compute the screen-space render area */
@@ -1953,7 +1952,6 @@ genX(upload_sf_clip_viewport)(struct brw_context *brw)
 {
    struct gl_context *ctx = &brw->ctx;
    float y_scale, y_bias;
-   const struct gen_device_info *devinfo = &brw->screen->devinfo;
 
    /* BRW_NEW_VIEWPORT_COUNT */
    const unsigned viewport_count = brw->clip.viewport_count;
@@ -1999,7 +1997,7 @@ genX(upload_sf_clip_viewport)(struct brw_context *brw)
       sfv.ViewportMatrixElementm30 = translate[0],
       sfv.ViewportMatrixElementm31 = translate[1] * y_scale + y_bias,
       sfv.ViewportMatrixElementm32 = translate[2],
-      brw_calculate_guardband_size(devinfo, fb_width, fb_height,
+      brw_calculate_guardband_size(fb_width, fb_height,
                                    sfv.ViewportMatrixElementm00,
                                    sfv.ViewportMatrixElementm11,
                                    sfv.ViewportMatrixElementm30,
@@ -3093,7 +3091,7 @@ genX(upload_3dstate_so_buffers)(struct brw_context *brw)
 #else
    struct brw_transform_feedback_object *brw_obj =
       (struct brw_transform_feedback_object *) xfb_obj;
-   uint32_t mocs_wb = brw->gen >= 9 ? SKL_MOCS_WB : BDW_MOCS_WB;
+   uint32_t mocs_wb = GEN_GEN >= 9 ? SKL_MOCS_WB : BDW_MOCS_WB;
 #endif
 
    /* Set up the up to 4 output buffers.  These are the ranges defined in the
-- 
2.12.2



More information about the mesa-dev mailing list