Suggested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
#include <stdio.h>
+#include "os/os_misc.h"
#include "pipe/p_defines.h"
#include "pipe/p_screen.h"
#include "pipe/p_state.h"
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;