gfx: drv: make page flip work on fb's with pvrBO null
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Wed, 26 Oct 2011 13:29:14 +0000 (16:29 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:28:21 +0000 (12:28 +0300)
The fb created in psbfb_create for stolen memory has a null
pvrBO. Make it possible to page flip a way from it.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
drivers/staging/mrst/drv/psb_page_flip.c

index dfde9b0..b66a3f1 100644 (file)
@@ -106,13 +106,17 @@ write_scanout_regs(struct pending_flip *pending_flip, uint32_t offset)
 static void
 increase_read_ops_pending(PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo)
 {
-       psKernelMemInfo->psKernelSyncInfo->psSyncData->ui32ReadOpsPending++;
+       if (psKernelMemInfo)
+               psKernelMemInfo->psKernelSyncInfo
+                       ->psSyncData->ui32ReadOpsPending++;
 }
 
 static void
 increase_read_ops_completed(PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo)
 {
-       psKernelMemInfo->psKernelSyncInfo->psSyncData->ui32ReadOpsComplete++;
+       if (psKernelMemInfo)
+               psKernelMemInfo->psKernelSyncInfo
+                       ->psSyncData->ui32ReadOpsComplete++;
 }
 
 static PVRSRV_KERNEL_MEM_INFO *
@@ -199,7 +203,6 @@ psb_intel_crtc_page_flip(struct drm_crtc *crtc,
 
        crtc->fb = fb;
 
-       BUG_ON(!current_fb_mem_info);
        new_pending_flip->old_mem_info = current_fb_mem_info;
 
        increase_read_ops_pending(current_fb_mem_info);