summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-08-14 20:46:29 +0100
committerEmil Velikov <[email protected]>2014-08-15 17:42:47 +0100
commitcc313b3ffeb1315dfa6a088da7f5f177aff9d192 (patch)
treeff9505628b9b0248cc667a046f7b7c778dfde071 /src/gallium/drivers
parent5b9cb1329557cc17e1533aed7c63e1252658d74b (diff)
gallium/ilo: handle query_renderer caps
Implementation based on the classic driver with the following changes: - Use auxiliarry function os_get_total_physical_memory to get the total amount of memory. - Move the libdrm_intel specific get_aperture_size to the winsys. Cc: Chia-I Wu <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/i915/i915_screen.c2
-rw-r--r--src/gallium/drivers/ilo/ilo_screen.c24
2 files changed, 25 insertions, 1 deletions
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 3af0b151b5a..0dfd3bb7b1f 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -301,7 +301,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
if (!os_get_total_physical_memory(&system_memory))
return 0;
- return MIN2(gpu_mappable_megabytes, (int) (system_memory >> 20));
+ return MIN2(gpu_mappable_megabytes, (int)(system_memory >> 20));
}
case PIPE_CAP_UMA:
return 1;
diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c
index 991d2d0de36..ad59d6dfb94 100644
--- a/src/gallium/drivers/ilo/ilo_screen.c
+++ b/src/gallium/drivers/ilo/ilo_screen.c
@@ -25,6 +25,7 @@
* Chia-I Wu <[email protected]>
*/
+#include "os/os_misc.h"
#include "util/u_format_s3tc.h"
#include "vl/vl_decoder.h"
#include "vl/vl_video_buffer.h"
@@ -436,6 +437,29 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
return 0;
+ case PIPE_CAP_VENDOR_ID:
+ return 0x8086;
+ case PIPE_CAP_DEVICE_ID:
+ return is->dev.devid;
+ case PIPE_CAP_ACCELERATED:
+ return true;
+ case PIPE_CAP_VIDEO_MEMORY: {
+ /* Once a batch uses more than 75% of the maximum mappable size, we
+ * assume that there's some fragmentation, and we start doing extra
+ * flushing, etc. That's the big cliff apps will care about.
+ */
+ const int gpu_mappable_megabytes =
+ intel_winsys_get_aperture_size(is->winsys) * 3 / 4;
+ uint64_t system_memory;
+
+ if (!os_get_total_physical_memory(&system_memory))
+ return 0;
+
+ return MIN2(gpu_mappable_megabytes, (int)(system_memory >> 20));
+ }
+ case PIPE_CAP_UMA:
+ return true;
+
default:
return 0;
}