diff options
author | Kevin Brace <kevinbrace@gmx.com> | 2020-04-01 07:55:24 -0700 |
---|---|---|
committer | Kevin Brace <kevinbrace@gmx.com> | 2020-04-01 08:00:00 -0700 |
commit | d3c0c8fbfb9d704b43b3bd3c88e6d6495a604e8f (patch) | |
tree | 212353c9e37db6299d5c45db49ba084caaff7fa1 | |
parent | a68c8319a22dc4fd79061c811001db92a1215a11 (diff) |
Fix for KMS mode CLE266 and KM400 chipsets HI (Hardware Icon) cursor
The HI cursor is still broken in UMS mode for CLE266 and KM400
chipsets.
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
-rw-r--r-- | src/via_driver.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/via_driver.c b/src/via_driver.c index d0adba5..34a6e47 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -1419,6 +1419,10 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL) VIAPtr pVia = VIAPTR(pScrn); unsigned int bppSize, alignedPitch; unsigned long alignment; + xf86CrtcConfigPtr xf86_config; + int cursorWidth, cursorHeight, flags; + int cursorSize; + int i; pScrn->displayWidth = pScrn->virtualX; @@ -1526,26 +1530,15 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL) miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); if (pVia->drmmode.hwcursor) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - int flags = (HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | - HARDWARE_CURSOR_TRUECOLOR_AT_8BPP); - int cursorSize, size, i = 0; - - switch (pVia->Chipset) { - case VIA_CLE266: - case VIA_KM400: - flags |= HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1; - size = 32; - cursorSize = ((size * size) >> 3) * 2; - alignment = cursorSize; - break; - default: - flags |= (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | HARDWARE_CURSOR_ARGB); - size = 64; - cursorSize = (size * size) << 2; - alignment = cursorSize; - break; - } + xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + + cursorWidth = cursorHeight = 64; + flags = HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | + HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | + HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | + HARDWARE_CURSOR_ARGB; + cursorSize = (cursorWidth * cursorHeight) * (32 / 8); + alignment = 1024; for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; @@ -1559,7 +1552,8 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL) TTM_PL_FLAG_VRAM); } - if (!xf86_cursors_init(pScreen, size, size, flags)) { + if (!xf86_cursors_init(pScreen, + cursorWidth, cursorHeight, flags)) { pVia->drmmode.hwcursor = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor initialization failed.\n"); |