Merge remote branch 'origin/master' into radeon-rewrite
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_bo_legacy.c
index 71fe27609b36b42831f80b83e371ee1c191b8f9d..1d25887e6913dfa6d8d2276c139664257bc7f6f5 100644 (file)
@@ -45,9 +45,9 @@
 
 #include "drm.h"
 #include "radeon_drm.h"
-#include "radeon_bo.h"
-#include "radeon_bo_legacy.h"
-#include "common_context.h"
+#include "radeon_common.h"
+#include "radeon_bocs_wrapper.h"
+
 
 struct bo_legacy {
     struct radeon_bo    base;
@@ -260,7 +260,10 @@ static struct bo_legacy *bo_allocate(struct bo_manager_legacy *boml,
                                      uint32_t flags)
 {
     struct bo_legacy *bo_legacy;
-    uint32_t pgsize = getpagesize() - 1;
+    static int pgsize;
+
+    if (pgsize == 0)
+        pgsize = getpagesize() - 1;
 
     size = (size + pgsize) & ~pgsize;
 
@@ -479,7 +482,7 @@ static int bo_map(struct radeon_bo *bo, int write)
      * framebuffer, but I've found this to be unnecessary.
      *  -- Nicolai Hähnle, June 2008
      */
-    {
+    if (!(bo->domains & RADEON_GEM_DOMAIN_GTT)) {
         int p;
         volatile int *buf = (int*)boml->screen->driScreen->pFB;
         p = *buf;