| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ffb_accel_common.c,v 1.3 2016/08/22 08:28:32 mrg Exp $ */ | | 1 | /* $NetBSD: ffb_accel_common.c,v 1.4 2016/09/02 21:24:49 macallan Exp $ */ |
2 | /* | | 2 | /* |
3 | * Copyright (C) 1998,1999,2000 Jakub Jelinek (jakub@redhat.com) | | 3 | * Copyright (C) 1998,1999,2000 Jakub Jelinek (jakub@redhat.com) |
4 | * Copyright (C) 1998 Michal Rehacek (majkl@iname.com) | | 4 | * Copyright (C) 1998 Michal Rehacek (majkl@iname.com) |
5 | * Copyright (C) 1999,2000 David S. Miller (davem@redhat.com) | | 5 | * Copyright (C) 1999,2000 David S. Miller (davem@redhat.com) |
6 | * Copyright (C) 2015 Michael Lorenz (macallan@netbsd.org) | | 6 | * Copyright (C) 2015 Michael Lorenz (macallan@netbsd.org) |
7 | * | | 7 | * |
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy | | 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
9 | * of this software and associated documentation files (the "Software"), to deal | | 9 | * of this software and associated documentation files (the "Software"), to deal |
10 | * in the Software without restriction, including without limitation the rights | | 10 | * in the Software without restriction, including without limitation the rights |
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | | 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
12 | * copies of the Software, and to permit persons to whom the Software is | | 12 | * copies of the Software, and to permit persons to whom the Software is |
13 | * furnished to do so, subject to the following conditions: | | 13 | * furnished to do so, subject to the following conditions: |
14 | * | | 14 | * |
| @@ -33,26 +33,35 @@ | | | @@ -33,26 +33,35 @@ |
33 | #endif | | 33 | #endif |
34 | | | 34 | |
35 | #include "ffb_fifo.h" | | 35 | #include "ffb_fifo.h" |
36 | #include "ffb_rcache.h" | | 36 | #include "ffb_rcache.h" |
37 | #include "ffb.h" | | 37 | #include "ffb.h" |
38 | #include "ffb_regs.h" | | 38 | #include "ffb_regs.h" |
39 | | | 39 | |
40 | /* all driver need this */ | | 40 | /* all driver need this */ |
41 | #include "xf86.h" | | 41 | #include "xf86.h" |
42 | #include "xf86_OSproc.h" | | 42 | #include "xf86_OSproc.h" |
43 | #include "compiler.h" | | 43 | #include "compiler.h" |
44 | #include "exa.h" | | 44 | #include "exa.h" |
45 | | | 45 | |
| | | 46 | /* Indexed by ffb resolution enum. */ |
| | | 47 | struct fastfill_parms ffb_fastfill_parms[] = { |
| | | 48 | /* fsmall, psmall, ffh, ffw, pfh, pfw */ |
| | | 49 | { 0x00c0, 0x1400, 0x04, 0x08, 0x10, 0x50 }, /* Standard: 1280 x 1024 */ |
| | | 50 | { 0x0140, 0x2800, 0x04, 0x10, 0x10, 0xa0 }, /* High: 1920 x 1360 */ |
| | | 51 | { 0x0080, 0x0a00, 0x02, 0x08, 0x08, 0x50 }, /* Stereo: 960 x 580 */ |
| | | 52 | /*XXX*/ { 0x00c0, 0x0a00, 0x04, 0x08, 0x08, 0x50 }, /* Portrait: 1280 x 2048 XXX */ |
| | | 53 | }; |
| | | 54 | |
46 | void FFB_SetupTextureAttrs(FFBPtr pFfb) | | 55 | void FFB_SetupTextureAttrs(FFBPtr pFfb) |
47 | { | | 56 | { |
48 | ffb_fbcPtr ffb = pFfb->regs; | | 57 | ffb_fbcPtr ffb = pFfb->regs; |
49 | unsigned int ppc = FFB_PPC_APE_DISABLE | FFB_PPC_CS_VAR | FFB_PPC_XS_VAR; | | 58 | unsigned int ppc = FFB_PPC_APE_DISABLE | FFB_PPC_CS_VAR | FFB_PPC_XS_VAR; |
50 | unsigned int ppc_mask = FFB_PPC_APE_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK; | | 59 | unsigned int ppc_mask = FFB_PPC_APE_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK; |
51 | unsigned int rop = FFB_ROP_NEW | (FFB_ROP_NEW << 8); | | 60 | unsigned int rop = FFB_ROP_NEW | (FFB_ROP_NEW << 8); |
52 | unsigned int fbc = pFfb->fbc; | | 61 | unsigned int fbc = pFfb->fbc; |
53 | unsigned int wid = pFfb->wid; | | 62 | unsigned int wid = pFfb->wid; |
54 | | | 63 | |
55 | ppc |= FFB_PPC_ABE_ENABLE; | | 64 | ppc |= FFB_PPC_ABE_ENABLE; |
56 | ppc_mask |= FFB_PPC_ABE_MASK; | | 65 | ppc_mask |= FFB_PPC_ABE_MASK; |
57 | | | 66 | |
58 | if ((pFfb->ppc_cache & ppc_mask) != ppc || | | 67 | if ((pFfb->ppc_cache & ppc_mask) != ppc || |