Evaluate software cursor option inside R128PreInit

Since SWCursor option is referenced only once, it should be handled
inside R128PreInit callback function rather than R128ScreenInit
callback function.

Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
This commit is contained in:
Kevin Brace
2018-07-26 10:11:59 -07:00
parent 15d245de28
commit 4e3638c612
2 changed files with 9 additions and 1 deletions

View File

@@ -349,6 +349,7 @@ typedef struct {
int fifo_slots; /* Free slots in the FIFO (64 max) */
int pix24bpp; /* Depth of pixmap for 24bpp framebuffer */
Bool dac6bits; /* Use 6 bit DAC? */
Bool swCursor;
/* Computed values for Rage 128 */
int pitch;

View File

@@ -1345,6 +1345,8 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
#endif
#endif
info->swCursor = FALSE;
/* By default, don't do VGA IOs on ppc */
#if defined(__powerpc__) || defined(__sparc__) || !defined(WITH_VGAHW)
info->VGAAccess = FALSE;
@@ -1433,6 +1435,11 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
"Using framebuffer device\n");
}
if (xf86ReturnOptValBool(info->Options,
OPTION_SW_CURSOR, FALSE)) {
info->swCursor = TRUE;
}
/* Allocate an xf86CrtcConfig */
xf86CrtcConfigInit(pScrn, &R128CRTCResizeFuncs);
@@ -2082,7 +2089,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
/* Hardware cursor setup */
if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
if (!info->swCursor) {
if (R128CursorInit(pScreen)) {
int width, height;