summaryrefslogtreecommitdiff
path: root/hw/xfree86/exa
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2006-03-15 01:20:08 +0000
committerEric Anholt <anholt@freebsd.org>2006-03-15 01:20:08 +0000
commitc1601717d536419693b3ef6e8a3d69b9f2fdc2b3 (patch)
tree2d989707731d8e3b6aa7f8be234296dca6e320e4 /hw/xfree86/exa
parenta90cff266cc81993ed804fb320c1dbfe5e0d4787 (diff)
Add a new migration scheme, "always", which will move pixmaps to their
desired location always (unless they don't fit in FB, in which case they all get moved out for software rendering). The default remains as before, but can be controlled by the MigrationHeuristic xorg.conf option (which is intentionally not documented, as it may be short-lived). This is part of the exa-damagetrack work, which appears stable in testing with fakexa, unlike the work as a whole.
Diffstat (limited to 'hw/xfree86/exa')
-rw-r--r--hw/xfree86/exa/examodule.c43
1 files changed, 38 insertions, 5 deletions
diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c
index 8b48444f1..627bfd567 100644
--- a/hw/xfree86/exa/examodule.c
+++ b/hw/xfree86/exa/examodule.c
@@ -29,6 +29,8 @@
#include <xorg-config.h>
#endif
+#include <string.h>
+
#include "exa_priv.h"
#include "xf86str.h"
@@ -37,11 +39,21 @@
typedef struct _ExaXorgScreenPrivRec {
CloseScreenProcPtr SavedCloseScreen;
EnableDisableFBAccessProcPtr SavedEnableDisableFBAccess;
+ OptionInfoPtr options;
} ExaXorgScreenPrivRec, *ExaXorgScreenPrivPtr;
static int exaXorgServerGeneration;
static int exaXorgScreenPrivateIndex;
+typedef enum {
+ EXAOPT_MIGRATION_HEURISTIC,
+} EXAOpts;
+
+static const OptionInfoRec EXAOptions[] = {
+ { EXAOPT_MIGRATION_HEURISTIC, "MigrationHeuristic", OPTV_ANYSTR, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+};
+
static Bool
exaXorgCloseScreen (int i, ScreenPtr pScreen)
{
@@ -53,6 +65,7 @@ exaXorgCloseScreen (int i, ScreenPtr pScreen)
pScrn->EnableDisableFBAccess = pScreenPriv->SavedEnableDisableFBAccess;
+ xfree (pScreenPriv->options);
xfree (pScreenPriv);
return pScreen->CloseScreen (i, pScreen);
@@ -82,6 +95,7 @@ exaXorgEnableDisableFBAccess (int index, Bool enable)
void
exaDDXDriverInit(ScreenPtr pScreen)
{
+ ExaScreenPriv(pScreen);
/* Do NOT use XF86SCRNINFO macro here!! */
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
ExaXorgScreenPrivPtr pScreenPriv;
@@ -95,6 +109,30 @@ exaDDXDriverInit(ScreenPtr pScreen)
if (pScreenPriv == NULL)
return;
+ pScreenPriv->options = xnfalloc (sizeof(EXAOptions));
+ memcpy(pScreenPriv->options, EXAOptions, sizeof(EXAOptions));
+ xf86ProcessOptions (pScrn->scrnIndex, pScrn->options, pScreenPriv->options);
+
+ if ((pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) &&
+ pExaScr->info->offScreenBase < pExaScr->info->memorySize)
+ {
+ char *heuristicName;
+
+ heuristicName = xf86GetOptValString (pScreenPriv->options,
+ EXAOPT_MIGRATION_HEURISTIC);
+ if (heuristicName != NULL) {
+ if (strcmp(heuristicName, "greedy") == 0)
+ pExaScr->migration = ExaMigrationGreedy;
+ else if (strcmp(heuristicName, "always") == 0)
+ pExaScr->migration = ExaMigrationAlways;
+ else {
+ xf86DrvMsg (pScreen->myNum, X_WARNING,
+ "EXA: unknown migration heuristic %s\n",
+ heuristicName);
+ }
+ }
+ }
+
pScreen->devPrivates[exaXorgScreenPrivateIndex].ptr = pScreenPriv;
pScreenPriv->SavedEnableDisableFBAccess = pScrn->EnableDisableFBAccess;
@@ -107,11 +145,6 @@ exaDDXDriverInit(ScreenPtr pScreen)
static MODULESETUPPROTO(exaSetup);
-static const OptionInfoRec EXAOptions[] = {
- { -1, NULL,
- OPTV_NONE, {0}, FALSE }
-};
-
/*ARGSUSED*/
static const OptionInfoRec *
EXAAvailableOptions(void *unused)