[Bug 54570] New Prime bits cause a segfault during setup

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Sep 8 03:37:36 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=54570

--- Comment #8 from Mike Lothian <mike at fireburn.co.uk> 2012-09-08 10:37:36 UTC ---
With the next patch I again get a segfault:

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9b9fc83..6bb882b 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1553,7 +1553,8 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr
drmmode, int cpp)
     xf86ProviderSetup(pScrn, NULL, "radeon");
 #endif

-    xf86InitialConfiguration(pScrn, TRUE);
+    if (drmmode->mode_res->count_connectors != 0)
+        xf86InitialConfiguration(pScrn, TRUE);

     drmmode->event_context.version = DRM_EVENT_CONTEXT_VERSION;
     drmmode->event_context.vblank_handler = drmmode_vblank_handler;
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index e953082..af0ac88 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -954,7 +954,7 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
     if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE;
     }

-    if (pScrn->modes == NULL) {
+    if (!pScrn->is_gpu && pScrn->modes == NULL) {
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n");
       goto fail;
    }
@@ -1152,32 +1152,35 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
     xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "radeon_setup_kernel_mem failed\n");
     return FALSE;
     }
-    front_ptr = info->front_bo->ptr;

-    if (info->r600_shadow_fb) {
-    info->fb_shadow = calloc(1,
-                 pScrn->displayWidth * pScrn->virtualY *
-                 ((pScrn->bitsPerPixel + 7) >> 3));
-    if (info->fb_shadow == NULL) {
-        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                       "Failed to allocate shadow framebuffer\n");
-        info->r600_shadow_fb = FALSE;
-    } else {
-        if (!fbScreenInit(pScreen, info->fb_shadow,
-                  pScrn->virtualX, pScrn->virtualY,
-                  pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth,
-                  pScrn->bitsPerPixel))
-        return FALSE;
-    }
-    }
-
-    if (info->r600_shadow_fb == FALSE) {
-    /* Init fb layer */
-    if (!fbScreenInit(pScreen, front_ptr,
-              pScrn->virtualX, pScrn->virtualY,
-              pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth,
-              pScrn->bitsPerPixel))
-        return FALSE;
+    if (info->front_bo) {
+        front_ptr = info->front_bo->ptr;
+
+        if (info->r600_shadow_fb) {
+            info->fb_shadow = calloc(1,
+                         pScrn->displayWidth * pScrn->virtualY *
+                         ((pScrn->bitsPerPixel + 7) >> 3));
+            if (info->fb_shadow == NULL) {
+                xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                       "Failed to allocate shadow framebuffer\n");
+                info->r600_shadow_fb = FALSE;
+            } else {
+                if (!fbScreenInit(pScreen, info->fb_shadow,
+                          pScrn->virtualX, pScrn->virtualY,
+                          pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth,
+                          pScrn->bitsPerPixel))
+                    return FALSE;
+            }
+        }
+        
+        if (info->r600_shadow_fb == FALSE) {
+            /* Init fb layer */
+            if (!fbScreenInit(pScreen, front_ptr,
+                      pScrn->virtualX, pScrn->virtualY,
+                      pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth,
+                      pScrn->bitsPerPixel))
+                return FALSE;
+        }
     }

     xf86SetBlackWhitePixels(pScreen);
@@ -1427,6 +1430,9 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
     } else
         tiling_flags |= RADEON_TILING_MACRO;
     }
+
+    if (pScrn->is_gpu && !pScrn->virtualX && !pScrn->virtualY)
+        return;
     pitch = RADEON_ALIGN(pScrn->virtualX, drmmode_get_pitch_align(pScrn, cpp,
tiling_flags)) * cpp;
     screen_size = RADEON_ALIGN(pScrn->virtualY,
drmmode_get_height_align(pScrn, tiling_flags)) * pitch;
     base_align = drmmode_get_base_align(pScrn, cpp, tiling_flags);

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the xorg-driver-ati mailing list