summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-08-15 20:07:09 +0100
committerEmil Velikov <[email protected]>2014-08-15 23:42:10 +0100
commit1e1d2857011cce13c1d67eec6711381debcd26f3 (patch)
tree2519fe55950341c974d1acba8a9f5252eb5e7385 /src/gallium/drivers
parent7c65b714ed974248f09dcc0b4f020b2e2bf50227 (diff)
gallium/vc4: PIPE_CAP_VIDEO_MEMORY return the amount of system ram
Suggested-by: Eric Anholt <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index da68f72c73b..852ff871322 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -24,6 +24,7 @@
#include <stdio.h>
+#include "os/os_misc.h"
#include "pipe/p_defines.h"
#include "pipe/p_screen.h"
#include "pipe/p_state.h"
@@ -207,9 +208,14 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return 0xFFFFFFFF;
case PIPE_CAP_ACCELERATED:
return 1;
- case PIPE_CAP_VIDEO_MEMORY:
- fprintf(stderr, "FINISHME: The value returned is incorrect\n");
- return 10;
+ case PIPE_CAP_VIDEO_MEMORY: {
+ uint64_t system_memory;
+
+ if (!os_get_total_physical_memory(&system_memory))
+ return 0;
+
+ return (int)(system_memory >> 20);
+ }
case PIPE_CAP_UMA:
return 1;