From 94d0e7dc0848a5f70a550f2294e459eab51ace8f Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Fri, 23 Sep 2016 00:41:23 +0300 Subject: i965: get rid of duplicated values from gen_device_info Now that we have gen_device_info mutable, we can update its values and drop all copies we had in brw_context. Signed-off-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/gen6_urb.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mesa/drivers/dri/i965/gen6_urb.c') diff --git a/src/mesa/drivers/dri/i965/gen6_urb.c b/src/mesa/drivers/dri/i965/gen6_urb.c index 4370fedb820..df12ea66fe9 100644 --- a/src/mesa/drivers/dri/i965/gen6_urb.c +++ b/src/mesa/drivers/dri/i965/gen6_urb.c @@ -52,6 +52,7 @@ gen6_upload_urb(struct brw_context *brw, unsigned vs_size, { int nr_vs_entries, nr_gs_entries; int total_urb_size = brw->urb.size * 1024; /* in bytes */ + const struct gen_device_info *devinfo = &brw->screen->devinfo; /* Calculate how many entries fit in each stage's section of the URB */ if (gs_present) { @@ -63,17 +64,17 @@ gen6_upload_urb(struct brw_context *brw, unsigned vs_size, } /* Then clamp to the maximum allowed by the hardware */ - if (nr_vs_entries > brw->urb.max_vs_entries) - nr_vs_entries = brw->urb.max_vs_entries; + if (nr_vs_entries > devinfo->urb.max_vs_entries) + nr_vs_entries = devinfo->urb.max_vs_entries; - if (nr_gs_entries > brw->urb.max_gs_entries) - nr_gs_entries = brw->urb.max_gs_entries; + if (nr_gs_entries > devinfo->urb.max_gs_entries) + nr_gs_entries = devinfo->urb.max_gs_entries; /* Finally, both must be a multiple of 4 (see 3DSTATE_URB in the PRM). */ brw->urb.nr_vs_entries = ROUND_DOWN_TO(nr_vs_entries, 4); brw->urb.nr_gs_entries = ROUND_DOWN_TO(nr_gs_entries, 4); - assert(brw->urb.nr_vs_entries >= brw->urb.min_vs_entries); + assert(brw->urb.nr_vs_entries >= devinfo->urb.min_vs_entries); assert(brw->urb.nr_vs_entries % 4 == 0); assert(brw->urb.nr_gs_entries % 4 == 0); assert(vs_size <= 5); -- cgit v1.2.3