diff options
Diffstat (limited to 'src/mali_fbdev.c')
-rw-r--r-- | src/mali_fbdev.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mali_fbdev.c b/src/mali_fbdev.c index fecbd7e..be717e7 100644 --- a/src/mali_fbdev.c +++ b/src/mali_fbdev.c @@ -893,6 +893,7 @@ static Bool MaliPreInit(ScrnInfoPtr pScrn, int flags) fPtr->dri_render = DRI_NONE; fPtr->use_pageflipping = FALSE; fPtr->use_pageflipping_vsync = FALSE; + fPtr->hwmem_fd = 0; /* open device */ if ( !MaliHWInit( pScrn, xf86FindOptionValue( fPtr->pEnt->device->options,"fbdev" ) ) ) return FALSE; @@ -1037,6 +1038,12 @@ static Bool MaliScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **ar else xf86DrvMsg(scrnIndex,X_ERROR,"DRI2 initialization failed\n"); } + if (0 == (fPtr->hwmem_fd = open("/dev/hwmem", O_RDWR))) + { + xf86DrvMsg(scrnIndex,X_ERROR,"opening of hwmem device file failed\n"); + return FALSE; + } + if (NULL == (fPtr->fbmem = MaliHWMapVidmem(pScrn))) { xf86DrvMsg(scrnIndex,X_ERROR,"mapping of video memory failed\n"); @@ -1191,6 +1198,12 @@ static Bool MaliCloseScreen(int scrnIndex, ScreenPtr pScreen) mali_drm_close_master( pScrn ); } + if ( fPtr->hwmem_fd ) + { + close(fPtr->hwmem_fd); + fPtr->hwmem_fd = 0; + } + return TRUE; } |