summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/drm/radeon/radeon_ttm.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_ttm.c b/sys/dev/pci/drm/radeon/radeon_ttm.c
index 0ce9fed2931..faf9f8310e8 100644
--- a/sys/dev/pci/drm/radeon/radeon_ttm.c
+++ b/sys/dev/pci/drm/radeon/radeon_ttm.c
@@ -39,6 +39,14 @@
#include "radeon_reg.h"
#include "radeon.h"
+#ifdef __amd64__
+#include "efifb.h"
+#endif
+
+#if NEFIFB > 0
+#include <machine/efifbvar.h>
+#endif
+
#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
static int radeon_ttm_debugfs_init(struct radeon_device *rdev);
@@ -923,6 +931,13 @@ static struct ttm_bo_driver radeon_bo_driver = {
int radeon_ttm_init(struct radeon_device *rdev)
{
int r;
+ unsigned long stolen_size = 0;
+
+#if NEFIFB > 0
+ stolen_size = efifb_stolen();
+#endif
+ if (stolen_size == 0)
+ stolen_size = 256 * 1024;
r = radeon_ttm_global_init(rdev);
if (r) {
@@ -966,7 +981,7 @@ int radeon_ttm_init(struct radeon_device *rdev)
RADEON_GEM_DOMAIN_VRAM, 0, NULL,
NULL, &rdev->stollen_vga_memory);
#else
- r = radeon_bo_create(rdev, 256 * 1024, PAGE_SIZE, true,
+ r = radeon_bo_create(rdev, stolen_size, PAGE_SIZE, true,
RADEON_GEM_DOMAIN_VRAM, 0, NULL,
NULL, &rdev->stollen_vga_memory);
#endif