summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen6_urb.c
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2016-09-23 00:41:23 +0300
committerLionel Landwerlin <[email protected]>2016-09-23 10:12:06 +0300
commit94d0e7dc0848a5f70a550f2294e459eab51ace8f (patch)
treef68f3d9c195a32c881f500a87be7e72fb11a53c7 /src/mesa/drivers/dri/i965/gen6_urb.c
parentbc24590f0c579a2528fd94eb8d40dd4ce12eba29 (diff)
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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen6_urb.c')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_urb.c11
1 files changed, 6 insertions, 5 deletions
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);