Ejemplo n.º 1
0
void RkDispHardwareCursor_Init(ScreenPtr pScreen)
{
    xf86CursorInfoPtr InfoPtr;
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    FBDevPtr pMxv = FBDEVPTR(pScrn);
    pMxv->RkHWC = NULL;
    int fd;

    fd = fbdevHWGetFD(pScrn);
    if (fd <= 0){
    	ERRMSG("DispHardwareCursor_Init fd error");
    	return;
    }

    if (!(InfoPtr = xf86CreateCursorInfoRec())) {
    	ERRMSG("DispHardwareCursor_Init: xf86CreateCursorInfoRec() failed");
        return;
    }

    InfoPtr->ShowCursor = ShowCursor;
    InfoPtr->HideCursor = HideCursor;
    InfoPtr->SetCursorPosition = SetCursorPosition;
    InfoPtr->SetCursorColors = SetCursorColors;
    InfoPtr->LoadCursorImage = LoadCursorImage;
    InfoPtr->MaxWidth = 32;
    InfoPtr->MaxHeight = 32;
//    InfoPtr->RealizeCursor
    InfoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1;

    if (!xf86InitCursor(pScreen, InfoPtr)) {
    	ERRMSG("DispHardwareCursor_Init: xf86InitCursor(pScreen, InfoPtr) failed");
        xf86DestroyCursorInfoRec(InfoPtr);
        goto err;
    }

    pMxv->RkHWC = calloc(1, sizeof(RkDispHWCRec));
    if (!pMxv->RkHWC) {
    	ERRMSG("DispHardwareCursor_Init: calloc failed");
        xf86DestroyCursorInfoRec(InfoPtr);
        goto err;
    }
    RkDispHWCPtr HWC = pMxv->RkHWC;

    INFMSG("HWCursor activated");
    HWC->hwcursor = InfoPtr;
    HWC->fb_fd = fd;
    return;
//******************not ok*************
err:
    xf86DestroyCursorInfoRec(InfoPtr);
}
Ejemplo n.º 2
0
void RkDispHardwareCursor_Close(ScreenPtr pScreen)
{
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    FBDevPtr pMxv = FBDEVPTR(pScrn);

    if (pMxv->RkHWC) {
    	RkDispHWCPtr HWC = pMxv->RkHWC;
        xf86DestroyCursorInfoRec(HWC->hwcursor);
        MFREE(HWC);
    }
}
Ejemplo n.º 3
0
void
RenditionHWCursorRelease (ScrnInfoPtr pScreenInfo)
{
    renditionPtr pRendition = RENDITIONPTR(pScreenInfo);

#ifdef DEBUG
    ErrorF ("Rendition: Debug RenditionHWCursorRelease called\n");
#endif

    xf86DestroyCursorInfoRec(pRendition->CursorInfoRec);
    pRendition->CursorInfoRec=NULL;
}
Ejemplo n.º 4
0
void Rk30DispHardwareCursor_Close(ScreenPtr pScreen)
{
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    FBDevPtr pMxv = FBDEVPTR(pScrn);

    if (pMxv->Rk30HWC) {
    Rk30DispHWCPtr HWC = pMxv->Rk30HWC;
        xf86DestroyCursorInfoRec(HWC->hwcursor);
    close(HWC->fb_fd);
        free(HWC);
    HWC = NULL;
    }
}
Ejemplo n.º 5
0
/**
 * Clean up CRTC-based cursor code
 */
void
xf86_cursors_fini(ScreenPtr screen)
{
    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
    xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);

    if (xf86_config->cursor_info) {
        xf86DestroyCursorInfoRec(xf86_config->cursor_info);
        xf86_config->cursor_info = NULL;
    }
    free(xf86_config->cursor_image);
    xf86_config->cursor_image = NULL;
    xf86_config->cursor = NULL;
}
Ejemplo n.º 6
0
/**
 * Clean up CRTC-based cursor code
 */
void
xf86_cursors_fini(ScreenPtr screen)
{
    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
    xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);

    if (xf86_config->cursor_info) {
        xf86DestroyCursorInfoRec(xf86_config->cursor_info);
        xf86_config->cursor_info = NULL;
    }
    free(xf86_config->cursor_image);
    xf86_config->cursor_image = NULL;
    if (xf86_config->cursor) {
        FreeCursor(xf86_config->cursor, None);
        xf86_config->cursor = NULL;
    }
}
Ejemplo n.º 7
0
Bool
vmwareCursorInit(ScreenPtr pScreen)
{
    xf86CursorInfoPtr infoPtr;
    VMWAREPtr pVMWARE = VMWAREPTR(infoFromScreen(pScreen));
    Bool ret;

    TRACEPOINT

    /* Require cursor bypass for hwcursor.  Ignore deprecated FIFO hwcursor */
    if (!(pVMWARE->vmwareCapability & SVGA_CAP_CURSOR_BYPASS)) {
        return FALSE;
    }

    infoPtr = xf86CreateCursorInfoRec();
    if (!infoPtr) 
        return FALSE;

    pVMWARE->CursorInfoRec = infoPtr;

    infoPtr->MaxWidth = MAX_CURS;
    infoPtr->MaxHeight = MAX_CURS;
    infoPtr->Flags = HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
                     HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED;
    infoPtr->SetCursorColors = vmwareSetCursorColors;
    infoPtr->SetCursorPosition = vmwareSetCursorPosition;
    infoPtr->LoadCursorImage = vmwareLoadCursorImage;
    infoPtr->HideCursor = vmwareHideCursor;
    infoPtr->ShowCursor = vmwareShowCursor;
    infoPtr->UseHWCursor = vmwareUseHWCursor;

#ifdef ARGB_CURSOR
    if (pVMWARE->vmwareCapability & SVGA_CAP_ALPHA_CURSOR) {
        infoPtr->UseHWCursorARGB = vmwareUseHWCursorARGB;
        infoPtr->LoadCursorARGB = vmwareLoadCursorARGB;
    }
#endif

    ret = xf86InitCursor(pScreen, infoPtr);
    if (!ret) {
        xf86DestroyCursorInfoRec(infoPtr);
        pVMWARE->CursorInfoRec = NULL;
    }
    return ret;
}
Bool
xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags)
{
    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
    xf86CursorInfoPtr	cursor_info;

    cursor_info = xf86CreateCursorInfoRec();
    if (!cursor_info)
	return FALSE;

    xf86_config->cursor_image = malloc(max_width * max_height * 4);

    if (!xf86_config->cursor_image)
    {
	xf86DestroyCursorInfoRec (cursor_info);
	return FALSE;
    }
	
    xf86_config->cursor_info = cursor_info;

    cursor_info->MaxWidth = max_width;
    cursor_info->MaxHeight = max_height;
    cursor_info->Flags = flags;

    cursor_info->SetCursorColors = xf86_set_cursor_colors;
    cursor_info->SetCursorPosition = xf86_set_cursor_position;
    cursor_info->LoadCursorImage = xf86_load_cursor_image;
    cursor_info->HideCursor = xf86_hide_cursors;
    cursor_info->ShowCursor = xf86_show_cursors;
    cursor_info->UseHWCursor = xf86_use_hw_cursor;
#ifdef ARGB_CURSOR
    if (flags & HARDWARE_CURSOR_ARGB)
    {
	cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb;
	cursor_info->LoadCursorARGB = xf86_load_cursor_argb;
    }
#endif
    
    xf86_config->cursor = NULL;
    xf86_hide_cursors (scrn);
    
    return xf86InitCursor (screen, cursor_info);
}
Ejemplo n.º 9
0
void
vmwareCursorCloseScreen(ScreenPtr pScreen)
{
    ScrnInfoPtr pScrn = infoFromScreen(pScreen);
    VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
#ifdef RENDER
    PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
#endif
    
    pScreen->GetImage = pVMWARE->ScrnFuncs.GetImage;
    pScreen->CopyWindow = pVMWARE->ScrnFuncs.CopyWindow;
#ifdef RENDER
    if (ps) {
        ps->Composite = pVMWARE->Composite;
    }
#endif /* RENDER */

    vmwareHideCursor(pScrn);
    xf86DestroyCursorInfoRec(pVMWARE->CursorInfoRec);
}
Ejemplo n.º 10
0
void Rk30DispHardwareCursor_Init(ScreenPtr pScreen, const char *device)
{
    xf86CursorInfoPtr InfoPtr;
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    FBDevPtr pMxv = FBDEVPTR(pScrn);

    pMxv->Rk30HWC = NULL;

    if(NULL == pMxv->OvlHW){
    xf86DrvMsg( pScreen->myNum, X_ERROR, "DispHardwareCursor_Init: Not found overlay\n");
    return;
    }

    OvlHWPtr    overlay = pMxv->OvlHW;

    if (!(InfoPtr = xf86CreateCursorInfoRec())) {
        xf86DrvMsg( pScreen->myNum, X_ERROR, "DispHardwareCursor_Init: xf86CreateCursorInfoRec() failed\n");
        return;
    }

    InfoPtr->ShowCursor = ShowCursor;
    InfoPtr->HideCursor = HideCursor;
    InfoPtr->SetCursorPosition = SetCursorPosition;
    InfoPtr->SetCursorColors = SetCursorColors;
    InfoPtr->LoadCursorImage = LoadCursorImage;
    InfoPtr->MaxWidth = InfoPtr->MaxHeight = 32;
    InfoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
                     HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 |
                     HARDWARE_CURSOR_ARGB;

    if (!xf86InitCursor(pScreen, InfoPtr)) {
    xf86DrvMsg(pScreen->myNum, X_ERROR, "DispHardwareCursor_Init: xf86InitCursor(pScreen, InfoPtr) failed\n");
        xf86DestroyCursorInfoRec(InfoPtr);
        goto err;
    }

    pMxv->Rk30HWC = calloc(1, sizeof(Rk30DispHWCRec));
    if (!pMxv->Rk30HWC) {
        xf86DrvMsg( pScreen->myNum, X_ERROR, "DispHardwareCursor_Init: calloc failed\n");
        xf86DestroyCursorInfoRec(InfoPtr);
        goto err;
    }
    Rk30DispHWCPtr HWC = pMxv->Rk30HWC;

    HWC->fb_fd = open(device, O_RDWR);
    if (HWC->fb_fd < 0) {
        xf86DrvMsg( pScreen->myNum, X_ERROR, "DispHardwareCursor_Init: open: %s failed\n",device);
//    close(HWC->fb_fd);
        free(HWC);
        goto err;
    }
//    private->cursor_enabled = 0;
//    private->cursor_x = -1;
//    private->cursor_y = -1;

    xf86DrvMsg(pScreen->myNum, X_INFO, "Enabled hardware cursor\n");
    HWC->hwcursor = InfoPtr;
    return;
//******************not ok*************
err:
    xf86DestroyCursorInfoRec(InfoPtr);
}