summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-03-09 02:00:46 +0800
committerChia-I Wu <[email protected]>2014-03-10 16:42:42 +0800
commita434ac045eb2e0333ee8bb6e44aa0a46de2e7438 (patch)
treeb7af34b87ea3eec4a5ffcf0a375078084306c6bc /src/gallium/winsys
parent249b1ad98440fee5174aa490e7c3269b88de8904 (diff)
ilo: PIPE_CAP_QUERY_TIMESTAMP may not be supported
Reading TIMESTAMP register may fail, depending on both kernel and hardware.
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/intel/drm/intel_drm_winsys.c11
-rw-r--r--src/gallium/winsys/intel/intel_winsys.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/winsys/intel/drm/intel_drm_winsys.c b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
index 12ed2e43355..bd805fdb786 100644
--- a/src/gallium/winsys/intel/drm/intel_drm_winsys.c
+++ b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
@@ -100,6 +100,14 @@ test_address_swizzling(struct intel_winsys *winsys)
}
static bool
+test_reg_read(struct intel_winsys *winsys, uint32_t reg)
+{
+ uint64_t dummy;
+
+ return !drm_intel_reg_read(winsys->bufmgr, reg, &dummy);
+}
+
+static bool
init_info(struct intel_winsys *winsys)
{
struct intel_winsys_info *info = &winsys->info;
@@ -130,6 +138,9 @@ init_info(struct intel_winsys *winsys)
get_param(winsys, I915_PARAM_HAS_LLC, &val);
info->has_llc = val;
+ /* test TIMESTAMP read */
+ info->has_timestamp = test_reg_read(winsys, 0x2358);
+
get_param(winsys, I915_PARAM_HAS_GEN7_SOL_RESET, &val);
info->has_gen7_sol_reset = val;
diff --git a/src/gallium/winsys/intel/intel_winsys.h b/src/gallium/winsys/intel/intel_winsys.h
index e84c9600c35..15f1aec1093 100644
--- a/src/gallium/winsys/intel/intel_winsys.h
+++ b/src/gallium/winsys/intel/intel_winsys.h
@@ -69,9 +69,13 @@ struct intel_bo;
struct intel_winsys_info {
int devid;
+
bool has_llc;
bool has_gen7_sol_reset;
bool has_address_swizzling;
+
+ /* valid registers for intel_winsys_read_reg() */
+ bool has_timestamp;
};
struct intel_winsys *