{
struct fd_screen *screen = fd_screen(pscreen);
struct pipe_context *pctx;
- unsigned prio = 1;
+ unsigned prio = screen->prio_norm;
/* lower numerical value == higher priority: */
if (FD_DBG(HIPRIO))
- prio = 0;
+ prio = screen->prio_high;
else if (flags & PIPE_CONTEXT_HIGH_PRIORITY)
- prio = 0;
+ prio = screen->prio_high;
else if (flags & PIPE_CONTEXT_LOW_PRIORITY)
- prio = 2;
+ prio = screen->prio_low;
/* Some of the stats will get printed out at context destroy, so
* make sure they are collected:
} else {
/* # of rings equates to number of unique priority values: */
screen->priority_mask = (1 << val) - 1;
+
+ /* Lowest numerical value (ie. zero) is highest priority: */
+ screen->prio_high = 0;
+
+ /* Highest numerical value is lowest priority: */
+ screen->prio_low = val - 1;
+
+ /* Pick midpoint for normal priority.. note that whatever the
+ * range of possible priorities, since we divide by 2 the
+ * result will either be an integer or an integer plus 0.5,
+ * in which case it will round down to an integer, so int
+ * division will give us an appropriate result in either
+ * case:
+ */
+ screen->prio_norm = val / 2;
}
if (fd_device_version(dev) >= FD_VERSION_ROBUSTNESS)