i965: use context priority definitions from gen_defines.h
authorTapani Pälli <tapani.palli@intel.com>
Mon, 22 Jan 2018 06:22:53 +0000 (08:22 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Wed, 28 Feb 2018 12:36:57 +0000 (14:36 +0200)
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/mesa/drivers/dri/i965/brw_bufmgr.h
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/intel_screen.c

index 005ff19798e88234db49af9803b8c4507b0a3cb6..0f2badd00694f9e6821dd3cf6b217807ec10d601 100644 (file)
@@ -320,10 +320,6 @@ int brw_bo_wait(struct brw_bo *bo, int64_t timeout_ns);
 
 uint32_t brw_create_hw_context(struct brw_bufmgr *bufmgr);
 
-#define BRW_CONTEXT_LOW_PRIORITY ((I915_CONTEXT_MIN_USER_PRIORITY-1)/2)
-#define BRW_CONTEXT_MEDIUM_PRIORITY (I915_CONTEXT_DEFAULT_PRIORITY)
-#define BRW_CONTEXT_HIGH_PRIORITY ((I915_CONTEXT_MAX_USER_PRIORITY+1)/2)
-
 int brw_hw_context_set_priority(struct brw_bufmgr *bufmgr,
                                 uint32_t ctx_id,
                                 int priority);
index ea1c78d1fe6533c19c9238942fa51bd5b63b0fdd..b9c3fa27bf0616797a2ad7bd45f1482d24ad6ea2 100644 (file)
@@ -76,6 +76,8 @@
 #include "util/disk_cache.h"
 #include "isl/isl.h"
 
+#include "common/gen_defines.h"
+
 /***************************************
  * Mesa's Driver Functions
  ***************************************/
@@ -982,14 +984,14 @@ brwCreateContext(gl_api api,
          return false;
       }
 
-      int hw_priority = BRW_CONTEXT_MEDIUM_PRIORITY;
+      int hw_priority = GEN_CONTEXT_MEDIUM_PRIORITY;
       if (ctx_config->attribute_mask & __DRIVER_CONTEXT_ATTRIB_PRIORITY) {
          switch (ctx_config->priority) {
          case __DRI_CTX_PRIORITY_LOW:
-            hw_priority = BRW_CONTEXT_LOW_PRIORITY;
+            hw_priority = GEN_CONTEXT_LOW_PRIORITY;
             break;
          case __DRI_CTX_PRIORITY_HIGH:
-            hw_priority = BRW_CONTEXT_HIGH_PRIORITY;
+            hw_priority = GEN_CONTEXT_HIGH_PRIORITY;
             break;
          }
       }
index 9e0c15bad21bc9e29cf48b85f0e471b2def45003..dfb889221d84e23de17c1f96b413c2924a0ad796 100644 (file)
@@ -45,6 +45,8 @@
 #include "util/disk_cache.h"
 #include "util/xmlpool.h"
 
+#include "common/gen_defines.h"
+
 static const __DRIconfigOptionsExtension brw_config_options = {
    .base = { __DRI_CONFIG_OPTIONS, 1 },
    .xml =
@@ -1462,14 +1464,14 @@ brw_query_renderer_integer(__DRIscreen *dri_screen,
    case __DRI2_RENDERER_HAS_CONTEXT_PRIORITY:
       value[0] = 0;
       if (brw_hw_context_set_priority(screen->bufmgr,
-                                     0, BRW_CONTEXT_HIGH_PRIORITY) == 0)
+                                     0, GEN_CONTEXT_HIGH_PRIORITY) == 0)
          value[0] |= __DRI2_RENDERER_HAS_CONTEXT_PRIORITY_HIGH;
       if (brw_hw_context_set_priority(screen->bufmgr,
-                                     0, BRW_CONTEXT_LOW_PRIORITY) == 0)
+                                     0, GEN_CONTEXT_LOW_PRIORITY) == 0)
          value[0] |= __DRI2_RENDERER_HAS_CONTEXT_PRIORITY_LOW;
       /* reset to default last, just in case */
       if (brw_hw_context_set_priority(screen->bufmgr,
-                                     0, BRW_CONTEXT_MEDIUM_PRIORITY) == 0)
+                                     0, GEN_CONTEXT_MEDIUM_PRIORITY) == 0)
          value[0] |= __DRI2_RENDERER_HAS_CONTEXT_PRIORITY_MEDIUM;
       return 0;
    case __DRI2_RENDERER_HAS_FRAMEBUFFER_SRGB: