diff options
author | Jordan Crouse <jordan.crouse@amd.com> | 2008-08-07 11:21:48 -0600 |
---|---|---|
committer | Jordan Crouse <jordan.crouse@amd.com> | 2008-08-07 11:21:48 -0600 |
commit | d681a844e448712a9a419d2a4dca81930d39a80a (patch) | |
tree | 09079ad5f93174e991a1da09a38d2aad53515cf9 /src/lx_cursor.c | |
parent | e98927f2c60acd9262cfb6fca2491fe0decc7aa5 (diff) |
[LX] - Add RandR 1.2 support
A wholesale update to Randr 1.2 for LX accompanied by massive
cleanup.
Diffstat (limited to 'src/lx_cursor.c')
-rw-r--r-- | src/lx_cursor.c | 129 |
1 files changed, 6 insertions, 123 deletions
diff --git a/src/lx_cursor.c b/src/lx_cursor.c index f97c271..61bee04 100644 --- a/src/lx_cursor.c +++ b/src/lx_cursor.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2003-2007 Advanced Micro Devices, Inc. +/* Copyright (c) 2003-2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -28,112 +28,16 @@ #endif #include "xf86.h" -#include "xf86_OSproc.h" -#include "xf86Pci.h" -#include "xf86PciInfo.h" +#include "xf86Crtc.h" #include "geode.h" -/* Forward declarations of the functions */ -static void LXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg); -static void LXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y); -static Bool LXUseHWCursor(ScreenPtr pScrn, CursorPtr pCurs); -extern void LXSetVideoPosition(int x, int y, int width, int height, - short src_w, short src_h, short drw_w, - short drw_h, int id, int offset, ScrnInfoPtr pScrn); - Bool -LXHWCursorInit(ScreenPtr pScrn) +LXCursorInit(ScreenPtr pScrn) { - ScrnInfoPtr pScrni = xf86Screens[pScrn->myNum]; - GeodeRec *pGeode = GEODEPTR(pScrni); - xf86CursorInfoPtr infoPtr; - - infoPtr = xf86CreateCursorInfoRec(); - if (!infoPtr) - return FALSE; - /* the geode structure is intiallized with the cursor infoRec */ - pGeode->CursorInfo = infoPtr; - infoPtr->MaxWidth = 32; - infoPtr->MaxHeight = 32; - /* seeting up the cursor flags */ - infoPtr->Flags = HARDWARE_CURSOR_BIT_ORDER_MSBFIRST | + return xf86_cursors_init(pScrn, 32, 32, + HARDWARE_CURSOR_BIT_ORDER_MSBFIRST | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | - HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED; - - infoPtr->SetCursorColors = LXSetCursorColors; - infoPtr->SetCursorPosition = LXSetCursorPosition; - infoPtr->LoadCursorImage = LXLoadCursorImage; - infoPtr->HideCursor = LXHideCursor; - infoPtr->ShowCursor = LXShowCursor; - infoPtr->UseHWCursor = LXUseHWCursor; - - return (xf86InitCursor(pScrn, infoPtr)); -} - -static void -LXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg) -{ - vg_set_mono_cursor_colors(bg, fg); -} - -static void -LXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y) -{ - GeodeRec *pGeode = GEODEPTR(pScrni); - int savex, savey; - int newX, newY; - int hsx, hsy; - - /* Adjust xf86HWCursor messing about */ - - savex = x + pScrni->frameX0; - savey = y + pScrni->frameY0; - - switch (pGeode->rotation) { - default: - ErrorF("%s:%d invalid rotation %d\n", __func__, __LINE__, - pGeode->rotation); - case RR_Rotate_0: - newX = savex; - newY = savey; - hsx = 31; - hsy = 31; - break; - - case RR_Rotate_270: - newX = savey; - newY = pScrni->pScreen->width - savex; - hsx = 31; - hsy = 0; - break; - - case RR_Rotate_180: - newX = pScrni->pScreen->width - savex; - newY = pScrni->pScreen->height - savey; - hsx = 0; - hsy = 0; - break; - - case RR_Rotate_90: - newX = pScrni->pScreen->height - savey; - newY = savex; - hsx = 0; - hsy = 31; - break; - } - - newX -= pScrni->frameX0; - newY -= pScrni->frameY0; - - { - VG_PANNING_COORDINATES panning; - - vg_set_cursor_position(newX + hsx, newY + hsy, &panning); - } - - vg_set_cursor_enable(1); - - /* FIXME: Adjust for video panning? */ + HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED); } void @@ -197,24 +101,3 @@ LXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src) vg_set_mono_cursor_shape32(pGeode->CursorStartOffset, &andMask[0], &xorMask[0], 31, 31); } - -void -LXHideCursor(ScrnInfoPtr pScrni) -{ - vg_set_cursor_enable(0); -} - -void -LXShowCursor(ScrnInfoPtr pScrni) -{ - vg_set_cursor_enable(1); -} - -static Bool -LXUseHWCursor(ScreenPtr pScrn, CursorPtr pCurs) -{ - ScrnInfoPtr pScrni = XF86SCRNINFO(pScrn); - GeodeRec *pGeode = GEODEPTR(pScrni); - - return pGeode->HWCursor; -} |